diff options
29 files changed, 239 insertions, 491 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index a308f191..ddaeb061 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -32,9 +32,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
32 | _iframeHolder: { value: null, enumerable: false }, | 32 | _iframeHolder: { value: null, enumerable: false }, |
33 | _textHolder: { value: null, enumerable: false }, | 33 | _textHolder: { value: null, enumerable: false }, |
34 | _codeMirrorCounter: {value: 1, enumerable: false}, | 34 | _codeMirrorCounter: {value: 1, enumerable: false}, |
35 | |||
36 | canSave:{value: false},//for Save menu state update | ||
37 | canSaveAll:{value: false},//for Save All menu state update | ||
38 | 35 | ||
39 | activeDocument: { | 36 | activeDocument: { |
40 | get: function() { | 37 | get: function() { |
@@ -50,12 +47,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
50 | if(!!this._activeDocument.editor){ | 47 | if(!!this._activeDocument.editor){ |
51 | this._activeDocument.editor.focus(); | 48 | this._activeDocument.editor.focus(); |
52 | } | 49 | } |
53 | |||
54 | this.canSave = doc.needsSave; | ||
55 | this.canSaveAll = doc.needsSave; | ||
56 | }else{ | ||
57 | this.canSave = false; | ||
58 | this.canSaveAll = false; | ||
59 | } | 50 | } |
60 | } | 51 | } |
61 | }, | 52 | }, |
@@ -80,7 +71,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
80 | handleAddComponentFirstDraw: { | 71 | handleAddComponentFirstDraw: { |
81 | value: function (e) { | 72 | value: function (e) { |
82 | //TODO: Add logic to reparse the document for dynamically added styles | 73 | //TODO: Add logic to reparse the document for dynamically added styles |
83 | console.log(e); | 74 | //console.log(e); |
84 | } | 75 | } |
85 | }, | 76 | }, |
86 | 77 | ||
diff --git a/js/controllers/presets-controller.js b/js/controllers/presets-controller.js index 975f9f7a..4c177189 100644 --- a/js/controllers/presets-controller.js +++ b/js/controllers/presets-controller.js | |||
@@ -72,20 +72,19 @@ exports.PresetsController = Montage.create(Component, { | |||
72 | selectorBase = stylesController.generateClassName(selectorBase); | 72 | selectorBase = stylesController.generateClassName(selectorBase); |
73 | 73 | ||
74 | selection.forEach(function(element) { | 74 | selection.forEach(function(element) { |
75 | var el = element._element, | 75 | var animationName; |
76 | animationName; | ||
77 | 76 | ||
78 | if(useTransition) { | 77 | if(useTransition) { |
79 | this.addTransition(el); | 78 | this.addTransition(element); |
80 | } | 79 | } |
81 | 80 | ||
82 | ///// TODO: remove when we find out what to do with competing animations | 81 | ///// TODO: remove when we find out what to do with competing animations |
83 | animationName = stylesController.getElementStyle(el, '-webkit-animation-name'); | 82 | animationName = stylesController.getElementStyle(element, '-webkit-animation-name'); |
84 | if(animationName) { | 83 | if(animationName) { |
85 | animationNames.push(animationName); | 84 | animationNames.push(animationName); |
86 | } | 85 | } |
87 | 86 | ||
88 | el.classList.add(selectorBase); | 87 | element.classList.add(selectorBase); |
89 | 88 | ||
90 | }, this); | 89 | }, this); |
91 | 90 | ||
diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 3333d209..a1fe2703 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js | |||
@@ -70,8 +70,12 @@ exports.MenuData = Montage.create( Montage, { | |||
70 | "enabled": { | 70 | "enabled": { |
71 | "value": false, | 71 | "value": false, |
72 | "boundObj": "documentController", | 72 | "boundObj": "documentController", |
73 | "boundProperty": "canSave", | 73 | "boundProperty": "activeDocument", |
74 | "oneway": true | 74 | "oneway": true, |
75 | "boundValueMutator": function(activeDocument){ | ||
76 | if(activeDocument !== null){return true;} | ||
77 | else{return false;} | ||
78 | } | ||
75 | }, | 79 | }, |
76 | "action": "executeSave" | 80 | "action": "executeSave" |
77 | }, | 81 | }, |
@@ -96,10 +100,10 @@ exports.MenuData = Montage.create( Montage, { | |||
96 | "enabled": { | 100 | "enabled": { |
97 | "value": false, | 101 | "value": false, |
98 | "boundObj": "documentController", | 102 | "boundObj": "documentController", |
99 | "boundProperty": "canSaveAll", | 103 | "boundProperty": "activeDocument", |
100 | "oneway": true, | 104 | "oneway": true, |
101 | "boundValueMutator": function(canSaveAll){ | 105 | "boundValueMutator": function(activeDocument){ |
102 | if(canSaveAll === true){return true;} | 106 | if(activeDocument !== null){return true;} |
103 | else{return false;} | 107 | else{return false;} |
104 | } | 108 | } |
105 | }, | 109 | }, |
diff --git a/js/data/panels-data.js b/js/data/panels-data.js index 2422f5e7..7a2d817a 100644 --- a/js/data/panels-data.js +++ b/js/data/panels-data.js | |||
@@ -55,8 +55,8 @@ exports.PanelsData = Montage.create(Montage, { | |||
55 | scrollable: true, | 55 | scrollable: true, |
56 | collapsed: true, | 56 | collapsed: true, |
57 | open: true, | 57 | open: true, |
58 | modulePath: "js/panels/Components/ComponentsPanelBase.reel", | 58 | modulePath: "js/panels/components-panel.reel", |
59 | moduleName: "ComponentsPanelBase" | 59 | moduleName: "ComponentsPanel" |
60 | }, | 60 | }, |
61 | // { | 61 | // { |
62 | // name: "Project/Assets", | 62 | // name: "Project/Assets", |
diff --git a/js/document/text-document.js b/js/document/text-document.js index 54a53999..2574b67c 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js | |||
@@ -164,11 +164,7 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { | |||
164 | needsSave: { | 164 | needsSave: { |
165 | get: function() { return this._needsSave; }, | 165 | get: function() { return this._needsSave; }, |
166 | set: function(value) { | 166 | set: function(value) { |
167 | var i=0, canSaveAll=false; | ||
168 | this._needsSave = value; | 167 | this._needsSave = value; |
169 | |||
170 | this.application.ninja.documentController.canSave = value;//for save menu state update | ||
171 | this.application.ninja.documentController.canSaveAll = value;//for save menu state update..currently save all is tried to the current document only | ||
172 | } | 168 | } |
173 | }, | 169 | }, |
174 | 170 | ||
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index b0ffe2d8..a06f45c6 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -1085,14 +1085,14 @@ exports.CoreIoApi = Montage.create(Component, { | |||
1085 | isValidUri:{ | 1085 | isValidUri:{ |
1086 | value: function(uri){ | 1086 | value: function(uri){ |
1087 | var isWindowsUri=false, isUnixUri=false,status=false; | 1087 | var isWindowsUri=false, isUnixUri=false,status=false; |
1088 | if(uri !== ""){ | 1088 | if((uri !== null) && (uri !== "")){ |
1089 | uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces | 1089 | uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces |
1090 | 1090 | ||
1091 | //for local machine folder uri | 1091 | //for local machine folder uri |
1092 | isWindowsUri = /^([a-zA-Z]:)([\\/][^<>:"/\\|?*]+)*[\\/]?$/gi.test(uri); | 1092 | isWindowsUri = /^([a-zA-Z]:)([\\/][^<>:"/\\|?*]+)*[\\/]?$/gi.test(uri); |
1093 | isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix | 1093 | isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix |
1094 | status = isWindowsUri || isUnixUri; | 1094 | status = isWindowsUri || isUnixUri; |
1095 | if(isWindowsUri && isUnixUri){status = false;} | 1095 | if((uri === "") || (isWindowsUri && isUnixUri)){status = false;} |
1096 | } | 1096 | } |
1097 | return status; | 1097 | return status; |
1098 | } | 1098 | } |
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html index 2fcaa075..00df1c11 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html | |||
@@ -10,13 +10,21 @@ | |||
10 | <link rel="stylesheet" type="text/css" href="file-input-field.css"> | 10 | <link rel="stylesheet" type="text/css" href="file-input-field.css"> |
11 | <script type="text/montage-serialization"> | 11 | <script type="text/montage-serialization"> |
12 | { | 12 | { |
13 | |||
14 | "newFileDirectory": { | ||
15 | "prototype": "montage/ui/textfield.reel", | ||
16 | "properties": { | ||
17 | "element": {"#": "newFileDirectory"} | ||
18 | } | ||
19 | }, |