Merge branch 'v3'
Conflicts: CHANGELOG.md LICENSE builds/appchan-x.user.js builds/crx/script.js src/Images/Sauce.coffee
This commit is contained in:
commit
9199f12ce0
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,12 +1,14 @@
|
||||
<<<<<<< HEAD
|
||||
### v2.8.7
|
||||
*2014-01-19*
|
||||
=======
|
||||
|
||||
**MayhemYDG**:
|
||||
- Added a `Reset Settings` button in the settings.
|
||||
- More stability update.
|
||||
- Stability update.
|
||||
>>>>>>> v3
|
||||
|
||||
**ParrotParrot**:
|
||||
- Added `Original filename` variable to Sauce panel.
|
||||
|
||||
### v2.8.7
|
||||
*2014-01-19*
|
||||
|
||||
**Zixaphir**:
|
||||
- Fix posting.
|
||||
|
||||
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* appchan x - Version 2.8.7 - 2014-01-26
|
||||
* appchan x - Version 2.8.7 - 2014-01-28
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
// ==/UserScript==
|
||||
|
||||
/*
|
||||
* appchan x - Version 2.8.7 - 2014-01-26
|
||||
* appchan x - Version 2.8.7 - 2014-01-28
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||
@ -2736,21 +2736,12 @@
|
||||
return __indexOf.call(el.classList, className) >= 0;
|
||||
};
|
||||
|
||||
$.rm = (function() {
|
||||
if ('remove' in Element.prototype) {
|
||||
return function(el) {
|
||||
return el.remove();
|
||||
};
|
||||
} else {
|
||||
return function(el) {
|
||||
var _ref;
|
||||
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
|
||||
};
|
||||
}
|
||||
})();
|
||||
$.rm = function(el) {
|
||||
return el.remove();
|
||||
};
|
||||
|
||||
$.rmAll = function(root) {
|
||||
return root.textContent = '';
|
||||
return root.textContent = null;
|
||||
};
|
||||
|
||||
$.tn = function(s) {
|
||||
@ -10622,23 +10613,15 @@
|
||||
},
|
||||
createSauceLink: function(link) {
|
||||
var m, text;
|
||||
link = link.replace(/(%(T?URL|MD5|board)|\$[1-4])/ig, function(parameter) {
|
||||
switch (parameter) {
|
||||
case '%TURL':
|
||||
case '$1':
|
||||
return "' + encodeURIComponent(post.file.thumbURL) + '";
|
||||
case '%URL':
|
||||
case '$2':
|
||||
return "' + encodeURIComponent(post.file.URL) + '";
|
||||
case '%MD5':
|
||||
case '$3':
|
||||
return "' + encodeURIComponent(post.file.MD5) + '";
|
||||
case '%board':
|
||||
case '$4':
|
||||
return "' + encodeURIComponent(post.board) + '";
|
||||
default:
|
||||
return parameter;
|
||||
}
|
||||
link = link.replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
||||
var type;
|
||||
return ((type = {
|
||||
'%TURL': 'post.file.thumbURL',
|
||||
'%URL': 'post.file.URL',
|
||||
'%MD5': 'post.file.MD5',
|
||||
'%board': 'post.board',
|
||||
'%name': 'post.file.name'
|
||||
}[parameter]) ? "' + encodeURIComponent(" + type + ") + '" : parameter);
|
||||
});
|
||||
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
||||
link = link.replace(/;text:.+$/, '');
|
||||
@ -16349,7 +16332,7 @@
|
||||
},
|
||||
sauce: function(section) {
|
||||
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);
|
||||
$.get('sauces', Conf['sauces'], function(item) {
|
||||
return ta.value = item['sauces'].replace(/\$\d/g, function(c) {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// Generated by CoffeeScript
|
||||
/*
|
||||
* appchan x - Version 2.8.7 - 2014-01-26
|
||||
* appchan x - Version 2.8.7 - 2014-01-28
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE
|
||||
@ -2713,21 +2713,12 @@
|
||||
return __indexOf.call(el.classList, className) >= 0;
|
||||
};
|
||||
|
||||
$.rm = (function() {
|
||||
if ('remove' in Element.prototype) {
|
||||
return function(el) {
|
||||
return el.remove();
|
||||
};
|
||||
} else {
|
||||
return function(el) {
|
||||
var _ref;
|
||||
return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0;
|
||||
};
|
||||
}
|
||||
})();
|
||||
$.rm = function(el) {
|
||||
return el.remove();
|
||||
};
|
||||
|
||||
$.rmAll = function(root) {
|
||||
return root.textContent = '';
|
||||
return root.textContent = null;
|
||||
};
|
||||
|
||||
$.tn = function(s) {
|
||||
@ -10615,23 +10606,15 @@
|
||||
},
|
||||
createSauceLink: function(link) {
|
||||
var m, text;
|
||||
link = link.replace(/(%(T?URL|MD5|board)|\$[1-4])/ig, function(parameter) {
|
||||
switch (parameter) {
|
||||
case '%TURL':
|
||||
case '$1':
|
||||
return "' + encodeURIComponent(post.file.thumbURL) + '";
|
||||
case '%URL':
|
||||
case '$2':
|
||||
return "' + encodeURIComponent(post.file.URL) + '";
|
||||
case '%MD5':
|
||||
case '$3':
|
||||
return "' + encodeURIComponent(post.file.MD5) + '";
|
||||
case '%board':
|
||||
case '$4':
|
||||
return "' + encodeURIComponent(post.board) + '";
|
||||
default:
|
||||
return parameter;
|
||||
}
|
||||
link = link.replace(/%(T?URL|MD5|board|name)/g, function(parameter) {
|
||||
var type;
|
||||
return ((type = {
|
||||
'%TURL': 'post.file.thumbURL',
|
||||
'%URL': 'post.file.URL',
|
||||
'%MD5': 'post.file.MD5',
|
||||
'%board': 'post.board',
|
||||
'%name': 'post.file.name'
|
||||
}[parameter]) ? "' + encodeURIComponent(" + type + ") + '" : parameter);
|
||||
});
|
||||
text = (m = link.match(/;text:(.+)$/)) ? m[1] : link.match(/(\w+)\.\w+\//)[1];
|
||||
link = link.replace(/;text:.+$/, '');
|
||||
@ -16351,7 +16334,7 @@
|
||||
},
|
||||
sauce: function(section) {
|
||||
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);
|
||||
$.get('sauces', Conf['sauces'], function(item) {
|
||||
return ta.value = item['sauces'].replace(/\$\d/g, function(c) {
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
"grunt-contrib-concat": "~0.3.0",
|
||||
"grunt-contrib-copy": "~0.5.0",
|
||||
"grunt-contrib-watch": "~0.5.3",
|
||||
"grunt-shell": "~0.6.3",
|
||||
"grunt-shell": "~0.6.4",
|
||||
"load-grunt-tasks": "~0.2.1"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
<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>
|
||||
<textarea name=sauces class=field spellcheck=false></textarea>
|
||||
|
||||
@ -127,14 +127,12 @@ $.toggleClass = (el, className) ->
|
||||
$.hasClass = (el, className) ->
|
||||
className in el.classList
|
||||
|
||||
$.rm = do ->
|
||||
if 'remove' of Element::
|
||||
(el) -> el.remove()
|
||||
else
|
||||
(el) -> el.parentNode?.removeChild el
|
||||
$.rm = (el) ->
|
||||
el.remove()
|
||||
|
||||
# jsperf.com/emptify-element/9
|
||||
$.rmAll = (root) -> root.textContent = ''
|
||||
$.rmAll = (root) ->
|
||||
# https://gist.github.com/MayhemYDG/8646194
|
||||
root.textContent = null
|
||||
|
||||
$.tn = (s) ->
|
||||
d.createTextNode s
|
||||
|
||||
@ -15,19 +15,17 @@ Sauce =
|
||||
name: 'Sauce'
|
||||
cb: @node
|
||||
createSauceLink: (link) ->
|
||||
# XXX Remove $1-4 after 31-7-2013 (v1 transitioning)
|
||||
link = link.replace /(%(T?URL|MD5|board)|\$[1-4])/ig, (parameter) ->
|
||||
switch parameter
|
||||
when '%TURL', '$1'
|
||||
"' + encodeURIComponent(post.file.thumbURL) + '"
|
||||
when '%URL', '$2'
|
||||
"' + encodeURIComponent(post.file.URL) + '"
|
||||
when '%MD5', '$3'
|
||||
"' + encodeURIComponent(post.file.MD5) + '"
|
||||
when '%board', '$4'
|
||||
"' + encodeURIComponent(post.board) + '"
|
||||
else
|
||||
parameter
|
||||
link = link.replace /%(T?URL|MD5|board|name)/g, (parameter) ->
|
||||
return (if type = {
|
||||
'%TURL': 'post.file.thumbURL'
|
||||
'%URL': 'post.file.URL'
|
||||
'%MD5': 'post.file.MD5'
|
||||
'%board': 'post.board'
|
||||
'%name': 'post.file.name'
|
||||
}[parameter]
|
||||
"' + encodeURIComponent(#{type}) + '"
|
||||
else
|
||||
parameter)
|
||||
text = if m = link.match(/;text:(.+)$/) then m[1] else link.match(/(\w+)\.\w+\//)[1]
|
||||
link = link.replace /;text:.+$/, ''
|
||||
Function 'post', 'a', """
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user