Remove /pol/ flags properly.
This commit is contained in:
parent
fce15eced5
commit
930a8a4307
@ -125,8 +125,6 @@ Build =
|
|||||||
|
|
||||||
flag = unless flagCode
|
flag = unless flagCode
|
||||||
<%= html('') %>
|
<%= html('') %>
|
||||||
else if boardID is 'pol'
|
|
||||||
<%= html(' <img src="//s.4cdn.org/image/country/troll/${flagCode.toLowerCase()}.gif" alt="${flagCode}" title="${flagName}" class="countryFlag">') %>
|
|
||||||
else
|
else
|
||||||
<%= html(' <span title="${flagName}" class="flag flag-${flagCode.toLowerCase()}"></span>') %>
|
<%= html(' <span title="${flagName}" class="flag flag-${flagCode.toLowerCase()}"></span>') %>
|
||||||
|
|
||||||
|
|||||||
@ -533,8 +533,6 @@ QR =
|
|||||||
nodes.flashTag.dataset.default = '4'
|
nodes.flashTag.dataset.default = '4'
|
||||||
$.add nodes.form, nodes.flashTag
|
$.add nodes.form, nodes.flashTag
|
||||||
|
|
||||||
QR.flagsInput()
|
|
||||||
|
|
||||||
$.on nodes.filename.parentNode, 'click keydown', QR.openFileInput
|
$.on nodes.filename.parentNode, 'click keydown', QR.openFileInput
|
||||||
|
|
||||||
$.on nodes.autohide, 'change', QR.toggleHide
|
$.on nodes.autohide, 'change', QR.toggleHide
|
||||||
@ -549,7 +547,7 @@ QR =
|
|||||||
$.on nodes.fileInput, 'change', QR.handleFiles
|
$.on nodes.fileInput, 'change', QR.handleFiles
|
||||||
|
|
||||||
# save selected post's data
|
# save selected post's data
|
||||||
items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']
|
items = ['thread', 'name', 'email', 'sub', 'com', 'filename']
|
||||||
i = 0
|
i = 0
|
||||||
save = -> QR.selected.save @
|
save = -> QR.selected.save @
|
||||||
while name = items[i++]
|
while name = items[i++]
|
||||||
@ -579,57 +577,6 @@ QR =
|
|||||||
# Use it to extend the QR's functionalities, or for XTRM RICE.
|
# Use it to extend the QR's functionalities, or for XTRM RICE.
|
||||||
$.event 'QRDialogCreation', null, dialog
|
$.event 'QRDialogCreation', null, dialog
|
||||||
|
|
||||||
flags: ->
|
|
||||||
select = $.el 'select',
|
|
||||||
name: 'flag'
|
|
||||||
className: 'flagSelector'
|
|
||||||
|
|
||||||
fn = (val) ->
|
|
||||||
$.add select, $.el 'option',
|
|
||||||
value: val[0]
|
|
||||||
textContent: val[1]
|
|
||||||
|
|
||||||
fn flag for flag in [
|
|
||||||
['0', 'None']
|
|
||||||
['US', 'American']
|
|
||||||
['KP', 'Best Korean']
|
|
||||||
['BL', 'Black Nationalist']
|
|
||||||
['CM', 'Communist']
|
|
||||||
['CF', 'Confederate']
|
|
||||||
['RE', 'Conservative']
|
|
||||||
['EU', 'European']
|
|
||||||
['GY', 'Gay']
|
|
||||||
['PC', 'Hippie']
|
|
||||||
['IL', 'Israeli']
|
|
||||||
['DM', 'Liberal']
|
|
||||||
['RP', 'Libertarian']
|
|
||||||
['MF', 'Muslim']
|
|
||||||
['NZ', 'Nazi']
|
|
||||||
['OB', 'Obama']
|
|
||||||
['PR', 'Pirate']
|
|
||||||
['RB', 'Rebel']
|
|
||||||
['TP', 'Tea Partier']
|
|
||||||
['TX', 'Texan']
|
|
||||||
['TR', 'Tree Hugger']
|
|
||||||
['WP', 'White Supremacist']
|
|
||||||
]
|
|
||||||
|
|
||||||
select
|
|
||||||
|
|
||||||
flagsInput: ->
|
|
||||||
{nodes} = QR
|
|
||||||
return if not nodes
|
|
||||||
if nodes.flag
|
|
||||||
$.rm nodes.flag
|
|
||||||
delete nodes.flag
|
|
||||||
|
|
||||||
if g.BOARD.ID is 'pol'
|
|
||||||
flag = QR.flags()
|
|
||||||
flag.dataset.name = 'flag'
|
|
||||||
flag.dataset.default = '0'
|
|
||||||
nodes.flag = flag
|
|
||||||
$.add nodes.form, flag
|
|
||||||
|
|
||||||
submit: (e) ->
|
submit: (e) ->
|
||||||
e?.preventDefault()
|
e?.preventDefault()
|
||||||
|
|
||||||
@ -694,7 +641,6 @@ QR =
|
|||||||
upfile: post.file
|
upfile: post.file
|
||||||
filetag: filetag
|
filetag: filetag
|
||||||
spoiler: post.spoiler
|
spoiler: post.spoiler
|
||||||
flag: post.flag
|
|
||||||
textonly: textOnly
|
textonly: textOnly
|
||||||
mode: 'regist'
|
mode: 'regist'
|
||||||
pwd: QR.persona.pwd
|
pwd: QR.persona.pwd
|
||||||
|
|||||||
@ -68,5 +68,4 @@ QR.persona =
|
|||||||
persona =
|
persona =
|
||||||
name: post.name
|
name: post.name
|
||||||
email: if /^sage$/.test post.email then persona.email else post.email
|
email: if /^sage$/.test post.email then persona.email else post.email
|
||||||
flag: post.flag
|
|
||||||
$.set 'QR.persona', persona
|
$.set 'QR.persona', persona
|
||||||
|
|||||||
@ -55,11 +55,6 @@ QR.post = class
|
|||||||
else
|
else
|
||||||
''
|
''
|
||||||
|
|
||||||
if QR.nodes.flag
|
|
||||||
@flag = if prev
|
|
||||||
prev.flag
|
|
||||||
else
|
|
||||||
persona.flag
|
|
||||||
@load() if QR.selected is @ # load persona
|
@load() if QR.selected is @ # load persona
|
||||||
@select() if select
|
@select() if select
|
||||||
@unlock()
|
@unlock()
|
||||||
@ -83,7 +78,7 @@ QR.post = class
|
|||||||
lock: (lock=true) ->
|
lock: (lock=true) ->
|
||||||
@isLocked = lock
|
@isLocked = lock
|
||||||
return unless @ is QR.selected
|
return unless @ is QR.selected
|
||||||
for name in ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler', 'flag'] when node = QR.nodes[name]
|
for name in ['thread', 'name', 'email', 'sub', 'com', 'fileButton', 'filename', 'spoiler'] when node = QR.nodes[name]
|
||||||
node.disabled = lock
|
node.disabled = lock
|
||||||
@nodes.rm.style.visibility = if lock then 'hidden' else ''
|
@nodes.rm.style.visibility = if lock then 'hidden' else ''
|
||||||
(if lock then $.off else $.on) QR.nodes.filename.previousElementSibling, 'click', QR.openFileInput
|
(if lock then $.off else $.on) QR.nodes.filename.previousElementSibling, 'click', QR.openFileInput
|
||||||
@ -108,7 +103,7 @@ QR.post = class
|
|||||||
|
|
||||||
load: ->
|
load: ->
|
||||||
# Load this post's values.
|
# Load this post's values.
|
||||||
for name in ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']
|
for name in ['thread', 'name', 'email', 'sub', 'com', 'filename']
|
||||||
continue unless node = QR.nodes[name]
|
continue unless node = QR.nodes[name]
|
||||||
node.value = @[name] or node.dataset.default or null
|
node.value = @[name] or node.dataset.default or null
|
||||||
(if @thread isnt 'new' then $.addClass else $.rmClass) QR.nodes.el, 'reply-to-thread'
|
(if @thread isnt 'new' then $.addClass else $.rmClass) QR.nodes.el, 'reply-to-thread'
|
||||||
@ -147,7 +142,7 @@ QR.post = class
|
|||||||
return unless @ is QR.selected
|
return unless @ is QR.selected
|
||||||
# Do this in case people use extensions
|
# Do this in case people use extensions
|
||||||
# that do not trigger the `input` event.
|
# that do not trigger the `input` event.
|
||||||
for name in ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler', 'flag']
|
for name in ['thread', 'name', 'email', 'sub', 'com', 'filename', 'spoiler']
|
||||||
continue unless node = QR.nodes[name]
|
continue unless node = QR.nodes[name]
|
||||||
@save node
|
@save node
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user