From 292616100724ea5572aad75d3c2df1edee4a791f Mon Sep 17 00:00:00 2001 From: sgupta7857 Date: Fri, 21 Apr 2017 18:21:37 -0400 Subject: [PATCH 1/2] disable-lint --- locales/en-US/messages.properties | 2 ++ .../scripts/editor/js/fc/bramble-menus.js | 17 +++++++++++++++++ server/routes/auth/oauth2-callback.js | 6 +----- views/editor/nav-options.html | 7 +++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/locales/en-US/messages.properties b/locales/en-US/messages.properties index 76bb05c21..c311798c8 100644 --- a/locales/en-US/messages.properties +++ b/locales/en-US/messages.properties @@ -102,6 +102,7 @@ navTextSize=Text size navColorTheme=Color theme navWrapText=Wrap long lines navAllowJS=Allow JavaScript +navAllowLS=Allow Linting navPreview=PREVIEW navViewTutorial=TUTORIAL navToggleAutoUpdateTitle=Toggle Preview Auto-refresh @@ -197,6 +198,7 @@ navDarkThemeIconTitle=Switch to the dark theme navLightThemeIconTitle=Switch to the light theme navWrapTextTitle=Toggle wrapping long lines of code navAllowJSTitle=Toggle running JavaScript code in the preview +navAllowLSTitle=Toggle running interactive-linting navPreviewTitle=View the Preview navViewTutorialTitle=View the Project Tutorial navDOMElementInspectorIconTitle=Toggle Element Inspector diff --git a/public/editor/scripts/editor/js/fc/bramble-menus.js b/public/editor/scripts/editor/js/fc/bramble-menus.js index 45c52baab..afe5c2e9b 100644 --- a/public/editor/scripts/editor/js/fc/bramble-menus.js +++ b/public/editor/scripts/editor/js/fc/bramble-menus.js @@ -78,7 +78,24 @@ define(function(require) { return false; }); + $("#allow-lint-toggle").click(function() { + // Toggle current value + var $allowWSToggle = $("#allow-lint-toggle"); + var toggle = !($allowWSToggle.hasClass("switch-enabled")); + + if(toggle) { + $allowWSToggle.addClass("switch-enabled"); + bramble.enablelint(); + analytics.event("EnableLintIndicator"); + } else { + $allowWSToggle.removeClass("switch-enabled"); + bramble.disablelint(); + analytics.event("DisablelintIndicator"); + } + + return false; + }); // Theme Toggle function lightThemeUI() { diff --git a/server/routes/auth/oauth2-callback.js b/server/routes/auth/oauth2-callback.js index dfc6a00cb..2b22bef73 100644 --- a/server/routes/auth/oauth2-callback.js +++ b/server/routes/auth/oauth2-callback.js @@ -145,11 +145,7 @@ module.exports = function(config, req, res, next) { ); } - // Was this sign-in triggered from the home page? - if (req.session.home) { - delete req.session.home; - return res.redirect(301, path.join("/", locale)); - } + res.redirect(301, path.join("/", locale, "/editor")); }); diff --git a/views/editor/nav-options.html b/views/editor/nav-options.html index 2025a91fd..243ad0d4c 100644 --- a/views/editor/nav-options.html +++ b/views/editor/nav-options.html @@ -93,6 +93,13 @@
+
  • + {{ gettext("navAllowLS") }} +
    +
    +
    +
    +
  • From ef910a1fb7b0aa8b1e3dd8376274cd3efa7d8641 Mon Sep 17 00:00:00 2001 From: sgupta7857 Date: Wed, 26 Apr 2017 16:29:26 -0400 Subject: [PATCH 2/2] toggle-lint --- .../scripts/editor/js/fc/bramble-menus.js | 20 +------------------ server/routes/auth/oauth2-callback.js | 6 +++++- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/public/editor/scripts/editor/js/fc/bramble-menus.js b/public/editor/scripts/editor/js/fc/bramble-menus.js index afe5c2e9b..b7db5d0c1 100644 --- a/public/editor/scripts/editor/js/fc/bramble-menus.js +++ b/public/editor/scripts/editor/js/fc/bramble-menus.js @@ -77,25 +77,7 @@ define(function(require) { } return false; - }); - $("#allow-lint-toggle").click(function() { - // Toggle current value - var $allowWSToggle = $("#allow-lint-toggle"); - var toggle = !($allowWSToggle.hasClass("switch-enabled")); - - if(toggle) { - $allowWSToggle.addClass("switch-enabled"); - bramble.enablelint(); - analytics.event("EnableLintIndicator"); - } else { - $allowWSToggle.removeClass("switch-enabled"); - bramble.disablelint(); - analytics.event("DisablelintIndicator"); - } - - return false; - - }); + }); // Theme Toggle function lightThemeUI() { diff --git a/server/routes/auth/oauth2-callback.js b/server/routes/auth/oauth2-callback.js index 2b22bef73..dfc6a00cb 100644 --- a/server/routes/auth/oauth2-callback.js +++ b/server/routes/auth/oauth2-callback.js @@ -145,7 +145,11 @@ module.exports = function(config, req, res, next) { ); } - + // Was this sign-in triggered from the home page? + if (req.session.home) { + delete req.session.home; + return res.redirect(301, path.join("/", locale)); + } res.redirect(301, path.join("/", locale, "/editor")); });