progressive publish timeout based on filesize, better tracker error log, content.json viewport support, wrapperSetViewport wrapperapi command support, escape wrapper notification
This commit is contained in:
parent
3b22be5091
commit
bccd246f71
5 changed files with 65 additions and 18 deletions
|
@ -799,6 +799,8 @@ jQuery.extend( jQuery.easing,
|
|||
return this.actionWrapperConfirm(message);
|
||||
} else if (cmd === "wrapperPrompt") {
|
||||
return this.actionWrapperPrompt(message);
|
||||
} else if (cmd === "wrapperSetViewport") {
|
||||
return this.actionSetViewport(message);
|
||||
} else {
|
||||
return this.ws.send(message);
|
||||
}
|
||||
|
@ -862,6 +864,15 @@ jQuery.extend( jQuery.easing,
|
|||
return this.notifications.add("notification-" + message.id, "ask", body);
|
||||
};
|
||||
|
||||
Wrapper.prototype.actionSetViewport = function(message) {
|
||||
this.log("actionSetViewport", message);
|
||||
if ($("#viewport").length > 0) {
|
||||
return $("#viewport").attr("content", this.toHtmlSafe(message.params));
|
||||
} else {
|
||||
return $('<meta name="viewport" id="viewport">').attr("content", this.toHtmlSafe(message.params)).appendTo("head");
|
||||
}
|
||||
};
|
||||
|
||||
Wrapper.prototype.onOpenWebsocket = function(e) {
|
||||
this.ws.cmd("channelJoin", {
|
||||
"channel": "siteChanged"
|
||||
|
@ -974,8 +985,18 @@ jQuery.extend( jQuery.easing,
|
|||
return this.site_info = site_info;
|
||||
};
|
||||
|
||||
Wrapper.prototype.toHtmlSafe = function(unsafe) {
|
||||
return unsafe;
|
||||
Wrapper.prototype.toHtmlSafe = function(values) {
|
||||
var i, value, _i, _len;
|
||||
if (!(values instanceof Array)) {
|
||||
values = [values];
|
||||
}
|
||||
for (i = _i = 0, _len = values.length; _i < _len; i = ++_i) {
|
||||
value = values[i];
|
||||
value = String(value).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
value = value.replace(/<([\/]{0,1}(br|b|u|i))>/g, "<$1>");
|
||||
values[i] = value;
|
||||
}
|
||||
return values;
|
||||
};
|
||||
|
||||
Wrapper.prototype.log = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue