Merge branch 'v3' of git://github.com/MayhemYDG/4chan-x into v3
Conflicts: CHANGELOG.md src/General/Config.coffee src/General/Main.coffee src/General/lib/$.coffee src/Miscellaneous/Time.coffee
This commit is contained in:
commit
8b992d42ed
@ -1,7 +1,9 @@
|
|||||||
**MayhemYDG**:
|
**MayhemYDG**:
|
||||||
|
- **New feature**: `Show Dice Roll` (with @carboncopy)
|
||||||
|
- Shows dice that were entered into the email field on /tg/.
|
||||||
- Fix impossibility to create new threads when in dead threads.
|
- Fix impossibility to create new threads when in dead threads.
|
||||||
- Fix flag filtering on /sp/ and /int/.
|
- Fix flag filtering on /sp/ and /int/.
|
||||||
- Update archives. (with woxxy and proplex)
|
- Update archives. (with @woxxy and @proplex)
|
||||||
- Minor fixes.
|
- Minor fixes.
|
||||||
- Minor optimizations.
|
- Minor optimizations.
|
||||||
|
|
||||||
|
|||||||
@ -111,7 +111,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
|
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, Dice, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
|
||||||
__slice = [].slice,
|
__slice = [].slice,
|
||||||
__hasProp = {}.hasOwnProperty,
|
__hasProp = {}.hasOwnProperty,
|
||||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||||
@ -133,6 +133,7 @@
|
|||||||
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
||||||
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
||||||
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
|
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
|
||||||
|
'Show Dice Roll': [true, 'Show dice that were entered into the email field.'],
|
||||||
'Check for Updates': [true, 'Check for updated versions of 4chan X.'],
|
'Check for Updates': [true, 'Check for updated versions of 4chan X.'],
|
||||||
'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'],
|
'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'],
|
||||||
'Emoji': [false, 'Adds icons next to names for different emails'],
|
'Emoji': [false, 'Adds icons next to names for different emails'],
|
||||||
@ -447,7 +448,7 @@
|
|||||||
var reqs;
|
var reqs;
|
||||||
|
|
||||||
reqs = {};
|
reqs = {};
|
||||||
return function(url, cb) {
|
return function(url, cb, options) {
|
||||||
var err, req, rm;
|
var err, req, rm;
|
||||||
|
|
||||||
if (req = reqs[url]) {
|
if (req = reqs[url]) {
|
||||||
@ -462,25 +463,23 @@
|
|||||||
return delete reqs[url];
|
return delete reqs[url];
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
req = $.ajax(url, {
|
req = $.ajax(url, options);
|
||||||
onload: function(e) {
|
|
||||||
var _i, _len, _ref;
|
|
||||||
|
|
||||||
_ref = this.callbacks;
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
cb = _ref[_i];
|
|
||||||
cb.call(this, e);
|
|
||||||
}
|
|
||||||
this.evt = e;
|
|
||||||
return delete this.callbacks;
|
|
||||||
},
|
|
||||||
onabort: rm,
|
|
||||||
onerror: rm
|
|
||||||
});
|
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
err = _error;
|
err = _error;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$.on(req, 'load', function(e) {
|
||||||
|
var _i, _len, _ref;
|
||||||
|
|
||||||
|
_ref = this.callbacks;
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
cb = _ref[_i];
|
||||||
|
cb.call(this, e);
|
||||||
|
}
|
||||||
|
this.evt = e;
|
||||||
|
return delete this.callbacks;
|
||||||
|
});
|
||||||
|
$.on(req, 'abort error', rm);
|
||||||
req.callbacks = [cb];
|
req.callbacks = [cb];
|
||||||
return reqs[url] = req;
|
return reqs[url] = req;
|
||||||
};
|
};
|
||||||
@ -2073,6 +2072,8 @@
|
|||||||
})) {
|
})) {
|
||||||
return $.cache(url, function() {
|
return $.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
|
}, {
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2105,6 +2106,8 @@
|
|||||||
})) {
|
})) {
|
||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
|
}, {
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.addClass(root, 'warning');
|
$.addClass(root, 'warning');
|
||||||
@ -2126,6 +2129,8 @@
|
|||||||
})) {
|
})) {
|
||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
|
}, {
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.addClass(root, 'warning');
|
$.addClass(root, 'warning');
|
||||||
@ -8183,6 +8188,7 @@
|
|||||||
domain: 'beta.foolz.us',
|
domain: 'beta.foolz.us',
|
||||||
http: true,
|
http: true,
|
||||||
https: true,
|
https: true,
|
||||||
|
withCredentials: true,
|
||||||
software: 'foolfuuka',
|
software: 'foolfuuka',
|
||||||
boards: ['a', 'co', 'gd', 'h', 'jp', 'm', 'mlp', 'q', 'sp', 'tg', 'tv', 'u', 'v', 'vg', 'vp', 'vr', 'wsg'],
|
boards: ['a', 'co', 'gd', 'h', 'jp', 'm', 'mlp', 'q', 'sp', 'tg', 'tv', 'u', 'v', 'vg', 'vp', 'vr', 'wsg'],
|
||||||
files: ['a', 'gd', 'h', 'jp', 'm', 'q', 'tg', 'u', 'vg', 'vp', 'vr', 'wsg']
|
files: ['a', 'gd', 'h', 'jp', 'm', 'q', 'tg', 'u', 'vg', 'vp', 'vr', 'wsg']
|
||||||
@ -8275,14 +8281,16 @@
|
|||||||
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
|
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
|
||||||
},
|
},
|
||||||
post: function(archive, _arg) {
|
post: function(archive, _arg) {
|
||||||
var boardID, postID, protocol;
|
var URL, boardID, postID, protocol;
|
||||||
|
|
||||||
boardID = _arg.boardID, postID = _arg.postID;
|
boardID = _arg.boardID, postID = _arg.postID;
|
||||||
protocol = Redirect.protocol(archive);
|
protocol = Redirect.protocol(archive);
|
||||||
if (['Foolz', 'NSFW Foolz'].contains(archive.name)) {
|
if (['Foolz', 'NSFW Foolz'].contains(archive.name)) {
|
||||||
protocol = 'https://';
|
protocol = 'https://';
|
||||||
}
|
}
|
||||||
return "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID;
|
URL = new String("" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
|
||||||
|
URL.archive = archive;
|
||||||
|
return URL;
|
||||||
},
|
},
|
||||||
file: function(archive, _arg) {
|
file: function(archive, _arg) {
|
||||||
var boardID, filename;
|
var boardID, filename;
|
||||||
@ -8498,6 +8506,27 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Dice = {
|
||||||
|
init: function() {
|
||||||
|
if (g.BOARD.ID !== 'tg' || g.VIEW === 'catalog' || !Conf['Show Dice Roll']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return Post.prototype.callbacks.push({
|
||||||
|
name: 'Show Dice Roll',
|
||||||
|
cb: this.node
|
||||||
|
});
|
||||||
|
},
|
||||||
|
node: function() {
|
||||||
|
var dicestats, roll, _ref;
|
||||||
|
|
||||||
|
if (this.isClone || !(dicestats = (_ref = this.info.email) != null ? _ref.match(/dice[+\s](\d+)d(\d+)/) : void 0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
roll = $('b', this.nodes.comment).firstChild;
|
||||||
|
return roll.data = "Rolled " + dicestats[1] + "d" + dicestats[2] + " and got " + (roll.data.slice(7));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Emoji = {
|
Emoji = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var css, icon, name, pos, _ref;
|
var css, icon, name, pos, _ref;
|
||||||
@ -9650,7 +9679,7 @@
|
|||||||
return Time.zeroPad(this.getSeconds());
|
return Time.zeroPad(this.getSeconds());
|
||||||
},
|
},
|
||||||
y: function() {
|
y: function() {
|
||||||
return this.getFullYear() % 100;
|
return this.getFullYear().toString().slice(2);
|
||||||
},
|
},
|
||||||
Y: function() {
|
Y: function() {
|
||||||
return this.getFullYear();
|
return this.getFullYear();
|
||||||
@ -10472,7 +10501,8 @@
|
|||||||
'Thread Updater': ThreadUpdater,
|
'Thread Updater': ThreadUpdater,
|
||||||
'Thread Watcher': ThreadWatcher,
|
'Thread Watcher': ThreadWatcher,
|
||||||
'Index Navigation': Nav,
|
'Index Navigation': Nav,
|
||||||
'Keybinds': Keybinds
|
'Keybinds': Keybinds,
|
||||||
|
'Show Dice Roll': Dice
|
||||||
});
|
});
|
||||||
$.on(d, 'AddCallback', Main.addCallback);
|
$.on(d, 'AddCallback', Main.addCallback);
|
||||||
return $.ready(Main.initReady);
|
return $.ready(Main.initReady);
|
||||||
|
|||||||
@ -92,7 +92,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
|
var $, $$, Anonymize, ArchiveLink, Board, Build, CatalogLinks, Clone, Conf, Config, CustomCSS, DataBoard, DataBoards, DeleteLink, Dice, DownloadLink, Emoji, ExpandComment, ExpandThread, FappeTyme, Favicon, FileInfo, Filter, Fourchan, Get, Header, IDColor, ImageExpand, ImageHover, ImageLoader, Keybinds, Linkify, Main, Menu, Nav, Notification, PSAHiding, Polyfill, Post, PostHiding, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, c, d, doc, g,
|
||||||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
|
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
|
||||||
__slice = [].slice,
|
__slice = [].slice,
|
||||||
__hasProp = {}.hasOwnProperty,
|
__hasProp = {}.hasOwnProperty,
|
||||||
@ -115,6 +115,7 @@
|
|||||||
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
'Thread Expansion': [true, 'Add buttons to expand threads.'],
|
||||||
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
'Index Navigation': [false, 'Add buttons to navigate between threads.'],
|
||||||
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
|
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
|
||||||
|
'Show Dice Roll': [true, 'Show dice that were entered into the email field.'],
|
||||||
'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'],
|
'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'],
|
||||||
'Emoji': [false, 'Adds icons next to names for different emails'],
|
'Emoji': [false, 'Adds icons next to names for different emails'],
|
||||||
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
|
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
|
||||||
@ -428,7 +429,7 @@
|
|||||||
var reqs;
|
var reqs;
|
||||||
|
|
||||||
reqs = {};
|
reqs = {};
|
||||||
return function(url, cb) {
|
return function(url, cb, options) {
|
||||||
var err, req, rm;
|
var err, req, rm;
|
||||||
|
|
||||||
if (req = reqs[url]) {
|
if (req = reqs[url]) {
|
||||||
@ -443,25 +444,23 @@
|
|||||||
return delete reqs[url];
|
return delete reqs[url];
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
req = $.ajax(url, {
|
req = $.ajax(url, options);
|
||||||
onload: function(e) {
|
|
||||||
var _i, _len, _ref;
|
|
||||||
|
|
||||||
_ref = this.callbacks;
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
cb = _ref[_i];
|
|
||||||
cb.call(this, e);
|
|
||||||
}
|
|
||||||
this.evt = e;
|
|
||||||
return delete this.callbacks;
|
|
||||||
},
|
|
||||||
onabort: rm,
|
|
||||||
onerror: rm
|
|
||||||
});
|
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
err = _error;
|
err = _error;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$.on(req, 'load', function(e) {
|
||||||
|
var _i, _len, _ref;
|
||||||
|
|
||||||
|
_ref = this.callbacks;
|
||||||
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
cb = _ref[_i];
|
||||||
|
cb.call(this, e);
|
||||||
|
}
|
||||||
|
this.evt = e;
|
||||||
|
return delete this.callbacks;
|
||||||
|
});
|
||||||
|
$.on(req, 'abort error', rm);
|
||||||
req.callbacks = [cb];
|
req.callbacks = [cb];
|
||||||
return reqs[url] = req;
|
return reqs[url] = req;
|
||||||
};
|
};
|
||||||
@ -2085,6 +2084,8 @@
|
|||||||
})) {
|
})) {
|
||||||
return $.cache(url, function() {
|
return $.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
|
}, {
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -2117,6 +2118,8 @@
|
|||||||
})) {
|
})) {
|
||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
|
}, {
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.addClass(root, 'warning');
|
$.addClass(root, 'warning');
|
||||||
@ -2138,6 +2141,8 @@
|
|||||||
})) {
|
})) {
|
||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, boardID, postID, root, context);
|
return Get.archivedPost(this, boardID, postID, root, context);
|
||||||
|
}, {
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.addClass(root, 'warning');
|
$.addClass(root, 'warning');
|
||||||
@ -8169,6 +8174,7 @@
|
|||||||
domain: 'beta.foolz.us',
|
domain: 'beta.foolz.us',
|
||||||
http: true,
|
http: true,
|
||||||
https: true,
|
https: true,
|
||||||
|
withCredentials: true,
|
||||||
software: 'foolfuuka',
|
software: 'foolfuuka',
|
||||||
boards: ['a', 'co', 'gd', 'h', 'jp', 'm', 'mlp', 'q', 'sp', 'tg', 'tv', 'u', 'v', 'vg', 'vp', 'vr', 'wsg'],
|
boards: ['a', 'co', 'gd', 'h', 'jp', 'm', 'mlp', 'q', 'sp', 'tg', 'tv', 'u', 'v', 'vg', 'vp', 'vr', 'wsg'],
|
||||||
files: ['a', 'gd', 'h', 'jp', 'm', 'q', 'tg', 'u', 'vg', 'vp', 'vr', 'wsg']
|
files: ['a', 'gd', 'h', 'jp', 'm', 'q', 'tg', 'u', 'vg', 'vp', 'vr', 'wsg']
|
||||||
@ -8261,14 +8267,16 @@
|
|||||||
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
|
return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path;
|
||||||
},
|
},
|
||||||
post: function(archive, _arg) {
|
post: function(archive, _arg) {
|
||||||
var boardID, postID, protocol;
|
var URL, boardID, postID, protocol;
|
||||||
|
|
||||||
boardID = _arg.boardID, postID = _arg.postID;
|
boardID = _arg.boardID, postID = _arg.postID;
|
||||||
protocol = Redirect.protocol(archive);
|
protocol = Redirect.protocol(archive);
|
||||||
if (['Foolz', 'NSFW Foolz'].contains(archive.name)) {
|
if (['Foolz', 'NSFW Foolz'].contains(archive.name)) {
|
||||||
protocol = 'https://';
|
protocol = 'https://';
|
||||||
}
|
}
|
||||||
return "" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID;
|
URL = new String("" + protocol + archive.domain + "/_/api/chan/post/?board=" + boardID + "&num=" + postID);
|
||||||
|
URL.archive = archive;
|
||||||
|
return URL;
|
||||||
},
|
},
|
||||||
file: function(archive, _arg) {
|
file: function(archive, _arg) {
|
||||||
var boardID, filename;
|
var boardID, filename;
|
||||||
@ -8484,6 +8492,27 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Dice = {
|
||||||
|
init: function() {
|
||||||
|
if (g.BOARD.ID !== 'tg' || g.VIEW === 'catalog' || !Conf['Show Dice Roll']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return Post.prototype.callbacks.push({
|
||||||
|
name: 'Show Dice Roll',
|
||||||
|
cb: this.node
|
||||||
|
});
|
||||||
|
},
|
||||||
|
node: function() {
|
||||||
|
var dicestats, roll, _ref;
|
||||||
|
|
||||||
|
if (this.isClone || !(dicestats = (_ref = this.info.email) != null ? _ref.match(/dice[+\s](\d+)d(\d+)/) : void 0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
roll = $('b', this.nodes.comment).firstChild;
|
||||||
|
return roll.data = "Rolled " + dicestats[1] + "d" + dicestats[2] + " and got " + (roll.data.slice(7));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Emoji = {
|
Emoji = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var css, icon, name, pos, _ref;
|
var css, icon, name, pos, _ref;
|
||||||
@ -9636,7 +9665,7 @@
|
|||||||
return Time.zeroPad(this.getSeconds());
|
return Time.zeroPad(this.getSeconds());
|
||||||
},
|
},
|
||||||
y: function() {
|
y: function() {
|
||||||
return this.getFullYear() % 100;
|
return this.getFullYear().toString().slice(2);
|
||||||
},
|
},
|
||||||
Y: function() {
|
Y: function() {
|
||||||
return this.getFullYear();
|
return this.getFullYear();
|
||||||
@ -10456,7 +10485,8 @@
|
|||||||
'Thread Updater': ThreadUpdater,
|
'Thread Updater': ThreadUpdater,
|
||||||
'Thread Watcher': ThreadWatcher,
|
'Thread Watcher': ThreadWatcher,
|
||||||
'Index Navigation': Nav,
|
'Index Navigation': Nav,
|
||||||
'Keybinds': Keybinds
|
'Keybinds': Keybinds,
|
||||||
|
'Show Dice Roll': Dice
|
||||||
});
|
});
|
||||||
$.on(d, 'AddCallback', Main.addCallback);
|
$.on(d, 'AddCallback', Main.addCallback);
|
||||||
return $.ready(Main.initReady);
|
return $.ready(Main.initReady);
|
||||||
|
|||||||
@ -103,6 +103,7 @@
|
|||||||
"domain": "beta.foolz.us",
|
"domain": "beta.foolz.us",
|
||||||
"http": true,
|
"http": true,
|
||||||
"https": true,
|
"https": true,
|
||||||
|
"withCredentials": true,
|
||||||
"software": "foolfuuka",
|
"software": "foolfuuka",
|
||||||
"boards": ["a", "co", "gd", "h", "jp", "m", "mlp", "q", "sp", "tg", "tv", "u", "v", "vg", "vp", "vr", "wsg"],
|
"boards": ["a", "co", "gd", "h", "jp", "m", "mlp", "q", "sp", "tg", "tv", "u", "v", "vg", "vp", "vr", "wsg"],
|
||||||
"files": ["a", "gd", "h", "jp", "m", "q", "tg", "u", "vg", "vp", "vr", "wsg"]
|
"files": ["a", "gd", "h", "jp", "m", "q", "tg", "u", "vg", "vp", "vr", "wsg"]
|
||||||
|
|||||||
@ -56,7 +56,8 @@ Redirect =
|
|||||||
'Foolz Beta':
|
'Foolz Beta':
|
||||||
domain: 'beta.foolz.us'
|
domain: 'beta.foolz.us'
|
||||||
http: true
|
http: true
|
||||||
https: true,
|
https: true
|
||||||
|
withCredentials: true
|
||||||
software: 'foolfuuka'
|
software: 'foolfuuka'
|
||||||
boards: ['a', 'co', 'gd', 'h', 'jp', 'm', 'mlp', 'q', 'sp', 'tg', 'tv', 'u', 'v', 'vg', 'vp', 'vr', 'wsg'],
|
boards: ['a', 'co', 'gd', 'h', 'jp', 'm', 'mlp', 'q', 'sp', 'tg', 'tv', 'u', 'v', 'vg', 'vp', 'vr', 'wsg'],
|
||||||
files: ['a', 'gd', 'h', 'jp', 'm', 'q', 'tg', 'u', 'vg', 'vp', 'vr', 'wsg']
|
files: ['a', 'gd', 'h', 'jp', 'm', 'q', 'tg', 'u', 'vg', 'vp', 'vr', 'wsg']
|
||||||
@ -150,7 +151,9 @@ Redirect =
|
|||||||
# Remove necessary HTTPS procotol in September 2013.
|
# Remove necessary HTTPS procotol in September 2013.
|
||||||
if ['Foolz', 'NSFW Foolz'].contains archive.name
|
if ['Foolz', 'NSFW Foolz'].contains archive.name
|
||||||
protocol = 'https://'
|
protocol = 'https://'
|
||||||
"#{protocol}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}"
|
URL = new String "#{protocol}#{archive.domain}/_/api/chan/post/?board=#{boardID}&num=#{postID}"
|
||||||
|
URL.archive = archive
|
||||||
|
URL
|
||||||
|
|
||||||
file: (archive, {boardID, filename}) ->
|
file: (archive, {boardID, filename}) ->
|
||||||
"#{Redirect.protocol archive}#{archive.domain}/#{boardID}/full_image/#{filename}"
|
"#{Redirect.protocol archive}#{archive.domain}/#{boardID}/full_image/#{filename}"
|
||||||
|
|||||||
@ -53,6 +53,10 @@ Config =
|
|||||||
false
|
false
|
||||||
'Add buttons to navigate to top / bottom of thread.'
|
'Add buttons to navigate to top / bottom of thread.'
|
||||||
]
|
]
|
||||||
|
'Show Dice Roll': [
|
||||||
|
true
|
||||||
|
'Show dice that were entered into the email field.'
|
||||||
|
]
|
||||||
<% if (type !== 'crx') { %>
|
<% if (type !== 'crx') { %>
|
||||||
'Check for Updates': [
|
'Check for Updates': [
|
||||||
true
|
true
|
||||||
|
|||||||
@ -71,8 +71,10 @@ Get =
|
|||||||
$.cache "//api.4chan.org/#{boardID}/res/#{threadID}.json", ->
|
$.cache "//api.4chan.org/#{boardID}/res/#{threadID}.json", ->
|
||||||
Get.fetchedPost @, boardID, threadID, postID, root, context
|
Get.fetchedPost @, boardID, threadID, postID, root, context
|
||||||
else if url = Redirect.to 'post', {boardID, postID}
|
else if url = Redirect.to 'post', {boardID, postID}
|
||||||
$.cache url, ->
|
$.cache url,
|
||||||
Get.archivedPost @, boardID, postID, root, context
|
-> Get.archivedPost @, boardID, postID, root, context
|
||||||
|
,
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
insert: (post, root, context) ->
|
insert: (post, root, context) ->
|
||||||
# Stop here if the container has been removed while loading.
|
# Stop here if the container has been removed while loading.
|
||||||
return unless root.parentNode
|
return unless root.parentNode
|
||||||
@ -97,8 +99,10 @@ Get =
|
|||||||
unless [200, 304].contains status
|
unless [200, 304].contains status
|
||||||
# The thread can die by the time we check a quote.
|
# The thread can die by the time we check a quote.
|
||||||
if url = Redirect.to 'post', {boardID, postID}
|
if url = Redirect.to 'post', {boardID, postID}
|
||||||
$.cache url, ->
|
$.cache url,
|
||||||
Get.archivedPost @, boardID, postID, root, context
|
-> Get.archivedPost @, boardID, postID, root, context
|
||||||
|
,
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
else
|
else
|
||||||
$.addClass root, 'warning'
|
$.addClass root, 'warning'
|
||||||
root.textContent =
|
root.textContent =
|
||||||
@ -115,8 +119,10 @@ Get =
|
|||||||
if post.no > postID
|
if post.no > postID
|
||||||
# The post can be deleted by the time we check a quote.
|
# The post can be deleted by the time we check a quote.
|
||||||
if url = Redirect.to 'post', {boardID, postID}
|
if url = Redirect.to 'post', {boardID, postID}
|
||||||
$.cache url, ->
|
$.cache url,
|
||||||
Get.archivedPost @, boardID, postID, root, context
|
-> Get.archivedPost @, boardID, postID, root, context
|
||||||
|
,
|
||||||
|
withCredentials: url.archive.withCredentials
|
||||||
else
|
else
|
||||||
$.addClass root, 'warning'
|
$.addClass root, 'warning'
|
||||||
root.textContent = "Post No.#{postID} was not found."
|
root.textContent = "Post No.#{postID} was not found."
|
||||||
|
|||||||
@ -128,6 +128,7 @@ Main =
|
|||||||
'Thread Watcher': ThreadWatcher
|
'Thread Watcher': ThreadWatcher
|
||||||
'Index Navigation': Nav
|
'Index Navigation': Nav
|
||||||
'Keybinds': Keybinds
|
'Keybinds': Keybinds
|
||||||
|
'Show Dice Roll': Dice
|
||||||
|
|
||||||
# c.timeEnd 'All initializations'
|
# c.timeEnd 'All initializations'
|
||||||
|
|
||||||
|
|||||||
@ -72,7 +72,7 @@ $.ajax = (url, options, extra={}) ->
|
|||||||
|
|
||||||
$.cache = do ->
|
$.cache = do ->
|
||||||
reqs = {}
|
reqs = {}
|
||||||
(url, cb) ->
|
(url, cb, options) ->
|
||||||
if req = reqs[url]
|
if req = reqs[url]
|
||||||
if req.readyState is 4
|
if req.readyState is 4
|
||||||
cb.call req, req.evt
|
cb.call req, req.evt
|
||||||
@ -81,15 +81,14 @@ $.cache = do ->
|
|||||||
return
|
return
|
||||||
rm = -> delete reqs[url]
|
rm = -> delete reqs[url]
|
||||||
try
|
try
|
||||||
req = $.ajax url,
|
req = $.ajax url, options
|
||||||
onload: (e) ->
|
|
||||||
cb.call @, e for cb in @callbacks
|
|
||||||
@evt = e
|
|
||||||
delete @callbacks
|
|
||||||
onabort: rm
|
|
||||||
onerror: rm
|
|
||||||
catch err
|
catch err
|
||||||
return
|
return
|
||||||
|
$.on req, 'load', (e) ->
|
||||||
|
cb.call @, e for cb in @callbacks
|
||||||
|
@evt = e
|
||||||
|
delete @callbacks
|
||||||
|
$.on req, 'abort error', rm
|
||||||
req.callbacks = [cb]
|
req.callbacks = [cb]
|
||||||
reqs[url] = req
|
reqs[url] = req
|
||||||
|
|
||||||
|
|||||||
11
src/Miscellaneous/Dice.coffee
Normal file
11
src/Miscellaneous/Dice.coffee
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Dice =
|
||||||
|
init: ->
|
||||||
|
return if g.BOARD.ID isnt 'tg' or g.VIEW is 'catalog' or !Conf['Show Dice Roll']
|
||||||
|
Post::callbacks.push
|
||||||
|
name: 'Show Dice Roll'
|
||||||
|
cb: @node
|
||||||
|
node: ->
|
||||||
|
return if @isClone or not dicestats = @info.email?.match /dice[+\s](\d+)d(\d+)/
|
||||||
|
# Use the text node directly, as the <b> has two <br>.
|
||||||
|
roll = $('b', @nodes.comment).firstChild
|
||||||
|
roll.data = "Rolled #{dicestats[1]}d#{dicestats[2]} and got #{roll.data.slice 7}"
|
||||||
@ -56,5 +56,6 @@ Time =
|
|||||||
p: -> if @getHours() < 12 then 'AM' else 'PM'
|
p: -> if @getHours() < 12 then 'AM' else 'PM'
|
||||||
P: -> if @getHours() < 12 then 'am' else 'pm'
|
P: -> if @getHours() < 12 then 'am' else 'pm'
|
||||||
S: -> Time.zeroPad @getSeconds()
|
S: -> Time.zeroPad @getSeconds()
|
||||||
y: -> @getFullYear() % 100
|
y: -> @getFullYear().toString()[2..]
|
||||||
Y: -> @getFullYear()
|
Y: -> @getFullYear()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user