aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
authorKruti Shah2012-07-17 12:40:00 -0700
committerKruti Shah2012-07-17 12:40:00 -0700
commitbf2d7bdb22c28089dc1067bc9094ebc590daac87 (patch)
tree2156d9920ea1b7db49ed6460545fea7cda121bae /js/io
parent7e2c2dbd040ed79a3f0678f91bd4b6db9cf69231 (diff)
parentb4b3e45d6684e77d361b4f8ca5be4889428320c5 (diff)
downloadninja-bf2d7bdb22c28089dc1067bc9094ebc590daac87.tar.gz
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Diffstat (limited to 'js/io')
-rw-r--r--js/io/system/chromeapi.js377
-rwxr-xr-xjs/io/system/coreioapi.js593
-rwxr-xr-xjs/io/system/fileio.js373
-rw-r--r--js/io/system/ninjalibrary.js513
-rw-r--r--js/io/system/ninjalibrary.json4
-rwxr-xr-xjs/io/system/projectio.js121
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.html119
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.js193
-rw-r--r--js/io/ui/cloudpopup.reel/css/cloudpopup.css23
-rwxr-xr-xjs/io/ui/cloudpopup.reel/css/cloudpopup.scss183
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.css23
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.html25
-rwxr-xr-xjs/io/ui/file-picker/file-input-field.reel/file-input-field.js23
-rwxr-xr-xjs/io/ui/file-picker/file-picker-controller.js23
-rwxr-xr-xjs/io/ui/file-picker/file-picker-model.js23
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.css35
-rwxr-xr-xjs/io/ui/file-picker/picker-navigator.reel/picker-navigator.html25
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js45
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.css23
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html25
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js25
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.css45
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.html25
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js37
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js23
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-model.js23
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.css29
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.html25
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js25
29 files changed, 1527 insertions, 1499 deletions
diff --git a/js/io/system/chromeapi.js b/js/io/system/chromeapi.js
index 0650385f..e46894d3 100644
--- a/js/io/system/chromeapi.js
+++ b/js/io/system/chromeapi.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -32,9 +33,9 @@ POSSIBILITY OF SUCH DAMAGE.
32//////////////////////////////////////////////////////////////////////// 33////////////////////////////////////////////////////////////////////////
33NOTES: 34NOTES:
34 35
35 The init function starts up the file system API, and a size must be 36 The init function starts up the file system API, and a size must be
36 set, no unlimited available as of now. 37 set, no unlimited available as of now.
37 38
38//////////////////////////////////////////////////////////////////////// 39////////////////////////////////////////////////////////////////////////
39///////////////////////////////////////////////////////////////////// */ 40///////////////////////////////////////////////////////////////////// */
40// 41//
@@ -42,31 +43,31 @@ var Montage = require("montage/core/core").Montage;
42//////////////////////////////////////////////////////////////////////// 43////////////////////////////////////////////////////////////////////////
43// 44//
44exports.ChromeApi = Montage.create(Object.prototype, { 45exports.ChromeApi = Montage.create(Object.prototype, {
45 //////////////////////////////////////////////////////////////////// 46 ////////////////////////////////////////////////////////////////////
46 //Needs size in MBs for fileSystem init 47 //Needs size in MBs for fileSystem init
47 init: { 48 init: {
48 enumerable: true, 49 enumerable: true,
49 value: function(size) { 50 value: function(size) {
50 // 51 //
51 if (window.webkitRequestFileSystem) { 52 if (window.webkitRequestFileSystem) {
52 //Current way to init Chrome's fileSystem API 53 //Current way to init Chrome's fileSystem API
53 window.webkitRequestFileSystem(window.PERSISTENT, size*1024*1024, function (fs) { 54 window.webkitRequestFileSystem(window.PERSISTENT, size*1024*1024, function (fs) {
54 //Storing reference to instance 55 //Storing reference to instance
55 this.fileSystem = fs; 56 this.fileSystem = fs;
56 //Dispatching action ready event 57 //Dispatching action ready event
57 var readyEvent = document.createEvent("CustomEvent"); 58 var readyEvent = document.createEvent("CustomEvent");
58 readyEvent.initEvent('ready', true, true); 59 readyEvent.initEvent('ready', true, true);
59 this.dispatchEvent(readyEvent); 60 this.dispatchEvent(readyEvent);
60 //Building data of local Ninja Library 61 //Building data of local Ninja Library
61 this._listNinjaChromeLibrary(); 62 this._listNinjaChromeLibrary();
62 }.bind(this), function (e) {return false}); //Returns false on error (not able to init) 63 }.bind(this), function (e) {return false}); //Returns false on error (not able to init)
63 // 64 //
64 return true; 65 return true;
65 } else { 66 } else {
66 //No fileSystem API 67 //No fileSystem API
67 return false; 68 return false;
68 } 69 }
69 } 70 }
70 }, 71 },
71 //////////////////////////////////////////////////////////////////// 72 ////////////////////////////////////////////////////////////////////
72 // 73 //
@@ -77,217 +78,217 @@ exports.ChromeApi = Montage.create(Object.prototype, {
77 //////////////////////////////////////////////////////////////////// 78 ////////////////////////////////////////////////////////////////////
78 // 79 //
79 fileSystem: { 80 fileSystem: {
80 enumerable: false, 81 enumerable: false,
81 get: function() { 82 get: function() {
82 return this._fileSystem; 83 return this._fileSystem;
83 }, 84 },
84 set: function(value) { 85 set: function(value) {
85 this._fileSystem = value; 86 this._fileSystem = value;
86 } 87 }
87 }, 88 },
88 //////////////////////////////////////////////////////////////////// 89 ////////////////////////////////////////////////////////////////////
89 // 90 //
90 fileNew: { 91 fileNew: {
91 enumerable: true, 92 enumerable: true,
92 value: function(filePath, content, callback) { 93 value: function(filePath, content, callback) {
93 // 94 //
94 this.fileSystem.root.getFile(filePath, {create: true}, function(f) { 95 this.fileSystem.root.getFile(filePath, {create: true}, function(f) {
95 // 96 //
96 f.createWriter(function(writer) { 97 f.createWriter(function(writer) {
97 // 98 //
98 var mime, blob = new window.WebKitBlobBuilder, type = filePath.split('.'); 99 var mime, blob = new window.WebKitBlobBuilder, type = filePath.split('.');
99 type = type[type.length-1]; 100 type = type[type.length-1];
100 switch (type) { 101 switch (type) {
101 case 'bmp': 102 case 'bmp':
102 mime = 'image/bmp'; 103 mime = 'image/bmp';
103 break; 104 break;
104 case 'gif': 105 case 'gif':
105 mime = 'image/gif'; 106 mime = 'image/gif';
106 break; 107 break;
107 case 'jpeg': 108 case 'jpeg':
108 mime = 'image/jpeg'; 109 mime = 'image/jpeg';
109 break; 110 break;
110 case 'jpg': 111 case 'jpg':
111 mime = 'image/jpeg'; 112 mime = 'image/jpeg';
112 break; 113 break;
113 case 'png': 114 case 'png':
114 mime = 'image/png'; 115 mime = 'image/png';
115 break; 116 break;
116 case 'rtf': 117 case 'rtf':
117 mime = 'application/rtf'; 118 mime = 'application/rtf';
118 break; 119 break;
119 case 'tif':