PageSourceSearch

https://www.starmen.com.tw/scripts/jquery.realperson.min.js

js starmen.com.tw collected 2026-10-08 02:52:24 UTC 6,954 bytes, 23 lines download raw bytes

1/* http://keith-wood.name/realPerson.html
2   Real Person Form Submission for jQuery v1.1.1.
3   Written by Keith Wood (kwood{at}iinet.com.au) June 2009.
4   Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license. 
5   Please attribute the author if you use it. */
6(function($){function RealPerson(){this._defaults={length:5,includeNumbers:false,regenerate:'Click to change',hashName:'{n}Hash'}}var f='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';var g=[['   *   ','  * *  ','  * *  ',' *   * ',' ***** ','*     *','*     *'],['****** ','*     *','*     *','****** ','*     *','*     *','****** '],[' ***** ','*     *','*      ','*      ','*      ','*     *',' ***** '],['****** ','*     *','*     *','*     *','*     *','*     *','****** '],['*******','*      ','*      ','****   ','*      ','*      ','*******'],['*******','*      ','*      ','****   ','*      ','*      ','*      '],[' ***** ','*     *','*      ','*      ','*   ***','*     *',' ***** '],['*     *','*     *','*     *','*******','*     *','*     *','*     *'],['*******','   *   ','   *   ','   *   ','   *   ','   *   ','*******'],['      *','      *','      *','      *','      *','*     *',' ***** '],['*     *','*   ** ','* **   ','**     ','* **   ','*   ** ','*     *'],['*      ','*      ','*      ','*      ','*      ','*      ','*******'],['*     *','**   **','* * * *','*  *  *','*     *','*     *','*     *'],['*     *','**    *','* *   *','*  *  *','*   * *','*    **','*     *'],[' ***** ','*     *','*     *','*     *','*     *','*     *',' ***** '],['****** ','*     *','*     *','****** ','*      ','*      ','*      '],[' ***** ','*     *','*     *','*     *','*   * *','*    * ',' **** *'],['****** ','*     *','*     *','****** ','*   *  ','*    * ','*     *'],[' ***** ','*     *','*      ',' ***** ','      *','*     *',' ***** '],['*******','   *   ','   *   ','   *   ','   *   ','   *   ','   *   '],['*     *','*     *','*     *','*     *','*     *','*     *',' ***** '],['*     *','*     *',' *   * ',' *   * ','  * *  ','  * *  ','   *   '],['*     *','*     *','*     *','*  *  *','* * * *','**   **','*     *'],['*     *',' *   * ','  * *  ','   *   ','  * *  ',' *   * ','*     *'],['*     *',' *   * ','  * *  ','   *   ','   *   ','   *   ','   *   '],['*******','     * ','    *  ','   *   ','  *    ',' *     ','*******'],['  ***  ',' *   * ','*   * *','*  *  *','* *   *',' *   * ','  ***  '],['   *   ','  **   ',' * *   ','   *   ','   *   ','   *   ','*******'],[' ***** ','*     *','      *','     * ','   **  ',' **    ','*******'],[' ***** ','*     *','      *','    ** ','      *','*     *',' ***** '],['    *  ','   **  ','  * *  ',' *  *  ','*******','    *  ','    *  '],['*******','*      ','****** ','      *','      *','*     *',' ***** '],['  **** ',' *     ','*      ','****** ','*     *','*     *',' ***** '],['*******','     * ','    *  ','   *   ','  *    ',' *     ','*      '],[' ***** ','*     *','*     *',' ***** ','*     *','*     *',' ***** '],[' ***** ','*     *','*     *',' ******','      *','     * ',' ****  ']];$.extend(RealPerson.prototype,{markerClassName:'hasRealPerson',propertyName:'realperson',setDefaults:function(a){$.extend(this._defaults,a||{});return this},_attachPlugin:function(a,b){a=$(a);if(a.hasClass(this.markerClassName)){return}var c={options:$.extend({},this._defaults)};a.addClass(this.markerClassName).data(this.propertyName,c);this._optionPlugin(a,b)},_optionPlugin:function(a,b,c){a=$(a);var d=a.data(this.propertyName);if(!b||(typeof b=='string'&&c==null)){var e=b;b=(d||{}).options;return(b&&e?b[e]:b)}if(!a.hasClass(this.markerClassName)){return}b=b||{};if(typeof b=='string'){var e=b;b={};b[e]=c}$.extend(d.options,b);a.prevAll('.'+this.propertyName+'-challenge,.'+this.propertyName+'-hash').remove().end().before(this._generateHTML(a,d))},_generateHTML:function(a,b){var c='';for(var i=0;
6i<b.options.length;i++){c+=f.charAt(Math.floor(Math.random()*(b.options.includeNumbers?36:26)))}var d='<div class="'+this.propertyName+'-challenge">'+'<div class="'+this.propertyName+'-text">';for(var i=0;i<g[0].length;i++){for(var j=0;j<c.length;j++){d+=g[f.indexOf(c.charAt(j))][i].replace(/ /g,'&nbsp;')+'&nbsp;&nbsp;'}d+='<br>'}d+='</div></div><input type="hidden" class="'+this.propertyName+'-hash" name="'+b.options.hashName.replace(/\{n\}/,a.attr('name'))+'" value="'+this._hash(c)+'">';return d},_enablePlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}a.removeClass(this.propertyName+'-disabled').prop('disabled',false).prevAll('.'+this.propertyName+'-challenge').removeClass(this.propertyName+'-disabled')},_disablePlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}a.addClass(this.propertyName+'-disabled').prop('disabled',true).prevAll('.'+this.propertyName+'-challenge').addClass(this.propertyName+'-disabled')},_destroyPlugin:function(a){a=$(a);if(!a.hasClass(this.markerClassName)){return}a.removeClass(this.markerClassName).removeData(this.propertyName).prevAll('.'+this.propertyName+'-challenge,.'+this.propertyName+'-hash').remove()},_hash:function(a){var b=4095;for(var i=0;i<a.length;i++){b=((b<<5)+b)+a.charCodeAt(i)}return b}});var h=[''];function isNotChained(a,b){if(a=='option'&&(b.length==0||(b.length==1&&typeof b[0]=='string'))){return true}return $.inArray(a,h)>-1}$.fn.realperson=function(a){var b=Array.prototype.slice.call(arguments,1);if(isNotChained(a,b)){return k['_'+a+'Plugin'].apply(k,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){if(!k['_'+a+'Plugin']){throw'Unknown command: '+a;}k['_'+a+'Plugin'].apply(k,[this].concat(b))}else{k._attachPlugin(this,a||{})}})};var k=$.realperson=new RealPerson();$(document).on('click','div.'+k.propertyName+'-challenge',function(){if(!$(this).hasClass(k.propertyName+'-disabled')){$(this).nextAll('.'+k.markerClassName).realperson('option',{})}})})(jQuery);
7/*  	
8$(function() {
9$("#defaultReal").realperson({dot: "●",regenerate:"下一個"});
10// $("#defaultReal").keypress(function(event) {if ($(this).val().length <5) {var key = event.which;if (key >= 97 && key <= 122) {event.preventDefault();$(this).val($(this).val() + String.fromCharCode(key - 32));}} else {$(this).val($(this).val());        }});
11$("#defaultReal").keyup(function(event) {$(this).val($(this).val().toUpperCase());});
12// $("#defaultReal").blur(function(event) {$(this).val($(this).val().toUpperCase());}); 
13var form = $('form[name=urlchk]') ; 
14form.submit(function () {
15$('span.alert').remove();
16value = $('#defaultReal').val() ;
17var hash = 4095;
18for (var i = 0; i < value.length; i++) {hash = ((hash << 5) + hash) + value.charCodeAt(i);}
19console.log(value);console.log(hash);
20if( hash == $('input[name=defaultRealHash]').val() ){ form.submit(); }
21else{ $('#defaultReal').css({"border-color":"red","border-style":"solid"}).after("<span class='alert' style=' color:red; '><b> 驗證碼錯誤 </b></span>"); return false;}
22});  
23});		*/

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.