From adb90eff3323aa780f9a0879572e3cf3b9f0b969 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 21 Feb 2012 13:04:58 -0800 Subject: - file picker - select file on double click - check cloud availability before IO operations [open file, new file, Save, Save As]. Canceling operation if cloud was unavailable, as per team's agreement. Signed-off-by: Ananya Sen --- js/components/ui/icon-list-basic/icon.reel/icon.js | 5 ++++ .../ui/tree-basic/treeItem.reel/treeItem.js | 5 ++++ js/controllers/document-controller.js | 33 ++++++++++++++++------ js/data/menu-data.js | 2 +- .../picker-navigator.reel/picker-navigator.js | 26 +++++++++++++---- .../new-file-workflow-controller.js | 7 ----- js/io/ui/save-as-dialog.reel/save-as-dialog.js | 4 +-- 7 files changed, 58 insertions(+), 24 deletions(-) (limited to 'js') 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, { openFolderEvent.initEvent("openFolder", false, false); openFolderEvent.folderUri = this.icondata.uri; this.element.dispatchEvent(openFolderEvent); + }else{ + var openFolderEvent = document.createEvent("Events"); + openFolderEvent.initEvent("selectFile", false, false); + openFolderEvent.fileUri = this.icondata.uri; + this.element.dispatchEvent(openFolderEvent); } if(evt.bubbles){ 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, { openFolderEvent.initEvent("openFolder", false, false); openFolderEvent.folderUri = this.treeItemData.uri; this.element.dispatchEvent(openFolderEvent); + }else{ + var openFolderEvent = document.createEvent("Events"); + openFolderEvent.initEvent("selectFile", false, false); + openFolderEvent.fileUri = this.treeItemData.uri; + this.element.dispatchEvent(openFolderEvent); } if(evt.bubbles){ evt.stopPropagation(); diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 9a063280..505daaba 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -58,6 +58,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.eventManager.addEventListener("executeFileOpen", this, false); this.eventManager.addEventListener("executeNewFile", this, false); this.eventManager.addEventListener("executeSave", this, false); + this.eventManager.addEventListener("executeSaveAs", this, false); this.eventManager.addEventListener("recordStyleChanged", this, false); @@ -100,33 +101,47 @@ var DocumentController = exports.DocumentController = Montage.create(Component, handleExecuteFileOpen: { value: function(event) { var pickerSettings = event._event.settings || {}; - pickerSettings.callback = this.openFileWithURI.bind(this); - pickerSettings.pickerMode = "read"; - pickerSettings.inFileMode = true; - this.application.ninja.filePickerController.showFilePicker(pickerSettings); + if (this.application.ninja.coreIoApi.cloudAvailable()) { + pickerSettings.callback = this.openFileWithURI.bind(this); + pickerSettings.pickerMode = "read"; + pickerSettings.inFileMode = true; + this.application.ninja.filePickerController.showFilePicker(pickerSettings); + } } }, handleExecuteNewFile: { value: function(event) { var newFileSettings = event._event.settings || {}; - newFileSettings.callback = this.createNewFile.bind(this); - this.application.ninja.newFileController.showNewFileDialog(newFileSettings); + if (this.application.ninja.coreIoApi.cloudAvailable()) { + newFileSettings.callback = this.createNewFile.bind(this); + this.application.ninja.newFileController.showNewFileDialog(newFileSettings); + } } }, - - //////////////////////////////////////////////////////////////////// //TODO: Check for appropiate structures handleExecuteSave: { value: function(event) { - if(!!this.activeDocument){ + if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ //Text and HTML document classes should return the same save object for fileSave this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); } } }, //////////////////////////////////////////////////////////////////// + handleExecuteSaveAs: { + value: function(event) { + var saveAsSettings = event._event.settings || {}; + if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ + saveAsSettings.fileName = this.activeDocument.name; + saveAsSettings.folderUri = this.activeDocument.uri.substring(0, this.activeDocument.uri.lastIndexOf("/")); + //add callback + this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); + } + } + }, + // fileSaveResult: { value: function (result) { diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 7c3ca5d4..52710b3a 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -44,7 +44,7 @@ exports.MenuData = Montage.create( Montage, { "displayText" : "Save As", "hasSubMenu" : false, "enabled": true, - "action":"saveAs" + "action":"executeSaveAs" }, { "displayText" : "Save All", diff --git a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js index 411386f9..428e7bab 100644 --- a/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js +++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js @@ -214,6 +214,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { this.element.addEventListener("openFolder", function(evt){that.handlePickerNavOpenFolder(evt);}, false);//add icon double click event listener to reload iconList with new set of data this.element.addEventListener("selectedItem", function(evt){that.handlePickerNavSelectedItem(evt);}, false);//for single selection only + this.element.addEventListener("selectFile", function(evt){that.handlePickerNavSelectedFile(evt);}, false);//for file selection this.element.addEventListener("showMetadata", function(evt){that.handlePickerNavShowMetadata(evt);}, false);//show metadata on hover of icon this.element.addEventListener("updateMetadata", function(evt){that.handlePickerNavUpdateMetadata(evt);}, false);//show metadata on click of icon //this.addressGo.addEventListener("click", this, false); @@ -669,14 +670,29 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { } }, + handlePickerNavSelectedFile:{ + value: function(evt){ + var uri = evt.fileUri; + + //do selection if in file selection mode + if(this.pickerModel.inFileMode && (this.application.ninja.filePickerController._directoryContentCache[uri].type === "file")){ + this.okButton.removeAttribute("disabled"); + //put into selectedItems..currently single selection is supported + this.selectedItems = [uri]; + this.currentURI = uri.substring(0, uri.lastIndexOf("/")); + this.handleOkButtonAction(); + } + } + }, + handlePickerNavShowMetadata: { value: function(evt){ - //update matadata only if nothing is already selected - if(this.currentSelectedNode == null){ - //console.log("handle showmetadata - true"); - this.metadataSection.innerHTML = evt.metadata; - } + //update matadata only if nothing is already selected + if(this.currentSelectedNode == null){ + //console.log("handle showmetadata - true"); + this.metadataSection.innerHTML = evt.metadata; } + } }, handlePickerNavUpdateMetadata:{ diff --git a/js/io/ui/new-file-dialog/new-file-workflow-controller.js b/js/io/ui/new-file-dialog/new-file-workflow-controller.js index 7b7f4572..f34ee000 100755 --- a/js/io/ui/new-file-dialog/new-file-workflow-controller.js +++ b/js/io/ui/new-file-dialog/new-file-workflow-controller.js @@ -19,12 +19,6 @@ var NewFileWorkflowController = exports.NewFileWorkflowController = Montage.cre writable:false, enumerable:true, value:function(){ - var that = this; - - this.eventManager.addEventListener("saveAs", function(evt){ - var data = evt._event.data || {};//data will contain the current file name, directory location and callback - that.showSaveAsDialog(data); - }, false); } }, @@ -99,7 +93,6 @@ var NewFileWorkflowController = exports.NewFileWorkflowController = Montage.cre saveAsDialog.fileName = fileName; saveAsDialog.folderUri = folderUri; saveAsDialog.callback = data.callback; - saveAsDialog.callbackScope = data.callbackScope; saveAsDialog.element = saveAsDialogContainer; //remove after rendering and add in modal dialog 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 55a09fa8..0a322b99 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 @@ -117,8 +117,8 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { try{ //validate file name and folder path //check if file already exists - if(!!this.callback && !!this.callbackScope){//inform document-controller if save successful - this.callback.call(this.callbackScope, {"filename":filename, "destination": newFileDirectory});//document-controller api + if(!!this.callback){//inform document-controller if save successful + this.callback({"filename":filename, "destination": newFileDirectory});//document-controller api }else{ //send save as event var saveAsEvent = document.createEvent("Events"); -- cgit v1.2.3 From 86996190d6a4dd59343d4ce482a9c0e6ef0f1eac Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 21 Feb 2012 15:53:37 -0800 Subject: added null check for matchedRules in styles-controller.js, to fix js error on reopening and edited html document Signed-off-by: Ananya Sen --- js/controllers/styles-controller.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 885d710f..31beb6d0 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -317,7 +317,11 @@ var stylesController = exports.StylesController = Montage.create(Component, { isInlineStyle : true, style : element.style }; - + + if((typeof matchedRules === "undefined") || (matchedRules === null)){ + return null; + } + ///// Now splice it into the matched rules ///// By inserting the inline style at the beginning, ///// we keep the correct order of specificity -- cgit v1.2.3 From 539fb19b2327a9f6fb39403e27c29a8f8d733198 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 21 Feb 2012 16:46:24 -0800 Subject: edit by Eric G.: catch the error instead of doing the null check for the stale element Signed-off-by: Ananya Sen --- js/controllers/styles-controller.js | 46 +++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'js') diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 31beb6d0..662816f5 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -318,10 +318,6 @@ var stylesController = exports.StylesController = Montage.create(Component, { style : element.style }; - if((typeof matchedRules === "undefined") || (matchedRules === null)){ - return null; - } - ///// Now splice it into the matched rules ///// By inserting the inline style at the beginning, ///// we keep the correct order of specificity @@ -576,37 +572,36 @@ var stylesController = exports.StylesController = Montage.create(Component, { win = element.ownerDocument.defaultView, self = this; - if(!win) { - return null; - } - if(!omitPseudos) { pseudos.concat(['link', 'visited', 'active', 'hover', 'focus', 'first-letter', 'first-line', 'first-child', 'before', 'after', 'lang', 'target']); } - pseudos.forEach(function(pseudo) { - rules = rules.concat(nj.toArray(win.getMatchedCSSRules(element, pseudo)).filter(function(rule) { - //// useStageStyleSheet flag indicates whether to only return rules from the stylesheet, - //// or only use rules for other stylesheets + try { + pseudos.forEach(function(pseudo) { + rules = rules.concat(nj.toArray(win.getMatchedCSSRules(element, pseudo)).filter(function(rule) { + //// useStageStyleSheet flag indicates whether to only return rules from the stylesheet, + //// or only use rules for other stylesheets - var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null, - isStageStyleSheet = sheetId === this.CONST.STAGE_SHEET_ID; + var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null, + isStageStyleSheet = sheetId === this.CONST.STAGE_SHEET_ID; - ///// filter out (return false) depending on flag - if(useStageStyleSheet && !isStageStyleSheet) { return false; } - if(!useStageStyleSheet && isStageStyleSheet) { return false; } + ///// filter out (return false) depending on flag + if(useStageStyleSheet && !isStageStyleSheet) { return false; } + if(!useStageStyleSheet && isStageStyleSheet) { return false; } - ///// Non-filter code - just assigning specificity to the rule - if(!rule[this.CONST.SPECIFICITY_KEY]) { - rule[this.CONST.SPECIFICITY_KEY] = this.getSpecificity(rule.selectorText); - } + ///// Non-filter code - just assigning specificity to the rule + if(!rule[this.CONST.SPECIFICITY_KEY]) { + rule[this.CONST.SPECIFICITY_KEY] = this.getSpecificity(rule.selectorText); + } - return true; - - }, this)); - }, this); + return true; + }, this)); + }, this); + } catch(ERROR) { + console.warn('StylesController::getMatchingRules - Un-attached element queried.'); + } ///// Function for sorting by specificity values function sorter(ruleA, ruleB) { var a, b, order, sheetAIndex, sheetBIndex, ruleAIndex, ruleBIndex; @@ -985,6 +980,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { ///// Pass "true" to method to return an override object, which ///// has the rule to override, and whether the !important flag is needed dominantRule = this.getDominantRuleForElement(element, property, true, isStageElement); + } ///// Did we find a dominant rule? -- cgit v1.2.3 From 9aa442da1ac9fd3212b37fa63a36090af47b6808 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 21 Feb 2012 17:41:55 -0800 Subject: fix bug when closing the first document tab Signed-off-by: Ananya Sen --- js/controllers/document-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 505daaba..7470bae2 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -309,7 +309,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, if(this.activeDocument.uuid === id && this._documents.length > 0) {//closing the active document tab var nextDocumentIndex = -1 ; if((this._documents.length > 0) && (closeDocumentIndex === 0)){ - nextDocumentIndex = 1; + nextDocumentIndex = 0; }else if((this._documents.length > 0) && (closeDocumentIndex > 0)){ nextDocumentIndex = closeDocumentIndex - 1; } -- cgit v1.2.3 From e17fb41feca768d746f89d90cef28192fa60c621 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 21 Feb 2012 23:30:01 -0800 Subject: Temp CSS fix (for file open) Implemented temporary work-around to the css-cross-origin issue on files loaded into Ninja. Fix is for open file, need to implement save functionality and integrate with CSS panel. --- js/document/html-document.js | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 9a7755e6..bd41bc46 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -382,24 +382,23 @@ exports.HTMLDocument = Montage.create(TextDocument, { //TODO: Remove, also for prototyping this.application.ninja.documentController._hackRootFlag = true; // - //this.documentRoot = this.iframe.contentWindow.document.getElementById("UserContent"); this.stageBG = this.iframe.contentWindow.document.getElementById("stageBG"); this.stageBG.onclick = null; this._document = this.iframe.contentWindow.document; this._window = this.iframe.contentWindow; // if(!this.documentRoot.Ninja) this.documentRoot.Ninja = {}; - // + //Inserting user's document into template this._templateDocument.head.innerHTML = this._userDocument.content.head; - this._templateDocument.body.innerHTML = this._userDocument.content.body; - - // Adding a handler for the main user document reel to finish loading. + //this._templateDocument.body.innerHTML = this._userDocument.content.body; + + //Adding a handler for the main user document reel to finish loading this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once - //TODO: When written, the best way to initialize the document is to listen for the DOM tree being modified + //TODO: When re-written, the best way to initialize the document is to listen for the DOM tree being modified setTimeout(function () { @@ -408,9 +407,41 @@ exports.HTMLDocument = Montage.create(TextDocument, { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if(this._document.styleSheets.length > 1) { + //Checking all styleSheets in document + for (var i in this._document.styleSheets) { + //If rules are null, assuming cross-origin issue + if(this._document.styleSheets[i].rules === null) { + //Disabling style sheet to reload via inserting in style tag + this._document.styleSheets[i].disabled = 'true'; + //TODO: Revisit URLs and URI creation logic, very hack right now + var fileUri, cssUrl, cssData, tag; + if (this._document.styleSheets[i].href.indexOf('js/document/templates/montage-html') !== -1) { + //Getting the url of the CSS file + cssUrl = this._document.styleSheets[i].href.split('js/document/templates/montage-html')[1]; + //Creating the URI of the file + fileUri = this.application.ninja.coreIoApi.cloudData.root+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+cssUrl.split('/')[1]; + //Loading the data from the file + cssData = this.application.ninja.coreIoApi.readFile({uri: fileUri}); + //Creating tag with file content + tag = document.createElement('style'); + tag.ninjauri = fileUri; + tag.innerHTML = cssData.content; + this._templateDocument.head.appendChild(tag); + } + } + } + + //TODO: Revisit this logic this._styles = this._document.styleSheets[this._document.styleSheets.length - 1]; this._stylesheets = this._document.styleSheets; // Entire stlyesheets array + + this._templateDocument.body.innerHTML = this._userDocument.content.body; + + + + + //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"); -- cgit v1.2.3 From 27589634d3e8ea52abe8623f8f2cc48ce0aa04c9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 22 Feb 2012 12:05:13 -0800 Subject: Improving temp CSS loading fix Adding logic to parse the entire DOM and insert the style tag loading the link element content directly above. --- js/document/html-document.js | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index bd41bc46..02e9918f 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -377,6 +377,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { value: function(event){ //TODO: Clean up, using for prototyping save this._templateDocument = {}; + this._templateDocument.html = this.iframe.contentWindow.document; this._templateDocument.head = this.iframe.contentWindow.document.getElementById("userHead"); this._templateDocument.body = this.documentRoot = this.iframe.contentWindow.document.getElementById("UserContent"); //TODO: Remove, also for prototyping @@ -390,7 +391,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { if(!this.documentRoot.Ninja) this.documentRoot.Ninja = {}; //Inserting user's document into template this._templateDocument.head.innerHTML = this._userDocument.content.head; - //this._templateDocument.body.innerHTML = this._userDocument.content.body; + this._templateDocument.body.innerHTML = this._userDocument.content.body; //Adding a handler for the main user document reel to finish loading this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); @@ -411,36 +412,42 @@ exports.HTMLDocument = Montage.create(TextDocument, { for (var i in this._document.styleSheets) { //If rules are null, assuming cross-origin issue if(this._document.styleSheets[i].rules === null) { - //Disabling style sheet to reload via inserting in style tag - this._document.styleSheets[i].disabled = 'true'; //TODO: Revisit URLs and URI creation logic, very hack right now - var fileUri, cssUrl, cssData, tag; + var fileUri, cssUrl, cssData, tag, query; if (this._document.styleSheets[i].href.indexOf('js/document/templates/montage-html') !== -1) { //Getting the url of the CSS file cssUrl = this._document.styleSheets[i].href.split('js/document/templates/montage-html')[1]; - //Creating the URI of the file + //Creating the URI of the file (this is wrong should not be splitting cssUrl) fileUri = this.application.ninja.coreIoApi.cloudData.root+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+cssUrl.split('/')[1]; //Loading the data from the file cssData = this.application.ninja.coreIoApi.readFile({uri: fileUri}); //Creating tag with file content - tag = document.createElement('style'); - tag.ninjauri = fileUri; + tag = this.iframe.contentWindow.document.createElement('style'); + tag.setAttribute('ninjauri', fileUri); + tag.setAttribute('ninjafileurl', cssUrl); tag.innerHTML = cssData.content; - this._templateDocument.head.appendChild(tag); + //Looping through DOM to insert style tag at location of link element + query = this._templateDocument.html.querySelectorAll(['link']); + for (var j in query) { + if (query[j].href === this._document.styleSheets[i].href) { + //Disabling style sheet to reload via inserting in style tag + query[j].setAttribute('disabled', 'true'); + //Inserting tag + this._templateDocument.head.insertBefore(tag, query[j]); + } + } } } } //TODO: Revisit this logic - this._styles = this._document.styleSheets[this._document.styleSheets.length - 1]; + this._styles = this._document.styleSheets[1]; this._stylesheets = this._document.styleSheets; // Entire stlyesheets array + console.log(this._document.styleSheets); - this._templateDocument.body.innerHTML = this._userDocument.content.body; - - - - + //////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////// //TODO Finish this implementation once we start caching Core Elements // Assign a model to the UserContent and add the ViewPort reference to it. -- cgit v1.2.3 From 5da4627fe899c03e885d10a77a5e33bb15875504 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 22 Feb 2012 13:38:09 -0800 Subject: Removed css not needed in Ninja Template --- js/document/html-document.js | 1 + js/document/templates/montage-html/index.html | 1 - js/document/templates/montage-html/styles.css | 5 ----- 3 files changed, 1 insertion(+), 6 deletions(-) delete mode 100755 js/document/templates/montage-html/styles.css (limited to 'js') diff --git a/js/document/html-document.js b/js/document/html-document.js index 02e9918f..ba5eea79 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -425,6 +425,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { tag = this.iframe.contentWindow.document.createElement('style'); tag.setAttribute('ninjauri', fileUri); tag.setAttribute('ninjafileurl', cssUrl); + tag.setAttribute('ninjafilename', cssUrl.split('/')[cssUrl.split('/').length-1]); tag.innerHTML = cssData.content; //Looping through DOM to insert style tag at location of link element query = this._templateDocument.html.querySelectorAll(['link']); diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html index 8b3d73bb..edfab2b0 100755 --- a/js/document/templates/montage-html/index.html +++ b/js/document/templates/montage-html/index.html @@ -12,7 +12,6 @@ Ninja Prototype - diff --git a/js/document/templates/montage-html/styles.css b/js/document/templates/montage-html/styles.css deleted file mode 100755 index 0441c1cf..00000000 --- a/js/document/templates/montage-html/styles.css +++ /dev/null @@ -1,5 +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. -
*/ \ No newline at end of file -- cgit v1.2.3 From 3524a22fa0745bb223ab6bcc312ca970a001157f Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 22 Feb 2012 16:45:19 -0800 Subject: Logic to save