Merge branch 'bstable'

This commit is contained in:
ccd0 2015-10-18 00:47:20 -07:00
commit ea0af4e815
4 changed files with 22 additions and 19 deletions

View File

@ -13,6 +13,9 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
### v1.11.12
**v1.11.12.8** *(2015-10-18)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.12.8/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.12.8/builds/4chan-X-noupdate.crx "Chromium version")]
- Update to support MathJax on /sci/.
**v1.11.12.7** *(2015-10-13)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.12.7/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.12.7/builds/4chan-X-noupdate.crx "Chromium version")]
- Add keybind for `[sjis]` tags (default: `Alt+a`).
- Update max comment length on /jp/ (now 5000, read from board).

View File

@ -302,10 +302,6 @@ audio.controls-added {
.current {
font-weight: bold;
}
:root.fixed.bottom-header #jsMath_button {
bottom: auto;
top: 1px;
}
@media (min-width: 1300px) {
:root.fixed:not(.centered-links) #header-bar {
white-space: nowrap;

View File

@ -3,9 +3,6 @@
background-color: #282A2E;
border-color: #111;
}
:root.tomorrow img[src*="//boards.4chan.org/js/jsMath/fonts/"] {
filter: invert(100%);
}
/* Header */
:root.tomorrow #header-bar.dialog {

View File

@ -26,15 +26,18 @@ Fourchan =
if g.BOARD.ID is 'sci'
$.globalEval '''
window.addEventListener('jsmath', function(e) {
if (!jsMath) return;
if (jsMath.loaded) {
// process one post
jsMath.ProcessBeforeShowing(e.target);
} else if (jsMath.Autoload && jsMath.Autoload.checked) {
// load jsMath and process whole document
jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]);
jsMath.Autoload.LoadJsMath();
window.addEventListener('mathjax', function(e) {
if (window.MathJax) {
window.MathJax.Hub.Queue(function() {
if (!e.target.querySelector('.MathJax')) {
window.MathJax.Hub.Typeset(e.target);
}
});
} else {
if (!document.querySelector('script[src^="//cdn.mathjax.org/"]')) {
window.loadMathJax();
window.loadMathJax = function() {};
}
}
}, false);
'''
@ -66,6 +69,10 @@ Fourchan =
return
math: ->
return if (@isClone and doc.contains @origin.nodes.root) or !$ '.math', @nodes.comment
$.asap (=> doc.contains @nodes.comment), =>
$.event 'jsmath', null, @nodes.comment
return unless /\[(math|eqn)\]/.test(@nodes.comment.textContent) or $('.math:not([id])', @nodes.comment)
cb = =>
return unless doc.contains @nodes.comment
$.off d, 'PostsInserted', cb
$.event 'mathjax', null, @nodes.comment
$.on d, 'PostsInserted', cb
cb()