Skip to content

Commit 131ec49

Browse files
committed
1.0.81
1 parent 0151bd1 commit 131ec49

File tree

5 files changed

+68
-28
lines changed

5 files changed

+68
-28
lines changed

manifest.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"version": "1.0.80",
2+
"version": "1.0.81",
33
"manifest_version": 2,
44
"minimum_chrome_version": "51",
55
"name": "Code Pad IDE",
66
"short_name": "Code Pad IDE",
7-
"description": "An multi-language code IDE / text editor crafted for ChromeOS, built as a hobby free to use and amend!",
7+
"description": "An multi-language code IDE / text editor crafted for the Chrome OS, built as a hobby, free to use and to amend!",
88
"author": "Andrew Borg",
99
"homepage_url": "https://github.com/andrewbrg/codepad-chrome-app",
1010
"offline_enabled": true,
@@ -108,7 +108,34 @@
108108
"types": [
109109
"text/*",
110110
"image/svg+xml",
111-
"application/*"
111+
"application/x-bsh",
112+
"application/java",
113+
"application/java-byte-code",
114+
"application/x-java-class",
115+
"application/x-x509-ca-cert",
116+
"application/x-x509-user-cert",
117+
"application/pkix-cert",
118+
"application/x-csh",
119+
"application/x-pointplus",
120+
"application/x-javascript",
121+
"application/javascript",
122+
"application/ecmascript",
123+
"application/rtf",
124+
"application/x-rtf",
125+
"application/x-lisp",
126+
"application/x-bytecode.python",
127+
"application/x-bsh",
128+
"application/x-sh",
129+
"application/x-shar",
130+
"application/xml",
131+
"application/plain",
132+
"application/x-pkcs7-signature",
133+
"application/pkcs7-mime",
134+
"application/x-pkcs7-mime",
135+
"application/pkcs7-mime",
136+
"application/x-pkcs7-mime",
137+
"application/x-pkcs7-certreqresp",
138+
"application/pkcs7-signature"
112139
]
113140
}
114141
},

src/html/modals/file/confirm.close.tab.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<p class="text-center">This file has been modified, do you want to save your changes?</p>
33
<div class="row">
44
<div class="col-4">
5-
<button class="action-save-tab btn btn-primary btn-sm btn-expanded" type="button" aria-label="Save">
5+
<button class="action-save btn btn-primary btn-sm btn-expanded" type="button" aria-label="Save">
66
<i class="fa fa-fw fa-check"></i>&nbsp;Save
77
</button>
88
</div>

src/js/handlers/editors.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var EditorsHandler = function () {
2626
this.defaultFileExt = null;
2727
this.undefinedFileMode = null;
2828
this.undefinedFileIcon = null;
29-
29+
this.undefinedFileName = null;
3030

3131
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3232
/// Private Helper
@@ -60,6 +60,8 @@ var EditorsHandler = function () {
6060
that.undefinedFileMode = data.undefinedFile.mode;
6161
// noinspection JSUnresolvedVariable
6262
that.undefinedFileIcon = data.undefinedFile.icon;
63+
// noinspection JSUnresolvedVariable
64+
that.undefinedFileName = data.undefinedFile.name;
6365

6466
deferred.resolve();
6567
});
@@ -256,27 +258,25 @@ var EditorsHandler = function () {
256258
return false;
257259
}
258260

259-
var that = this;
261+
var that = this;
262+
var aceEditor = this.getEditor(idx);
263+
264+
if (typeof aceEditor === typeof undefined) {
265+
return false;
266+
}
260267

261268
idx = parseInt(idx);
262-
if (typeof fileEntry !== typeof undefined) {
263-
chrome.fileSystem.getDisplayPath(fileEntry, function (path) {
264-
var aceEditor = that.getEditor(idx);
265-
if (typeof aceEditor !== typeof undefined) {
269+
this._getTabMode(idx).then(function (data) {
270+
if (JSON.parse(data).mode === that.undefinedFileMode) {
271+
chrome.fileSystem.getDisplayPath(fileEntry, function (path) {
266272
that.getEditor(idx).setOption('mode', that.Modelist.getModeForPath(path).mode);
267273
that._populateStatusBar(idx);
268-
}
269-
});
270-
}
271-
else {
272-
this._getTabMode(idx).then(function (data) {
273-
var aceEditor = that.getEditor(idx);
274-
if (typeof aceEditor !== typeof undefined) {
275-
that.getEditor(idx).setOption('mode', 'ace/mode/' + JSON.parse(data).mode);
276-
that._populateStatusBar(idx);
277-
}
278-
});
279-
}
274+
});
275+
} else {
276+
that.getEditor(idx).setOption('mode', 'ace/mode/' + JSON.parse(data).mode);
277+
that._populateStatusBar(idx);
278+
}
279+
});
280280
};
281281

282282
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -391,7 +391,7 @@ var EditorsHandler = function () {
391391
deferred.resolve(JSON.stringify({
392392
"icon": that.undefinedFileIcon,
393393
"mode": that.undefinedFileMode,
394-
"name": "Text"
394+
"name": that.undefinedFileName
395395
}));
396396
}
397397
if (data.hasOwnProperty(ext)) {
@@ -664,7 +664,7 @@ var EditorsHandler = function () {
664664
}
665665
});
666666
});
667-
667+
668668
ace.require("ace/ext/chromevox");
669669
};
670670

src/js/handlers/files.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ var FilesHandler = function () {
153153

154154
var valid = false;
155155

156-
console.log(file.type);
157-
158156
if (typeof file.type === typeof undefined ||
159157
file.type === 'undefined' ||
160158
file.type === '') {

src/settings/ace.modes.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"json": {
5353
"icon": "icon-javascript-alt",
54-
"mode": "javascript",
54+
"mode": "json",
5555
"name": "JSON"
5656
},
5757
"less": {
@@ -84,6 +84,11 @@
8484
"mode": "perl",
8585
"name": "Perl"
8686
},
87+
"pgsql": {
88+
"icon": "devicon devicon-postgresql-plain",
89+
"mode": "pgsql",
90+
"name": "Postgre SQL"
91+
},
8792
"py": {
8893
"icon": "icon-python",
8994
"mode": "python",
@@ -109,6 +114,11 @@
109114
"mode": "scala",
110115
"name": "Scala"
111116
},
117+
"scss": {
118+
"icon": "icon-css3-alt",
119+
"mode": "scss",
120+
"name": "Scss"
121+
},
112122
"sql": {
113123
"icon": "icon-database",
114124
"mode": "sql",
@@ -119,8 +129,13 @@
119129
"mode": "typescript",
120130
"name": "TypeScript"
121131
},
132+
"vb": {
133+
"icon": "devicon devicon-visualstudio-plain",
134+
"mode": "vbscript",
135+
"name": "VB Script"
136+
},
122137
"txt": {
123-
"icon": "devicon devicon-devicon-plain",
138+
"icon": "devicon fa fa-file-text",
124139
"mode": "textfile",
125140
"name": "Plain text"
126141
},

0 commit comments

Comments
 (0)