Fixed chat new line indeed
This commit is contained in:
parent
b6e41e8c47
commit
1d0d4f2f37
6 changed files with 37 additions and 12 deletions
|
@ -7,6 +7,7 @@
|
|||
* Using random password field ids for server connect modal
|
||||
+ Improved forum not authenticated message within connect modal
|
||||
- Added partitional MS Edge support
|
||||
* Fixed chat new line indeed
|
||||
|
||||
* **24.09.18**:
|
||||
- Added server passwords within login modal
|
||||
|
|
|
@ -4,9 +4,17 @@
|
|||
min-width: 20%; }
|
||||
|
||||
.select_server {
|
||||
height: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; }
|
||||
.select_server .button-update {
|
||||
width: 100%; }
|
||||
width: 100%;
|
||||
height: 23px; }
|
||||
.select_server .button-update:disabled {
|
||||
color: red;
|
||||
pointer-events: none; }
|
||||
.select_server .button-update:not(:disabled) {
|
||||
color: green; }
|
||||
|
||||
/*# sourceMappingURL=SelectInfo.css.map */
|
||||
|
|
|
@ -9,10 +9,21 @@
|
|||
}
|
||||
|
||||
.select_server {
|
||||
height: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.button-update {
|
||||
width: 100%;
|
||||
height: 23px;
|
||||
|
||||
&:disabled {
|
||||
color: red;
|
||||
pointer-events: none;
|
||||
}
|
||||
&:not(:disabled) {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,11 +6,11 @@ enum ChatType {
|
|||
}
|
||||
|
||||
namespace MessageHelper {
|
||||
export function htmlEscape(message: string) : string {
|
||||
export function htmlEscape(message: string) : string[] {
|
||||
const div = document.createElement('div');
|
||||
div.innerText = message;
|
||||
message = div.innerHTML;
|
||||
return message.replace(/ /g, ' ');
|
||||
return message.replace(/ /g, ' ').split(/<br>/);
|
||||
}
|
||||
|
||||
export function formatElement(object: any) : JQuery[] {
|
||||
|
@ -21,7 +21,8 @@ namespace MessageHelper {
|
|||
return result;
|
||||
} else if(typeof(object) == "string") {
|
||||
if(object.length == 0) return [];
|
||||
return [$.spawn("a").html(this.htmlEscape(object))];
|
||||
|
||||
return this.htmlEscape(object).map((entry, idx, array) => $.spawn("a").css("display", (idx == 0 || idx + 1 == array.length ? "inline" : "") + "block").html(entry));
|
||||
} else if(typeof(object) === "object") {
|
||||
if(object instanceof jQuery)
|
||||
return [object];
|
||||
|
|
10
js/load.ts
10
js/load.ts
|
@ -58,6 +58,16 @@ namespace app {
|
|||
}
|
||||
}
|
||||
|
||||
/* safari remove "fix" */
|
||||
Object.defineProperty(Element.prototype, "remove", {
|
||||
enumerable: false,
|
||||
configurable: false,
|
||||
writable: false,
|
||||
value: function(){
|
||||
this.parentElement.removeChild(this);
|
||||
}
|
||||
});
|
||||
|
||||
if(typeof Module === "undefined")
|
||||
this["Module"] = {};
|
||||
app.initialize();
|
||||
|
|
|
@ -199,13 +199,7 @@ class ServerInfoManager extends InfoManager<ServerEntry> {
|
|||
|
||||
{
|
||||
let requestUpdate = rendered.find(".btn_update");
|
||||
/*
|
||||
let requestUpdate = $.spawn("button");
|
||||
requestUpdate.css("min-height", "16px");
|
||||
requestUpdate.css("bottom", 0);
|
||||
requestUpdate.text("update info");
|
||||
*/
|
||||
requestUpdate.prop("enabled", server.shouldUpdateProperties());
|
||||
requestUpdate.prop("disabled", !server.shouldUpdateProperties());
|
||||
|
||||
requestUpdate.click(() => {
|
||||
server.updateProperties();
|
||||
|
@ -213,7 +207,7 @@ class ServerInfoManager extends InfoManager<ServerEntry> {
|
|||
});
|
||||
|
||||
this.registerTimer(setTimeout(function () {
|
||||
requestUpdate.prop("enabled", true);
|
||||
requestUpdate.prop("disabled", false);
|
||||
}, server.nextInfoRequest - Date.now()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue