formatting

This commit is contained in:
e218736 2024-02-21 16:23:15 +00:00
parent 4c31c16eef
commit d79d412959
2 changed files with 11 additions and 10 deletions

View file

@ -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);
}

View file

@ -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,7 +235,7 @@ 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);