Merge branch 'v3' of https://github.com/zixaphir/appchan-x
Conflicts: CHANGELOG.md LICENSE builds/4chan-X.user.js builds/crx/script.js src/Images/ImageExpand.coffee src/Images/ImageHover.coffee
This commit is contained in:
commit
782fd7ad05
@ -48,6 +48,7 @@
|
|||||||
- Clicking on the border of the Header will not toggle `Header auto-hide` anymore.
|
- Clicking on the border of the Header will not toggle `Header auto-hide` anymore.
|
||||||
You can still change the setting in the Header menu → Header.
|
You can still change the setting in the Header menu → Header.
|
||||||
- Bugfixes
|
- Bugfixes
|
||||||
|
- WebM support fixes.
|
||||||
|
|
||||||
**Vampiricwulf**
|
**Vampiricwulf**
|
||||||
- Flash embedding and other Flash features.
|
- Flash embedding and other Flash features.
|
||||||
@ -62,6 +63,7 @@
|
|||||||
- Improved Linkifier link detection.
|
- Improved Linkifier link detection.
|
||||||
- Fixed an issue with Thread Updater intervals not saving correctly.
|
- Fixed an issue with Thread Updater intervals not saving correctly.
|
||||||
- Many spiffy performance, state awareness, and sanity improvements to JSON Navigation.
|
- Many spiffy performance, state awareness, and sanity improvements to JSON Navigation.
|
||||||
|
- Reload captcha if there are posts in the queue.
|
||||||
|
|
||||||
### v1.5.2
|
### v1.5.2
|
||||||
*2014-04-04*
|
*2014-04-04*
|
||||||
|
|||||||
@ -3610,10 +3610,11 @@
|
|||||||
gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
|
gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
|
||||||
spoilerRange: {},
|
spoilerRange: {},
|
||||||
shortFilename: function(filename, isReply) {
|
shortFilename: function(filename, isReply) {
|
||||||
var threshold;
|
var ext, threshold;
|
||||||
threshold = isReply ? 30 : 40;
|
threshold = isReply ? 30 : 40;
|
||||||
if (filename.length - 4 > threshold) {
|
ext = filename.match(/\.[^.]+$/)[0];
|
||||||
return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3);
|
if (filename.length - ext.length > threshold) {
|
||||||
|
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
||||||
} else {
|
} else {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
@ -4780,7 +4781,9 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
dimensions: function(post) {
|
dimensions: function(post) {
|
||||||
if (post.file && post.file.isImage) {
|
var file;
|
||||||
|
file = post.file;
|
||||||
|
if (file && (file.isImage || file.isVideo)) {
|
||||||
return post.file.dimensions;
|
return post.file.dimensions;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -5933,7 +5936,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
QR = {
|
QR = {
|
||||||
mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', 'video/webm', ''],
|
|
||||||
init: function() {
|
init: function() {
|
||||||
var sc;
|
var sc;
|
||||||
if (!Conf['Quick Reply']) {
|
if (!Conf['Quick Reply']) {
|
||||||
@ -6121,6 +6123,7 @@
|
|||||||
}
|
}
|
||||||
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
|
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
|
||||||
QR.captcha.nodes.input.focus();
|
QR.captcha.nodes.input.focus();
|
||||||
|
QR.captcha.setup();
|
||||||
if (Conf['Captcha Warning Notifications'] && !d.hidden) {
|
if (Conf['Captcha Warning Notifications'] && !d.hidden) {
|
||||||
QR.notify(el);
|
QR.notify(el);
|
||||||
} else {
|
} else {
|
||||||
@ -6394,29 +6397,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleFile: function(file, isSingle, max) {
|
handleFile: function(file, isSingle, max) {
|
||||||
var post, _ref;
|
var post;
|
||||||
if (file.size > max) {
|
if (file.size > max) {
|
||||||
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
|
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
|
||||||
return;
|
return;
|
||||||
} else if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
|
|
||||||
if (!/^text/.test(file.type)) {
|
|
||||||
QR.error("" + file.name + ": Unsupported file type.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isSingle) {
|
|
||||||
post = QR.selected;
|
|
||||||
} else if ((post = QR.posts[QR.posts.length - 1]).com) {
|
|
||||||
post = new QR.post();
|
|
||||||
}
|
|
||||||
post.pasteText(file);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (isSingle) {
|
if (isSingle) {
|
||||||
post = QR.selected;
|
post = QR.selected;
|
||||||
} else if ((post = QR.posts[QR.posts.length - 1]).file) {
|
} else if ((post = QR.posts[QR.posts.length - 1]).file) {
|
||||||
post = new QR.post();
|
post = new QR.post();
|
||||||
}
|
}
|
||||||
return post.setFile(file);
|
if (/^text/.test(file.type)) {
|
||||||
|
return post.pasteText(file);
|
||||||
|
} else {
|
||||||
|
return post.setFile(file);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
openFileInput: function(e) {
|
openFileInput: function(e) {
|
||||||
var _ref;
|
var _ref;
|
||||||
@ -7252,6 +7247,9 @@
|
|||||||
$.rmClass(QR.nodes.el, 'dump');
|
$.rmClass(QR.nodes.el, 'dump');
|
||||||
} else if (this === QR.selected) {
|
} else if (this === QR.selected) {
|
||||||
(QR.posts[index - 1] || QR.posts[index + 1]).select();
|
(QR.posts[index - 1] || QR.posts[index + 1]).select();
|
||||||
|
if (QR.captcha.isEnabled) {
|
||||||
|
QR.captcha.setup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QR.posts.splice(index, 1);
|
QR.posts.splice(index, 1);
|
||||||
return QR.status();
|
return QR.status();
|
||||||
@ -7992,7 +7990,7 @@
|
|||||||
if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
|
if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
|
if (ImageExpand.on && !post.isHidden && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.queueTask(func, post);
|
$.queueTask(func, post);
|
||||||
@ -11618,11 +11616,7 @@
|
|||||||
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
||||||
},
|
},
|
||||||
r: function() {
|
r: function() {
|
||||||
if (this.file.isImage || this.file.isVideo) {
|
return this.file.dimensions || 'PDF';
|
||||||
return this.file.dimensions;
|
|
||||||
} else {
|
|
||||||
return 'PDF';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -13353,6 +13347,7 @@
|
|||||||
sizeInBytes: 276 * 1024,
|
sizeInBytes: 276 * 1024,
|
||||||
dimensions: '1280x720',
|
dimensions: '1280x720',
|
||||||
isImage: true,
|
isImage: true,
|
||||||
|
isVideo: false,
|
||||||
isSpoiler: true
|
isSpoiler: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3671,10 +3671,11 @@
|
|||||||
gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
|
gifIcon: window.devicePixelRatio >= 2 ? '@2x.gif' : '.gif',
|
||||||
spoilerRange: {},
|
spoilerRange: {},
|
||||||
shortFilename: function(filename, isReply) {
|
shortFilename: function(filename, isReply) {
|
||||||
var threshold;
|
var ext, threshold;
|
||||||
threshold = isReply ? 30 : 40;
|
threshold = isReply ? 30 : 40;
|
||||||
if (filename.length - 4 > threshold) {
|
ext = filename.match(/\.[^.]+$/)[0];
|
||||||
return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3);
|
if (filename.length - ext.length > threshold) {
|
||||||
|
return "" + filename.slice(0, threshold - 5) + "(...)" + ext;
|
||||||
} else {
|
} else {
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
@ -4834,7 +4835,9 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
dimensions: function(post) {
|
dimensions: function(post) {
|
||||||
if (post.file && post.file.isImage) {
|
var file;
|
||||||
|
file = post.file;
|
||||||
|
if (file && (file.isImage || file.isVideo)) {
|
||||||
return post.file.dimensions;
|
return post.file.dimensions;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -5987,7 +5990,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
QR = {
|
QR = {
|
||||||
mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', 'video/webm', ''],
|
|
||||||
init: function() {
|
init: function() {
|
||||||
var sc;
|
var sc;
|
||||||
if (!Conf['Quick Reply']) {
|
if (!Conf['Quick Reply']) {
|
||||||
@ -6176,6 +6178,7 @@
|
|||||||
}
|
}
|
||||||
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
|
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
|
||||||
QR.captcha.nodes.input.focus();
|
QR.captcha.nodes.input.focus();
|
||||||
|
QR.captcha.setup();
|
||||||
if (Conf['Captcha Warning Notifications'] && !d.hidden) {
|
if (Conf['Captcha Warning Notifications'] && !d.hidden) {
|
||||||
QR.notify(el);
|
QR.notify(el);
|
||||||
} else {
|
} else {
|
||||||
@ -6450,29 +6453,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleFile: function(file, isSingle, max) {
|
handleFile: function(file, isSingle, max) {
|
||||||
var post, _ref;
|
var post;
|
||||||
if (file.size > max) {
|
if (file.size > max) {
|
||||||
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
|
QR.error("" + file.name + ": File too large (file: " + ($.bytesToString(file.size)) + ", max: " + ($.bytesToString(max)) + ").");
|
||||||
return;
|
return;
|
||||||
} else if (_ref = file.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
|
|
||||||
if (!/^text/.test(file.type)) {
|
|
||||||
QR.error("" + file.name + ": Unsupported file type.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (isSingle) {
|
|
||||||
post = QR.selected;
|
|
||||||
} else if ((post = QR.posts[QR.posts.length - 1]).com) {
|
|
||||||
post = new QR.post();
|
|
||||||
}
|
|
||||||
post.pasteText(file);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (isSingle) {
|
if (isSingle) {
|
||||||
post = QR.selected;
|
post = QR.selected;
|
||||||
} else if ((post = QR.posts[QR.posts.length - 1]).file) {
|
} else if ((post = QR.posts[QR.posts.length - 1]).file) {
|
||||||
post = new QR.post();
|
post = new QR.post();
|
||||||
}
|
}
|
||||||
return post.setFile(file);
|
if (/^text/.test(file.type)) {
|
||||||
|
return post.pasteText(file);
|
||||||
|
} else {
|
||||||
|
return post.setFile(file);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
openFileInput: function(e) {
|
openFileInput: function(e) {
|
||||||
var _ref;
|
var _ref;
|
||||||
@ -7291,6 +7286,9 @@
|
|||||||
$.rmClass(QR.nodes.el, 'dump');
|
$.rmClass(QR.nodes.el, 'dump');
|
||||||
} else if (this === QR.selected) {
|
} else if (this === QR.selected) {
|
||||||
(QR.posts[index - 1] || QR.posts[index + 1]).select();
|
(QR.posts[index - 1] || QR.posts[index + 1]).select();
|
||||||
|
if (QR.captcha.isEnabled) {
|
||||||
|
QR.captcha.setup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QR.posts.splice(index, 1);
|
QR.posts.splice(index, 1);
|
||||||
return QR.status();
|
return QR.status();
|
||||||
@ -8031,7 +8029,7 @@
|
|||||||
if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
|
if (!(file && (file.isImage || file.isVideo) && doc.contains(post.nodes.root))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ImageExpand.on && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
|
if (ImageExpand.on && !post.isHidden && (!Conf['Expand spoilers'] && file.isSpoiler || Conf['Expand from here'] && Header.getTopOf(file.thumb) < 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.queueTask(func, post);
|
$.queueTask(func, post);
|
||||||
@ -11634,11 +11632,7 @@
|
|||||||
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
return FileInfo.convertUnit(this.file.sizeInBytes, 'MB');
|
||||||
},
|
},
|
||||||
r: function() {
|
r: function() {
|
||||||
if (this.file.isImage || this.file.isVideo) {
|
return this.file.dimensions || 'PDF';
|
||||||
return this.file.dimensions;
|
|
||||||
} else {
|
|
||||||
return 'PDF';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -13372,6 +13366,7 @@
|
|||||||
sizeInBytes: 276 * 1024,
|
sizeInBytes: 276 * 1024,
|
||||||
dimensions: '1280x720',
|
dimensions: '1280x720',
|
||||||
isImage: true,
|
isImage: true,
|
||||||
|
isVideo: false,
|
||||||
isSpoiler: true
|
isSpoiler: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,15 +28,15 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"font-awesome": "~4.0.3",
|
"font-awesome": "~4.0.3",
|
||||||
"grunt": "~0.4.2",
|
"grunt": "~0.4.4",
|
||||||
"grunt-bump": "~0.0.13",
|
"grunt-bump": "~0.0.13",
|
||||||
"grunt-concurrent": "~0.5.0",
|
"grunt-concurrent": "~0.5.0",
|
||||||
"grunt-contrib-clean": "~0.5.0",
|
"grunt-contrib-clean": "~0.5.0",
|
||||||
"grunt-contrib-coffee": "~0.10.0",
|
"grunt-contrib-coffee": "~0.10.1",
|
||||||
"grunt-contrib-compress": "~0.7.0",
|
"grunt-contrib-compress": "~0.7.0",
|
||||||
"grunt-contrib-concat": "~0.3.0",
|
"grunt-contrib-concat": "~0.4.0",
|
||||||
"grunt-contrib-copy": "~0.5.0",
|
"grunt-contrib-copy": "~0.5.0",
|
||||||
"grunt-contrib-watch": "~0.6.0",
|
"grunt-contrib-watch": "~0.6.1",
|
||||||
"grunt-shell": "~0.6.4",
|
"grunt-shell": "~0.6.4",
|
||||||
"load-grunt-tasks": "~0.4.0"
|
"load-grunt-tasks": "~0.4.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -149,7 +149,8 @@ Filter =
|
|||||||
return post.file.name
|
return post.file.name
|
||||||
false
|
false
|
||||||
dimensions: (post) ->
|
dimensions: (post) ->
|
||||||
if post.file and post.file.isImage
|
{file} = post
|
||||||
|
if file and (file.isImage or file.isVideo)
|
||||||
return post.file.dimensions
|
return post.file.dimensions
|
||||||
false
|
false
|
||||||
filesize: (post) ->
|
filesize: (post) ->
|
||||||
|
|||||||
@ -7,8 +7,9 @@ Build =
|
|||||||
# OPs have a +10 characters threshold.
|
# OPs have a +10 characters threshold.
|
||||||
# The file extension is not taken into account.
|
# The file extension is not taken into account.
|
||||||
threshold = if isReply then 30 else 40
|
threshold = if isReply then 30 else 40
|
||||||
if filename.length - 4 > threshold
|
ext = filename.match(/\.[^.]+$/)[0]
|
||||||
"#{filename[...threshold - 5]}(...).#{filename[-3..]}"
|
if filename.length - ext.length > threshold
|
||||||
|
"#{filename[...threshold - 5]}(...)#{ext}"
|
||||||
else
|
else
|
||||||
filename
|
filename
|
||||||
thumbRotate: do ->
|
thumbRotate: do ->
|
||||||
|
|||||||
@ -388,6 +388,7 @@ Settings =
|
|||||||
sizeInBytes: 276 * 1024
|
sizeInBytes: 276 * 1024
|
||||||
dimensions: '1280x720'
|
dimensions: '1280x720'
|
||||||
isImage: true
|
isImage: true
|
||||||
|
isVideo: false
|
||||||
isSpoiler: true
|
isSpoiler: true
|
||||||
funk = FileInfo.createFunc @value
|
funk = FileInfo.createFunc @value
|
||||||
@nextElementSibling.innerHTML = funk FileInfo, data
|
@nextElementSibling.innerHTML = funk FileInfo, data
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class Post
|
|||||||
|
|
||||||
parseFile: (that) ->
|
parseFile: (that) ->
|
||||||
return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl
|
return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl
|
||||||
# Supports JPG/PNG/GIF/PDF.
|
# Supports JPG/PNG/GIF/WEBM/PDF.
|
||||||
# Flash files are not supported.
|
# Flash files are not supported.
|
||||||
anchor = thumb.parentNode
|
anchor = thumb.parentNode
|
||||||
fileText = fileEl.firstElementChild
|
fileText = fileEl.firstElementChild
|
||||||
|
|||||||
@ -32,4 +32,3 @@ AutoGIF =
|
|||||||
else
|
else
|
||||||
thumb.src = URL
|
thumb.src = URL
|
||||||
gif.src = URL
|
gif.src = URL
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ ImageExpand =
|
|||||||
for post in [post].concat post.clones
|
for post in [post].concat post.clones
|
||||||
{file} = post
|
{file} = post
|
||||||
return unless file and (file.isImage or file.isVideo) and doc.contains post.nodes.root
|
return unless file and (file.isImage or file.isVideo) and doc.contains post.nodes.root
|
||||||
if ImageExpand.on and
|
if ImageExpand.on and !post.isHidden and
|
||||||
(!Conf['Expand spoilers'] and file.isSpoiler or
|
(!Conf['Expand spoilers'] and file.isSpoiler or
|
||||||
Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0)
|
Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0)
|
||||||
return
|
return
|
||||||
|
|||||||
@ -47,4 +47,4 @@ FileInfo =
|
|||||||
B: -> FileInfo.convertUnit @file.sizeInBytes, 'B'
|
B: -> FileInfo.convertUnit @file.sizeInBytes, 'B'
|
||||||
K: -> FileInfo.convertUnit @file.sizeInBytes, 'KB'
|
K: -> FileInfo.convertUnit @file.sizeInBytes, 'KB'
|
||||||
M: -> FileInfo.convertUnit @file.sizeInBytes, 'MB'
|
M: -> FileInfo.convertUnit @file.sizeInBytes, 'MB'
|
||||||
r: -> if @file.isImage or @file.isVideo then @file.dimensions else 'PDF'
|
r: -> @file.dimensions or 'PDF'
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
QR =
|
QR =
|
||||||
# Add empty mimeType to avoid errors with URLs selected in Window's file dialog.
|
|
||||||
mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', 'video/webm', '']
|
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
return if !Conf['Quick Reply']
|
return if !Conf['Quick Reply']
|
||||||
|
|
||||||
@ -147,6 +144,7 @@ QR =
|
|||||||
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
|
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
|
||||||
# Focus the captcha input on captcha error.
|
# Focus the captcha input on captcha error.
|
||||||
QR.captcha.nodes.input.focus()
|
QR.captcha.nodes.input.focus()
|
||||||
|
QR.captcha.setup()
|
||||||
if Conf['Captcha Warning Notifications'] and !d.hidden
|
if Conf['Captcha Warning Notifications'] and !d.hidden
|
||||||
QR.notify el
|
QR.notify el
|
||||||
else
|
else
|
||||||
@ -390,22 +388,14 @@ QR =
|
|||||||
if file.size > max
|
if file.size > max
|
||||||
QR.error "#{file.name}: File too large (file: #{$.bytesToString file.size}, max: #{$.bytesToString max})."
|
QR.error "#{file.name}: File too large (file: #{$.bytesToString file.size}, max: #{$.bytesToString max})."
|
||||||
return
|
return
|
||||||
else unless file.type in QR.mimeTypes
|
|
||||||
unless /^text/.test file.type
|
|
||||||
QR.error "#{file.name}: Unsupported file type."
|
|
||||||
return
|
|
||||||
if isSingle
|
|
||||||
post = QR.selected
|
|
||||||
else if (post = QR.posts[QR.posts.length - 1]).com
|
|
||||||
post = new QR.post()
|
|
||||||
post.pasteText file
|
|
||||||
return
|
|
||||||
if isSingle
|
if isSingle
|
||||||
post = QR.selected
|
post = QR.selected
|
||||||
else if (post = QR.posts[QR.posts.length - 1]).file
|
else if (post = QR.posts[QR.posts.length - 1]).file
|
||||||
post = new QR.post()
|
post = new QR.post()
|
||||||
post.setFile file
|
if /^text/.test file.type
|
||||||
|
post.pasteText file
|
||||||
|
else
|
||||||
|
post.setFile file
|
||||||
openFileInput: (e) ->
|
openFileInput: (e) ->
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
if e.shiftKey and e.type is 'click'
|
if e.shiftKey and e.type is 'click'
|
||||||
|
|||||||
@ -80,6 +80,8 @@ QR.post = class
|
|||||||
$.rmClass QR.nodes.el, 'dump'
|
$.rmClass QR.nodes.el, 'dump'
|
||||||
else if @ is QR.selected
|
else if @ is QR.selected
|
||||||
(QR.posts[index-1] or QR.posts[index+1]).select()
|
(QR.posts[index-1] or QR.posts[index+1]).select()
|
||||||
|
if QR.captcha.isEnabled
|
||||||
|
QR.captcha.setup()
|
||||||
QR.posts.splice index, 1
|
QR.posts.splice index, 1
|
||||||
QR.status()
|
QR.status()
|
||||||
delete: ->
|
delete: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user