Merge branch 'master' into v3

This commit is contained in:
Nicolas Stepien 2012-08-24 21:53:23 +02:00
commit 7460bc1c0f
4 changed files with 38 additions and 1 deletions

View File

@ -487,6 +487,15 @@
$.add(d.head, script);
return $.rm(script);
},
shortenFilename: function(filename, isOP) {
var threshold;
threshold = 30 + 10 * isOP;
if (filename.replace(/\.\w+$/, '').length > threshold) {
return "" + filename.slice(0, threshold - 5) + "(...)" + (filename.match(/\.\w+$/));
} else {
return filename;
}
},
bytesToString: function(size) {
var unit;
unit = 0;

View File

@ -2,6 +2,25 @@ alpha
- Mayhem
Fix Chrome's install warning that 4chan X would execute on all domains.
2.34.7
- Mayhem
Fix one-word-captcha, you'll need to leave a space for the fake word now.
2.34.6
- Mayhem
Fix error caused by change in 4chan's HTML about hidden filename in case of spoiler.
2.34.5
- Mayhem
Fix cooldown on /q/.
Fix thread creation with no file on /q/.
Fix 'Administrator/Moderator/Developer Replies' creating extra backlinks on /q/.
Add /mlp/ archive redirection.
2.34.4
- Mayhem
Add /q/ archive redirection.
2.34.3
- Mayhem
Update /k/ archive redirection.

View File

@ -1 +1 @@
postMessage({version:'2.34.3'},'*')
postMessage({version:'2.34.7'},'*')

View File

@ -372,6 +372,15 @@ $.extend $,
script = $.el 'script', textContent: code
$.add d.head, script
$.rm script
shortenFilename: (filename, isOP) ->
# FILENAME SHORTENING SCIENCE:
# OPs have a +10 characters threshold.
# The file extension is not taken into account.
threshold = 30 + 10 * isOP
if filename.replace(/\.\w+$/, '').length > threshold
"#{filename[...threshold - 5]}(...)#{filename.match(/\.\w+$/)}"
else
filename
bytesToString: (size) ->
unit = 0 # Bytes
while size >= 1024