PageSourceSearch

https://www.aqua-land.hu/templ/js/jQuery-plugins/chapcha/qaptcha.jquery.js

js aqua-land.hu collected 2026-10-07 17:02:53 UTC 3,011 bytes, 91 lines download raw bytes

1/************************************************************************
2*************************************************************************
3@Name :       	QapTcha - jQuery Plugin
4@Revison :    	4.2
5@Date : 		06/09/2012  - dd/mm/YYYY
6@Author:     	 ALPIXEL Agency - (www.myjqueryplugins.com - www.alpixel.fr)
7@License :		 Open Source - MIT License : http://www.opensource.org/licenses/mit-license.php
8
9**************************************************************************
10*************************************************************************/
11jQuery.QapTcha = {
12	build : function(options)
13	{
14        var defaults = {
15			txtLock : 'Zárva : Az űrlap nem küldhető',
16			txtUnlock : 'Kinyítva! Az űrlap elküldhető',
17			disabledSubmit : true,
18			autoRevert : true,
19			PHPfile : 'php/Qaptcha.jquery.php',
20			autoSubmit : false
21        };
22
23		if(this.length>0)
24		return jQuery(this).each(function(i) {
25			/** Vars **/
26			var
27				opts = $.extend(defaults, options),
28				$this = $(this),
29				form = $('form').has($this),
30				Clr = jQuery('<div>',{'class':'clr'}),
31				bgSlider = jQuery('<div>',{'class':'bgSlider'}),
32				Slider = jQuery('<div>',{'class':'Slider'}),
33				TxtStatus = jQuery('<div>',{'class':' TxtStatus dropError',text:opts.txtLock}),
34				inputQapTcha = jQuery('<input>',{name:generatePass(32),value:generatePass(7),type:'hidden'});
35
36			/** Disabled submit button **/
37			if(opts.disabledSubmit) form.find('input[type=\'submit\']').attr('disabled','disabled');
38
39			/** Construct DOM **/
40			bgSlider.appendTo($this);
41			Clr.insertAfter(bgSlider);
42			TxtStatus.insertAfter(Clr);
43			inputQapTcha.appendTo($this);
44			Slider.appendTo(bgSlider);
45			$this.show();
46
47			Slider.draggable({
48				revert: function(){
49					if(opts.autoRevert)
50					{
51						if(parseInt(Slider.css("left")) > (bgSlider.width()-Slider.width()-10)) return false;
52						else return true;
53					}
54				},
55				containment: bgSlider,
56				axis:'x',
57				stop: function(event,ui){
58					if(ui.position.left > (bgSlider.width()-Slider.width()-10))
59					{
60						// set the SESSION iQaptcha in PHP file
61						$.post(opts.PHPfile,{
62							action : 'qaptcha',
63							qaptcha_key : inputQapTcha.attr('name')
64						},
65						function(data) {
66							if(!data.error)
67							{
68								Slider.draggable('disable').css('cursor','default');
69								inputQapTcha.val('');
70								TxtStatus.text(opts.txtUnlock).addClass('dropSuccess').removeClass('dropError');
71								form.find('input[type=\'submit\']').removeAttr('disabled');
72								if(opts.autoSubmit) form.find('input[type=\'submit\']').trigger('click');
73							}
74						},'json');
75					}
76				}
77			});
78
79			function generatePass(nb) {
80		        var chars = 'azertyupqsdfghjkmwxcvbn23456789AZERTYUPQSDFGHJKMWXCVBN_-#@';
81		        var pass = '';
82		        for(i=0;i<nb;i++){
83		            var wpos = Math.round(Math.random()*chars.length);
84		            pass += chars.substring(wpos,wpos+1);
85		        }
86		        return pass;
87		    }
88
89		});
90	}
91}; jQuery.fn.QapTcha = jQuery.QapTcha.build;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.