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

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: Forbid moving node into self or descendant Created 6 years, 5 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
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 var attr = this._attributesMap[name]; 705 var attr = this._attributesMap[name];
701 if (attr) { 706 if (attr) {
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
715 * @param {boolean} deep
716 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
717 */
718 copyTo: function(targetNode, anchorNode, deep, callback)
719 {
720 this._agent.copyTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, deep, this._domModel._markRevision(this, callback));
721 },
722
723 /**
724 * @param {!WebInspector.DOMNode} targetNode
725 * @param {?WebInspector.DOMNode} anchorNode
710 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback 726 * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
711 */ 727 */
712 moveTo: function(targetNode, anchorNode, callback) 728 moveTo: function(targetNode, anchorNode, callback)
713 { 729 {
714 this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback)); 730 this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback));
715 }, 731 },
716 732
717 /** 733 /**
718 * @return {boolean} 734 * @return {boolean}
719 */ 735 */
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 * @param {boolean} inspectUAShadowDOM 1943 * @param {boolean} inspectUAShadowDOM
1928 * @param {!DOMAgent.HighlightConfig} config 1944 * @param {!DOMAgent.HighlightConfig} config
1929 * @param {function(?Protocol.Error)=} callback 1945 * @param {function(?Protocol.Error)=} callback
1930 */ 1946 */
1931 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k) 1947 setInspectModeEnabled: function(enabled, inspectUAShadowDOM, config, callbac k)
1932 { 1948 {
1933 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled); 1949 WebInspector.overridesSupport.setTouchEmulationSuspended(enabled);
1934 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback); 1950 this._agent.setInspectModeEnabled(enabled, inspectUAShadowDOM, config, c allback);
1935 } 1951 }
1936 } 1952 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698