From cd9be261e3d54070845c21b84bfc20891cabde31 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Sat, 10 Feb 2018 19:51:27 +0000 Subject: Minor code cleanup --- index.html | 4 +- main.js | 12 ++--- renderer.js | 10 ++-- style.css | 124 ------------------------------------------------- styles/style.css | 124 +++++++++++++++++++++++++++++++++++++++++++++++++ styles/table-style.css | 43 +++++++++++++++++ table-style.css | 43 ----------------- 7 files changed, 180 insertions(+), 180 deletions(-) delete mode 100644 style.css create mode 100644 styles/style.css create mode 100644 styles/table-style.css delete mode 100644 table-style.css diff --git a/index.html b/index.html index 3c85b64..2b6547c 100644 --- a/index.html +++ b/index.html @@ -7,8 +7,8 @@ - - + +
diff --git a/main.js b/main.js index c85b9ab..5f4342b 100644 --- a/main.js +++ b/main.js @@ -6,7 +6,7 @@ const url = require("url"); let uiWindow; let queryExecutorProcess; -function createMainWindow () { +function createMainWindow() { uiWindow = new BrowserWindow({ width: 800, height: 600 @@ -17,7 +17,7 @@ function createMainWindow () { slashes: true })); - uiWindow.on("closed", function () { + uiWindow.on("closed", () => { uiWindow = null; app.quit(); }); @@ -34,24 +34,24 @@ function createQueryExecutorProcess() { slashes: true })); - queryExecutorProcess.on("closed", function () { + queryExecutorProcess.on("closed", () => { queryExecutorProcess = null; }); } -app.on("ready", function() { +app.on("ready", () => { createMainWindow(); createQueryExecutorProcess(); }); -app.on("window-all-closed", function () { +app.on("window-all-closed", () => { if (process.platform !== "darwin") { app.quit(); } }); -app.on("activate", function () { +app.on("activate", () => { if (uiWindow === null) { createWindow(); } diff --git a/renderer.js b/renderer.js index a7da9da..b7da806 100644 --- a/renderer.js +++ b/renderer.js @@ -48,7 +48,7 @@ ipcRenderer.on("queryExecutor.runQueryComplete", (event, response) => { function _startExecTimer() { execStartTime = new Date; execElapsedTime = 0; - execTimerInterval = setInterval(function () { + execTimerInterval = setInterval(() => { execElapsedTime = Date.now() - execStartTime; $("#execution-time").text("exec time: " + execElapsedTime + "ms"); }, 10); @@ -85,7 +85,7 @@ function handleResult(results) { } function _mapColumnProperties(results) { - return results.fields.map(function (column) { + return results.fields.map((column) => { return { "data": column.name, "title": column.name @@ -125,7 +125,7 @@ function _onKeyUp(event) { } } -$(document).ready(function () { +$(document).ready(() => { // Event handlers $("#run-query").click(runQuery); @@ -135,12 +135,12 @@ $(document).ready(function () { sizes: [50, 50], direction: "vertical", gutterSize: 10, - elementStyle: function (dimension, size, gutterSize) { + elementStyle: (dimension, size, gutterSize) => { return { "flex-basis": "calc(" + size + "% - " + gutterSize + "px" } }, - gutterStyle: function (dimension, gutterSize) { + gutterStyle: (dimension, gutterSize) => { return { "flex-basis": gutterSize + "px" } diff --git a/style.css b/style.css deleted file mode 100644 index f6b8313..0000000 --- a/style.css +++ /dev/null @@ -1,124 +0,0 @@ -html, -body { - height: 100%; - margin: 0 -} - -::-webkit-scrollbar { - width: 10px; - height: 10px; -} - -::-webkit-scrollbar-track { - background: #474A5E; -} - -::-webkit-scrollbar-thumb { - background: #63677C; -} - -::-webkit-scrollbar-thumb:hover { - background: #555; -} -::-webkit-scrollbar-corner { - background: #63677C -} - -.flex-wrapper { - display: flex; - flex-flow: column; - height: 100%; -} - -.flex-wrapper .row.header { - flex: 0 1 auto; - background-color: #474A5E; - color: white; -} - -.flex-wrapper .row.content { - flex: 1 1 auto; - display: flex; - flex-direction: column; - height: 100%; -} - -.flex-wrapper .row.footer { - flex: 0 1 auto; - background-color: #474A5E; - color: white; - display: flex; - flex-direction: row; - font-family: monospace; - align-items: center; -} - -.flex-wrapper .row .split-row { - overflow: auto; -} - -.gutter { - background-color: #474A5E; - background-repeat: no-repeat; - background-position: 50%; -} - -.gutter.gutter-vertical { - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII='); - cursor: ns-resize; -} - -.gutter.gutter-horizontal { - background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg=='); - cursor: ew-resize; -} - -.CodeMirror { - height: 100%; -} - -.results-row { - color: #ffffff; - background-color: #282a36; - font-family: monospace; -} - -#result-error { - padding: 5px; -} - -#execution-status { - padding: 2px; - flex-basis: 60px; - text-align: center; - font-weight: bold; -} - -#execution-time { - /* background-color: green; */ - flex-basis: auto; - padding: 2px 10px; -} - -#row-count { - background-color: blue; - flex-basis: auto; -} - -.exec-idle { - background-color: gray; -} - -.exec-running { - background-color: yellow; - color: black; -} - -.exec-ok { - background-color: green; -} - -.exec-error { - background-color: red; - color: black; -} \ No newline at end of file diff --git a/styles/style.css b/styles/style.css new file mode 100644 index 0000000..f6b8313 --- /dev/null +++ b/styles/style.css @@ -0,0 +1,124 @@ +html, +body { + height: 100%; + margin: 0 +} + +::-webkit-scrollbar { + width: 10px; + height: 10px; +} + +::-webkit-scrollbar-track { + background: #474A5E; +} + +::-webkit-scrollbar-thumb { + background: #63677C; +} + +::-webkit-scrollbar-thumb:hover { + background: #555; +} +::-webkit-scrollbar-corner { + background: #63677C +} + +.flex-wrapper { + display: flex; + flex-flow: column; + height: 100%; +} + +.flex-wrapper .row.header { + flex: 0 1 auto; + background-color: #474A5E; + color: white; +} + +.flex-wrapper .row.content { + flex: 1 1 auto; + display: flex; + flex-direction: column; + height: 100%; +} + +.flex-wrapper .row.footer { + flex: 0 1 auto; + background-color: #474A5E; + color: white; + display: flex; + flex-direction: row; + font-family: monospace; + align-items: center; +} + +.flex-wrapper .row .split-row { + overflow: auto; +} + +.gutter { + background-color: #474A5E; + background-repeat: no-repeat; + background-position: 50%; +} + +.gutter.gutter-vertical { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII='); + cursor: ns-resize; +} + +.gutter.gutter-horizontal { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg=='); + cursor: ew-resize; +} + +.CodeMirror { + height: 100%; +} + +.results-row { + color: #ffffff; + background-color: #282a36; + font-family: monospace; +} + +#result-error { + padding: 5px; +} + +#execution-status { + padding: 2px; + flex-basis: 60px; + text-align: center; + font-weight: bold; +} + +#execution-time { + /* background-color: green; */ + flex-basis: auto; + padding: 2px 10px; +} + +#row-count { + background-color: blue; + flex-basis: auto; +} + +.exec-idle { + background-color: gray; +} + +.exec-running { + background-color: yellow; + color: black; +} + +.exec-ok { + background-color: green; +} + +.exec-error { + background-color: red; + color: black; +} \ No newline at end of file diff --git a/styles/table-style.css b/styles/table-style.css new file mode 100644 index 0000000..fda66d0 --- /dev/null +++ b/styles/table-style.css @@ -0,0 +1,43 @@ +table.dataTable thead .sorting { + background-image: url("./images/sort_both.png"); +} +table.dataTable thead .sorting_asc { + background-image: url("./images/sort_asc.png"); +} +table.dataTable thead .sorting_desc { + background-image: url("./images/sort_desc.png"); +} +table.dataTable thead .sorting_asc_disabled { + background-image: url("./images/sort_asc_disabled.png"); +} +table.dataTable thead .sorting_desc_disabled { + background-image: url("./images/sort_desc_disabled.png"); +} +table.dataTable tbody tr { + background-color: #282a36; +} +table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { + background-color: #474A5E; +} +table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover { + background-color: #262834; +} +table.dataTable.order-column tbody tr > .sorting_1, +table.dataTable.order-column tbody tr > .sorting_2, +table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1, +table.dataTable.display tbody tr > .sorting_2, +table.dataTable.display tbody tr > .sorting_3 { + background-color: #4F4837; +} +table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 { + background-color: #897E63; +} +table.dataTable.display tbody tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 { + background-color: #897E63; +} +table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 { + background-color: #4F4837; +} +table.dataTable.display tbody tr:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1 { + background-color: #242631; +} \ No newline at end of file diff --git a/table-style.css b/table-style.css deleted file mode 100644 index fda66d0..0000000 --- a/table-style.css +++ /dev/null @@ -1,43 +0,0 @@ -table.dataTable thead .sorting { - background-image: url("./images/sort_both.png"); -} -table.dataTable thead .sorting_asc { - background-image: url("./images/sort_asc.png"); -} -table.dataTable thead .sorting_desc { - background-image: url("./images/sort_desc.png"); -} -table.dataTable thead .sorting_asc_disabled { - background-image: url("./images/sort_asc_disabled.png"); -} -table.dataTable thead .sorting_desc_disabled { - background-image: url("./images/sort_desc_disabled.png"); -} -table.dataTable tbody tr { - background-color: #282a36; -} -table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { - background-color: #474A5E; -} -table.dataTable.hover tbody tr:hover, table.dataTable.display tbody tr:hover { - background-color: #262834; -} -table.dataTable.order-column tbody tr > .sorting_1, -table.dataTable.order-column tbody tr > .sorting_2, -table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1, -table.dataTable.display tbody tr > .sorting_2, -table.dataTable.display tbody tr > .sorting_3 { - background-color: #4F4837; -} -table.dataTable.display tbody tr.odd > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 { - background-color: #897E63; -} -table.dataTable.display tbody tr.odd.selected > .sorting_1, table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 { - background-color: #897E63; -} -table.dataTable.display tbody tr.even > .sorting_1, table.dataTable.order-column.stripe tbody tr.even > .sorting_1 { - background-color: #4F4837; -} -table.dataTable.display tbody tr:hover > .sorting_1, table.dataTable.order-column.hover tbody tr:hover > .sorting_1 { - background-color: #242631; -} \ No newline at end of file -- cgit v1.2.3