From 16efba2b911db9794dbb4fac3bc4bc3210b9abfc Mon Sep 17 00:00:00 2001 From: shortcutme Date: Tue, 6 Mar 2018 12:03:10 +0100 Subject: [PATCH] Merge wrapper js --- src/Ui/media/all.js | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index 08c21c28..aae99e56 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -683,7 +683,6 @@ jQuery.extend( jQuery.easing, }).call(this); - /* ---- src/Ui/media/Notifications.coffee ---- */ @@ -784,6 +783,13 @@ jQuery.extend( jQuery.easing, return _this.close(elem); }; })(this)); + $("input", elem).on("keyup", (function(_this) { + return function(e) { + if (e.keyCode === 13) { + return _this.close(elem); + } + }; + })(this)); return elem; }; @@ -1152,9 +1158,9 @@ jQuery.extend( jQuery.easing, return this.notifications.add("notification-" + message.id, message.params[0], body, message.params[2]); }; - Wrapper.prototype.displayConfirm = function(message, captions, cb) { - var body, button, buttons, caption, fn, i, j, len; - body = $("" + message + ""); + Wrapper.prototype.displayConfirm = function(body, captions, cb) { + var button, buttons, caption, fn, i, j, len; + body = $("" + body + ""); buttons = $(""); if (!(captions instanceof Array)) { captions = [captions]; @@ -1170,7 +1176,12 @@ jQuery.extend( jQuery.easing, })(this); for (i = j = 0, len = captions.length; j < len; i = ++j) { caption = captions[i]; - button = $("" + caption + ""); + button = $("", { + href: "#" + caption, + "class": "button button-confirm button-" + caption + " button-" + (i + 1), + "data-value": i + 1 + }); + button.text(caption); fn(button); buttons.append(button); } @@ -1205,11 +1216,15 @@ jQuery.extend( jQuery.easing, Wrapper.prototype.displayPrompt = function(message, type, caption, placeholder, cb) { var body, button, input; - body = $("" + message + ""); + body = $("").text(message); if (placeholder == null) { placeholder = ""; } - input = $(""); + input = $("", { + type: type, + "class": "input button-" + type, + placeholder: placeholder + }); input.on("keyup", (function(_this) { return function(e) { _this.verifyEvent(input, e); @@ -1219,7 +1234,10 @@ jQuery.extend( jQuery.easing, }; })(this)); body.append(input); - button = $("" + caption + ""); + button = $("", { + href: "#" + caption, + "class": "button button-" + caption + }).text(caption); button.on("click", (function(_this) { return function(e) { _this.verifyEvent(button, e); @@ -1561,7 +1579,7 @@ jQuery.extend( jQuery.easing, if (value instanceof Array) { value = this.toHtmlSafe(value); } else { - value = String(value).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); + value = String(value).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); value = value.replace(/<([\/]{0,1}(br|b|u|i|small))>/g, "<$1>"); } values[i] = value; @@ -1622,6 +1640,7 @@ jQuery.extend( jQuery.easing, }).call(this); + /* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */