Search Results

Search found 2852 results on 115 pages for 'thermal paste'.

Page 15/115 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • How to copy data from another workbook and paste onto related group rows?

    - by leighla
    Hi there, How do I copy data from all the workbooks in the folder onto workbook 1 into it's corresponding row groups? The attached images shows the sample worksheet is the file I want to paste data into (main template) and wb2 sample is a sample of one of the worksheets in the folder that I want to copy data from. As you can see, the workbook 2 does not include all of the tasks. So I need to copy all of the data from workbook 2 and paste it on the corresponding row group (col A) on original workbook. I then need to do this for all workbooks in the folder. Any help would be most appreciated!

    Read the article

  • how to block select, move, copy, paste in vi?

    - by gojira
    I am trying to migrate from Notepad++ to vi. In N++, I constantly rely on block edit (or "column mode"), as it is a great increase in productivity: I can select a rectangular area of text by pressing ALT before marking with the mouse, and copy, move, paste the rectangular area anywhere. Also, it is possible to drag the cursor vertically so that I can type simulatenously on several subsequent lines at the same time. Is there any similar functionality for vi? If yes, how can I do that?

    Read the article

  • Sweave can't see a vector if run from a function ?

    - by PaulHurleyuk
    I have a function that sets a vector to a string, copies a Sweave document with a new name and then runs that Sweave. Inside the Sweave document I want to use the vector I set in the function, but it doesn't seem to see it. (Edit: I changed this function to use tempdir(() as suggested by Dirk) I created a sweave file test_sweave.rnw; % \documentclass[a4paper]{article} \usepackage[OT1]{fontenc} \usepackage{Sweave} \begin{document} \title{Test Sweave Document} \author{gb02413} \maketitle <<>>= ls() Sys.time() print(paste("The chosen study was ",chstud,sep="")) @ \end{document} and I have this function; onOK <- function(){ chstud<-"test" message(paste("Chosen Study is ",chstud,sep="")) newfile<-paste(chstud,"_report",sep="") mypath<-paste(tempdir(),"\\",sep="") setwd(mypath) message(paste("Copying test_sweave.Rnw to ",paste(mypath,newfile,".Rnw",sep=""),sep="")) file.copy("c:\\local\\test_sweave.Rnw", paste(mypath,newfile,".Rnw",sep=""), overwrite=TRUE) Sweave(paste(mypath,newfile,".Rnw",sep="")) require(tools) texi2dvi(file = paste(mypath,newfile,".tex",sep=""), pdf = TRUE) } If I run the code from the function directly, the resulting file has this output for ls(); > ls() [1] "chstud" "mypath" "newfile" "onOK" However If I call onOK() I get this output; > ls() [1] "onOK" and the print(...chstud...)) function generates an error. I suspect this is an environment problem, but I assumed because the call to Sweave occurs within the onOK function, it would be in the same enviroment, and would see all the objects created within the function. How can I get the Sweave process to see the chstud vector ? Thanks Paul.

    Read the article

  • How can I redirect the contents of a file to the pastebinit command? [duplicate]

    - by Tim
    This question already has an answer here: How to submit a file to paste.ubuntu.com without graphical interface? 2 answers Whenever I was to store something to show someone here, I run command-with-output | pastebinit. That returns the link to the paste online. For example: echo timtjtim | pastebinit gave me the link paste.ubuntu.com/8010000 Which I can share. How can I do this with a file - for example a log file. Surely I don't have to open - > copy all - > open paste.ubuntu.com -> paste it?

    Read the article

  • Why does Cut/Paste of form components sometimes stop working in Delphi 2007 IDE?

    - by robsoft
    This is driving me crazy. I'm not going to take it anymore. I'm going to ask, even at the risk of eternal public humiliation! (If it's something really obvious or that I've done to the system myself). For reasons I've never quite had the patience to work out, every so often the form I'm working on in Delphi 2007's visual form editor goes 'pseudo-read-only'; I can add new components to the form, I can move/resize existing ones (and change any properties in the Object Inspector), and I can select a component and 'copy' it to the clipboard. But I'm completely unable to cut a component from the form, or paste a new copy down. I don't believe it's to do with the 'Lock Controls' Edit menu option as I can toggle this on or off and it has the effect it's supposed to - this disappearance of Cut & Paste happens on the right-click context menu, from the keyboard and from the main Edit menu - it's as if the form has become read only to thing to do with the clipboard. If I close the form in the IDE and then reopen it, everything starts working fine again (just as D1, D3, D5 and D7 always did for me, previously). I'm not going mad, as I'm sure I read something about why this happens on a newsgroup once and it's caught me out from time to time many many times in the last few months, but I've failed to find the newsgroup reference this evening and I've decided that, as more and more Delphi users seem to be making use of StackOverflow, it was worth asking here. Help - when I'm doing lots of form-work it drives me absolutely mad!

    Read the article

  • Excel macro, to copy and paste a cell value based on another cell value?

    - by Keziah Dorman
    Hi I shall try to explain clearly what I need to be able to do, here goes: I have an Excel spread sheet 1 with postcodes in column a and a number in column b. I need to create a macro/formula so that it will see the number (i.e 4) and copy and paste the postcode that number of times into sheet 2 column a underneath each other. I need to do this for the next row down etc until it comes to a blank. Sheet 1 A,B DE43PP,3 DE43PQ,8 Sheet 2 A,B DE43PP, DE43PP, DE43PP, Thanks

    Read the article

  • How to paste in a new line with vim?

    - by static_rtti
    I often have to paste some stuff on a new line in vim. What I usually do is: o<Esc>p Which inserts a new line and puts me in insertion mode, than quits insertion mode, and finally pastes. Three keystrokes. Not very efficient. Any better ideas?

    Read the article

  • Absolute reRendering using RichFaces

    - by wheelie
    Hey there, I am implementing copy/paste functionality for a complex object tree, this means you can copy an object and paste it where the object type is the same. Therefore I need to reRender the <a4j:commandLink>-s which are performing the paste action (so it will show on the GUI or not). Simplified example: Problem is that copy links are deep in the tree. How is it possible to reRender on a higher level in the component tree? (very)Simplified example: ... <h:form id="form1"> ... <a4j:commandLink value="Copy" reRender=":paste1, :paste2, :paste3" /> <a4j:commandLink id="paste1" value="Paste" rendered="#{myBean.myHashMap.key}" /> <a4j:outputPanel> <a4j:region renderRegionOnly="true"> <a4j:commandLink value="Copy" reRender=":paste1, :paste2, :paste3" /> <a4j:commandLink id="paste2" value="Paste" rendered="#{myBean.myHashMap.key}" /> </a4j:region> <a4j:outputPanel> <a4j:region renderRegionOnly="true"> <a4j:commandLink value="Copy" reRender=":paste1, :paste2, :paste3" /> <a4j:commandLink id="paste3" value="Paste" rendered="#{myBean.myHashMap.key}" /> </a4j:region> </a4j:outputPanel> </a4j:outputPanel> ... </h:form> Something like that. In practise this differs in that a rich:tree is displayed. Also, there can be multiple instances of the same paste link: object:0::paste3, object:1::paste3. private final String pasteIDs = ":xxPaste, ... , :xyPaste"; According to the RichFaces reference, putting the separator to the beginning of the ID means it is an "absolute" search expression, however this way i get the same result: only the 'local' paste link gets rerendered, the others not. Every copy-paste link pair is encapsulated in <a4j:region renderRegionOnly="true">, because it is necessary for other components to restrict the reRender to that region. Could this be blocking the reRender I want to make? Also I want to rerender exactly those paste links, so no other rerender action is triggered. Hope it is clear what i want to achieve. Any help would be appreciated! Daniel

    Read the article

  • How To Remove Hyperlinks from Microsoft Word Documents

    - by Mysticgeek
    Sometimes when you copy text from a webpage and paste it into Word, it can be annoying when the hyperlinks transfer with it. Today we take a look at how to easily remove the hyperlinks if you don’t want them in the document. Here we will cover a few different ways you can remove hyperlinks from emails or webpage data that you enter into a Word document using Paste Special and Keyboard Shortcuts. Remove Hyperlinks in Word Using Paste Special In Word 2010 we copied part of an article from How-To Geek, as you can see the hyperlinks were copied into the document as well. To remove the hyperlinks right-click on the document and you’ll see three icons under Paste Options. We want to select the third one to the right which is Keep Text Only…the text in in the document changes so you can get a preview of how it will look. After selecting Keep Text Only, you can see the hyperlinks have been removed. However, you’ll need to change the fonts and other layouts if you’re not happy with the default of Calibri. In Office 2007 under the Home tab click the dropdown menu under Paste and select Paste Special. In the Paste Special screen select Unformatted Text then click OK. In Office 2003 copy the text into the document, hover your mouse over the clipboard, click the dropdown menu, then select Keep Text Only. Keyboard Ninja Style If you’re a Keyboard Ninja, an easy way to remove all hyperlinks is to use “Ctrl+A” to select everything, then use the key combination “Ctrl+Shift+F9”…We tested this key combination and it works in Word 2003-2010. This will remove all of the hyperlinks and keep the original format of the text. Conclusion There are several different ways to get rid of hyperlinks in text pasted into Word documents. The method you use will depend on your preference and the version of Word you’re using…but the “Ctrl+Shift+F9” keyboard shortcut works in all versions of Word and might be the easiest way. If you always want just text in Word 2007, you can disable automatically disable them. If you have a different method you use to remove hyperlinks from Word documents, leave a comment and let us know! Similar Articles Productive Geek Tips Preview Documents Without Opening Them In Word 2007Embed True Type Fonts in Word and PowerPoint 2007 DocumentsAdd Background Color To Word 2007 DocumentsUse Image Placeholders to Display Documents Faster in WordHow To Make Sure Word Prints Document Backgrounds TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Gadfly is a cool Twitter/Silverlight app Enable DreamScene in Windows 7 Microsoft’s “How Do I ?” Videos Home Networks – How do they look like & the problems they cause Check Your IMAP Mail Offline In Thunderbird Follow Finder Finds You Twitter Users To Follow

    Read the article

  • How to copy from C# control and paste link into excel.

    - by Steve H.
    I have an application that I want to link to excel. I have no preference which control is used as long as I can copy the data or control, and paste link into excel. When the data changes in my application, I want the cell to change in excel. I have a client that claims it is possible and he has seen it, but has no proof and may be confused. I have searched the internet and have come up with a number of half-solutions, and people who want the opposite of what I want. Does anyone know the full solution?

    Read the article

  • Emacs with CEDET changes copy/paste to include trailing spaces?

    - by Paul D.
    I just started trying out CEDET today, which I really like, but it seems to do something completely worthless with respect to copying/pasting. If I highlight some stuff and copy it, when it gets pasted back the newlines are eliminated and there is just a ton of trailing whitespace on each line. This is really worthless. All I have in my .emacs right now for CEDET is the following: (load-file "~/.emacs.d/cedet-1.0pre7/common/cedet.el") (require 'semantic-ia) (require 'semantic-gcc) (semantic-load-enable-code-helpers) Does anybody know how to turn this off? I can't find anything about this except that the CEDET main page says it has "magic copy & paste".

    Read the article

  • CMD/ADB - Autorun script to search, copy, and paste a file from android system to flash drive

    - by Outride
    I've looked around and can't find anything that answers my question. This is my first question, so any tips or thoughts are welcome, as well as an answer :p As explained in title, i want to create a script that launches, finds a file on android phone, copies it, and pastes it to a flash drive. As of right now, it's a mix of multiple tutorials, trial and error, and I'm at a point of giving up. As of right now, I have a flash drive, loaded with three scripts. As follows: Bold = name of file file.bat @echo off :: variables /min SET odrive=%odrive:~0,2% set backupcmd=xcopy /s /c /d /e /h /i /r /y echo off %backupcmd% "C:\Users\Outride\Desktop\kikDatabase.db" "%drive%\all" @echo off cls invisible.vbs CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False launch.bat wscript.exe \invisible.vbs file.bat So far, I had to use android commander, manually go through the directory, find /data/data/kik.android/databases and then copy kikDatabase.db to my desktop. Then run this scrip. Yes i'm trying to pull the database to copy all my email contacts. I use launch.bat, which then makes file.bat invisible due to the invisible.vbs script. What would i need to do now to have the file searched for and copied to the flashdrive? Thanks in advance, i'll be glad to answer any questions if theres any :p just remember that i'm not exactly a tech expert haha EDIT* Cleared junk of prior edits. New - I now have a .bat script to recognize what drive the usb is on, and launch py_cmd (adb shell) This is the current script. pull.bat @echo off :: variables SET odrive=%odrive:~0,2% set launching=start "%drive%\Minimal ADB and Fastboot\py_cmd" echo off %launching% so how could I make it for the .bat or a new script, to type the following "adb pull /data/data/kik.android/databases/ %drive%\All\Database" into the adb terminal? please help! I've been racking my brain over this all night :3

    Read the article

  • Writing Macros to find a specific cell and paste the value from a control cell into it

    - by G-Edinburgh
    I am having some issues writing a Macro to do the following. I have a very long list of rooms with two columns one containing the room number i.e. B-CL102 and the other containing a varying integer.I am looking to create a new column that will contain another different integer for each of the rooms. Is there any way to write a Macro so that I can use two control cells at the top of the sheet, type the room number into one and the integer matching that room into another, then run the Macro and it will automatically populate the correct cell. Then I can change the two values in the control cells and run the Macro again and so on. Thanks for your help, I have a very minimal amount of experience with Macros essentially just the basics. Thanks G

    Read the article

  • Windows Phone 7 Developer Tools - January 2011 Update

    - by Nikita Polyakov
    Long time no talk? So to make up for it, here is something very new – update to WP7 Dev Tools! The Windows Phone 7 Developer Tools January 2011 Update provides bits that you would install on TOP of the current WP7 Dev tools on your machine. If you are just installing the tools for the first time, this update replaces previously released October patch. In fact, it is no longer available as this January 2011 update replaces the patch entirely. What is in this update? TextBox support for Copy&Paste Updated Emulator Image that contains Copy&Paste for your testing There have been performance tweaks for the OS Minor Bugs and Fixes How does it Work? The Copy&Paste extends a existing TextBox control to have this new functionality, There is no current API access to the Clipboard or support for other controls that are not based on TextBox. If I have/Do I need to: A current application in the marketplace/No action is required Have an application that contains a TextBox in a Pivot or Panorama control surface/Text your application in provided emulator Recommendation is to move TextBox controls from directly top of controls that listen to Gesture movement to their own pop-off screens or entire pages as this might interfear with select behavior for Copy&Paste Have controls that do no inherit from TextBox/Such controls will not get new Copy&Paste behavior Note: The update materials, FAQ and Q&A do not answer WHEN the update for the OS will be sent to the phones.  Also to note - this update does NOT update your developer phone to enable Copy&Paste or any other features. Windows Phone 7 Training Kit February Update Windows Phone Training Kit has also been updated – you can grab a fresh copy here.   Where to I find more good information, documentation and training? This very awesome blog post from the Windows Phone Developer Blog - Windows Phone 7 Documentation Landscape. Official Blog Post on the Update is here. Happy coding! -Nikita   PS: I am well aware that it is Feb 4th and not January :) If you were disappointed at CES that Microsoft said nothing at all about future of WP7, don’t forget that MWC 2011 is Feb 14th – I am going to be listening for Windows Phone announcements then, as that is where the announcements were made about Windows Phone 7.

    Read the article

  • JsTree v1.0 - How to manipulate effectively the data from the backend to render the trees and operate correctly?

    - by Jean Paul
    Backend info: PHP 5 / MySQL URL: http://github.com/downloads/vakata/jstree/jstree_pre1.0_fix_1.zip Table structure for table discussions_tree -- CREATE TABLE IF NOT EXISTS `discussions_tree` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) NOT NULL DEFAULT '0', `user_id` int(11) NOT NULL DEFAULT '0', `label` varchar(16) DEFAULT NULL, `position` bigint(20) unsigned NOT NULL DEFAULT '0', `left` bigint(20) unsigned NOT NULL DEFAULT '0', `right` bigint(20) unsigned NOT NULL DEFAULT '0', `level` bigint(20) unsigned NOT NULL DEFAULT '0', `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `h_label` varchar(16) NOT NULL DEFAULT '', `fulllabel` varchar(255) DEFAULT NULL, UNIQUE KEY `uidx_3` (`id`), KEY `idx_1` (`user_id`), KEY `idx_2` (`parent_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; /*The first element should in my understanding not even be shown*/ INSERT INTO `discussions_tree` (`id`, `parent_id`, `user_id`, `label`, `position`, `left`, `right`, `level`, `type`, `h_label`, `fulllabel`) VALUES (0, 0, 0, 'Contacts', 0, 1, 1, 0, NULL, '', NULL); INSERT INTO `discussions_tree` (`id`, `parent_id`, `user_id`, `label`, `position`, `left`, `right`, `level`, `type`, `h_label`, `fulllabel`) VALUES (1, 0, 0, 'How to Tag', 1, 2, 2, 0, 'drive', '', NULL); Front End : I've simplified the logic, it has 6 trees actually inside of a panel and that works fine $array = array("Discussions"); $id_arr = array("d"); $nid = 0; foreach ($array as $k=> $value) { $nid++; ?> <li id="<?=$value?>" class="label"> <a href='#<?=$value?>'><span> <?=$value?> </span></a> <div class="sub-menu" style="height:auto; min-height:120px; background-color:#E5E5E5" > <div class="menu" id="menu_<?=$id_arr[$k]?>" style="position:relative; margin-left:56%"> <img src="./js/jsTree/create.png" alt="" id="create" title="Create" > <img src="./js/jsTree/rename.png" alt="" id="rename" title="Rename" > <img src="./js/jsTree/remove.png" alt="" id="remove" title="Delete"> <img src="./js/jsTree/cut.png" alt="" id="cut" title="Cut" > <img src="./js/jsTree/copy.png" alt="" id="copy" title="Copy"> <img src="./js/jsTree/paste.png" alt="" id="paste" title="Paste"> </div> <div id="<?=$id_arr[$k]?>" class="jstree_container"></div> </div> </li> <!-- JavaScript neccessary for this tree : <?=$value?> --> <script type="text/javascript" > jQuery(function ($) { $("#<?=$id_arr[$k]?>").jstree({ // List of active plugins used "plugins" : [ "themes", "json_data", "ui", "crrm" , "hotkeys" , "types" , "dnd", "contextmenu"], // "ui" :{ "initially_select" : ["#node_"+ $nid ] } , "crrm": { "move": { "always_copy": "multitree" }, "input_width_limit":128 }, "core":{ "strings":{ "new_node" : "New Tag" }}, "themes": {"theme": "classic"}, "json_data" : { "ajax" : { "url" : "./js/jsTree/server-<?=$id_arr[$k]?>.php", "data" : function (n) { // the result is fed to the AJAX request `data` option return { "operation" : "get_children", "id" : n.attr ? n.attr("id").replace("node_","") : 1, "state" : "", "user_id": <?=$uid?> }; } } } , "types" : { "max_depth" : -1, "max_children" : -1, "types" : { // The default type "default" : { "hover_node":true, "valid_children" : [ "default" ], }, // The `drive` nodes "drive" : { // can have files and folders inside, but NOT other `drive` nodes "valid_children" : [ "default", "folder" ], "hover_node":true, "icon" : { "image" : "./js/jsTree/root.png" }, // those prevent the functions with the same name to be used on `drive` nodes.. internally the `before` event is used "start_drag" : false, "move_node" : false, "remove_node" : false } } }, "contextmenu" : { "items" : customMenu , "select_node": true} }) //Hover function binded to jstree .bind("hover_node.jstree", function (e, data) { $('ul li[rel="drive"], ul li[rel="default"], ul li[rel=""]').each(function(i) { $(this).find("a").attr('href', $(this).attr("id")+".php" ); }) }) //Create function binded to jstree .bind("create.jstree", function (e, data) { $.post( "./js/jsTree/server-<?=$id_arr[$k]?>.php", { "operation" : "create_node", "id" : data.rslt.parent.attr("id").replace("node_",""), "position" : data.rslt.position, "label" : data.rslt.name, "href" : data.rslt.obj.attr("href"), "type" : data.rslt.obj.attr("rel"), "user_id": <?=$uid?> }, function (r) { if(r.status) { $(data.rslt.obj).attr("id", "node_" + r.id); } else { $.jstree.rollback(data.rlbk); } } ); }) //Remove operation .bind("remove.jstree", function (e, data) { data.rslt.obj.each(function () { $.ajax({ async : false, type: 'POST', url: "./js/jsTree/server-<?=$id_arr[$k]?>.php", data : { "operation" : "remove_node", "id" : this.id.replace("node_",""), "user_id": <?=$uid?> }, success : function (r) { if(!r.status) { data.inst.refresh(); } } }); }); }) //Rename operation .bind("rename.jstree", function (e, data) { data.rslt.obj.each(function () { $.ajax({ async : true, type: 'POST', url: "./js/jsTree/server-<?=$id_arr[$k]?>.php", data : { "operation" : "rename_node", "id" : this.id.replace("node_",""), "label" : data.rslt.new_name, "user_id": <?=$uid?> }, success : function (r) { if(!r.status) { data.inst.refresh(); } } }); }); }) //Move operation .bind("move_node.jstree", function (e, data) { data.rslt.o.each(function (i) { $.ajax({ async : false, type: 'POST', url: "./js/jsTree/server-<?=$id_arr[$k]?>.php", data : { "operation" : "move_node", "id" : $(this).attr("id").replace("node_",""), "ref" : data.rslt.cr === -1 ? 1 : data.rslt.np.attr("id").replace("node_",""), "position" : data.rslt.cp + i, "label" : data.rslt.name, "copy" : data.rslt.cy ? 1 : 0, "user_id": <?=$uid?> }, success : function (r) { if(!r.status) { $.jstree.rollback(data.rlbk); } else { $(data.rslt.oc).attr("id", "node_" + r.id); if(data.rslt.cy && $(data.rslt.oc).children("UL").length) { data.inst.refresh(data.inst._get_parent(data.rslt.oc)); } } } }); }); }); // This is for the context menu to bind with operations on the right clicked node function customMenu(node) { // The default set of all items var control; var items = { createItem: { label: "Create", action: function (node) { return {createItem: this.create(node) }; } }, renameItem: { label: "Rename", action: function (node) { return {renameItem: this.rename(node) }; } }, deleteItem: { label: "Delete", action: function (node) { return {deleteItem: this.remove(node) }; }, "separator_after": true }, copyItem: { label: "Copy", action: function (node) { $(node).addClass("copy"); return {copyItem: this.copy(node) }; } }, cutItem: { label: "Cut", action: function (node) { $(node).addClass("cut"); return {cutItem: this.cut(node) }; } }, pasteItem: { label: "Paste", action: function (node) { $(node).addClass("paste"); return {pasteItem: this.paste(node) }; } } }; // We go over all the selected items as the context menu only takes action on the one that is right clicked $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element) { if ( $(element).attr("id") != $(node).attr("id") ) { // Let's deselect all nodes that are unrelated to the context menu -- selected but are not the one right clicked $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); } }); //if any previous click has the class for copy or cut $("#<?=$id_arr[$k]?>").find("li").each(function(index,element) { if ($(element) != $(node) ) { if( $(element).hasClass("copy") || $(element).hasClass("cut") ) control=1; } else if( $(node).hasClass("cut") || $(node).hasClass("copy")) { control=0; } }); //only remove the class for cut or copy if the current operation is to paste if($(node).hasClass("paste") ) { control=0; // Let's loop through all elements and try to find if the paste operation was done already $("#<?=$id_arr[$k]?>").find("li").each(function(index,element) { if( $(element).hasClass("copy") ) $(this).removeClass("copy"); if ( $(element).hasClass("cut") ) $(this).removeClass("cut"); if ( $(element).hasClass("paste") ) $(this).removeClass("paste"); }); } switch (control) { //Remove the paste item from the context menu case 0: switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; delete items.pasteItem; break; case "default": delete items.pasteItem; break; } break; //Remove the paste item from the context menu only on the node that has either copy or cut added class case 1: if( $(node).hasClass("cut") || $(node).hasClass("copy") ) { switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; delete items.pasteItem; break; case "default": delete items.pasteItem; break; } } else //Re-enable it on the clicked node that does not have the cut or copy class { switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; break; } } break; //initial state don't show the paste option on any node default: switch ($(node).attr("rel")) { case "drive": delete items.renameItem; delete items.deleteItem; delete items.cutItem; delete items.copyItem; delete items.pasteItem; break; case "default": delete items.pasteItem; break; } break; } return items; } $("#menu_<?=$id_arr[$k]?> img").hover( function () { $(this).css({'cursor':'pointer','outline':'1px double teal'}) }, function () { $(this).css({'cursor':'none','outline':'1px groove transparent'}) } ); $("#menu_<?=$id_arr[$k]?> img").click(function () { switch(this.id) { //Create only the first element case "create": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("create", '#'+$(element).attr("id"), null, /*{attr : {href: '#' }}*/null ,null, false); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //REMOVE case "remove": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ //only execute if the current node is not the first one (drive) if( $(element).attr("id") != $("div.jstree > ul > li").first().attr("id") ) { $("#<?=$id_arr[$k]?>").jstree("remove",'#'+$(element).attr("id")); } else $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //RENAME NODE only one selection case "rename": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ if( $(element).attr("id") != $("div.jstree > ul > li").first().attr("id") ) { switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("rename", '#'+$(element).attr("id") ); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } } else $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //Cut case "cut": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("cut", '#'+$(element).attr("id")); $.facebox('<p class=\'p_inner teal\'>Operation "Cut" successfully done.<p class=\'p_inner teal bold\'>Where to place it?'); setTimeout(function(){ $.facebox.close(); $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id")); }, 2000); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; //Copy case "copy": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("copy", '#'+$(element).attr("id")); $.facebox('<p class=\'p_inner teal\'>Operation "Copy": Successfully done.<p class=\'p_inner teal bold\'>Where to place it?'); setTimeout(function(){ $.facebox.close(); $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); }, 2000); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; case "paste": if ( $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).length ) { $.jstree._reference("#<?=$id_arr[$k]?>").get_selected(false, true).each(function(index,element){ switch(index) { case 0: $("#<?=$id_arr[$k]?>").jstree("paste", '#'+$(element).attr("id")); break; default: $("#<?=$id_arr[$k]?>").jstree("deselect_node", '#'+$(element).attr("id") ); break; } }); } else { $.facebox('<p class=\'p_inner error bold\'>A selection needs to be made to work with this operation'); setTimeout(function(){ $.facebox.close(); }, 2000); } break; } }); <? } ?> server.php $path='../../../..'; require_once "$path/phpfoo/dbif.class"; require_once "$path/global.inc"; // Database config & class $db_config = array( "servername"=> $dbHost, "username" => $dbUser, "password" => $dbPW, "database" => $dbName ); if(extension_loaded("mysqli")) require_once("_inc/class._database_i.php"); else require_once("_inc/class._database.php"); //Tree class require_once("_inc/class.ctree.php"); $dbLink = new dbif(); $dbErr = $dbLink->connect($dbName,$dbUser,$dbPW,$dbHost); $jstree = new json_tree(); if(isset($_GET["reconstruct"])) { $jstree->_reconstruct(); die(); } if(isset($_GET["analyze"])) { echo $jstree->_analyze(); die(); } $table = '`discussions_tree`'; if($_REQUEST["operation"] && strpos($_REQUEST["operation"], "_") !== 0 && method_exists($jstree, $_REQUEST["operation"])) { foreach($_REQUEST as $k => $v) { switch($k) { case 'user_id': //We are passing the user_id from the $_SESSION on each request and trying to pick up the min and max value from the table that matches the 'user_id' $sql = "SELECT max(`right`) , min(`left`) FROM $table WHERE `user_id`=$v"; //If the select does not return any value then just let it be :P if (!list($right, $left)=$dbLink->getRow($sql)) { $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v WHERE `id` = 1 AND `parent_id` = 0"); $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v WHERE `parent_id` = 1 AND `label`='How to Tag' "); } else { $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v, `right`=$right+2 WHERE `id` = 1 AND `parent_id` = 0"); $sql = $dbLink->dbSubmit("UPDATE $table SET `user_id`=$v, `left`=$left+1, `right`=$right+1 WHERE `parent_id` = 1 AND `label`='How to Tag' "); } break; } } header("HTTP/1.0 200 OK"); header('Content-type: application/json; charset=utf-8'); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Pragma: no-cache"); echo $jstree->{$_REQUEST["operation"]}($_REQUEST); die(); } header("HTTP/1.0 404 Not Found"); ?> The problem: DND *(Drag and Drop) works, Delete works, Create works, Rename works, but Copy, Cut and Paste don't work

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >