Increase Sauce linking possibilites.
This commit is contained in:
parent
b936b6bfcb
commit
bd542eb4b5
@ -141,7 +141,7 @@
|
|||||||
filesize: '',
|
filesize: '',
|
||||||
md5: ''
|
md5: ''
|
||||||
},
|
},
|
||||||
flavors: ['http://iqdb.org/?url=', 'http://google.com/searchbyimage?image_url=', '#http://tineye.com/search?url=', '#http://saucenao.com/search.php?db=999&url=', '#http://3d.iqdb.org/?url=', '#http://regex.info/exif.cgi?imgurl=', '#http://imgur.com/upload?url=', '#http://ompldr.org/upload?url1='].join('\n'),
|
sauces: ['http://iqdb.org/?url=$1', 'http://google.com/searchbyimage?image_url=$1', '#http://tineye.com/search?url=$1', '#http://saucenao.com/search.php?db=999&url=$1', '#http://3d.iqdb.org/?url=$1', '#http://regex.info/exif.cgi?imgurl=$2', '#http://imgur.com/upload?url=$2', '#http://ompldr.org/upload?url1=$2'].join('\n'),
|
||||||
time: '%m/%d/%y(%a)%H:%M',
|
time: '%m/%d/%y(%a)%H:%M',
|
||||||
backlink: '>>%id',
|
backlink: '>>%id',
|
||||||
favicon: 'ferongr',
|
favicon: 'ferongr',
|
||||||
@ -305,7 +305,6 @@
|
|||||||
val = properties[key];
|
val = properties[key];
|
||||||
object[key] = val;
|
object[key] = val;
|
||||||
}
|
}
|
||||||
return object;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$.extend($, {
|
$.extend($, {
|
||||||
@ -408,14 +407,12 @@
|
|||||||
return el.parentNode.removeChild(el);
|
return el.parentNode.removeChild(el);
|
||||||
},
|
},
|
||||||
add: function() {
|
add: function() {
|
||||||
var child, children, parent, _i, _len, _results;
|
var child, children, parent, _i, _len;
|
||||||
parent = arguments[0], children = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
parent = arguments[0], children = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
||||||
_results = [];
|
|
||||||
for (_i = 0, _len = children.length; _i < _len; _i++) {
|
for (_i = 0, _len = children.length; _i < _len; _i++) {
|
||||||
child = children[_i];
|
child = children[_i];
|
||||||
_results.push(parent.appendChild(child));
|
parent.appendChild(child);
|
||||||
}
|
}
|
||||||
return _results;
|
|
||||||
},
|
},
|
||||||
prepend: function(parent, child) {
|
prepend: function(parent, child) {
|
||||||
return parent.insertBefore(child, parent.firstChild);
|
return parent.insertBefore(child, parent.firstChild);
|
||||||
@ -1979,7 +1976,7 @@
|
|||||||
<div>\
|
<div>\
|
||||||
<label for=main_tab>Main</label>\
|
<label for=main_tab>Main</label>\
|
||||||
| <label for=filter_tab>Filter</label>\
|
| <label for=filter_tab>Filter</label>\
|
||||||
| <label for=flavors_tab>Sauce</label>\
|
| <label for=sauces_tab>Sauce</label>\
|
||||||
| <label for=rice_tab>Rice</label>\
|
| <label for=rice_tab>Rice</label>\
|
||||||
| <label for=keybinds_tab>Keybinds</label>\
|
| <label for=keybinds_tab>Keybinds</label>\
|
||||||
</div>\
|
</div>\
|
||||||
@ -1988,10 +1985,15 @@
|
|||||||
<div id=content>\
|
<div id=content>\
|
||||||
<input type=radio name=tab hidden id=main_tab checked>\
|
<input type=radio name=tab hidden id=main_tab checked>\
|
||||||
<div></div>\
|
<div></div>\
|
||||||
<input type=radio name=tab hidden id=flavors_tab>\
|
<input type=radio name=tab hidden id=sauces_tab>\
|
||||||
<div>\
|
<div>\
|
||||||
<div class=warning><code>Sauce</code> is disabled.</div>\
|
<div class=warning><code>Sauce</code> is disabled.</div>\
|
||||||
<textarea name=flavors id=flavors></textarea>\
|
<div>Lines starting with a <code>#</code> will be ignored.</div>\
|
||||||
|
<ul>These variables will be replaced by the corresponding url:\
|
||||||
|
<li>$1: Thumbnail.</li>\
|
||||||
|
<li>$2: Full image.</li>\
|
||||||
|
</ul>\
|
||||||
|
<textarea name=sauces id=sauces></textarea>\
|
||||||
</div>\
|
</div>\
|
||||||
<input type=radio name=tab hidden id=filter_tab>\
|
<input type=radio name=tab hidden id=filter_tab>\
|
||||||
<div>\
|
<div>\
|
||||||
@ -2571,26 +2573,38 @@
|
|||||||
|
|
||||||
sauce = {
|
sauce = {
|
||||||
init: function() {
|
init: function() {
|
||||||
if (!(sauce.prefixes = conf['flavors'].match(/^[^#].+$/gm))) return;
|
var link, links, _i, _len;
|
||||||
sauce.names = sauce.prefixes.map(function(prefix) {
|
links = conf['sauces'].match(/^[^#].+$/gm);
|
||||||
return prefix.match(/(\w+)\./)[1];
|
this.links = [];
|
||||||
});
|
for (_i = 0, _len = links.length; _i < _len; _i++) {
|
||||||
return g.callbacks.push(function(root) {
|
link = links[_i];
|
||||||
var i, link, prefix, span, suffix, _len, _ref, _results;
|
this.links.push([link, link.match(/(\w+)\./)[1]]);
|
||||||
if (root.className === 'inline' || !(span = $('.filesize', root))) return;
|
}
|
||||||
suffix = $('a', span).href;
|
return g.callbacks.push(this.node);
|
||||||
_ref = sauce.prefixes;
|
},
|
||||||
_results = [];
|
node: function(root) {
|
||||||
for (i = 0, _len = _ref.length; i < _len; i++) {
|
var a, img, link, span, _i, _len, _ref;
|
||||||
prefix = _ref[i];
|
if (root.className === 'inline' || !(span = $('.filesize', root))) return;
|
||||||
link = $.el('a', {
|
img = $('img', root);
|
||||||
textContent: sauce.names[i],
|
_ref = sauce.links;
|
||||||
href: prefix + suffix,
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
target: '_blank'
|
link = _ref[_i];
|
||||||
});
|
a = $.el('a', {
|
||||||
_results.push($.add(span, $.tn(' '), link));
|
textContent: link[1],
|
||||||
|
href: sauce.href(link[0], img),
|
||||||
|
target: '_blank'
|
||||||
|
});
|
||||||
|
$.add(span, $.tn(' '), a);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
href: function(link, img) {
|
||||||
|
return link.replace(/\$\d/, function(fragment) {
|
||||||
|
switch (fragment) {
|
||||||
|
case '$1':
|
||||||
|
return img.src;
|
||||||
|
case '$2':
|
||||||
|
return img.parentNode.href;
|
||||||
}
|
}
|
||||||
return _results;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -3819,8 +3833,8 @@ img[md5], img[md5] + img {\
|
|||||||
resize: vertical;\
|
resize: vertical;\
|
||||||
width: 100%;\
|
width: 100%;\
|
||||||
}\
|
}\
|
||||||
#flavors {\
|
#sauces {\
|
||||||
height: 100%;\
|
height: 350px;\
|
||||||
}\
|
}\
|
||||||
\
|
\
|
||||||
#updater {\
|
#updater {\
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
master
|
master
|
||||||
|
- Mayhem
|
||||||
|
Increase Sauce linking possibilites:
|
||||||
|
Thumbnails, full images.
|
||||||
|
|
||||||
2.25.5
|
2.25.5
|
||||||
- Mayhem
|
- Mayhem
|
||||||
|
|||||||
@ -57,15 +57,15 @@ config =
|
|||||||
filename: ''
|
filename: ''
|
||||||
filesize: ''
|
filesize: ''
|
||||||
md5: ''
|
md5: ''
|
||||||
flavors: [
|
sauces: [
|
||||||
'http://iqdb.org/?url='
|
'http://iqdb.org/?url=$1'
|
||||||
'http://google.com/searchbyimage?image_url='
|
'http://google.com/searchbyimage?image_url=$1'
|
||||||
'#http://tineye.com/search?url='
|
'#http://tineye.com/search?url=$1'
|
||||||
'#http://saucenao.com/search.php?db=999&url='
|
'#http://saucenao.com/search.php?db=999&url=$1'
|
||||||
'#http://3d.iqdb.org/?url='
|
'#http://3d.iqdb.org/?url=$1'
|
||||||
'#http://regex.info/exif.cgi?imgurl='
|
'#http://regex.info/exif.cgi?imgurl=$2'
|
||||||
'#http://imgur.com/upload?url='
|
'#http://imgur.com/upload?url=$2'
|
||||||
'#http://ompldr.org/upload?url1='
|
'#http://ompldr.org/upload?url1=$2'
|
||||||
].join '\n'
|
].join '\n'
|
||||||
time: '%m/%d/%y(%a)%H:%M'
|
time: '%m/%d/%y(%a)%H:%M'
|
||||||
backlink: '>>%id'
|
backlink: '>>%id'
|
||||||
@ -217,7 +217,7 @@ $ = (selector, root=d.body) ->
|
|||||||
$.extend = (object, properties) ->
|
$.extend = (object, properties) ->
|
||||||
for key, val of properties
|
for key, val of properties
|
||||||
object[key] = val
|
object[key] = val
|
||||||
object
|
return
|
||||||
|
|
||||||
$.extend $,
|
$.extend $,
|
||||||
ready: (fc) ->
|
ready: (fc) ->
|
||||||
@ -282,6 +282,7 @@ $.extend $,
|
|||||||
add: (parent, children...) ->
|
add: (parent, children...) ->
|
||||||
for child in children
|
for child in children
|
||||||
parent.appendChild child
|
parent.appendChild child
|
||||||
|
return
|
||||||
prepend: (parent, child) ->
|
prepend: (parent, child) ->
|
||||||
parent.insertBefore child, parent.firstChild
|
parent.insertBefore child, parent.firstChild
|
||||||
after: (root, el) ->
|
after: (root, el) ->
|
||||||
@ -1516,7 +1517,7 @@ options =
|
|||||||
<div>
|
<div>
|
||||||
<label for=main_tab>Main</label>
|
<label for=main_tab>Main</label>
|
||||||
| <label for=filter_tab>Filter</label>
|
| <label for=filter_tab>Filter</label>
|
||||||
| <label for=flavors_tab>Sauce</label>
|
| <label for=sauces_tab>Sauce</label>
|
||||||
| <label for=rice_tab>Rice</label>
|
| <label for=rice_tab>Rice</label>
|
||||||
| <label for=keybinds_tab>Keybinds</label>
|
| <label for=keybinds_tab>Keybinds</label>
|
||||||
</div>
|
</div>
|
||||||
@ -1525,10 +1526,15 @@ options =
|
|||||||
<div id=content>
|
<div id=content>
|
||||||
<input type=radio name=tab hidden id=main_tab checked>
|
<input type=radio name=tab hidden id=main_tab checked>
|
||||||
<div></div>
|
<div></div>
|
||||||
<input type=radio name=tab hidden id=flavors_tab>
|
<input type=radio name=tab hidden id=sauces_tab>
|
||||||
<div>
|
<div>
|
||||||
<div class=warning><code>Sauce</code> is disabled.</div>
|
<div class=warning><code>Sauce</code> is disabled.</div>
|
||||||
<textarea name=flavors id=flavors></textarea>
|
<div>Lines starting with a <code>#</code> will be ignored.</div>
|
||||||
|
<ul>These variables will be replaced by the corresponding url:
|
||||||
|
<li>$1: Thumbnail.</li>
|
||||||
|
<li>$2: Full image.</li>
|
||||||
|
</ul>
|
||||||
|
<textarea name=sauces id=sauces></textarea>
|
||||||
</div>
|
</div>
|
||||||
<input type=radio name=tab hidden id=filter_tab>
|
<input type=radio name=tab hidden id=filter_tab>
|
||||||
<div>
|
<div>
|
||||||
@ -2025,17 +2031,29 @@ anonymize =
|
|||||||
|
|
||||||
sauce =
|
sauce =
|
||||||
init: ->
|
init: ->
|
||||||
return unless sauce.prefixes = conf['flavors'].match /^[^#].+$/gm
|
# return unless
|
||||||
sauce.names = sauce.prefixes.map (prefix) -> prefix.match(/(\w+)\./)[1]
|
links = conf['sauces'].match /^[^#].+$/gm
|
||||||
g.callbacks.push (root) ->
|
@links = []
|
||||||
return if root.className is 'inline' or not span = $ '.filesize', root
|
for link in links
|
||||||
suffix = $('a', span).href
|
@links.push [link, link.match(/(\w+)\./)[1]]
|
||||||
for prefix, i in sauce.prefixes
|
g.callbacks.push @node
|
||||||
link = $.el 'a',
|
node: (root) ->
|
||||||
textContent: sauce.names[i]
|
return if root.className is 'inline' or not span = $ '.filesize', root
|
||||||
href: prefix + suffix
|
img = $ 'img', root
|
||||||
target: '_blank'
|
for link in sauce.links
|
||||||
$.add span, $.tn(' '), link
|
a = $.el 'a',
|
||||||
|
textContent: link[1]
|
||||||
|
href: sauce.href link[0], img
|
||||||
|
target: '_blank'
|
||||||
|
$.add span, $.tn(' '), a
|
||||||
|
return
|
||||||
|
href: (link, img) ->
|
||||||
|
link.replace /\$\d/, (fragment) ->
|
||||||
|
switch fragment
|
||||||
|
when '$1'
|
||||||
|
img.src
|
||||||
|
when '$2'
|
||||||
|
img.parentNode.href
|
||||||
|
|
||||||
revealSpoilers =
|
revealSpoilers =
|
||||||
init: ->
|
init: ->
|
||||||
@ -3060,8 +3078,8 @@ img[md5], img[md5] + img {
|
|||||||
resize: vertical;
|
resize: vertical;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
#flavors {
|
#sauces {
|
||||||
height: 100%;
|
height: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#updater {
|
#updater {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user