diff --git a/src/app.js b/src/app.js index f6dd0f8c3b..0659785e1b 100644 --- a/src/app.js +++ b/src/app.js @@ -13,7 +13,7 @@ var OffsetToLineColumnConverter = require('./lib/offsetToLineColumnConverter') var QueryParams = require('./lib/query-params') var GistHandler = require('./lib/gist-handler') var helper = require('./lib/helper') -var Storage = require('./storage') +var Storage = remixLib.Storage var Browserfiles = require('./app/files/browser-files') var chromeCloudStorageSync = require('./app/files/chromeCloudStorageSync') var SharedFolder = require('./app/files/shared-folder') @@ -38,8 +38,8 @@ var ContextualListener = require('./app/editor/contextualListener') var ContextView = require('./app/editor/contextView') var BasicReadOnlyExplorer = require('./app/files/basicReadOnlyExplorer') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` html { box-sizing: border-box; } diff --git a/src/app/editor/contextView.js b/src/app/editor/contextView.js index 56beacaab5..e8bce3f24d 100644 --- a/src/app/editor/contextView.js +++ b/src/app/editor/contextView.js @@ -2,8 +2,8 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var SourceMappingDecoder = remixLib.SourceMappingDecoder var css = csjs` diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 02183b32fb..88272973ff 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -12,8 +12,8 @@ require('brace/ext/language_tools') require('brace/ext/searchbox') var langTools = ace.acequire('ace/ext/language_tools') require('./mode-solidity.js') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() function setTheme (cb) { if (styles.appProperties.aceTheme) { diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index ab7abcc078..6e782a7acc 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -5,8 +5,8 @@ var copyToClipboard = require('../ui/copy-to-clipboard') // -------------- styling ---------------------- var csjs = require('csjs-inject') var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var EventManager = remixLib.EventManager var helper = require('../../lib/helper') diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 27ad8034be..2e2673895e 100755 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -9,8 +9,8 @@ var EventManager = remixLib.EventManager var helper = require('../../lib/helper') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .fileexplorer { diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 1414ec554b..605e8995ec 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -2,8 +2,8 @@ var csjs = require('csjs-inject') var yo = require('yo-yo') var remixLib = require('remix-lib') var EventManager = remixLib.EventManager -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var Terminal = require('./terminal') diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 558587a736..bb4015ff32 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -12,8 +12,8 @@ var QueryParams = require('../../lib/query-params') var queryParams = new QueryParams() var helper = require('../../lib/helper') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() module.exports = filepanel diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 843a925b55..f870913867 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -13,8 +13,8 @@ var PluginManager = require('../../pluginManager') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` #righthand-panel { diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index c89d52684d..914799689a 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -10,10 +10,12 @@ var Web3 = require('web3') var executionContext = require('../../execution-context') var Dropdown = require('../ui/dropdown') + // -------------- styling ---------------------- var csjs = require('csjs-inject') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() + +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .panel { diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index 1805f43e60..508958e589 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -6,8 +6,8 @@ var remixLib = require('remix-lib') var utils = remixLib.util var csjs = require('csjs-inject') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var EventManager = remixLib.EventManager diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 3f8fde60ff..bf17e4037a 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -1,10 +1,10 @@ var yo = require('yo-yo') +var remixLib = require('remix-lib') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .analysisTabView { diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 702d28c75d..7e801d9806 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -9,12 +9,12 @@ var modalDialog = require('../ui/modaldialog') var modalDialogCustom = require('../ui/modal-dialog-custom') var TreeView = require('remix-debugger').ui.TreeView var copyToClipboard = require('../ui/copy-to-clipboard') +var remixLib = require('remix-lib') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = remixLib.ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .compileTabView { diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index 1fe289baff..a0a03f6bdd 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -1,10 +1,8 @@ var yo = require('yo-yo') - // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = require('remix-lib').ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .debuggerTabView { diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 52b9f949c4..510f7abd69 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -13,9 +13,8 @@ var EventManager = require('remix-lib').EventManager // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = require('remix-lib').ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .runTabView { diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 924c027386..2348b92362 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -2,12 +2,13 @@ var $ = require('jquery') var yo = require('yo-yo') var QueryParams = require('../../lib/query-params') +var remixLib = require('remix-lib') +var Storage = remixLib.Storage +var styleGuide = remixLib.ui.themeChooser // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styles = styleGuide.chooser() var helper = require('../../lib/helper') var modal = require('../ui/modal-dialog-custom') @@ -28,6 +29,9 @@ var css = csjs` padding: .5em; font-weight: bold; } + .crow label { + cursor:pointer; + } .crowNoFlex { overflow: auto; clear: both; @@ -37,15 +41,30 @@ var css = csjs` .select { ${styles.rightPanel.settingsTab.dropdown_SelectCompiler} } + .heading { + margin-bottom: 0; + } + .explaination { + margin-top: 3px; + margin-bottom: 3px; + } input { - margin-right: 3px; + margin-right: 5px; + cursor: pointer; + } + input[type=radio] { + margin-top: 2px; } .pluginTextArea { font-family: unset; + margin-top: 5px; } .pluginLoad { vertical-align: top; } + i.warnIt { + color: ${styles.appProperties.warningText_Color}; + } } ` module.exports = SettingsTab @@ -79,13 +98,25 @@ function SettingsTab (container, appAPI, appEvents, opts) { Enable Optimization
+

Themes ( Selecting a theme will trigger a page reload )

+
+ + +
+
+ + +
+
-
Plugin ( Do not use this alpha feature if you are not sure what you are doing!)
-
+
Plugin ( Do not use this alpha feature if you are not sure what you are doing! ) +
+
+
-
+
` @@ -124,6 +155,29 @@ function SettingsTab (container, appAPI, appEvents, opts) { appAPI.setOptimize(optimize, true) }) + var themeStorage = new Storage('style:') + var currTheme = themeStorage.get('theme') + var themeDark = el.querySelector('#themeDark') + var themeLight = el.querySelector('#themeLight') + + if (currTheme === 'dark') { + themeDark.setAttribute('checked', 'checked') + } else { + themeLight.setAttribute('checked', 'checked') + } + + themeDark.addEventListener('change', function () { + console.log('change dark theme') + styleGuide.switchTheme('dark') + window.location.reload() + }) + + themeLight.addEventListener('change', function () { + console.log('change to light theme') + styleGuide.switchTheme('light') + window.location.reload() + }) + // ----------------- version selector------------- // clear and disable the version selector diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index f1e1f83be1..0d91e47978 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -2,9 +2,8 @@ var yo = require('yo-yo') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remixLib = require('remix-lib') -var styleGuide = remixLib.ui.styleGuide -var styles = styleGuide() +var styleGuide = require('remix-lib').ui.themeChooser +var styles = styleGuide.chooser() var css = csjs` .supportTabView { @@ -78,7 +77,6 @@ function supportTab (container, appAPI, events, opts) {
-
ethereum/remix community chat