Update generated bookmarklet
This commit is contained in:
parent
b1d12b1154
commit
df1cadc250
@ -20,7 +20,10 @@ b&&b<=e.to||c&&(!1!==(f=g(97,122,e.from,e.to))&&f.from<=b&&b<=f.to||!1!==(f=g(65
|
||||
p=function(a,b,c){var e,f,g,h;switch(a.type){case d.ROOT:case d.GROUP:if(a.notFollowedBy)return"";a.remember&&(e=b.push(!0)-1);f=a.options?a.options[Math.floor(Math.random()*a.options.length)]:a.stack;c="";g=0;for(h=f.length;g<h;g++)c+=p.call(this,f[g],b);return a.remember&&(b[e]=c),c;case d.POSITION:return"";case d.SET:e=!!c!==a.not;if(!e)return p.call(this,a.set[Math.floor(Math.random()*a.set.length)],b,e);for(;;)if(b=this.anyRandChar(),e=b.charCodeAt(0),!n(a.set,e,this.ignoreCase))return b;break;
|
||||
case d.RANGE:return a=a.from+Math.floor(Math.random()*(1+a.to-a.from)),String.fromCharCode(this.ignoreCase&&0.5<Math.random()?s(a):a);case d.REPETITION:e=a.min+Math.floor(Math.random()*(1+(Infinity===a.max?a.min+this.max:a.max)-a.min));c="";for(g=0;g<e;g++)c+=p.call(this,a.value,b);return c;case d.REFERENCE:return b[a.value-1];case d.CHAR:return String.fromCharCode(this.ignoreCase&&0.5<Math.random()?s(a.value):a.value)}},q=h.exports=function(b,c){if(b instanceof RegExp)this.ignoreCase=b.ignoreCase,
|
||||
this.multiline=b.multiline,"number"==typeof b.max&&(this.max=b.max),"function"==typeof b.anyRandChar&&(this.anyRandChar=b.anyRandChar),b=b.source;else{if("string"!=typeof b)throw Error("Expected a regexp or string");this.ignoreCase=c&&-1!==c.indexOf("i");this.multiline=c&&-1!==c.indexOf("m")}this.tokens=a(b)};q.prototype.max=100;q.prototype.anyRandChar=function(){return String.fromCharCode(0+Math.floor(65536*Math.random()))};q.prototype.gen=function(){return p.call(this,this.tokens,[])};var m=q.randexp=
|
||||
function(a,b){var c;return a._randexp===w?(c=new q(a,b),a._randexp=c):(c=a._randexp,"number"==typeof a.max&&(c.max=a.max),"function"==typeof a.anyRandChar&&(c.anyRandChar=a.anyRandChar)),c.gen()};q.sugar=function(){RegExp.prototype.gen=function(){return m(this)}}});!function(b,h){"function"==typeof define&&"object"==typeof define.amd?define(b,function(){return h}):"undefined"!=typeof window&&(window[b]=h)}("RandExp",b("/randexp.js"))})();;(function(m,q){var l={email:/[a-z0-9._+\-]{1,20}@[a-z0-9]{3,15}\.[a-z]{2,4}/i,url:/^(https?:\/\/)([a-z\.\-]+)\.([a-z\.]{2,6})\/?$/,sql:/[a-z0-9"'`\-]{5,17}/,text:/[\x20-\x7E]{10,15}/i,color:/^\#[0-9a-f]{6}$/i,tel:/[0-9+\-]{7,15}/,alphanumeric:/[A-Z][0-9]+/i,week:/(20|1[0-9])[0-9]{2}-W(5[1-2]|[1-4][0-9]|0[1-9])/,month:/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])/,datetime:/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])-(2[0-8]|1[0-9]|0[1-9])T(2[0-3]|[0-1][0-9]):[0-5][0-9]Z/,"datetime-local":/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])-(2[0-8]|1[0-9]|0[1-9])T(2[0-3]|[0-1][0-9]):[0-5][0-9]/,
|
||||
function(a,b){var c;return a._randexp===w?(c=new q(a,b),a._randexp=c):(c=a._randexp,"number"==typeof a.max&&(c.max=a.max),"function"==typeof a.anyRandChar&&(c.anyRandChar=a.anyRandChar)),c.gen()};q.sugar=function(){RegExp.prototype.gen=function(){return m(this)}}});!function(b,h){"function"==typeof define&&"object"==typeof define.amd?define(b,function(){return h}):"undefined"!=typeof window&&(window[b]=h)}("RandExp",b("/randexp.js"))})();;/*
|
||||
MIT
|
||||
*/
|
||||
(function(m,q){var l={email:/[a-z0-9._+\-]{1,20}@[a-z0-9]{3,15}\.[a-z]{2,4}/i,url:/^(https?:\/\/)([a-z\.\-]+)\.([a-z\.]{2,6})\/?$/,sql:/[a-z0-9"'`\-]{5,17}/,text:/[\x20-\x7E]{10,15}/,color:/^\#[0-9a-f]{6}$/i,tel:/[0-9+\-]{7,15}/,alphanumeric:/[A-Z][0-9]+/i,week:/(20|1[0-9])[0-9]{2}-W(5[1-2]|[1-4][0-9]|0[1-9])/,month:/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])/,datetime:/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])-(2[0-8]|1[0-9]|0[1-9])T(2[0-3]|[0-1][0-9]):[0-5][0-9]Z/,"datetime-local":/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])-(2[0-8]|1[0-9]|0[1-9])T(2[0-3]|[0-1][0-9]):[0-5][0-9]/,
|
||||
date:/(20|1[0-9])[0-9]{2}-(1[0-2]|0[1-9])-(2[0-8]|1[0-9]|0[1-9])/,time:/(2[0-3]|[0-1][0-9]):[0-5][0-9]/};Array.prototype.forEach||(Array.prototype.forEach=function(d,e){for(var b=0,c=this.length;b<c;++b)b in this&&d.call(e,this[b],b,this)});var r=function(d){var e=[],b=arguments.length,c="",a=1,g="",h={};a:for(c in d)for(a=1;a<b;a++){h=arguments[a];for(g in h)if(h[g]===d[c])continue a;e.push(d[c])}return e},s=function(d,e,b){e=e||1;b=b||0;d=Math.round((d||1E3)/e);return Math.ceil(Math.random()*d)*
|
||||
e-b},n=function(d,e){var b,c,a,g=d.querySelectorAll("input, select, textarea"),h=g.length;b=d.querySelectorAll("option");[].forEach.call(b,function(a){a.selected=!1});b=d.querySelectorAll("[checked]");[].forEach.call(b,function(a){a.checked=!1});for(b=0;b<h;b++)if(a=g[b],!a.hasAttribute("readonly")&&!a.hasAttribute("disabled"))if(a.hasAttribute("checked")&&(a.checked=!1),a.hasAttribute("pattern"))c=a.getAttribute("pattern"),a.value=(new m(c)).gen();else{if(!1===a.hasAttribute("type")&&"INPUT"!==a.nodeName)switch(a.nodeName){case "TEXTAREA":c=
|
||||
(new m(l.text)).gen();a.value=c;continue;case "SELECT":a=a.querySelectorAll("option");a[Math.floor(Math.random()*a.length)].selected=!0;continue;default:continue}c=a.getAttribute("type");var k,f={};switch(c){case "radio":null==f[a.name]&&(c=r(d.querySelectorAll("input[type=radio][name="+a.name+"]"),d.querySelectorAll("[name="+a.name+"][disabled]")),c[Math.floor(Math.random()*c.length)].checked=!0,f[a.name]=!0);continue;case "number":case "range":a.value=s(a.getAttribute("max"),a.getAttribute("step"),
|
||||
|
Loading…
Reference in New Issue
Block a user