commit da0565aa2a6d3fb808f37fe013ff9a7cc9c78c8c
parent e7bbde2b42163bd6b9cc0f9cd31b7abadbe28d8e
Author: markseu <mark2011@mayberg.se>
Date: Mon, 21 Dec 2020 15:17:34 +0100
Updated edit extension, disabled buttons
Diffstat:
4 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/system/extensions/edit.css b/system/extensions/edit.css
@@ -248,6 +248,12 @@
border-color: #666;
color: #fff;
}
+.yellow-toolbar .yellow-toolbar-disabled,
+.yellow-toolbar .yellow-toolbar-disabled:hover {
+ background-color: inherit;
+ border-color: #c1c1c1 #c1c1c1 #aaa;
+ color: #aaa;
+}
.yellow-toolbar-tooltip {
position: relative;
}
@@ -340,7 +346,7 @@
color: #333333;
background-image: linear-gradient(to bottom, #f8f8f8, #e1e1e1);
border: 1px solid #bbb;
- border-color: #c1c1c1 #c1c1c1 #aaaaaa;
+ border-color: #c1c1c1 #c1c1c1 #aaa;
border-radius: 4px;
outline-offset: -2px;
font-size: 0.9em;
diff --git a/system/extensions/edit.js b/system/extensions/edit.js
@@ -417,8 +417,12 @@ yellow.edit = {
this.updateToolbar(0, "yellow-toolbar-checked");
}
if (!this.isUserAccess(paneAction, yellow.page.location) || (yellow.page.rawDataReadonly && paneId!="yellow-pane-create")) {
- yellow.toolbox.setVisible(document.getElementById(paneId+"-submit"), false);
document.getElementById(paneId+"-text").readOnly = true;
+ var elements = document.getElementsByClassName("yellow-toolbar-btn-icon");
+ for (var i=0, l=elements.length; i<l; i++) {
+ yellow.toolbox.addClass(elements[i], "yellow-toolbar-disabled");
+ }
+ yellow.toolbox.setVisible(document.getElementById(paneId+"-submit"), false);
}
}
if (!document.getElementById(paneId+"-text").readOnly) {
@@ -608,14 +612,16 @@ yellow.edit = {
case "undo": yellow.editor.undo(); break;
case "redo": yellow.editor.redo(); break;
}
+ if (this.isExpandable(status)) {
+ this.showPopup("yellow-popup-"+status, status);
+ } else {
+ this.hidePopup(this.popupId);
+ }
}
- if (status=="preview" && !elementText.readOnly) this.showPreview(elementText, elementPreview);
- if (status=="save" && !elementText.readOnly && this.paneAction!="delete") this.processSubmit("action:"+this.paneAction);
- if (status=="help") window.open(this.getText("YellowHelpUrl"), "_blank");
- if (this.isExpandable(status)) {
- this.showPopup("yellow-popup-"+status, status);
- } else {
- this.hidePopup(this.popupId);
+ if (!elementText.readOnly) {
+ if (status=="preview") this.showPreview(elementText, elementPreview);
+ if (status=="save" && this.paneAction!="delete") this.processSubmit("action:"+this.paneAction);
+ if (status=="help") window.open(this.getText("YellowHelpUrl"), "_blank");
}
},
diff --git a/system/extensions/edit.php b/system/extensions/edit.php
@@ -2,7 +2,7 @@
// Edit extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
class YellowEdit {
- const VERSION = "0.8.40";
+ const VERSION = "0.8.41";
public $yellow; // access to API
public $response; // web response
public $merge; // text merge
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -31,11 +31,11 @@ Tag: feature
system/extensions/core.php: core.php, create, update
Extension: Edit
-Version: 0.8.40
+Version: 0.8.41
Description: Edit your website in a web browser.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/edit.zip
-Published: 2020-11-24 21:22:52
+Published: 2020-12-21 14:57:43
Developer: Datenstrom
Tag: feature
system/extensions/edit.php: edit.php, create, update