Small fixes
This commit is contained in:
parent
409f1f9ecf
commit
ada2b5abd0
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* appchan x - Version 2.9.43 - 2015-01-09
|
* appchan x - Version 2.9.43 - 2015-01-10
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* appchan x - Version 2.9.43 - 2015-01-09
|
* appchan x - Version 2.9.43 - 2015-01-10
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||||
@ -2707,7 +2707,6 @@
|
|||||||
req.callbacks.push(cb);
|
req.callbacks.push(cb);
|
||||||
}
|
}
|
||||||
return req;
|
return req;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
rm = function() {
|
rm = function() {
|
||||||
return delete reqs[url];
|
return delete reqs[url];
|
||||||
@ -3180,8 +3179,8 @@
|
|||||||
|
|
||||||
function Board(ID) {
|
function Board(ID) {
|
||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
this.threads = new SimpleDict;
|
this.threads = new SimpleDict();
|
||||||
this.posts = new SimpleDict;
|
this.posts = new SimpleDict();
|
||||||
g.boards[this] = this;
|
g.boards[this] = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3200,7 +3199,7 @@
|
|||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
this.board = board;
|
this.board = board;
|
||||||
this.fullID = "" + this.board + "." + this.ID;
|
this.fullID = "" + this.board + "." + this.ID;
|
||||||
this.posts = new SimpleDict;
|
this.posts = new SimpleDict();
|
||||||
this.isDead = false;
|
this.isDead = false;
|
||||||
this.isHidden = false;
|
this.isHidden = false;
|
||||||
this.isOnTop = false;
|
this.isOnTop = false;
|
||||||
@ -5945,7 +5944,7 @@
|
|||||||
shortFilename: function(filename) {
|
shortFilename: function(filename) {
|
||||||
var ext, threshold;
|
var ext, threshold;
|
||||||
threshold = 30;
|
threshold = 30;
|
||||||
ext = filename.match(/\.[^.]+$/)[0];
|
ext = filename.match(/\.?[^\.]*$/)[0];
|
||||||
if (filename.length - ext.length > threshold) {
|
if (filename.length - ext.length > threshold) {
|
||||||
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
||||||
} else {
|
} else {
|
||||||
@ -6010,7 +6009,6 @@
|
|||||||
} else if (data.ext) {
|
} else if (data.ext) {
|
||||||
o.file = {
|
o.file = {
|
||||||
name: (Build.unescape(data.filename)) + data.ext,
|
name: (Build.unescape(data.filename)) + data.ext,
|
||||||
name: data.filename + data.ext,
|
|
||||||
timestamp: "" + data.tim + data.ext,
|
timestamp: "" + data.tim + data.ext,
|
||||||
url: boardID === 'f' ? "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
|
url: boardID === 'f' ? "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
|
||||||
height: data.h,
|
height: data.h,
|
||||||
@ -6049,7 +6047,7 @@
|
|||||||
innerHTML: " <strong class=\"capcode hand id_admin\" title=\"Highlight posts by the Administrator\">## Admin</strong>"
|
innerHTML: " <strong class=\"capcode hand id_admin\" title=\"Highlight posts by the Administrator\">## Admin</strong>"
|
||||||
};
|
};
|
||||||
capcodeIcon = {
|
capcodeIcon = {
|
||||||
innerHTML: " <img src=\"" + E(staticPath) + "adminicon" + E(gifIcon) + "\" alt=\"Admin Icon\" title=\"This user is the 4chan Administrator.\" class=\"identityIcon retina\">"
|
innerHTML: " <img src=\"//s.4cdn.org/image/adminicon" + E(retina) + ".gif\" alt=\"Admin Icon\" title=\"This user is the 4chan Administrator.\" class=\"identityIcon retina\">"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'mod':
|
case 'mod':
|
||||||
@ -6058,14 +6056,16 @@
|
|||||||
innerHTML: " <strong class=\"capcode hand id_mod\" title=\"Highlight posts by Moderators\">## Mod</strong>"
|
innerHTML: " <strong class=\"capcode hand id_mod\" title=\"Highlight posts by Moderators\">## Mod</strong>"
|
||||||
};
|
};
|
||||||
capcodeIcon = {
|
capcodeIcon = {
|
||||||
innerHTML: " <img src=\"" + E(staticPath) + "modicon" + E(gifIcon) + "\" alt=\"Mod Icon\" title=\"This user is a 4chan Moderator.\" class=\"identityIcon retina\">"
|
innerHTML: " <img src=\"//s.4cdn.org/image/modicon" + E(retina) + ".gif\" alt=\"Mod Icon\" title=\"This user is a 4chan Moderator.\" class=\"identityIcon retina\">"
|
||||||
};
|
};
|
||||||
|
break;
|
||||||
|
case 'developer':
|
||||||
capcodeClass = ' capcodeDeveloper';
|
capcodeClass = ' capcodeDeveloper';
|
||||||
capcodeStart = {
|
capcodeStart = {
|
||||||
innerHTML: " <strong class=\"capcode hand id_developer\" title=\"Highlight posts by Developers\">## Developer</strong>"
|
innerHTML: " <strong class=\"capcode hand id_developer\" title=\"Highlight posts by Developers\">## Developer</strong>"
|
||||||
};
|
};
|
||||||
capcodeIcon = {
|
capcodeIcon = {
|
||||||
innerHTML: " <img src=\"" + E(staticPath) + "developericon" + E(gifIcon) + "\" alt=\"Developer Icon\" title=\"This user is a 4chan Developer.\" class=\"identityIcon retina\">"
|
innerHTML: " <img src=\"//s.4cdn.org/image/developericon" + E(retina) + ".gif\" alt=\"Developer Icon\" title=\"This user is a 4chan Developer.\" class=\"identityIcon retina\">"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -6147,21 +6147,43 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* File Info */
|
/* File Info */
|
||||||
fileCont = (file != null ? file.isDeleted : void 0) ? {
|
if (file != null ? file.isDeleted : void 0) {
|
||||||
innerHTML: "<span class=\"fileThumb\"><img src=\"" + E(staticPath) + "filedeleted-res" + E(gifIcon) + "\" alt=\"File deleted.\" class=\"fileDeletedRes retina\"></span>"
|
fileCont = {
|
||||||
} : file && boardID === 'f' ? {
|
innerHTML: "<span class=\"fileThumb\"><img src=\"" + E(staticPath) + "filedeleted-res" + E(gifIcon) + "\" alt=\"File deleted.\" class=\"fileDeletedRes retina\"></span>"
|
||||||
innerHTML: "<div class=\"fileInfo\"><span class=\"fileText\" id=\"fT" + E(postID) + "\">File: <a data-width=\"" + E(file.width) + "\" data-height=\"" + E(file.height) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(file.name) + "</a>-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ")</span></div>"
|
};
|
||||||
} : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = "//s.4cdn.org/image/spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = '//s.4cdn.org/image/spoiler.png', file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
|
} else if (file && boardID === 'f') {
|
||||||
innerHTML: "<a href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
fileCont = {
|
||||||
} : {
|
innerHTML: "<div class=\"fileInfo\"><span class=\"fileText\" id=\"fT" + E(postID) + "\">File: <a data-width=\"" + E(file.width) + "\" data-height=\"" + E(file.height) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(file.name) + "</a>-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ")</span></div>"
|
||||||
innerHTML: "<a title=\"" + E(file.name) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
};
|
||||||
}, fileText = file.isSpoiler ? {
|
} else if (file) {
|
||||||
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\" title=\"" + E(file.name) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
if (file.isSpoiler) {
|
||||||
} : {
|
shortFilename = 'Spoiler Image';
|
||||||
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
if (spoilerRange = Build.spoilerRange[boardID]) {
|
||||||
}, {
|
fileThumb = "//s.4cdn.org/image/spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png";
|
||||||
innerHTML: fileText.innerHTML + "<a class=\"fileThumb" + E(file.isSpoiler ? " imgspoiler" : "") + "\" href=\"" + E(file.url) + "\" target=\"_blank\"><img src=\"" + E(fileThumb) + "\" alt=\"" + E(fileSize) + "\" data-md5=\"" + E(file.MD5) + "\" style=\"height: " + E(file.theight) + "px; width: " + E(file.twidth) + "px;\"></a>"
|
} else {
|
||||||
}) : void 0;
|
fileThumb = '//s.4cdn.org/image/spoiler.png';
|
||||||
|
}
|
||||||
|
file.twidth = file.theight = 100;
|
||||||
|
} else {
|
||||||
|
shortFilename = Build.shortFilename(file.name, !isOP);
|
||||||
|
fileThumb = file.turl;
|
||||||
|
}
|
||||||
|
fileSize = $.bytesToString(file.size);
|
||||||
|
fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height;
|
||||||
|
fileLink = file.isSpoiler || file.name === shortFilename ? {
|
||||||
|
innerHTML: "<a href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
||||||
|
} : {
|
||||||
|
innerHTML: "<a title=\"" + E(file.name) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
||||||
|
};
|
||||||
|
fileText = file.isSpoiler ? {
|
||||||
|
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\" title=\"" + E(file.name) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
||||||
|
} : {
|
||||||
|
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
||||||
|
};
|
||||||
|
({
|
||||||
|
innerHTML: fileText.innerHTML + "<a class=\"fileThumb" + E(file.isSpoiler ? " imgspoiler" : "") + "\" href=\"" + E(file.url) + "\" target=\"_blank\"><img src=\"" + E(fileThumb) + "\" alt=\"" + E(fileSize) + "\" data-md5=\"" + E(file.MD5) + "\" style=\"height: " + E(file.theight) + "px; width: " + E(file.twidth) + "px;\"></a>"
|
||||||
|
});
|
||||||
|
}
|
||||||
fileBlock = file ? {
|
fileBlock = file ? {
|
||||||
innerHTML: "<div class=\"file\" id=\"f" + E(postID) + "\">" + fileCont.innerHTML + "</div>"
|
innerHTML: "<div class=\"file\" id=\"f" + E(postID) + "\">" + fileCont.innerHTML + "</div>"
|
||||||
} : {
|
} : {
|
||||||
@ -8421,7 +8443,7 @@
|
|||||||
posts.forEach(QuoteThreading.insert);
|
posts.forEach(QuoteThreading.insert);
|
||||||
} else {
|
} else {
|
||||||
nodes = [];
|
nodes = [];
|
||||||
Unread.order = new RandomAccessList;
|
Unread.order = new RandomAccessList();
|
||||||
QuoteThreading.inserted = {};
|
QuoteThreading.inserted = {};
|
||||||
posts.forEach(function(post) {
|
posts.forEach(function(post) {
|
||||||
if (post.isFetchedQuote) {
|
if (post.isFetchedQuote) {
|
||||||
@ -14672,9 +14694,9 @@
|
|||||||
this.hr = $.el('hr', {
|
this.hr = $.el('hr', {
|
||||||
id: 'unread-line'
|
id: 'unread-line'
|
||||||
});
|
});
|
||||||
this.posts = new Set;
|
this.posts = new Set();
|
||||||
this.postsQuotingYou = new Set;
|
this.postsQuotingYou = new Set();
|
||||||
this.order = new RandomAccessList;
|
this.order = new RandomAccessList();
|
||||||
this.position = null;
|
this.position = null;
|
||||||
Thread.callbacks.push({
|
Thread.callbacks.push({
|
||||||
name: 'Unread',
|
name: 'Unread',
|
||||||
@ -19761,8 +19783,8 @@
|
|||||||
return Captcha.noscript.initFrame();
|
return Captcha.noscript.initFrame();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
g.threads = new SimpleDict;
|
g.threads = new SimpleDict();
|
||||||
g.posts = new SimpleDict;
|
g.posts = new SimpleDict();
|
||||||
pathname = location.pathname.split('/');
|
pathname = location.pathname.split('/');
|
||||||
g.BOARD = new Board(pathname[1]);
|
g.BOARD = new Board(pathname[1]);
|
||||||
if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
|
if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
/*
|
/*
|
||||||
* appchan x - Version 2.9.43 - 2015-01-09
|
* appchan x - Version 2.9.43 - 2015-01-10
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||||
@ -2679,7 +2679,6 @@
|
|||||||
req.callbacks.push(cb);
|
req.callbacks.push(cb);
|
||||||
}
|
}
|
||||||
return req;
|
return req;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
rm = function() {
|
rm = function() {
|
||||||
return delete reqs[url];
|
return delete reqs[url];
|
||||||
@ -3206,8 +3205,8 @@
|
|||||||
|
|
||||||
function Board(ID) {
|
function Board(ID) {
|
||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
this.threads = new SimpleDict;
|
this.threads = new SimpleDict();
|
||||||
this.posts = new SimpleDict;
|
this.posts = new SimpleDict();
|
||||||
g.boards[this] = this;
|
g.boards[this] = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3226,7 +3225,7 @@
|
|||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
this.board = board;
|
this.board = board;
|
||||||
this.fullID = "" + this.board + "." + this.ID;
|
this.fullID = "" + this.board + "." + this.ID;
|
||||||
this.posts = new SimpleDict;
|
this.posts = new SimpleDict();
|
||||||
this.isDead = false;
|
this.isDead = false;
|
||||||
this.isHidden = false;
|
this.isHidden = false;
|
||||||
this.isOnTop = false;
|
this.isOnTop = false;
|
||||||
@ -5974,7 +5973,7 @@
|
|||||||
shortFilename: function(filename) {
|
shortFilename: function(filename) {
|
||||||
var ext, threshold;
|
var ext, threshold;
|
||||||
threshold = 30;
|
threshold = 30;
|
||||||
ext = filename.match(/\.[^.]+$/)[0];
|
ext = filename.match(/\.?[^\.]*$/)[0];
|
||||||
if (filename.length - ext.length > threshold) {
|
if (filename.length - ext.length > threshold) {
|
||||||
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
||||||
} else {
|
} else {
|
||||||
@ -6039,7 +6038,6 @@
|
|||||||
} else if (data.ext) {
|
} else if (data.ext) {
|
||||||
o.file = {
|
o.file = {
|
||||||
name: (Build.unescape(data.filename)) + data.ext,
|
name: (Build.unescape(data.filename)) + data.ext,
|
||||||
name: data.filename + data.ext,
|
|
||||||
timestamp: "" + data.tim + data.ext,
|
timestamp: "" + data.tim + data.ext,
|
||||||
url: boardID === 'f' ? "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
|
url: boardID === 'f' ? "//i.4cdn.org/" + boardID + "/" + (encodeURIComponent(data.filename)) + data.ext : "//i.4cdn.org/" + boardID + "/" + data.tim + data.ext,
|
||||||
height: data.h,
|
height: data.h,
|
||||||
@ -6078,7 +6076,7 @@
|
|||||||
innerHTML: " <strong class=\"capcode hand id_admin\" title=\"Highlight posts by the Administrator\">## Admin</strong>"
|
innerHTML: " <strong class=\"capcode hand id_admin\" title=\"Highlight posts by the Administrator\">## Admin</strong>"
|
||||||
};
|
};
|
||||||
capcodeIcon = {
|
capcodeIcon = {
|
||||||
innerHTML: " <img src=\"" + E(staticPath) + "adminicon" + E(gifIcon) + "\" alt=\"Admin Icon\" title=\"This user is the 4chan Administrator.\" class=\"identityIcon retina\">"
|
innerHTML: " <img src=\"//s.4cdn.org/image/adminicon" + E(retina) + ".gif\" alt=\"Admin Icon\" title=\"This user is the 4chan Administrator.\" class=\"identityIcon retina\">"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'mod':
|
case 'mod':
|
||||||
@ -6087,14 +6085,16 @@
|
|||||||
innerHTML: " <strong class=\"capcode hand id_mod\" title=\"Highlight posts by Moderators\">## Mod</strong>"
|
innerHTML: " <strong class=\"capcode hand id_mod\" title=\"Highlight posts by Moderators\">## Mod</strong>"
|
||||||
};
|
};
|
||||||
capcodeIcon = {
|
capcodeIcon = {
|
||||||
innerHTML: " <img src=\"" + E(staticPath) + "modicon" + E(gifIcon) + "\" alt=\"Mod Icon\" title=\"This user is a 4chan Moderator.\" class=\"identityIcon retina\">"
|
innerHTML: " <img src=\"//s.4cdn.org/image/modicon" + E(retina) + ".gif\" alt=\"Mod Icon\" title=\"This user is a 4chan Moderator.\" class=\"identityIcon retina\">"
|
||||||
};
|
};
|
||||||
|
break;
|
||||||
|
case 'developer':
|
||||||
capcodeClass = ' capcodeDeveloper';
|
capcodeClass = ' capcodeDeveloper';
|
||||||
capcodeStart = {
|
capcodeStart = {
|
||||||
innerHTML: " <strong class=\"capcode hand id_developer\" title=\"Highlight posts by Developers\">## Developer</strong>"
|
innerHTML: " <strong class=\"capcode hand id_developer\" title=\"Highlight posts by Developers\">## Developer</strong>"
|
||||||
};
|
};
|
||||||
capcodeIcon = {
|
capcodeIcon = {
|
||||||
innerHTML: " <img src=\"" + E(staticPath) + "developericon" + E(gifIcon) + "\" alt=\"Developer Icon\" title=\"This user is a 4chan Developer.\" class=\"identityIcon retina\">"
|
innerHTML: " <img src=\"//s.4cdn.org/image/developericon" + E(retina) + ".gif\" alt=\"Developer Icon\" title=\"This user is a 4chan Developer.\" class=\"identityIcon retina\">"
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -6176,21 +6176,43 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* File Info */
|
/* File Info */
|
||||||
fileCont = (file != null ? file.isDeleted : void 0) ? {
|
if (file != null ? file.isDeleted : void 0) {
|
||||||
innerHTML: "<span class=\"fileThumb\"><img src=\"" + E(staticPath) + "filedeleted-res" + E(gifIcon) + "\" alt=\"File deleted.\" class=\"fileDeletedRes retina\"></span>"
|
fileCont = {
|
||||||
} : file && boardID === 'f' ? {
|
innerHTML: "<span class=\"fileThumb\"><img src=\"" + E(staticPath) + "filedeleted-res" + E(gifIcon) + "\" alt=\"File deleted.\" class=\"fileDeletedRes retina\"></span>"
|
||||||
innerHTML: "<div class=\"fileInfo\"><span class=\"fileText\" id=\"fT" + E(postID) + "\">File: <a data-width=\"" + E(file.width) + "\" data-height=\"" + E(file.height) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(file.name) + "</a>-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ")</span></div>"
|
};
|
||||||
} : file ? (file.isSpoiler ? (shortFilename = 'Spoiler Image', (spoilerRange = Build.spoilerRange[boardID]) ? fileThumb = "//s.4cdn.org/image/spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png" : fileThumb = '//s.4cdn.org/image/spoiler.png', file.twidth = file.theight = 100) : (shortFilename = Build.shortFilename(file.name, !isOP), fileThumb = file.turl), fileSize = $.bytesToString(file.size), fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height, fileLink = file.isSpoiler || file.name === shortFilename ? {
|
} else if (file && boardID === 'f') {
|
||||||
innerHTML: "<a href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
fileCont = {
|
||||||
} : {
|
innerHTML: "<div class=\"fileInfo\"><span class=\"fileText\" id=\"fT" + E(postID) + "\">File: <a data-width=\"" + E(file.width) + "\" data-height=\"" + E(file.height) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(file.name) + "</a>-(" + E($.bytesToString(file.size)) + ", " + E(file.width) + "x" + E(file.height) + ", " + E(file.tag) + ")</span></div>"
|
||||||
innerHTML: "<a title=\"" + E(file.name) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
};
|
||||||
}, fileText = file.isSpoiler ? {
|
} else if (file) {
|
||||||
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\" title=\"" + E(file.name) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
if (file.isSpoiler) {
|
||||||
} : {
|
shortFilename = 'Spoiler Image';
|
||||||
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
if (spoilerRange = Build.spoilerRange[boardID]) {
|
||||||
}, {
|
fileThumb = "//s.4cdn.org/image/spoiler-" + boardID + (Math.floor(1 + spoilerRange * Math.random())) + ".png";
|
||||||
innerHTML: fileText.innerHTML + "<a class=\"fileThumb" + E(file.isSpoiler ? " imgspoiler" : "") + "\" href=\"" + E(file.url) + "\" target=\"_blank\"><img src=\"" + E(fileThumb) + "\" alt=\"" + E(fileSize) + "\" data-md5=\"" + E(file.MD5) + "\" style=\"height: " + E(file.theight) + "px; width: " + E(file.twidth) + "px;\"></a>"
|
} else {
|
||||||
}) : void 0;
|
fileThumb = '//s.4cdn.org/image/spoiler.png';
|
||||||
|
}
|
||||||
|
file.twidth = file.theight = 100;
|
||||||
|
} else {
|
||||||
|
shortFilename = Build.shortFilename(file.name, !isOP);
|
||||||
|
fileThumb = file.turl;
|
||||||
|
}
|
||||||
|
fileSize = $.bytesToString(file.size);
|
||||||
|
fileDims = file.url.slice(-4) === '.pdf' ? 'PDF' : "" + file.width + "x" + file.height;
|
||||||
|
fileLink = file.isSpoiler || file.name === shortFilename ? {
|
||||||
|
innerHTML: "<a href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
||||||
|
} : {
|
||||||
|
innerHTML: "<a title=\"" + E(file.name) + "\" href=\"" + E(file.url) + "\" target=\"_blank\">" + E(shortFilename) + "</a>"
|
||||||
|
};
|
||||||
|
fileText = file.isSpoiler ? {
|
||||||
|
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\" title=\"" + E(file.name) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
||||||
|
} : {
|
||||||
|
innerHTML: "<div class=\"fileText\" id=\"fT" + E(postID) + "\">File: " + fileLink.innerHTML + " (" + E(fileSize) + ", " + E(fileDims) + ")</div>"
|
||||||
|
};
|
||||||
|
({
|
||||||
|
innerHTML: fileText.innerHTML + "<a class=\"fileThumb" + E(file.isSpoiler ? " imgspoiler" : "") + "\" href=\"" + E(file.url) + "\" target=\"_blank\"><img src=\"" + E(fileThumb) + "\" alt=\"" + E(fileSize) + "\" data-md5=\"" + E(file.MD5) + "\" style=\"height: " + E(file.theight) + "px; width: " + E(file.twidth) + "px;\"></a>"
|
||||||
|
});
|
||||||
|
}
|
||||||
fileBlock = file ? {
|
fileBlock = file ? {
|
||||||
innerHTML: "<div class=\"file\" id=\"f" + E(postID) + "\">" + fileCont.innerHTML + "</div>"
|
innerHTML: "<div class=\"file\" id=\"f" + E(postID) + "\">" + fileCont.innerHTML + "</div>"
|
||||||
} : {
|
} : {
|
||||||
@ -8466,7 +8488,7 @@
|
|||||||
posts.forEach(QuoteThreading.insert);
|
posts.forEach(QuoteThreading.insert);
|
||||||
} else {
|
} else {
|
||||||
nodes = [];
|
nodes = [];
|
||||||
Unread.order = new RandomAccessList;
|
Unread.order = new RandomAccessList();
|
||||||
QuoteThreading.inserted = {};
|
QuoteThreading.inserted = {};
|
||||||
posts.forEach(function(post) {
|
posts.forEach(function(post) {
|
||||||
if (post.isFetchedQuote) {
|
if (post.isFetchedQuote) {
|
||||||
@ -14699,9 +14721,9 @@
|
|||||||
this.hr = $.el('hr', {
|
this.hr = $.el('hr', {
|
||||||
id: 'unread-line'
|
id: 'unread-line'
|
||||||
});
|
});
|
||||||
this.posts = new Set;
|
this.posts = new Set();
|
||||||
this.postsQuotingYou = new Set;
|
this.postsQuotingYou = new Set();
|
||||||
this.order = new RandomAccessList;
|
this.order = new RandomAccessList();
|
||||||
this.position = null;
|
this.position = null;
|
||||||
Thread.callbacks.push({
|
Thread.callbacks.push({
|
||||||
name: 'Unread',
|
name: 'Unread',
|
||||||
@ -19790,8 +19812,8 @@
|
|||||||
return Captcha.noscript.initFrame();
|
return Captcha.noscript.initFrame();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
g.threads = new SimpleDict;
|
g.threads = new SimpleDict();
|
||||||
g.posts = new SimpleDict;
|
g.posts = new SimpleDict();
|
||||||
pathname = location.pathname.split('/');
|
pathname = location.pathname.split('/');
|
||||||
g.BOARD = new Board(pathname[1]);
|
g.BOARD = new Board(pathname[1]);
|
||||||
if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
|
if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Build =
|
|||||||
{'&': '&', ''': "'", '"': '"', '<': '<', '>': '>'}[c]
|
{'&': '&', ''': "'", '"': '"', '<': '<', '>': '>'}[c]
|
||||||
shortFilename: (filename) ->
|
shortFilename: (filename) ->
|
||||||
threshold = 30
|
threshold = 30
|
||||||
ext = filename.match(/\.[^.]+$/)[0]
|
ext = filename.match(/\.?[^\.]*$/)[0]
|
||||||
if filename.length - ext.length > threshold
|
if filename.length - ext.length > threshold
|
||||||
"#{filename[...threshold - 5]}(...)#{ext}"
|
"#{filename[...threshold - 5]}(...)#{ext}"
|
||||||
else
|
else
|
||||||
@ -33,24 +33,24 @@ Build =
|
|||||||
postFromObject: (data, boardID) ->
|
postFromObject: (data, boardID) ->
|
||||||
o =
|
o =
|
||||||
# id
|
# id
|
||||||
postID: data.no
|
postID: data.no
|
||||||
threadID: data.resto or data.no
|
threadID: data.resto or data.no
|
||||||
boardID: boardID
|
boardID: boardID
|
||||||
# info
|
# info
|
||||||
name: Build.unescape data.name
|
name: Build.unescape data.name
|
||||||
capcode: data.capcode
|
capcode: data.capcode
|
||||||
tripcode: data.trip
|
tripcode: data.trip
|
||||||
uniqueID: data.id
|
uniqueID: data.id
|
||||||
email: Build.unescape data.email
|
email: Build.unescape data.email
|
||||||
subject: Build.unescape data.sub
|
subject: Build.unescape data.sub
|
||||||
flagCode: data.country
|
flagCode: data.country
|
||||||
flagName: Build.unescape data.country_name
|
flagName: Build.unescape data.country_name
|
||||||
date: data.now
|
date: data.now
|
||||||
dateUTC: data.time
|
dateUTC: data.time
|
||||||
comment: {innerHTML: data.com or ''}
|
comment: {innerHTML: data.com or ''}
|
||||||
# thread status
|
# thread status
|
||||||
isSticky: !!data.sticky
|
isSticky: !!data.sticky
|
||||||
isClosed: !!data.closed
|
isClosed: !!data.closed
|
||||||
isArchived: !!data.archived
|
isArchived: !!data.archived
|
||||||
# file
|
# file
|
||||||
if data.filedeleted
|
if data.filedeleted
|
||||||
@ -59,7 +59,6 @@ Build =
|
|||||||
else if data.ext
|
else if data.ext
|
||||||
o.file =
|
o.file =
|
||||||
name: (Build.unescape data.filename) + data.ext
|
name: (Build.unescape data.filename) + data.ext
|
||||||
name: data.filename + data.ext
|
|
||||||
timestamp: "#{data.tim}#{data.ext}"
|
timestamp: "#{data.tim}#{data.ext}"
|
||||||
url: if boardID is 'f'
|
url: if boardID is 'f'
|
||||||
"//i.4cdn.org/#{boardID}/#{encodeURIComponent data.filename}#{data.ext}"
|
"//i.4cdn.org/#{boardID}/#{encodeURIComponent data.filename}#{data.ext}"
|
||||||
@ -98,14 +97,15 @@ Build =
|
|||||||
when 'admin', 'admin_highlight'
|
when 'admin', 'admin_highlight'
|
||||||
capcodeClass = ' capcodeAdmin'
|
capcodeClass = ' capcodeAdmin'
|
||||||
capcodeStart = <%= html(' <strong class="capcode hand id_admin" title="Highlight posts by the Administrator">## Admin</strong>') %>
|
capcodeStart = <%= html(' <strong class="capcode hand id_admin" title="Highlight posts by the Administrator">## Admin</strong>') %>
|
||||||
capcodeIcon = <%= html(' <img src="${staticPath}adminicon${gifIcon}" alt="Admin Icon" title="This user is the 4chan Administrator." class="identityIcon retina">') %>
|
capcodeIcon = <%= html(' <img src="//s.4cdn.org/image/adminicon${retina}.gif" alt="Admin Icon" title="This user is the 4chan Administrator." class="identityIcon retina">') %>
|
||||||
when 'mod'
|
when 'mod'
|
||||||
capcodeClass = ' capcodeMod'
|
capcodeClass = ' capcodeMod'
|
||||||
capcodeStart = <%= html(' <strong class="capcode hand id_mod" title="Highlight posts by Moderators">## Mod</strong>') %>
|
capcodeStart = <%= html(' <strong class="capcode hand id_mod" title="Highlight posts by Moderators">## Mod</strong>') %>
|
||||||
capcodeIcon = <%= html(' <img src="${staticPath}modicon${gifIcon}" alt="Mod Icon" title="This user is a 4chan Moderator." class="identityIcon retina">') %>
|
capcodeIcon = <%= html(' <img src="//s.4cdn.org/image/modicon${retina}.gif" alt="Mod Icon" title="This user is a 4chan Moderator." class="identityIcon retina">') %>
|
||||||
|
when 'developer'
|
||||||
capcodeClass = ' capcodeDeveloper'
|
capcodeClass = ' capcodeDeveloper'
|
||||||
capcodeStart = <%= html(' <strong class="capcode hand id_developer" title="Highlight posts by Developers">## Developer</strong>') %>
|
capcodeStart = <%= html(' <strong class="capcode hand id_developer" title="Highlight posts by Developers">## Developer</strong>') %>
|
||||||
capcodeIcon = <%= html(' <img src="${staticPath}developericon${gifIcon}" alt="Developer Icon" title="This user is a 4chan Developer." class="identityIcon retina">') %>
|
capcodeIcon = <%= html(' <img src="//s.4cdn.org/image/developericon${retina}.gif" alt="Developer Icon" title="This user is a 4chan Developer." class="identityIcon retina">') %>
|
||||||
else
|
else
|
||||||
capcodeClass = ''
|
capcodeClass = ''
|
||||||
capcodeStart = <%= html('') %>
|
capcodeStart = <%= html('') %>
|
||||||
@ -181,14 +181,14 @@ Build =
|
|||||||
|
|
||||||
### File Info ###
|
### File Info ###
|
||||||
|
|
||||||
fileCont = if file?.isDeleted
|
if file?.isDeleted
|
||||||
<%= html(
|
fileCont = <%= html(
|
||||||
'<span class="fileThumb">' +
|
'<span class="fileThumb">' +
|
||||||
'<img src="${staticPath}filedeleted-res${gifIcon}" alt="File deleted." class="fileDeletedRes retina">' +
|
'<img src="${staticPath}filedeleted-res${gifIcon}" alt="File deleted." class="fileDeletedRes retina">' +
|
||||||
'</span>'
|
'</span>'
|
||||||
) %>
|
) %>
|
||||||
else if file and boardID is 'f'
|
else if file and boardID is 'f'
|
||||||
<%= html(
|
fileCont = <%= html(
|
||||||
'<div class="fileInfo"><span class="fileText" id="fT${postID}">' +
|
'<div class="fileInfo"><span class="fileText" id="fT${postID}">' +
|
||||||
'File: <a data-width="${file.width}" data-height="${file.height}" href="${file.url}" target="_blank">${file.name}</a>' +
|
'File: <a data-width="${file.width}" data-height="${file.height}" href="${file.url}" target="_blank">${file.name}</a>' +
|
||||||
'-(${$.bytesToString(file.size)}, ${file.width}x${file.height}, ${file.tag})' +
|
'-(${$.bytesToString(file.size)}, ${file.width}x${file.height}, ${file.tag})' +
|
||||||
|
|||||||
@ -3,8 +3,8 @@ Main =
|
|||||||
if location.hostname is 'www.google.com'
|
if location.hostname is 'www.google.com'
|
||||||
return $.ready -> Captcha.noscript.initFrame()
|
return $.ready -> Captcha.noscript.initFrame()
|
||||||
|
|
||||||
g.threads = new SimpleDict
|
g.threads = new SimpleDict()
|
||||||
g.posts = new SimpleDict
|
g.posts = new SimpleDict()
|
||||||
|
|
||||||
pathname = location.pathname.split '/'
|
pathname = location.pathname.split '/'
|
||||||
g.BOARD = new Board pathname[1]
|
g.BOARD = new Board pathname[1]
|
||||||
|
|||||||
@ -70,7 +70,6 @@ do ->
|
|||||||
else
|
else
|
||||||
req.callbacks.push cb
|
req.callbacks.push cb
|
||||||
return req
|
return req
|
||||||
return
|
|
||||||
rm = -> delete reqs[url]
|
rm = -> delete reqs[url]
|
||||||
try
|
try
|
||||||
return unless req = $.ajax url, options
|
return unless req = $.ajax url, options
|
||||||
|
|||||||
@ -2,7 +2,7 @@ class Board
|
|||||||
toString: -> @ID
|
toString: -> @ID
|
||||||
|
|
||||||
constructor: (@ID) ->
|
constructor: (@ID) ->
|
||||||
@threads = new SimpleDict
|
@threads = new SimpleDict()
|
||||||
@posts = new SimpleDict
|
@posts = new SimpleDict()
|
||||||
|
|
||||||
g.boards[@] = @
|
g.boards[@] = @
|
||||||
@ -4,7 +4,7 @@ class Thread
|
|||||||
|
|
||||||
constructor: (@ID, @board) ->
|
constructor: (@ID, @board) ->
|
||||||
@fullID = "#{@board}.#{@ID}"
|
@fullID = "#{@board}.#{@ID}"
|
||||||
@posts = new SimpleDict
|
@posts = new SimpleDict()
|
||||||
@isDead = false
|
@isDead = false
|
||||||
@isHidden = false
|
@isHidden = false
|
||||||
@isOnTop = false
|
@isOnTop = false
|
||||||
|
|||||||
@ -12,9 +12,9 @@ Unread =
|
|||||||
@db = new DataBoard 'lastReadPosts', @sync
|
@db = new DataBoard 'lastReadPosts', @sync
|
||||||
@hr = $.el 'hr',
|
@hr = $.el 'hr',
|
||||||
id: 'unread-line'
|
id: 'unread-line'
|
||||||
@posts = new Set
|
@posts = new Set()
|
||||||
@postsQuotingYou = new Set
|
@postsQuotingYou = new Set()
|
||||||
@order = new RandomAccessList
|
@order = new RandomAccessList()
|
||||||
@position = null
|
@position = null
|
||||||
|
|
||||||
Thread.callbacks.push
|
Thread.callbacks.push
|
||||||
|
|||||||
@ -105,7 +105,7 @@ QuoteThreading =
|
|||||||
posts.forEach QuoteThreading.insert
|
posts.forEach QuoteThreading.insert
|
||||||
else
|
else
|
||||||
nodes = []
|
nodes = []
|
||||||
Unread.order = new RandomAccessList
|
Unread.order = new RandomAccessList()
|
||||||
QuoteThreading.inserted = {}
|
QuoteThreading.inserted = {}
|
||||||
posts.forEach (post) ->
|
posts.forEach (post) ->
|
||||||
return if post.isFetchedQuote
|
return if post.isFetchedQuote
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user