Drop 'ff' prefixes in FileInfo values. It's already prefixed you aho.
This commit is contained in:
parent
9d0594312e
commit
23766e8ef9
@ -2320,7 +2320,7 @@
|
||||
return $.id('backlinkPreview').textContent = conf['backlink'].replace(/%id/, '123456789');
|
||||
},
|
||||
fileInfo: function() {
|
||||
FileInfo.ffType = this.name === 'fileInfoR' ? 0 : 1;
|
||||
FileInfo.type = this.name === 'fileInfoR' ? 0 : 1;
|
||||
FileInfo.data = {
|
||||
link: '<a href="javascript:;">1329791824.png</a>',
|
||||
size: 996,
|
||||
@ -2329,7 +2329,7 @@
|
||||
filename: 'Untitled.png'
|
||||
};
|
||||
FileInfo.funks = FileInfo.setFormats();
|
||||
return $.id("" + this.name + "Preview").innerHTML = FileInfo.funks[FileInfo.ffType](FileInfo);
|
||||
return $.id("" + this.name + "Preview").innerHTML = FileInfo.funks[FileInfo.type](FileInfo);
|
||||
},
|
||||
favicon: function() {
|
||||
Favicon["switch"]();
|
||||
@ -2937,8 +2937,8 @@
|
||||
node: function(root) {
|
||||
var filename, link, node, resolution, size, unit, _, _ref;
|
||||
if (root.className === 'inline' || !(node = $('.filesize', root))) return;
|
||||
FileInfo.ffType = node.childElementCount === 2 ? 0 : 1;
|
||||
_ref = node.innerHTML.match(FileInfo.ffRgex[FileInfo.ffType]), _ = _ref[0], link = _ref[1], size = _ref[2], unit = _ref[3], resolution = _ref[4], filename = _ref[5];
|
||||
FileInfo.type = node.childElementCount === 2 ? 0 : 1;
|
||||
_ref = node.innerHTML.match(FileInfo.regexp[FileInfo.type]), _ = _ref[0], link = _ref[1], size = _ref[2], unit = _ref[3], resolution = _ref[4], filename = _ref[5];
|
||||
FileInfo.data = {
|
||||
link: link,
|
||||
size: size,
|
||||
@ -2946,13 +2946,13 @@
|
||||
resolution: resolution,
|
||||
filename: filename
|
||||
};
|
||||
return node.innerHTML = FileInfo.funks[FileInfo.ffType](FileInfo);
|
||||
return node.innerHTML = FileInfo.funks[FileInfo.type](FileInfo);
|
||||
},
|
||||
setFormats: function() {
|
||||
var code, i, _results;
|
||||
_results = [];
|
||||
for (i = 0; i <= 1; i++) {
|
||||
code = conf[FileInfo.ffConf[i]].replace(FileInfo.ffMtrs[i], function(s, c) {
|
||||
code = conf[FileInfo.conf[i]].replace(FileInfo.param[i], function(s, c) {
|
||||
if (c in FileInfo.formatters) {
|
||||
return "' + FileInfo.formatters." + c + "() + '";
|
||||
} else {
|
||||
@ -2986,9 +2986,9 @@
|
||||
}
|
||||
return "" + size + " " + unitT;
|
||||
},
|
||||
ffConf: ['fileInfoR', 'fileInfoT'],
|
||||
ffMtrs: [/%([BKlLMnNrs])/g, /%([BKlMrs])/g],
|
||||
ffRgex: [/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)\)/],
|
||||
conf: ['fileInfoR', 'fileInfoT'],
|
||||
param: [/%([BKlLMnNrs])/g, /%([BKlMrs])/g],
|
||||
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)\)/],
|
||||
formatters: {
|
||||
B: function() {
|
||||
return FileInfo.convertUnit('B');
|
||||
@ -2997,7 +2997,7 @@
|
||||
return FileInfo.convertUnit('KB');
|
||||
},
|
||||
l: function() {
|
||||
if (FileInfo.ffType === 0) {
|
||||
if (FileInfo.type === 0) {
|
||||
return FileInfo.data.link.replace(/>\d+\.\w+</, '>' + FileInfo.formatters.n() + '<');
|
||||
} else {
|
||||
return FileInfo.data.link;
|
||||
|
||||
@ -1904,7 +1904,7 @@ options =
|
||||
backlink: ->
|
||||
$.id('backlinkPreview').textContent = conf['backlink'].replace /%id/, '123456789'
|
||||
fileInfo: ->
|
||||
FileInfo.ffType = if @name is 'fileInfoR' then 0 else 1
|
||||
FileInfo.type = if @name is 'fileInfoR' then 0 else 1
|
||||
FileInfo.data =
|
||||
link : '<a href="javascript:;">1329791824.png</a>'
|
||||
size : 996
|
||||
@ -1912,7 +1912,7 @@ options =
|
||||
resolution: '1366x768'
|
||||
filename : 'Untitled.png'
|
||||
FileInfo.funks = FileInfo.setFormats()
|
||||
$.id("#{@name}Preview").innerHTML = FileInfo.funks[FileInfo.ffType] FileInfo
|
||||
$.id("#{@name}Preview").innerHTML = FileInfo.funks[FileInfo.type] FileInfo
|
||||
favicon: ->
|
||||
Favicon.switch()
|
||||
unread.update true
|
||||
@ -2402,19 +2402,19 @@ FileInfo =
|
||||
g.callbacks.push @node
|
||||
node: (root) ->
|
||||
return if root.className is 'inline' or not node = $ '.filesize', root
|
||||
FileInfo.ffType = if node.childElementCount is 2 then 0 else 1
|
||||
FileInfo.type = if node.childElementCount is 2 then 0 else 1
|
||||
[_, link, size, unit, resolution, filename] =
|
||||
node.innerHTML.match FileInfo.ffRgex[FileInfo.ffType]
|
||||
node.innerHTML.match FileInfo.regexp[FileInfo.type]
|
||||
FileInfo.data =
|
||||
link: link
|
||||
size: size
|
||||
unit: unit
|
||||
resolution: resolution
|
||||
filename: filename
|
||||
node.innerHTML = FileInfo.funks[FileInfo.ffType] FileInfo
|
||||
node.innerHTML = FileInfo.funks[FileInfo.type] FileInfo
|
||||
setFormats: ->
|
||||
for i in [0..1]
|
||||
code = conf[FileInfo.ffConf[i]].replace FileInfo.ffMtrs[i], (s, c) ->
|
||||
code = conf[FileInfo.conf[i]].replace FileInfo.param[i], (s, c) ->
|
||||
if c of FileInfo.formatters
|
||||
"' + FileInfo.formatters.#{c}() + '"
|
||||
else
|
||||
@ -2434,15 +2434,15 @@ FileInfo =
|
||||
if size < 1 and size.toString().length > size.toFixed(2).length
|
||||
size = size.toFixed 2
|
||||
"#{size} #{unitT}"
|
||||
ffConf: [
|
||||
conf: [
|
||||
'fileInfoR'
|
||||
'fileInfoT'
|
||||
]
|
||||
ffMtrs: [
|
||||
param: [
|
||||
/%([BKlLMnNrs])/g
|
||||
/%([BKlMrs])/g
|
||||
]
|
||||
ffRgex: [
|
||||
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)\)/
|
||||
]
|
||||
@ -2450,7 +2450,7 @@ FileInfo =
|
||||
B: -> FileInfo.convertUnit 'B'
|
||||
K: -> FileInfo.convertUnit 'KB'
|
||||
l: ->
|
||||
if FileInfo.ffType is 0
|
||||
if FileInfo.type is 0
|
||||
FileInfo.data.link.replace />\d+\.\w+</, '>' + FileInfo.formatters.n() + '<'
|
||||
else
|
||||
FileInfo.data.link
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user