relabel email field to options

This commit is contained in:
ccd0 2014-08-13 22:56:11 -07:00
parent 6bfd39b3f9
commit 753ac9039a
5 changed files with 11 additions and 9 deletions

View File

@ -329,7 +329,7 @@ Config =
] ]
'Show Name and Subject': [ 'Show Name and Subject': [
false false
'Always show name and subject fields in the QR even when 4chan doesn\'t use them.' 'Show the classic name, email, and subject fields in the QR, even when 4chan doesn\'t use them all.'
] ]
'Hide Original Post Form': [ 'Hide Original Post Form': [
true true
@ -601,7 +601,7 @@ vp-replace
QR: QR:
'QR.personas': """ 'QR.personas': """
#email:"sage";boards:jp;always #options:"sage";boards:jp;always
""" """
time: '%m/%d/%y(%a)%H:%M:%S' time: '%m/%d/%y(%a)%H:%M:%S'

View File

@ -11,7 +11,7 @@
<form> <form>
<div class=persona> <div class=persona>
<input name=name data-name=name list="list-name" placeholder=Name class=field size=1 tabindex=10> <input name=name data-name=name list="list-name" placeholder=Name class=field size=1 tabindex=10>
<input name=email data-name=email list="list-email" placeholder=E-mail class=field size=1 tabindex=20> <input name=email data-name=email list="list-email" placeholder=Options class=field size=1 tabindex=20>
<input name=sub data-name=sub list="list-sub" placeholder=Subject class=field size=1 tabindex=30> <input name=sub data-name=sub list="list-sub" placeholder=Subject class=field size=1 tabindex=30>
</div> </div>
<div class=textarea> <div class=textarea>

View File

@ -75,10 +75,10 @@
Lines starting with a <code>#</code> will be ignored. Lines starting with a <code>#</code> will be ignored.
</p> </p>
<ul>You can use these settings with each item, separate them with semicolons: <ul>You can use these settings with each item, separate them with semicolons:
<li>Possible items are: <code>name</code>, <code>email</code>, <code>subject</code> and <code>password</code>.</li> <li>Possible items are: <code>name</code>, <code>options</code> (or equivalently <code>email</code>), <code>subject</code> and <code>password</code>.</li>
<li>Wrap values of items with quotes, like this: <code>email:"sage"</code>.</li> <li>Wrap values of items with quotes, like this: <code>options:"sage"</code>.</li>
<li>Force values as defaults with the <code>always</code> keyword, for example: <code>email:"sage";always</code>.</li> <li>Force values as defaults with the <code>always</code> keyword, for example: <code>options:"sage";always</code>.</li>
<li>Select specific boards for an item, separated with commas, for example: <code>email:"sage";boards:jp;always</code>.</li> <li>Select specific boards for an item, separated with commas, for example: <code>options:"sage";boards:jp;always</code>.</li>
</ul> </ul>
</fieldset> </fieldset>

View File

@ -472,6 +472,7 @@ QR =
if Conf['Show Name and Subject'] if Conf['Show Name and Subject']
$.addClass QR.nodes.name, 'force-show' $.addClass QR.nodes.name, 'force-show'
$.addClass QR.nodes.sub, 'force-show' $.addClass QR.nodes.sub, 'force-show'
QR.nodes.email.placeholder = 'E-mail'
QR.forcedAnon = !!$ '.postForm input[name=name][type=hidden]' QR.forcedAnon = !!$ '.postForm input[name=name][type=hidden]'
if QR.forcedAnon if QR.forcedAnon

View File

@ -16,7 +16,7 @@ QR.persona =
parseItem: (item, types) -> parseItem: (item, types) ->
return if item[0] is '#' return if item[0] is '#'
return unless match = item.match /(name|email|subject|password):"(.*)"/i return unless match = item.match /(name|options|email|subject|password):"(.*)"/i
[match, type, val] = match [match, type, val] = match
# Don't mix up item settings with val. # Don't mix up item settings with val.
@ -30,7 +30,8 @@ QR.persona =
QR.persona.pwd = val QR.persona.pwd = val
return return
type = 'sub' if type is 'subject' type = 'email' if type is 'options'
type = 'sub' if type is 'subject'
if /always/i.test item if /always/i.test item
QR.persona.always[type] = val QR.persona.always[type] = val