Files
editcaptcha/templates/editcaptcha.tpl
2026-03-06 15:28:56 +05:00

171 lines
8.1 KiB
Smarty

<div class="title">
<h5>{#mod_name#}</h5>
</div>
<div class="widget" style="margin-top:0">
<div class="body">
<ul style="list-style: none; margin-left:0px;">
<li>{#e_cap_infomod#}</li>
<li>{#e_cap_infomod1#}</li>
</ul>
</div>
</div>
<div class="breadCrumbHolder module">
<div class="breadCrumb module">
<ul>
<li class="firstB">
<a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a>
</li>
<li>
<a href="index.php?do=modules&amp;cp={$sess}">{#MODULES_SUB_TITLE#}</a>
</li>
<li>
<strong class="code">{#e_cap_title#}</strong>
</li>
</ul>
</div>
</div>
<div class="widget first">
<div class="head">
<h5 class="iFrames">{#e_cap_title#}</h5>
<div style="float:right; margin-right:15px; margin-top:10px;">
{if ADMIN_CAPTCHA == true}<a title="{#e_cap_on_info#}" style="cursor: default" class="topleftDir btn greenBtn" href="javascript:void(0);">{#e_cap_on#}</a>{else}<a title="{#e_cap_of_info#}" style="cursor: default" class="topleftDir btn redBtn" href="javascript:void(0);">{#e_cap_of#}</a>{/if}
</div>
</div>
</div>
<div class="mainForm" id="form">
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic">
<colgroup>
<col width="180" />
<col width="50" />
<col width="*" />
<col width="*" />
<col width="*" />
<col width="*" />
<col width="*" />
<col width="*" />
<col width="70" /> <col width="*" />
</colgroup>
<thead>
<tr class="noborder">
<td>{#e_cap_real#}</td>
<td>{#e_cap_ref#}</td>
<td>{#e_cap_allow_symbol#}</td>
<td>{#e_cap_count_symbol#}</td>
<td>{#e_cap_fluc_amplit#}</td>
<td>{#e_cap_white_noise#}</td>
<td>{#e_cap_black_noise#}</td>
<td>{#e_cap_spaces_symb#}</td>
<td>{#e_cap_bg_color#}</td>
<td>{#e_cap_actions#}</td>
</tr>
</thead>
<tbody>
<tr>
<td align="center"><span id="captcha"><img src="{$ABS_PATH}inc/captcha.php" alt="" width="120" height="60" border="0" /></span></td>
<td align="center"><img id="captcha-ref" style="cursor: pointer;" src="{$ABS_PATH}modules/editcaptcha/img/ref.png" width="30" height="30" border="0" /></td>
<td align="center">
<input id="allow_symbols" class="mousetrap" name="allow_symbols" type="text" value="{$allow_symbols|escape}" style="width:148px;"/><br /><br />
<strong><a href="javascript:void(0);" onclick="allow_symbols.value = '23456789abcdegikpqsvxyz'; return false;">23456789abcdegikpqsvxyz</a></strong>
</td>
<td align="center">
<input required id="count_symbols" class="mousetrap" name="count_symbols" type="text" value="{$count_symbols|escape}" style="width:30px;"/><br /><br />
| <strong><a href="javascript:void(0);" onclick="count_symbols.value = '4,4'; return false;">4,4</a></strong> |
<strong><a href="javascript:void(0);" onclick="count_symbols.value = '4,5'; return false;">4,5</a></strong> |
<strong><a href="javascript:void(0);" onclick="count_symbols.value = '5,5'; return false;">5,5</a></strong> |
<strong><a href="javascript:void(0);" onclick="count_symbols.value = '5,6'; return false;">5,6</a></strong> |
</td>
<td align="center">
<input required id="fluct_amplit" class="mousetrap" name="fluct_amplit" type="text" value="{$fluct_amplit|escape}" style="width:21px;"/><br /><br />
{section name=foo start=0 loop=9 step=1}
<strong><a href="javascript:void(0);" onclick="fluct_amplit.value = '{$smarty.section.foo.index}'; return false;">{$smarty.section.foo.index}</a></strong> |
{/section}
</td>
<td align="center">
<input required id="white_noise" class="mousetrap" name="white_noise" type="text" value="{$white_noise|escape}" style="width:36px;"/><br /><br />
| <strong><a href="javascript:void(0);" onclick="white_noise.value = '0'; return false;">0</a></strong> |
<strong><a href="javascript:void(0);" onclick="white_noise.value = '1/6'; return false;">1/6</a></strong> |
</td>
<td align="center">
<input required id="black_noise" class="mousetrap" name="black_noise" type="text" value="{$black_noise|escape}" style="width:36px;"/><br /><br />
| <strong><a href="javascript:void(0);" onclick="black_noise.value = '0'; return false;">0</a></strong> |
<strong><a href="javascript:void(0);" onclick="black_noise.value = '1/30'; return false;">1/30</a></strong> |
</td>
<td align="center">
<input required id="no_spaces" class="mousetrap" name="no_spaces" type="text" value="{$no_spaces|escape}" style="width:39px;"/><br /><br />
| <strong><a href="javascript:void(0);" onclick="no_spaces.value = 'false'; return false;">false</a></strong> |
<strong><a href="javascript:void(0);" onclick="no_spaces.value = 'true'; return false;">true</a></strong> |
</td>
<td align="center">
<input id="bg_color" type="color" value="{$bg_color}" style="width:40px; height:30px; border:none; cursor:pointer;" /><br /><br />
<strong>HEX</strong>
</td>
<td align="center">
<a id="btn_sub" title="{#e_cap_submit#}" class="btn blueBtn" href="javascript:void(0);">{#e_cap_submit#}</a>
</td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#captcha-ref").click(function() {
$("#captcha img").attr("src", '{$ABS_PATH}inc/captcha.php?refresh=' + new Date().getTime());
});
$("#btn_sub").on('click', function() {
var allow_symbols = $("#allow_symbols").val();
var count_symbols = $("#count_symbols").val();
var fluct_amplit = $("#fluct_amplit").val();
var white_noise = $("#white_noise").val();
var black_noise = $("#black_noise").val();
var no_spaces = $("#no_spaces").val();
var bg_color = $("#bg_color").val();
if (allow_symbols.length == 0 || count_symbols.length == 0 || fluct_amplit.length == 0 || white_noise.length == 0 || black_noise.length == 0 || no_spaces.length == 0) {
$.jGrowl("{#e_cap_field#}", {
theme: 'error',
life: 5000
});
return false;
}
$.ajax({
type: 'POST',
url: 'index.php?do=modules&action=modedit&mod=editcaptcha&moduleaction=save&cp={$sess}',
data: {
a: allow_symbols,
b: count_symbols,
c: fluct_amplit,
d: white_noise,
e: black_noise,
f: no_spaces,
g: bg_color
},
success: function(data) {
$.alerts._overlay('hide');
if (data.trim() === "success") {
$.jGrowl("{#e_cap_infomod2#}", {
theme: 'accept',
life: 3000
});
$("#captcha-ref").click();
} else {
$.jGrowl("{#e_cap_err#} " + data, {
theme: 'error',
life: 5000
});
}
},
error: function(xhr) {
$.alerts._overlay('hide');
$.jGrowl("{#e_cap_err_crit#} " + xhr.status, {
theme: 'error',
life: 5000
});
}
});
});
});
</script>