[26041] | 1 | {combine_css path=$CRYPTO_PATH|cat:'template/style.css'} |
---|
[23209] | 2 | |
---|
[26041] | 3 | {combine_css path=$CRYPTO_PATH|cat:'template/colorpicker/colorpicker.css'} |
---|
| 4 | {combine_script id='jquery.colorpicker' load='footer' path=$CRYPTO_PATH|cat:'template/colorpicker/colorpicker.js'} |
---|
[12617] | 5 | |
---|
[26041] | 6 | {combine_css path='themes/default/js/plugins/chosen.css'} |
---|
[23209] | 7 | {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} |
---|
| 8 | |
---|
| 9 | |
---|
[26041] | 10 | {footer_script} |
---|
[23209] | 11 | // colorpicker |
---|
| 12 | $('.colorpicker-input') |
---|
| 13 | .ColorPicker({ |
---|
| 14 | onSubmit: function(hsb, hex, rgb, el) { |
---|
| 15 | $(el).val(hex); |
---|
| 16 | $(el).ColorPickerHide(); |
---|
| 17 | }, |
---|
| 18 | onChange: function(hsb, hex, rgb, el) { |
---|
| 19 | $(el).val(hex); |
---|
| 20 | changeColor(el, hex); |
---|
| 21 | changePreview(); |
---|
| 22 | setThemeCutom(); |
---|
| 23 | }, |
---|
| 24 | onBeforeShow: function () { |
---|
| 25 | $(this).ColorPickerSetColor(this.value); |
---|
| 26 | } |
---|
| 27 | }) |
---|
[26041] | 28 | .bind('keyup', function() { |
---|
[23209] | 29 | $(this).ColorPickerSetColor(this.value); |
---|
| 30 | changeColor(this, $(this).val()); |
---|
| 31 | }) |
---|
| 32 | .each(function() { |
---|
| 33 | changeColor(this, $(this).val()); |
---|
[19428] | 34 | }); |
---|
[23209] | 35 | |
---|
| 36 | // change button |
---|
| 37 | $('.button').click(function() { |
---|
| 38 | $('.button').removeClass('selected'); |
---|
| 39 | $(this).addClass('selected'); |
---|
| 40 | $('input[name=button_color]').val($(this).attr('title')); |
---|
[26041] | 41 | $('#reload').attr('src', '{$CRYPTO_PATH}template/refresh_'+ $(this).attr('title') +'.png'); |
---|
[23209] | 42 | }); |
---|
| 43 | |
---|
| 44 | // apply a preset |
---|
| 45 | $('.preset').click(function() { |
---|
| 46 | $('.preset').removeClass('selected'); |
---|
| 47 | $(this).addClass('selected'); |
---|
[19428] | 48 | |
---|
[23209] | 49 | var id = $(this).attr("title"); |
---|
[12617] | 50 | |
---|
[23209] | 51 | for (key in presets[id]) { |
---|
| 52 | $('input[name="'+ key +'"]').val([presets[id][key]]); |
---|
| 53 | } |
---|
[12617] | 54 | |
---|
[26041] | 55 | $('.colorpicker-input').each(function() { |
---|
| 56 | changeColor(this, $(this).val()); |
---|
| 57 | }); |
---|
[23209] | 58 | $('input[name="theme"]').val($(this).attr('title')); |
---|
| 59 | changePreview(); |
---|
[12617] | 60 | }); |
---|
| 61 | |
---|
[23209] | 62 | // display customization panel |
---|
| 63 | $('.customize').click(function() { |
---|
| 64 | $('#theming').toggle(); |
---|
| 65 | }); |
---|
| 66 | |
---|
| 67 | // change theme to 'custom' if a parameter is changed |
---|
| 68 | $('input.istheme').change(function() { |
---|
| 69 | setThemeCutom(); |
---|
| 70 | }); |
---|
| 71 | |
---|
| 72 | // update the preview |
---|
| 73 | $('input.istheme, input.preview').change(function() { |
---|
| 74 | changePreview(); |
---|
| 75 | }); |
---|
| 76 | $('#reload').click(function() { |
---|
| 77 | changePreview(); |
---|
| 78 | }); |
---|
| 79 | |
---|
| 80 | // links for random color |
---|
| 81 | $('a.random').click(function() { |
---|
| 82 | $(this).prev('label').children('input').val('random'); |
---|
| 83 | changeColor($(this).prev('label').children('input'), 'random'); |
---|
| 84 | changePreview(); |
---|
| 85 | setThemeCutom(); |
---|
| 86 | }); |
---|
| 87 | |
---|
| 88 | // multiselect |
---|
| 89 | $("select").css({ |
---|
[26041] | 90 | width: 300 |
---|
[23209] | 91 | }).chosen({ |
---|
| 92 | disable_search:true, |
---|
| 93 | }); |
---|
| 94 | |
---|
[14527] | 95 | function setThemeCutom() { |
---|
| 96 | $('.preset').removeClass('selected'); |
---|
| 97 | $('input[name=theme]').val('custom'); |
---|
| 98 | } |
---|
| 99 | |
---|
[26041] | 100 | function changePreview() { |
---|
[14527] | 101 | options = new Array(); |
---|
| 102 | str = ''; |
---|
| 103 | |
---|
| 104 | $('input[type="text"], input[type="radio"]:checked').each(function() { |
---|
| 105 | options[$(this).attr('name')] = $(this).val(); |
---|
| 106 | }); |
---|
| 107 | |
---|
| 108 | for (x in options) { |
---|
| 109 | str+= '&' + x + '=' + options[x]; |
---|
| 110 | } |
---|
[26041] | 111 | $('#captcha').attr('src', '{$CRYPTO_PATH}securimage/securimage_preview.php?' + new Date().getTime() + str); |
---|
[14527] | 112 | } |
---|
| 113 | |
---|
[12617] | 114 | function changeColor(target, color) { |
---|
| 115 | if (color == 'random') color = '808080'; |
---|
| 116 | if (parseInt(color, 16) > 16777215/2) { |
---|
| 117 | $(target).css('color', '#222'); |
---|
[26041] | 118 | } |
---|
| 119 | else { |
---|
[12617] | 120 | $(target).css('color', '#ddd'); |
---|
| 121 | } |
---|
| 122 | $(target).css('background', '#'+color) |
---|
| 123 | } |
---|
| 124 | |
---|
[26041] | 125 | var presets = { |
---|
[23209] | 126 | {foreach from=$PRESETS key=name item=params} |
---|
[26041] | 127 | "{$name}" : { |
---|
[23209] | 128 | {foreach from=$params key=key item=value} |
---|
| 129 | "{$key}" : "{$value}", |
---|
| 130 | {/foreach} |
---|
| 131 | }, |
---|
| 132 | {/foreach} |
---|
| 133 | }; |
---|
[12617] | 134 | {/footer_script} |
---|
| 135 | |
---|
[23209] | 136 | |
---|
[24143] | 137 | {html_style} |
---|
[12617] | 138 | {foreach from=$fonts item=font} |
---|
[26041] | 139 | @font-face { |
---|
| 140 | font-family: '{$font}'; |
---|
[12617] | 141 | src: url({$CRYPTO_PATH}securimage/fonts/{$font}.ttf) format("truetype"); |
---|
| 142 | } |
---|
| 143 | {/foreach} |
---|
[24143] | 144 | {/html_style} |
---|
[12617] | 145 | |
---|
[23209] | 146 | |
---|
[12617] | 147 | <div class="titrePage"> |
---|
| 148 | <h2>Crypto Captcha</h2> |
---|
| 149 | </div> |
---|
| 150 | |
---|
| 151 | <form method="post" class="properties"> |
---|
| 152 | <fieldset> |
---|
[26041] | 153 | <legend>{'Configuration'|translate}</legend> |
---|
[12617] | 154 | |
---|
[15996] | 155 | <ul> |
---|
[12617] | 156 | <li> |
---|
[26041] | 157 | <b>{'Activate on'|translate}</b> |
---|
[23209] | 158 | <select name="activate_on[]" multiple> |
---|
[26041] | 159 | <option value="picture" {if $crypto.activate_on.picture}selected{/if}>{'Picture comments'|translate}</option> |
---|
| 160 | {if $loaded.category}<option value="category" {if $crypto.activate_on.category}selected{/if}>{'Album comments'|translate}</option>{/if} |
---|
| 161 | <option value="register" {if $crypto.activate_on.register}selected{/if}>{'Register form'|translate}</option> |
---|
| 162 | {if $loaded.contactform}<option value="contactform" {if $crypto.activate_on.contactform}selected{/if}>{'Contact form'|translate}</option>{/if} |
---|
| 163 | {if $loaded.guestbook}<option value="guestbook" {if $crypto.activate_on.guestbook}selected{/if}>{'Guestbook'|translate}</option>{/if} |
---|
[23209] | 164 | </select> |
---|
[15996] | 165 | </li> |
---|
| 166 | <li> |
---|
[26041] | 167 | <b>{'Comments action'|translate}</b> |
---|
| 168 | <label><input type="radio" name="comments_action" value="reject" {if $crypto.comments_action == 'reject'}checked="checked"{/if}> {'Reject'|translate}</label> |
---|
| 169 | <label><input type="radio" name="comments_action" value="moderate" {if $crypto.comments_action == 'moderate'}checked="checked"{/if}> {'Moderate'|translate}</label> |
---|
[12617] | 170 | </li> |
---|
| 171 | <li> |
---|
[26041] | 172 | <b>{'Captcha type'|translate}</b> |
---|
| 173 | <label><input type="radio" name="captcha_type" class="preview" value="string" {if $crypto.captcha_type == 'string'}checked="checked"{/if}> {'Random string'|translate}</label> |
---|
| 174 | <label><input type="radio" name="captcha_type" class="preview" value="math" {if $crypto.captcha_type == 'math'}checked="checked"{/if}> {'Simple equation'|translate}</label> |
---|
[12617] | 175 | </li> |
---|
| 176 | <!--<li> |
---|
[26041] | 177 | <b>{'Case sensitive'|translate}</b> |
---|
| 178 | <label><input type="radio" name="case_sensitive" value="false" {if $crypto.case_sensitive == 'false'}checked="checked"{/if}> {'No'|translate}</label> |
---|
| 179 | <label><input type="radio" name="case_sensitive" value="true" {if $crypto.case_sensitive == 'true'}checked="checked"{/if}> {'Yes'|translate}</label> |
---|
[12617] | 180 | </li>--> |
---|
| 181 | <li> |
---|
[26041] | 182 | <b>{'Code lenght'|translate}</b> |
---|
[14527] | 183 | <label><input type="text" name="code_length" class="preview" value="{$crypto.code_length}" size="6" maxlength="2"></label> |
---|
[12617] | 184 | </li> |
---|
| 185 | <li> |
---|
[26041] | 186 | <b>{'Width'|translate}</b> |
---|
| 187 | <label><input type="text" name="width" class="preview" value="{$crypto.width}" size="6" maxlength="3"> {'good value:'|translate} lenght×30</label> |
---|
[12617] | 188 | </li> |
---|
| 189 | <li> |
---|
[26041] | 190 | <b>{'Height'|translate}</b> |
---|
| 191 | <label><input type="text" name="height" class="preview" value="{$crypto.height}" size="6" maxlength="3"> {'good value:'|translate} lenght×12</label> |
---|
[12617] | 192 | </li> |
---|
| 193 | <li> |
---|
[26041] | 194 | <b>{'Button color'|translate}</b> |
---|
[23209] | 195 | <a class="button {if $crypto.button_color == 'dark'}selected{/if}" title="dark"><img src="{$CRYPTO_PATH}template/refresh_dark.png" alt="dark"></a> |
---|
| 196 | <a class="button {if $crypto.button_color == 'light'}selected{/if}" title="light"><img src="{$CRYPTO_PATH}template/refresh_light.png" alt="light"></a> |
---|
| 197 | <input type="hidden" name="button_color" value="{$crypto.button_color}"> |
---|
[19428] | 198 | </li> |
---|
| 199 | <li> |
---|
[26041] | 200 | <b>{'Captcha theme'|translate}</b> |
---|
[23209] | 201 | {foreach from=$PRESETS key=preset item=params} |
---|
| 202 | <a class="preset {if $crypto.theme == $preset}selected{/if}" title="{$preset}"><img src="{$CRYPTO_PATH}template/presets/{$preset}.png" alt="{$preset}"></a> |
---|
| 203 | {/foreach} |
---|
| 204 | <input type="hidden" name="theme" value="{$crypto.theme}"> |
---|
[26041] | 205 | <a class="customize">{'Customize'|translate}</a> |
---|
[12617] | 206 | </li> |
---|
| 207 | </ul> |
---|
| 208 | |
---|
| 209 | <fieldset {if $crypto.theme != 'custom'}style="display:none;"{/if} id="theming"> |
---|
[26041] | 210 | <legend>{'Customize'|translate}</legend> |
---|
[12617] | 211 | |
---|
| 212 | <ul> |
---|
| 213 | <li> |
---|
[26041] | 214 | <b>{'Perturbation'|translate}</b> |
---|
| 215 | <label><input type="text" name="perturbation" value="{$crypto.perturbation}" class="istheme" size="6" maxlength="4"> {'range:'|translate} 0 - 1</label> |
---|
[12617] | 216 | </li> |
---|
| 217 | <li> |
---|
[26041] | 218 | <b>{'Background color'|translate}</b> |
---|
[14527] | 219 | <label><input type="text" name="image_bg_color" value="{$crypto.image_bg_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
[26041] | 220 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
[12617] | 221 | </li> |
---|
| 222 | <li> |
---|
[26041] | 223 | <b>{'Text color'|translate}</b> |
---|
[14527] | 224 | <label><input type="text" name="text_color" value="{$crypto.text_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
[26041] | 225 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
[12617] | 226 | </li> |
---|
| 227 | <li> |
---|
[26041] | 228 | <b>{'Lines density'|translate}</b> |
---|
| 229 | <label><input type="text" name="num_lines" value="{$crypto.num_lines}" class="istheme" size="6" maxlength="4"> {'range:'|translate} 0 - 10</label> |
---|
[12617] | 230 | </li> |
---|
| 231 | <li> |
---|
[26041] | 232 | <b>{'Lines color'|translate}</b> |
---|
[14527] | 233 | <label><input type="text" name="line_color" value="{$crypto.line_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
[26041] | 234 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
[12617] | 235 | </li> |
---|
| 236 | <li> |
---|
[26041] | 237 | <b>{'Noise level'|translate}</b> |
---|
| 238 | <label><input type="text" name="noise_level" value="{$crypto.noise_level}" class="istheme" size="6" maxlength="4"> {'range:'|translate} 0 - 10</label> |
---|
[12617] | 239 | </li> |
---|
| 240 | <li> |
---|
[26041] | 241 | <b>{'Noise color'|translate}</b> |
---|
[14527] | 242 | <label><input type="text" name="noise_color" value="{$crypto.noise_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
[26041] | 243 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
[12617] | 244 | </li> |
---|
| 245 | <li> |
---|
[26041] | 246 | <b>{'Font'|translate}</b> |
---|
[23209] | 247 | {foreach from=$fonts item=font} |
---|
| 248 | <label style="font-family:{$font};" title="{$font}"><input type="radio" name="ttf_file" value="{$font}" {if $crypto.ttf_file == $font}checked="checked"{/if} class="istheme"> {$font}</label> |
---|
| 249 | {/foreach} |
---|
[12617] | 250 | </li> |
---|
| 251 | </ul> |
---|
| 252 | |
---|
[26041] | 253 | {'Tip: type "random" on a color field to have a random color'|translate} |
---|
[12617] | 254 | </fieldset> |
---|
| 255 | |
---|
[19428] | 256 | <ul style="margin-top:30px;"> |
---|
| 257 | <li> |
---|
[26041] | 258 | <b>{'Preview'|translate}</b> |
---|
[19428] | 259 | <img id="captcha" src="{$CRYPTO_PATH}securimage/securimage_show.php" alt="CAPTCHA Image"> |
---|
| 260 | <a href="#" onClick="return false;"><img id="reload" src="{$CRYPTO_PATH}template/refresh_{$crypto.button_color}.png"></a> |
---|
| 261 | </li> |
---|
| 262 | </ul> |
---|
| 263 | |
---|
[12617] | 264 | </fieldset> |
---|
[23209] | 265 | |
---|
[26041] | 266 | <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|translate}" name="submit"></p> |
---|
[12617] | 267 | </form> |
---|
| 268 | |
---|
| 269 | <div style="text-align:right;"> |
---|
| 270 | All free fonts from <a href="http://www.dafont.com" target="_blank">dafont.com</a> | |
---|
| 271 | Powered by : <a href="http://www.phpcaptcha.org/" target="_blank"><img src="{$CRYPTO_PATH}template/logo.png" alt="Secureimage"></a> |
---|
| 272 | </div> |
---|