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