From a7952c5a16e2cae3fd1a459b03b9f16bba1004da Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Tue, 14 Feb 2012 13:23:20 -0800
Subject: Cleaning up
Setting up a 'document' folder to handle all document related classes that in relation to IO
---
js/io/document/base-document.js | 93 --------
js/io/document/html-document.js | 492 ----------------------------------------
js/io/document/text-document.js | 156 -------------
3 files changed, 741 deletions(-)
delete mode 100755 js/io/document/base-document.js
delete mode 100755 js/io/document/html-document.js
delete mode 100755 js/io/document/text-document.js
(limited to 'js/io')
diff --git a/js/io/document/base-document.js b/js/io/document/base-document.js
deleted file mode 100755
index 918b51ad..00000000
--- a/js/io/document/base-document.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
- */
-
-//BaseDocument Object for all files types and base class for HTML documents.
-
-var Montage = require("montage/core/core").Montage;
-
-var BaseDocument = exports.BaseDocument = Montage.create(Montage, {
- /** Private Members **/
- _name: { value: null, enumerable: false },
- _uri: { value: null, enumerable: false },
- _documentType: { value: null, enumerable: false },
- _container: {value: null, enumerable: false },
- _uuid: { value: null, enumerable: false },
- _isActive: { value: true, enumerable: false },
- _dirtyFlag: { value: false, enumerable: false },
- _callback: { value: null, enumerable: false },
- _currentView: { value: null, enumerable: false},
-
- /** Getters/Setters **/
- name: {
- get: function() { return this._name; },
- set: function(value) { this._name = value; }
- },
-
- uri: {
- get: function() { return this._uri; },
- set: function(value) { this._uri = value; }
- },
-
- documentType: {
- get: function() { return this._documentType; },
- set: function(value) { this._documentType = value; }
- },
-
- container: {
- get: function() { return this._container; },
- set: function(value) { this._container = value; }
- },
-
- uuid: {
- get: function() { return this._uuid; },
- set: function(value) { this._uuid = value; }
- },
-
- isActive: {
- get: function() { return this._isActive; },
- set: function(value) { this._isActive = value; }
- },
-
- dirtyFlag: {
- get: function() { return this._dirtyFlag; },
- set: function(value) { this._dirtyFlag = value; }
- },
-
- callback: {
- get: function() { return this._callback; },
- set: function(value) { this._callback = value; }
- },
-
- currentView: {
- get: function() { return this._currentView; },
- set: function(value) { this._currentView = value }
- },
-
- /** Base Methods **/
- init: {
- value: function(name, uri, type, container, uuid, callback) {
- this.name = name;
- this.uri = uri;
- this.documentType = type;
- this.container = container;
- this.uuid = uuid;
- this.callback = callback;
- }
- },
-
- loadDocument: {
- value: function() {
- // Have the XHR here?
- }
- },
-
- save:{
- value:function(){
- //base function - to be overridden
- }
- }
-
-});
\ No newline at end of file
diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js
deleted file mode 100755
index ac556c2d..00000000
--- a/js/io/document/html-document.js
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
-This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
- */
-
-////////////////////////////////////////////////////////////////////////
-//
-var Montage = require("montage/core/core").Montage,
- BaseDocument = require("js/io/document/base-document").BaseDocument,
- NJUtils = require("js/lib/NJUtils").NJUtils;
-////////////////////////////////////////////////////////////////////////
-//
-exports.HTMLDocument = Montage.create(BaseDocument, {
- // PRIVATE MEMBERS
- _selectionExclude: { value: null, enumerable: false },
- _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false},
- _iframe: { value: null, enumerable: false },
- _server: { value: null, enumerable: false },
- _templateDocument: { value: null, enumerable: false },
- _selectionModel: { value: [], enumerable: false },
- _undoModel: { value: { "queue" : [], "position" : 0 }, enumerable: false},
-
- _document: { value: null, enumerable: false },
- _documentRoot: { value: null, enumerable: false },
- _stageBG: { value: null, enumerable: false },
- _window: { value: null, enumerable: false },
- _styles: { value: null, enumerable: false },
- _stylesheets: { value: null, enumerable: false },
- _stageStyleSheetId : { value: 'nj-stage-stylesheet', enumerable: false },
- _userDocument: { value: null, enumerable: false },
- _htmlSource: {value: "", enumerable: false},
- _glData: {value: null, enumerable: false },
-
- _elementCounter: { value: 1, enumerable: false },
- _snapping : { value: true, enumerable: false },
- _layoutMode: { value: "all", enumerable: false },
- _draw3DGrid: { value: false, writable: true },
- _swfObject: { value: false, enumerable: false },
-
- _zoomFactor: { value: 100, enumerable: false },
-
- // PUBLIC MEMBERS
- cssLoadInterval: { value: null, enumerable: false },
-
- _savedLeftScroll: {value:null},
- _savedTopScroll: {value:null},
-
- _codeViewDocument:{
- writable: true,
- enumerable: true,
- value:null
- },
-
- /*
- * PUBLIC API
- */
-
- // GETTERS / SETTERS
-
- codeViewDocument:{
- get: function() { return this._codeViewDocument; },
- set: function(value) { this._codeViewDocument = value}
- },
-
- savedLeftScroll:{
- get: function() { return this._savedLeftScroll; },
- set: function(value) { this._savedLeftScroll = value}
- },
-
- savedTopScroll:{
- get: function() { return this._savedTopScroll; },
- set: function(value) { this._savedTopScroll = value}
- },
-
- selectionExclude: {
- get: function() { return this._selectionExclude; },
- set: function(value) { this._selectionExclude = value; }
- },
-
- iframe: {
- get: function() { return this._iframe; },
- set: function(value) { this._iframe = value; }
- },
-
- server: {
- get: function() { return this._server; },
- set: function(value) { this._server = value; }
- },
-
- selectionModel: {
- get: function() { return this._selectionModel; },
- set: function(value) { this._selectionModel = value; }
- },
-
- undoModel: {
- get: function() { return this._undoModel; },
- set: function(value) { this._undoModel.queue = value.queue; this._undoModel.position = value.position; }
- },
-
- documentRoot: {
- get: function() { return this._documentRoot; },
- set: function(value) { this._documentRoot = value; }
- },
-
- stageBG: {
- get: function() { return this._stageBG; },
- set: function(value) { this._stageBG = value; }
- },
-
- elementCounter: {
- set: function(value) { this._elementCounter = value; },
- get: function() { return this._elementCounter; }
- },
-
- snapping: {
- get: function() { return this._snapping; },
- set: function(value) {
- if(this._snapping !== value) {
- this._snapping = value;
- }
- }
- },
-
- // TODO SEND THE EVENT --> Redraw the desired layout
- layoutMode: {
- get: function() { return this._layoutMode; },
- set: function(mode) { this._layoutMode = mode; }
- },
-
- draw3DGrid: {
- get: function() { return this._draw3DGrid; },
- set: function(value) {
- if(this._draw3DGrid !== value) {
- this._draw3DGrid = value;
- }
- }
- },
-
- _userComponentSet: {
- value: {},
- writable: true,
- enumerable:true
- },
-
-// userComponentSet:{
-// enumerable: true,
-// get: function() {
-// return this._userComponentSet;
-// },
-// set: function(value) {
-// this._userComponentSet = value;
-// this._drawUserComponentsOnOpen();
-// }
-// },
-//
-// _drawUserComponentsOnOpen:{
-// value:function(){
-// for(var i in this._userComponentSet){
-// console.log(this._userComponentSet[i].control)
-// this._userComponentSet[i].control.needsDraw = true;
-// }
-// }
-// },
-
- glData: {
- get: function()
- {
- var elt = this.iframe;
- var elt = this.iframe.contentWindow.document.getElementById("UserContent");
- this._glData = null;
- if (elt)
- {
- this._glData = new Array();
- this.collectGLData( elt, this._glData );
- }
-
- return this._glData
- },
-
- set: function(value)
- {
- var nWorlds = value.length;
- for (var i=0; i= 0)
- {
- var endIndex = importStr.indexOf( "\n", startIndex );
- if (endIndex > 0)
- {
- var id = importStr.substring( startIndex+4, endIndex );
- var canvas = this.iframe.contentWindow.document.getElementById( id );
- if (canvas)
- {
- if (!canvas.elementModel)
- {
- NJUtils.makeElementModel(canvas, "Canvas", "shape", true);
- }
-
- if (canvas.elementModel)
- {
- if (canvas.elementModel.shapeModel.GLWorld)
- canvas.elementModel.shapeModel.GLWorld.clearTree();
-
- var world = new GLWorld( canvas );
- canvas.elementModel.shapeModel.GLWorld = world;
- world.import( importStr );
- }
- }
- }
- }
- }
- }
- },
-
- zoomFactor: {
- get: function() { return this._zoomFactor; },
- set: function(value) { this._zoomFactor = value; }
- },
-
- //****************************************//
- // PUBLIC METHODS
-
-
- ////////////////////////////////////////////////////////////////////
- //
- initialize: {
- value: function(file, uuid, iframe, callback) {
- //
- this._userDocument = file;
- //
- this.init(file.name, file.uri, file.extension, iframe, uuid, callback);
- //
- this.iframe = iframe;
- this.selectionExclude = ["HTML", "BODY", "Viewport", "UserContent", "stageBG"];
- this.currentView = "design";
- //
- this.iframe.src = this._htmlTemplateUrl;
- this.iframe.addEventListener("load", this, true);
- }
- },
- ////////////////////////////////////////////////////////////////////
-
-
- collectGLData: {
- value: function( elt, dataArray )
- {
- if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld)
- {
- var data = elt.elementModel.shapeModel.GLWorld.export();
- dataArray.push( data );
- }
-
- if (elt.children)
- {
- var nKids = elt.children.length;
- for (var i=0; i 1) {
- clearInterval(this.cssLoadInterval);
- this._styles = this._document.styleSheets[this._document.styleSheets.length - 1];
- this._stylesheets = this._document.styleSheets; // Entire stlyesheets array
-
- this.callback(this);
- }
- }.bind(this), 50);
-
- // TODO - Not sure where this goes
- this._userComponentSet = {};
-
-
- this._styles = this._document.styleSheets[this._document.styleSheets.length - 1];
- this._stylesheets = this._document.styleSheets; // Entire stlyesheets array
-
- /* TODO Finish this implementation once we start caching Core Elements */
- // Assign a model to the UserContent and add the ViewPort reference to it.
- NJUtils.makeElementModel(this.documentRoot, "Stage", "stage");
- //this.documentRoot.elementModel.viewPort = this.iframe.contentWindow.document.getElementById("Viewport");
- NJUtils.makeElementModel(this.stageBG, "Stage", "stage");
- NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage");
-
- for(i = 0; i < this._stylesheets.length; i++) {
- if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) {
- this.documentRoot.elementModel.defaultRule = this._stylesheets[i];
- break;
- }
- }
-
- // Temporary create properties for each rule we need to save the index of the rule.
- var len = this.documentRoot.elementModel.defaultRule.cssRules.length;
- for(var j = 0; j < len; j++) {
-// console.log(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText);
- if(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText === "*") {
-
- this.documentRoot.elementModel.transitionStopRule = this.documentRoot.elementModel.defaultRule.cssRules[j];
-
- } else if(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText === "body") {
-
- this.documentRoot.elementModel.body = this.documentRoot.elementModel.defaultRule.cssRules[j];
-
- } else if(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText === "#Viewport") {
-
- this.documentRoot.elementModel.viewPort = this.documentRoot.elementModel.defaultRule.cssRules[j];
-
- } else if(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText === ".stageDimension") {
-
- this.documentRoot.elementModel.stageDimension = this.documentRoot.elementModel.defaultRule.cssRules[j];
-
- } else if(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText === ".stageView") {
-
- this.documentRoot.elementModel.stageView = this.documentRoot.elementModel.defaultRule.cssRules[j];
-
- } else if(this.documentRoot.elementModel.defaultRule.cssRules[j].selectorText === "#stageBG") {
-
- this.documentRoot.elementModel.stageBackground = this.documentRoot.elementModel.defaultRule.cssRules[j];
- }
- }
-
- this.callback(this);
-
- }
- },
-
- _setSWFObjectScript: {
- value: function() {
- if(!this._swfObject) {
- /*
- var swfObj = document.createElement("script");
- swfObj.type = "text/javascript";
- swfObj.src = "../../user-document-templates/external-libs/swf-object/swfobject.js";
- swfObj.id = "swfObject";
- var head= this._document.getElementsByTagName('head')[0];
- head.appendChild(swfObj);
- this._swfObject = true;
- */
- }
- }
- },
-
- /**
- * public method
- *
- */
- ////////////////////////////////////////////////////////////////////
- //
- save: {
- enumerable: false,
- value: function () {
- //TODO: Add code view logic and also styles for HTML
- if (this.currentView === 'design') {
- return {mode: 'html', document: this._userDocument, style: this._styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML};
- } else if (this.currentView === "code"){
- //TODO: Would this get call when we are in code of HTML?
- } else {
- //Error
- }
- }
- }
- ////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////
-});
\ No newline at end of file
diff --git a/js/io/document/text-document.js b/js/io/document/text-document.js
deleted file mode 100755
index 87fcc551..00000000
--- a/js/io/document/text-document.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
- */
-
-////////////////////////////////////////////////////////////////////////
-//
-var Montage = require("montage/core/core").Montage,
- BaseDocument = require("js/io/document/base-document").BaseDocument;
-////////////////////////////////////////////////////////////////////////
-//
-exports.TextDocument = Montage.create(BaseDocument, {
- // PRIVATE MEMBERS
- _codeEditor: {
- value: {
- "editor": { value: null, enumerable: false },
-
- }
- },
-
- _editor: { value: null, enumerable: false },
- _hline: { value: null, enumerable: false },
-
- _textArea: {value: null, enumerable: false },
-
- _userDocument: {value: null, enumerable: false },
-
- _source: { value: null, enumerable: false},
-
- source: {
- get: function() { return this._source;},
- set: function(value) { this._source = value;}
- },
-
- // PUBLIC MEMBERS
-
- _savedLeftScroll: {value:null},
- _savedTopScroll: {value:null},
-
- //****************************************//
- //PUBLIC API
-
-
- // GETTERS / SETTERS
-
- savedLeftScroll:{
- get: function() { return this._savedLeftScroll; },
- set: function(value) { this._savedLeftScroll = value}
- },
-
- savedTopScroll:{
- get: function() { return this._savedTopScroll; },
- set: function(value) { this._savedTopScroll = value}
- },
-
- textArea: {
- get: function() { return this._textArea; },
- set: function(value) { this._textArea = value; }
- },
- editor: {
- get: function() { return this._editor; },
- set: function(value) { this._editor = value}
- },
-
- hline: {
- get: function() { return this._hline; },
- set: function(value) {this._hline = value; }
- },
-
-
- ////////////////////////////////////////////////////////////////////
- //
- initialize: {
- value: function(file, uuid, textArea, container, callback) {
- //
- this._userDocument = file;
- //
- this.init(file.name, file.uri, file.extension, container, uuid, callback);
- //
- this.currentView = "code";
- this.textArea = textArea;
- }
- },
- ////////////////////////////////////////////////////////////////////
- //
- save: {
- enumerable: false,
- value: function () {
- //TODO: Improve sequence
- this.editor.save();
- return {mode: this._userDocument.extension, document: this._userDocument, content: this.textArea.value};
- }
- }
- ////////////////////////////////////////////////////////////////////
-
-
-
-
-
-
-
-
-
-
-
- /*
-// PRIVATE METHODS
- _loadContent: {
- value: function() {
- // Start and AJAX call to load the HTML Document as a String
- var xhr = new XMLHttpRequest();
- var ref = this;
-
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- ref.source = xhr.responseText;
- ref.textArea.innerHTML = xhr.responseText;
- //ref.callback(xhr.responseText);
- ref.callback(ref);
- }
- };
-
- if(this.documentType === "js") {
- xhr.open('GET', 'user-document-templates/montage-application-cloud/appdelegate.js');
- } else if(this.documentType === "css") {
- xhr.open('GET', 'user-document-templates/montage-application-cloud/default_html.css');
- } else {
- xhr.open('GET', 'user-document-templates/montage-application-cloud/index.html');
- }
-
- xhr.send('');
- }
- },
-*/
- ////////////////////////////////////////////////////////////////////
-
-
- /**
- * public method
- */
- /*
-save:{
- value:function(){
- try{
- this.editor.save();
- //persist textArea.value to filesystem
- this.dirtyFlag=false;
- }catch(e){
- console.log("Error while saving "+this.uri);
- console.log(e.stack);
- }
- }
- }
-*/
-});
\ No newline at end of file
--
cgit v1.2.3
From ffe7ddf30aeb2b89d49a91c76406aed93f6bed7a Mon Sep 17 00:00:00 2001
From: Ananya Sen
Date: Tue, 14 Feb 2012 14:03:17 -0800
Subject: use button tag for save as dialog
Signed-off-by: Ananya Sen
---
js/io/ui/save-as-dialog.reel/save-as-dialog.css | 57 ++++++++++++++----------
js/io/ui/save-as-dialog.reel/save-as-dialog.html | 4 +-
2 files changed, 36 insertions(+), 25 deletions(-)
(limited to 'js/io')
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.css b/js/io/ui/save-as-dialog.reel/save-as-dialog.css
index 40434c25..92970706 100644
--- a/js/io/ui/save-as-dialog.reel/save-as-dialog.css
+++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.css
@@ -10,8 +10,12 @@
height:150px;
padding-left: 15px;
padding-right: 15px;
- background-color:#313131;
color: #ffffff;
+ background-color:#494949;
+ font-family: 'Droid Sans', sans-serif;
+ border-radius: 8px;
+ box-shadow: 0px 0px 8px rgba(0, 0, 0, .8);
+ text-shadow: 1px 1px 1px #000;
}
.saveAsDialog .title{
@@ -24,7 +28,7 @@
}
.saveAsDialog .locationSelection{
- border: 1px groove #000000;
+ border: 1px solid #000000;
overflow: auto;
height:38%;
padding: 15px;
@@ -65,31 +69,38 @@
margin-left:3px;
}
+.saveAsDialog .buttons button {
+ float: left;
+ width: 100px;
+ margin-top: 3px;
+}
+
.saveAsDialog .okButton{
- margin-right:25px;
- -webkit-box-align: center;
- text-align: center;
- cursor: default;
- padding: 0px 6px 0px;
- border:2px solid #d1d1d1;
- background-color: #e1e1e1;
- box-sizing: border-box;
- border-radius:10px;
- background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%);
- cursor:pointer;
+ margin: 0px 5px 0px 5px;
+ /*margin-right:25px;*/
+ /*-webkit-box-align: center;*/
+ /*text-align: center;*/
+ /*cursor: default;*/
+ /*padding: 0px 6px 0px;*/
+ /*border:2px solid #d1d1d1;*/
+ /*background-color: #e1e1e1;*/
+ /*box-sizing: border-box;*/
+ /*border-radius:10px;*/
+ /*background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%);*/
+ /*cursor:pointer;*/
}
.saveAsDialog .cancelButton{
- -webkit-box-align: center;
- text-align: center;
- cursor: default;
- padding: 0px 6px 0px;
- border:2px solid #d1d1d1;
- background-color: #e1e1e1;
- box-sizing: border-box;
- border-radius:10px;
- background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%);
- cursor:pointer;
+ /*-webkit-box-align: center;*/
+ /*text-align: center;*/
+ /*cursor: default;*/
+ /*padding: 0px 6px 0px;*/
+ /*border:2px solid #d1d1d1;*/
+ /*background-color: #e1e1e1;*/
+ /*box-sizing: border-box;*/
+ /*border-radius:10px;*/
+ /*background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%);*/
+ /*cursor:pointer;*/
}
.saveAsDialog input[type="button"]:disabled{
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.html b/js/io/ui/save-as-dialog.reel/save-as-dialog.html
index f2011a34..4f0d5779 100644
--- a/js/io/ui/save-as-dialog.reel/save-as-dialog.html
+++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.html
@@ -48,8 +48,8 @@
-
-
+
+
--
cgit v1.2.3
From ec14eff9831026600ba4cf71810444d54e143e04 Mon Sep 17 00:00:00 2001
From: Ananya Sen
Date: Tue, 14 Feb 2012 14:53:32 -0800
Subject: allow / in windows directory path
Signed-off-by: Ananya Sen
---
js/io/system/coreioapi.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'js/io')
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 614b0850..ea9627cc 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -1101,7 +1101,7 @@ window.hack = function (name, type) {
uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces
//for local machine folder uri
- isWindowsUri = /^([a-zA-Z]:)(\\[^<>:"/\\|?*]+)*\\?$/gi.test(uri);
+ isWindowsUri = /^([a-zA-Z]:)([\\/][^<>:"/\\|?*]+)*[\\/]?$/gi.test(uri);
isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix
status = isWindowsUri || isUnixUri;
if(isWindowsUri && isUnixUri){status = false;}
--
cgit v1.2.3
From 68ce64a5a2f4a71b54d33916aaf1d57161302425 Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Tue, 14 Feb 2012 20:48:40 -0800
Subject: Reverting text/html document classes and setting up MVC folder
structure
Setting up the folder structure for the proposed set up for documents in Ninja. Reverted to have a temp HTML/Text document class. Tweak some UI for file pickers.
---
js/io/system/coreioapi.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'js/io')
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 614b0850..6dcd795e 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -97,10 +97,12 @@ window.hack = function (name, type) {
this.application.ninja.ioMediator.fileNew('Users/kgq387/Desktop/Ninja Cloud/Disk/'+name+'.'+type, '/js/io/templates/files/'+type+'.txt', function (status) {console.log(status)});
}.bind(this);
*/
- window.hack = function (path) {
+ /*
+window.hack = function (path) {
//
this.application.ninja.ioMediator.fileOpen('Users/kgq387/Desktop/Ninja Cloud/Disk/'+path, function (result) {console.log(result)});
}.bind(this);
+*/
}
},
////////////////////////////////////////////////////////////////////
--
cgit v1.2.3
From c7ef6951baff283266df7567e30c8074dda4ad01 Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Wed, 15 Feb 2012 15:31:30 -0800
Subject: Setting up webGL local library (assets)
---
js/io/system/ninjalibrary.json | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'js/io')
diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json
index 272cc2c7..05e0a427 100644
--- a/js/io/system/ninjalibrary.json
+++ b/js/io/system/ninjalibrary.json
@@ -1,6 +1,7 @@
{
"libraries": [
- {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0"},
- {"name": "RDGE", "path": "/js/helper-classes/RDGE/rdge-compiled.js", "version": "0.6.0", "file": "rdge-compiled.js"}
+ {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0.0"},
+ {"name": "Assets", "path": "/assets/descriptor.json", "version": "0.5.0.0"},
+ {"name": "RDGE", "path": "/js/helper-classes/RDGE/rdge-compiled.js", "version": "0.5.0.0", "file": "rdge-compiled.js"}
]
}
\ No newline at end of file
--
cgit v1.2.3
From 075252ad893452df446566f01d0b26eeab08be3d Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Wed, 15 Feb 2012 23:07:00 -0800
Subject: Setting up webGL library copy on save
---
js/io/system/coreioapi.js | 20 +++-----------------
js/io/system/ninjalibrary.js | 25 ++++++++++++++++++++++---
2 files changed, 25 insertions(+), 20 deletions(-)
(limited to 'js/io')
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 507804fd..a75b59bb 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -40,6 +40,7 @@ exports.CoreIoApi = Montage.create(Component, {
////////////////////////////////////////////////////////////
//Instance of ninja library
this.ninjaLibrary = NinjaLibrary;
+ this.ninjaLibrary.coreApi = this;
//Getting reference of chrome file system API
this.chromeFileSystem = ChromeApi;
//Sending size in MBs for file system storage
@@ -62,6 +63,7 @@ exports.CoreIoApi = Montage.create(Component, {
this.chromeFileSystem.removeEventListener('ready', this, false);
//Listening for library to be copied event (builds list)
this.chromeFileSystem.addEventListener('library', this, false);
+ //TODO: Add sync loading screen logic (Add screen here)
}
},
////////////////////////////////////////////////////////////////////
@@ -86,23 +88,7 @@ exports.CoreIoApi = Montage.create(Component, {
console.log('Ninja Local Library: Ready');
//Removing events
this.ninjaLibrary.removeEventListener('sync', this, false);
- this.ninjaLibrary.coreApi = this;
- //TODO: Add sync loading screen logic
-
- //TODO: Remove test
- //this.ninjaLibrary.copyLibToCloud('Users/kgq387/Desktop/Ninja Cloud/Disk', 'montage0.6.0');
- //this.ninjaLibrary.deleteLibraries();
- /*
-window.hack = function (name, type) {
- this.application.ninja.ioMediator.fileNew('Users/kgq387/Desktop/Ninja Cloud/Disk/'+name+'.'+type, '/js/io/templates/files/'+type+'.txt', function (status) {console.log(status)});
- }.bind(this);
-*/
- /*
-window.hack = function (path) {
- //
- this.application.ninja.ioMediator.fileOpen('Users/kgq387/Desktop/Ninja Cloud/Disk/'+path, function (result) {console.log(result)});
- }.bind(this);
-*/
+ //TODO: Add sync loading screen logic (Remove screen here)
}
},
////////////////////////////////////////////////////////////////////
diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js
index fc943323..8c58883a 100644
--- a/js/io/system/ninjalibrary.js
+++ b/js/io/system/ninjalibrary.js
@@ -51,6 +51,23 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
},
////////////////////////////////////////////////////////////////////
//
+ _libs: {
+ enumerable: false,
+ value: null
+ },
+ ////////////////////////////////////////////////////////////////////
+ //
+ libs: {
+ enumerable: false,
+ get: function() {
+ return this._libs;
+ },
+ set: function(value) {
+ this._libs = value;
+ }
+ },
+ ////////////////////////////////////////////////////////////////////
+ //
_libsToSync: {
enumerable: false,
value: 0
@@ -67,14 +84,14 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
enumerable: false,
value: function (path, libName) {
//
- if(this.coreApi.directoryExists({uri: '/'+path+'/'+libName+'/'}).status === 404) {
+ if(this.coreApi.directoryExists({uri: path+libName}).status === 404) {
this.chromeApi.directoryContents(this.chromeApi.fileSystem.root, function (contents) {
for (var i in contents) {
if (libName === contents[i].name) {
//Getting contents of library to be copied
this.chromeApi.directoryContents(contents[i], function (lib) {
//Creating directory structure from subfolders
- this.copyDirectoryToCloud(path, contents[i], '/'+path, function (status) {console.log(status)});
+ this.copyDirectoryToCloud(path, contents[i], path, function (status) {console.log(status)});
}.bind(this));
break;
}
@@ -99,7 +116,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
dir = folder.name;
}
//
- if (!this.coreApi.createDirectory({uri: '/'+dir+'/'})) {
+ if (!this.coreApi.createDirectory({uri: dir})) {
//Error occured while creating folders
return;
}
@@ -140,6 +157,8 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
//Parsing json libraries
libs = JSON.parse(xhr.response);
//
+ this.libs = libs.libraries;
+ //
if (chromeLibs.length > 0) {
//
for (i=0; chromeLibs[i]; i++) {
--
cgit v1.2.3