diff --git a/src/web/utils/statusBar.mjs b/src/web/utils/statusBar.mjs index 0e85e0b5..a17e2e37 100644 --- a/src/web/utils/statusBar.mjs +++ b/src/web/utils/statusBar.mjs @@ -11,6 +11,7 @@ import {CHR_ENC_SIMPLE_LOOKUP, CHR_ENC_SIMPLE_REVERSE_LOOKUP} from "../../core/l * A Status bar extension for CodeMirror */ class StatusBarPanel { + /** * StatusBarPanel constructor * @param {Object} opts @@ -264,6 +265,7 @@ class StatusBarPanel { this.eolVal = state.lineBreak; } + /** * Sets the current character encoding of the document */ @@ -446,8 +448,7 @@ function hideOnClickOutside(element, instantiatingEvent) { const outsideClickListener = event => { // Don't trigger if we're clicking inside the element, or if the element // is not visible, or if this is the same click event that opened it. - if ( - !element.contains(event.target) && + if (!element.contains(event.target) && event.timeStamp !== instantiatingEvent.timeStamp) { hideElement(element); } diff --git a/src/web/waiters/ControlsWaiter.mjs b/src/web/waiters/ControlsWaiter.mjs index 5982be68..5c721d76 100755 --- a/src/web/waiters/ControlsWaiter.mjs +++ b/src/web/waiters/ControlsWaiter.mjs @@ -121,8 +121,8 @@ class ControlsWaiter { recipeConfig = recipeConfig || this.app.getRecipeConfig(); const link = baseURL || window.location.protocol + "//" + - window.location.host + - window.location.pathname; + window.location.host + + window.location.pathname; const recipeStr = Utils.generatePrettyRecipe(recipeConfig); includeRecipe = includeRecipe && (recipeConfig.length > 0); @@ -185,7 +185,7 @@ class ControlsWaiter { document.getElementById("save-text-chef").value = Utils.generatePrettyRecipe(recipeConfig, true); document.getElementById("save-text-clean").value = JSON.stringify(recipeConfig, null, 2) - .replace(/{\n\s+"/g, '{ "') + .replace(/{\n\s+"/g, "{ \"") .replace(/\[\n\s{3,}/g, "[") .replace(/\n\s{3,}]/g, "]") .replace(/\s*\n\s*}/g, " }") @@ -235,14 +235,14 @@ class ControlsWaiter { } const recipeName = Utils.escapeHtml(document.getElementById("save-name").value); - const recipeStr = document.querySelector("#save-texts .tab-pane.active textarea").value; + const recipeStr = document.querySelector("#save-texts .tab-pane.active textarea").value; if (!recipeName) { this.app.alert("Please enter a recipe name", 3000); return; } - const savedRecipes = localStorage.savedRecipes ? + const savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : []; let recipeId = localStorage.recipeId || 0; @@ -274,7 +274,7 @@ class ControlsWaiter { } // Add recipes to select - const savedRecipes = localStorage.savedRecipes ? + const savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : []; for (i = 0; i < savedRecipes.length; i++) { @@ -318,7 +318,7 @@ class ControlsWaiter { if (!this.app.isLocalStorageAvailable()) return false; const el = e.target; - const savedRecipes = localStorage.savedRecipes ? + const savedRecipes = localStorage.savedRecipes ? JSON.parse(localStorage.savedRecipes) : []; const id = parseInt(el.value, 10); @@ -429,7 +429,7 @@ ${navigator.userAgent} recList.style.bottom = controls.clientHeight + "px"; } - + } export default ControlsWaiter;