Remove /pol/ flags properly.

This commit is contained in:
ccd0 2015-01-25 14:57:39 -08:00
parent fce15eced5
commit 930a8a4307
4 changed files with 4 additions and 66 deletions

View File

@ -125,8 +125,6 @@ Build =
flag = unless flagCode
<%= 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
<%= html(' <span title="${flagName}" class="flag flag-${flagCode.toLowerCase()}"></span>') %>

View File

@ -533,8 +533,6 @@ QR =
nodes.flashTag.dataset.default = '4'
$.add nodes.form, nodes.flashTag
QR.flagsInput()
$.on nodes.filename.parentNode, 'click keydown', QR.openFileInput
$.on nodes.autohide, 'change', QR.toggleHide
@ -549,7 +547,7 @@ QR =
$.on nodes.fileInput, 'change', QR.handleFiles
# save selected post's data
items = ['thread', 'name', 'email', 'sub', 'com', 'filename', 'flag']
items = ['thread', 'name', 'email', 'sub', 'com', 'filename']
i = 0
save = -> QR.selected.save @
while name = items[i++]
@ -579,57 +577,6 @@ QR =
# Use it to extend the QR's functionalities, or for XTRM RICE.
$.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) ->
e?.preventDefault()
@ -694,7 +641,6 @@ QR =
upfile: post.file
filetag: filetag
spoiler: post.spoiler
flag: post.flag
textonly: textOnly
mode: 'regist'
pwd: QR.persona.pwd

View File

@ -68,5 +68,4 @@ QR.persona =
persona =
name: post.name
email: if /^sage$/.test post.email then persona.email else post.email
flag: post.flag
$.set 'QR.persona', persona

View File

@ -55,11 +55,6 @@ QR.post = class
else
''
if QR.nodes.flag
@flag = if prev
prev.flag
else
persona.flag
@load() if QR.selected is @ # load persona
@select() if select
@unlock()
@ -83,7 +78,7 @@ QR.post = class
lock: (lock=true) ->
@isLocked = lock
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
@nodes.rm.style.visibility = if lock then 'hidden' else ''
(if lock then $.off else $.on) QR.nodes.filename.previousElementSibling, 'click', QR.openFileInput
@ -108,7 +103,7 @@ QR.post = class
load: ->
# 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]
node.value = @[name] or node.dataset.default or null
(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
# Do this in case people use extensions
# 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]
@save node
return