From aea0e6879abfef02a827ed239ef091c3b96d6eb2 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 7 Jun 2012 11:55:36 -0700 Subject: - cleanse html for copying from outer application Signed-off-by: Ananya Sen --- js/controllers/clipboard-controller.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/clipboard-controller.js b/js/controllers/clipboard-controller.js index 38102512..e08cb12b 100644 --- a/js/controllers/clipboard-controller.js +++ b/js/controllers/clipboard-controller.js @@ -227,28 +227,41 @@ var ClipboardController = exports.ClipboardController = Montage.create(Component pastedElements.push(node); } } + + this.application.ninja.selectionController.selectElements(pastedElements); + this.application.ninja.currentDocument.model.needsSave = true; } }, //paste from external applicaitons pasteFromExternalSource:{//todo: change to pasteNinja, pasteHTML, etc value: function(htmlData, textData){ - var i=0, + var i=0, j=0, pasteDataObject=null, clipboardHelper=this.createClipboardHelper(), pastedElements = null, node = null, styles = null, divWrapper = null, - spanWrapper = null; + spanWrapper = null, + metaEl = null; if(htmlData){ + //TODO: cleanse HTML + //TODO: remove all script tags for security + htmlData.replace(/[