Файл: password-punch/docs/tutorial.html
Строк: 195
<?php
<!DOCTYPE html>
<html><head>
<title>jQuery - Password Punch Examples</title>
<style>
.hljs {
background: #f8f8f8 none repeat scroll 0 0;
color: #333;
display: block;
overflow-x: auto;
padding: 0.5em;
}
.hljs-comment, .hljs-template_comment, .diff .hljs-header, .hljs-javadoc {
color: #998;
font-style: italic;
}
.hljs-keyword, .css .rule .hljs-keyword, .hljs-winutils, .javascript .hljs-title, .nginx .hljs-title, .hljs-subst, .hljs-request, .hljs-status {
color: #333;
font-weight: bold;
}
.hljs-number, .hljs-hexcolor, .ruby .hljs-constant {
color: #008080;
}
.hljs-string, .hljs-tag .hljs-value, .hljs-phpdoc, .hljs-dartdoc, .tex .hljs-formula {
color: #d14;
}
.hljs-title, .hljs-id, .scss .hljs-preprocessor {
color: #900;
font-weight: bold;
}
.javascript .hljs-title, .hljs-list .hljs-keyword, .hljs-subst {
font-weight: normal;
}
.hljs-class .hljs-title, .hljs-type, .vhdl .hljs-literal, .tex .hljs-command {
color: #458;
font-weight: bold;
}
.hljs-tag, .hljs-tag .hljs-title, .hljs-rules .hljs-property, .django .hljs-tag .hljs-keyword {
color: #000080;
font-weight: normal;
}
.hljs-attribute, .hljs-variable, .lisp .hljs-body {
color: #008080;
}
.hljs-regexp {
color: #009926;
}
.hljs-symbol, .ruby .hljs-symbol .hljs-string, .lisp .hljs-keyword, .clojure .hljs-keyword, .scheme .hljs-keyword, .tex .hljs-special, .hljs-prompt {
color: #990073;
}
.hljs-built_in {
color: #0086b3;
}
.hljs-preprocessor, .hljs-pragma, .hljs-pi, .hljs-doctype, .hljs-shebang, .hljs-cdata {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd none repeat scroll 0 0;
}
.hljs-addition {
background: #dfd none repeat scroll 0 0;
}
.diff .hljs-change {
background: #0086b3 none repeat scroll 0 0;
}
.hljs-chunk {
color: #aaa;
}
</style>
</head>
<body>
<div class="docs">
<div class="wrap">
<span class="wi wi801"></span>
<h1>Password Punch jQuery Plugin</h1>
<pre><code class="html hljs ">
<span class="hljs-tag"><<span class="hljs-title">head</span>></span>
<span class="hljs-comment"><!-- include password.punch.css --></span>
<span class="hljs-tag"><<span class="hljs-title">link</span> <span class="hljs-attribute">href</span>=<span class="hljs-value">"path/to/js/password-punch/password.punch.css"</span> <span class="hljs-attribute">rel</span>=<span class="hljs-value">"stylesheet"</span>></span>
<span class="hljs-tag"></<span class="hljs-title">script</span>></span>
<span class="hljs-tag"></<span class="hljs-title">head</span>></span>
<span class="hljs-tag"><<span class="hljs-title">body</span>></span>
<span class="hljs-tag"><<span class="hljs-title">input</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"password"</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">"password"</span>></span><span class="hljs-tag"></<span class="hljs-title">div</span>></span>
<span class="hljs-comment"><!-- have a target for where you want it shown --></span>
<span class="hljs-tag"><<span class="hljs-title">div</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">"password_rules_container"</span>></span><span class="hljs-tag"></<span class="hljs-title">div</span>></span>
<span class="hljs-comment"><!-- include a copy of jquery (if you haven't already) --></span>
<span class="hljs-tag"><<span class="hljs-title">script</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">"path/to/js/jquery.min.js"</span>></span><span class="javascript"></span><span class="hljs-tag"></<span class="hljs-title">script</span>></span>
<span class="hljs-comment"><!-- include passwordPunch jQuery plugin --></span>
<span class="hljs-tag"><<span class="hljs-title">script</span> <span class="hljs-attribute">src</span>=<span class="hljs-value">"path/to/js/password-punch/jquery.password.punch.js"</span>></span><span class="javascript"></span><span class="hljs-tag"></<span class="hljs-title">script</span>></span>
<span class="hljs-tag"><<span class="hljs-title">script</span> <span class="hljs-attribute">type</span>=<span class="hljs-value">"text/javascript"</span>></span><span class="javascript">
$(document).ready(function () {
$('#password').passwordPunch({
rules: {
uppercase: {label: 'Two Upper case characters', limit: 2}, /*Limit - Number of characters required | label: Text to display*/
lowercase: {label: 'One Lower case character', limit: 1},
number: {label: 'One number', limit: 1},
special_char: {label: 'One special chracter', limit: 1},
min_length: {label: '6 Characters', limit: 6}
},
onValidationCompleted: function () {
//fires once all the rules are validated
},
onValidationError function () {
//fires if rules are not validated
}
});
});
</span>
<span class="hljs-tag"></<span class="hljs-title">body</span>></span>
</code></pre>
</div>
</div>
</body>
</html>
?>