Implement #675
This commit is contained in:
parent
d9e4c2abcf
commit
04c60a62ef
@ -156,7 +156,8 @@
|
||||
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
|
||||
'Remove Spoilers': [false, 'Remove all spoilers in text.'],
|
||||
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
|
||||
'Show Support Message': [true, 'Warn if your browser is unsupported. 4chan X may not operate correctly on unsupported browser versions.']
|
||||
'Show Support Message': [true, 'Warn if your browser is unsupported. 4chan X may not operate correctly on unsupported browser versions.'],
|
||||
'Announcement Hiding': [true, 'Enable announcements to be hidden.']
|
||||
},
|
||||
'Linkification': {
|
||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||
@ -14946,6 +14947,9 @@
|
||||
|
||||
PSAHiding = {
|
||||
init: function() {
|
||||
if (!Conf['Announcement Hiding']) {
|
||||
return;
|
||||
}
|
||||
$.addClass(doc, 'hide-announcement');
|
||||
return $.on(d, '4chanXInitFinished', this.setup);
|
||||
},
|
||||
|
||||
@ -131,7 +131,8 @@
|
||||
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
|
||||
'Remove Spoilers': [false, 'Remove all spoilers in text.'],
|
||||
'Reveal Spoilers': [false, 'Indicate spoilers if Remove Spoilers is enabled, or make the text appear hovered if Remove Spoiler is disabled.'],
|
||||
'Show Support Message': [true, 'Warn if your browser is unsupported. 4chan X may not operate correctly on unsupported browser versions.']
|
||||
'Show Support Message': [true, 'Warn if your browser is unsupported. 4chan X may not operate correctly on unsupported browser versions.'],
|
||||
'Announcement Hiding': [true, 'Enable announcements to be hidden.']
|
||||
},
|
||||
'Linkification': {
|
||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||
@ -14960,6 +14961,9 @@
|
||||
|
||||
PSAHiding = {
|
||||
init: function() {
|
||||
if (!Conf['Announcement Hiding']) {
|
||||
return;
|
||||
}
|
||||
$.addClass(doc, 'hide-announcement');
|
||||
return $.on(d, '4chanXInitFinished', this.setup);
|
||||
},
|
||||
|
||||
@ -77,6 +77,10 @@ Config =
|
||||
true
|
||||
'Warn if your browser is unsupported. 4chan X may not operate correctly on unsupported browser versions.'
|
||||
]
|
||||
'Announcement Hiding': [
|
||||
true
|
||||
'Enable announcements to be hidden.'
|
||||
]
|
||||
|
||||
'Linkification':
|
||||
'Linkify': [
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
PSAHiding =
|
||||
init: ->
|
||||
return unless Conf['Announcement Hiding']
|
||||
$.addClass doc, 'hide-announcement'
|
||||
$.on d, '4chanXInitFinished', @setup
|
||||
|
||||
@ -34,6 +35,7 @@ PSAHiding =
|
||||
$.rmClass doc, 'hide-announcement'
|
||||
|
||||
$.sync 'hiddenPSA', PSAHiding.sync
|
||||
|
||||
toggle: (e) ->
|
||||
if $.hasClass @, 'hide-announcement'
|
||||
UTC = +$.id('globalMessage').dataset.utc
|
||||
@ -42,6 +44,7 @@ PSAHiding =
|
||||
$.event 'CloseMenu'
|
||||
$.delete 'hiddenPSA'
|
||||
PSAHiding.sync UTC
|
||||
|
||||
sync: (UTC) ->
|
||||
psa = $.id 'globalMessage'
|
||||
psa.hidden = PSAHiding.btn.hidden = if UTC and UTC >= +psa.dataset.utc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user