From 8db9e73ca68c006769af3997034959f6b7008add Mon Sep 17 00:00:00 2001
From: Ananya Sen
Date: Thu, 21 Jun 2012 11:02:55 -0700
Subject: - added io api to generate file from binary - refactoring and cleanup

Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
---
 js/clipboard/util.js | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 js/clipboard/util.js

(limited to 'js/clipboard/util.js')

diff --git a/js/clipboard/util.js b/js/clipboard/util.js
new file mode 100644
index 00000000..a0813855
--- /dev/null
+++ b/js/clipboard/util.js
@@ -0,0 +1,28 @@
+/* <copyright>
+This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
+(c) Copyright 2011 Motorola Mobility, Inc.  All Rights Reserved.
+</copyright> */
+
+////////////////////////////////////////////////////////////////////////
+//
+
+var Montage = 		        require("montage/core/core").Montage,
+    Component = 	require("montage/ui/component").Component;
+
+var ClipboardUtil = exports.ClipboardUtil = Montage.create(Component, {
+
+    deserializeHtmlString:{
+        value:function(htmlString){
+            var doc = (this.application.ninja.currentDocument.currentView === "design") ? this.application.ninja.currentDocument.model.views.design.document : document,
+                clipboardHelper=doc.createElement("div"),
+                nodeList = null;
+
+            clipboardHelper.innerHTML = htmlString;
+            nodeList = clipboardHelper.childNodes;
+            clipboardHelper = null; //for garbage collection
+            return nodeList;
+        }
+    }
+
+});
\ No newline at end of file
-- 
cgit v1.2.3