diff --git a/manifest.json b/manifest.json index 64e5690..1e16bb2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { - "version": "1.0.80", + "version": "1.0.81", "manifest_version": 2, "minimum_chrome_version": "51", "name": "Code Pad IDE", "short_name": "Code Pad IDE", - "description": "An multi-language code IDE / text editor crafted for ChromeOS, built as a hobby free to use and amend!", + "description": "An multi-language code IDE / text editor crafted for the Chrome OS, built as a hobby, free to use and to amend!", "author": "Andrew Borg", "homepage_url": "https://github.com/andrewbrg/codepad-chrome-app", "offline_enabled": true, @@ -108,7 +108,34 @@ "types": [ "text/*", "image/svg+xml", - "application/*" + "application/x-bsh", + "application/java", + "application/java-byte-code", + "application/x-java-class", + "application/x-x509-ca-cert", + "application/x-x509-user-cert", + "application/pkix-cert", + "application/x-csh", + "application/x-pointplus", + "application/x-javascript", + "application/javascript", + "application/ecmascript", + "application/rtf", + "application/x-rtf", + "application/x-lisp", + "application/x-bytecode.python", + "application/x-bsh", + "application/x-sh", + "application/x-shar", + "application/xml", + "application/plain", + "application/x-pkcs7-signature", + "application/pkcs7-mime", + "application/x-pkcs7-mime", + "application/pkcs7-mime", + "application/x-pkcs7-mime", + "application/x-pkcs7-certreqresp", + "application/pkcs7-signature" ] } }, diff --git a/src/html/modals/file/confirm.close.tab.html b/src/html/modals/file/confirm.close.tab.html index ccf154e..e4863d1 100644 --- a/src/html/modals/file/confirm.close.tab.html +++ b/src/html/modals/file/confirm.close.tab.html @@ -2,7 +2,7 @@

This file has been modified, do you want to save your changes?

-
diff --git a/src/js/handlers/editors.js b/src/js/handlers/editors.js index c34625d..98e9c0c 100644 --- a/src/js/handlers/editors.js +++ b/src/js/handlers/editors.js @@ -26,7 +26,7 @@ var EditorsHandler = function () { this.defaultFileExt = null; this.undefinedFileMode = null; this.undefinedFileIcon = null; - + this.undefinedFileName = null; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Private Helper @@ -60,6 +60,8 @@ var EditorsHandler = function () { that.undefinedFileMode = data.undefinedFile.mode; // noinspection JSUnresolvedVariable that.undefinedFileIcon = data.undefinedFile.icon; + // noinspection JSUnresolvedVariable + that.undefinedFileName = data.undefinedFile.name; deferred.resolve(); }); @@ -256,27 +258,25 @@ var EditorsHandler = function () { return false; } - var that = this; + var that = this; + var aceEditor = this.getEditor(idx); + + if (typeof aceEditor === typeof undefined) { + return false; + } idx = parseInt(idx); - if (typeof fileEntry !== typeof undefined) { - chrome.fileSystem.getDisplayPath(fileEntry, function (path) { - var aceEditor = that.getEditor(idx); - if (typeof aceEditor !== typeof undefined) { + this._getTabMode(idx).then(function (data) { + if (JSON.parse(data).mode === that.undefinedFileMode) { + chrome.fileSystem.getDisplayPath(fileEntry, function (path) { that.getEditor(idx).setOption('mode', that.Modelist.getModeForPath(path).mode); that._populateStatusBar(idx); - } - }); - } - else { - this._getTabMode(idx).then(function (data) { - var aceEditor = that.getEditor(idx); - if (typeof aceEditor !== typeof undefined) { - that.getEditor(idx).setOption('mode', 'ace/mode/' + JSON.parse(data).mode); - that._populateStatusBar(idx); - } - }); - } + }); + } else { + that.getEditor(idx).setOption('mode', 'ace/mode/' + JSON.parse(data).mode); + that._populateStatusBar(idx); + } + }); }; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -391,7 +391,7 @@ var EditorsHandler = function () { deferred.resolve(JSON.stringify({ "icon": that.undefinedFileIcon, "mode": that.undefinedFileMode, - "name": "Text" + "name": that.undefinedFileName })); } if (data.hasOwnProperty(ext)) { @@ -664,7 +664,7 @@ var EditorsHandler = function () { } }); }); - + ace.require("ace/ext/chromevox"); }; diff --git a/src/js/handlers/files.js b/src/js/handlers/files.js index ca53311..8aa3818 100644 --- a/src/js/handlers/files.js +++ b/src/js/handlers/files.js @@ -153,8 +153,6 @@ var FilesHandler = function () { var valid = false; - console.log(file.type); - if (typeof file.type === typeof undefined || file.type === 'undefined' || file.type === '') { diff --git a/src/settings/ace.modes.json b/src/settings/ace.modes.json index 71ecf51..04c8056 100644 --- a/src/settings/ace.modes.json +++ b/src/settings/ace.modes.json @@ -51,7 +51,7 @@ }, "json": { "icon": "icon-javascript-alt", - "mode": "javascript", + "mode": "json", "name": "JSON" }, "less": { @@ -84,6 +84,11 @@ "mode": "perl", "name": "Perl" }, + "pgsql": { + "icon": "devicon devicon-postgresql-plain", + "mode": "pgsql", + "name": "Postgre SQL" + }, "py": { "icon": "icon-python", "mode": "python", @@ -109,6 +114,11 @@ "mode": "scala", "name": "Scala" }, + "scss": { + "icon": "icon-css3-alt", + "mode": "scss", + "name": "Scss" + }, "sql": { "icon": "icon-database", "mode": "sql", @@ -119,8 +129,13 @@ "mode": "typescript", "name": "TypeScript" }, + "vb": { + "icon": "devicon devicon-visualstudio-plain", + "mode": "vbscript", + "name": "VB Script" + }, "txt": { - "icon": "devicon devicon-devicon-plain", + "icon": "devicon fa fa-file-text", "mode": "textfile", "name": "Plain text" },