1 | {combine_css path=$CRYPTO_PATH|cat:'template/style.css'} |
---|
2 | |
---|
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'} |
---|
5 | |
---|
6 | {combine_css path='themes/default/js/plugins/chosen.css'} |
---|
7 | {combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} |
---|
8 | |
---|
9 | |
---|
10 | {footer_script} |
---|
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 | }) |
---|
28 | .bind('keyup', function() { |
---|
29 | $(this).ColorPickerSetColor(this.value); |
---|
30 | changeColor(this, $(this).val()); |
---|
31 | }) |
---|
32 | .each(function() { |
---|
33 | changeColor(this, $(this).val()); |
---|
34 | }); |
---|
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')); |
---|
41 | $('#reload').attr('src', '{$CRYPTO_PATH}template/refresh_'+ $(this).attr('title') +'.png'); |
---|
42 | }); |
---|
43 | |
---|
44 | // apply a preset |
---|
45 | $('.preset').click(function() { |
---|
46 | $('.preset').removeClass('selected'); |
---|
47 | $(this).addClass('selected'); |
---|
48 | |
---|
49 | var id = $(this).attr("title"); |
---|
50 | |
---|
51 | for (key in presets[id]) { |
---|
52 | $('input[name="'+ key +'"]').val([presets[id][key]]); |
---|
53 | } |
---|
54 | |
---|
55 | $('.colorpicker-input').each(function() { |
---|
56 | changeColor(this, $(this).val()); |
---|
57 | }); |
---|
58 | $('input[name="theme"]').val($(this).attr('title')); |
---|
59 | changePreview(); |
---|
60 | }); |
---|
61 | |
---|
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({ |
---|
90 | width: 300 |
---|
91 | }).chosen({ |
---|
92 | disable_search:true, |
---|
93 | }); |
---|
94 | |
---|
95 | function setThemeCutom() { |
---|
96 | $('.preset').removeClass('selected'); |
---|
97 | $('input[name=theme]').val('custom'); |
---|
98 | } |
---|
99 | |
---|
100 | function changePreview() { |
---|
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 | } |
---|
111 | $('#captcha').attr('src', '{$CRYPTO_PATH}securimage/securimage_preview.php?' + new Date().getTime() + str); |
---|
112 | } |
---|
113 | |
---|
114 | function changeColor(target, color) { |
---|
115 | if (color == 'random') color = '808080'; |
---|
116 | if (parseInt(color, 16) > 16777215/2) { |
---|
117 | $(target).css('color', '#222'); |
---|
118 | } |
---|
119 | else { |
---|
120 | $(target).css('color', '#ddd'); |
---|
121 | } |
---|
122 | $(target).css('background', '#'+color) |
---|
123 | } |
---|
124 | |
---|
125 | var presets = { |
---|
126 | {foreach from=$PRESETS key=name item=params} |
---|
127 | "{$name}" : { |
---|
128 | {foreach from=$params key=key item=value} |
---|
129 | "{$key}" : "{$value}", |
---|
130 | {/foreach} |
---|
131 | }, |
---|
132 | {/foreach} |
---|
133 | }; |
---|
134 | {/footer_script} |
---|
135 | |
---|
136 | |
---|
137 | {html_style} |
---|
138 | {foreach from=$fonts item=font} |
---|
139 | @font-face { |
---|
140 | font-family: '{$font}'; |
---|
141 | src: url({$CRYPTO_PATH}securimage/fonts/{$font}.ttf) format("truetype"); |
---|
142 | } |
---|
143 | {/foreach} |
---|
144 | {/html_style} |
---|
145 | |
---|
146 | |
---|
147 | <div class="titrePage"> |
---|
148 | <h2>Crypto Captcha</h2> |
---|
149 | </div> |
---|
150 | |
---|
151 | <form method="post" class="properties"> |
---|
152 | <fieldset> |
---|
153 | <legend>{'Configuration'|translate}</legend> |
---|
154 | |
---|
155 | <ul> |
---|
156 | <li> |
---|
157 | <b>{'Activate on'|translate}</b> |
---|
158 | <select name="activate_on[]" multiple> |
---|
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} |
---|
164 | </select> |
---|
165 | </li> |
---|
166 | <li> |
---|
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> |
---|
170 | </li> |
---|
171 | <li> |
---|
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> |
---|
175 | </li> |
---|
176 | <!--<li> |
---|
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> |
---|
180 | </li>--> |
---|
181 | <li> |
---|
182 | <b>{'Code lenght'|translate}</b> |
---|
183 | <label><input type="text" name="code_length" class="preview" value="{$crypto.code_length}" size="6" maxlength="2"></label> |
---|
184 | </li> |
---|
185 | <li> |
---|
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> |
---|
188 | </li> |
---|
189 | <li> |
---|
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> |
---|
192 | </li> |
---|
193 | <li> |
---|
194 | <b>{'Button color'|translate}</b> |
---|
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}"> |
---|
198 | </li> |
---|
199 | <li> |
---|
200 | <b>{'Captcha theme'|translate}</b> |
---|
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}"> |
---|
205 | <a class="customize">{'Customize'|translate}</a> |
---|
206 | </li> |
---|
207 | </ul> |
---|
208 | |
---|
209 | <fieldset {if $crypto.theme != 'custom'}style="display:none;"{/if} id="theming"> |
---|
210 | <legend>{'Customize'|translate}</legend> |
---|
211 | |
---|
212 | <ul> |
---|
213 | <li> |
---|
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> |
---|
216 | </li> |
---|
217 | <li> |
---|
218 | <b>{'Background color'|translate}</b> |
---|
219 | <label><input type="text" name="image_bg_color" value="{$crypto.image_bg_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
220 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
221 | </li> |
---|
222 | <li> |
---|
223 | <b>{'Text color'|translate}</b> |
---|
224 | <label><input type="text" name="text_color" value="{$crypto.text_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
225 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
226 | </li> |
---|
227 | <li> |
---|
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> |
---|
230 | </li> |
---|
231 | <li> |
---|
232 | <b>{'Lines color'|translate}</b> |
---|
233 | <label><input type="text" name="line_color" value="{$crypto.line_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
234 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
235 | </li> |
---|
236 | <li> |
---|
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> |
---|
239 | </li> |
---|
240 | <li> |
---|
241 | <b>{'Noise color'|translate}</b> |
---|
242 | <label><input type="text" name="noise_color" value="{$crypto.noise_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label> |
---|
243 | <a class="random" title="{'random'|translate}"><img src="{$CRYPTO_PATH}/template/arrow_switch.png"></a> |
---|
244 | </li> |
---|
245 | <li> |
---|
246 | <b>{'Font'|translate}</b> |
---|
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} |
---|
250 | </li> |
---|
251 | </ul> |
---|
252 | |
---|
253 | {'Tip: type "random" on a color field to have a random color'|translate} |
---|
254 | </fieldset> |
---|
255 | |
---|
256 | <ul style="margin-top:30px;"> |
---|
257 | <li> |
---|
258 | <b>{'Preview'|translate}</b> |
---|
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 | |
---|
264 | </fieldset> |
---|
265 | |
---|
266 | <p class="formButtons"><input class="submit" type="submit" value="{'Submit'|translate}" name="submit"></p> |
---|
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> |
---|