Simpler filename truncated/full.
This commit is contained in:
parent
27a40c46cf
commit
6cc786cba6
@ -2327,7 +2327,8 @@
|
|||||||
size: 996,
|
size: 996,
|
||||||
unit: 'KB',
|
unit: 'KB',
|
||||||
resolution: '1366x768',
|
resolution: '1366x768',
|
||||||
filename: 'Untitled.png',
|
fullname: '[a.f.k.] Sayonara Zetsubou Sensei - 09.avi_snapshot_03.34_[2011.02.20_06.58.00].jpg',
|
||||||
|
shortname: '[a.f.k.] Sayonara Zetsubou Sen(...).jpg',
|
||||||
type: type
|
type: type
|
||||||
};
|
};
|
||||||
FileInfo.setFormats();
|
FileInfo.setFormats();
|
||||||
@ -2937,17 +2938,18 @@
|
|||||||
return g.callbacks.push(this.node);
|
return g.callbacks.push(this.node);
|
||||||
},
|
},
|
||||||
node: function(root) {
|
node: function(root) {
|
||||||
var filename, link, node, regexp, resolution, size, type, unit, _, _ref;
|
var fullname, link, node, regexp, resolution, shortname, size, type, unit, _, _ref;
|
||||||
if (root.className === 'inline' || !(node = $('.filesize', root))) return;
|
if (root.className === 'inline' || !(node = $('.filesize', root))) return;
|
||||||
type = node.childElementCount === 2 ? 0 : 1;
|
type = node.childElementCount === 2 ? 0 : 1;
|
||||||
regexp = [/File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF),\s<span\stitle=\"([^\"]+)\">/, /File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF)\)/][type];
|
regexp = [/File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF),\s<span\stitle=\"([^\"]+)\">([^<]+)/, /File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF)\)/][type];
|
||||||
_ref = node.innerHTML.match(regexp), _ = _ref[0], link = _ref[1], size = _ref[2], unit = _ref[3], resolution = _ref[4], filename = _ref[5];
|
_ref = node.innerHTML.match(regexp), _ = _ref[0], link = _ref[1], size = _ref[2], unit = _ref[3], resolution = _ref[4], fullname = _ref[5], shortname = _ref[6];
|
||||||
FileInfo.data = {
|
FileInfo.data = {
|
||||||
link: link,
|
link: link,
|
||||||
size: size,
|
size: size,
|
||||||
unit: unit,
|
unit: unit,
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
filename: filename,
|
fullname: fullname,
|
||||||
|
shortname: shortname,
|
||||||
type: type
|
type: type
|
||||||
};
|
};
|
||||||
return node.innerHTML = FileInfo.funks[type](FileInfo);
|
return node.innerHTML = FileInfo.funks[type](FileInfo);
|
||||||
@ -2993,6 +2995,29 @@
|
|||||||
return "" + size + " " + unitT;
|
return "" + size + " " + unitT;
|
||||||
},
|
},
|
||||||
formatters: {
|
formatters: {
|
||||||
|
l: function() {
|
||||||
|
if (FileInfo.data.type === 0) {
|
||||||
|
return FileInfo.data.link.replace(/>\d+\.\w+</, ">" + (this.n()) + "<");
|
||||||
|
} else {
|
||||||
|
return FileInfo.data.link;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
L: function() {
|
||||||
|
return FileInfo.data.link.replace(/>\d+\.\w+</, ">" + FileInfo.data.fullname + "<");
|
||||||
|
},
|
||||||
|
n: function() {
|
||||||
|
if (FileInfo.data.fullname === FileInfo.data.shortname) {
|
||||||
|
return FileInfo.data.fullname;
|
||||||
|
} else {
|
||||||
|
return "<span class=filename><span class=fnfull>" + FileInfo.data.fullname + "</span><span class=fntrunc>" + FileInfo.data.shortname + "</span></span>";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
N: function() {
|
||||||
|
return FileInfo.data.fullname;
|
||||||
|
},
|
||||||
|
s: function() {
|
||||||
|
return "" + FileInfo.data.size + " " + FileInfo.data.unit;
|
||||||
|
},
|
||||||
B: function() {
|
B: function() {
|
||||||
return FileInfo.convertUnit('B');
|
return FileInfo.convertUnit('B');
|
||||||
},
|
},
|
||||||
@ -3002,30 +3027,6 @@
|
|||||||
M: function() {
|
M: function() {
|
||||||
return FileInfo.convertUnit('MB');
|
return FileInfo.convertUnit('MB');
|
||||||
},
|
},
|
||||||
s: function() {
|
|
||||||
return "" + FileInfo.data.size + " " + FileInfo.data.unit;
|
|
||||||
},
|
|
||||||
l: function() {
|
|
||||||
if (FileInfo.data.type === 0) {
|
|
||||||
return FileInfo.data.link.replace(/>\d+\.\w+</, '>' + this.n() + '<');
|
|
||||||
} else {
|
|
||||||
return FileInfo.data.link;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
L: function() {
|
|
||||||
return FileInfo.data.link.replace(/>\d+\.\w+</, '>' + FileInfo.data.filename + '<');
|
|
||||||
},
|
|
||||||
n: function() {
|
|
||||||
var ext;
|
|
||||||
if ((ext = FileInfo.data.filename.lastIndexOf('.')) > 38) {
|
|
||||||
return "<span class=fnfull>" + FileInfo.data.filename + "</span><span class=fntrunc>" + (FileInfo.data.filename.substr(0, 32)) + "(...)" + (FileInfo.data.filename.substr(ext)) + "</span>";
|
|
||||||
} else {
|
|
||||||
return FileInfo.data.filename;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
N: function() {
|
|
||||||
return FileInfo.data.filename;
|
|
||||||
},
|
|
||||||
r: function() {
|
r: function() {
|
||||||
return FileInfo.data.resolution;
|
return FileInfo.data.resolution;
|
||||||
}
|
}
|
||||||
@ -4135,7 +4136,8 @@ td.replyhider {\
|
|||||||
float: left;\
|
float: left;\
|
||||||
pointer-events: none;\
|
pointer-events: none;\
|
||||||
}\
|
}\
|
||||||
.filesize a:not(:hover) .fnfull, .filesize a:hover .fntrunc {\
|
.filename:hover > .fntrunc,\
|
||||||
|
.filename:not(:hover) > .fnfull {\
|
||||||
display: none;\
|
display: none;\
|
||||||
}\
|
}\
|
||||||
img[md5], img[md5] + img {\
|
img[md5], img[md5] + img {\
|
||||||
|
|||||||
@ -1910,7 +1910,8 @@ options =
|
|||||||
size: 996
|
size: 996
|
||||||
unit: 'KB'
|
unit: 'KB'
|
||||||
resolution: '1366x768'
|
resolution: '1366x768'
|
||||||
filename: 'Untitled.png'
|
fullname: '[a.f.k.] Sayonara Zetsubou Sensei - 09.avi_snapshot_03.34_[2011.02.20_06.58.00].jpg'
|
||||||
|
shortname: '[a.f.k.] Sayonara Zetsubou Sen(...).jpg'
|
||||||
type: type
|
type: type
|
||||||
FileInfo.setFormats()
|
FileInfo.setFormats()
|
||||||
$.id("#{@name}Preview").innerHTML = FileInfo.funks[type] FileInfo
|
$.id("#{@name}Preview").innerHTML = FileInfo.funks[type] FileInfo
|
||||||
@ -2405,17 +2406,18 @@ FileInfo =
|
|||||||
return if root.className is 'inline' or not node = $ '.filesize', root
|
return if root.className is 'inline' or not node = $ '.filesize', root
|
||||||
type = if node.childElementCount is 2 then 0 else 1
|
type = if node.childElementCount is 2 then 0 else 1
|
||||||
regexp = [
|
regexp = [
|
||||||
/File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF),\s<span\stitle=\"([^\"]+)\">/
|
/File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF),\s<span\stitle=\"([^\"]+)\">([^<]+)/
|
||||||
/File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF)\)/
|
/File:\s(<a.+<\/a>)-\((?:Spoiler Image,\s)?([\d\.]+)\s([BKM]{1,2}),\s(\d+x\d+|PDF)\)/
|
||||||
][type]
|
][type]
|
||||||
[_, link, size, unit, resolution, filename] =
|
[_, link, size, unit, resolution, fullname, shortname] =
|
||||||
node.innerHTML.match regexp
|
node.innerHTML.match regexp
|
||||||
FileInfo.data =
|
FileInfo.data =
|
||||||
link: link
|
link: link
|
||||||
size: size
|
size: size
|
||||||
unit: unit
|
unit: unit
|
||||||
resolution: resolution
|
resolution: resolution
|
||||||
filename: filename
|
fullname: fullname
|
||||||
|
shortname: shortname
|
||||||
type: type
|
type: type
|
||||||
node.innerHTML = FileInfo.funks[type] FileInfo
|
node.innerHTML = FileInfo.funks[type] FileInfo
|
||||||
setFormats: ->
|
setFormats: ->
|
||||||
@ -2445,22 +2447,22 @@ FileInfo =
|
|||||||
size = size.toFixed 2
|
size = size.toFixed 2
|
||||||
"#{size} #{unitT}"
|
"#{size} #{unitT}"
|
||||||
formatters:
|
formatters:
|
||||||
|
l: ->
|
||||||
|
if FileInfo.data.type is 0
|
||||||
|
FileInfo.data.link.replace />\d+\.\w+</, ">#{@n()}<"
|
||||||
|
else
|
||||||
|
FileInfo.data.link
|
||||||
|
L: -> FileInfo.data.link.replace />\d+\.\w+</, ">#{FileInfo.data.fullname}<"
|
||||||
|
n: ->
|
||||||
|
if FileInfo.data.fullname is FileInfo.data.shortname
|
||||||
|
FileInfo.data.fullname
|
||||||
|
else
|
||||||
|
"<span class=filename><span class=fnfull>#{FileInfo.data.fullname}</span><span class=fntrunc>#{FileInfo.data.shortname}</span></span>"
|
||||||
|
N: -> FileInfo.data.fullname
|
||||||
|
s: -> "#{FileInfo.data.size} #{FileInfo.data.unit}"
|
||||||
B: -> FileInfo.convertUnit 'B'
|
B: -> FileInfo.convertUnit 'B'
|
||||||
K: -> FileInfo.convertUnit 'KB'
|
K: -> FileInfo.convertUnit 'KB'
|
||||||
M: -> FileInfo.convertUnit 'MB'
|
M: -> FileInfo.convertUnit 'MB'
|
||||||
s: -> "#{FileInfo.data.size} #{FileInfo.data.unit}"
|
|
||||||
l: ->
|
|
||||||
if FileInfo.data.type is 0
|
|
||||||
FileInfo.data.link.replace />\d+\.\w+</, '>' + @n() + '<'
|
|
||||||
else
|
|
||||||
FileInfo.data.link
|
|
||||||
L: -> FileInfo.data.link.replace />\d+\.\w+</, '>' + FileInfo.data.filename + '<'
|
|
||||||
n: ->
|
|
||||||
if (ext = FileInfo.data.filename.lastIndexOf '.') > 38
|
|
||||||
"<span class=fnfull>#{FileInfo.data.filename}</span><span class=fntrunc>#{FileInfo.data.filename.substr 0, 32}(...)#{FileInfo.data.filename.substr ext}</span>"
|
|
||||||
else
|
|
||||||
FileInfo.data.filename
|
|
||||||
N: -> FileInfo.data.filename
|
|
||||||
r: -> FileInfo.data.resolution
|
r: -> FileInfo.data.resolution
|
||||||
|
|
||||||
getTitle = (thread) ->
|
getTitle = (thread) ->
|
||||||
@ -3428,7 +3430,8 @@ td.replyhider {
|
|||||||
float: left;
|
float: left;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.filesize a:not(:hover) .fnfull, .filesize a:hover .fntrunc {
|
.filename:hover > .fntrunc,
|
||||||
|
.filename:not(:hover) > .fnfull {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
img[md5], img[md5] + img {
|
img[md5], img[md5] + img {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user