Cuter Sauce.
This commit is contained in:
parent
c2fa9098b9
commit
659d54a6aa
@ -2174,49 +2174,28 @@
|
|||||||
};
|
};
|
||||||
sauce = {
|
sauce = {
|
||||||
init: function() {
|
init: function() {
|
||||||
var prefix, s;
|
sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm);
|
||||||
sauce.prefixes = (function() {
|
sauce.names = sauce.prefixes.map(function(s) {
|
||||||
var _i, _len, _ref, _results;
|
return s.match(/\w+(?=\.)/)[0];
|
||||||
_ref = conf['flavors'].split('\n');
|
});
|
||||||
_results = [];
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
s = _ref[_i];
|
|
||||||
if (s && s[0] !== '#') {
|
|
||||||
_results.push(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
})();
|
|
||||||
sauce.names = (function() {
|
|
||||||
var _i, _len, _ref, _results;
|
|
||||||
_ref = sauce.prefixes;
|
|
||||||
_results = [];
|
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
|
||||||
prefix = _ref[_i];
|
|
||||||
_results.push(prefix.match(/(\w+)\./)[1]);
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
})();
|
|
||||||
return g.callbacks.push(function(root) {
|
return g.callbacks.push(function(root) {
|
||||||
var i, link, prefix, span, suffix, _len, _ref, _results;
|
var i, link, prefix, span, suffix, _len, _ref, _results;
|
||||||
if (root.className === 'inline') {
|
if (root.className === 'inline' || !(span = $('.filesize', root))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (span = $('.filesize', root)) {
|
suffix = $('a', span).href;
|
||||||
suffix = $('a', span).href;
|
_ref = sauce.prefixes;
|
||||||
_ref = sauce.prefixes;
|
_results = [];
|
||||||
_results = [];
|
for (i = 0, _len = _ref.length; i < _len; i++) {
|
||||||
for (i = 0, _len = _ref.length; i < _len; i++) {
|
prefix = _ref[i];
|
||||||
prefix = _ref[i];
|
link = $.el('a', {
|
||||||
link = $.el('a', {
|
textContent: sauce.names[i],
|
||||||
textContent: sauce.names[i],
|
href: prefix + suffix,
|
||||||
href: prefix + suffix,
|
target: '_blank'
|
||||||
target: '_blank'
|
});
|
||||||
});
|
_results.push($.add(span, $.tn(' '), link));
|
||||||
_results.push($.add(span, $.tn(' '), link));
|
|
||||||
}
|
|
||||||
return _results;
|
|
||||||
}
|
}
|
||||||
|
return _results;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1646,18 +1646,17 @@ anonymize =
|
|||||||
|
|
||||||
sauce =
|
sauce =
|
||||||
init: ->
|
init: ->
|
||||||
sauce.prefixes = (s for s in (conf['flavors'].split '\n') when s and s[0] != '#')
|
sauce.prefixes = conf['flavors'].match /^[^#].+$/gm
|
||||||
sauce.names = (prefix.match(/(\w+)\./)[1] for prefix in sauce.prefixes)
|
sauce.names = sauce.prefixes.map (s) -> s.match(/\w+(?=\.)/)[0]
|
||||||
g.callbacks.push (root) ->
|
g.callbacks.push (root) ->
|
||||||
return if root.className is 'inline'
|
return if root.className is 'inline' or not span = $ '.filesize', root
|
||||||
if span = $ '.filesize', root
|
suffix = $('a', span).href
|
||||||
suffix = $('a', span).href
|
for prefix, i in sauce.prefixes
|
||||||
for prefix, i in sauce.prefixes
|
link = $.el 'a',
|
||||||
link = $.el 'a',
|
textContent: sauce.names[i]
|
||||||
textContent: sauce.names[i]
|
href: prefix + suffix
|
||||||
href: prefix + suffix
|
target: '_blank'
|
||||||
target: '_blank'
|
$.add span, $.tn(' '), link
|
||||||
$.add span, $.tn(' '), link
|
|
||||||
|
|
||||||
revealSpoilers =
|
revealSpoilers =
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user