Added %FNAME case to link.replace switch

This commit is contained in:
ParrotParrot 2014-01-25 20:10:40 +01:00
parent d5f5349c63
commit 7a2faf861e

View File

@ -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|FNAME)/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 '%FNAME'
"' + encodeURIComponent(post.file.name) + '"
else
parameter
text = if m = link.match(/;text:(.+)$/) then m[1] else link.match(/(\w+)\.\w+\//)[1]