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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/DOMModel.js
diff --git a/Source/devtools/front_end/sdk/DOMModel.js b/Source/devtools/front_end/sdk/DOMModel.js
index 66253b66f01e67fc67155c7d7a47013946ff1eb1..a54e229e04e485420a379bc99cf28ef4567677f9 100644
--- a/Source/devtools/front_end/sdk/DOMModel.js
+++ b/Source/devtools/front_end/sdk/DOMModel.js
@@ -456,12 +456,17 @@ WebInspector.DOMNode.prototype = {
this._agent.removeNode(this.id, this._domModel._markRevision(this, callback));
},
- copyNode: function()
+ /**
+ * @param {function(?string)=} callback
+ */
+ copyNode: function(callback)
{
function copy(error, text)
{
if (!error)
InspectorFrontendHost.copyText(text);
+ if (callback)
+ callback(error ? null : text);
}
this._agent.getOuterHTML(this.id, copy);
},
@@ -709,6 +714,16 @@ WebInspector.DOMNode.prototype = {
* @param {?WebInspector.DOMNode} anchorNode
* @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
*/
+ copyTo: function(targetNode, anchorNode, callback)
+ {
+ this._agent.copyTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback));
+ },
+
+ /**
+ * @param {!WebInspector.DOMNode} targetNode
+ * @param {?WebInspector.DOMNode} anchorNode
+ * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
+ */
moveTo: function(targetNode, anchorNode, callback)
{
this._agent.moveTo(this.id, targetNode.id, anchorNode ? anchorNode.id : undefined, this._domModel._markRevision(this, callback));
« 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