Merge branch 'v3' into index
This commit is contained in:
commit
a12bdb1451
@ -1,3 +1,4 @@
|
||||
- Added `Original filename` variable to Sauce panel.
|
||||
- Added a `Reset Settings` button in the settings.
|
||||
|
||||
### 3.15.2 - *2014-01-22*
|
||||
|
||||
@ -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>
|
||||
|
||||
10
lib/$.coffee
10
lib/$.coffee
@ -99,16 +99,12 @@ $.rmClass = (el, className...) ->
|
||||
el.classList.remove className...
|
||||
$.hasClass = (el, className) ->
|
||||
el.classList.contains className
|
||||
$.rm = do ->
|
||||
if 'remove' of Element.prototype
|
||||
(el) -> el.remove()
|
||||
else
|
||||
(el) -> el.parentNode?.removeChild el
|
||||
$.rm = (el) ->
|
||||
el.remove()
|
||||
$.rmAll = (root) ->
|
||||
# jsperf.com/emptify-element
|
||||
for node in [root.childNodes...]
|
||||
# HTMLSelectElement.remove !== Element.remove
|
||||
root.removeChild node
|
||||
node.remove()
|
||||
return
|
||||
$.tn = (s) ->
|
||||
d.createTextNode s
|
||||
|
||||
@ -15,7 +15,7 @@ Sauce =
|
||||
name: 'Sauce'
|
||||
cb: @node
|
||||
createSauceLink: (link) ->
|
||||
link = link.replace /%(T?URL|MD5|board)/g, (parameter) ->
|
||||
link = link.replace /%(T?URL|MD5|board|name)/g, (parameter) ->
|
||||
switch parameter
|
||||
when '%TURL'
|
||||
"' + encodeURIComponent(post.file.thumbURL) + '"
|
||||
@ -25,6 +25,8 @@ Sauce =
|
||||
"' + encodeURIComponent(post.file.MD5) + '"
|
||||
when '%board'
|
||||
"' + encodeURIComponent(post.board) + '"
|
||||
when '%name'
|
||||
"' + encodeURIComponent(post.file.name) + '"
|
||||
else
|
||||
parameter
|
||||
text = if m = link.match(/;text:(.+)$/) then m[1] else link.match(/(\w+)\.\w+\//)[1]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user