Skip to content

Commit abf5ee2

Browse files
committed
fixed jquery-validation plugin asset
1 parent ab6b9e5 commit abf5ee2

316 files changed

Lines changed: 114660 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[jQuery Validation Plugin](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) - Form validation made easy
2+
================================
3+
4+
[![Build Status](https://secure.travis-ci.org/jzaefferer/jquery-validation.png)](http://travis-ci.org/jzaefferer/jquery-validation)
5+
6+
The jQuery Validation Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy.
7+
8+
## [Help the project](http://pledgie.com/campaigns/18159)
9+
10+
[![Help the project](http://www.pledgie.com/campaigns/18159.png?skin_name=chrome)](http://pledgie.com/campaigns/18159)
11+
12+
This project is looking for help! [You can donate to the ongoing pledgie campaign](http://pledgie.com/campaigns/18159)
13+
and help spread the word. If you've used the plugin, or plan to use, consider a donation - any amount will help.
14+
15+
You can find the plan for how to spend the money on the [pledgie page](http://pledgie.com/campaigns/18159).
16+
17+
## Getting Started
18+
19+
Include jQuery and the plugin on a page. Then select a form to validate and call the `validate` method.
20+
21+
```html
22+
<form>
23+
<input required>
24+
</form>
25+
<script src="jquery.js"></script>
26+
<script src="jquery.validation.js"></script>
27+
<script>
28+
$("form").validate();
29+
</script>
30+
```
31+
32+
For more information on how to setup a rules and customizations, [check the documentation](http://docs.jquery.com/Plugins/Validation).
33+
34+
## Contributing
35+
Follow the [jQuery style guide](http://contribute.jquery.com/style-guides/js), even if existing code doesn't. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
36+
37+
If you've wrote custom methods that you'd like to contribute to additional-methods.js, create a branch, add the method there and send a pull request for that branch.
38+
39+
## License
40+
Copyright (c) 2013 Jörn Zaefferer
41+
Licensed under the MIT license.

dist/assets/lib/jquery-validation-1.11.1/changelog.txt

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
5+
<title>Test for jQuery validate() plugin</title>
6+
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
7+
<style type="text/css">
8+
.warning { color: red; }
9+
</style>
10+
<script src="../lib/jquery.js"></script>
11+
<script src="../lib/jquery.mockjax.js"></script>
12+
<script src="../lib/jquery.form.js"></script>
13+
<script src="../jquery.validate.js"></script>
14+
15+
<script type="text/javascript">
16+
jQuery(function() {
17+
$.mockjax({
18+
url: "login.action",
19+
response: function(settings) {
20+
var user = settings.data.match( /user=(.+?)($|&)/ )[ 1 ],
21+
password = settings.data.match( /password=(.+?)($|&)/ )[ 1 ];
22+
if ( password !== "foobar" ) {
23+
this.responseText = "Your password is wrong (must be foobar).";
24+
return;
25+
}
26+
this.responseText = "Hi " + user + ", welcome back.";
27+
},
28+
responseStatus: 200,
29+
responseTime: 500
30+
});
31+
32+
// show a simple loading indicator
33+
var loader = jQuery('<div id="loader"><img src="images/loading.gif" alt="loading..." /></div>')
34+
.css({position: "relative", top: "1em", left: "25em", display: "inline"})
35+
.appendTo("body")
36+
.hide();
37+
jQuery().ajaxStart(function() {
38+
loader.show();
39+
}).ajaxStop(function() {
40+
loader.hide();
41+
}).ajaxError(function(a, b, e) {
42+
throw e;
43+
});
44+
45+
var v = jQuery("#form").validate({
46+
submitHandler: function(form) {
47+
jQuery(form).ajaxSubmit({
48+
target: "#result"
49+
});
50+
}
51+
});
52+
53+
jQuery("#reset").click(function() {
54+
v.resetForm();
55+
});
56+
});
57+
</script>
58+
59+
</head>
60+
<body>
61+
62+
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
63+
<div id="main">
64+
65+
<form method="post" class="cmxform" id="form" action="login.action">
66+
<fieldset>
67+
<legend>Login Form (Enter "foobar" as password)</legend>
68+
<p>
69+
<label for="user">Username</label>
70+
<input id="user" name="user" title="Please enter your username (at least 3 characters)" class="required" minlength="3" />
71+
</p>
72+
<p>
73+
<label for="pass">Password</label>
74+
<input type="password" name="password" id="password" class="required" minlength"5" />
75+
</p>
76+
<p>
77+
<input class="submit" type="submit" value="Login"/>
78+
</p>
79+
</fieldset>
80+
</form>
81+
82+
<div id="result" class="warning">Please login!</div>
83+
84+
<br/>
85+
86+
<button id="reset">Programmatically reset above form!</button>
87+
88+
<a href="index.html">Back to main page</a>
89+
90+
</div>
91+
92+
93+
</body>
94+
</html>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$(function(){
2+
$("#refreshimg").click(function(){
3+
$.post('newsession.php');
4+
$("#captchaimage").load('image_req.php');
5+
return false;
6+
});
7+
8+
$("#captchaform").validate({
9+
rules: {
10+
captcha: {
11+
required: true,
12+
remote: "process.php"
13+
}
14+
},
15+
messages: {
16+
captcha: "Correct captcha is required. Click the captcha to generate a new one"
17+
},
18+
submitHandler: function() {
19+
alert("Correct captcha!");
20+
},
21+
success: function(label) {
22+
label.addClass("valid").text("Valid captcha!")
23+
},
24+
onkeyup: false
25+
});
26+
27+
});
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
// Echo the image - timestamp appended to prevent caching
4+
echo '<a href="index.php" onclick="refreshimg(); return false;" title="Click to refresh image"><img src="images/image.jpg?' . time() . '" width="132" height="46" alt="Captcha image" /></a>';
5+
6+
?>
1.51 KB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
// Begin the session
4+
session_start();
5+
6+
// If the session is not present, set the variable to an error message
7+
if(!isset($_SESSION['captcha_id']))
8+
$str = 'ERROR!';
9+
// Else if it is present, set the variable to the session contents
10+
else
11+
$str = $_SESSION['captcha_id'];
12+
13+
// Set the content type
14+
//header('Content-type: image/png');
15+
header('Cache-control: no-cache');
16+
17+
// Create an image from button.png
18+
$image = imagecreatefrompng('button.png');
19+
20+
// Set the font colour
21+
$colour = imagecolorallocate($image, 183, 178, 152);
22+
23+
// Set the font
24+
$font = '../fonts/Anorexia.ttf';
25+
26+
// Set a random integer for the rotation between -15 and 15 degrees
27+
$rotate = rand(-15, 15);
28+
29+
// Create an image using our original image and adding the detail
30+
imagettftext($image, 14, $rotate, 18, 30, $colour, $font, $str);
31+
32+
// Output the image as a png
33+
imagepng($image);
34+
35+
?>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
// Make the page validate
4+
ini_set('session.use_trans_sid', '0');
5+
6+
// Include the random string file
7+
require 'rand.php';
8+
9+
// Begin the session
10+
session_start();
11+
12+
// Set the session contents
13+
$_SESSION['captcha_id'] = $str;
14+
15+
?>
16+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
17+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
18+
19+
<head>
20+
<title>AJAX CAPTCHA</title>
21+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
22+
<meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" />
23+
<meta name="description" content="An AJAX CAPTCHA script, written in PHP" />
24+
25+
<script type="text/javascript" src="../../lib/jquery.js"></script>
26+
<script type="text/javascript" src="../../jquery.validate.js"></script>
27+
<script type="text/javascript" src="captcha.js"></script>
28+
29+
<link rel="stylesheet" type="text/css" href="style.css" />
30+
<style type="text/css">
31+
img { border: 1px solid #eee; }
32+
p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; }
33+
p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; }
34+
fieldset label { display: block; }
35+
fieldset div#captchaimage { float: left; margin-right: 15px; }
36+
fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; }
37+
fieldset input#submit { display: block; margin: 2% 0% 0% 0%; }
38+
#captcha.success {
39+
border: 1px solid #49c24f;
40+
background: #bcffbf;
41+
}
42+
#captcha.error {
43+
border: 1px solid #c24949;
44+
background: #ffbcbc;
45+
}
46+
</style>
47+
</head>
48+
49+
<body>
50+
51+
<h1><acronym title="Asynchronous JavaScript And XML">AJAX</acronym> <acronym title="Completely Automated Public Turing test to tell Computers and Humans Apart">CAPTCHA</acronym>, based on <a href="http://psyrens.com/captcha/">http://psyrens.com/captcha/</a></h1>
52+
53+
<form id="captchaform" action="">
54+
<fieldset>
55+
<div id="captchaimage"><a href="<?php echo $_SERVER['PHP_SELF']; ?>" id="refreshimg" title="Click to refresh image"><img src="images/image.php?<?php echo time(); ?>" width="132" height="46" alt="Captcha image" /></a></div>
56+
<label for="captcha">Enter the characters as seen on the image above (case insensitive):</label>
57+
<input type="text" maxlength="6" name="captcha" id="captcha" />
58+
<input type="submit" name="submit" id="submit" value="Check" />
59+
</fieldset>
60+
</form>
61+
62+
<p>If you can&#39;t decipher the text on the image, click it to dynamically generate a new one.</p>
63+
64+
</body>
65+
66+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
// Include the random string file
4+
require 'rand.php';
5+
6+
// Begin a new session
7+
session_start();
8+
9+
// Set the session contents
10+
$_SESSION['captcha_id'] = $str;
11+
12+
?>

0 commit comments

Comments
 (0)