mirror of
https://github.com/processwire/processwire.git
synced 2025-08-14 18:55:56 +02:00
Update Repeaters to add these features: 1) Support for repeater depth per @jlahijani, 2) Add new repeater item "clone" feature, 3) Add support for max items, 4) Add double-click trash icon to "delete all" feature. This commit also adds the Vex library for nicer looking Javascript alert and confirm boxes, which we use to confirm "clone" and "delete all" operations in repeaters, and will use elsewhere.
This commit is contained in:
@@ -335,4 +335,42 @@ var ProcessWireAdmin = {
|
||||
|
||||
};
|
||||
|
||||
if(typeof ProcessWire != "undefined") {
|
||||
ProcessWire.confirm = function(message, func) {
|
||||
if(typeof vex != "undefined") {
|
||||
vex.dialog.confirm({
|
||||
message: message,
|
||||
callback: function(v) {
|
||||
if(v) func();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if(confirm(message)) func();
|
||||
}
|
||||
};
|
||||
|
||||
ProcessWire.alert = function(message, allowMarkup) {
|
||||
if(typeof allowMarkup == "undefined") var allowMarkup = false;
|
||||
if(typeof vex != "undefined") {
|
||||
if(allowMarkup) {
|
||||
vex.dialog.alert({unsafeMessage: message});
|
||||
} else {
|
||||
vex.dialog.alert(message);
|
||||
}
|
||||
} else {
|
||||
alert(message);
|
||||
}
|
||||
};
|
||||
|
||||
ProcessWire.prompt = function(message, placeholder, func) {
|
||||
if(typeof vex == "undefined") {
|
||||
alert("prompt function requires vex");
|
||||
return;
|
||||
}
|
||||
vex.dialog.prompt({
|
||||
message: message,
|
||||
placeholder: placeholder,
|
||||
callback: func
|
||||
})
|
||||
};
|
||||
}
|
||||
|
2
wire/templates-admin/scripts/main.min.js
vendored
2
wire/templates-admin/scripts/main.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user