Updated edit extension, disabled buttons

This commit is contained in:
markseu 2020-12-21 15:17:34 +01:00
parent e7bbde2b42
commit da0565aa2a
4 changed files with 24 additions and 12 deletions

View file

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

View file

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

View file

@ -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

View file

@ -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