aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorhwc4872012-02-28 12:58:09 -0800
committerhwc4872012-02-28 12:58:09 -0800
commit347fc28227d822e9fea3fa823fae79cf14ea041c (patch)
tree180e7ee1ad092397b05c0452e75d456fa0a3abb7 /js
parented16298e4323b733f6dc957c307dc07036fa3569 (diff)
parent7c9291a5bab4abd849547f8878f6fb962fc88250 (diff)
downloadninja-347fc28227d822e9fea3fa823fae79cf14ea041c.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into integration
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/ui/icon-list-basic/icon.reel/icon.js5
-rwxr-xr-xjs/components/ui/tree-basic/treeItem.reel/treeItem.js5
-rwxr-xr-xjs/controllers/document-controller.js72
-rwxr-xr-xjs/controllers/elements/element-controller.js6
-rwxr-xr-xjs/controllers/local-storage-controller.js67
-rwxr-xr-xjs/controllers/selection-controller.js9
-rwxr-xr-xjs/controllers/styles-controller.js44
-rwxr-xr-xjs/data/menu-data.js2
-rwxr-xr-xjs/data/settings.js71
-rwxr-xr-xjs/document/html-document.js221
-rwxr-xr-xjs/document/templates/montage-html/index.html1
-rwxr-xr-xjs/document/templates/montage-html/styles.css5
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js20
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js4
-rwxr-xr-xjs/io/system/coreioapi.js6
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.js4
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js21
-rwxr-xr-xjs/io/ui/file-picker/file-picker-controller.js36
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js26
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js38
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js36
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js19
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js4
-rwxr-xr-xjs/lib/NJUtils.js4
-rwxr-xr-xjs/mediators/element-mediator.js12
-rw-r--r--js/mediators/io-mediator.js166
-rwxr-xr-xjs/mediators/keyboard-mediator.js8
-rwxr-xr-xjs/ninja.reel/ninja.html18
-rwxr-xr-xjs/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.html2
-rwxr-xr-xjs/panels/Panel.reel/Panel.html12
-rwxr-xr-xjs/panels/Panel.reel/Panel.js4
-rwxr-xr-xjs/panels/PanelBase.js49
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.js12
-rwxr-xr-xjs/panels/Resizer.js83
-rwxr-xr-xjs/panels/Splitter.js22
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.html153
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js134
-rw-r--r--js/panels/Timeline/Layer.reel/css/Layer.css29
-rw-r--r--js/panels/Timeline/Layer.reel/scss/Layer.scss6
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/css/PropertyTrack.css6
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/images/gridline.jpgbin0 -> 724 bytes
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/scss/PropertyTrack.scss1
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html37
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js62
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js119
-rw-r--r--js/panels/presets/content.reel/content.js4
-rwxr-xr-xjs/stage/layout.js76
-rwxr-xr-xjs/stage/stage-deps.js38
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js21
-rwxr-xr-xjs/stage/stage.reel/stage.js18
-rwxr-xr-xjs/tools/EyedropperTool.js187
-rwxr-xr-xjs/tools/FillTool.js4
-rwxr-xr-xjs/tools/InkBottleTool.js4
53 files changed, 1401 insertions, 612 deletions
diff --git a/js/components/ui/icon-list-basic/icon.reel/icon.js b/js/components/ui/icon-list-basic/icon.reel/icon.js
index b0279207..72adbfa1 100755
--- a/js/components/ui/icon-list-basic/icon.reel/icon.js
+++ b/js/components/ui/icon-list-basic/icon.reel/icon.js
@@ -131,6 +131,11 @@ var Icon = exports.Icon = Montage.create(Component, {
131 openFolderEvent.initEvent("openFolder", false, false); 131 openFolderEvent.initEvent("openFolder", false, false);
132 openFolderEvent.folderUri = this.icondata.uri; 132 openFolderEvent.folderUri = this.icondata.uri;
133 this.element.dispatchEvent(openFolderEvent); 133 this.element.dispatchEvent(openFolderEvent);
134 }else{
135 var openFolderEvent = document.createEvent("Events");
136 openFolderEvent.initEvent("selectFile", false, false);
137 openFolderEvent.fileUri = this.icondata.uri;
138 this.element.dispatchEvent(openFolderEvent);
134 } 139 }
135 if(evt.bubbles){ 140 if(evt.bubbles){
136 evt.stopPropagation(); 141 evt.stopPropagation();
diff --git a/js/components/ui/tree-basic/treeItem.reel/treeItem.js b/js/components/ui/tree-basic/treeItem.reel/treeItem.js
index 755eab8c..4c71cb6b 100755
--- a/js/components/ui/tree-basic/treeItem.reel/treeItem.js
+++ b/js/components/ui/tree-basic/treeItem.reel/treeItem.js
@@ -225,6 +225,11 @@ exports.TreeItem = Montage.create(Component, {
225 openFolderEvent.initEvent("openFolder", false, false); 225 openFolderEvent.initEvent("openFolder", false, false);
226 openFolderEvent.folderUri = this.treeItemData.uri; 226 openFolderEvent.folderUri = this.treeItemData.uri;
227 this.element.dispatchEvent(openFolderEvent); 227 this.element.dispatchEvent(openFolderEvent);
228 }else{
229 var openFolderEvent = document.createEvent("Events");
230 openFolderEvent.initEvent("selectFile", false, false);
231 openFolderEvent.fileUri = this.treeItemData.uri;
232 this.element.dispatchEvent(openFolderEvent);
228 } 233 }
229 if(evt.bubbles){ 234 if(evt.bubbles){
230 evt.stopPropagation(); 235 evt.stopPropagation();
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 1c9d9d59..02031922 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -58,6 +58,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
58 this.eventManager.addEventListener("executeFileOpen", this, false); 58 this.eventManager.addEventListener("executeFileOpen", this, false);
59 this.eventManager.addEventListener("executeNewFile", this, false); 59 this.eventManager.addEventListener("executeNewFile", this, false);
60 this.eventManager.addEventListener("executeSave", this, false); 60 this.eventManager.addEventListener("executeSave", this, false);
61 this.eventManager.addEventListener("executeSaveAs", this, false);
62 this.eventManager.addEventListener("executeSaveAll", this, false);
61 63
62 this.eventManager.addEventListener("recordStyleChanged", this, false); 64 this.eventManager.addEventListener("recordStyleChanged", this, false);
63 65
@@ -87,11 +89,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
87 //Checking for app to be loaded through extension 89 //Checking for app to be loaded through extension
88 var check; 90 var check;
89 if (chrome && chrome.app) { 91 if (chrome && chrome.app) {
90 check = chrome.app.getDetails(); 92 check = chrome.app.getDetails();
91 } 93 }
92 if (check !== null) { 94 if (check !== null) {
93 //Adding an intercept to resources loaded to ensure user assets load from cloud simulator 95 //Adding an intercept to resources loaded to ensure user assets load from cloud simulator
94 chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]); 96 chrome.webRequest.onBeforeRequest.addListener(this.handleWebRequest.bind(this), {urls: ["<all_urls>"]}, ["blocking"]);
95 } 97 }
96 } 98 }
97 }, 99 },
@@ -107,33 +109,57 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
107 handleExecuteFileOpen: { 109 handleExecuteFileOpen: {
108 value: function(event) { 110 value: function(event) {
109 var pickerSettings = event._event.settings || {}; 111 var pickerSettings = event._event.settings || {};
110 pickerSettings.callback = this.openFileWithURI.bind(this); 112 if (this.application.ninja.coreIoApi.cloudAvailable()) {
111 pickerSettings.pickerMode = "read"; 113 pickerSettings.callback = this.openFileWithURI.bind(this);
112 pickerSettings.inFileMode = true; 114 pickerSettings.pickerMode = "read";
113 this.application.ninja.filePickerController.showFilePicker(pickerSettings); 115 pickerSettings.inFileMode = true;
116 this.application.ninja.filePickerController.showFilePicker(pickerSettings);
117 }
114 } 118 }
115 }, 119 },
116 120
117 handleExecuteNewFile: { 121 handleExecuteNewFile: {
118 value: function(event) { 122 value: function(event) {
119 var newFileSettings = event._event.settings || {}; 123 var newFileSettings = event._event.settings || {};
120 newFileSettings.callback = this.createNewFile.bind(this); 124 if (this.application.ninja.coreIoApi.cloudAvailable()) {
121 this.application.ninja.newFileController.showNewFileDialog(newFileSettings); 125 newFileSettings.callback = this.createNewFile.bind(this);
126 this.application.ninja.newFileController.showNewFileDialog(newFileSettings);
127 }
122 } 128 }
123 }, 129 },
124
125
126 //////////////////////////////////////////////////////////////////// 130 ////////////////////////////////////////////////////////////////////
127 //TODO: Check for appropiate structures 131 //TODO: Check for appropiate structures
128 handleExecuteSave: { 132 handleExecuteSave: {
129 value: function(event) { 133 value: function(event) {
130 if(!!this.activeDocument){ 134 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
131 //Text and HTML document classes should return the same save object for fileSave 135 //Text and HTML document classes should return the same save object for fileSave
132 this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); 136 this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this));
137 }
133 } 138 }
139 },
140 ////////////////////////////////////////////////////////////////////
141 //TODO: Check for appropiate structures
142 handleExecuteSaveAll: {
143 value: function(event) {
144 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
145 //Text and HTML document classes should return the same save object for fileSave
146 this.application.ninja.ioMediator.fileSave(this.activeDocument.saveAll(), this.fileSaveResult.bind(this));
147 }
134 } 148 }
135 }, 149 },
136 //////////////////////////////////////////////////////////////////// 150 ////////////////////////////////////////////////////////////////////