From 36d50b6599ab98559c76e1fe57b1bb131c4433da Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 19 Apr 2012 15:53:18 -0700 Subject: Clean up --- js/io/system/fileio.js | 4 ++-- js/io/system/ninjalibrary.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js/io') diff --git a/js/io/system/fileio.js b/js/io/system/fileio.js index f78ad173..1680ca7f 100755 --- a/js/io/system/fileio.js +++ b/js/io/system/fileio.js @@ -146,7 +146,7 @@ exports.FileIo = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// - // + //TODO: Add functionality deleteFile: { enumerable: true, value: function() { @@ -159,7 +159,7 @@ exports.FileIo = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// - // + //TODO: Add functionality copyFile: { enumerable: true, value: function() { diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index 201598fc..78bdbe53 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -213,7 +213,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { xhr.responseType = "arraybuffer"; xhr.send(); //Checking for status - if (xhr.readyState === 4) { //TODO: add check for mime type + if (xhr.readyState === 4) { //Creating new file from loaded content this.chromeApi.fileNew('/'+tocopylibs[i].name+'/'+tocopylibs[i].file, xhr.response, function (status) {if(status) this.libraryCopied()}.bind(this)); } else { -- cgit v1.2.3 From 6356edefaea3fe78969c53fec2d371cb8f42d820 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 3 May 2012 15:28:38 -0700 Subject: Full CSS support on open Add full CSS for files on open (including loading cross-domain). This is only for files that are opened. --- js/io/system/coreioapi.js | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'js/io') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index a06f45c6..1e6518fe 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -192,6 +192,23 @@ exports.CoreIoApi = Montage.create(Component, { set: function(value) { this._fileServiceURL = value; } + }, + //////////////////////////////////////////////////////////////////// + //File service API URL + _webServiceURL: { + enumerable: false, + value: '/web' + }, + //////////////////////////////////////////////////////////////////// + // + webServiceURL: { + enumerable: false, + get: function() { + return String(this.rootUrl+this._webServiceURL); + }, + set: function(value) { + this._webServiceURL = value; + } }, //////////////////////////////////////////////////////////////////// //Directory service API URL @@ -647,6 +664,53 @@ exports.CoreIoApi = Montage.create(Component, { } }, //////////////////////////////////////////////////////////////////// + // Reads an external file (cross-domain) + // Parameters: + // the file parameter must contain the following properties + // url: string value containing the full file path/URL i.e. "http://google.com/motorola.html" + // binary parameter is optional if the content is to be binary + // Return values: + // returns an object with two properties + // success: boolean indicating if the call succeeded or failed + // content: string containing the file contents + // status: int indicating the request HTTP status code + // 200 - the file was read and its contents were returned + // 404 - the file does not exist + // 500 - unknown server error occurred + readExternalFile: { + enumerable: false, + value: function(file) { + // + var retValue = {success:null, content:null, status:null}; + // + if(file && file.url && file.url.length) { + try { + var serviceURL = this._prepareServiceURL(this.webServiceURL, ''), + xhr = new XMLHttpRequest(); + // + xhr.open("GET", serviceURL+"?url="+file.url, false); + if (file.binary) xhr.setRequestHeader("return-type", "binary"); + xhr.setRequestHeader("Content-Type", "text/plain"); + xhr.send(); + // + if (xhr.readyState === 4) { + retValue.status = xhr.status; + if(xhr.status == 200) { + retValue.content = xhr.response; + } + retValue.success = true; + } + } + catch(error) { + xhr = null; + retValue.success = false; + } + } + // + return retValue; + } + }, + //////////////////////////////////////////////////////////////////// // Create a new directory/folder // Parameters: // the dir parameter must contain the following properties -- cgit v1.2.3 From 3ad9024bcfce76e28816daa02bac14fc8985ca62 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 4 May 2012 15:32:25 -0700 Subject: Fixing body's default styles. Signed-off-by: Nivesh Rajbhandari --- js/io/templates/files/html.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/io') diff --git a/js/io/templates/files/html.txt b/js/io/templates/files/html.txt index 15641348..4e42267e 100755 --- a/js/io/templates/files/html.txt +++ b/js/io/templates/files/html.txt @@ -9,6 +9,10 @@ -- cgit v1.2.3 From a1e8540f5656e62db6a89f3af7829be6b259b7ed Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 8 May 2012 17:33:13 -0700 Subject: Adding SAVE for I/O Adding save functionality to new template. Need to implement user UI for prompts and also clean up... --- js/io/templates/files/html.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'js/io') diff --git a/js/io/templates/files/html.txt b/js/io/templates/files/html.txt index 4e42267e..5a9010cf 100755 --- a/js/io/templates/files/html.txt +++ b/js/io/templates/files/html.txt @@ -1,3 +1,4 @@ + -- cgit v1.2.3 From 9ff89d41048d056ddab4c15b4e9e74bc5417c883 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 9 May 2012 18:12:48 -0700 Subject: Adding support to save body's css styles on preview. Signed-off-by: Nivesh Rajbhandari --- js/io/templates/files/html.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'js/io') diff --git a/js/io/templates/files/html.txt b/js/io/templates/files/html.txt index 5a9010cf..3449ae39 100755 --- a/js/io/templates/files/html.txt +++ b/js/io/templates/files/html.txt @@ -10,10 +10,6 @@ -- cgit v1.2.3 From c87e538fdc337639bc4d54bb087dbf2b4f20297f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 11 May 2012 14:41:20 -0700 Subject: Adding support for new templates This is supported for NEW and OPEN, SAVE is not supported yet by I/O. Saving works, but it will not be a banner template. --- js/io/templates/descriptor.json | 59 ++++++++++++++++++++-- js/io/templates/files/banner.txt | 13 +++++ .../new-file-options-navigator.js | 11 ++-- 3 files changed, 76 insertions(+), 7 deletions(-) create mode 100755 js/io/templates/files/banner.txt (limited to 'js/io') diff --git a/js/io/templates/descriptor.json b/js/io/templates/descriptor.json index 21c4b58c..0b2b70e5 100644 --- a/js/io/templates/descriptor.json +++ b/js/io/templates/descriptor.json @@ -1,13 +1,21 @@ { "categories":{ - "children":["/"] + "children":["/basic", "/template"] }, - "/":{ + + "/basic":{ "name":"Blank File", - "uri":"/", + "uri":"/basic", "type":"directory", "children":["js/io/templates/files/html.txt", "js/io/templates/files/js.txt", "js/io/templates/files/css.txt", "js/io/templates/files/json.txt", "js/io/templates/files/php.txt", "js/io/templates/files/pl.txt", "js/io/templates/files/py.txt", "js/io/templates/files/rb.txt", "js/io/templates/files/xml.txt"] }, + "/template":{ + "name":"Template", + "uri":"/template", + "type":"directory", + "children":["js/io/templates/files/banner.txt"] + }, + "js/io/templates/files/html.txt":{ "name":"HTML", "uri":"js/io/templates/files/html.txt", @@ -75,6 +83,49 @@ "name": "Basic", "uri": "defaultTemplate", "type":"file" + }, + + "js/io/templates/files/banner.txt":{ + "name":"Banner", + "uri":"js/io/templates/files/banner.txt", + "type":"file", + "fileExtension":".html", + "children":["120x600", "160x600", "200x200", "250x250", "300x250", "336x280", "550x400"] + }, + + "120x600":{ + "name": "Skyscraper", + "uri": "120x600", + "type":"file" + }, + "160x600":{ + "name": "Wide Skyscraper", + "uri": "160x600", + "type":"file" + }, + "200x200":{ + "name": "Small Square", + "uri": "200x200", + "type":"file" + }, + "250x250":{ + "name": "Square", + "uri": "250x250", + "type":"file" + }, + "300x250":{ + "name": "Medium Rectangle", + "uri": "300x250", + "type":"file" + }, + "336x280":{ + "name": "Large Rectangle", + "uri": "336x280", + "type":"file" + }, + "550x400":{ + "name": "Animation Default", + "uri": "550x400", + "type":"file" } - } \ No newline at end of file diff --git a/js/io/templates/files/banner.txt b/js/io/templates/files/banner.txt new file mode 100755 index 00000000..fdafe4f6 --- /dev/null +++ b/js/io/templates/files/banner.txt @@ -0,0 +1,13 @@ + + +
+ + + + + + + +
\ No newline at end of file diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js index 1a26c99c..ebe2df61 100644 --- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js +++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js @@ -249,7 +249,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C handleOkButtonAction:{ value: function(evt){ - var selectedProjectTypeID = this.selectedProjectType.uri, + var templateData, + selectedProjectTypeID = this.selectedProjectType.uri, templateID = this.selectedTemplate.uri, projectName = this.newFileLocation.newFileName.value, projectDirectory = this.newFileLocation.fileInputField.newFileDirectory.value, @@ -264,7 +265,10 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C "projectDirectory="+projectDirectory+"\n"+ "projectWidth="+projectWidth+"\n"+ "projectHeight="+projectHeight; - + //////////////////////////////////////////////////////////////////// + //Template data must be passed during file creation (lots of confusion data here, should be cleaned up…) + templateData = {id: templateID, name: this.newFileModel.projectTypeData[selectedProjectTypeID].name, type: this.newFileModel.projectTypeData[selectedProjectTypeID].type}; + //////////////////////////////////////////////////////////////////// if(/[^/\\]$/g.test(projectDirectory)){ projectDirectory = projectDirectory + "/"; @@ -285,7 +289,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C if(!!this.newFileModel.callback){//inform document-controller if save successful this.newFileModel.callback({"fileTemplateUri":selectedProjectTypeID, "newFilePath":newFilePath, - "fileExtension":fileExtension});//document-controller api + "fileExtension":fileExtension, + "template":templateData});//document-controller api }else{ //send selection event var newFileSelectionEvent = document.createEvent("Events"); -- cgit v1.2.3 From 150b6eb2be526627d588a0cf7226ddad7a399b8f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 14 May 2012 16:35:09 -0700 Subject: Fixing banner template Need to implement save, but this cover open and new. --- js/io/templates/files/banner.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'js/io') diff --git a/js/io/templates/files/banner.txt b/js/io/templates/files/banner.txt index fdafe4f6..33b45e53 100755 --- a/js/io/templates/files/banner.txt +++ b/js/io/templates/files/banner.txt @@ -1,13 +1,18 @@ -
+
- - + +
+ + + +
\ No newline at end of file -- cgit v1.2.3 From 3ce003c8d99f0043d460b5833c9e5e6bf6a9f0a7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 15 May 2012 11:24:05 -0700 Subject: Adding animation sub-category to new file Adding animation sub-category to template in new file. --- js/io/templates/descriptor.json | 17 +++++++++++++---- js/io/templates/files/animation.txt | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100755 js/io/templates/files/animation.txt (limited to 'js/io') diff --git a/js/io/templates/descriptor.json b/js/io/templates/descriptor.json index 0b2b70e5..9c9c4ac8 100644 --- a/js/io/templates/descriptor.json +++ b/js/io/templates/descriptor.json @@ -13,7 +13,7 @@ "name":"Template", "uri":"/template", "type":"directory", - "children":["js/io/templates/files/banner.txt"] + "children":["js/io/templates/files/banner.txt", "js/io/templates/files/animation.txt"] }, "js/io/templates/files/html.txt":{ @@ -90,7 +90,7 @@ "uri":"js/io/templates/files/banner.txt", "type":"file", "fileExtension":".html", - "children":["120x600", "160x600", "200x200", "250x250", "300x250", "336x280", "550x400"] + "children":["120x600", "160x600", "200x200", "250x250", "300x250", "336x280"] }, "120x600":{ @@ -123,8 +123,17 @@ "uri": "336x280", "type":"file" }, - "550x400":{ - "name": "Animation Default", + + "js/io/templates/files/animation.txt":{ + "name":"Animation", + "uri":"js/io/templates/files/animation.txt", + "type":"file", + "fileExtension":".html", + "children":["550x400"] + }, + + "550x400":{ + "name": "Default", "uri": "550x400", "type":"file" } diff --git a/js/io/templates/files/animation.txt b/js/io/templates/files/animation.txt new file mode 100755 index 00000000..33b45e53 --- /dev/null +++ b/js/io/templates/files/animation.txt @@ -0,0 +1,18 @@ + + +
+ + + + + +
+ + + +
+ +
\ No newline at end of file -- cgit v1.2.3 From 1ab2c2925fbf6186c8d9872392831f69c61d063d Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 15 May 2012 15:11:26 -0700 Subject: Correcting location of Ninja meta data Needs to be inside most child div. --- js/io/templates/files/animation.txt | 7 +++---- js/io/templates/files/banner.txt | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'js/io') diff --git a/js/io/templates/files/animation.txt b/js/io/templates/files/animation.txt index 33b45e53..8a3dbd41 100755 --- a/js/io/templates/files/animation.txt +++ b/js/io/templates/files/animation.txt @@ -2,12 +2,11 @@
- - - -
+ + + diff --git a/js/io/templates/files/banner.txt b/js/io/templates/files/banner.txt index f26accf6..fcfac14c 100755 --- a/js/io/templates/files/banner.txt +++ b/js/io/templates/files/banner.txt @@ -8,6 +8,12 @@ -- cgit v1.2.3 From f9f8fdc3000042ba5b4504d91870dc9a32ef25eb Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 01:00:22 -0700 Subject: Squashed master into dom-architecture Signed-off-by: Valerio Virgillito --- js/io/system/ninjalibrary.js | 28 ++++++++++++---------------- js/io/system/ninjalibrary.json | 4 ++-- 2 files changed, 14 insertions(+), 18 deletions(-) (limited to 'js/io') diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js index 78bdbe53..3de5fb69 100644 --- a/js/io/system/ninjalibrary.js +++ b/js/io/system/ninjalibrary.js @@ -152,7 +152,8 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { // this.chromeApi = chrome; // - var i, l, libs, libjson, xhr = new XMLHttpRequest(), tocopylibs = [], copied; +// debugger; + var i, l, libs, libjson, xhr = new XMLHttpRequest(), tocopylibs = []; //Getting known json list of libraries to copy to chrome xhr.open("GET", '/js/io/system/ninjalibrary.json', false); xhr.send(); @@ -166,23 +167,18 @@ exports.NinjaLibrary = Montage.create(Object.prototype, { if (chromeLibs.length > 0) { // for (i=0; chromeLibs[i]; i++) { - copied = false; for (var j in libs.libraries) { if (String(libs.libraries[j].name+libs.libraries[j].version).toLowerCase() === chromeLibs[i]) { - copied = true; - } - } - // - if (!copied) { - if (libs.libraries[j].file) { - tocopylibs.push({name: String(libs.libraries[j].name+libs.libraries[j].version).toLowerCase(), path: libs.libraries[j].path, file: libs.libraries[j].file}); - } else { - tocopylibs.push({name: String(libs.libraries[j].name+libs.libraries[j].version).toLowerCase(), path: libs.libraries[j].path}); - } - } else { - //TODO: Remove, currently manually removing copied libraries - //this.chromeApi.directoryDelete(chromeLibs[i]); - } + //TODO: Remove, currently manually removing copied libraries + // //this.chromeApi.directoryDelete(chromeLibs[i]); + } else { + if (libs.libraries[j].file) { + tocopylibs.push({name: String(libs.libraries[j].name+libs.libraries[j].version).toLowerCase(), path: libs.libraries[j].path, file: libs.libraries[j].file}); + } else { + tocopylibs.push({name: String(libs.libraries[j].name+libs.libraries[j].version).toLowerCase(), path: libs.libraries[j].path}); + } + } + } } } else { diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index e236f2e0..feced079 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,6 +1,6 @@ { "libraries": [ - {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.7.0.0"}, - {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.5.0"} + {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.8.0.0"}, + {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.6.0"} ] } \ No newline at end of file -- cgit v1.2.3 From 13ae16997d4bbca14e255d5989d1c44a76eac72c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:23:48 -0700 Subject: montage v.0.10 integration Signed-off-by: Valerio Virgillito --- js/io/system/ninjalibrary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/io') diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json index feced079..041e7ed7 100644 --- a/js/io/system/ninjalibrary.json +++ b/js/io/system/ninjalibrary.json @@ -1,6 +1,6 @@ { "libraries": [ - {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.8.0.0"}, + {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.10.0.0"}, {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.6.0"} ] } \ No newline at end of file -- cgit v1.2.3 From fd54dabad7cbc27a0efb0957155c00d578912909 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 16 May 2012 15:32:36 -0700 Subject: changing @change to propertyChangeListener Signed-off-by: Valerio Virgillito --- js/io/ui/file-picker/file-input-field.reel/file-input-field.js | 2 +- js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js | 2 +- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js/io') diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js index 9e77759f..a5fab11c 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js @@ -16,7 +16,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { this.findDirectory.identifier = "findDirectory"; this.findDirectory.addEventListener("click", this, false); this.eventManager.addEventListener("pickerSelectionsDone", this.handleFileInputPickerSelectionsDone, false); - this.addEventListener("change@newFileDirectory.value", this.handleNewFileDirectoryChange, false); + this.addPropertyChangeListener("newFileDirectory.value", this.handleNewFileDirectoryChange, false); this.newFileDirectory.element.addEventListener("keyup", this, false); } }, diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js index 3ac38d02..e8a699cc 100755 --- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js +++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js @@ -22,7 +22,7 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, { value: function() { this.fileInputField.selectDirectory = true; - this.addEventListener("change@newFileName.value", this.newFileNameChange, false); + this.addPropertyChangeListener("newFileName.value", this.newFileNameChange, false); this.newFileName.element.addEventListener("keyup", this, false); this.newFileName.element.focus(); this.newFileName.element.select(); diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js index e2f50ff5..a27d9d13 100644 --- a/js/io/ui/save-as-dialog.reel/save-as-dialog.js +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js @@ -57,7 +57,7 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { this.fileInputField.selectDirectory = true; this.fileInputField.pickerName = "saveAsDirectoryPicker"; - this.addEventListener("change@newFileName.value", this.handleNewFileNameChange, false); + this.addPropertyChangeListener("newFileName.value", this.handleNewFileNameChange, false); this.newFileName.element.addEventListener("keyup", this, false); this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); -- cgit v1.2.3