delete button
This commit is contained in:
parent
59aa957d12
commit
b6df3d60fc
@ -72,7 +72,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var $, $$, Anonymize, AutoGif, Conf, Config, ExpandComment, ExpandThread, Favicon, FileInfo, Filter, GetTitle, ImageExpand, ImageHover, Keybinds, Main, Nav, Options, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, ReplyHiding, ReportButton, RevealSpoilers, Sauce, StrikethroughQuotes, ThreadHiding, ThreadStats, Time, TitlePost, UI, Unread, Updater, Watcher, d, g, _base;
|
var $, $$, Anonymize, AutoGif, Conf, Config, DeleteButton, ExpandComment, ExpandThread, Favicon, FileInfo, Filter, GetTitle, ImageExpand, ImageHover, Keybinds, Main, Nav, Options, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, ReplyHiding, ReportButton, RevealSpoilers, Sauce, StrikethroughQuotes, ThreadHiding, ThreadStats, Time, TitlePost, UI, Unread, Updater, Watcher, d, g, _base;
|
||||||
|
|
||||||
Config = {
|
Config = {
|
||||||
main: {
|
main: {
|
||||||
@ -82,6 +82,7 @@
|
|||||||
'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'],
|
'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time'],
|
||||||
'File Info Formatting': [true, 'Reformats the file information'],
|
'File Info Formatting': [true, 'Reformats the file information'],
|
||||||
'Report Button': [true, 'Add report buttons'],
|
'Report Button': [true, 'Add report buttons'],
|
||||||
|
'Delete Button': [false, 'Add delete buttons'],
|
||||||
'Comment Expansion': [true, 'Expand too long comments'],
|
'Comment Expansion': [true, 'Expand too long comments'],
|
||||||
'Thread Expansion': [true, 'View all replies'],
|
'Thread Expansion': [true, 'View all replies'],
|
||||||
'Index Navigation': [true, 'Navigate to previous / next thread'],
|
'Index Navigation': [true, 'Navigate to previous / next thread'],
|
||||||
@ -3416,6 +3417,29 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DeleteButton = {
|
||||||
|
init: function() {
|
||||||
|
this.a = $.el('a', {
|
||||||
|
className: 'delete_button',
|
||||||
|
innerHTML: '[ X ]',
|
||||||
|
href: 'javascript:;'
|
||||||
|
});
|
||||||
|
return Main.callbacks.push(this.node);
|
||||||
|
},
|
||||||
|
node: function(post) {
|
||||||
|
var a;
|
||||||
|
if (!(a = $('.delete_button', post.el))) {
|
||||||
|
a = DeleteButton.a.cloneNode(true);
|
||||||
|
$.add($('.postInfo', post.el), a);
|
||||||
|
}
|
||||||
|
return $.on(a, 'click', DeleteButton["delete"]);
|
||||||
|
},
|
||||||
|
"delete": function() {
|
||||||
|
$.x('preceding-sibling::input', this).checked = true;
|
||||||
|
return $.id('delPassword').nextElementSibling.click();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
ReportButton = {
|
ReportButton = {
|
||||||
init: function() {
|
init: function() {
|
||||||
this.a = $.el('a', {
|
this.a = $.el('a', {
|
||||||
@ -4053,6 +4077,9 @@
|
|||||||
if (Conf['Report Button']) {
|
if (Conf['Report Button']) {
|
||||||
ReportButton.init();
|
ReportButton.init();
|
||||||
}
|
}
|
||||||
|
if (Conf['Delete Button']) {
|
||||||
|
DeleteButton.init();
|
||||||
|
}
|
||||||
if (Conf['Resurrect Quotes']) {
|
if (Conf['Resurrect Quotes']) {
|
||||||
Quotify.init();
|
Quotify.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
master
|
master
|
||||||
|
- aeosynth
|
||||||
|
delete button
|
||||||
|
|
||||||
2.31.6
|
2.31.6
|
||||||
- Mayhem
|
- Mayhem
|
||||||
|
|||||||
@ -6,6 +6,7 @@ Config =
|
|||||||
'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time']
|
'Time Formatting': [true, 'Arbitrarily formatted timestamps, using your local time']
|
||||||
'File Info Formatting': [true, 'Reformats the file information']
|
'File Info Formatting': [true, 'Reformats the file information']
|
||||||
'Report Button': [true, 'Add report buttons']
|
'Report Button': [true, 'Add report buttons']
|
||||||
|
'Delete Button': [false, 'Add delete buttons']
|
||||||
'Comment Expansion': [true, 'Expand too long comments']
|
'Comment Expansion': [true, 'Expand too long comments']
|
||||||
'Thread Expansion': [true, 'View all replies']
|
'Thread Expansion': [true, 'View all replies']
|
||||||
'Index Navigation': [true, 'Navigate to previous / next thread']
|
'Index Navigation': [true, 'Navigate to previous / next thread']
|
||||||
@ -2605,6 +2606,22 @@ Quotify =
|
|||||||
$.replace node, nodes
|
$.replace node, nodes
|
||||||
return
|
return
|
||||||
|
|
||||||
|
DeleteButton =
|
||||||
|
init: ->
|
||||||
|
@a = $.el 'a',
|
||||||
|
className: 'delete_button'
|
||||||
|
innerHTML: '[ X ]'
|
||||||
|
href: 'javascript:;'
|
||||||
|
Main.callbacks.push @node
|
||||||
|
node: (post) ->
|
||||||
|
unless a = $ '.delete_button', post.el
|
||||||
|
a = DeleteButton.a.cloneNode true
|
||||||
|
$.add $('.postInfo', post.el), a
|
||||||
|
$.on a, 'click', DeleteButton.delete
|
||||||
|
delete: ->
|
||||||
|
$.x('preceding-sibling::input', @).checked = true
|
||||||
|
$.id('delPassword').nextElementSibling.click()
|
||||||
|
|
||||||
ReportButton =
|
ReportButton =
|
||||||
init: ->
|
init: ->
|
||||||
@a = $.el 'a',
|
@a = $.el 'a',
|
||||||
@ -3082,6 +3099,9 @@ Main =
|
|||||||
if Conf['Report Button']
|
if Conf['Report Button']
|
||||||
ReportButton.init()
|
ReportButton.init()
|
||||||
|
|
||||||
|
if Conf['Delete Button']
|
||||||
|
DeleteButton.init()
|
||||||
|
|
||||||
if Conf['Resurrect Quotes']
|
if Conf['Resurrect Quotes']
|
||||||
Quotify.init()
|
Quotify.init()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user