diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/controllers/selection-controller.js | 6 | ||||
-rw-r--r-- | js/data/panels-data.js | 25 | ||||
-rwxr-xr-x | js/document/html-document.js | 22 | ||||
-rw-r--r-- | js/mediators/io-mediator.js | 6 | ||||
-rwxr-xr-x | js/ninja.reel/ninja.html | 2 | ||||
-rwxr-xr-x | js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js | 2 | ||||
-rwxr-xr-x | js/panels/Panel.reel/Panel.js | 100 | ||||
-rwxr-xr-x | js/panels/PanelContainer.reel/PanelContainer.html | 110 | ||||
-rwxr-xr-x | js/panels/PanelContainer.reel/PanelContainer.js (renamed from js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js) | 75 | ||||
-rwxr-xr-x | js/panels/PanelContainer/PanelContainer.reel/PanelContainer.html | 146 | ||||
-rw-r--r-- | js/panels/drag-drop-composer.js | 2 |
11 files changed, 245 insertions, 251 deletions
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 49bf42b6..eff9c91a 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -77,7 +77,7 @@ exports.SelectionController = Montage.create(Component, { | |||
77 | 77 | ||
78 | 78 | ||
79 | this.application.ninja.selectedElements = currentSelectionArray; | 79 | this.application.ninja.selectedElements = currentSelectionArray; |
80 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); | 80 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); |
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
@@ -90,7 +90,7 @@ exports.SelectionController = Montage.create(Component, { | |||
90 | } | 90 | } |
91 | }, | 91 | }, |
92 | 92 | ||
93 | handleSwitchDocument: { | 93 | handleSwitchDocument: { |
94 | value: function() { | 94 | value: function() { |
95 | if(this.application.ninja.documentController.activeDocument.currentView === "design"){ | 95 | if(this.application.ninja.documentController.activeDocument.currentView === "design"){ |
96 | this._selectedItems = this.application.ninja.selectedElements.slice(0); | 96 | this._selectedItems = this.application.ninja.selectedElements.slice(0); |
@@ -154,7 +154,7 @@ exports.SelectionController = Montage.create(Component, { | |||
154 | value: function(event) { | 154 | value: function(event) { |
155 | this.application.ninja.selectedElements = []; | 155 | this.application.ninja.selectedElements = []; |
156 | this._isDocument = true; | 156 | this._isDocument = true; |
157 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); | 157 | NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument}); |
158 | } | 158 | } |
159 | }, | 159 | }, |
160 | 160 | ||
diff --git a/js/data/panels-data.js b/js/data/panels-data.js index aa5057a2..2422f5e7 100644 --- a/js/data/panels-data.js +++ b/js/data/panels-data.js | |||
@@ -19,7 +19,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
19 | scrollable: false, | 19 | scrollable: false, |
20 | collapsed: false, | 20 | collapsed: false, |
21 | open: true, | 21 | open: true, |
22 | contentComponent: null, | ||
23 | modulePath: "js/panels/Color/colorpanelbase.reel", | 22 | modulePath: "js/panels/Color/colorpanelbase.reel", |
24 | moduleName: "ColorPanelBase" | 23 | moduleName: "ColorPanelBase" |
25 | }, | 24 | }, |
@@ -32,7 +31,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
32 | scrollable: true, | 31 | scrollable: true, |
33 | collapsed: false, | 32 | collapsed: false, |
34 | open: true, | 33 | open: true, |
35 | contentComponent: null, | ||
36 | modulePath: "js/panels/properties.reel", | 34 | modulePath: "js/panels/properties.reel", |
37 | moduleName: "Properties" | 35 | moduleName: "Properties" |
38 | }, | 36 | }, |
@@ -45,7 +43,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
45 | collapsed: true, | 43 | collapsed: true, |
46 | scrollable: true, | 44 | scrollable: true, |
47 | open: true, | 45 | open: true, |
48 | contentComponent: null, | ||
49 | modulePath: "js/panels/Materials/materials-library-panel.reel", | 46 | modulePath: "js/panels/Materials/materials-library-panel.reel", |
50 | moduleName: "MaterialsLibraryPanel" | 47 | moduleName: "MaterialsLibraryPanel" |
51 | }, | 48 | }, |
@@ -58,7 +55,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
58 | scrollable: true, | 55 | scrollable: true, |
59 | collapsed: true, | 56 | collapsed: true, |
60 | open: true, | 57 | open: true, |
61 | contentComponent: null, | ||
62 | modulePath: "js/panels/Components/ComponentsPanelBase.reel", | 58 | modulePath: "js/panels/Components/ComponentsPanelBase.reel", |
63 | moduleName: "ComponentsPanelBase" | 59 | moduleName: "ComponentsPanelBase" |
64 | }, | 60 | }, |
@@ -71,7 +67,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
71 | // scrollable: true, | 67 | // scrollable: true, |
72 | // collapsed: false, | 68 | // collapsed: false, |
73 | // open: true, | 69 | // open: true, |
74 | // content: null, | ||
75 | // modulePath: "js/panels/Project/projectpanelbase.reel", | 70 | // modulePath: "js/panels/Project/projectpanelbase.reel", |
76 | // moduleName: "ProjectPanelBase" | 71 | // moduleName: "ProjectPanelBase" |
77 | // }, | 72 | // }, |
@@ -84,7 +79,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
84 | scrollable: true, | 79 | scrollable: true, |
85 | collapsed: true, | 80 | collapsed: true, |
86 | open: true, | 81 | open: true, |
87 | contentComponent: null, | ||
88 | modulePath: "js/panels/CSSPanel/CSSPanelBase.reel", | 82 | modulePath: "js/panels/CSSPanel/CSSPanelBase.reel", |
89 | moduleName: "CSSPanelBase" | 83 | moduleName: "CSSPanelBase" |
90 | }, | 84 | }, |
@@ -97,7 +91,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
97 | collapsed: true, | 91 | collapsed: true, |
98 | scrollable: true, | 92 | scrollable: true, |
99 | open: true, | 93 | open: true, |
100 | contentComponent: null, | ||
101 | modulePath: "js/panels/presets/content.reel", | 94 | modulePath: "js/panels/presets/content.reel", |
102 | moduleName: "content" | 95 | moduleName: "content" |
103 | } | 96 | } |
@@ -118,24 +111,6 @@ exports.PanelsData = Montage.create(Montage, { | |||
118 | this._panelOrder = val; | 111 | this._panelOrder = val; |
119 | } | 112 | } |
120 | } | 113 | } |
121 | |||
122 | |||
123 | panels: { | ||
124 | get: function() { | ||
125 | var filtered = this._panels.filter(function(item) { | ||
126 | return item.open; | ||
127 | }); | ||
128 | |||
129 | filtered.sort(function(a,b) { | ||
130 | a.name | ||
131 | }); | ||
132 | |||
133 | return filtered; | ||
134 | }, | ||
135 | set : function() { | ||
136 | |||
137 | } | ||
138 | } | ||
139 | */ | 114 | */ |
140 | 115 | ||
141 | }); \ No newline at end of file | 116 | }); \ No newline at end of file |
diff --git a/js/document/html-document.js b/js/document/html-document.js index 924a013d..9670e0c4 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -437,8 +437,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
437 | } else if (prop.indexOf('url') !== -1) { //From CSS property | 437 | } else if (prop.indexOf('url') !== -1) { //From CSS property |
438 | //TODO: Add functionality | 438 | //TODO: Add functionality |
439 | var docRootUrl = this.application.ninja.coreIoApi.rootUrl+escape((this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]).replace(/\/\//gi, '/')); | 439 | var docRootUrl = this.application.ninja.coreIoApi.rootUrl+escape((this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]).replace(/\/\//gi, '/')); |
440 | prop = prop.replace(/[^()\\""\\'']+/g, test); | 440 | prop = prop.replace(/[^()\\""\\'']+/g, cssUrlToNinjaUrl); |
441 | function test (s) { | 441 | function cssUrlToNinjaUrl (s) { |
442 | if (s !== 'url') { | 442 | if (s !== 'url') { |
443 | s = docRootUrl + s; | 443 | s = docRootUrl + s; |
444 | } | 444 | } |
@@ -570,8 +570,22 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
570 | } | 570 | } |
571 | // | 571 | // |
572 | fileCouldDirUrl = this._document.styleSheets[i].href.split(this._document.styleSheets[i].href.split('/')[this._document.styleSheets[i].href.split('/').length-1])[0]; | 572 | fileCouldDirUrl = this._document.styleSheets[i].href.split(this._document.styleSheets[i].href.split('/')[this._document.styleSheets[i].href.split('/').length-1])[0]; |
573 | prefixUrl = 'url('+fileCouldDirUrl; //This should be re-written with better RegEx | 573 | |
574 | tag.innerHTML = cssData.content.replace(/url\(/gi, prefixUrl); | 574 | tag.innerHTML = cssData.content.replace(/url\(()(.+?)\1\)/g, detectUrl); |
575 | |||
576 | function detectUrl (prop) { | ||
577 | return prop.replace(/[^()\\""\\'']+/g, prefixUrl);; | ||
578 | } | ||
579 | |||
580 | function prefixUrl (url) { | ||
581 | if (url !== 'url') { | ||
582 | if (!url.match(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi)) { | ||
583 | url = fileCouldDirUrl+url; | ||
584 | } | ||
585 | } | ||
586 | return url; | ||
587 | } | ||
588 | |||
575 | //Looping through DOM to insert style tag at location of link element | 589 | //Looping through DOM to insert style tag at location of link element |
576 | query = this._templateDocument.html.querySelectorAll(['link']); | 590 | query = this._templateDocument.html.querySelectorAll(['link']); |
577 | for (var j in query) { | 591 | for (var j in query) { |
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 097f5975..f44c182c 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js | |||
@@ -335,7 +335,11 @@ exports.IoMediator = Montage.create(Component, { | |||
335 | cleanedCss = dirtyCss.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaUrl.bind(this)); | 335 | cleanedCss = dirtyCss.replace(/(\b(?:(?:https?|ftp|file|[A-Za-z]+):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gi, parseNinjaUrl.bind(this)); |
336 | 336 | ||
337 | function parseNinjaUrl (url) { | 337 | function parseNinjaUrl (url) { |
338 | return this.getUrlfromNinjaUrl(url, fileRootUrl, fileUrl); | 338 | if (url.indexOf(this.application.ninja.coreIoApi.rootUrl) !== -1) { |
339 | return this.getUrlfromNinjaUrl(url, fileRootUrl, fileUrl); | ||
340 | } else { | ||
341 | return url; | ||
342 | } | ||
339 | } | 343 | } |
340 | 344 | ||
341 | /////////////////////////////////////////////////////////////////////////////////////////// | 345 | /////////////////////////////////////////////////////////////////////////////////////////// |
diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index cdf53ddf..8f6f6d7b 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html | |||
@@ -166,7 +166,7 @@ | |||
166 | }, | 166 | }, |
167 | 167 | ||
168 | "panelContainer": { | 168 | "panelContainer": { |
169 | "module": "js/panels/PanelContainer/PanelContainer.reel", | 169 | "module": "js/panels/PanelContainer.reel", |
170 | "name": "PanelContainer", | 170 | "name": "PanelContainer", |
171 | "properties": { | 171 | "properties": { |
172 | "element": {"#": "rightPanelContent"}, |