summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2017-07-30 01:24:47 -0700
committerMatthew Sotoudeh <matthewsot@outlook.com>2017-07-30 01:24:47 -0700
commit07e017d83b2743ee63689d640df6189b57e1a967 (patch)
tree2739216ecce2c5f952748a1b72720e5f00a500d2
parent7fcc2db0aa72a64afac5adca9311049c79822710 (diff)
updates
-rw-r--r--.gitignore1
m---------asm-yaepl0
-rw-r--r--content/scripts/editor.js1
-rw-r--r--content/scripts/open-save.js33
-rw-r--r--content/styles/editor.css3
-rw-r--r--package.json4
6 files changed, 23 insertions, 19 deletions
diff --git a/.gitignore b/.gitignore
index 346ace5..96ae97b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
*.swp
*.swo
*.lock
+dist/**
# Logs
logs
diff --git a/asm-yaepl b/asm-yaepl
-Subproject cedf133c77195dedc731c60b52d379941a78e8b
+Subproject 4c3c7de3e8b2375dd90a0a4b9922b0e4a9cf0c1
diff --git a/content/scripts/editor.js b/content/scripts/editor.js
index 792c21b..d0cc59f 100644
--- a/content/scripts/editor.js
+++ b/content/scripts/editor.js
@@ -8,6 +8,7 @@ var editorArea = document.getElementById("editor");
var editor = CodeMirror.fromTextArea(editorArea, {
lineNumbers: true,
autofocus: true,
+ indentUnit: 4,
mode: window.lang,
});
diff --git a/content/scripts/open-save.js b/content/scripts/open-save.js
index 1a92fb8..eaa603f 100644
--- a/content/scripts/open-save.js
+++ b/content/scripts/open-save.js
@@ -4,17 +4,18 @@ var dialog = remote.require('electron').dialog;
window.fileName = null;
+var extension = { "javascript": "js", "yaepl": "yaepl" }[window.lang];
+var filter = { name: window.lang + " files", extensions: [extension] };
+
document.getElementById("open").onclick = function () {
- dialog.showOpenDialog({ filters: [
- { name: 'YAEPL Files', extensions: ['yaepl'] }
- ]},
- function (fileNames) {
- if (fileNames === undefined) return;
- window.fileName = fileNames[0];
- fs.readFile(window.fileName, 'utf-8', function (err, data) {
- editor.setValue(data);
+ dialog.showOpenDialog({ filters: [ filter] },
+ function (fileNames) {
+ if (fileNames === undefined) return;
+ window.fileName = fileNames[0];
+ fs.readFile(window.fileName, 'utf-8', function (err, data) {
+ editor.setValue(data);
+ });
});
- });
};
window.save = function () {
@@ -24,12 +25,10 @@ window.save = function () {
};
document.getElementById("save").onclick = function () {
- dialog.showSaveDialog({ filters: [
- { name: 'YAEPL Files', extensions: ['yaepl'] }
- ]},
- function (fileName) {
- if (fileName === undefined) return;
- window.fileName = fileName;
- window.save();
- });
+ dialog.showSaveDialog({ filters: [ filter ] },
+ function (fileName) {
+ if (fileName === undefined) return;
+ window.fileName = fileName;
+ window.save();
+ });
};
diff --git a/content/styles/editor.css b/content/styles/editor.css
index 9bc7fbc..cc2916f 100644
--- a/content/styles/editor.css
+++ b/content/styles/editor.css
@@ -39,5 +39,6 @@ main {
background-color: black;
text-align: left;
overflow: hidden;
- height: calc(100vh - 150px);
+ overflow-y: auto;
+ min-height: calc(100vh - 150px);
}
diff --git a/package.json b/package.json
index eda4b4a..195915c 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,9 @@
"scripts": {
"start": "electron .",
"pack": "electron-builder --dir",
- "dist": "electron-builder"
+ "distl": "electron-builder -l",
+ "distm": "electron-builder -m",
+ "distw": "electron-builder -w"
},
"repository": "https://github.com/matthewsot/yaepl-app",
"author": "Matthew Sotoudeh/Develop Academy",
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback