<html lang="en" dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body {
color: #000;
font-family: Tahoma;
font-size: 11px;
}
textarea {
background: url("http://up.makuonline.ir/textra.png") repeat scroll 0 0 rgba(0, 0, 0, 0);
border: 1px dashed #000;
border-radius: 10px;
color: #000;
direction: ltr;
height: 150px;
margin-top: 15px;
max-width: 100%;
overflow-x: hidden;
overflow-y: auto;
padding: 7px;
resize: none;
width: 500px;
}
input {
background: none repeat scroll 0 0 #fff;
border: 2px solid #000000;
border-radius: 4px;
color: #000;
direction: ltr;
font-family: Tahoma;
font-size: 11px;
font-style: normal;
font-weight: 700;
max-width: 100%;
padding: 6px;
text-shadow: none;
}
select {
font-size: 16px;
width: 300px;
}
button {
background: none repeat scroll 0 0 #3abec0;
border: 1px solid #3abec0;
border-radius: 3px;
color: #000;
cursor: pointer;
font-family: tahoma;
margin-right: 5px;
margin-top: 10px;
padding: 5px;
}
button:hover {
background: none repeat scroll 0 0 #f81a3d;
border: 1px solid #3abec0;
border-radius: 3px;
color: #eee;
margin-right: 5px;
margin-top: 10px;
padding: 5px;
}
textarea:hover {
border: 1px dashed #3abec0;
border-radius: 10px;
box-shadow: 0 0 10px 1px #3abec0;
transition: all 0.1s ease 0s;
}
textarea:focus {
border: 1px dashed #3abec0;
border-radius: 10px;
box-shadow: 0 0 10px 1px #3abec0;
transition: all 0.1s ease 0s;
}
</style>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
<script type="text/javascript">
$( function() {
$( "#generate").click(
function() {
$( "#password").val( password_generator( $( "#length").val() ) );
}
);
$( "#clear" ).click(
function() {
$( "#password").val( "" );
}
);
$( "#letters").click(
function() {
setPasswordMode(
$( "#letters").is( ":checked" ),
$( "#numbers").is( ":checked" ),
$( "#punctuations").is( ":checked" )
);
}
)
$( "#numbers").click(
function() {
setPasswordMode(
$( "#letters").is( ":checked" ),
$( "#numbers").is( ":checked" ),
$( "#punctuations").is( ":checked" )
);
}
)
$( "#punctuations").click(
function() {
setPasswordMode(
$( "#letters").is( ":checked" ),
$( "#numbers").is( ":checked" ),
$( "#punctuations").is( ":checked" )
);
}
)
});
( function() {
var editor = null;
String.prototype.trim = function() {
return this.replace(/^\s+/g,'').replace(/\s+$/g,'');
}
$( function() {
var aceMode = ( typeof ace == "object" );
if ( aceMode ) {
if ( document.getElementById( "editor" ) ) {
var jsMode = window.location.href.indexOf( "javascript" ) > -1;
var jsonMode = window.location.href.indexOf( "json" ) > -1;
var xmlMode = window.location.href.indexOf( "xml" ) > -1;
var sqlMode = window.location.href.indexOf( "sql" ) > -1
var cssMode = window.location.href.indexOf( "css" ) > -1
editor = ace.edit("editor");
editor.setTheme("ace/theme/eclipse");
if ( jsMode ) {
editor.getSession().setMode("ace/mode/javascript");
} else
if ( jsonMode ) {
editor.getSession().setMode("ace/mode/json");
} else
if ( xmlMode ) {
editor.getSession().setMode("ace/mode/xml" );
} else
if ( sqlMode ) {
editor.getSession().setMode("ace/mode/sql" );
} else
if ( cssMode ) {
editor.getSession().setMode("ace/mode/css" );
}
window.getValue = function() {
return editor.getValue();
}
window.setValue = function( pText ) {
editor.setValue( pText );
}
editor.focus();
}
}
$( "#copy" ).zclip( {
path:'js/ZeroClipboard.swf',
copy: function() {
if ( $( ".result" ).length > 0 ) {
return $( ".result" ).val();
}
if ( aceMode ) {
return getValue();
}
return $( "textarea" ).val();
}
} );
$( "#menuButton" ).click(
function() {
if ( $( "#leftMenu" ).is( ":visible" ) ) {
$( "#leftMenu" ).hide();
} else
$( "#leftMenu" ).show();
$("a.jQueryBookmark").click(function(e){
e.preventDefault();
var bookmarkUrl = this.href;
var bookmarkTitle = this.title;
if (window.sidebar) {
window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
} else if( window.external || document.all) {
window.external.AddFavorite &&
window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
} else if(window.opera) {
$("a.jQueryBookmark").attr("href",bookmarkUrl);
$("a.jQueryBookmark").attr("title",bookmarkTitle);
$("a.jQueryBookmark").attr("rel","sidebar");
} else {
alert('Your browser does not support this bookmark action');
return false;
}
});
}
);
} );
var stringMode = true;
var numericMode = true;
var punctuationMode = true;
function setPasswordMode( pStringMode, pNumericMode, pPunctuationMode ) {
stringMode = pStringMode;
numericMode = pNumericMode;
punctuationMode = pPunctuationMode;
}
function password_generator( len ) {
var length = (len)?(len):(10);
var string = stringMode ? "abcdefghijklmnopqrstuvwxyz" : "";
var numeric = numericMode ? '0123456789' : "";
var punctuation = punctuationMode ? '!\"%&()*+,-./:;<=>?@[\]^_`{|.o}~‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–˜™š›œžŸ¡¢£¤¥¦§¨©ª,«¬®¯°±´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€~‰‡™•‘!$%Qº¸³©ª²¦ª¨£½¹º®°¢«µ-/‰€™' : "";
var password = "";
var character = "";
var crunch = true;
if ( !stringMode && !numericMode && !punctuationMode ) {
return "";
}
while( password.length<length ) {
var entity1 = Math.ceil(string.length * Math.random()*Math.random());
var entity2 = Math.ceil(numeric.length * Math.random()*Math.random());
var entity3 = Math.ceil(punctuation.length * Math.random()*Math.random());
hold = string.charAt( entity1 );
hold = (entity1%2==0)?(hold.toUpperCase()):(hold);
character += hold;
character += numeric.charAt( entity2 );
character += punctuation.charAt( entity3 );
password = character;
}
return password;
}
window.setPasswordMode = setPasswordMode;
window.password_generator = password_generator;
} )();
</script>
<script>
(function($){
var passwordStrength = new function()
{
this.countRegexp = function(val, rex)
{
var match = val.match(rex);
return match ? match.length : 0;
};
this.getStrength = function(val, minLength)
{
var len = val.length;
if (len < minLength)
{
return 0;
}
var nums = this.countRegexp(val, /\d/g),
lowers = this.countRegexp(val, /[a-z]/g),
uppers = this.countRegexp(val, /[A-Z]/g),
specials = len - nums - lowers - uppers;
if (nums == len || lowers == len || uppers == len || specials == len)
{
return 1;
}
var strength = 0;
if (nums) { strength+= 2; }
if (lowers) { strength+= uppers? 4 : 3; }
if (uppers) { strength+= lowers? 4 : 3; }
if (specials) { strength+= 5; }
if (len > 10) { strength+= 1; }
return strength;
};
this.getStrengthLevel = function(val, minLength)
{
var strength = this.getStrength(val, minLength);
val = 1;
if (strength <= 0) {
val = 1;
} else if (strength > 0 && strength <= 4) {
val = 2;
} else if (strength > 4 && strength <= 8) {
val = 3;
} else if (strength > 8 && strength <= 12) {
val = 4;
} else if (strength > 12) {
val = 5;
}
return val;
};
};
$.fn.password_strength = function(options)
{
var settings = $.extend({
'container' : null,
'bar': null,
'minLength' : 6,
'texts' : {
1 : 'خیلی ضعیف',
2 : 'ضعیف',
3 : 'معمولی',
4 : 'قوی',
5 : 'خیلی قوی'
},
'onCheck': null
}, options);
return this.each(function()
{
var container = null, $bar = null;
if (settings.container)
{
container = $(settings.container);
}
else
{
container = $('<span/>').attr('class', 'password_strength');
$(this).after(container);
}
if (settings.bar)
{
$bar = $(settings.bar);
}
$(this).bind('keyup.password_strength', function()
{
var val = $(this).val(),
level = passwordStrength.getStrengthLevel(val, settings.minLength);
if (val.length > 0)
{
var _class = 'password_strength_' + level,
_barClass = 'password_bar_' + level;
if (!container.hasClass(_class) && level in settings.texts)
{
container.text(settings.texts[level]).attr('class', 'password_strength ' + _class);
}
if ($bar && !$bar.hasClass(_barClass))
{
$bar.attr('class', 'password_bar ' + _barClass);
}
}
else
{
container.text('').attr('class', 'password_strength');
if ($bar) {
$bar.attr('class', 'password_bar');
}
}
if (settings.onCheck) {
settings.onCheck.call(this, level);
}
});
if ($(this).val() != '') {
$(this).trigger('keyup.password_strength');
}
});
};
})(jQuery);
$(function () {$('.passwd').password_strength();});
</script>
</head>
<body>
<div id="all">
<div id="body">
<div id="content" class="box">
<div class="body">
<center>
<form>
<label for="length">انتخاب کنید پسورد چند رقمی باشد</label><p> <input id="length" name="length" value="8" size="3">
</p>
<p><label for="letters">حروف</label>
<input id="letters" name="letters" checked="checked" type="checkbox">
</p>
<p><label for="numbers">اعداد</label>
<input id="numbers" name="numbers" checked="checked" type="checkbox">
</p>
<p><label for="punctuations">کاراکترها</label>
<input id="punctuations" name="punctuations" checked="checked" type="checkbox">
</p>
<p>
<button id="generate" value="Generate" type="button">ساخت پسورد</button>
<button id="clear" value="Clear" type="button">پاک کردن</button>
<button style="background:#E74C3C;cursor:default;">ماکو آنلاین</button>
</p>
<p><label for="password">پسورد ساخته شده</label></p>
<p> <input onclick="this.select()" value="E2}C7,h5&" id="password" name="password" class="result passwd" size="20">
</p>
</form>
</center>