Merge wrapper js
This commit is contained in:
parent
e93b5c3c1c
commit
16efba2b91
1 changed files with 28 additions and 9 deletions
|
@ -683,7 +683,6 @@ jQuery.extend( jQuery.easing,
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---- src/Ui/media/Notifications.coffee ---- */
|
/* ---- src/Ui/media/Notifications.coffee ---- */
|
||||||
|
|
||||||
|
|
||||||
|
@ -784,6 +783,13 @@ jQuery.extend( jQuery.easing,
|
||||||
return _this.close(elem);
|
return _this.close(elem);
|
||||||
};
|
};
|
||||||
})(this));
|
})(this));
|
||||||
|
$("input", elem).on("keyup", (function(_this) {
|
||||||
|
return function(e) {
|
||||||
|
if (e.keyCode === 13) {
|
||||||
|
return _this.close(elem);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})(this));
|
||||||
return elem;
|
return elem;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1152,9 +1158,9 @@ jQuery.extend( jQuery.easing,
|
||||||
return this.notifications.add("notification-" + message.id, message.params[0], body, message.params[2]);
|
return this.notifications.add("notification-" + message.id, message.params[0], body, message.params[2]);
|
||||||
};
|
};
|
||||||
|
|
||||||
Wrapper.prototype.displayConfirm = function(message, captions, cb) {
|
Wrapper.prototype.displayConfirm = function(body, captions, cb) {
|
||||||
var body, button, buttons, caption, fn, i, j, len;
|
var button, buttons, caption, fn, i, j, len;
|
||||||
body = $("<span class='message-outer'><span class='message'>" + message + "</span></span>");
|
body = $("<span class='message-outer'><span class='message'>" + body + "</span></span>");
|
||||||
buttons = $("<span class='buttons'></span>");
|
buttons = $("<span class='buttons'></span>");
|
||||||
if (!(captions instanceof Array)) {
|
if (!(captions instanceof Array)) {
|
||||||
captions = [captions];
|
captions = [captions];
|
||||||
|
@ -1170,7 +1176,12 @@ jQuery.extend( jQuery.easing,
|
||||||
})(this);
|
})(this);
|
||||||
for (i = j = 0, len = captions.length; j < len; i = ++j) {
|
for (i = j = 0, len = captions.length; j < len; i = ++j) {
|
||||||
caption = captions[i];
|
caption = captions[i];
|
||||||
button = $("<a href='#" + caption + "' class='button button-confirm button-" + caption + " button-" + (i + 1) + "' data-value='" + (i + 1) + "'>" + caption + "</a>");
|
button = $("<a></a>", {
|
||||||
|
href: "#" + caption,
|
||||||
|
"class": "button button-confirm button-" + caption + " button-" + (i + 1),
|
||||||
|
"data-value": i + 1
|
||||||
|
});
|
||||||
|
button.text(caption);
|
||||||
fn(button);
|
fn(button);
|
||||||
buttons.append(button);
|
buttons.append(button);
|
||||||
}
|
}
|
||||||
|
@ -1205,11 +1216,15 @@ jQuery.extend( jQuery.easing,
|
||||||
|
|
||||||
Wrapper.prototype.displayPrompt = function(message, type, caption, placeholder, cb) {
|
Wrapper.prototype.displayPrompt = function(message, type, caption, placeholder, cb) {
|
||||||
var body, button, input;
|
var body, button, input;
|
||||||
body = $("<span class='message'>" + message + "</span>");
|
body = $("<span class='message'></span>").text(message);
|
||||||
if (placeholder == null) {
|
if (placeholder == null) {
|
||||||
placeholder = "";
|
placeholder = "";
|
||||||
}
|
}
|
||||||
input = $("<input type='" + type + "' class='input button-" + type + "' placeholder='" + placeholder + "'/>");
|
input = $("<input/>", {
|
||||||
|
type: type,
|
||||||
|
"class": "input button-" + type,
|
||||||
|
placeholder: placeholder
|
||||||
|
});
|
||||||
input.on("keyup", (function(_this) {
|
input.on("keyup", (function(_this) {
|
||||||
return function(e) {
|
return function(e) {
|
||||||
_this.verifyEvent(input, e);
|
_this.verifyEvent(input, e);
|
||||||
|
@ -1219,7 +1234,10 @@ jQuery.extend( jQuery.easing,
|
||||||
};
|
};
|
||||||
})(this));
|
})(this));
|
||||||
body.append(input);
|
body.append(input);
|
||||||
button = $("<a href='#" + caption + "' class='button button-" + caption + "'>" + caption + "</a>");
|
button = $("<a></a>", {
|
||||||
|
href: "#" + caption,
|
||||||
|
"class": "button button-" + caption
|
||||||
|
}).text(caption);
|
||||||
button.on("click", (function(_this) {
|
button.on("click", (function(_this) {
|
||||||
return function(e) {
|
return function(e) {
|
||||||
_this.verifyEvent(button, e);
|
_this.verifyEvent(button, e);
|
||||||
|
@ -1561,7 +1579,7 @@ jQuery.extend( jQuery.easing,
|
||||||
if (value instanceof Array) {
|
if (value instanceof Array) {
|
||||||
value = this.toHtmlSafe(value);
|
value = this.toHtmlSafe(value);
|
||||||
} else {
|
} else {
|
||||||
value = String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
value = String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
||||||
value = value.replace(/<([\/]{0,1}(br|b|u|i|small))>/g, "<$1>");
|
value = value.replace(/<([\/]{0,1}(br|b|u|i|small))>/g, "<$1>");
|
||||||
}
|
}
|
||||||
values[i] = value;
|
values[i] = value;
|
||||||
|
@ -1622,6 +1640,7 @@ jQuery.extend( jQuery.easing,
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */
|
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue