Browse Source

Revert "use codeflask for user css editor"

This reverts commit daa43e05727d4cd4d7b261a5be3faefab4263dcd.
Andrew Dolgov 8 months ago
parent
commit
be49b77b14
9 changed files with 24 additions and 55 deletions
  1. 6 1
      classes/pref/prefs.php
  2. 0 6
      css/default.css
  3. 1 1
      css/default.css.map
  4. 0 8
      css/prefs.less
  5. 16 28
      js/PrefHelpers.js
  6. 0 1
      lib/codeflask.min.js
  7. 0 3
      prefs.php
  8. 0 6
      themes/night.css
  9. 1 1
      themes/night.css.map

+ 6 - 1
classes/pref/prefs.php

@@ -992,7 +992,12 @@ class Pref_Prefs extends Handler_Protected {
 		print_hidden("method", "setpref");
 		print_hidden("key", "USER_STYLESHEET");
 
-		print "<div class='panel' id='user-css-editor'>$value</div>";
+		print "<table width='100%'><tr><td>";
+		print "<textarea dojoType=\"dijit.form.SimpleTextarea\"
+			style='font-size : 12px; width : 98%; height: 200px;'
+			placeHolder='body#ttrssMain { font-size : 14px; };'
+			name='value'>$value</textarea>";
+		print "</td></tr></table>";
 
 		print "<div class='dlgButtons'>";
 		print "<button dojoType=\"dijit.form.Button\"

+ 0 - 6
css/default.css

@@ -1434,12 +1434,6 @@ body.ttrss_prefs #header img {
   vertical-align: middle;
   cursor: pointer;
 }
-body.ttrss_prefs #user-css-editor {
-  height: 300px;
-}
-body.ttrss_prefs #user-css-editor .codeflask {
-  position: relative;
-}
 body.ttrss_prefs .dijitTree#filterTree .dijitTreeIcon,
 body.ttrss_prefs .dijitTree#labelTree .dijitTreeIcon,
 body.ttrss_prefs .dijitTree#filterTree .dijitTreeIcon {

File diff suppressed because it is too large
+ 1 - 1
css/default.css.map


+ 0 - 8
css/prefs.less

@@ -28,14 +28,6 @@ body.ttrss_prefs {
 		cursor : pointer;
 	}
 
-	#user-css-editor {
-		height : 300px;
-
-		.codeflask {
-			position : relative;
-		}
-	}
-
 	.dijitTree#filterTree .dijitTreeIcon,
 	.dijitTree#labelTree .dijitTreeIcon,
 	.dijitTree#filterTree .dijitTreeIcon {

+ 16 - 28
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?"))) {

File diff suppressed because it is too large
+ 0 - 1
lib/codeflask.min.js


+ 0 - 3
prefs.php

@@ -59,9 +59,6 @@
 			packages: [
 				{ name: "lib", location: "../" },
 				{ name: "fox", location: "../../js" },
-			],
-			aliases: [
-				[ "codeflask", "lib/codeflask.min.js" ]
 			]
 		};
 	</script>

+ 0 - 6
themes/night.css

@@ -1434,12 +1434,6 @@ body.ttrss_prefs #header img {
   vertical-align: middle;
   cursor: pointer;
 }
-body.ttrss_prefs #user-css-editor {
-  height: 300px;
-}
-body.ttrss_prefs #user-css-editor .codeflask {
-  position: relative;
-}
 body.ttrss_prefs .dijitTree#filterTree .dijitTreeIcon,
 body.ttrss_prefs .dijitTree#labelTree .dijitTreeIcon,
 body.ttrss_prefs .dijitTree#filterTree .dijitTreeIcon {

File diff suppressed because it is too large
+ 1 - 1
themes/night.css.map