1
0
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:
Ryan Cramer
2016-12-07 11:24:49 -05:00
parent 423fbe6f57
commit e2f9597c5a
53 changed files with 7235 additions and 173 deletions

View File

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

File diff suppressed because one or more lines are too long