Merge branch 'mayhem' into v3
Conflicts: CHANGELOG.md src/General/lib/$.coffee src/Images/Sauce.coffee
This commit is contained in:
commit
2ac2286ad5
@ -3,6 +3,9 @@
|
|||||||
- More stability update.
|
- More stability update.
|
||||||
- Stability update.
|
- Stability update.
|
||||||
|
|
||||||
|
**ParrotParrot**:
|
||||||
|
- Added `Original filename` variable to Sauce panel.
|
||||||
|
|
||||||
**seaweedchan**:
|
**seaweedchan**:
|
||||||
- Fix Menu errors on older Firefox versions, such as the ESR
|
- Fix Menu errors on older Firefox versions, such as the ESR
|
||||||
|
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.3.2 - 2014-01-24
|
* 4chan X - Version 1.3.2 - 2014-01-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.3.2 - 2014-01-24
|
* 4chan X - Version 1.3.2 - 2014-01-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -561,21 +561,12 @@
|
|||||||
return __indexOf.call(el.classList, className) >= 0;
|
return __indexOf.call(el.classList, className) >= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.rm = (function() {
|
$.rm = function(el) {
|
||||||
if ('remove' in Element.prototype) {
|
return el.remove();
|
||||||
return function(el) {
|
};
|
||||||
return el.remove();
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return function(el) {
|
|
||||||
var _ref;
|
|
||||||
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
$.rmAll = function(root) {
|
$.rmAll = function(root) {
|
||||||
return root.textContent = '';
|
return root.textContent = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.tn = function(s) {
|
$.tn = function(s) {
|
||||||
@ -7972,19 +7963,15 @@
|
|||||||
},
|
},
|
||||||
createSauceLink: function(link) {
|
createSauceLink: function(link) {
|
||||||
var m, text;
|
var m, text;
|
||||||
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
|
link = link.replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
||||||
switch (parameter) {
|
var type;
|
||||||
case '%TURL':
|
return ((type = {
|
||||||
return "' + encodeURIComponent(post.file.thumbURL) + '";
|
'%TURL': 'post.file.thumbURL',
|
||||||
case '%URL':
|
'%URL': 'post.file.URL',
|
||||||
return "' + encodeURIComponent(post.file.URL) + '";
|
'%MD5': 'post.file.MD5',
|
||||||
case '%MD5':
|
'%board': 'post.board',
|
||||||
return "' + encodeURIComponent(post.file.MD5) + '";
|
'%name': 'post.file.name'
|
||||||
case '%board':
|
}[parameter]) ? "' + encodeURIComponent(" + type + ") + '" : parameter);
|
||||||
return "' + encodeURIComponent(post.board) + '";
|
|
||||||
default:
|
|
||||||
return parameter;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
||||||
link = link.replace(/;text:.+$/, '');
|
link = link.replace(/;text:.+$/, '');
|
||||||
@ -12845,7 +12832,7 @@
|
|||||||
},
|
},
|
||||||
sauce: function(section) {
|
sauce: function(section) {
|
||||||
var ta;
|
var ta;
|
||||||
section.innerHTML = "<div class=warning " + (Conf['Sauce'] ? 'hidden' : '') + "><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%board</code>: Current board.</li></ul><textarea name=sauces class=field spellcheck=false></textarea>";
|
section.innerHTML = "<div class=warning " + (Conf['Sauce'] ? 'hidden' : '') + "><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li></ul><textarea name=sauces class=field spellcheck=false></textarea>";
|
||||||
ta = $('textarea', section);
|
ta = $('textarea', section);
|
||||||
$.get('sauces', Conf['sauces'], function(item) {
|
$.get('sauces', Conf['sauces'], function(item) {
|
||||||
return ta.value = item['sauces'];
|
return ta.value = item['sauces'];
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Generated by CoffeeScript
|
// Generated by CoffeeScript
|
||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.3.2 - 2014-01-24
|
* 4chan X - Version 1.3.2 - 2014-01-28
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
|
||||||
@ -538,21 +538,12 @@
|
|||||||
return __indexOf.call(el.classList, className) >= 0;
|
return __indexOf.call(el.classList, className) >= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.rm = (function() {
|
$.rm = function(el) {
|
||||||
if ('remove' in Element.prototype) {
|
return el.remove();
|
||||||
return function(el) {
|
};
|
||||||
return el.remove();
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return function(el) {
|
|
||||||
var _ref;
|
|
||||||
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
$.rmAll = function(root) {
|
$.rmAll = function(root) {
|
||||||
return root.textContent = '';
|
return root.textContent = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.tn = function(s) {
|
$.tn = function(s) {
|
||||||
@ -7965,19 +7956,15 @@
|
|||||||
},
|
},
|
||||||
createSauceLink: function(link) {
|
createSauceLink: function(link) {
|
||||||
var m, text;
|
var m, text;
|
||||||
link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) {
|
link = link.replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
||||||
switch (parameter) {
|
var type;
|
||||||
case '%TURL':
|
return ((type = {
|
||||||
return "' + encodeURIComponent(post.file.thumbURL) + '";
|
'%TURL': 'post.file.thumbURL',
|
||||||
case '%URL':
|
'%URL': 'post.file.URL',
|
||||||
return "' + encodeURIComponent(post.file.URL) + '";
|
'%MD5': 'post.file.MD5',
|
||||||
case '%MD5':
|
'%board': 'post.board',
|
||||||
return "' + encodeURIComponent(post.file.MD5) + '";
|
'%name': 'post.file.name'
|
||||||
case '%board':
|
}[parameter]) ? "' + encodeURIComponent(" + type + ") + '" : parameter);
|
||||||
return "' + encodeURIComponent(post.board) + '";
|
|
||||||
default:
|
|
||||||
return parameter;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
||||||
link = link.replace(/;text:.+$/, '');
|
link = link.replace(/;text:.+$/, '');
|
||||||
@ -12841,7 +12828,7 @@
|
|||||||
},
|
},
|
||||||
sauce: function(section) {
|
sauce: function(section) {
|
||||||
var ta;
|
var ta;
|
||||||
section.innerHTML = "<div class=warning " + (Conf['Sauce'] ? 'hidden' : '') + "><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%board</code>: Current board.</li></ul><textarea name=sauces class=field spellcheck=false></textarea>";
|
section.innerHTML = "<div class=warning " + (Conf['Sauce'] ? 'hidden' : '') + "><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li></ul><textarea name=sauces class=field spellcheck=false></textarea>";
|
||||||
ta = $('textarea', section);
|
ta = $('textarea', section);
|
||||||
$.get('sauces', Conf['sauces'], function(item) {
|
$.get('sauces', Conf['sauces'], function(item) {
|
||||||
return ta.value = item['sauces'];
|
return ta.value = item['sauces'];
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
"grunt-contrib-concat": "~0.3.0",
|
"grunt-contrib-concat": "~0.3.0",
|
||||||
"grunt-contrib-copy": "~0.5.0",
|
"grunt-contrib-copy": "~0.5.0",
|
||||||
"grunt-contrib-watch": "~0.5.3",
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
"grunt-shell": "~0.6.3",
|
"grunt-shell": "~0.6.4",
|
||||||
"load-grunt-tasks": "~0.2.1"
|
"load-grunt-tasks": "~0.2.1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
<li><code>%TURL</code>: Thumbnail URL.</li>
|
<li><code>%TURL</code>: Thumbnail URL.</li>
|
||||||
<li><code>%URL</code>: Full image URL.</li>
|
<li><code>%URL</code>: Full image URL.</li>
|
||||||
<li><code>%MD5</code>: MD5 hash.</li>
|
<li><code>%MD5</code>: MD5 hash.</li>
|
||||||
|
<li><code>%name</code>: Original file name.</li>
|
||||||
<li><code>%board</code>: Current board.</li>
|
<li><code>%board</code>: Current board.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<textarea name=sauces class=field spellcheck=false></textarea>
|
<textarea name=sauces class=field spellcheck=false></textarea>
|
||||||
@ -127,14 +127,12 @@ $.toggleClass = (el, className) ->
|
|||||||
$.hasClass = (el, className) ->
|
$.hasClass = (el, className) ->
|
||||||
className in el.classList
|
className in el.classList
|
||||||
|
|
||||||
$.rm = do ->
|
$.rm = (el) ->
|
||||||
if 'remove' of Element::
|
el.remove()
|
||||||
(el) -> el.remove()
|
|
||||||
else
|
|
||||||
(el) -> el.parentNode?.removeChild el
|
|
||||||
|
|
||||||
# jsperf.com/emptify-element/9
|
$.rmAll = (root) ->
|
||||||
$.rmAll = (root) -> root.textContent = ''
|
# https://gist.github.com/MayhemYDG/8646194
|
||||||
|
root.textContent = null
|
||||||
|
|
||||||
$.tn = (s) ->
|
$.tn = (s) ->
|
||||||
d.createTextNode s
|
d.createTextNode s
|
||||||
|
|||||||
@ -15,19 +15,17 @@ Sauce =
|
|||||||
name: 'Sauce'
|
name: 'Sauce'
|
||||||
cb: @node
|
cb: @node
|
||||||
createSauceLink: (link) ->
|
createSauceLink: (link) ->
|
||||||
link = link.replace /%(T?URL|MD5|board)/ig, (parameter) ->
|
link = link.replace /%(T?URL|MD5|board|name)/g, (parameter) ->
|
||||||
switch parameter
|
return (if type = {
|
||||||
|
'%TURL': 'post.file.thumbURL'
|
||||||
when '%TURL'
|
'%URL': 'post.file.URL'
|
||||||
"' + encodeURIComponent(post.file.thumbURL) + '"
|
'%MD5': 'post.file.MD5'
|
||||||
when '%URL'
|
'%board': 'post.board'
|
||||||
"' + encodeURIComponent(post.file.URL) + '"
|
'%name': 'post.file.name'
|
||||||
when '%MD5'
|
}[parameter]
|
||||||
"' + encodeURIComponent(post.file.MD5) + '"
|
"' + encodeURIComponent(#{type}) + '"
|
||||||
when '%board'
|
else
|
||||||
"' + encodeURIComponent(post.board) + '"
|
parameter)
|
||||||
else
|
|
||||||
parameter
|
|
||||||
text = if m = link.match(/;text:(.+)$/) then m[1] else link.match(/(\w+)\.\w+\//)[1]
|
text = if m = link.match(/;text:(.+)$/) then m[1] else link.match(/(\w+)\.\w+\//)[1]
|
||||||
link = link.replace /;text:.+$/, ''
|
link = link.replace /;text:.+$/, ''
|
||||||
Function 'post', 'a', """
|
Function 'post', 'a', """
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user