aboutsummaryrefslogtreecommitdiff
path: root/js/clipboard
diff options
context:
space:
mode:
Diffstat (limited to 'js/clipboard')
-rw-r--r--js/clipboard/external-apps-clipboard-agent.js9
-rw-r--r--js/clipboard/internal-ops/elements-clipboard-agent.js7
2 files changed, 6 insertions, 10 deletions
diff --git a/js/clipboard/external-apps-clipboard-agent.js b/js/clipboard/external-apps-clipboard-agent.js
index cd093d6f..6b9d8090 100644
--- a/js/clipboard/external-apps-clipboard-agent.js
+++ b/js/clipboard/external-apps-clipboard-agent.js
@@ -75,7 +75,6 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
75 } 75 }
76 }, 76 },
77 77
78 //todo: this will be moved to a seperate api
79 pasteImageBinary:{ 78 pasteImageBinary:{
80 value: function(imageBlob){ 79 value: function(imageBlob){
81 var element, self = this, 80 var element, self = this,
@@ -99,7 +98,7 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
99 if (save && save.success && save.status === 201) { 98 if (save && save.success && save.status === 201) {
100 // 99 //
101 if (fileType.indexOf('svg') !== -1) { 100 if (fileType.indexOf('svg') !== -1) {
102 element = document.application.njUtils.make('embed', null, this.application.ninja.currentDocument);//TODO: Verify this is proper 101 element = document.application.njUtils.make('embed', null, this.application.ninja.currentDocument);
103 element.type = 'image/svg+xml'; 102 element.type = 'image/svg+xml';
104 element.src = url+'/'+fileName; 103 element.src = url+'/'+fileName;
105 } else { 104 } else {
@@ -120,7 +119,7 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
120 // 119 //
121 self.application.ninja.elementMediator.addElements(element, rules, false); 120 self.application.ninja.elementMediator.addElements(element, rules, false);
122 } else { 121 } else {
123 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT 122 //HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT
124 } 123 }
125 124
126 return element; 125 return element;
@@ -128,7 +127,7 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
128 }, 127 },
129 128
130 //paste from external applicaitons 129 //paste from external applicaitons
131 pasteHtml:{//todo: change to pasteNinja, pasteHTML, etc 130 pasteHtml:{
132 value: function(htmlData, textData){ 131 value: function(htmlData, textData){
133 var i=0, j=0, 132 var i=0, j=0,
134 pasteDataObject=null, 133 pasteDataObject=null,
@@ -142,7 +141,7 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
142 141
143 if(htmlData){ 142 if(htmlData){
144 143
145 //TODO: cleanse HTML 144 //cleanse HTML
146 145
147 htmlData.replace(/[<script]/g," "); 146 htmlData.replace(/[<script]/g," ");
148 147
diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js
index 3129b644..a6bce2ba 100644
--- a/js/clipboard/internal-ops/elements-clipboard-agent.js
+++ b/js/clipboard/internal-ops/elements-clipboard-agent.js
@@ -142,7 +142,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
142 } 142 }
143 }, 143 },
144 144
145 pasteFromCopy:{//todo: change to appropriate name 145 pasteFromCopy:{
146 value:function(){ 146 value:function(){
147 var i=0, j=0, 147 var i=0, j=0,
148 pastedElements = [],//array of te pastes clones - for selection 148 pastedElements = [],//array of te pastes clones - for selection
@@ -152,7 +152,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
152 152
153 this.pasteCounter++; 153 this.pasteCounter++;
154 154
155 //TODO: cleanse HTML 155 //cleanse HTML
156 156
157 for(j=0; j< this.copiedObjects.copy.length; j++){ 157 for(j=0; j< this.copiedObjects.copy.length; j++){
158 copiedElement = this.copiedObjects.copy[j]; 158 copiedElement = this.copiedObjects.copy[j];
@@ -230,9 +230,6 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
230 //build the computed style attribute 230 //build the computed style attribute
231 computedStyles = elem.ownerDocument.defaultView.getComputedStyle(elem); 231 computedStyles = elem.ownerDocument.defaultView.getComputedStyle(elem);
232 232
233 //todo: consider cleaning up the position data [or making position:relative with 0,0] from the computed styles,
234 // so that the object is pasted onto expernal applicaitons [like gmail] with no offset
235
236 for (i = 0; i < computedStyles.length; i++) { 233 for (i = 0; i < computedStyles.length; i++) {
237 stylePropertyName = computedStyles[i]; 234 stylePropertyName = computedStyles[i];
238 computedStylesStr = computedStylesStr + stylePropertyName + ":" + computedStyles.getPropertyValue(stylePropertyName) + ";"; 235 computedStylesStr = computedStylesStr + stylePropertyName + ":" + computedStyles.getPropertyValue(stylePropertyName) + ";";