forked from GithubBackups/vichan
New post form part one
This commit is contained in:
parent
0bbae23680
commit
c04d46933e
@ -2410,33 +2410,19 @@ function shell_exec_error($command, $suppress_stdout = false) {
|
|||||||
*/
|
*/
|
||||||
function diceRoller($post) {
|
function diceRoller($post) {
|
||||||
global $config;
|
global $config;
|
||||||
if(strpos(strtolower($post->email), 'dice%20') === 0) {
|
if (isset($_POST['dx'], $_POST['dy'], $_POST['dz']) && !empty($_POST['dy'])) {
|
||||||
$dicestr = str_split(substr($post->email, strlen('dice%20')));
|
|
||||||
|
|
||||||
// Get params
|
// Get params
|
||||||
$diceX = '';
|
$diceX = $_POST['dx'];
|
||||||
$diceY = '';
|
$diceY = $_POST['dy'];
|
||||||
$diceZ = '';
|
$diceZ = $_POST['dz'];
|
||||||
|
|
||||||
$curd = 'diceX';
|
|
||||||
for($i = 0; $i < count($dicestr); $i ++) {
|
|
||||||
if(is_numeric($dicestr[$i])) {
|
|
||||||
$$curd .= $dicestr[$i];
|
|
||||||
} else if($dicestr[$i] == 'd') {
|
|
||||||
$curd = 'diceY';
|
|
||||||
} else if($dicestr[$i] == '-' || $dicestr[$i] == '+') {
|
|
||||||
$curd = 'diceZ';
|
|
||||||
$$curd = $dicestr[$i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Default values for X and Z
|
// Default values for X and Z
|
||||||
if($diceX == '') {
|
if($diceX == '') {
|
||||||
$diceX = '1';
|
$diceX = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($diceZ == '') {
|
if($diceZ == '') {
|
||||||
$diceZ = '+0';
|
$diceZ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Intify them
|
// Intify them
|
||||||
@ -2453,6 +2439,10 @@ function diceRoller($post) {
|
|||||||
$diceX = 200;
|
$diceX = 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (abs($diceZ) > 1000000) {
|
||||||
|
$diceZ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Continue only if we have valid values
|
// Continue only if we have valid values
|
||||||
if($diceX > 0 && $diceY > 0) {
|
if($diceX > 0 && $diceY > 0) {
|
||||||
$dicerolls = array();
|
$dicerolls = array();
|
||||||
@ -2466,7 +2456,8 @@ function diceRoller($post) {
|
|||||||
// Prepend the result to the post body
|
// Prepend the result to the post body
|
||||||
$modifier = ($diceZ != 0) ? ((($diceZ < 0) ? ' - ' : ' + ') . abs($diceZ)) : '';
|
$modifier = ($diceZ != 0) ? ((($diceZ < 0) ? ' - ' : ' + ') . abs($diceZ)) : '';
|
||||||
$dicesum = ($diceX > 1) ? ' = ' . $dicesum : '';
|
$dicesum = ($diceX > 1) ? ' = ' . $dicesum : '';
|
||||||
$post->body = '<table class="diceroll"><tr><td><img src="'.$config['dir']['static'].'d10.svg" alt="Dice roll" width="24"></td><td>Rolled ' . implode(', ', $dicerolls) . $modifier . $dicesum . '</td></tr></table><br/>' . $post->body;
|
$rollstring = "{$diceX}d{$diceY}";
|
||||||
|
$post->body = '<table class="diceroll"><tr><td><img src="'.$config['dir']['static'].'d10.svg" alt="Dice roll" width="24"></td><td>Rolled ' . implode(', ', $dicerolls) . $modifier . $dicesum . " ($rollstring)</td></tr></table><br/>" . $post->body;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,13 +137,13 @@
|
|||||||
$config['additional_javascript'][] = 'js/catalog-search.js';
|
$config['additional_javascript'][] = 'js/catalog-search.js';
|
||||||
$config['additional_javascript'][] = 'js/thread-stats.js';
|
$config['additional_javascript'][] = 'js/thread-stats.js';
|
||||||
$config['additional_javascript'][] = 'js/quote-selection.js';
|
$config['additional_javascript'][] = 'js/quote-selection.js';
|
||||||
$config['additional_javascript'][] = 'js/twemoji/twemoji.js';
|
|
||||||
$config['additional_javascript'][] = 'js/flag-previews.js';
|
$config['additional_javascript'][] = 'js/flag-previews.js';
|
||||||
$config['additional_javascript'][] = 'js/post-menu.js';
|
$config['additional_javascript'][] = 'js/post-menu.js';
|
||||||
$config['additional_javascript'][] = 'js/post-filter.js';
|
$config['additional_javascript'][] = 'js/post-filter.js';
|
||||||
$config['additional_javascript'][] = 'js/fix-report-delete-submit.js';
|
$config['additional_javascript'][] = 'js/fix-report-delete-submit.js';
|
||||||
$config['additional_javascript'][] = 'js/image-hover.js';
|
$config['additional_javascript'][] = 'js/image-hover.js';
|
||||||
$config['additional_javascript'][] = 'js/auto-scroll.js';
|
$config['additional_javascript'][] = 'js/auto-scroll.js';
|
||||||
|
$config['additional_javascript'][] = 'js/twemoji/twemoji.js';
|
||||||
|
|
||||||
//$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
|
//$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ $(window).ready(function() {
|
|||||||
$(form).find('input[type="submit"]').val(submit_txt);
|
$(form).find('input[type="submit"]').val(submit_txt);
|
||||||
$(form).find('input[type="submit"]').removeAttr('disabled');
|
$(form).find('input[type="submit"]').removeAttr('disabled');
|
||||||
$(form).find('input[name="subject"],input[name="file_url"],\
|
$(form).find('input[name="subject"],input[name="file_url"],\
|
||||||
textarea[name="body"],input[type="file"]').val('').change();
|
textarea[name="body"],input[type="file"],input[name="embed"]').val('').change();
|
||||||
},
|
},
|
||||||
cache: false,
|
cache: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
|
@ -98,9 +98,6 @@
|
|||||||
#quick-reply .nonsense {\
|
#quick-reply .nonsense {\
|
||||||
display: none;\
|
display: none;\
|
||||||
}\
|
}\
|
||||||
#quick-reply td.submit {\
|
|
||||||
width: 1%;\
|
|
||||||
}\
|
|
||||||
#quick-reply td.recaptcha {\
|
#quick-reply td.recaptcha {\
|
||||||
text-align: center;\
|
text-align: center;\
|
||||||
padding: 0 0 1px 0;\
|
padding: 0 0 1px 0;\
|
||||||
@ -257,7 +254,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove mod controls, because it looks shit.
|
// Remove mod controls, because it looks shit.
|
||||||
if ($td.find('input[type="checkbox"]').length) {
|
/*if ($td.find('input[type="checkbox"]').length) {
|
||||||
var tr = this;
|
var tr = this;
|
||||||
$td.find('input[type="checkbox"]').each(function() {
|
$td.find('input[type="checkbox"]').each(function() {
|
||||||
if ($(this).attr('name') == 'spoiler') {
|
if ($(this).attr('name') == 'spoiler') {
|
||||||
@ -272,7 +269,7 @@
|
|||||||
$(tr).remove();
|
$(tr).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
|
|
||||||
$td.find('small').hide();
|
$td.find('small').hide();
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ tb_settings['quick-reply'] = {
|
|||||||
// Show remote in quick reply
|
// Show remote in quick reply
|
||||||
show_remote: false,
|
show_remote: false,
|
||||||
// Show embedding in quick reply
|
// Show embedding in quick reply
|
||||||
show_embed: false
|
show_embed: true
|
||||||
};
|
};
|
||||||
|
|
||||||
// ajax.js
|
// ajax.js
|
||||||
|
@ -79,10 +79,6 @@ header div.subtitle {
|
|||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
form {
|
|
||||||
margin-bottom: 4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
form table {
|
form table {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
@ -131,7 +127,10 @@ form table tr th {
|
|||||||
form table tr td div.center {
|
form table tr td div.center {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
float: left;
|
float: left;
|
||||||
padding-left: 3px;
|
padding: 3px;
|
||||||
|
padding-top: 0px;
|
||||||
|
border: 1px dashed black;
|
||||||
|
margin: 2px
|
||||||
}
|
}
|
||||||
|
|
||||||
form table tr td div input {
|
form table tr td div input {
|
||||||
@ -261,6 +260,11 @@ p.intro a {
|
|||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sage {
|
||||||
|
color: red;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
div.delete {
|
div.delete {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
@ -1035,3 +1039,9 @@ div.mix {
|
|||||||
display: block!important;
|
display: block!important;
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dx,.dy,.dz {
|
||||||
|
width: 30px;
|
||||||
|
text-align: right;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<table>
|
<table>
|
||||||
{% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
{% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
||||||
<th>
|
<th>
|
||||||
{% trans %}Name{% endtrans %}
|
{% trans %}Name{% endtrans %} <span class="unimportant optional-text">{% trans %}(optional){% endtrans %}</span>
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@ -21,7 +21,7 @@
|
|||||||
</tr>{% endif %}
|
</tr>{% endif %}
|
||||||
{% if not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
{% if not config.field_disable_email or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
||||||
<th>
|
<th>
|
||||||
{% trans %}Email{% endtrans %}
|
{% trans %}Email{% endtrans %} <span class="unimportant optional-text">{% trans %}(optional){% endtrans %}</span>
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@ -36,19 +36,19 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
{% if not (not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri))) %}
|
{% if not (not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri))) %}
|
||||||
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />{% if config.spoiler_images %} <input id="spoiler" name="spoiler" type="checkbox"> <label for="spoiler">{% trans %}Spoiler Image{% endtrans %}</label> {% endif %}
|
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</td>
|
</td>
|
||||||
</tr>{% endif %}
|
</tr>{% endif %}
|
||||||
{% if not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
{% if not (config.field_disable_subject or (id and config.field_disable_reply_subject)) or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
||||||
<th>
|
<th>
|
||||||
{% trans %}Subject{% endtrans %}
|
{% trans %}Subject{% endtrans %} {% if not config.force_subject_op or id %}<span class="unimportant optional-text">{% trans %}(optional){% endtrans %}</span>{% endif %}
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input style="float:left;" type="text" name="subject" size="25" maxlength="100" autocomplete="off">
|
<input style="float:left;" type="text" name="subject" size="25" maxlength="100" autocomplete="off">
|
||||||
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />{% if config.spoiler_images %} <input id="spoiler" name="spoiler" type="checkbox"> <label for="spoiler">{% trans %}Spoiler Image{% endtrans %}</label>{% endif %}
|
<input accesskey="s" style="margin-left:2px;" type="submit" name="post" value="{% if id %}{{ config.button_reply }}{% else %}{{ config.button_newtopic }}{% endif %}" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
{% if config.user_flag %}
|
{% if config.user_flag %}
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans %}Flag{% endtrans %}</th>
|
<th>{% trans %}Flag{% endtrans %} <span class="unimportant optional-text">{% trans %}(optional){% endtrans %}</span></th>
|
||||||
<td>
|
<td>
|
||||||
<select name="user_flag" id="user_flag">
|
<select name="user_flag" id="user_flag">
|
||||||
<option value="">{% trans %}None{% endtrans %}</option>
|
<option value="">{% trans %}None{% endtrans %}</option>
|
||||||
@ -113,7 +113,7 @@
|
|||||||
{% if not config.disable_images %}
|
{% if not config.disable_images %}
|
||||||
<tr id="upload">
|
<tr id="upload">
|
||||||
<th>
|
<th>
|
||||||
{% trans %}File{% endtrans %}
|
{% trans %}File{% endtrans %} {% if not config.force_image_op or id %}<span class="unimportant optional-text">{% trans %}(optional){% endtrans %}</span>{% endif %}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<input type="file" name="file" id="upload_file">
|
<input type="file" name="file" id="upload_file">
|
||||||
@ -130,7 +130,7 @@
|
|||||||
{% if config.enable_embedding %}
|
{% if config.enable_embedding %}
|
||||||
<tr id="upload_embed">
|
<tr id="upload_embed">
|
||||||
<th>
|
<th>
|
||||||
{% trans %}Embed{% endtrans %}
|
{% trans %}Embed{% endtrans %} {% if not config.force_image_op or id %}<span class="unimportant optional-text">{% trans %}(optional){% endtrans %}</span>{% else %}<span class="unimportant optional-text">{% trans %}(or file){% endtrans %}</span>{% endif %}
|
||||||
{{ antibot.html() }}
|
{{ antibot.html() }}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@ -138,34 +138,47 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (mod and ((not id and post.mod|hasPermission(config.mod.sticky, board.uri)) or (not id and post.mod|hasPermission(config.mod.lock, board.uri)) or post.mod|hasPermission(config.mod.rawhtml, board.uri))) or (config.allow_no_country and config.country_flags) %}
|
<tr id="options-row">
|
||||||
<tr>
|
|
||||||
<th>
|
<th>
|
||||||
{% trans %}Flags{% endtrans %}
|
{% trans %}Options{% endtrans %}
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
{% if config.allow_no_country and config.country_flags %}<div class="center">
|
<div class="center no-bump-option">
|
||||||
|
<label for="no-bump">{% trans %}No bump{% endtrans %}</label>
|
||||||
|
<input title="No bump" id="no-bump" name="no-bump" type="checkbox">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if config.spoiler_images %}<div class="center spoiler-images-option">
|
||||||
|
<label for="spoiler">{% trans %}Spoiler images{% endtrans %}</label>
|
||||||
|
<input title="Spoiler images" id="spoiler" name="spoiler" type="checkbox">
|
||||||
|
</div>{% endif %}
|
||||||
|
|
||||||
|
{% if config.allow_no_country and config.country_flags %}<div class="center no-country-option">
|
||||||
<label for="no_country">{% trans %}No country flag{% endtrans %}</label>
|
<label for="no_country">{% trans %}No country flag{% endtrans %}</label>
|
||||||
<input title="No country flag" id="no_country" name="no_country" type="checkbox">
|
<input title="No country flag" id="no_country" name="no_country" type="checkbox">
|
||||||
</div>{% endif %}
|
</div>{% endif %}
|
||||||
|
|
||||||
{% if mod %}
|
{% if config.allow_roll %}<div class="center dice-option">
|
||||||
{% if not id and post.mod|hasPermission(config.mod.sticky, board.uri) %}<div class="center">
|
<label for="dy">{% trans %}Dice{% endtrans %}</label>
|
||||||
<label for="sticky">{% trans %}Sticky{% endtrans %}</label>
|
<div><input class="dx" name="dx" type="number">d<input class="dy" name="dy" type="number">±<input class="dz" name="dz" type="number"></div>
|
||||||
<input title="{% trans %}Sticky{% endtrans %}" type="checkbox" name="sticky" id="sticky"><br>
|
|
||||||
</div>{% endif %}
|
</div>{% endif %}
|
||||||
{% if not id and post.mod|hasPermission(config.mod.lock, board.uri) %}<div class="center">
|
|
||||||
|
{% if mod %}
|
||||||
|
{% if not id and post.mod|hasPermission(config.mod.sticky, board.uri) %}<div class="center sticky-option">
|
||||||
|
<label for="sticky">{% trans %}Sticky{% endtrans %}</label>
|
||||||
|
<input title="{% trans %}Sticky{% endtrans %}" type="checkbox" name="sticky" id="sticky">
|
||||||
|
</div>{% endif %}
|
||||||
|
{% if not id and post.mod|hasPermission(config.mod.lock, board.uri) %}<div class="center lock-option">
|
||||||
<label for="lock">{% trans %}Lock{% endtrans %}</label><br>
|
<label for="lock">{% trans %}Lock{% endtrans %}</label><br>
|
||||||
<input title="{% trans %}Lock{% endtrans %}" type="checkbox" name="lock" id="lock">
|
<input title="{% trans %}Lock{% endtrans %}" type="checkbox" name="lock" id="lock">
|
||||||
</div>{% endif %}
|
</div>{% endif %}
|
||||||
{% if post.mod|hasPermission(config.mod.rawhtml, board.uri) %}<div class="center">
|
{% if post.mod|hasPermission(config.mod.rawhtml, board.uri) %}<div class="center raw-html-option">
|
||||||
<label for="raw">{% trans %}Raw HTML{% endtrans %}</label><br>
|
<label for="raw">{% trans %}Raw HTML{% endtrans %}</label><br>
|
||||||
<input title="{% trans %}Raw HTML{% endtrans %}" type="checkbox" name="raw" id="raw">
|
<input title="{% trans %}Raw HTML{% endtrans %}" type="checkbox" name="raw" id="raw">
|
||||||
</div>{% endif %}
|
</div>{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
|
||||||
{% if not config.field_disable_password or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
{% if not config.field_disable_password or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr>
|
||||||
<th>
|
<th>
|
||||||
{% trans %}Password{% endtrans %}
|
{% trans %}Password{% endtrans %}
|
||||||
@ -198,7 +211,5 @@ Max filesize is {{ config.max_filesize|filesize }}.<br />
|
|||||||
Max image dimensions are {{ config.max_height }} x {{ config.max_width }}.<br />
|
Max image dimensions are {{ config.max_height }} x {{ config.max_width }}.<br />
|
||||||
You may upload {{ config.max_images }} per post.<br />
|
You may upload {{ config.max_images }} per post.<br />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if config.allow_roll %}
|
<strong class="faq-message"><br />Confused? See the <a href="/faq.html">FAQ</a>.</strong>
|
||||||
You may roll dice on this board, type "dice XdY+Z" in the email field where X is number of dice, Y is max roll and Z is modifier.<br />
|
|
||||||
{% endif %}
|
|
||||||
</p>
|
</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user