From be49b77b14ac724cf8b35f2f077cdfaf990c0a7e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 11 Dec 2018 20:48:17 +0300 Subject: Revert "use codeflask for user css editor" This reverts commit daa43e05727d4cd4d7b261a5be3faefab4263dcd. --- js/PrefHelpers.js | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) (limited to 'js/PrefHelpers.js') diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index f7ca2525f..a3d122029 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -103,39 +103,27 @@ define(["dojo/_base/declare"], function (declare) { dialog.show(); }, customizeCSS: function() { - require(["codeflask"], function(CodeFlask) { + const query = "backend.php?op=pref-prefs&method=customizeCSS"; - const query = "backend.php?op=pref-prefs&method=customizeCSS"; + if (dijit.byId("cssEditDlg")) + dijit.byId("cssEditDlg").destroyRecursive(); - if (dijit.byId("cssEditDlg")) - dijit.byId("cssEditDlg").destroyRecursive(); - - const dialog = new dijit.Dialog({ - id: "cssEditDlg", - title: __("Customize stylesheet"), - style: "width: 600px", - execute: function () { - Notify.progress('Saving data...', true); - - const params = this.attr('value'); - params.value = this._flask.getCode(); - - xhrPost("backend.php", params, () => { - window.location.reload(); - }); - - }, - href: query - }); + const dialog = new dijit.Dialog({ + id: "cssEditDlg", + title: __("Customize stylesheet"), + style: "width: 600px", + execute: function () { + Notify.progress('Saving data...', true); - dojo.connect(dialog, "onShow", function () { - setTimeout(() => { - dialog._flask = new CodeFlask('#user-css-editor', {language: 'css'}); - }, 250); - }); + xhrPost("backend.php", this.attr('value'), () => { + window.location.reload(); + }); - dialog.show(); + }, + href: query }); + + dialog.show(); }, confirmReset: function() { if (confirm(__("Reset to defaults?"))) { -- cgit v1.2.3