aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rwxr-xr-xcss/ninja.css2
-rw-r--r--js/clipboard/external-apps-clipboard-agent.js185
-rw-r--r--js/clipboard/internal-ops/elements-clipboard-agent.js24
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.css13
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.html23
-rwxr-xr-xjs/components/layout/document-bar.reel/document-bar.js6
-rwxr-xr-xjs/components/layout/stage-mode.reel/stage-mode.css49
-rwxr-xr-xjs/components/layout/stage-mode.reel/stage-mode.html55
-rwxr-xr-xjs/components/layout/stage-mode.reel/stage-mode.js77
-rwxr-xr-xjs/components/ui/icon-list-basic/iconsList.reel/iconsList.css4
-rw-r--r--js/controllers/clipboard-controller.js23
-rwxr-xr-xjs/data/menu-data.js582
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.js14
-rwxr-xr-xjs/mediators/element-mediator.js6
-rwxr-xr-xjs/mediators/keyboard-mediator.js2
-rwxr-xr-xjs/models/app-model.js156
-rwxr-xr-xjs/ninja.reel/ninja.html19
-rwxr-xr-xjs/ninja.reel/ninja.js5
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js23
-rw-r--r--js/panels/Timeline/Style.reel/Style.js23
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js23
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js23
-rw-r--r--js/ui/menu/menu-controller.js636
-rwxr-xr-xjs/ui/menu/menu-entry.reel/menu-entry.css (renamed from js/components/menu/menu-entry.reel/menu-entry.css)55
-rwxr-xr-xjs/ui/menu/menu-entry.reel/menu-entry.html (renamed from js/components/menu/menu-entry.reel/menu-entry.html)37
-rwxr-xr-xjs/ui/menu/menu-entry.reel/menu-entry.js (renamed from js/components/menu/menu-entry.reel/menu-entry.js)90
-rwxr-xr-xjs/ui/menu/menu-item.reel/menu-item.css (renamed from js/components/menu/menu-item.reel/menu-item.css)101
-rwxr-xr-xjs/ui/menu/menu-item.reel/menu-item.html (renamed from js/components/menu/menu-item.reel/menu-item.html)67
-rwxr-xr-xjs/ui/menu/menu-item.reel/menu-item.js (renamed from js/components/menu/menu-item.reel/menu-item.js)150
-rwxr-xr-xjs/ui/menu/menu.reel/menu.css (renamed from js/components/menu/menu.reel/menu.css)4
-rwxr-xr-xjs/ui/menu/menu.reel/menu.html (renamed from js/components/menu/menu.reel/menu.html)21
-rwxr-xr-xjs/ui/menu/menu.reel/menu.js (renamed from js/components/menu/menu.reel/menu.js)78
-rwxr-xr-xscss/imports/scss/_MainWindow.scss2
34 files changed, 1197 insertions, 1385 deletions
diff --git a/README.md b/README.md
index 286a99ae..9479a000 100644
--- a/README.md
+++ b/README.md
@@ -25,13 +25,13 @@ If you're already familiar with using Git, GitHub, you can clone master branch o
25 - Browse to HKEY_CURRENT_USER/Software/Motorola Mobility/Ninja Local Cloud/Options. 25 - Browse to HKEY_CURRENT_USER/Software/Motorola Mobility/Ninja Local Cloud/Options.
26 - Right click and select New > String value. 26 - Right click and select New > String value.
27 - Type 'Local Ninja Origin' no quotes. 27 - Type 'Local Ninja Origin' no quotes.
28 - Double click on Local Ninja Origin and paste in the Ninja app ID copied in step 6 from the Chrome extensions page in the Value data field. 28 - Double click on Local Ninja Origin and paste in the Ninja app ID copied in step 6 from the Chrome extensions page in the Value data field. To have multiple builds of Ninja installed but not running simultaneously as this is not supported, multiple app IDs can be added separated by comma and no space.
29 - Close Registry Editor. 29 - Close Registry Editor.
308. On Mac: 308. On Mac:
31 - Launch Finder. 31 - Launch Finder.
32 - Double click on /Users/\<user\>/Library/Preferences/com.MotorolaMobility.Ninja-Local-Cloud.plist. Note: on Lion (10.7), user library folder is hidden by default. To browse to it, in Finder choose Go > Go to Folder and type ~/Library, or select Go menu with Alt (Option) key down to see Library listed in Go menu or make the user library folder permanently visible by running the following command in Terminal: chflags nohidden ~/Library 32 - Double click on /Users/\<user\>/Library/Preferences/com.MotorolaMobility.Ninja-Local-Cloud.plist. Note: on Lion (10.7), user library folder is hidden by default. To browse to it, in Finder choose Go > Go to Folder and type ~/Library, or select Go menu with Alt (Option) key down to see Library listed in Go menu or make the user library folder permanently visible by running the following command in Terminal: chflags nohidden ~/Library
33 - Click on Add Child Type 'Local Ninja Origin' no quotes. 33 - Click on Add Child Type 'Local Ninja Origin' no quotes.
34 - For value, paste in the Ninja app ID copied in step 6 from the Chrome extensions page. 34 - For value, paste in the Ninja app ID copied in step 6 from the Chrome extensions page. To have multiple builds of Ninja installed but not running simultaneously as this is not supported, multiple app IDs can be added separated by comma and no space.
35 - Save (File > Save or Cmd S). 35 - Save (File > Save or Cmd S).
36 - Close Property List Editor. 36 - Close Property List Editor.
379. Quit Ninja Local Cloud 379. Quit Ninja Local Cloud
diff --git a/css/ninja.css b/css/ninja.css
index 288156b6..bc82f50d 100755
--- a/css/ninja.css
+++ b/css/ninja.css
@@ -98,7 +98,7 @@ body { position: absolute; margin: 0px; width: 100%; height: 100%; background-co
98 98
99#appWorkspace { display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; -webkit-box-sizing: stretch; position: relative; padding: 2px 0px; border: 1px solid #333; overflow: hidden; } 99#appWorkspace { display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; -webkit-box-sizing: stretch; position: relative; padding: 2px 0px; border: 1px solid #333; overflow: hidden; }
100 100
101#topMenu { background-color: #474747; position: absolute; height: 28px; width: 100%; top: 0px; left: 0px; z-index: 6995; } 101#topMenu { background-color: #474747; position: absolute; height: 26px; width: 100%; top: 0px; left: 0px; z-index: 6995; }
102 102
103#topPanelContainer, #leftPanelContainer, #rightPanelContainer, .timelinePanel { background-color: #282828; } 103#topPanelContainer, #leftPanelContainer, #rightPanelContainer, .timelinePanel { background-color: #282828; }
104 104
diff --git a/js/clipboard/external-apps-clipboard-agent.js b/js/clipboard/external-apps-clipboard-agent.js
index 6b9d8090..65410543 100644
--- a/js/clipboard/external-apps-clipboard-agent.js
+++ b/js/clipboard/external-apps-clipboard-agent.js
@@ -38,40 +38,52 @@ var Montage = require("montage/core/core").Montage,
38 38
39var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.create(Component, { 39var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.create(Component, {
40 40
41 //count how many times pasted
42 //used to move multiple pastes of same copy
43 pasteCounter:{
44 value: 0
45 },
46
41 paste:{ 47 paste:{
42 value: function(clipboardEvent){ 48 value: function(clipboardEvent){
43 var clipboardData = clipboardEvent.clipboardData, 49 var clipboardData = clipboardEvent.clipboardData,
44 htmlData = clipboardData.getData("text/html"), 50 htmlData = clipboardData.getData("text/html"),
45 textData = clipboardData.getData("text/plain"), 51 textData = clipboardData.getData("text/plain"),
46 i=0, 52 i=0,
47 imageMime, imageData, imageElement; 53 imageMime, imageData, imageElement, isImage = false, imageItem;
48 54
49 //handle image blobs 55 if(clipboardData.items && (clipboardData.items.length > 0)){//handle image blobs
50 if(clipboardData.items && (clipboardData.items.length > 0)){
51 for(i=0; i < clipboardData.items.length; i++ ){ 56 for(i=0; i < clipboardData.items.length; i++ ){
52 if((clipboardData.items[i].kind === "file") && (clipboardData.items[i].type.indexOf("image") === 0)){//example type -> "image/png" 57 if((clipboardData.items[i].kind === "file") && (clipboardData.items[i].type.indexOf("image") === 0)){//example type -> "image/png"
53 imageMime = clipboardData.items[i].type; 58 isImage = true;
54 imageData = clipboardData.items[i].getAsFile(); 59 if(clipboardData.items[i].type === "image/png"){
55 try{ 60 imageItem = clipboardData.items[i];//grab the png image from clipboard
56 imageElement = this.pasteImageBinary(imageData); 61 }
57 }catch(e){ 62 else if(i===0){
58 console.log(""+e.stack); 63 imageItem = clipboardData.items[i];
59 } 64 }
60 this.application.ninja.selectionController.selectElements(imageElement);
61 this.application.ninja.currentDocument.model.needsSave = true;
62
63 } 65 }
64 } 66 }
65 } 67 }
66 68
67 try{ 69 if(isImage && imageItem){
68 if(!!htmlData || !!textData){ 70 imageMime = imageItem.type;
69 this.pasteHtml(htmlData, textData); 71 imageData = imageItem.getAsFile();
72 try{
73 imageElement = this.pasteImageBinary(imageData);
74 }catch(e){
75 console.log(""+e.stack);
70 } 76 }
71 }catch(e){ 77 this.application.ninja.currentDocument.model.needsSave = true;
72 console.log(""+e.stack);
73 } 78 }
74 79
80 if(!isImage && (!!htmlData || !!textData)){
81 try{
82 this.doPasteHtml(htmlData, textData);
83 }catch(e){
84 console.log(""+e.stack);
85 }
86 }
75 } 87 }
76 }, 88 },
77 89
@@ -108,16 +120,16 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
108 //Adding element once it is loaded 120 //Adding element once it is loaded
109 element.onload = function () { 121 element.onload = function () {
110 element.onload = null; 122 element.onload = null;
111 self.application.ninja.elementMediator.addElements(element, rules, true); 123 self.application.ninja.elementMediator.addElements(element, rules, true/*notify*/, false /*callAddDelegate*/);
112 }; 124 };
113 //Setting rules of element 125 //Setting rules of element
114 rules = { 126 rules = {
115 'position': 'absolute', 127 'position': 'absolute',
116 'top' : '100px', 128 'top' : '0px',
117 'left' : '100px' 129 'left' : '0px'
118 }; 130 };
119 // 131 //
120 self.application.ninja.elementMediator.addElements(element, rules, false); 132 self.application.ninja.elementMediator.addElements(element, rules, false/*notify*/, false /*callAddDelegate*/);
121 } else { 133 } else {
122 //HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT 134 //HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT
123 } 135 }
@@ -126,119 +138,60 @@ var ExternalAppsClipboardAgent = exports.ExternalAppsClipboardAgent = Montage.cr
126 } 138 }
127 }, 139 },
128 140
129 //paste from external applicaitons 141 doPasteHtml:{
130 pasteHtml:{
131 value: function(htmlData, textData){ 142 value: function(htmlData, textData){
132 var i=0, j=0, 143 var divWrapper = null, data = null, theclass, height, width;
133 pasteDataObject=null,
134 pastedElements = [],
135 node = null