Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: Source/devtools/front_end/sdk/DOMModel.js

Issue 397303002: DevTools: [Elements] Implement shortcut-based node cut-copy-pasting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reset clipboard if node on it is removed Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 }, 449 },
450 450
451 /** 451 /**
452 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback 452 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
453 */ 453 */
454 removeNode: function(callback) 454 removeNode: function(callback)
455 { 455 {
456 this._agent.removeNode(this.id, this._domModel._markRevision(this, callb ack)); 456 this._agent.removeNode(this.id, this._domModel._markRevision(this, callb ack));
457 }, 457 },
458 458
459 copyNode: function() 459 /**
460 * @param {function(?string)=} callback
461 */
462 copyNode: function(callback)
460 { 463 {
461 function copy(error, text) 464 function copy(error, text)
462 { 465 {
463 if (!error) 466 if (!error)
464 InspectorFrontendHost.copyText(text); 467 InspectorFrontendHost.copyText(text);
468 if (callback)
469 callback(error ? null : text);
465 } 470 }
466 this._agent.getOuterHTML(this.id, copy); 471 this._agent.getOuterHTML(this.id, copy);
467 }, 472 },
468 473
469 /** 474 /**
470 * @param {string} objectGroupId 475 * @param {string} objectGroupId
471 * @param {function(?Array.<!WebInspector.DOMModel.EventListener>)} callback 476 * @param {function(?Array.<!WebInspector.DOMModel.EventListener>)} callback
472 */ 477 */
473 eventListeners: function(objectGroupId, callback) 478 eventListeners: function(objectGroupId, callback)
474 { 479 {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 this._attributes.remove(attr); 707 this._attributes.remove(attr);
703 delete this._attributesMap[name]; 708 delete this._attributesMap[name];
704 } 709 }
705 }, 710 },
706 711
707 /** 712 /**
708 * @param {!WebInspector.DOMNode} targetNode 713 * @param {!WebInspector.DOMNode} targetNode
709 * @param {?WebInspector.DOMNode} anchorNode 714 * @param {?WebInspector.DOMNode} anchorNode
710 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback 715 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
711 */ 716 */
717 copyTo: function(targetNode, anchorNode, callback)
718 {
719 this._agent.copyTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback));
720 },
721
722 /**
723 * @param {!WebInspector.DOMNode} targetNode
724 * @param {?WebInspector.DOMNode} anchorNode
725 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
726 */
712 moveTo: function(targetNode, anchorNode, callback) 727 moveTo: function(targetNode, anchorNode, callback)
713 { 728 {
714 this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback)); 729 this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback));
715 }, 730 },
716 731
717 /** 732 /**
718 * @return {boolean} 733 * @return {boolean}
719 */ 734 */
720 isXMLNode: function() 735 isXMLNode: function()
721 { 736 {
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 * @param {boolean} inspectUAShadowDOM 1942 * @param {boolean} inspectUAShadowDOM
1928 * @param {!DOMAgent.HighlightConfig} config 1943 * @param {!DOMAgent.HighlightConfig} config
1929 * @param {function(?Protocol.Error)=} callback 1944 * @param {function(?Protocol.Error)=} callback
1930 */ 1945 */
1931 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) 1946 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k)
1932 { 1947 {
1933 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); 1948 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled);
1934 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback); 1949 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback);
1935 } 1950 }
1936 } 1951 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698