103 if(op.trip !== "") threadObj.op += "!" + op.trip;
104 if(op.sub !== "") {
105 if(op.sub.length > subjectCuttoff)
106 threadObj.subject = op.sub.slice(0, subjectCuttoff) + "...";107 else
108 threadObj.subject = op.sub;
109 }
100 op: op.name,
101 latest: data.posts[data.posts.length-1].no
102 };
103 if(op.trip !== "") threadObj.op += "!" + op.trip;104 if(op.sub !== "") {
105 if(op.sub.length > subjectCuttoff)
106 threadObj.subject = op.sub.slice(0, subjectCuttoff) + "...";
231 const cursor = (msgbox.selectionStart !== undefined)?msgbox.selectionStart:msgbox.value.length;
232 let quoted = lines.join("\n");
233 if(quoted !== "") quoted += "\n";
234 msgbox.value = msgbox.value.slice(0, cursor) + `>>${no}\n` +235 quoted + msgbox.value.slice(cursor);236
237 if(msgbox.id === "postmsg")
238 window.scroll(0,msgbox.offsetTop - 48);
225
226 if(selected !== "") {
227 for(let l = 0; l < lines.length; l++) {
228 lines[l] = ">" + lines[l];229 }
230 }
231 const cursor = (msgbox.selectionStart !== undefined)?msgbox.selectionStart:msgbox.value.length;
217 openQR();
218 }
219 const msgboxID = "postmsg";
220 let msgbox = document.getElementById("qr" + msgboxID) as HTMLInputElement;221 if(msgbox === null)
222 msgbox = document.getElementById(msgboxID) as HTMLInputElement;
223 const selected = selectedText();
In ES2015 (ES6), we can use template literals instead of string concatenation.
var str = `Hello, ${name}!`;
var str = "Hello, " + name + "!";
var str = "Time: " + (12 * 60 * 60 * 1000);
var str = "Hello World!";
var str = `Hello, ${name}!`;
var str = `Time: ${12 * 60 * 60 * 1000}`;
var str = "Hello, " + "World!";