Added jQuery Validation Plugin.
1
js/jquery-validate
Symbolic link
|
@ -0,0 +1 @@
|
|||
../vendors/jquery-validate
|
1
vendors/jquery-validate
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
/home/josh/Source/pickles/vendors/jquery-validate-1.7
|
259
vendors/jquery-validate-1.7/additional-methods.js
vendored
Normal file
|
@ -0,0 +1,259 @@
|
|||
(function() {
|
||||
|
||||
function stripHtml(value) {
|
||||
// remove html tags and space chars
|
||||
return value.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' ')
|
||||
// remove numbers and punctuation
|
||||
.replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,'');
|
||||
}
|
||||
jQuery.validator.addMethod("maxWords", function(value, element, params) {
|
||||
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length < params;
|
||||
}, jQuery.validator.format("Please enter {0} words or less."));
|
||||
|
||||
jQuery.validator.addMethod("minWords", function(value, element, params) {
|
||||
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params;
|
||||
}, jQuery.validator.format("Please enter at least {0} words."));
|
||||
|
||||
jQuery.validator.addMethod("rangeWords", function(value, element, params) {
|
||||
return this.optional(element) || stripHtml(value).match(/\b\w+\b/g).length >= params[0] && value.match(/bw+b/g).length < params[1];
|
||||
}, jQuery.validator.format("Please enter between {0} and {1} words."));
|
||||
|
||||
})();
|
||||
|
||||
jQuery.validator.addMethod("letterswithbasicpunc", function(value, element) {
|
||||
return this.optional(element) || /^[a-z-.,()'\"\s]+$/i.test(value);
|
||||
}, "Letters or punctuation only please");
|
||||
|
||||
jQuery.validator.addMethod("alphanumeric", function(value, element) {
|
||||
return this.optional(element) || /^\w+$/i.test(value);
|
||||
}, "Letters, numbers, spaces or underscores only please");
|
||||
|
||||
jQuery.validator.addMethod("lettersonly", function(value, element) {
|
||||
return this.optional(element) || /^[a-z]+$/i.test(value);
|
||||
}, "Letters only please");
|
||||
|
||||
jQuery.validator.addMethod("nowhitespace", function(value, element) {
|
||||
return this.optional(element) || /^\S+$/i.test(value);
|
||||
}, "No white space please");
|
||||
|
||||
jQuery.validator.addMethod("ziprange", function(value, element) {
|
||||
return this.optional(element) || /^90[2-5]\d\{2}-\d{4}$/.test(value);
|
||||
}, "Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");
|
||||
|
||||
jQuery.validator.addMethod("integer", function(value, element) {
|
||||
return this.optional(element) || /^-?\d+$/.test(value);
|
||||
}, "A positive or negative non-decimal number please");
|
||||
|
||||
/**
|
||||
* Return true, if the value is a valid vehicle identification number (VIN).
|
||||
*
|
||||
* Works with all kind of text inputs.
|
||||
*
|
||||
* @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" />
|
||||
* @desc Declares a required input element whose value must be a valid vehicle identification number.
|
||||
*
|
||||
* @name jQuery.validator.methods.vinUS
|
||||
* @type Boolean
|
||||
* @cat Plugins/Validate/Methods
|
||||
*/
|
||||
jQuery.validator.addMethod(
|
||||
"vinUS",
|
||||
function(v){
|
||||
if (v.length != 17)
|
||||
return false;
|
||||
var i, n, d, f, cd, cdv;
|
||||
var LL = ["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"];
|
||||
var VL = [1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9];
|
||||
var FL = [8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];
|
||||
var rs = 0;
|
||||
for(i = 0; i < 17; i++){
|
||||
f = FL[i];
|
||||
d = v.slice(i,i+1);
|
||||
if(i == 8){
|
||||
cdv = d;
|
||||
}
|
||||
if(!isNaN(d)){
|
||||
d *= f;
|
||||
}
|
||||
else{
|
||||
for(n = 0; n < LL.length; n++){
|
||||
if(d.toUpperCase() === LL[n]){
|
||||
d = VL[n];
|
||||
d *= f;
|
||||
if(isNaN(cdv) && n == 8){
|
||||
cdv = LL[n];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
rs += d;
|
||||
}
|
||||
cd = rs % 11;
|
||||
if(cd == 10){cd = "X";}
|
||||
if(cd == cdv){return true;}
|
||||
return false;
|
||||
},
|
||||
"The specified vehicle identification number (VIN) is invalid."
|
||||
);
|
||||
|
||||
/**
|
||||
* Return true, if the value is a valid date, also making this formal check dd/mm/yyyy.
|
||||
*
|
||||
* @example jQuery.validator.methods.date("01/01/1900")
|
||||
* @result true
|
||||
*
|
||||
* @example jQuery.validator.methods.date("01/13/1990")
|
||||
* @result false
|
||||
*
|
||||
* @example jQuery.validator.methods.date("01.01.1900")
|
||||
* @result false
|
||||
*
|
||||
* @example <input name="pippo" class="{dateITA:true}" />
|
||||
* @desc Declares an optional input element whose value must be a valid date.
|
||||
*
|
||||
* @name jQuery.validator.methods.dateITA
|
||||
* @type Boolean
|
||||
* @cat Plugins/Validate/Methods
|
||||
*/
|
||||
jQuery.validator.addMethod(
|
||||
"dateITA",
|
||||
function(value, element) {
|
||||
var check = false;
|
||||
var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
|
||||
if( re.test(value)){
|
||||
var adata = value.split('/');
|
||||
var gg = parseInt(adata[0],10);
|
||||
var mm = parseInt(adata[1],10);
|
||||
var aaaa = parseInt(adata[2],10);
|
||||
var xdata = new Date(aaaa,mm-1,gg);
|
||||
if ( ( xdata.getFullYear() == aaaa ) && ( xdata.getMonth () == mm - 1 ) && ( xdata.getDate() == gg ) )
|
||||
check = true;
|
||||
else
|
||||
check = false;
|
||||
} else
|
||||
check = false;
|
||||
return this.optional(element) || check;
|
||||
},
|
||||
"Please enter a correct date"
|
||||
);
|
||||
|
||||
jQuery.validator.addMethod("dateNL", function(value, element) {
|
||||
return this.optional(element) || /^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(value);
|
||||
}, "Vul hier een geldige datum in."
|
||||
);
|
||||
|
||||
jQuery.validator.addMethod("time", function(value, element) {
|
||||
return this.optional(element) || /^([01][0-9])|(2[0123]):([0-5])([0-9])$/.test(value);
|
||||
}, "Please enter a valid time, between 00:00 and 23:59"
|
||||
);
|
||||
|
||||
/**
|
||||
* matches US phone number format
|
||||
*
|
||||
* where the area code may not start with 1 and the prefix may not start with 1
|
||||
* allows '-' or ' ' as a separator and allows parens around area code
|
||||
* some people may want to put a '1' in front of their number
|
||||
*
|
||||
* 1(212)-999-2345
|
||||
* or
|
||||
* 212 999 2344
|
||||
* or
|
||||
* 212-999-0983
|
||||
*
|
||||
* but not
|
||||
* 111-123-5434
|
||||
* and not
|
||||
* 212 123 4567
|
||||
*/
|
||||
jQuery.validator.addMethod("phoneUS", function(phone_number, element) {
|
||||
phone_number = phone_number.replace(/\s+/g, "");
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
|
||||
}, "Please specify a valid phone number");
|
||||
|
||||
jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
|
||||
}, 'Please specify a valid phone number');
|
||||
|
||||
jQuery.validator.addMethod('mobileUK', function(phone_number, element) {
|
||||
return this.optional(element) || phone_number.length > 9 &&
|
||||
phone_number.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/);
|
||||
}, 'Please specify a valid mobile number');
|
||||
|
||||
// TODO check if value starts with <, otherwise don't try stripping anything
|
||||
jQuery.validator.addMethod("strippedminlength", function(value, element, param) {
|
||||
return jQuery(value).text().length >= param;
|
||||
}, jQuery.validator.format("Please enter at least {0} characters"));
|
||||
|
||||
// same as email, but TLD is optional
|
||||
jQuery.validator.addMethod("email2", function(value, element, param) {
|
||||
return this.optional(element) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
|
||||
}, jQuery.validator.messages.email);
|
||||
|
||||
// same as url, but TLD is optional
|
||||
jQuery.validator.addMethod("url2", function(value, element, param) {
|
||||
return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
|
||||
}, jQuery.validator.messages.url);
|
||||
|
||||
// NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator
|
||||
// Redistributed under the the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings)
|
||||
jQuery.validator.addMethod("creditcardtypes", function(value, element, param) {
|
||||
|
||||
if (/[^0-9-]+/.test(value))
|
||||
return false;
|
||||
|
||||
value = value.replace(/\D/g, "");
|
||||
|
||||
var validTypes = 0x0000;
|
||||
|
||||
if (param.mastercard)
|
||||
validTypes |= 0x0001;
|
||||
if (param.visa)
|
||||
validTypes |= 0x0002;
|
||||
if (param.amex)
|
||||
validTypes |= 0x0004;
|
||||
if (param.dinersclub)
|
||||
validTypes |= 0x0008;
|
||||
if (param.enroute)
|
||||
validTypes |= 0x0010;
|
||||
if (param.discover)
|
||||
validTypes |= 0x0020;
|
||||
if (param.jcb)
|
||||
validTypes |= 0x0040;
|
||||
if (param.unknown)
|
||||
validTypes |= 0x0080;
|
||||
if (param.all)
|
||||
validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080;
|
||||
|
||||
if (validTypes & 0x0001 && /^(51|52|53|54|55)/.test(value)) { //mastercard
|
||||
return value.length == 16;
|
||||
}
|
||||
if (validTypes & 0x0002 && /^(4)/.test(value)) { //visa
|
||||
return value.length == 16;
|
||||
}
|
||||
if (validTypes & 0x0004 && /^(34|37)/.test(value)) { //amex
|
||||
return value.length == 15;
|
||||
}
|
||||
if (validTypes & 0x0008 && /^(300|301|302|303|304|305|36|38)/.test(value)) { //dinersclub
|
||||
return value.length == 14;
|
||||
}
|
||||
if (validTypes & 0x0010 && /^(2014|2149)/.test(value)) { //enroute
|
||||
return value.length == 15;
|
||||
}
|
||||
if (validTypes & 0x0020 && /^(6011)/.test(value)) { //discover
|
||||
return value.length == 16;
|
||||
}
|
||||
if (validTypes & 0x0040 && /^(3)/.test(value)) { //jcb
|
||||
return value.length == 16;
|
||||
}
|
||||
if (validTypes & 0x0040 && /^(2131|1800)/.test(value)) { //jcb
|
||||
return value.length == 15;
|
||||
}
|
||||
if (validTypes & 0x0080) { //unknown
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}, "Please enter a valid credit card number.");
|
239
vendors/jquery-validate-1.7/changelog.txt
vendored
Normal file
|
@ -0,0 +1,239 @@
|
|||
1.7
|
||||
---
|
||||
* Added Lithuanian (LT) localization
|
||||
* Added Greek (EL) localization (http://plugins.jquery.com/node/12319)
|
||||
* Added Latvian (LV) localization (http://plugins.jquery.com/node/12349)
|
||||
* Added Hebrew (HE) localization (http://plugins.jquery.com/node/12039)
|
||||
* Fixed Spanish (ES) localization (http://plugins.jquery.com/node/12696)
|
||||
* Added jQuery UI themerolled demo
|
||||
* Removed cmxform.js
|
||||
* Fixed four missing semicolons (http://plugins.jquery.com/node/12639)
|
||||
* Renamed phone-method in additional-methods.js to phoneUS
|
||||
* Added phoneUK and mobileUK methods to additional-methods.js (http://plugins.jquery.com/node/12359)
|
||||
* Deep extend options to avoid modifying multiple forms when using the rules-method on a single element (http://plugins.jquery.com/node/12411)
|
||||
* Bugfixes for compability with jQuery 1.4.2, while maintaining backwards-compability
|
||||
|
||||
1.6
|
||||
---
|
||||
* Added Arabic (AR), Portuguese (PTPT), Persian (FA), Finnish (FI) and Bulgarian (BR) localization
|
||||
* Updated Swedish (SE) localization (some missing html iso characters)
|
||||
* Fixed $.validator.addMethod to properly handle empty string vs. undefined for the message argument
|
||||
* Fixed two accidental global variables
|
||||
* Enhanced min/max/rangeWords (in additional-methods.js) to strip html before counting; good when counting words in a richtext editor
|
||||
* Added localized methods for DE, NL and PT, removing the dateDE and numberDE methods (use messages_de.js and methods_de.js with date and number methods instead)
|
||||
* Fixed remote form submit synchronization, kudos to Matas Petrikas
|
||||
* Improved interactive select validation, now validating also on click (via option or select, inconsistent across browsers); doesn't work in Safari, which doesn't trigger a click event at all on select elements; fixes http://plugins.jquery.com/node/11520
|
||||
* Updated to latest form plugin (2.36), fixing http://plugins.jquery.com/node/11487
|
||||
* Bind to blur event for equalTo target to revalidate when that target changes, fixes http://plugins.jquery.com/node/11450
|
||||
* Simplified select validation, delegating to jQuery's val() method to get the select value; should fix http://plugins.jquery.com/node/11239
|
||||
* Fixed default message for digits (http://plugins.jquery.com/node/9853)
|
||||
* Fixed issue with cached remote message (http://plugins.jquery.com/node/11029 and http://plugins.jquery.com/node/9351)
|
||||
* Fixed a missing semicolon in additional-methods.js (http://plugins.jquery.com/node/9233)
|
||||
* Added automatic detection of substitution parameters in messages, removing the need to provide format functions (http://plugins.jquery.com/node/11195)
|
||||
* Fixed an issue with :filled/:blank somewhat caused by Sizzle (http://plugins.jquery.com/node/11144)
|
||||
* Added an integer method to additional-methods.js (http://plugins.jquery.com/node/9612)
|
||||
* Fixed errorsFor method where the for-attribute contains characters that need escaping to be valid inside a selector (http://plugins.jquery.com/node/9611)
|
||||
|
||||
1.5.5
|
||||
---
|
||||
* Fix for http://plugins.jquery.com/node/8659
|
||||
* Fixed trailing comma in messages_cs.js
|
||||
|
||||
1.5.4
|
||||
---
|
||||
* Fixed remote method bug (http://plugins.jquery.com/node/8658)
|
||||
|
||||
1.5.3
|
||||
---
|
||||
* Fixed a bug related to the wrapper-option, where all ancestor-elements that matched the wrapper-option where selected (http://plugins.jquery.com/node/7624)
|
||||
* Updated multipart demo to use latest jQuery UI accordion
|
||||
* Added dateNL and time methods to additionalMethods.js
|
||||
* Added Traditional Chinese (Taiwan, tw) and Kazakhstan (KK) localization
|
||||
* Moved jQuery.format (fomerly String.format) to jQuery.validator.format, jQuery.format is deprecated and will be removed in 1.6 (see http://code.google.com/p/jquery-utils/issues/detail?id=15 for details)
|
||||
* Cleaned up messages_pl.js and messages_ptbr.js (still defined messages for max/min/rangeValue, which were removed in 1.4)
|
||||
* Fixed flawed boolean logic in valid-plugin-method for multiple elements; now all elements need to be valid for a boolean-true result (http://plugins.jquery.com/node/8481)
|
||||
* Enhancement $.validator.addMethod: An undefined third message-argument won't overwrite an existing message (http://plugins.jquery.com/node/8443)
|
||||
* Enhancement to submitHandler option: When used, click events on submit buttons are captured and the submitting button is inserted into the form before calling submitHandler, and removed afterwards; keeps submit buttons intact (http://plugins.jquery.com/node/7183#comment-3585)
|
||||
* Added option validClass, default "valid", which adds that class to all valid elements, after validation (http://dev.jquery.com/ticket/2205)
|
||||
* Added creditcardtypes method to additionalMethods.js, including tests (via http://dev.jquery.com/ticket/3635)
|
||||
* Improved remote method to allow serverside message as a string, or true for valid, or false for invalid using the clientside defined message (http://dev.jquery.com/ticket/3807)
|
||||
* Improved accept method to also accept a Drupal-style comma-seperated list of values (http://plugins.jquery.com/node/8580)
|
||||
|
||||
1.5.2
|
||||
---
|
||||
* Fixed messages in additional-methods.js for maxWords, minWords, and rangeWords to include call to $.format
|
||||
* Fixed value passed to methods to exclude carriage return (\r), same as jQuery's val() does
|
||||
* Added slovak (sk) localization
|
||||
* Added demo for intergration with jQuery UI tabs
|
||||
* Added selects-grouping example to tabs demo (see second tab, birthdate field)
|
||||
|
||||
1.5.1
|
||||
---
|
||||
* Updated marketo demo to use invalidHandler option instead of binding invalid-form event
|
||||
* Added TinyMCE integration example
|
||||
* Added ukrainian (ua) localization
|
||||
* Fixed length validation to work with trimmed value (regression from 1.5 where general trimming before validation was removed)
|
||||
* Various small fixes for compability with both 1.2.6 and 1.3
|
||||
|
||||
1.5
|
||||
---
|
||||
* Improved basic demo, validating confirm-password field after password changed
|
||||
* Fixed basic validation to pass the untrimmed input value as the first parameter to validation methods, changed required accordingly; breaks existing custom method that rely on the trimming
|
||||
* Added norwegian (no), italian (it), hungarian (hu) and romanian (ro) localization
|
||||
* Fixed #3195: Two flaws in swedish localization
|
||||
* Fixed #3503: Extended rules("add") to accept messages propery: use to specify add custom messages to an element via rules("add", { messages: { required: "Required! " } });
|
||||
* Fixed #3356: Regression from #2908 when using meta-option
|
||||
* Fixed #3370: Added ignoreTitle option, set to skip reading messages from the title attribute, helps to avoid issues with Google Toolbar; default is false for compability
|
||||
* Fixed #3516: Trigger invalid-form event even when remote validation is involved
|
||||
* Added invalidHandler option as a shortcut to bind("invalid-form", function() {})
|
||||
* Fixed Safari issue for loading indicator in ajaxSubmit-integration-demo (append to body first, then hide)
|
||||
* Added test for creditcard validation and improved default message
|
||||
* Enhanced remote validation, accepting options to passthrough to $.ajax as paramter (either url string or options, including url property plus everything else that $.ajax supports)
|
||||
|
||||
1.4
|
||||
---
|
||||
* Fixed #2931, validate elements in document order and ignore type=image inputs
|
||||
* Fixed usage of $ and jQuery variables, now fully comptible with all variations of noConflict usage
|
||||
* Implemented #2908, enabling custom messages via metadata ala class="{required:true,messages:{required:'required field'}}", added demo/custom-messages-metadata-demo.html
|
||||
* Removed deprecated methods minValue (min), maxValue (max), rangeValue (rangevalue), minLength (minlength), maxLength (maxlength), rangeLength (rangelength)
|
||||
* Fixed #2215 regression: Call unhighlight only for current elements, not everything
|
||||
* Implemented #2989, enabling image button to cancel validation
|
||||
* Fixed issue where IE incorrectly validates against maxlength=0
|
||||
* Added czech (cs) localization
|
||||
* Reset validator.submitted on validator.resetForm(), enabling a full reset when necessary
|
||||
* Fixed #3035, skipping all falsy attributes when reading rules (0, undefined, empty string), removed part of the maxlength workaround (for 0)
|
||||
* Added dutch (nl) localization (#3201)
|
||||
|
||||
1.3
|
||||
---
|
||||
* Fixed invalid-form event, now only triggered when form is invalid
|
||||
* Added spanish (es), russian (ru), portuguese brazilian (ptbr), turkish (tr), and polish (pl) localization
|
||||
* Added removeAttrs plugin to facilate adding and removing multiple attributes
|
||||
* Added groups option to display a single message for multiple elements, via groups: { arbitraryGroupName: "fieldName1 fieldName2[, fieldNameN" }
|
||||
* Enhanced rules() for adding and removing (static) rules: rules("add", "method1[, methodN]"/{method1:param[, method_n:param]}) and rules("remove"[, "method1[, method_n]")
|
||||
* Enhanced rules-option, accepts space-seperated string-list of methods, eg. {birthdate: "required date"}
|
||||
* Fixed checkbox group validation with inline rules: As long as the rules are specified on the first element, the group is now properly validated on click
|
||||
* Fixed #2473, ignoring all rules with an explicit parameter of boolean-false, eg. required:false is the same as not specifying required at all (it was handled as required:true so far)
|
||||
* Fixed #2424, with a modified patch from #2473: Methods returning a dependency-mismatch don't stop other rules from being evaluated anymore; still, success isn't applied for optional fields
|
||||
* Fixed url and email validation to not use trimmed values
|
||||
* Fixed creditcard validation to accept only digits and dashes ("asdf" is not a valid creditcard number)
|
||||
* Allow both button and input elements for cancel buttons (via class="cancel")
|
||||
* Fixed #2215: Fixed message display to call unhighlight as part of showing and hiding messages, no more visual side-effects while checking an element and extracted validator.checkForm to validate a form without UI sideeffects
|
||||
* Rewrote custom selectors (:blank, :filled, :unchecked) with functions for compability with AIR
|
||||
|
||||
1.2.1
|
||||
-----
|
||||
|
||||
* Bundled delegeate plugin with validate plugin - its always required anyway
|
||||
* Improved remote validation to include parts from the ajaxQueue plugin for proper synchronization (no additional plugin necessary)
|
||||
* Fixed stopRequest to prevent pendingRequest < 0
|
||||
* Added jQuery.validator.autoCreateRanges property, defaults to false, enable to convert min/max to range and minlength/maxlength to rangelength; this basically fixes the issue introduced by automatically creating ranges in 1.2
|
||||
* Fixed optional-methods to not highlight anything at all if the field is blank, that is, don't trigger success
|
||||
* Allow false/null for highlight/unhighlight options instead of forcing a do-nothing-callback even when nothing needs to be highlighted
|
||||
* Fixed validate() call with no elements selected, returning undefined instead of throwing an error
|
||||
* Improved demo, replacing metadata with classes/attributes for specifying rules
|
||||
* Fixed error when no custom message is used for remote validation
|
||||
* Modified email and url validation to require domain label and top label
|
||||
* Fixed url and email validation to require TLD (actually to require domain label); 1.2 version (TLD is optional) is moved to additionals as url2 and email2
|
||||
* Fixed dynamic-totals demo in IE6/7 and improved templating, using textarea to store multiline template and string interpolation
|
||||
* Added login form example with "Email password" link that makes the password field optional
|
||||
* Enhanced dynamic-totals demo with an example of a single message for two fields
|
||||
|
||||
1.2
|
||||
---
|
||||
|
||||
* Added AJAX-captcha validation example (based on http://psyrens.com/captcha/)
|
||||
* Added remember-the-milk-demo (thanks RTM team for the permission!)
|
||||
* Added marketo-demo (thanks Glen Lipka!)
|
||||
* Added support for ajax-validation, see method "remote"; serverside returns JSON, true for valid elements, false or a String for invalid, String is used as message
|
||||
* Added highlight and unhighlight options, by default toggles errorClass on element, allows custom highlighting
|
||||
* Added valid() plugin method for easy programmatic checking of forms and fields without the need to use the validator API
|
||||
* Added rules() plguin method to read and write rules for an element (currently read only)
|
||||
* Replaced regex for email method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/email_address_validation/
|
||||
* Restructured event architecture to rely solely on delegation, both improving performance, and ease-of-use for the developer (requires jquery.delegate.js)
|
||||
* Moved documentation from inline to http://docs.jquery.com/Plugins/Validation - including interactive examples for all methods
|
||||
* Removed validator.refresh(), validation is now completey dynamic
|
||||
* Renamed minValue to min, maxValue to max and rangeValue to range, deprecating the previous names (to be removed in 1.3)
|
||||
* Renamed minLength to minlength, maxLength to maxlength and rangeLength to rangelength, deprecating the previous names (to be removed in 1.3)
|
||||
* Added feature to merge min + max into and range and minlength + maxlength into rangelength
|
||||
* Added support for dynamic rule parameters, allowing to specify a function as a parameter eg. for minlength, called when validating the element
|
||||
* Allow to specify null or an empty string as a message to display nothing (see marketo demo)
|
||||
* Rules overhaul: Now supports combination of rules-option, metadata, classes (new) and attributes (new), see rules() for details
|
||||
|
||||
1.1.2
|
||||
---
|
||||
|
||||
* Replaced regex for URL method, thanks to the contribution by Scott Gonzalez, see http://projects.scottsplayground.com/iri/
|
||||
* Improved email method to better handle unicode characters
|
||||
* Fixed error container to hide when all elements are valid, not only on form submit
|
||||
* Fixed String.format to jQuery.format (moving into jQuery namespace)
|
||||
* Fixed accept method to accept both upper and lowercase extensions
|
||||
* Fixed validate() plugin method to create only one validator instance for a given form and always return that one instance (avoids binding events multiple times)
|
||||
* Changed debug-mode console log from "error" to "warn" level
|
||||
|
||||
1.1.1
|
||||
-----
|
||||
|
||||
* Fixed invalid XHTML, preventing error label creation in IE since jQuery 1.1.4
|
||||
* Fixed and improved String.format: Global search & replace, better handling of array arguments
|
||||
* Fixed cancel-button handling to use validator-object for storing state instead of form element
|
||||
* Fixed name selectors to handle "complex" names, eg. containing brackets ("list[]")
|
||||
* Added button and disabled elements to exclude from validation
|
||||
* Moved element event handlers to refresh to be able to add handlers to new elements
|
||||
* Fixed email validation to allow long top level domains (eg. ".travel")
|
||||
* Moved showErrors() from valid() to form()
|
||||
* Added validator.size(): returns the number of current errors
|
||||
* Call submitHandler with validator as scope for easier access of it's methods, eg. to find error labels using errorsFor(Element)
|
||||
* Compatible with jQuery 1.1.x and 1.2.x
|
||||
|
||||
1.1
|
||||
---
|
||||
|
||||
* Added validation on blur, keyup and click (for checkboxes and radiobutton). Replaces event-option.
|
||||
* Fixed resetForm
|
||||
* Fixed custom-methods-demo
|
||||
|
||||
1.0
|
||||
---
|
||||
|
||||
* Improved number and numberDE methods to check for correct decimal numbers with delimiters
|
||||
* Only elements that have rules are checked (otherwise success-option is applied to all elements)
|
||||
* Added creditcard number method (thanks to Brian Klug)
|
||||
* Added ignore-option, eg. ignore: "[@type=hidden]", using that expression to exclude elements to validate. Default: none, though submit and reset buttons are always ignored
|
||||
* Heavily enhanced Functions-as-messages by providing a flexible String.format helper
|
||||
* Accept Functions as messages, providing runtime-custom-messages
|
||||
* Fixed exclusion of elements without rules from successList
|
||||
* Fixed custom-method-demo, replaced the alert with message displaying the number of errors
|
||||
* Fixed form-submit-prevention when using submitHandler
|
||||
* Completely removed dependency on element IDs, though they are still used (when present) to link error labels to inputs. Achieved by using
|
||||
an array with {name, message, element} instead of an object with id:message pairs for the internal errorList.
|
||||
* Added support for specifying simple rules as simple strings, eg. "required" is equivalent to {required: true}
|
||||
* Added feature: Add errorClass to invalid field<6C>s parent element, making it easy to style the label/field container or the label for the field.
|
||||
* Added feature: focusCleanup - If enabled, removes the errorClass from the invalid elements and hides all errors messages whenever the element is focused.
|
||||
* Added success option to show the a field was validated successfully
|
||||
* Fixed Opera select-issue (avoiding a attribute-collision)
|
||||
* Fixed problems with focussing hidden elements in IE
|
||||
* Added feature to skip validation for submit buttons with class "cancel"
|
||||
* Fixed potential issues with Google Toolbar by prefering plugin option messages over title attribute
|
||||
* submitHandler is only called when an actual submit event was handled, validator.form() returns false only for invalid forms
|
||||
* Invalid elements are now focused only on submit or via validator.focusInvalid(), avoiding all trouble with focus-on-blur
|
||||
* IE6 error container layout issue is solved
|
||||
* Customize error element via errorElement option
|
||||
* Added validator.refresh() to find new inputs in the form
|
||||
* Added accept validation method, checks file extensions
|
||||
* Improved dependecy feature by adding two custom expressions: ":blank" to select elements with an empty value and <20>:filled<65> to select elements with a value, both excluding whitespace
|
||||
* Added a resetForm() method to the validator: Resets each form element (using the form plugin, if available), removes classes on invalid elements and hides all error messages
|
||||
* Fixed docs for validator.showErrors()
|
||||
* Fixed error label creation to always use html() instead of text(), allowing arbitrary HTML passed in as messages
|
||||
* Fixed error label creation to use specified error class
|
||||
* Added dependency feature: The requires method accepts both String (jQuery expressions) and Functions as the argument
|
||||
* Heavily improved customizing of error message display: Use normal messages and show/hide an additional container; Completely replace message display with own mechanism (while being able to delegate to the default handler; Customize placing of generated labels (instead of default below-element)
|
||||
* Fixed two major bugs in IE (error containers) and Opera (metadata)
|
||||
* Modified validation methods to accept empty fields as valid (exception: of course <20>required<65> and also <20>equalTo<54> methods)
|
||||
* Renamed "min" to "minLength", "max" to "maxLength", "length" to "rangeLength"
|
||||
* Added "minValue", "maxValue" and "rangeValue"
|
||||
* Streamlined API for support of different events. The default, submit, can be disabled. If any event is specified, that is applied to each element (instead of the entire form). Combining keyup-validation with submit-validation is now extremely easy to setup
|
||||
* Added support for one-message-per-rule when defining messages via plugin settings
|
||||
* Added support to wrap metadata in some parent element. Useful when metadata is used for other plugins, too.
|
||||
* Refactored tests and demos: Less files, better demos
|
||||
* Improved documentation: More examples for methods, more reference texts explaining some basics
|
85
vendors/jquery-validate-1.7/demo/ajaxSubmit-intergration-demo.html
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>Test for jQuery validate() plugin</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
<style type="text/css">
|
||||
.warning { color: red; }
|
||||
</style>
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../lib/jquery.form.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function() {
|
||||
// show a simple loading indicator
|
||||
var loader = jQuery('<div id="loader"><img src="images/loading.gif" alt="loading..." /></div>')
|
||||
.css({position: "relative", top: "1em", left: "25em"})
|
||||
.appendTo("body")
|
||||
.hide();
|
||||
jQuery().ajaxStart(function() {
|
||||
loader.show();
|
||||
}).ajaxStop(function() {
|
||||
loader.hide();
|
||||
}).ajaxError(function(a, b, e) {
|
||||
throw e;
|
||||
});
|
||||
|
||||
var v = jQuery("#form").validate({
|
||||
submitHandler: function(form) {
|
||||
jQuery(form).ajaxSubmit({
|
||||
target: "#result"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jQuery("#reset").click(function() {
|
||||
v.resetForm();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<form method="post" class="cmxform" id="form" action="form.php">
|
||||
<fieldset>
|
||||
<legend>Login Form (Enter "foobar" as password)</legend>
|
||||
<p>
|
||||
<label for="user">Username</label>
|
||||
<input id="user" name="user" title="Please enter your username (at least 3 characters)" class="required" minlength="3" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="pass">Password</label>
|
||||
<input type="password" name="password" id="password" class="required" minlength"5" />
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Login"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<div id="result">Please login!</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<button id="reset">Programmatically reset above form!</button>
|
||||
|
||||
<p>Backend file: <a href="form.phps">form.phps</a></p>
|
||||
|
||||
<a href="index.html">Back to main page</a>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
27
vendors/jquery-validate-1.7/demo/captcha/captcha.js
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
$(function(){
|
||||
$("#refreshimg").click(function(){
|
||||
$.post('newsession.php');
|
||||
$("#captchaimage").load('image_req.php');
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#captchaform").validate({
|
||||
rules: {
|
||||
captcha: {
|
||||
required: true,
|
||||
remote: "process.php"
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
captcha: "Correct captcha is required. Click the captcha to generate a new one"
|
||||
},
|
||||
submitHandler: function() {
|
||||
alert("Correct captcha!");
|
||||
},
|
||||
success: function(label) {
|
||||
label.addClass("valid").text("Valid captcha!")
|
||||
},
|
||||
onkeyup: false
|
||||
});
|
||||
|
||||
});
|
BIN
vendors/jquery-validate-1.7/demo/captcha/fonts/Anorexia.ttf
vendored
Normal file
6
vendors/jquery-validate-1.7/demo/captcha/image_req.php
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
// Echo the image - timestamp appended to prevent caching
|
||||
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>';
|
||||
|
||||
?>
|
1
vendors/jquery-validate-1.7/demo/captcha/images/.htaccess
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
AddType application/x-httpd-php .jpg
|
BIN
vendors/jquery-validate-1.7/demo/captcha/images/button.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
vendors/jquery-validate-1.7/demo/captcha/images/button.psd
vendored
Normal file
35
vendors/jquery-validate-1.7/demo/captcha/images/image.php
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
// Begin the session
|
||||
session_start();
|
||||
|
||||
// If the session is not present, set the variable to an error message
|
||||
if(!isset($_SESSION['captcha_id']))
|
||||
$str = 'ERROR!';
|
||||
// Else if it is present, set the variable to the session contents
|
||||
else
|
||||
$str = $_SESSION['captcha_id'];
|
||||
|
||||
// Set the content type
|
||||
//header('Content-type: image/png');
|
||||
header('Cache-control: no-cache');
|
||||
|
||||
// Create an image from button.png
|
||||
$image = imagecreatefrompng('button.png');
|
||||
|
||||
// Set the font colour
|
||||
$colour = imagecolorallocate($image, 183, 178, 152);
|
||||
|
||||
// Set the font
|
||||
$font = '../fonts/Anorexia.ttf';
|
||||
|
||||
// Set a random integer for the rotation between -15 and 15 degrees
|
||||
$rotate = rand(-15, 15);
|
||||
|
||||
// Create an image using our original image and adding the detail
|
||||
imagettftext($image, 14, $rotate, 18, 30, $colour, $font, $str);
|
||||
|
||||
// Output the image as a png
|
||||
imagepng($image);
|
||||
|
||||
?>
|
66
vendors/jquery-validate-1.7/demo/captcha/index.php
vendored
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
// Make the page validate
|
||||
ini_set('session.use_trans_sid', '0');
|
||||
|
||||
// Include the random string file
|
||||
require 'rand.php';
|
||||
|
||||
// Begin the session
|
||||
session_start();
|
||||
|
||||
// Set the session contents
|
||||
$_SESSION['captcha_id'] = $str;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
|
||||
<head>
|
||||
<title>AJAX CAPTCHA</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="keywords" content="AJAX,JHR,PHP,CAPTCHA,download,PHP CAPTCHA,AJAX CAPTCHA,AJAX PHP CAPTCHA,download AJAX CAPTCHA,download AJAX PHP CAPTCHA" />
|
||||
<meta name="description" content="An AJAX CAPTCHA script, written in PHP" />
|
||||
|
||||
<script type="text/javascript" src="../../lib/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="captcha.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<style type="text/css">
|
||||
img { border: 1px solid #eee; }
|
||||
p#statusgreen { font-size: 1.2em; background-color: #fff; color: #0a0; }
|
||||
p#statusred { font-size: 1.2em; background-color: #fff; color: #a00; }
|
||||
fieldset label { display: block; }
|
||||
fieldset div#captchaimage { float: left; margin-right: 15px; }
|
||||
fieldset input#captcha { width: 25%; border: 1px solid #ddd; padding: 2px; }
|
||||
fieldset input#submit { display: block; margin: 2% 0% 0% 0%; }
|
||||
#captcha.success {
|
||||
border: 1px solid #49c24f;
|
||||
background: #bcffbf;
|
||||
}
|
||||
#captcha.error {
|
||||
border: 1px solid #c24949;
|
||||
background: #ffbcbc;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<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>
|
||||
|
||||
<form id="captchaform" action="">
|
||||
<fieldset>
|
||||
<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>
|
||||
<label for="captcha">Enter the characters as seen on the image above (case insensitive):</label>
|
||||
<input type="text" maxlength="6" name="captcha" id="captcha" />
|
||||
<input type="submit" name="submit" id="submit" value="Check" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<p>If you can't decipher the text on the image, click it to dynamically generate a new one.</p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
12
vendors/jquery-validate-1.7/demo/captcha/newsession.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
// Include the random string file
|
||||
require 'rand.php';
|
||||
|
||||
// Begin a new session
|
||||
session_start();
|
||||
|
||||
// Set the session contents
|
||||
$_SESSION['captcha_id'] = $str;
|
||||
|
||||
?>
|
14
vendors/jquery-validate-1.7/demo/captcha/process.php
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
// Begin the session
|
||||
session_start();
|
||||
|
||||
// To avoid case conflicts, make the input uppercase and check against the session value
|
||||
// If it's correct, echo '1' as a string
|
||||
if(strtoupper($_GET['captcha']) == $_SESSION['captcha_id'])
|
||||
echo 'true';
|
||||
// Else echo '0' as a string
|
||||
else
|
||||
echo 'false';
|
||||
|
||||
?>
|
11
vendors/jquery-validate-1.7/demo/captcha/rand.php
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
// Create a random string, leaving out 'o' to avoid confusion with '0'
|
||||
$char = strtoupper(substr(str_shuffle('abcdefghjkmnpqrstuvwxyz'), 0, 4));
|
||||
|
||||
// Concatenate the random string onto the random numbers
|
||||
// The font 'Anorexia' doesn't have a character for '8', so the numbers will only go up to 7
|
||||
// '0' is left out to avoid confusion with 'O'
|
||||
$str = rand(1, 7) . rand(1, 7) . $char;
|
||||
|
||||
?>
|
140
vendors/jquery-validate-1.7/demo/captcha/style.css
vendored
Normal file
|
@ -0,0 +1,140 @@
|
|||
body {
|
||||
margin: 3% 5%;
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
font: 0.9em/1.3 Helvetica, Arial, Verdana, Sans-serif;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:hover, a:focus, a:active {
|
||||
background-color: #ffb;
|
||||
color: #454545;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 2% 0%;
|
||||
padding: 1%;
|
||||
border-bottom: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
color: #666;
|
||||
font: normal 1.5em Helvetica, Arial, Verdana, Sans-serif;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 2% 0%;
|
||||
padding: 1%;
|
||||
border-bottom: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
color: #666;
|
||||
font: normal 1.3em Helvetica, Arial, Verdana, Sans-serif;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 2% 0%;
|
||||
padding: 1%;
|
||||
border-bottom: 1px solid #ddd;
|
||||
background-color: #f8f8f8;
|
||||
color: #666;
|
||||
font: normal 1.2em Helvetica, Arial, Verdana, Sans-serif;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table th {
|
||||
border: 1px solid #ddd;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
padding: 1%;
|
||||
}
|
||||
|
||||
table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 1%;
|
||||
}
|
||||
|
||||
dl, dt, dd {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
border: 1px solid #ddd;
|
||||
margin: 0% 0% 2% 0%;
|
||||
padding: 2%;
|
||||
}
|
||||
|
||||
fieldset legend {
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
background-color: inherit;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
code {
|
||||
font: 1em "Courier New", Courier, Monospace;
|
||||
}
|
||||
|
||||
pre code {
|
||||
font: 1.1em "Courier New", Courier, Monospace;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
p#statusgreen {
|
||||
font-size: 1.2em;
|
||||
background-color: #fff;
|
||||
color: #0a0;
|
||||
}
|
||||
|
||||
p#statusred {
|
||||
font-size: 1.2em;
|
||||
background-color: #fff;
|
||||
color: #a00;
|
||||
}
|
||||
|
||||
fieldset label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
fieldset label.error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
fieldset label.valid {
|
||||
color: green;
|
||||
}
|
||||
|
||||
fieldset div#captchaimage {
|
||||
float: left;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
fieldset input#captcha {
|
||||
width: 25%;
|
||||
border: 1px solid #ddd;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
fieldset input#submit {
|
||||
display: block;
|
||||
margin: 2% 0% 0% 0%;
|
||||
}
|
15
vendors/jquery-validate-1.7/demo/css/chili.css
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
.jscom, .mix htcom { color: #4040c2; }
|
||||
.com { color: green; }
|
||||
.regexp { color: maroon; }
|
||||
.string { color: teal; }
|
||||
.keywords { color: blue; }
|
||||
.global { color: #008; }
|
||||
.numbers { color: #880; }
|
||||
.comm { color: green; }
|
||||
.tag { color: blue; }
|
||||
.entity { color: blue; }
|
||||
.string { color: teal; }
|
||||
.aname { color: maroon; }
|
||||
.avalue { color: maroon; }
|
||||
.jquery { color: #00a; }
|
||||
.plugin { color: red; }
|
46
vendors/jquery-validate-1.7/demo/css/cmxform.css
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
/**********************************
|
||||
|
||||
Name: cmxform Styles
|
||||
|
||||
***********************************/
|
||||
form.cmxform {
|
||||
width: 370px;
|
||||
font-size: 1.0em;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
form.cmxform legend {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
form.cmxform legend, form.cmxform label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
form.cmxform fieldset {
|
||||
border: none;
|
||||
border-top: 1px solid #C9DCA6;
|
||||
background: url(../images/cmxform-fieldset.gif) left bottom repeat-x;
|
||||
background-color: #F8FDEF;
|
||||
}
|
||||
|
||||
form.cmxform fieldset fieldset {
|
||||
background: none;
|
||||
}
|
||||
|
||||
form.cmxform fieldset p, form.cmxform fieldset fieldset {
|
||||
padding: 5px 10px 7px;
|
||||
background: url(../images/cmxform-divider.gif) left bottom repeat-x;
|
||||
}
|
||||
|
||||
form.cmxform label.error, label.error {
|
||||
/* remove the next line when you have trouble in IE6 with labels in list */
|
||||
color: red;
|
||||
font-style: italic
|
||||
}
|
||||
div.error { display: none; }
|
||||
input { border: 1px solid black; }
|
||||
input.checkbox { border: none }
|
||||
input:focus { border: 1px dotted black; }
|
||||
input.error { border: 1px dotted red; }
|
||||
form.cmxform .gray * { color: gray; }
|
55
vendors/jquery-validate-1.7/demo/css/cmxformTemplate.css
vendored
Normal file
|
@ -0,0 +1,55 @@
|
|||
/**********************************
|
||||
|
||||
Use: cmxform template
|
||||
|
||||
***********************************/
|
||||
form.cmxform fieldset {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
form.cmxform legend {
|
||||
padding: 0 2px;
|
||||
font-weight: bold;
|
||||
_margin: 0 -7px; /* IE Win */
|
||||
}
|
||||
|
||||
form.cmxform label {
|
||||
display: inline-block;
|
||||
line-height: 1.8;
|
||||
vertical-align: top;
|
||||
cursor: hand;
|
||||
}
|
||||
|
||||
form.cmxform fieldset p {
|
||||
list-style: none;
|
||||
padding: 5px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
form.cmxform fieldset fieldset {
|
||||
border: none;
|
||||
margin: 3px 0 0;
|
||||
}
|
||||
|
||||
form.cmxform fieldset fieldset legend {
|
||||
padding: 0 0 5px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
form.cmxform fieldset fieldset label {
|
||||
display: block;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
form.cmxform label { width: 100px; } /* Width of labels */
|
||||
form.cmxform fieldset fieldset label { margin-left: 103px; } /* Width plus 3 (html space) */
|
||||
form.cmxform label.error {
|
||||
margin-left: 103px;
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
form.cmxform input.submit {
|
||||
margin-left: 103px;
|
||||
}
|
||||
|
||||
/*\*//*/ form.cmxform legend { display: inline-block; } /* IE Mac legend fix */
|
21
vendors/jquery-validate-1.7/demo/css/core.css
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
body, div { font-family: 'lucida grande', helvetica, verdana, arial, sans-serif }
|
||||
body { margin: 0; padding: 0; font-size: small; color: #333 }
|
||||
h1, h2 { font-family: 'trebuchet ms', verdana, arial; padding: 10px; margin: 0 }
|
||||
h1 { font-size: large }
|
||||
#main { padding: 1em; }
|
||||
#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc;
|
||||
background: url(../images/bg.gif) repeat-x; text-align: center }
|
||||
#banner a { color: white; }
|
||||
|
||||
p { margin: 10px 0; }
|
||||
|
||||
li { margin-left: 10px; }
|
||||
|
||||
h3 { margin: 1em 0 0; }
|
||||
|
||||
h1 { font-size: 2em; }
|
||||
h2 { font-size: 1.8em; }
|
||||
h3 { font-size: 1.6em; }
|
||||
h4 { font-size: 1.4em; }
|
||||
h5 { font-size: 1.2em; }
|
||||
|
61
vendors/jquery-validate-1.7/demo/css/reset.css
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
/**********************************
|
||||
|
||||
Use: Reset Styles for all browsers
|
||||
|
||||
***********************************/
|
||||
|
||||
body, p, blockquote {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a img, iframe { border: none; }
|
||||
|
||||
/* Headers
|
||||
------------------------------*/
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
/* Lists
|
||||
------------------------------*/
|
||||
|
||||
ul, ol, dl, li, dt, dd {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Links
|
||||
------------------------------*/
|
||||
|
||||
a, a:link {}
|
||||
a:visited {}
|
||||
a:hover {}
|
||||
a:active {}
|
||||
|
||||
/* Forms
|
||||
------------------------------*/
|
||||
|
||||
form, fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
fieldset { border: 1px solid #000; }
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
input, textarea, select {
|
||||
margin: 0;
|
||||
padding: 1px;
|
||||
font-size: 100%;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
select { padding: 0; }
|
11
vendors/jquery-validate-1.7/demo/css/screen.css
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/**********************************
|
||||
|
||||
Use: Main Screen Import
|
||||
|
||||
***********************************/
|
||||
|
||||
@import "reset.css";
|
||||
@import "core.css";
|
||||
|
||||
@import "cmxformTemplate.css";
|
||||
@import "cmxform.css";
|
92
vendors/jquery-validate-1.7/demo/custom-messages-metadata-demo.html
vendored
Normal file
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>jQuery validation plug-in - comment form example</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
<script src="../lib/jquery.metadata.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#commentForm").validate({meta: "validate"});
|
||||
$("#commentForm2").validate();
|
||||
$("#commentForm3").validate({
|
||||
messages: {
|
||||
email: {
|
||||
required: 'Enter this!'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
form { width: 500px; }
|
||||
form label { width: 250px; }
|
||||
form label.error,
|
||||
form input.submit { margin-left: 253px; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<p>Take a look at the source to see how messages can be customized with metadata.</p>
|
||||
|
||||
<!-- Custom messages with custom "meta" setting -->
|
||||
<form class="cmxform" id="commentForm" method="post" action="">
|
||||
<fieldset>
|
||||
<legend>Please enter your email address</legend>
|
||||
<p>
|
||||
|
||||
<label for="cemail">E-Mail *</label>
|
||||
<input id="cemail" name="email" class="{validate:{required:true, email:true, messages:{required:'Please enter your email address', email:'Please enter a valid email address'}}}"/>
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<!-- Custom messages with default "meta" setting -->
|
||||
<form class="cmxform" id="commentForm2" method="post" action="">
|
||||
<fieldset>
|
||||
<legend>Please enter your email address</legend>
|
||||
<p>
|
||||
|
||||
<label for="cemail">E-Mail *</label>
|
||||
<input id="cemail" name="email" class="{required:true, email:true, messages:{required:'Please enter your email address', email:'Please enter a valid email address'}}"/>
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
<!-- Custom message for "required" in metadata is overriden by a validate option -->
|
||||
<form class="cmxform" id="commentForm3" method="post" action="">
|
||||
<fieldset>
|
||||
<legend>Please enter your email address</legend>
|
||||
<p>
|
||||
|
||||
<label for="cemail">E-Mail *</label>
|
||||
<input id="cemail" name="email" class="{required:true, email:true, messages:{email:'Please enter a valid email address'}}"/>
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<a href="index.html">Back to main page</a>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">_uacct = "UA-2623402-1";urchinTracker();</script>
|
||||
|
||||
</body>
|
||||
</html>
|
122
vendors/jquery-validate-1.7/demo/custom-methods-demo.html
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>Test for jQuery validate() plugin</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// extend the current rules with new groovy ones
|
||||
|
||||
// this one requires the text "buga", we define a default message, too
|
||||
$.validator.addMethod("buga", function(value) {
|
||||
return value == "buga";
|
||||
}, 'Please enter "buga"!');
|
||||
|
||||
// this one requires the value to be the same as the first parameter
|
||||
$.validator.methods.equal = function(value, element, param) {
|
||||
return value == param;
|
||||
};
|
||||
|
||||
$().ready(function() {
|
||||
var validator = $("#texttests").bind("invalid-form.validate", function() {
|
||||
$("#summary").html("Your form contains " + validator.numberOfInvalids() + " errors, see details below.");
|
||||
}).validate({
|
||||
debug: true,
|
||||
errorElement: "em",
|
||||
errorContainer: $("#warning, #summary"),
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent("td").next("td") );
|
||||
},
|
||||
success: function(label) {
|
||||
label.text("ok!").addClass("success");
|
||||
},
|
||||
rules: {
|
||||
number: {
|
||||
required:true,
|
||||
minLength:3,
|
||||
maxLength:15,
|
||||
number:true
|
||||
},
|
||||
secret: "buga",
|
||||
math: {
|
||||
equal: 11
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
form.cmxform { width: 50em; }
|
||||
em.error {
|
||||
background:url("images/unchecked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
em.success {
|
||||
background:url("images/checked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
form.cmxform label.error {
|
||||
margin-left: auto;
|
||||
width: 250px;
|
||||
}
|
||||
em.error { color: black; }
|
||||
#warning { display: none; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<form class="cmxform" id="texttests" method="get" action="foo.html">
|
||||
<h2 id="summary"></h2>
|
||||
|
||||
<fieldset>
|
||||
<legend>Example with custom methods and heavily customized error display</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="number">textarea</label></td>
|
||||
<td><input id="number" name="number"
|
||||
title="Please enter a number with at least 3 and max 15 characters!" />
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="secret">Secret</label></td>
|
||||
<td><input name="secret" id="secret" /></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="math">7 + 4 = </label></td>
|
||||
<td><input id="math" name="math" title="Please enter the correct result!" /></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<h3 id="warning">Your form contains tons of errors! Please try again.</h3>
|
||||
|
||||
<p><a href="index.html">Back to main page</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
151
vendors/jquery-validate-1.7/demo/dynamic-totals.html
vendored
Normal file
|
@ -0,0 +1,151 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>jQuery validation plug-in - dynamic forms demo</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// only for demo purposes
|
||||
$.validator.setDefaults({
|
||||
submitHandler: function() {
|
||||
alert("submitted!");
|
||||
}
|
||||
});
|
||||
$.validator.messages.max = jQuery.format("Your totals musn't exceed {0}!");
|
||||
|
||||
$.validator.addMethod("quantity", function(value, element) {
|
||||
return !this.optional(element) && !this.optional($(element).parent().prev().children("select")[0]);
|
||||
}, "Please select both the item and its amount.");
|
||||
|
||||
$().ready(function() {
|
||||
$("#orderform").validate({
|
||||
errorPlacement: function(error, element) {
|
||||
error.appendTo( element.parent().next() );
|
||||
},
|
||||
highlight: function(element, errorClass) {
|
||||
$(element).addClass(errorClass).parent().prev().children("select").addClass(errorClass);
|
||||
}
|
||||
});
|
||||
|
||||
var template = jQuery.format($("#template").val());
|
||||
function addRow() {
|
||||
$(template(i++)).appendTo("#orderitems tbody");
|
||||
}
|
||||
|
||||
var i = 1;
|
||||
// start with one row
|
||||
addRow();
|
||||
// add more rows on click
|
||||
$("#add").click(addRow);
|
||||
|
||||
// check keyup on quantity inputs to update totals field
|
||||
$("#orderform").delegate("keyup", "input.quantity", function(event) {
|
||||
var totals = 0;
|
||||
$("#orderitems input.quantity").each(function() {
|
||||
totals += +this.value;
|
||||
});
|
||||
$("#totals").attr("value", totals).valid();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
form.cmxform { width: 50em; }
|
||||
em.error {
|
||||
background:url("images/unchecked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
em.success {
|
||||
background:url("images/checked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
form.cmxform label.error {
|
||||
margin-left: auto;
|
||||
width: 250px;
|
||||
}
|
||||
form.cmxform input.submit {
|
||||
margin-left: 0;
|
||||
}
|
||||
em.error { color: black; }
|
||||
#warning { display: none; }
|
||||
select.error {
|
||||
border: 1px dotted red;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<textarea style="display:none" id="template">
|
||||
<tr>
|
||||
<td>
|
||||
<label>{0}. Item</label>
|
||||
</td>
|
||||
<td class='type'>
|
||||
<select name="item-type-{0}">
|
||||
<option value="">Select...</option>
|
||||
<option value="0">Learning jQuery</option>
|
||||
<option value="1">jQuery Reference Guide</option>
|
||||
<option value="2">jQuery Cookbook</option>
|
||||
<option vlaue="3">jQuery In Action</option>
|
||||
<option value="4">jQuery For Designers</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class='quantity'>
|
||||
<input size='4' class="quantity" min="1" id="item-quantity-{0}" name="item-quantity-{0}" />
|
||||
</td>
|
||||
<td class='quantity-error'></td>
|
||||
</tr>
|
||||
</textarea>
|
||||
|
||||
<form id="orderform" class="cmxform" method="get" action="foo.html">
|
||||
<h2 id="summary"></h2>
|
||||
|
||||
<fieldset>
|
||||
<legend>Example with custom methods and heavily customized error display</legend>
|
||||
<table id="orderitems">
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2"><label>Totals (max 25)</label></td>
|
||||
<td class="totals"><input id="totals" name="totals" value="0" max="25" readonly="readonly" size='4' /></td>
|
||||
<td class="totals-error"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
<td><input class="submit" type="submit" value="Submit"/></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<button id="add">Add another input to the form</button>
|
||||
|
||||
<h1 id="warning">Your form contains tons of errors! Please try again.</h1>
|
||||
|
||||
<p><a href="index.html">Back to main page</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
161
vendors/jquery-validate-1.7/demo/errorcontainer-demo.html
vendored
Normal file
|
@ -0,0 +1,161 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>Test for jQuery validate() plugin</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../lib/jquery.metadata.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.cmxform fieldset p.error label { color: red; }
|
||||
div.container {
|
||||
background-color: #eee;
|
||||
border: 1px solid red;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
}
|
||||
div.container ol li {
|
||||
list-style-type: disc;
|
||||
margin-left: 20px;
|
||||
}
|
||||
div.container { display: none }
|
||||
.container label.error {
|
||||
display: inline;
|
||||
}
|
||||
form.cmxform { width: 30em; }
|
||||
form.cmxform label.error {
|
||||
display: block;
|
||||
margin-left: 1em;
|
||||
width: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
// only for demo purposes
|
||||
$.validator.setDefaults({
|
||||
submitHandler: function() {
|
||||
alert("submitted! (skipping validation for cancel button)");
|
||||
}
|
||||
});
|
||||
|
||||
$().ready(function() {
|
||||
$("#form1").validate({
|
||||
errorLabelContainer: $("#form1 div.error")
|
||||
});
|
||||
|
||||
var container = $('div.container');
|
||||
// validate the form when it is submitted
|
||||
var validator = $("#form2").validate({
|
||||
errorContainer: container,
|
||||
errorLabelContainer: $("ol", container),
|
||||
wrapper: 'li',
|
||||
meta: "validate"
|
||||
});
|
||||
|
||||
$(".cancel").click(function() {
|
||||
validator.resetForm();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<form method="get" class="cmxform" id="form1" action="">
|
||||
<fieldset>
|
||||
<legend>Login Form</legend>
|
||||
<p>
|
||||
<label>Username</label>
|
||||
<input name="user" title="Please enter your username (at least 3 characters)" class="{required:true,minlength:3}" />
|
||||
</p>
|
||||
<p>
|
||||
<label>Password</label>
|
||||
<input type="password" maxlength="12" name="password" title="Please enter your password, between 5 and 12 characters" class="{required:true,minlength:5}" />
|
||||
</p>
|
||||
<div class="error">
|
||||
</div>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Login"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<!-- our error container -->
|
||||
<div class="container">
|
||||
<h4>There are serious errors in your form submission, please see below for details.</h4>
|
||||
<ol>
|
||||
<li><label for="email" class="error">Please enter your email address</label></li>
|
||||
<li><label for="phone" class="error">Please enter your phone <b>number</b> (between 2 and 8 characters)</label></li>
|
||||
<li><label for="address" class="error">Please enter your address (at least 3 characters)</label></li>
|
||||
<li><label for="avatar" class="error">Please select an image (png, jpg, jpeg, gif)</label></li>
|
||||
<li><label for="cv" class="error">Please select a document (doc, docx, txt, pdf)</label></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<form class="cmxform" id="form2" method="get" action="">
|
||||
<fieldset>
|
||||
<legend>Validating a complete form</legend>
|
||||
<p>
|
||||
<label for="email">Email</label>
|
||||
<input id="email" name="email" class="{validate:{required:true,email:true}}" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="agree">Favorite Color</label>
|
||||
<select id="color" name="color" title="Please select your favorite color!" class="{validate:{required:true}}">
|
||||
<option></option>
|
||||
<option>Red</option>
|
||||
<option>Blue</option>
|
||||
<option>Yellow</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label for="phone">Phone</label>
|
||||
<input id="phone" name="phone" class="some styles {validate:{required:true,number:true, rangelength:[2,8]}}" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="address">Address</label>
|
||||
<input id="address" name="address" class="some other styles {validate:{required:true,minlength:3}}" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="avatar">Avatar</label>
|
||||
<input type="file" id="avatar" name="avatar" class="{validate:{required:true,accept:true}}" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="agree">Please agree to our policy</label>
|
||||
<input type="checkbox" class="checkbox" id="agree" title="Please agree to our policy!" name="agree" class="{validate:{required:true}}" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="cv">CV</label>
|
||||
<input type="file" id="cv" name="cv" class="{validate:{required:true,accept:'docx?|txt|pdf'}}" />
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
<input class="cancel" type="submit" value="Cancel"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<div class="container">
|
||||
<h4>There are serious errors in your form submission, please see details above the form!</h4>
|
||||
</div>
|
||||
|
||||
<a href="index.html">Back to main page</a>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
52
vendors/jquery-validate-1.7/demo/example.html
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>jQuery validation plug-in - comment form example</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#commentForm").validate();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
#commentForm { width: 500px; }
|
||||
#commentForm label { width: 250px; }
|
||||
#commentForm label.error, #commentForm input.submit { margin-left: 253px; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form class="cmxform" id="commentForm" method="post" action="">
|
||||
<fieldset>
|
||||
<legend>Please provide your name, email address (won't be published) and a comment</legend>
|
||||
<p>
|
||||
<label for="cname">Name (required, at least 2 characters)</label>
|
||||
<input id="cname" name="name" class="required" minlength="2" />
|
||||
<p>
|
||||
<label for="cemail">E-Mail (required)</label>
|
||||
<input id="cemail" name="email" class="required email" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="curl">URL (optional)</label>
|
||||
<input id="curl" name="url" class="url" value="" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="ccomment">Your comment (required)</label>
|
||||
<textarea id="ccomment" name="comment" class="required"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
10
vendors/jquery-validate-1.7/demo/form.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
// wait a second to simulate a some latency
|
||||
usleep(500000);
|
||||
$user = $_REQUEST['user'];
|
||||
$pw = $_REQUEST['password'];
|
||||
if($user && $pw && $pw == "foobar")
|
||||
echo "Hi $user, welcome back.";
|
||||
else
|
||||
echo "Your password is wrong (must be foobar).";
|
||||
?>
|
10
vendors/jquery-validate-1.7/demo/form.phps
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
// wait a second to simulate a some latency
|
||||
usleep(500000);
|
||||
$user = $_REQUEST['user'];
|
||||
$pw = $_REQUEST['password'];
|
||||
if($user && $pw && $pw == "foobar")
|
||||
echo "Hi $user, welcome back.";
|
||||
else
|
||||
echo "Your password is wrong (must be foobar).";
|
||||
?>
|
BIN
vendors/jquery-validate-1.7/demo/images/bg.gif
vendored
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
vendors/jquery-validate-1.7/demo/images/checked.gif
vendored
Normal file
After Width: | Height: | Size: 220 B |
BIN
vendors/jquery-validate-1.7/demo/images/cmxform-divider.gif
vendored
Normal file
After Width: | Height: | Size: 43 B |
BIN
vendors/jquery-validate-1.7/demo/images/cmxform-fieldset.gif
vendored
Normal file
After Width: | Height: | Size: 314 B |
BIN
vendors/jquery-validate-1.7/demo/images/loading.gif
vendored
Normal file
After Width: | Height: | Size: 418 B |
BIN
vendors/jquery-validate-1.7/demo/images/unchecked.gif
vendored
Normal file
After Width: | Height: | Size: 223 B |
230
vendors/jquery-validate-1.7/demo/index.html
vendored
Normal file
|
@ -0,0 +1,230 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>jQuery validation plug-in - main demo</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$.validator.setDefaults({
|
||||
submitHandler: function() { alert("submitted!"); }
|
||||
});
|
||||
|
||||
$().ready(function() {
|
||||
// validate the comment form when it is submitted
|
||||
$("#commentForm").validate();
|
||||
|
||||
// validate signup form on keyup and submit
|
||||
$("#signupForm").validate({
|
||||
rules: {
|
||||
firstname: "required",
|
||||
lastname: "required",
|
||||
username: {
|
||||
required: true,
|
||||
minlength: 2
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
minlength: 5
|
||||
},
|
||||
confirm_password: {
|
||||
required: true,
|
||||
minlength: 5,
|
||||
equalTo: "#password"
|
||||
},
|
||||
email: {
|
||||
required: true,
|
||||
email: true
|
||||
},
|
||||
topic: {
|
||||
required: "#newsletter:checked",
|
||||
minlength: 2
|
||||
},
|
||||
agree: "required"
|
||||
},
|
||||
messages: {
|
||||
firstname: "Please enter your firstname",
|
||||
lastname: "Please enter your lastname",
|
||||
username: {
|
||||
required: "Please enter a username",
|
||||
minlength: "Your username must consist of at least 2 characters"
|
||||
},
|
||||
password: {
|
||||
required: "Please provide a password",
|
||||
minlength: "Your password must be at least 5 characters long"
|
||||
},
|
||||
confirm_password: {
|
||||
required: "Please provide a password",
|
||||
minlength: "Your password must be at least 5 characters long",
|
||||
equalTo: "Please enter the same password as above"
|
||||
},
|
||||
email: "Please enter a valid email address",
|
||||
agree: "Please accept our policy"
|
||||
}
|
||||
});
|
||||
|
||||
// propose username by combining first- and lastname
|
||||
$("#username").focus(function() {
|
||||
var firstname = $("#firstname").val();
|
||||
var lastname = $("#lastname").val();
|
||||
if(firstname && lastname && !this.value) {
|
||||
this.value = firstname + "." + lastname;
|
||||
}
|
||||
});
|
||||
|
||||
//code to hide topic selection, disable for demo
|
||||
var newsletter = $("#newsletter");
|
||||
// newsletter topics are optional, hide at first
|
||||
var inital = newsletter.is(":checked");
|
||||
var topics = $("#newsletter_topics")[inital ? "removeClass" : "addClass"]("gray");
|
||||
var topicInputs = topics.find("input").attr("disabled", !inital);
|
||||
// show when newsletter is checked
|
||||
newsletter.click(function() {
|
||||
topics[this.checked ? "removeClass" : "addClass"]("gray");
|
||||
topicInputs.attr("disabled", !this.checked);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
#commentForm { width: 500px; }
|
||||
#commentForm label { width: 250px; }
|
||||
#commentForm label.error, #commentForm input.submit { margin-left: 253px; }
|
||||
#signupForm { width: 670px; }
|
||||
#signupForm label.error {
|
||||
margin-left: 10px;
|
||||
width: auto;
|
||||
display: inline;
|
||||
}
|
||||
#newsletter_topics label.error {
|
||||
display: none;
|
||||
margin-left: 103px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<p>Default submitHandler is set to display an alert into of submitting the form</p>
|
||||
|
||||
<form class="cmxform" id="commentForm" method="get" action="">
|
||||
<fieldset>
|
||||
<legend>Please provide your name, email address (won't be published) and a comment</legend>
|
||||
<p>
|
||||
<label for="cname">Name (required, at least 2 characters)</label>
|
||||
<input id="cname" name="name" class="required" minlength="2" />
|
||||
<p>
|
||||
<label for="cemail">E-Mail (required)</label>
|
||||
<input id="cemail" name="email" class="required email" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="curl">URL (optional)</label>
|
||||
<input id="curl" name="url" class="url" value="" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="ccomment">Your comment (required)</label>
|
||||
<textarea id="ccomment" name="comment" class="required"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<form class="cmxform" id="signupForm" method="get" action="">
|
||||
<fieldset>
|
||||
<legend>Validating a complete form</legend>
|
||||
<p>
|
||||
<label for="firstname">Firstname</label>
|
||||
<input id="firstname" name="firstname" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="lastname">Lastname</label>
|
||||
<input id="lastname" name="lastname" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="username">Username</label>
|
||||
<input id="username" name="username" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
<input id="password" name="password" type="password" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="confirm_password">Confirm password</label>
|
||||
<input id="confirm_password" name="confirm_password" type="password" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="email">Email</label>
|
||||
<input id="email" name="email" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="agree">Please agree to our policy</label>
|
||||
<input type="checkbox" class="checkbox" id="agree" name="agree" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="newsletter">I'd like to receive the newsletter</label>
|
||||
<input type="checkbox" class="checkbox" id="newsletter" name="newsletter" />
|
||||
</p>
|
||||
<fieldset id="newsletter_topics">
|
||||
<legend>Topics (select at least two) - note: would be hidden when newsletter isn't selected, but is visible here for the demo</legend>
|
||||
<label for="topic_marketflash">
|
||||
<input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" />
|
||||
Marketflash
|
||||
</label>
|
||||
<label for="topic_fuzz">
|
||||
<input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" />
|
||||
Latest fuzz
|
||||
</label>
|
||||
<label for="topic_digester">
|
||||
<input type="checkbox" id="topic_digester" value="digester" name="topic" />
|
||||
Mailing list digester
|
||||
</label>
|
||||
<label for="topic" class="error">Please select at least two topics you'd like to receive.</label>
|
||||
</fieldset>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<h3>Syntetic examples</h3>
|
||||
<ul>
|
||||
<li><a href="errorcontainer-demo.html">Error message containers in action</a></li>
|
||||
<li><a href="custom-messages-metadata-demo.html">Custom Messages as Metadata</a></li>
|
||||
<li><a href="radio-checkbox-select-demo.html">Radio and checkbox buttons and selects</a></li>
|
||||
<li><a href="ajaxSubmit-intergration-demo.html">Integration with Form Plugin (AJAX submit)</a></li>
|
||||
<li><a href="custom-methods-demo.html">Custom methods and message display.</a></li>
|
||||
<li><a href="dynamic-totals.html">Dynamic forms</a></li>
|
||||
<li><a href="themerollered.html">Forms styled with jQuery UI Themeroller</a></li>
|
||||
</ul>
|
||||
<h3>Real-world examples</h3>
|
||||
<ul>
|
||||
<li><a href="milk/">Remember The Milk signup form</a></li>
|
||||
<li><a href="marketo/">Marketo signup form</a></li>
|
||||
<li><a href="multipart/">Buy and Sell a House multipart form</a></li>
|
||||
<li><a href="captcha/">Remote captcha validation</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Testsuite</h3>
|
||||
<ul>
|
||||
<li><a href="../test/">Validation Testsuite</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
1
vendors/jquery-validate-1.7/demo/js/chili-1.7.pack.js
vendored
Normal file
BIN
vendors/jquery-validate-1.7/demo/login/images/bg.gif
vendored
Normal file
After Width: | Height: | Size: 89 B |
BIN
vendors/jquery-validate-1.7/demo/login/images/header1.jpg
vendored
Normal file
After Width: | Height: | Size: 442 B |
BIN
vendors/jquery-validate-1.7/demo/login/images/page.gif
vendored
Normal file
After Width: | Height: | Size: 664 B |
BIN
vendors/jquery-validate-1.7/demo/login/images/required_star.gif
vendored
Normal file
After Width: | Height: | Size: 121 B |
76
vendors/jquery-validate-1.7/demo/login/index.html
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Login Form with Email Password Link</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="screen.css" />
|
||||
|
||||
<script type="text/javascript" src="../../lib/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.validate.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
// highlight
|
||||
var elements = $("input[type!='submit'], textarea, select");
|
||||
elements.focus(function(){
|
||||
$(this).parents('li').addClass('highlight');
|
||||
});
|
||||
elements.blur(function(){
|
||||
$(this).parents('li').removeClass('highlight');
|
||||
});
|
||||
|
||||
$("#forgotpassword").click(function() {
|
||||
$("#password").removeClass("required");
|
||||
$("#login").submit();
|
||||
$("#password").addClass("required");
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#login").validate()
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
|
||||
<div id="header">
|
||||
<h1>Login</h1>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<p id="status"></p>
|
||||
<form action="" method="get" id="login">
|
||||
<fieldset>
|
||||
<legend>User details</legend>
|
||||
<ul>
|
||||
<li>
|
||||
<label for="email"><span class="required">Email address</span></label>
|
||||
<input id="email" name="email" class="text required email" type="text" />
|
||||
<label for="email" class="error">This must be a valid email address</label>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label for="password"><span class="required">Password</span></label>
|
||||
<input name="password" type="password" class="text required" id="password" minlength="4" maxlength="20" />
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label class="centered info"><a id="forgotpassword" href="#">Email my password...</a></label>
|
||||
</li>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="submit">
|
||||
<input type="submit" class="button" value="Login..." />
|
||||
</fieldset>
|
||||
|
||||
<div class="clear"></div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
457
vendors/jquery-validate-1.7/demo/login/screen.css
vendored
Normal file
|
@ -0,0 +1,457 @@
|
|||
/*******************************************************************************
|
||||
********************************************************************************
|
||||
**
|
||||
* - GENERAL
|
||||
*
|
||||
* - PAGE CONTAINERS
|
||||
*
|
||||
* - HEADER
|
||||
*
|
||||
* - CONTENT
|
||||
**
|
||||
********************************************************************************
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/* GENERAL ------------------------------------------------------------------ */
|
||||
|
||||
html
|
||||
{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Zero default margin & padding around common elements */
|
||||
body, dd, dl, dt, form, h1, h2, h3, h4, h5, h6, ul, ol, li, p
|
||||
{
|
||||
margin: 0;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
height: 100%;
|
||||
background-color: #333333;
|
||||
background-image: url(images/bg.gif);
|
||||
background-position: 0% 0;
|
||||
color: #000000;
|
||||
line-height: 1.5;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 62.5%;
|
||||
text-align: center;
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
a:link
|
||||
{
|
||||
color: #003399;
|
||||
}
|
||||
|
||||
a:visited
|
||||
{
|
||||
color: #B266B2;
|
||||
}
|
||||
|
||||
a:hover
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* PAGE CONTAINERS ---------------------------------------------------------- */
|
||||
|
||||
#page
|
||||
{
|
||||
width: 636px;
|
||||
w\idth: 600px;
|
||||
min-height: 100%;
|
||||
margin: 17px auto;
|
||||
padding: 0 18px;
|
||||
background-image: url(images/page.gif);
|
||||
background-repeat: repeat-y;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
* html #page
|
||||
{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* HEADER ------------------------------------------------------------------- */
|
||||
|
||||
#header
|
||||
{
|
||||
height: 90px;
|
||||
background-color: #B2DD32;
|
||||
background-image: url(images/header1.jpg);
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
padding: 0 35px;
|
||||
font-size: 2.2em;
|
||||
font-weight: normal;
|
||||
line-height: 82px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* CONTENT ------------------------------------------------------------------ */
|
||||
|
||||
#content
|
||||
{
|
||||
padding: 0 25px;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
font-size:1.1em;
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
form
|
||||
{
|
||||
margin-top: 1.5em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*** MASTER FORM WIDTHS - CUSTOMIZE THIS TO CHANGE THE FORM LAYOUT ***/
|
||||
|
||||
/*
|
||||
form width: 550px
|
||||
left column: 190px / 180px + 10px padding
|
||||
mid column: 200px
|
||||
right column: 160px
|
||||
*/
|
||||
|
||||
form{
|
||||
width:550px !important;
|
||||
}
|
||||
|
||||
fieldset.submit
|
||||
{
|
||||
padding-left: 190px !important;
|
||||
}
|
||||
|
||||
form label{
|
||||
padding:0px 10px;
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
form label.error,
|
||||
form input.submit
|
||||
{
|
||||
margin-left:180px !important;
|
||||
}
|
||||
|
||||
form fieldset fieldset label.error
|
||||
{
|
||||
margin-left:0px !important;
|
||||
width:200px !important;
|
||||
}
|
||||
|
||||
|
||||
form .centered{
|
||||
margin-left:180px !important;
|
||||
width:200px !important;
|
||||
}
|
||||
|
||||
form .text,
|
||||
form .button,
|
||||
form .group,
|
||||
form .control,
|
||||
form .submit,
|
||||
form textarea,
|
||||
form select
|
||||
{
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*** FIELDSETS AND LEGENDS ***/
|
||||
|
||||
form{
|
||||
width:550px;
|
||||
margin-bottom:25px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
form fieldset
|
||||
{
|
||||
margin: 0 0 1.5em 0;
|
||||
padding: 0 0 10px 0px;
|
||||
|
||||
border: 1px solid #BFBAB0;
|
||||
|
||||
background-color: #F2EFE9;
|
||||
background-image: url(images/fieldset_gradient.jpg);
|
||||
background-repeat: repeat-x;
|
||||
|
||||
background-color: #fff;
|
||||
background-image: url(images/fieldset-gradient-02.jpg);
|
||||
background-position:bottom;
|
||||
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
form fieldset.submit
|
||||
{
|
||||
padding: 0px 10px 10px 190px;
|
||||
border-style: none;
|
||||
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
|
||||
float: none;
|
||||
width: auto;
|
||||
|
||||
}
|
||||
|
||||
form legend
|
||||
{
|
||||
color: #000000;
|
||||
|
||||
font-size:1.3em;
|
||||
font-weight: bold;
|
||||
font-variant:small-caps;
|
||||
|
||||
margin-left: 1em;
|
||||
padding:0px 5px;
|
||||
}
|
||||
|
||||
form fieldset p{
|
||||
margin:10px 0px 0px 10px;
|
||||
}
|
||||
|
||||
/*** FORM BLOCKS ***/
|
||||
|
||||
form ul
|
||||
{
|
||||
padding:5px 10px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
form li
|
||||
{
|
||||
width: 100%;
|
||||
|
||||
padding:5px 0px 10px 0;
|
||||
border-top:1px dotted #ccc;
|
||||
|
||||
display:block;
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
form li:first-child
|
||||
{
|
||||
border:none;
|
||||
}
|
||||
|
||||
|
||||
/*** FORM BLOCK ELEMENTS ***/
|
||||
|
||||
form label
|
||||
{
|
||||
padding:0px 10px;
|
||||
width: 160px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
form .error{
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
form label.error
|
||||
{
|
||||
color: #c00;
|
||||
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
font-variant:small-caps;
|
||||
|
||||
width:308px;
|
||||
display: none;
|
||||
|
||||
margin:8px 0px 0px 180px;
|
||||
padding:3px 0px 0px 5px;
|
||||
border-top:1px dotted #ccc;
|
||||
|
||||
clear:both;
|
||||
}
|
||||
|
||||
form label.info{
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
font-variant:small-caps;
|
||||
|
||||
margin:8px 0px 0px 180px;
|
||||
padding:3px 0px 0px 5px;
|
||||
}
|
||||
|
||||
form fieldset fieldset,
|
||||
form .group
|
||||
{
|
||||
width:200px;
|
||||
|
||||
margin: 0;
|
||||
border:none;
|
||||
|
||||
background:none;
|
||||
|
||||
float:left;
|
||||
clear: none;
|
||||
|
||||
}
|
||||
|
||||
form fieldset fieldset label
|
||||
{
|
||||
width:auto !important;
|
||||
white-space:nowrap;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
display:block;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
form label label.error{
|
||||
margin-left:0px;
|
||||
}
|
||||
|
||||
form label.centered{
|
||||
padding:0px 0px;
|
||||
width:200px !important;
|
||||
}
|
||||
|
||||
/* see also the error class at the foot of the page */
|
||||
|
||||
form fieldset fieldset label.spaced
|
||||
{
|
||||
margin-bottom:3px;
|
||||
}
|
||||
|
||||
/*** FORM ELEMENT COLUMNS ***/
|
||||
|
||||
.col-1,
|
||||
fieldset fieldset.col-1 label
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.col-2,
|
||||
fieldset fieldset.col-2 label
|
||||
{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.col-3,
|
||||
fieldset fieldset.col-3 label
|
||||
{
|
||||
width:33%;
|
||||
}
|
||||
|
||||
.col-4,
|
||||
fieldset fieldset.col-4 label
|
||||
{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*** FORM ELEMENTS ***/
|
||||
|
||||
form input.submit{
|
||||
margin:10px 0px 10px 180px;
|
||||
padding:0px 2px;
|
||||
}
|
||||
|
||||
form input, textarea, select,
|
||||
form label
|
||||
{
|
||||
font-size:1.1em;
|
||||
line-height:1.6em;
|
||||
}
|
||||
|
||||
form input, textarea, select
|
||||
{
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
form .input[type="text"],
|
||||
form textarea
|
||||
{
|
||||
padding:1px;
|
||||
}
|
||||
|
||||
form .input[type="radio"],
|
||||
form .input[type="checkbox"]
|
||||
{
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
position:relative;
|
||||
top:3px;
|
||||
}
|
||||
|
||||
/*** SUPPORTING CLASSES ***/
|
||||
|
||||
form label.required{
|
||||
background-image:url(images/required_star.gif);
|
||||
background-position:right;
|
||||
background-repeat:no-repeat;
|
||||
}
|
||||
|
||||
form span.required{
|
||||
padding-right:15px;
|
||||
}
|
||||
|
||||
form .clean
|
||||
{
|
||||
border:none;
|
||||
}
|
||||
|
||||
form .info{
|
||||
padding-top:0.5em;
|
||||
font-size:80%;
|
||||
line-height:100%;
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
form .indent{
|
||||
padding:2px 20px;
|
||||
width:auto !important;
|
||||
white-space:nowrap;
|
||||
padding-left: 25px !important;
|
||||
}
|
||||
|
||||
form label.disabled{
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
form .highlight{
|
||||
background-color:#e2e2e2;
|
||||
}
|
||||
|
||||
.off{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.clear{
|
||||
clear:both;
|
||||
}
|
||||
|
10
vendors/jquery-validate-1.7/demo/marketo/emails.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
$request = trim(strtolower($_REQUEST['email']));
|
||||
$emails = array('glen@marketo.com', 'george@bush.gov', 'me@god.com', 'aboutface@cooper.com', 'steam@valve.com', 'bill@gates.com');
|
||||
$valid = 'true';
|
||||
foreach($emails as $email) {
|
||||
if( strtolower($email) == $request )
|
||||
$valid = 'false';
|
||||
}
|
||||
echo $valid;
|
||||
?>
|
10
vendors/jquery-validate-1.7/demo/marketo/emails.phps
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
$request = trim(strtolower($_REQUEST['value']));
|
||||
$emails = array('glen@marketo.com', 'george@bush.gov', 'me@god.com', 'aboutface@cooper.com', 'steam@valve.com', 'bill@gates.com');
|
||||
$valid = 'true';
|
||||
foreach($emails as $email) {
|
||||
if( strtolower($email) == $request )
|
||||
$valid = 'false';
|
||||
}
|
||||
echo $valid;
|
||||
?>
|
35
vendors/jquery-validate-1.7/demo/marketo/ie6.css
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
img.png {
|
||||
background-image: expression(
|
||||
this.runtimeStyle.backgroundImage = "none",
|
||||
this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
|
||||
this.src = "images/blank.gif"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.hidden {
|
||||
display:none
|
||||
}
|
||||
|
||||
|
||||
|
||||
div.login { width: 120px;}
|
||||
div.nav-global LI,
|
||||
div.nav-global LI A { display:inline !important; zoom: 1;}
|
||||
|
||||
div.nav-global LI A:hover,
|
||||
div.nav-left li a:hover { text-decoration: none;}
|
||||
|
||||
div.buttonSubmit { height: 36px;}
|
||||
|
||||
div.buttonSubmit input { position: absolute;}
|
||||
|
||||
div.offerHeader {margin-left: 3px;}
|
||||
|
||||
#col-left { height: 340px;}
|
||||
|
||||
span#cancellation {
|
||||
position: relative;
|
||||
top: 20px;
|
||||
}
|
BIN
vendors/jquery-validate-1.7/demo/marketo/images/backRequiredGray.gif
vendored
Normal file
After Width: | Height: | Size: 137 B |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/back_green-fade.gif
vendored
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/back_nav_blue.gif
vendored
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/blank.gif
vendored
Normal file
After Width: | Height: | Size: 799 B |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/button-submit.gif
vendored
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/favicon.ico
vendored
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/help.png
vendored
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/left-nav-callout-long.png
vendored
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/login-sprite.gif
vendored
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/logo_marketo.gif
vendored
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/sf.png
vendored
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/step1-24.gif
vendored
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/step2-24.gif
vendored
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/step3-24.gif
vendored
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/tab-sprite.gif
vendored
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/tab_green.gif
vendored
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/time.png
vendored
Normal file
After Width: | Height: | Size: 793 B |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/toggle.gif
vendored
Normal file
After Width: | Height: | Size: 845 B |
BIN
vendors/jquery-validate-1.7/demo/marketo/images/warning.gif
vendored
Normal file
After Width: | Height: | Size: 234 B |
247
vendors/jquery-validate-1.7/demo/marketo/index.html
vendored
Normal file
|
@ -0,0 +1,247 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="title" content="Subscription Signup | Marketo" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="description" content="Marketo Search Marketing application" />
|
||||
<meta name="keywords" content="Marketo, Search Marketing" />
|
||||
<meta name="language" content="en" />
|
||||
<title>Subscription Signup | Marketo</title>
|
||||
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
|
||||
<script src="../../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" src="jquery.maskedinput.js"></script>
|
||||
<script type="text/javascript" src="mktSignup.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="stylesheet.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!--[if lte IE 6]>
|
||||
<link rel="stylesheet" type="text/css" media="all" href="ie6.css" />
|
||||
<![endif]-->
|
||||
|
||||
<!-- start page wrapper --><div id="letterbox">
|
||||
|
||||
<!-- start header container -->
|
||||
<div id="header-background">
|
||||
<div class="nav-global-container">
|
||||
|
||||
<div class="login"><a href="#"><span></span>Customer Login</a></div>
|
||||
<div class="logo"><a href="#"><img src="images/logo_marketo.gif" width="168" height="73" alt="Marketo" /></a></div>
|
||||
<div class="nav-global">
|
||||
<ul>
|
||||
<li><a href="#" class="nav-g01"><span></span>Home</a></li>
|
||||
<li><a href="#" class="nav-g02"><span></span>Products</a></li>
|
||||
<li><a href="#" class="nav-g04"><span></span>B2B Marketing Resources</a></li>
|
||||
|
||||
<li><a href="#" class="nav-g05"><span></span>About Marketo</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end header container -->
|
||||
<div class="line-grey-tier"></div>
|
||||
|
||||
<!-- start page container 2 div-->
|
||||
<div id="page-container" class="resize"><div id="page-content-inner" class="resize">
|
||||
|
||||
<!-- start col-main -->
|
||||
|
||||
<div id="col-main" class="resize" style="">
|
||||
|
||||
|
||||
|
||||
<!-- start main content -->
|
||||
<div class="main-content resize">
|
||||
|
||||
<div class="action-container" style="display:none;"></div>
|
||||
|
||||
|
||||
<h1>Step 1 of 2 </h1>
|
||||
<p>
|
||||
</p>
|
||||
<br clear="all" />
|
||||
<div>
|
||||
<form id="profileForm" type="actionForm" action="step2.htm" method="get" >
|
||||
|
||||
|
||||
<div class="error" style="display:none;">
|
||||
<img src="images/warning.gif" alt="Warning!" width="24" height="24" style="float:left; margin: -5px 10px 0px 0px; " />
|
||||
|
||||
<span></span>.<br clear="all"/>
|
||||
</div>
|
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td class="label"><label for="co_name">Company Name:</label></td>
|
||||
<td class="field">
|
||||
<input id="co_name" class="required" maxlength="40" name="co_name" size="20" type="text" tabindex="1" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="co_url">Company URL:</label></td>
|
||||
<td class="field">
|
||||
<input id="co_url" class="required defaultInvalid url" maxlength="40" name="co_url" style="width:163px" type="text" tabindex="2" value="http://" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td/><td/>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="first_name">First Name:</label></td>
|
||||
<td class="field">
|
||||
<input id="first_name" class="required" maxlength="40" name="first_name" size="20" type="text" tabindex="3" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="last_name">Last Name:</label></td>
|
||||
<td class="field">
|
||||
<input id="last_name" class="required" maxlength="40" name="last_name" size="20" type="text" tabindex="4" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="address1">Company Address:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="required" name="address1" size="20" type="text" tabindex="5" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" name="address2" size="20" type="text" tabindex="6" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="city">City:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="required" name="city" size="20" type="text" tabindex="7" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="state">State:</label></td>
|
||||
<td class="field">
|
||||
<select id="state" class="required" name="state" style="margin-left: 4px;" tabindex="8">
|
||||
<option value="">Choose State:</option>
|
||||
<option value="AL">Alabama</option><option value="AK">Alaska</option><option value="AZ">Arizona</option><option value="AR">Arkansas</option><option value="CA">California</option><option value="CO">Colorado</option><option value="CT">Connecticut</option><option value="DE">Delaware</option><option value="FL">Florida</option><option value="GA">Georgia</option><option value="HI">Hawaii</option><option value="ID">Idaho</option><option value="IL">Illinois</option><option value="IN">Indiana</option><option value="IA">Iowa</option><option value="KS">Kansas</option><option value="KY">Kentucky</option><option value="LA">Louisiana</option><option value="ME">Maine</option><option value="MD">Maryland</option><option value="MA">Massachusetts</option><option value="MI">Michigan</option><option value="MN">Minnesota</option><option value="MS">Mississippi</option><option value="MO">Missouri</option><option value="MT">Montana</option><option value="NE">Nebraska</option><option value="NV">Nevada</option><option value="NH">New Hampshire</option><option value="NJ">New Jersey</option><option value="NM">New Mexico</option><option value="NY">New York</option><option value="NC">North Carolina</option><option value="ND">North Dakota</option><option value="OH">Ohio</option><option value="OK">Oklahoma</option><option value="OR">Oregon</option><option value="PA">Pennsylvania</option><option value="RI">Rhode Island</option><option value="SC">South Carolina</option><option value="SD">South Dakota</option><option value="TN">Tennessee</option><option value="TX">Texas</option><option value="UT">Utah</option><option value="VT">Vermont</option><option value="VA">Virginia</option><option value="WA">Washington</option><option value="WV">West Virginia</option><option value="WI">Wisconsin</option><option value="WY">Wyoming</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="label"><label for="zip">Zip:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="10" name="zip" style="width: 100px" type="text" class="required zipcode" tabindex="9" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="phone">Phone:</label></td>
|
||||
<td class="field">
|
||||
<input id="phone" maxlength="14" name="phone" type="text" class="required phone" tabindex="10" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h2 style="border-bottom: 1px solid #CCCCCC;">Login Information</h2>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="label"><label for="email">Email:</label></td>
|
||||
<td class="field">
|
||||
<input id="email" class="required email" remote="emails.php" maxlength="40" name="email" size="20" type="text" tabindex="11" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="label"><label for="password1">Password:</label></td>
|
||||
<td class="field">
|
||||
<input id="password1" class="required password" maxlength="40" name="password1" size="20" type="password" tabindex="12" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="password2">Retype Password:</label></td>
|
||||
<td class="field">
|
||||
<input id="password2" class="required" equalTo="#password1" maxlength="40" name="password2" size="20" type="password" tabindex="13" value="" />
|
||||
<div class="formError"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="buttonSubmit">
|
||||
<span></span>
|
||||
<input class="formButton" type="submit" value="Next" style="width: 140px" tabindex="14" />
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table><br /><br />
|
||||
</form>
|
||||
<br clear="all"/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end main content -->
|
||||
<br />
|
||||
</div> <!-- end col-main -->
|
||||
|
||||
<!-- start left col -->
|
||||
<div id="col-left" class="nav-left-back empty resize" style="position: absolute; min-height: 450px;">
|
||||
<div class="col-left-header-tab" style="position: absolute;">Signup</div>
|
||||
<div class="nav-left">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="left-nav-callout png" style="top: 15px; margin-bottom: 100px;">
|
||||
<img src="images/left-nav-callout-long.png" class="png" alt="" />
|
||||
<h6>Sign Up Process</h6>
|
||||
<a style="background-image: url(images/step1-24.gif); font-weight: normal; text-decoration: none; cursor: default;">Sign up with a valid credit card.</a>
|
||||
<a style="background-image: url(images/step2-24.gif); font-weight: normal; text-decoration: none; cursor: default;">Connect to your Google AdWords account. You will need your AdWords Customer ID.</a>
|
||||
<a style="background-image: url(images/step3-24.gif); font-weight: normal; text-decoration: none; cursor: default;">Start your 30 day trial. No payments until trial ends.</a>
|
||||
</div>
|
||||
|
||||
<div class="footerAddress">
|
||||
<b>Marketo Inc.</b><br />
|
||||
1710 S. Amphlett Blvd.<br />
|
||||
San Mateo, CA 94402 USA<br />
|
||||
</div>
|
||||
<br clear="all"/>
|
||||
</div> <!-- end left col -->
|
||||
|
||||
</div> </div> <!-- end page container 2 divs-->
|
||||
|
||||
<div id="footer-container" align="center">
|
||||
<div class="footer">
|
||||
<ul>
|
||||
<li><a href="..">Home</a></li>
|
||||
<li class="line-off"><a href="step2.htm">Second step</a></li>
|
||||
</ul>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
<!-- end page wrapper -->
|
||||
</div>
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
267
vendors/jquery-validate-1.7/demo/marketo/jquery.maskedinput.js
vendored
Normal file
|
@ -0,0 +1,267 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Josh Bush (digitalbush.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Version: 1.1
|
||||
* Release: 2007-09-08
|
||||
*/
|
||||
(function($) {
|
||||
//Helper Functions for Caret positioning
|
||||
function getCaretPosition(ctl){
|
||||
var res = {begin: 0, end: 0 };
|
||||
if (ctl.setSelectionRange){
|
||||
res.begin = ctl.selectionStart;
|
||||
res.end = ctl.selectionEnd;
|
||||
}else if (document.selection && document.selection.createRange){
|
||||
var range = document.selection.createRange();
|
||||
res.begin = 0 - range.duplicate().moveStart('character', -100000);
|
||||
res.end = res.begin + range.text.length;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
function setCaretPosition(ctl, pos){
|
||||
if(ctl.setSelectionRange){
|
||||
ctl.focus();
|
||||
ctl.setSelectionRange(pos,pos);
|
||||
}else if (ctl.createTextRange){
|
||||
var range = ctl.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', pos);
|
||||
range.moveStart('character', pos);
|
||||
range.select();
|
||||
}
|
||||
};
|
||||
|
||||
//Predefined character definitions
|
||||
var charMap={
|
||||
'9':"[0-9]",
|
||||
'a':"[A-Za-z]",
|
||||
'*':"[A-Za-z0-9]"
|
||||
};
|
||||
|
||||
//Helper method to inject character definitions
|
||||
$.mask={
|
||||
addPlaceholder : function(c,r){
|
||||
charMap[c]=r;
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.unmask=function(){
|
||||
return this.trigger("unmask");
|
||||
};
|
||||
|
||||
//Main Method
|
||||
$.fn.mask = function(mask,settings) {
|
||||
settings = $.extend({
|
||||
placeholder: "_",
|
||||
completed: null
|
||||
}, settings);
|
||||
|
||||
//Build Regex for format validation
|
||||
var reString="^";
|
||||
for(var i=0;i<mask.length;i++)
|
||||
reString+=(charMap[mask.charAt(i)] || ("\\"+mask.charAt(i)));
|
||||
reString+="$";
|
||||
var re = new RegExp(reString);
|
||||
|
||||
return this.each(function(){
|
||||
var input=$(this);
|
||||
var buffer=new Array(mask.length);
|
||||
var locked=new Array(mask.length);
|
||||
|
||||
//Build buffer layout from mask
|
||||
for(var i=0;i<mask.length;i++){
|
||||
locked[i]=charMap[mask.charAt(i)]==null;
|
||||
buffer[i]=locked[i]?mask.charAt(i):settings.placeholder;
|
||||
}
|
||||
|
||||
/*Event Bindings*/
|
||||
function focusEvent(){
|
||||
checkVal();
|
||||
writeBuffer();
|
||||
setTimeout(function(){
|
||||
setCaretPosition(input[0],0);
|
||||
},0);
|
||||
};
|
||||
input.bind("focus",focusEvent);
|
||||
|
||||
input.bind("blur",checkVal);
|
||||
|
||||
//Paste events for IE and Mozilla thanks to Kristinn Sigmundsson
|
||||
if ($.browser.msie)
|
||||
this.onpaste= function(){setTimeout(checkVal,0);};
|
||||
else if ($.browser.mozilla)
|
||||
this.addEventListener('input',checkVal,false);
|
||||
|
||||
var ignore=false; //Variable for ignoring control keys
|
||||
|
||||
function keydownEvent(e){
|
||||
var pos=getCaretPosition(this);
|
||||
var k = e.keyCode;
|
||||
ignore=(k < 16 || (k > 16 && k < 32 ) || (k > 32 && k < 41));
|
||||
|
||||
//delete selection before proceeding
|
||||
if((pos.begin-pos.end)!=0 && (!ignore || k==8 || k==46)){
|
||||
clearBuffer(pos.begin,pos.end);
|
||||
}
|
||||
//backspace and delete get special treatment
|
||||
if(k==8){//backspace
|
||||
while(pos.begin-->=0){
|
||||
if(!locked[pos.begin]){
|
||||
buffer[pos.begin]=settings.placeholder;
|
||||
if($.browser.opera){
|
||||
//Opera won't let you cancel the backspace, so we'll let it backspace over a dummy character.
|
||||
writeBuffer(pos.begin);
|
||||
setCaretPosition(this,pos.begin+1);
|
||||
}else{
|
||||
writeBuffer();
|
||||
setCaretPosition(this,pos.begin);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else if(k==46){//delete
|
||||
clearBuffer(pos.begin,pos.begin+1);
|
||||
writeBuffer();
|
||||
setCaretPosition(this,pos.begin);
|
||||
return false;
|
||||
}else if (k==27){
|
||||
clearBuffer(0,mask.length);
|
||||
writeBuffer();
|
||||
setCaretPosition(this,0);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
input.bind("keydown",keydownEvent);
|
||||
|
||||
function keypressEvent(e){
|
||||
if(ignore){
|
||||
ignore=false;
|
||||
return;
|
||||
}
|
||||
e=e||window.event;
|
||||
var k=e.charCode||e.keyCode||e.which;
|
||||
|
||||
var pos=getCaretPosition(this);
|
||||
var caretPos=pos.begin;
|
||||
|
||||
if(e.ctrlKey || e.altKey){//Ignore
|
||||
return true;
|
||||
}else if ((k>=41 && k<=122) ||k==32 || k>186){//typeable characters
|
||||
while(pos.begin<mask.length){
|
||||
var reString=charMap[mask.charAt(pos.begin)];
|
||||
var match;
|
||||
if(reString){
|
||||
var reChar=new RegExp(reString);
|
||||
match=String.fromCharCode(k).match(reChar);
|
||||
}else{//we're on a mask char, go forward and try again
|
||||
pos.begin+=1;
|
||||
pos.end=pos.begin;
|
||||
caretPos+=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(match)
|
||||
buffer[pos.begin]=String.fromCharCode(k);
|
||||
else
|
||||
return false;//reject char
|
||||
|
||||
while(++caretPos<mask.length){//seek forward to next typable position
|
||||
if(!locked[caretPos])
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}else
|
||||
return false;
|
||||
|
||||
writeBuffer();
|
||||
if(settings.completed && caretPos>=buffer.length)
|
||||
settings.completed.call(input);
|
||||
else
|
||||
setCaretPosition(this,caretPos);
|
||||
|
||||
return false;
|
||||
};
|
||||
input.bind("keypress",keypressEvent);
|
||||
|
||||
/*Helper Methods*/
|
||||
function clearBuffer(start,end){
|
||||
for(var i=start;i<end;i++){
|
||||
if(!locked[i])
|
||||
buffer[i]=settings.placeholder;
|
||||
}
|
||||
};
|
||||
|
||||
function writeBuffer(pos){
|
||||
var s="";
|
||||
for(var i=0;i<mask.length;i++){
|
||||
s+=buffer[i];
|
||||
if(i==pos)
|
||||
s+=settings.placeholder;
|
||||
}
|
||||
input.val(s);
|
||||
return s;
|
||||
};
|
||||
|
||||
function checkVal(){
|
||||
//try to place charcters where they belong
|
||||
var test=input.val();
|
||||
var pos=0;
|
||||
for(var i=0;i<mask.length;i++){
|
||||
if(!locked[i]){
|
||||
while(pos++<test.length){
|
||||
//Regex Test each char here.
|
||||
var reChar=new RegExp(charMap[mask.charAt(i)]);
|
||||
if(test.charAt(pos-1).match(reChar)){
|
||||
buffer[i]=test.charAt(pos-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var s=writeBuffer();
|
||||
if(!s.match(re)){
|
||||
input.val("");
|
||||
clearBuffer(0,mask.length);
|
||||
}
|
||||
};
|
||||
|
||||
input.one("unmask",function(){
|
||||
input.unbind("focus",focusEvent);
|
||||
input.unbind("blur",checkVal);
|
||||
input.unbind("keydown",keydownEvent);
|
||||
input.unbind("keypress",keypressEvent);
|
||||
if ($.browser.msie)
|
||||
this.onpaste= null;
|
||||
else if ($.browser.mozilla)
|
||||
this.removeEventListener('input',checkVal,false);
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
125
vendors/jquery-validate-1.7/demo/marketo/mktSignup.js
vendored
Normal file
|
@ -0,0 +1,125 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
jQuery.validator.addMethod("password", function( value, element ) {
|
||||
var result = this.optional(element) || value.length >= 6 && /\d/.test(value) && /[a-z]/i.test(value);
|
||||
if (!result) {
|
||||
element.value = "";
|
||||
var validator = this;
|
||||
setTimeout(function() {
|
||||
validator.blockFocusCleanup = true;
|
||||
element.focus();
|
||||
validator.blockFocusCleanup = false;
|
||||
}, 1);
|
||||
}
|
||||
return result;
|
||||
}, "Your password must be at least 6 characters long and contain at least one number and one character.");
|
||||
|
||||
// a custom method making the default value for companyurl ("http://") invalid, without displaying the "invalid url" message
|
||||
jQuery.validator.addMethod("defaultInvalid", function(value, element) {
|
||||
return value != element.defaultValue;
|
||||
}, "");
|
||||
|
||||
jQuery.validator.addMethod("billingRequired", function(value, element) {
|
||||
if ($("#bill_to_co").is(":checked"))
|
||||
return $(element).parents(".subTable").length;
|
||||
return !this.optional(element);
|
||||
}, "");
|
||||
|
||||
jQuery.validator.messages.required = "";
|
||||
$("form").validate({
|
||||
invalidHandler: function(e, validator) {
|
||||
var errors = validator.numberOfInvalids();
|
||||
if (errors) {
|
||||
var message = errors == 1
|
||||
? 'You missed 1 field. It has been highlighted below'
|
||||
: 'You missed ' + errors + ' fields. They have been highlighted below';
|
||||
$("div.error span").html(message);
|
||||
$("div.error").show();
|
||||
} else {
|
||||
$("div.error").hide();
|
||||
}
|
||||
},
|
||||
onkeyup: false,
|
||||
submitHandler: function() {
|
||||
$("div.error").hide();
|
||||
alert("submit! use link below to go to the other step");
|
||||
},
|
||||
messages: {
|
||||
password2: {
|
||||
required: " ",
|
||||
equalTo: "Please enter the same password as above"
|
||||
},
|
||||
email: {
|
||||
required: " ",
|
||||
email: "Please enter a valid email address, example: you@yourdomain.com",
|
||||
remote: jQuery.validator.format("{0} is already taken, please enter a different address.")
|
||||
}
|
||||
},
|
||||
debug:true
|
||||
});
|
||||
|
||||
$(".resize").vjustify();
|
||||
$("div.buttonSubmit").hoverClass("buttonSubmitHover");
|
||||
|
||||
if ($.browser.safari) {
|
||||
$("body").addClass("safari");
|
||||
}
|
||||
|
||||
$("input.phone").mask("(999) 999-9999");
|
||||
$("input.zipcode").mask("99999");
|
||||
var creditcard = $("#creditcard").mask("9999 9999 9999 9999");
|
||||
|
||||
$("#cc_type").change(
|
||||
function() {
|
||||
switch ($(this).val()){
|
||||
case 'amex':
|
||||
creditcard.unmask().mask("9999 999999 99999");
|
||||
break;
|
||||
default:
|
||||
creditcard.unmask().mask("9999 9999 9999 9999");
|
||||
break;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// toggle optional billing address
|
||||
var subTableDiv = $("div.subTableDiv");
|
||||
var toggleCheck = $("input.toggleCheck");
|
||||
toggleCheck.is(":checked")
|
||||
? subTableDiv.hide()
|
||||
: subTableDiv.show();
|
||||
$("input.toggleCheck").click(function() {
|
||||
if (this.checked == true) {
|
||||
subTableDiv.slideUp("medium");
|
||||
$("form").valid();
|
||||
} else {
|
||||
subTableDiv.slideDown("medium");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
$.fn.vjustify = function() {
|
||||
var maxHeight=0;
|
||||
$(".resize").css("height","auto");
|
||||
this.each(function(){
|
||||
if (this.offsetHeight > maxHeight) {
|
||||
maxHeight = this.offsetHeight;
|
||||
}
|
||||
});
|
||||
this.each(function(){
|
||||
$(this).height(maxHeight);
|
||||
if (this.offsetHeight > maxHeight) {
|
||||
$(this).height((maxHeight-(this.offsetHeight-maxHeight)));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.hoverClass = function(classname) {
|
||||
return this.hover(function() {
|
||||
$(this).addClass(classname);
|
||||
}, function() {
|
||||
$(this).removeClass(classname);
|
||||
});
|
||||
};
|
291
vendors/jquery-validate-1.7/demo/marketo/step2.htm
vendored
Normal file
|
@ -0,0 +1,291 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-200000126/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="title" content="Subscription Signup | Marketo" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="description" content="Marketo Search Marketing application" />
|
||||
<meta name="keywords" content="Marketo, Search Marketing" />
|
||||
<meta name="language" content="en" />
|
||||
<title>Subscription Signup | Marketo</title>
|
||||
|
||||
<link rel="shortcut icon" href="/favicon.ico" />
|
||||
|
||||
|
||||
<script src="../../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../../lib/jquery.metadata.js" type="text/javascript"></script>
|
||||
<script src="../../lib/jquery.ajaxQueue.js" type="text/javascript"></script>
|
||||
<script src="../../lib/jquery.delegate.js" type="text/javascript"></script>
|
||||
<script src="../../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" src="jquery.maskedinput.js"></script>
|
||||
<script type="text/javascript" src="mktSignup.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="stylesheet.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!--[if lte IE 6]>
|
||||
<link rel="stylesheet" type="text/css" media="all" href="ie6.css" />
|
||||
<![endif]-->
|
||||
|
||||
|
||||
|
||||
<!-- start page wrapper --><div id="letterbox">
|
||||
|
||||
<!-- start header container -->
|
||||
<div id="header-background">
|
||||
<div class="nav-global-container">
|
||||
|
||||
<div class="login"><a href="https://app.marketo.com"><span></span>Customer Login</a></div>
|
||||
<div class="logo"><a href="#"><img src="images/logo_marketo.gif" width="168" height="73" alt="Marketo" /></a></div>
|
||||
<div class="nav-global">
|
||||
<ul>
|
||||
<li><a href="#" class="nav-g01"><span></span>Home</a></li>
|
||||
<li><a href="#" class="nav-g02"><span></span>Products</a></li>
|
||||
<li><a href="#" class="nav-g04"><span></span>B2B Marketing Resources</a></li>
|
||||
|
||||
<li><a href="#" class="nav-g05"><span></span>About Marketo</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end header container -->
|
||||
<div class="line-grey-tier"></div>
|
||||
|
||||
<!-- start page container 2 div-->
|
||||
<div id="page-container" class="resize"><div id="page-content-inner" class="resize">
|
||||
|
||||
<!-- start col-main -->
|
||||
|
||||
<div id="col-main" class="resize" style="">
|
||||
|
||||
|
||||
|
||||
<!-- start main content -->
|
||||
<div class="main-content resize">
|
||||
|
||||
<div class="action-container" style="display:none;"></div>
|
||||
|
||||
|
||||
<h1>Step 2 of 2</h1>
|
||||
<h2>Billing Information</h2>
|
||||
<p>
|
||||
</p>
|
||||
<br clear="all" />
|
||||
<div>
|
||||
<form id="billingForm" action="" method="get" >
|
||||
|
||||
<div class="error" style="display:none;">
|
||||
<img src="images/warning.gif" alt="Warning!" width="24" height="24" style="float:left; margin: -5px 10px 0px 0px; " />
|
||||
|
||||
<span></span>.<br clear="all" />
|
||||
</div>
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td class="label" style="vertical-align: top; padding-top: 8px;">Billing Address:</td>
|
||||
<td class="field" style="font-weight: normal">
|
||||
<div class="billingAddressControl">
|
||||
|
||||
<input type="checkbox" id="bill_to_co" name="bill_to_co" class="toggleCheck" checked="checked" style="width: auto;" tabindex="1" />
|
||||
<label for="bill_to_co" style="cursor:pointer">Same as Company Address</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="subTable">
|
||||
<td colspan="2">
|
||||
<div style="background-color: #EEEEEE; border: 1px solid #CCCCCC; padding: 10px;" class="subTableDiv">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td class="label"><label for="bill_first_name">First Name:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="billingRequired" name="bill_first_name" size="20" type="text" tabindex="2" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="bill_last_name">Last Name:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="billingRequired" name="bill_last_name" size="20" type="text" tabindex="3" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="bill_email">Email:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="billingRequired email" remote="emails.php" name="email" size="20" type="text" tabindex="4" value="" />
|
||||
<div class="formError"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="bill_address1">Address:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="billingRequired" name="bill_address1" size="20" type="text" tabindex="5" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" name="bill_address2" size="20" type="text" tabindex="6" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="bill_city">City:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" class="billingRequired" name="bill_city" size="20" type="text" tabindex="7" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="bill_state">State:</label></td>
|
||||
<td class="field">
|
||||
<select id="bill_state" class="billingRequired" name="bill_state" style="margin-left: 4px;" tabindex="8">
|
||||
<option value="">Choose State</option>
|
||||
<option value="AL">Alabama</option><option value="AK">Alaska</option><option value="AZ">Arizona</option><option value="AR">Arkansas</option><option value="CA">California</option><option value="CO">Colorado</option><option value="CT">Connecticut</option><option value="DE">Delaware</option><option value="FL">Florida</option><option value="GA">Georgia</option><option value="HI">Hawaii</option><option value="ID">Idaho</option><option value="IL">Illinois</option><option value="IN">Indiana</option><option value="IA">Iowa</option><option value="KS">Kansas</option><option value="KY">Kentucky</option><option value="LA">Louisiana</option><option value="ME">Maine</option><option value="MD">Maryland</option><option value="MA">Massachusetts</option><option value="MI">Michigan</option><option value="MN">Minnesota</option><option value="MS">Mississippi</option><option value="MO">Missouri</option><option value="MT">Montana</option><option value="NE">Nebraska</option><option value="NV">Nevada</option><option value="NH">New Hampshire</option><option value="NJ">New Jersey</option><option value="NM">New Mexico</option><option value="NY">New York</option><option value="NC">North Carolina</option><option value="ND">North Dakota</option><option value="OH">Ohio</option><option value="OK">Oklahoma</option><option value="OR">Oregon</option><option value="PA">Pennsylvania</option><option value="RI">Rhode Island</option><option value="SC">South Carolina</option><option value="SD">South Dakota</option><option value="TN">Tennessee</option><option value="TX">Texas</option><option value="UT">Utah</option><option value="VT">Vermont</option><option value="VA">Virginia</option><option value="WA">Washington</option><option value="WV">West Virginia</option><option value="WI">Wisconsin</option><option value="WY">Wyoming</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="label"><label for="bill_zip">Zip:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="10" class="billingRequired zipcode" name="bill_zip" style="width: 100px" type="text" class="zipcode" tabindex="9" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="label"><label for="bill_phone">Phone:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="14" class="billingRequired phone" name="bill_phone" style="width: 100px" type="text" class="phone" tabindex="10" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Credit Card Type:</td>
|
||||
<td class="field">
|
||||
<select id="cc_type" class="required" name="cc_type" class="creditCardType" tabindex="11">
|
||||
<option value="">Choose Credit Card</option>
|
||||
<option value="amex">American Express</option>
|
||||
<option value="discover">Discover</option>
|
||||
<option value="mastercard">MasterCard</option>
|
||||
<option value="visa">Visa</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Expiration:</td>
|
||||
<td class="field">
|
||||
<select id="cc_exp_month" name="cc_exp_month" title="ExpirationMonth" tabindex="12">
|
||||
<option value="01">01 - Jan</option>
|
||||
<option value="02">02 - Feb</option>
|
||||
<option value="03">03 - Mar</option>
|
||||
<option value="04">04 - Apr</option>
|
||||
<option value="05">05 - May</option>
|
||||
<option value="06">06 - Jun</option>
|
||||
<option value="07">07 - Jul</option>
|
||||
<option value="08">08 - Aug</option>
|
||||
<option value="09">09 - Sep</option>
|
||||
<option value="10">10 - Oct</option>
|
||||
<option value="11">11 - Nov</option>
|
||||
<option value="12">12 - Dec</option>
|
||||
</select>
|
||||
<select id="cc_exp_year" name="cc_exp_year" title="ExpirationYear" tabindex="13">
|
||||
<option value="2007">2007</option>
|
||||
<option value="2008" selected="selected">2008</option>
|
||||
<option value="2009">2009</option>
|
||||
<option value="2010">2010</option>
|
||||
<option value="2011">2011</option>
|
||||
<option value="2012">2012</option>
|
||||
<option value="2013">2013</option>
|
||||
<option value="2014">2014</option>
|
||||
<option value="2015">2015</option>
|
||||
<option value="2016">2016</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="credit_card">Credit Card Number:</label></td>
|
||||
<td class="field">
|
||||
<input maxlength="40" id="creditcard" class="required" name="credit_card" size="20" type="text" tabindex="14" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label for="cc_cvv">Security Code:</label></td>
|
||||
<td class="field">
|
||||
<input id="ccNumber" class="required" maxlength="4" name="cc_cvv" style="width: 30px;" type="text" style="vertical-align: top;" tabindex="16" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div class="buttonSubmit">
|
||||
<span></span>
|
||||
<input class="formButton" type="submit" value="Finish" style="width: 180px" />
|
||||
</div><br clear="all"/>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br clear="all" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end main content -->
|
||||
<br />
|
||||
</div> <!-- end col-main -->
|
||||
|
||||
<!-- start left col -->
|
||||
<div id="col-left" class="nav-left-back empty resize" style="position: absolute; min-height: 450px;">
|
||||
<div class="col-left-header-tab" style="position: absolute;">Signup</div>
|
||||
<div class="nav-left">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="left-nav-callout png" style="top: 15px; margin-bottom: 100px;">
|
||||
<img src="images/left-nav-callout-long.png" class="png" alt="" />
|
||||
<h6>Sign Up Process</h6>
|
||||
<a style="background-image: url(images/step1-24.gif); font-weight: normal; text-decoration: none; cursor: default;">Sign up with a valid credit card.</a>
|
||||
<a style="background-image: url(images/step2-24.gif); font-weight: normal; text-decoration: none; cursor: default;">Connect to your Google AdWords account. You will need your AdWords Customer ID.</a>
|
||||
|
||||
<a target="_blank" style="background-image: url(images/step3-24.gif); font-weight: normal; text-decoration: none; cursor: default;">Start your 30 day trial. No payments until trial ends.</a>
|
||||
</div>
|
||||
|
||||
<div class="footerAddress">
|
||||
<b>Marketo Inc.</b><br />
|
||||
1710 S. Amphlett Blvd.<br />
|
||||
San Mateo, CA 94402 USA<br />
|
||||
</div>
|
||||
<br clear="all"/>
|
||||
</div> <!-- end left col -->
|
||||
|
||||
</div> </div> <!-- end page container 2 divs-->
|
||||
|
||||
<div id="footer-container" align="center">
|
||||
<div class="footer">
|
||||
<ul>
|
||||
<li><a href="..">Home</a></li>
|
||||
<li class="line-off"><a href=".">Back to first step</a></li>
|
||||
</ul>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
<!-- end page wrapper -->
|
||||
</div>
|
||||
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
1179
vendors/jquery-validate-1.7/demo/marketo/stylesheet.css
vendored
Normal file
BIN
vendors/jquery-validate-1.7/demo/milk/bg.gif
vendored
Normal file
After Width: | Height: | Size: 73 B |
10
vendors/jquery-validate-1.7/demo/milk/emails.php
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
$request = trim(strtolower($_REQUEST['email']));
|
||||
$emails = array('glen@marketo.com', 'george@bush.gov', 'me@god.com', 'aboutface@cooper.com', 'steam@valve.com', 'bill@gates.com');
|
||||
$valid = 'true';
|
||||
foreach($emails as $email) {
|
||||
if( strtolower($email) == $request )
|
||||
$valid = '"Thats already taken."';
|
||||
}
|
||||
echo $valid;
|
||||
?>
|
10
vendors/jquery-validate-1.7/demo/milk/emails.phps
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
$request = trim(strtolower($_REQUEST['value']));
|
||||
$emails = array('glen@marketo.com', 'george@bush.gov', 'me@god.com', 'aboutface@cooper.com', 'steam@valve.com', 'bill@gates.com');
|
||||
$valid = 'true';
|
||||
foreach($emails as $email) {
|
||||
if( strtolower($email) == $request )
|
||||
$valid = 'false';
|
||||
}
|
||||
echo $valid;
|
||||
?>
|
235
vendors/jquery-validate-1.7/demo/milk/index.html
vendored
Normal file
|
@ -0,0 +1,235 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>Remember The Milk signup form - jQuery Validate plugin demo - with friendly permission from the RTM team</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="milk.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../css/chili.css" />
|
||||
|
||||
<script src="../../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<style type="text/css">
|
||||
pre { text-align: left; }
|
||||
</style>
|
||||
|
||||
<script id="demo" type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// validate signup form on keyup and submit
|
||||
var validator = $("#signupform").validate({
|
||||
rules: {
|
||||
firstname: "required",
|
||||
lastname: "required",
|
||||
username: {
|
||||
required: true,
|
||||
minlength: 2,
|
||||
remote: "users.php"
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
minlength: 5
|
||||
},
|
||||
password_confirm: {
|
||||
required: true,
|
||||
minlength: 5,
|
||||
equalTo: "#password"
|
||||
},
|
||||
email: {
|
||||
required: true,
|
||||
email: true,
|
||||
remote: "emails.php"
|
||||
},
|
||||
dateformat: "required",
|
||||
terms: "required"
|
||||
},
|
||||
messages: {
|
||||
firstname: "Enter your firstname",
|
||||
lastname: "Enter your lastname",
|
||||
username: {
|
||||
required: "Enter a username",
|
||||
minlength: jQuery.format("Enter at least {0} characters"),
|
||||
remote: jQuery.format("{0} is already in use")
|
||||
},
|
||||
password: {
|
||||
required: "Provide a password",
|
||||
rangelength: jQuery.format("Enter at least {0} characters")
|
||||
},
|
||||
password_confirm: {
|
||||
required: "Repeat your password",
|
||||
minlength: jQuery.format("Enter at least {0} characters"),
|
||||
equalTo: "Enter the same password as above"
|
||||
},
|
||||
email: {
|
||||
required: "Please enter a valid email address",
|
||||
minlength: "Please enter a valid email address",
|
||||
remote: jQuery.format("{0} is already in use")
|
||||
},
|
||||
dateformat: "Choose your preferred dateformat",
|
||||
terms: " "
|
||||
},
|
||||
// the errorPlacement has to take the table layout into account
|
||||
errorPlacement: function(error, element) {
|
||||
if ( element.is(":radio") )
|
||||
error.appendTo( element.parent().next().next() );
|
||||
else if ( element.is(":checkbox") )
|
||||
error.appendTo ( element.next() );
|
||||
else
|
||||
error.appendTo( element.parent().next() );
|
||||
},
|
||||
// specifying a submitHandler prevents the default submit, good for the demo
|
||||
submitHandler: function() {
|
||||
alert("submitted!");
|
||||
},
|
||||
// set this class to error-labels to indicate valid fields
|
||||
success: function(label) {
|
||||
// set as text for IE
|
||||
label.html(" ").addClass("checked");
|
||||
}
|
||||
});
|
||||
|
||||
// propose username by combining first- and lastname
|
||||
$("#username").focus(function() {
|
||||
var firstname = $("#firstname").val();
|
||||
var lastname = $("#lastname").val();
|
||||
if(firstname && lastname && !this.value) {
|
||||
this.value = firstname + "." + lastname;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div id="header">
|
||||
<div id="headerlogo"><img src="milk.png" alt="Remember The Milk" /></div>
|
||||
</div>
|
||||
<div style="clear: both;"><div></div></div>
|
||||
|
||||
|
||||
<div class="content">
|
||||
<div id="signupbox">
|
||||
<div id="signuptab">
|
||||
<ul>
|
||||
<li id="signupcurrent"><a href=" ">Signup</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="signupwrap">
|
||||
<form id="signupform" autocomplete="off" method="get" action="">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label"><label id="lfirstname" for="firstname">First Name</label></td>
|
||||
<td class="field"><input id="firstname" name="firstname" type="text" value="" maxlength="100" /></td>
|
||||
<td class="status"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label id="llastname" for="lastname">Last Name</label></td>
|
||||
<td class="field"><input id="lastname" name="lastname" type="text" value="" maxlength="100" /></td>
|
||||
<td class="status"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label id="lusername" for="username">Username</label></td>
|
||||
<td class="field"><input id="username" name="username" type="text" value="" maxlength="50" /></td>
|
||||
<td class="status"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label id="lpassword" for="password">Password</label></td>
|
||||
<td class="field"><input id="password" name="password" type="password" maxlength="50" value="" /></td>
|
||||
<td class="status"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label id="lpassword_confirm" for="password_confirm">Confirm Password</label></td>
|
||||
<td class="field"><input id="password_confirm" name="password_confirm" type="password" maxlength="50" value="" /></td>
|
||||
<td class="status"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label id="lemail" for="email">Email Address</label></td>
|
||||
<td class="field"><input id="email" name="email" type="text" value="" maxlength="150" /></td>
|
||||
<td class="status"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label>Which Looks Right</label></td>
|
||||
<td class="field" colspan="2" style="vertical-align: top; padding-top: 2px;">
|
||||
<table>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td style="padding-right: 5px;">
|
||||
<input id="dateformat_eu" name="dateformat" type="radio" value="0" />
|
||||
<label id="ldateformat_eu" for="dateformat_eu">14/02/07</label>
|
||||
</td>
|
||||
<td style="padding-left: 5px;">
|
||||
<input id="dateformat_am" name="dateformat" type="radio" value="1" />
|
||||
<label id="ldateformat_am" for="dateformat_am">02/14/07</label>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="label"> </td>
|
||||
<td class="field" colspan="2">
|
||||
<div id="termswrap">
|
||||
<input id="terms" type="checkbox" name="terms" />
|
||||
<label id="lterms" for="terms">I have read and accept the Terms of Use.</label>
|
||||
</div> <!-- /termswrap -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><label id="lsignupsubmit" for="signupsubmit">Signup</label></td>
|
||||
<td class="field" colspan="2">
|
||||
<input id="signupsubmit" name="signup" type="submit" value="Signup" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("<a href='#'>Show script used on this page</a><br/>").appendTo("body").click(function() {
|
||||
script.toggle();
|
||||
return false;
|
||||
});
|
||||
$("<a href='#'>Show serverside script</a>").appendTo("body").click(function() {
|
||||
serverscript.toggle();
|
||||
return false;
|
||||
});
|
||||
var script = $("<code class='mix'>").html( $("#demo").html() ).wrap("<pre></pre>").parent().hide().appendTo("body");
|
||||
var serverscript;
|
||||
$.get("users.phps", function(response) {
|
||||
serverscript = $("<pre>").hide().html( response ).appendTo("body");
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="../js/chili-1.7.pack.js" type="text/javascript"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
vendors/jquery-validate-1.7/demo/milk/left_white.png
vendored
Normal file
After Width: | Height: | Size: 538 B |
236
vendors/jquery-validate-1.7/demo/milk/milk.css
vendored
Normal file
|
@ -0,0 +1,236 @@
|
|||
/* GENERAL ELEMENTS */
|
||||
|
||||
* { margin: 0; padding: 0; }
|
||||
|
||||
body, input, select, textarea { font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; }
|
||||
body { color: #333; background-color: #fff; text-align: center; }
|
||||
|
||||
a:link { color:#0060BF; text-decoration: underline; }
|
||||
a:visited { color:#0060BF; text-decoration: underline; }
|
||||
a:active { color:#0060BF; text-decoration: underline; }
|
||||
a:hover { color:#000000; text-decoration: underline; }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 { font-family: "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, arial, helvetica, sans-serif; font-weight: bold; color: #666; }
|
||||
h1 { font-size: 1.8em; margin: 0em 0em 0.6em 0em; color: #EC5800; }
|
||||
h2 { font-size: 1.5em; margin: 1.2em 0em 0.4em 0em; }
|
||||
h3 { font-size: 1.4em; margin: 1.2em 0em 0.4em 0em; color: #EC5800; }
|
||||
h4 { font-size: 1.2em; margin: 1.2em 0em 0.4em 0em; }
|
||||
h5 { font-size: 1.0em; margin: 1.2em 0em 0.4em 0em; }
|
||||
h6 { font-size: 0.8em; margin: 1.2em 0em 0.4em 0em; }
|
||||
|
||||
img { border: 0px; }
|
||||
|
||||
p { font-size: 1.0em; line-height: 1.3em; margin: 1.2em 0em 1.2em 0em; }
|
||||
li > p { margin-top: 0.2em; }
|
||||
pre { font-family: monospace; font-size: 1.0em; }
|
||||
strong, b { font-weight: bold; }
|
||||
|
||||
/* PAGE ELEMENTS */
|
||||
|
||||
/* Content */
|
||||
|
||||
#content { margin: 0em auto; width: 765px; padding: 10px 0 10px 0; text-align: left; /* Win IE5 */ }
|
||||
.content { margin-left: 4.5em; margin-right: 4.5em; }
|
||||
.content ol, .content ul, .content li { font-size: 1.0em; line-height: 1.3em; margin: 0.2em 0 0.1em 1.5em; }
|
||||
.content ol.terms li { margin-bottom: 1em; }
|
||||
|
||||
/* Header */
|
||||
|
||||
#header { padding-bottom: 10em; }
|
||||
#headerlogo { float: left; }
|
||||
#headerlogo img { width: 188px; height: 83px; }
|
||||
#headernav { float: right; }
|
||||
|
||||
label { font-weight: bold; }
|
||||
#reminders label { font-weight: normal; }
|
||||
|
||||
table.tabbedtable { padding-left: 3em; }
|
||||
table.tabbedtable td { padding-bottom: 5px; }
|
||||
table.tabbedtable label { text-align: right; padding-right: 9px; }
|
||||
.hiddenlabel { visibility: hidden; }
|
||||
.largelink { border: 1px solid #cacaca; padding: 10px; background-color: #E8EEF7; font-size: 1.2em; font-weight: bold; }
|
||||
.largelinkwrap { padding-top: 10px; padding-bottom: 10px; }
|
||||
|
||||
|
||||
|
||||
#signuptab {
|
||||
float:left;
|
||||
width:100%;
|
||||
background:#fff url("bg.gif") repeat-x bottom;
|
||||
font-size: 1.0em;
|
||||
line-height: normal;
|
||||
}
|
||||
#signuptab ul {
|
||||
margin:0;
|
||||
padding: 0px 10px 0px 10px;
|
||||
list-style:none;
|
||||
}
|
||||
#signuptab li {
|
||||
float:left;
|
||||
background:url("left_white.png") no-repeat left top;
|
||||
margin:0;
|
||||
padding:0 3px 0 9px;
|
||||
border-bottom:1px solid #CACACA;
|
||||
}
|
||||
#signuptab a {
|
||||
float:left;
|
||||
display:block;
|
||||
width:.1em;
|
||||
background:url("right_white.png") no-repeat right top;
|
||||
padding:2px 15px 0px 6px;
|
||||
text-decoration:none;
|
||||
font-weight:bold;
|
||||
color:#fff;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#signuptab > ul a {width:auto;}
|
||||
/* Commented Backslash Hack hides rule from IE5-Mac \*/
|
||||
#signuptab a {float:none;}
|
||||
/* End IE5-Mac hack */
|
||||
#signuptab a:hover {
|
||||
color:#333;
|
||||
}
|
||||
#signuptab #signupcurrent {
|
||||
background-position:0 -150px;
|
||||
border-width:0;
|
||||
}
|
||||
#signuptab #signupcurrent a {
|
||||
background-position:100% -150px;
|
||||
padding-bottom:1px;
|
||||
color:#000;
|
||||
}
|
||||
#signuptab li:hover, #signuptab li:hover a {
|
||||
background-position:0% -150px;
|
||||
color:#000;
|
||||
}
|
||||
#signuptab li:hover a {
|
||||
background-position:100% -150px;
|
||||
}
|
||||
|
||||
/* Signup box */
|
||||
|
||||
#signupbox {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin: 0em auto;
|
||||
}
|
||||
|
||||
#signupwrap {
|
||||
border: 1px solid #CACACA;
|
||||
border-top: 0;
|
||||
text-align: left;
|
||||
padding: 35px 10px 20px 30px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* Unsupported browsers */
|
||||
|
||||
.orange_rbcontent { padding: 0.4em; }
|
||||
.orange_rbroundbox { width: 100%; }
|
||||
|
||||
#unsupported {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/*#content {
|
||||
padding-top: 15px;
|
||||
}*/
|
||||
|
||||
/* Signup form */
|
||||
|
||||
#signupform table {
|
||||
border-spacing: 0px;
|
||||
border-collapse: collapse;
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
#signupform .label {
|
||||
padding-top: 2px;
|
||||
padding-right: 8px;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
width: 125px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#signupform .field {
|
||||
padding-bottom: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#signupform .status {
|
||||
padding-top: 2px;
|
||||
padding-left: 8px;
|
||||
vertical-align: top;
|
||||
width: 246px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#signupform .textfield {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
#signupform label.error {
|
||||
background:url("../images/unchecked.gif") no-repeat 0px 0px;
|
||||
padding-left: 16px;
|
||||
padding-bottom: 2px;
|
||||
font-weight: bold;
|
||||
color: #EA5200;
|
||||
}
|
||||
|
||||
#signupform label.checked {
|
||||
background:url("../images/checked.gif") no-repeat 0px 0px;
|
||||
}
|
||||
|
||||
#signupform .success_msg {
|
||||
font-weight: bold;
|
||||
color: #0060BF;
|
||||
margin-left: 19px;
|
||||
}
|
||||
|
||||
#signupform #dateformatStatus, #signupform #termsStatus {
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
#signupform #dateformat_eu {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#signupform #ldateformat_eu {
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#signupform #dateformat_am {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#signupform #ldateformat_am {
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#signupform #termswrap {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#signupform #terms {
|
||||
vertical-align: middle;
|
||||
float: left;
|
||||
display: block;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#signupform #lterms {
|
||||
font-weight: normal;
|
||||
vertical-align: middle;
|
||||
float: left;
|
||||
display: block;
|
||||
width: 350px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
#signupform #lsignupsubmit {
|
||||
visibility: hidden;
|
||||
}
|
BIN
vendors/jquery-validate-1.7/demo/milk/milk.png
vendored
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
vendors/jquery-validate-1.7/demo/milk/right_white.png
vendored
Normal file
After Width: | Height: | Size: 1.5 KiB |
12
vendors/jquery-validate-1.7/demo/milk/users.php
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
$request = trim(strtolower($_REQUEST['username']));
|
||||
//sleep(2);
|
||||
usleep(150000);
|
||||
$users = array('asdf', 'Peter', 'Peter2', 'George');
|
||||
$valid = 'true';
|
||||
foreach($users as $user) {
|
||||
if( strtolower($user) == $request )
|
||||
$valid = 'false';
|
||||
}
|
||||
echo $valid;
|
||||
?>
|
10
vendors/jquery-validate-1.7/demo/milk/users.phps
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
$request = trim(strtolower($_REQUEST['value']));
|
||||
$users = array('asdf', 'Peter', 'Peter2', 'George');
|
||||
$valid = 'true';
|
||||
foreach($users as $user) {
|
||||
if( strtolower($user) == $request )
|
||||
$valid = 'false';
|
||||
}
|
||||
echo $valid;
|
||||
?>
|
412
vendors/jquery-validate-1.7/demo/multipart/index.html
vendored
Normal file
|
@ -0,0 +1,412 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
|
||||
<title>jQuery accordion form with validation</title>
|
||||
|
||||
<link rel="stylesheet" href="../assets/demo_blue.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="../../lib/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="js/jquery.maskedinput-1.0.js"></script>
|
||||
<script type="text/javascript" src="js/ui.core.js"></script>
|
||||
<script type="text/javascript" src="js/ui.accordion.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#recordClientPhone").mask("(999) 999-9999");
|
||||
$("#recordClientPhoneAlt").mask("(999) 999-9999");
|
||||
$("#recordClientZip").mask("99999");
|
||||
$("#recordPropertyZip").mask("99999");
|
||||
$("#recordPurchaseZip").mask("99999");
|
||||
|
||||
// add * to required field labels
|
||||
$('label.required').append(' <strong>*</strong> ');
|
||||
|
||||
// accordion functions
|
||||
var accordion = $("#stepForm").accordion();
|
||||
var current = 0;
|
||||
|
||||
$.validator.addMethod("pageRequired", function(value, element) {
|
||||
var $element = $(element)
|
||||
function match(index) {
|
||||
return current == index && $(element).parents("#sf" + (index + 1)).length;
|
||||
}
|
||||
if (match(0) || match(1) || match(2)) {
|
||||
return !this.optional(element);
|
||||
}
|
||||
return "dependency-mismatch";
|
||||
}, $.validator.messages.required)
|
||||
|
||||
var v = $("#cmaForm").validate({
|
||||
errorClass: "warning",
|
||||
onkeyup: false,
|
||||
onblur: false,
|
||||
submitHandler: function() {
|
||||
alert("Submitted, thanks!");
|
||||
}
|
||||
});
|
||||
|
||||
// back buttons do not need to run validation
|
||||
$("#sf2 .prevbutton").click(function(){
|
||||
accordion.accordion("activate", 0);
|
||||
current = 0;
|
||||
});
|
||||
$("#sf3 .prevbutton").click(function(){
|
||||
accordion.accordion("activate", 1);
|
||||
current = 1;
|
||||
});
|
||||
// these buttons all run the validation, overridden by specific targets above
|
||||
$(".open2").click(function() {
|
||||
if (v.form()) {
|
||||
accordion.accordion("activate", 2);
|
||||
current = 2;
|
||||
}
|
||||
});
|
||||
$(".open1").click(function() {
|
||||
if (v.form()) {
|
||||
accordion.accordion("activate", 1);
|
||||
current = 1;
|
||||
}
|
||||
});
|
||||
$(".open0").click(function() {
|
||||
if (v.form()) {
|
||||
accordion.accordion("activate", 0);
|
||||
current = 0;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="wrap">
|
||||
<div id="main">
|
||||
|
||||
<h1 class="top bottom"><span>Help me</span> Buy and Sell a House</h1>
|
||||
<h2>This form is quick & easy to complete - in only 3 steps!</h2>
|
||||
<form name="cmaForm" id="cmaForm" method="post">
|
||||
<input type="hidden" name="recordRequestPrimaryServiceID" id="recordRequestPrimaryServiceID" value="100" />
|
||||
<input type="hidden" name="recordClientServices" id="recordClientServices" value="1,3" />
|
||||
<ul id="stepForm" class="ui-accordion-container">
|
||||
<li id="sf1"><a href='#' class="ui-accordion-link"> </a>
|
||||
<div>
|
||||
<fieldset><legend> Step 1 of 3 </legend>
|
||||
<div class="requiredNotice">*Required Field</div>
|
||||
<h3 class="stepHeader">Tell us about the property you're buying</h3>
|
||||
<label for="recordPurchaseMetRealtor" class="input required">Are you currently working with a<br />
|
||||
real estate agent? </label> No: <input name="recordPurchaseMetRealtor" type="radio" checked="checked" class="inputclass" value="0" /> Yes: <input name="recordPurchaseMetRealtor" type="radio" class="inputclass pageRequired" value="1" title="Please choose Yes or No" />
|
||||
<div class="formspacer"></div>
|
||||
<label for="recordPurchaseTimeFrameID" class="input required">When would you like to move?</label> <select name="recordPurchaseTimeFrameID" id="recordPurchaseTimeFrameID" class="inputclass pageRequired" title="Select a Time Frame">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">Less than 3 months</option>
|
||||
<option value="2">3-6 months</option>
|
||||
<option value="3">6-9 months</option>
|
||||
<option value="4">9-12 months</option>
|
||||
<option value="5">Over 12 months</option>
|
||||
</select> <br />
|
||||
<label for="recordPurchasePriceRangeID" class="input required">Purchase price range:</label> <select name="recordPurchasePriceRangeID" id="recordPurchasePriceRangeID" class="inputclass pageRequired" title="Select a Price Range">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1"></option>
|
||||
<option value="2">$75,000 - $100,000</option>
|
||||
<option value="3">$100,000 - $125,000</option>
|
||||
<option value="4">$125,000 - $150,000</option>
|
||||
<option value="5">$150,000 - $200,000</option>
|
||||
<option value="6">$200,000 - $250,000</option>
|
||||
<option value="7">$250,000 - $300,000</option>
|
||||
<option value="8">$300,000 - $350,000</option>
|
||||
<option value="9">$350,000 - $400,000</option>
|
||||
<option value="10">$400,000 - $500,000</option>
|
||||
<option value="11">$500,000 - $700,000</option>
|
||||
<option value="12">$700,000 - $900,000</option>
|
||||
<option value="13">> $900,000</option>
|
||||
</select> <br />
|
||||
<label for="recordPurchaseState" class="input required">State:</label> <select name="recordPurchaseState" id="recordPurchaseState" class="inputclass pageRequired" title="Select a State">
|
||||
<option value="">-Select-</option>
|
||||
<option value="AL">Alabama</option>
|
||||
<option value="AK">Alaska</option>
|
||||
<option value="AZ">Arizona</option>
|
||||
<option value="AR">Arkansas</option>
|
||||
<option value="CA">California</option>
|
||||
<option value="CO">Colorado</option>
|
||||
<option value="CT">Connecticut</option>
|
||||
<option value="DE">Delaware</option>
|
||||
<option value="DC">Dist of Columbia</option>
|
||||
<option value="FL">Florida</option>
|
||||
<option value="GA">Georgia</option>
|
||||
<option value="HI">Hawaii</option>
|
||||
<option value="ID">Idaho</option>
|
||||
<option value="IL">Illinois</option>
|
||||
<option value="IN">Indiana</option>
|
||||
<option value="IA">Iowa</option>
|
||||
<option value="KS">Kansas</option>
|
||||
<option value="KY">Kentucky</option>
|
||||
<option value="LA">Louisiana</option>
|
||||
<option value="ME">Maine</option>
|
||||
<option value="MD">Maryland</option>
|
||||
<option value="MA">Massachusetts</option>
|
||||
<option value="MI">Michigan</option>
|
||||
<option value="MN">Minnesota</option>
|
||||
<option value="MS">Mississippi</option>
|
||||
<option value="MO">Missouri</option>
|
||||
<option value="MT">Montana</option>
|
||||
<option value="NE">Nebraska</option>
|
||||
<option value="NV">Nevada</option>
|
||||
<option value="NH">New Hampshire</option>
|
||||
<option value="NJ">New Jersey</option>
|
||||
<option value="NM">New Mexico</option>
|
||||
<option value="NY">New York</option>
|
||||
<option value="NC">North Carolina</option>
|
||||
<option value="ND">North Dakota</option>
|
||||
<option value="OH">Ohio</option>
|
||||
<option value="OK">Oklahoma</option>
|
||||
<option value="OR">Oregon</option>
|
||||
<option value="PA" selected="selected">Pennsylvania</option>
|
||||
<option value="RI">Rhode Island</option>
|
||||
<option value="SC">South Carolina</option>
|
||||
<option value="SD">South Dakota</option>
|
||||
<option value="TN">Tennessee</option>
|
||||
<option value="TX">Texas</option>
|
||||
<option value="UT">Utah</option>
|
||||
<option value="VT">Vermont</option>
|
||||
<option value="VA">Virginia</option>
|
||||
<option value="WA">Washington</option>
|
||||
<option value="WV">West Virginia</option>
|
||||
<option value="WI">Wisconsin</option>
|
||||
<option value="WY">Wyoming</option>
|
||||
</select> <br />
|
||||
|
||||
<label for="recordPurchasePropertyTypeID" class="input">Desired property type:</label> <select name="recordPurchasePropertyTypeID" id="recordPurchasePropertyTypeID" class="inputclass" title="Select a Property Type">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">Single Family Detached</option>
|
||||
<option value="2">Condo</option>
|
||||
<option value="3">Townhouse</option>
|
||||
<option value="4">Rental</option>
|
||||
<option value="5">Multi-Family</option>
|
||||
<option value="6">Vacation Home</option>
|
||||
<option value="7">Other</option>
|
||||
</select> <br />
|
||||
<div class="buttonWrapper"><input name="formNext1" type="button" class="open1 nextbutton" value="Next" alt="Next" title="Next" /></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</li>
|
||||
<li id="sf2">
|
||||
<a href='#' class="ui-accordion-link">
|
||||
</a>
|
||||
<div>
|
||||
<fieldset><legend> Step 2 of 3 </legend>
|
||||
<div class="requiredNotice">*Required Field</div>
|
||||
<h3 class="stepHeader">Tell us about the property you're selling</h3>
|
||||
<label for="recordClientTimeFrameID" class="input required">When would you like to sell?</label> <select name="recordClientTimeFrameID" id="recordClientTimeFrameID" class="inputclass pageRequired" title="Select a Time Frame">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">Less than 3 months</option>
|
||||
<option value="2">3-6 months</option>
|
||||
<option value="3">6-9 months</option>
|
||||
<option value="4">9-12 months</option>
|
||||
<option value="5">Over 12 months</option>
|
||||
</select> <br />
|
||||
<label for="recordClientHomeTypeID" class="input required">Type of property you are selling:</label> <select name="recordClientHomeTypeID" id="recordClientHomeTypeID" class="inputclass pageRequired" title="Select a Property Type">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">Single Family Detached</option>
|
||||
<option value="2">Condo</option>
|
||||
<option value="3">Townhouse</option>
|
||||
<option value="4">Rental</option>
|
||||
<option value="5">Multi-Family</option>
|
||||
<option value="6">Vacation Home</option>
|
||||
<option value="7">Other</option>
|
||||
</select> <br />
|
||||
<label for="recordPropertyAddress1" class="input required">Property Street Address:</label> <input name="recordPropertyAddress1" id="recordPropertyAddress1" class="inputclass pageRequired" title="Street Address is required" maxlength="254" onblur="recordClientAddress1.value = this.value" /><br />
|
||||
<label for="recordPropertyAddress2" class="input">Address (2):</label> <input name="recordPropertyAddress2" id="recordPropertyAddress2" class="inputclass" maxlength="254" onblur="recordClientAddress2.value = this.value" /><br />
|
||||
<label for="recordPropertyCity" class="input required">City:</label> <input name="recordPropertyCity" id="recordPropertyCity" class="inputclass pageRequired" title="City is required" maxlength="254" onblur="recordClientCity.value = this.value" /><br />
|
||||
<label for="recordPropertyState" class="input required">State:</label> <select name="recordPropertyState" id="recordPropertyState" class="inputclass pageRequired" title="Select a State" onchange="recordClientState.value = this.value">
|
||||
<option value="">-Select-</option>
|
||||
<option value="AL">Alabama</option>
|
||||
<option value="AK">Alaska</option>
|
||||
<option value="AZ">Arizona</option>
|
||||
<option value="AR">Arkansas</option>
|
||||
<option value="CA">California</option>
|
||||
<option value="CO">Colorado</option>
|
||||
<option value="CT">Connecticut</option>
|
||||
<option value="DE">Delaware</option>
|
||||
<option value="DC">Dist of Columbia</option>
|
||||
<option value="FL">Florida</option>
|
||||
<option value="GA">Georgia</option>
|
||||
<option value="HI">Hawaii</option>
|
||||
<option value="ID">Idaho</option>
|
||||
<option value="IL">Illinois</option>
|
||||
<option value="IN">Indiana</option>
|
||||
<option value="IA">Iowa</option>
|
||||
<option value="KS">Kansas</option>
|
||||
<option value="KY">Kentucky</option>
|
||||
<option value="LA">Louisiana</option>
|
||||
<option value="ME">Maine</option>
|
||||
<option value="MD">Maryland</option>
|
||||
<option value="MA">Massachusetts</option>
|
||||
<option value="MI">Michigan</option>
|
||||
<option value="MN">Minnesota</option>
|
||||
<option value="MS">Mississippi</option>
|
||||
<option value="MO">Missouri</option>
|
||||
<option value="MT">Montana</option>
|
||||
<option value="NE">Nebraska</option>
|
||||
<option value="NV">Nevada</option>
|
||||
<option value="NH">New Hampshire</option>
|
||||
<option value="NJ">New Jersey</option>
|
||||
<option value="NM">New Mexico</option>
|
||||
<option value="NY">New York</option>
|
||||
<option value="NC">North Carolina</option>
|
||||
<option value="ND">North Dakota</option>
|
||||
<option value="OH">Ohio</option>
|
||||
<option value="OK">Oklahoma</option>
|
||||
<option value="OR">Oregon</option>
|
||||
<option value="PA" selected="selected">Pennsylvania</option>
|
||||
<option value="RI">Rhode Island</option>
|
||||
<option value="SC">South Carolina</option>
|
||||
<option value="SD">South Dakota</option>
|
||||
<option value="TN">Tennessee</option>
|
||||
<option value="TX">Texas</option>
|
||||
<option value="UT">Utah</option>
|
||||
<option value="VT">Vermont</option>
|
||||
<option value="VA">Virginia</option>
|
||||
<option value="WA">Washington</option>
|
||||
<option value="WV">West Virginia</option>
|
||||
<option value="WI">Wisconsin</option>
|
||||
<option value="WY">Wyoming</option>
|
||||
</select> <br />
|
||||
<label for="recordPropertyZip" class="input required">Zip:</label> <input name="recordPropertyZip" id="recordPropertyZip" class="inputclass pageRequired" title="Zip Code is required" maxlength="254" onblur="recordClientZip.value = this.value" /><br />
|
||||
|
||||
<label for="recordClientPropertyValueID" class="input required">Estimated Market Value:</label> <select name="recordClientPropertyValueID" id="recordClientPropertyValueID" class="inputclass pageRequired" title="Select a Price Range">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">Less Than $75K</option>
|
||||
<option value="2">$75-$100K</option>
|
||||
<option value="3">$100-$125K</option>
|
||||
<option value="4">$125-$150K</option>
|
||||
<option value="5">$150-$200K</option>
|
||||
<option value="6">$200-$250K</option>
|
||||
<option value="7">$250-$300K</option>
|
||||
<option value="8">$300-$350K</option>
|
||||
<option value="9">$350-$400K</option>
|
||||
<option value="10">$400-$500K</option>
|
||||
<option value="11">$500-$700K</option>
|
||||
<option value="12">$700-$900K</option>
|
||||
<option value="13">Over $900K</option>
|
||||
</select> <br />
|
||||
<label for="recordPropertyBedroomsID" class="input">Bedrooms:</label> <select name="recordPropertyBedroomsID" id="recordPropertyBedroomsID" class="inputclass">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5+</option>
|
||||
</select> <br />
|
||||
<label for="recordPropertyBathroomsId" class="input">Bathrooms:</label> <select name="recordPropertyBathroomsId" id="recordPropertyBathroomsId" class="inputclass">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">1.5</option>
|
||||
<option value="3">2</option>
|
||||
<option value="4">2.5</option>
|
||||
<option value="5">3</option>
|
||||
<option value="6">3.5</option>
|
||||
<option value="7">4+</option>
|
||||
</select> <br />
|
||||
<label for="recordPropertyAgeId" class="input">Approx. Age of Home:</label> <select name="recordPropertyAgeId" id="recordPropertyAgeId" class="inputclass">
|
||||
<option value="">-Select-</option>
|
||||
<option value="1">Less Than 1 year</option>
|
||||
<option value="2">1-5 years</option>
|
||||
<option value="3">6-10 years</option>
|
||||
<option value="4">11-15 years</option>
|
||||
<option value="5">More than 15 years</option>
|
||||
</select> <br />
|
||||
<label for="recordPropertySqFt" class="input">Approx. Square Footage:</label> <input name="recordPropertySqFt" id="recordPropertySqFt" class="inputclass" maxlength="254" /><br />
|
||||
<div class="buttonWrapper"><input name="formBack0" type="button" class="open0 prevbutton" value="Back" alt="Back" title="Back" /> <input name="formNext2" type="button" class="open2 nextbutton" value="Next" alt="Next" title="Next" /></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</li>
|
||||
<li id="sf3">
|
||||
<a href='#' class="ui-accordion-link">
|
||||
</a>
|
||||
<div>
|
||||
<fieldset><legend> Step 3 of 3 </legend>
|
||||
<div class="requiredNotice">*Required Field</div>
|
||||
<h3 class="stepHeader">Tell us about yourself</h3>
|
||||
<label for="recordClientNameFirst" class="input required">First Name:</label> <input name="recordClientNameFirst" id="recordClientNameFirst" class="inputclass pageRequired" title="First Name is required" maxlength="254" /> <br />
|
||||
<label for="recordClientNameLast" class="input required">Last Name:</label> <input name="recordClientNameLast" id="recordClientNameLast" class="inputclass pageRequired" maxlength="254" title="Last Name is required" /> <br />
|
||||
<label for="recordClientAddress1" class="input required">Current Address:</label> <input name="recordClientAddress1" id="recordClientAddress1" class="inputclass pageRequired" maxlength="254" title="Address is required" /> <br />
|
||||
<label for="recordClientAddress2" class="input">Address (2):</label> <input name="recordClientAddress2" id="recordClientAddress2" class="inputclass" maxlength="254" /> <br />
|
||||
<label for="recordClientCity" class="input required">City:</label> <input name="recordClientCity" id="recordClientCity" class="inputclass pageRequired" maxlength="254" title="City is required" /> <br />
|
||||
<label for="recordClientState" class="input required">State:</label> <select name="recordClientState" id="recordClientState" class="inputclass pageRequired" title="Select a State">
|
||||
<option value="">-Select-</option>
|
||||
<option value="AL">Alabama</option>
|
||||
<option value="AK">Alaska</option>
|
||||
<option value="AZ">Arizona</option>
|
||||
<option value="AR">Arkansas</option>
|
||||
<option value="CA">California</option>
|
||||
<option value="CO">Colorado</option>
|
||||
<option value="CT">Connecticut</option>
|
||||
<option value="DE">Delaware</option>
|
||||
<option value="DC">Dist of Columbia</option>
|
||||
<option value="FL">Florida</option>
|
||||
<option value="GA">Georgia</option>
|
||||
<option value="HI">Hawaii</option>
|
||||
<option value="ID">Idaho</option>
|
||||
<option value="IL">Illinois</option>
|
||||
<option value="IN">Indiana</option>
|
||||
<option value="IA">Iowa</option>
|
||||
<option value="KS">Kansas</option>
|
||||
<option value="KY">Kentucky</option>
|
||||
<option value="LA">Louisiana</option>
|
||||
<option value="ME">Maine</option>
|
||||
<option value="MD">Maryland</option>
|
||||
<option value="MA">Massachusetts</option>
|
||||
<option value="MI">Michigan</option>
|
||||
<option value="MN">Minnesota</option>
|
||||
<option value="MS">Mississippi</option>
|
||||
<option value="MO">Missouri</option>
|
||||
<option value="MT">Montana</option>
|
||||
<option value="NE">Nebraska</option>
|
||||
<option value="NV">Nevada</option>
|
||||
<option value="NH">New Hampshire</option>
|
||||
<option value="NJ">New Jersey</option>
|
||||
<option value="NM">New Mexico</option>
|
||||
<option value="NY">New York</option>
|
||||
<option value="NC">North Carolina</option>
|
||||
<option value="ND">North Dakota</option>
|
||||
<option value="OH">Ohio</option>
|
||||
<option value="OK">Oklahoma</option>
|
||||
<option value="OR">Oregon</option>
|
||||
<option value="PA" selected="selected">Pennsylvania</option>
|
||||
<option value="RI">Rhode Island</option>
|
||||
<option value="SC">South Carolina</option>
|
||||
<option value="SD">South Dakota</option>
|
||||
<option value="TN">Tennessee</option>
|
||||
<option value="TX">Texas</option>
|
||||
<option value="UT">Utah</option>
|
||||
<option value="VT">Vermont</option>
|
||||
<option value="VA">Virginia</option>
|
||||
<option value="WA">Washington</option>
|
||||
<option value="WV">West Virginia</option>
|
||||
<option value="WI">Wisconsin</option>
|
||||
<option value="WY">Wyoming</option>
|
||||
</select> <br />
|
||||
<label for="recordClientZip" class="input required">Zip:</label> <input name="recordClientZip" id="recordClientZip" class="inputclass pageRequired" maxlength="12" title="Zip Code is required" /> <br />
|
||||
<label for="recordClientPhone" class="input required">Phone Number:</label> <input name="recordClientPhone" id="recordClientPhone" class="inputclass pageRequired" maxlength="254" title="Phone Number is required" /> <br />
|
||||
<label for="recordClientPhoneAlt" class="input">Alternate Number:</label> <input name="recordClientPhoneAlt" id="recordClientPhoneAlt" class="inputclass" maxlength="254" /> <br />
|
||||
<label for="recordClientEmail" class="input required">Email Address:</label> <input name="recordClientEmail" id="recordClientEmail" class="inputclass pageRequired email" maxlength="254" title="Email address is required" /> <br />
|
||||
<label for="recordClientEmail1" class="input required">Confirm Email:</label> <input name="recordClientEmail1" id="recordClientEmail1" class="inputclass pageRequired" equalTo:"'#recordClientEmail" maxlength="254" title="Please confirm your email address" /> <br />
|
||||
<br />
|
||||
<p class="formDisclaimer">This is a sample form, no information is sent anywhere.</p>
|
||||
<div class="buttonWrapper"><input name="formBack1" type="button" class="open1 prevbutton" value="Back" alt="Back" title="Back" /> <input name="submit" type="submit" id="submit" value="Submit" class="submitbutton" alt="Submit" title="Submit"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
246
vendors/jquery-validate-1.7/demo/multipart/js/jquery.maskedinput-1.0.js
vendored
Normal file
|
@ -0,0 +1,246 @@
|
|||
/*
|
||||
* Copyright (c) 2007 Josh Bush (digitalbush.com)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Version: 1.0
|
||||
* Release: 2007-07-25
|
||||
*/
|
||||
(function($) {
|
||||
//Helper Functions for Caret positioning
|
||||
function getCaretPosition(ctl){
|
||||
var res = {begin: 0, end: 0 };
|
||||
if (ctl.setSelectionRange){
|
||||
res.begin = ctl.selectionStart;
|
||||
res.end = ctl.selectionEnd;
|
||||
}else if (document.selection && document.selection.createRange){
|
||||
var range = document.selection.createRange();
|
||||
res.begin = 0 - range.duplicate().moveStart('character', -100000);
|
||||
res.end = res.begin + range.text.length;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
function setCaretPosition(ctl, pos){
|
||||
if(ctl.setSelectionRange){
|
||||
ctl.focus();
|
||||
ctl.setSelectionRange(pos,pos);
|
||||
}else if (ctl.createTextRange){
|
||||
var range = ctl.createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', pos);
|
||||
range.moveStart('character', pos);
|
||||
range.select();
|
||||
}
|
||||
};
|
||||
|
||||
//Predefined character definitions
|
||||
var charMap={
|
||||
'9':"[0-9]",
|
||||
'a':"[A-Za-z]",
|
||||
'*':"[A-Za-z0-9]"
|
||||
};
|
||||
|
||||
//Helper method to inject character definitions
|
||||
$.mask={
|
||||
addPlaceholder : function(c,r){
|
||||
charMap[c]=r;
|
||||
}
|
||||
};
|
||||
|
||||
//Main Method
|
||||
$.fn.mask = function(mask,settings) {
|
||||
settings = $.extend({
|
||||
placeholder: "_",
|
||||
completed: null
|
||||
}, settings);
|
||||
|
||||
//Build Regex for format validation
|
||||
var reString="^";
|
||||
for(var i=0;i<mask.length;i++)
|
||||
reString+=(charMap[mask.charAt(i)] || ("\\"+mask.charAt(i)));
|
||||
reString+="$";
|
||||
var re = new RegExp(reString);
|
||||
|
||||
return this.each(function(){
|
||||
var input=$(this);
|
||||
var buffer=new Array(mask.length);
|
||||
var locked=new Array(mask.length);
|
||||
|
||||
//Build buffer layout from mask
|
||||
for(var i=0;i<mask.length;i++){
|
||||
locked[i]=charMap[mask.charAt(i)]==null;
|
||||
buffer[i]=locked[i]?mask.charAt(i):settings.placeholder;
|
||||
}
|
||||
|
||||
/*Event Bindings*/
|
||||
input.focus(function(){
|
||||
checkVal();
|
||||
writeBuffer();
|
||||
setCaretPosition(this,0);
|
||||
});
|
||||
|
||||
input.blur(checkVal);
|
||||
|
||||
//Paste events for IE and Mozilla thanks to Kristinn Sigmundsson
|
||||
if ($.browser.msie)
|
||||
this.onpaste= function(){setTimeout(checkVal,0);};
|
||||
else if ($.browser.mozilla)
|
||||
this.addEventListener('input',checkVal,false);
|
||||
|
||||
var ignore=false; //Variable for ignoring control keys
|
||||
|
||||
input.keydown(function(e){
|
||||
var pos=getCaretPosition(this);
|
||||
var k = e.keyCode;
|
||||
ignore=(k < 16 || (k > 16 && k < 32 ) || (k > 32 && k < 41));
|
||||
|
||||
//delete selection before proceeding
|
||||
if((pos.begin-pos.end)!=0 && (!ignore || k==8 || k==46)){
|
||||
clearBuffer(pos.begin,pos.end);
|
||||
}
|
||||
//backspace and delete get special treatment
|
||||
if(k==8){//backspace
|
||||
while(pos.begin-->=0){
|
||||
if(!locked[pos.begin]){
|
||||
buffer[pos.begin]=settings.placeholder;
|
||||
if($.browser.opera){
|
||||
//Opera won't let you cancel the backspace, so we'll let it backspace over a dummy character.
|
||||
writeBuffer(pos.begin);
|
||||
setCaretPosition(this,pos.begin+1);
|
||||
}else{
|
||||
writeBuffer();
|
||||
setCaretPosition(this,pos.begin);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else if(k==46){//delete
|
||||
clearBuffer(pos.begin,pos.begin+1);
|
||||
writeBuffer();
|
||||
setCaretPosition(this,pos.begin);
|
||||
return false;
|
||||
}else if (k==27){
|
||||
clearBuffer(0,mask.length);
|
||||
writeBuffer();
|
||||
setCaretPosition(this,0);
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
input.keypress(function(e){
|
||||
if(ignore){
|
||||
ignore=false;
|
||||
return;
|
||||
}
|
||||
e=e||window.event;
|
||||
var k=e.charCode||e.keyCode||e.which;
|
||||
|
||||
var pos=getCaretPosition(this);
|
||||
var caretPos=pos.begin;
|
||||
|
||||
if(e.ctrlKey || e.altKey){//Ignore
|
||||
return true;
|
||||
}else if ((k>=41 && k<=122) ||k==32 || k>186){//typeable characters
|
||||
while(pos.begin<mask.length){
|
||||
var reString=charMap[mask.charAt(pos.begin)];
|
||||
var match;
|
||||
if(reString){
|
||||
var reChar=new RegExp(reString);
|
||||
match=String.fromCharCode(k).match(reChar);
|
||||
}else{//we're on a mask char, go forward and try again
|
||||
pos.begin+=1;
|
||||
pos.end=pos.begin;
|
||||
caretPos+=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(match)
|
||||
buffer[pos.begin]=String.fromCharCode(k);
|
||||
else
|
||||
return false;//reject char
|
||||
|
||||
while(++caretPos<mask.length){//seek forward to next typable position
|
||||
if(!locked[caretPos])
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}else
|
||||
return false;
|
||||
|
||||
writeBuffer();
|
||||
if(settings.completed && caretPos>=buffer.length)
|
||||
settings.completed.call(input);
|
||||
else
|
||||
setCaretPosition(this,caretPos);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/*Helper Methods*/
|
||||
function clearBuffer(start,end){
|
||||
for(var i=start;i<end;i++){
|
||||
if(!locked[i])
|
||||
buffer[i]=settings.placeholder;
|
||||
}
|
||||
};
|
||||
|
||||
function writeBuffer(pos){
|
||||
var s="";
|
||||
for(var i=0;i<mask.length;i++){
|
||||
s+=buffer[i];
|
||||
if(i==pos)
|
||||
s+=settings.placeholder;
|
||||
}
|
||||
input.val(s);
|
||||
return s;
|
||||
};
|
||||
|
||||
function checkVal(){
|
||||
//try to place charcters where they belong
|
||||
var test=input.val();
|
||||
var pos=0;
|
||||
for(var i=0;i<mask.length;i++){
|
||||
if(!locked[i]){
|
||||
while(pos++<test.length){
|
||||
//Regex Test each char here.
|
||||
var reChar=new RegExp(charMap[mask.charAt(i)]);
|
||||
if(test.charAt(pos-1).match(reChar)){
|
||||
buffer[i]=test.charAt(pos-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var s=writeBuffer();
|
||||
if(!s.match(re)){
|
||||
input.val("");
|
||||
clearBuffer(0,mask.length);
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
477
vendors/jquery-validate-1.7/demo/multipart/js/ui.accordion.js
vendored
Normal file
|
@ -0,0 +1,477 @@
|
|||
/*
|
||||
* jQuery UI Accordion 1.7.1
|
||||
*
|
||||
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Accordion
|
||||
*
|
||||
* Depends:
|
||||
* ui.core.js
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
$.widget("ui.accordion", {
|
||||
|
||||
_init: function() {
|
||||
|
||||
var o = this.options, self = this;
|
||||
this.running = 0;
|
||||
|
||||
// if the user set the alwaysOpen option on init
|
||||
// then we need to set the collapsible option
|
||||
// if they set both on init, collapsible will take priority
|
||||
if (o.collapsible == $.ui.accordion.defaults.collapsible &&
|
||||
o.alwaysOpen != $.ui.accordion.defaults.alwaysOpen) {
|
||||
o.collapsible = !o.alwaysOpen;
|
||||
}
|
||||
|
||||
if ( o.navigation ) {
|
||||
var current = this.element.find("a").filter(o.navigationFilter);
|
||||
if ( current.length ) {
|
||||
if ( current.filter(o.header).length ) {
|
||||
this.active = current;
|
||||
} else {
|
||||
this.active = current.parent().parent().prev();
|
||||
current.addClass("ui-accordion-content-active");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.element.addClass("ui-accordion ui-widget ui-helper-reset");
|
||||
|
||||
// in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
|
||||
if (this.element[0].nodeName == "UL") {
|
||||
this.element.children("li").addClass("ui-accordion-li-fix");
|
||||
}
|
||||
|
||||
this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
|
||||
.bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
|
||||
.bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
|
||||
.bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
|
||||
.bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });
|
||||
|
||||
this.headers
|
||||
.next()
|
||||
.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
||||
|
||||
this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
|
||||
this.active.next().addClass('ui-accordion-content-active');
|
||||
|
||||
//Append icon elements
|
||||
$("<span/>").addClass("ui-icon " + o.icons.header).prependTo(this.headers);
|
||||
this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);
|
||||
|
||||
// IE7-/Win - Extra vertical space in lists fixed
|
||||
if ($.browser.msie) {
|
||||
this.element.find('a').css('zoom', '1');
|
||||
}
|
||||
|
||||
this.resize();
|
||||
|
||||
//ARIA
|
||||
this.element.attr('role','tablist');
|
||||
|
||||
this.headers
|
||||
.attr('role','tab')
|
||||
.bind('keydown', function(event) { return self._keydown(event); })
|
||||
.next()
|
||||
.attr('role','tabpanel');
|
||||
|
||||
this.headers
|
||||
.not(this.active || "")
|
||||
.attr('aria-expanded','false')
|
||||
.attr("tabIndex", "-1")
|
||||
.next()
|
||||
.hide();
|
||||
|
||||
// make sure at least one header is in the tab order
|
||||
if (!this.active.length) {
|
||||
this.headers.eq(0).attr('tabIndex','0');
|
||||
} else {
|
||||
this.active
|
||||
.attr('aria-expanded','true')
|
||||
.attr('tabIndex', '0');
|
||||
}
|
||||
|
||||
// only need links in taborder for Safari
|
||||
if (!$.browser.safari)
|
||||
this.headers.find('a').attr('tabIndex','-1');
|
||||
|
||||
if (o.event) {
|
||||
this.headers.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event, this); });
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
var o = this.options;
|
||||
|
||||
this.element
|
||||
.removeClass("ui-accordion ui-widget ui-helper-reset")
|
||||
.removeAttr("role")
|
||||
.unbind('.accordion')
|
||||
.removeData('accordion');
|
||||
|
||||
this.headers
|
||||
.unbind(".accordion")
|
||||
.removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
|
||||
.removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
|
||||
|
||||
this.headers.find("a").removeAttr("tabindex");
|
||||
this.headers.children(".ui-icon").remove();
|
||||
var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");
|
||||
if (o.autoHeight || o.fillHeight) {
|
||||
contents.css("height", "");
|
||||
}
|
||||
},
|
||||
|
||||
_setData: function(key, value) {
|
||||
if(key == 'alwaysOpen') { key = 'collapsible'; value = !value; }
|
||||
$.widget.prototype._setData.apply(this, arguments);
|
||||
},
|
||||
|
||||
_keydown: function(event) {
|
||||
|
||||
var o = this.options, keyCode = $.ui.keyCode;
|
||||
|
||||
if (o.disabled || event.altKey || event.ctrlKey)
|
||||
return;
|
||||
|
||||
var length = this.headers.length;
|
||||
var currentIndex = this.headers.index(event.target);
|
||||
var toFocus = false;
|
||||
|
||||
switch(event.keyCode) {
|
||||
case keyCode.RIGHT:
|
||||
case keyCode.DOWN:
|
||||
toFocus = this.headers[(currentIndex + 1) % length];
|
||||
break;
|
||||
case keyCode.LEFT:
|
||||
case keyCode.UP:
|
||||
toFocus = this.headers[(currentIndex - 1 + length) % length];
|
||||
break;
|
||||
case keyCode.SPACE:
|
||||
case keyCode.ENTER:
|
||||
return this._clickHandler({ target: event.target }, event.target);
|
||||
}
|
||||
|
||||
if (toFocus) {
|
||||
$(event.target).attr('tabIndex','-1');
|
||||
$(toFocus).attr('tabIndex','0');
|
||||
toFocus.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
|
||||
var o = this.options, maxHeight;
|
||||
|
||||
if (o.fillSpace) {
|
||||
|
||||
if($.browser.msie) { var defOverflow = this.element.parent().css('overflow'); this.element.parent().css('overflow', 'hidden'); }
|
||||
maxHeight = this.element.parent().height();
|
||||
if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
|
||||
|
||||
this.headers.each(function() {
|
||||
maxHeight -= $(this).outerHeight();
|
||||
});
|
||||
|
||||
var maxPadding = 0;
|
||||
this.headers.next().each(function() {
|
||||
maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
|
||||
}).height(Math.max(0, maxHeight - maxPadding))
|
||||
.css('overflow', 'auto');
|
||||
|
||||
} else if ( o.autoHeight ) {
|
||||
maxHeight = 0;
|
||||
this.headers.next().each(function() {
|
||||
maxHeight = Math.max(maxHeight, $(this).outerHeight());
|
||||
}).height(maxHeight);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
activate: function(index) {
|
||||
// call clickHandler with custom event
|
||||
var active = this._findActive(index)[0];
|
||||
this._clickHandler({ target: active }, active);
|
||||
},
|
||||
|
||||
_findActive: function(selector) {
|
||||
return selector
|
||||
? typeof selector == "number"
|
||||
? this.headers.filter(":eq(" + selector + ")")
|
||||
: this.headers.not(this.headers.not(selector))
|
||||
: selector === false
|
||||
? $([])
|
||||
: this.headers.filter(":eq(0)");
|
||||
},
|
||||
|
||||
_clickHandler: function(event, target) {
|
||||
|
||||
var o = this.options;
|
||||
if (o.disabled) return false;
|
||||
|
||||
// called only when using activate(false) to close all parts programmatically
|
||||
if (!event.target && o.collapsible) {
|
||||
this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
|
||||
.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
|
||||
this.active.next().addClass('ui-accordion-content-active');
|
||||
var toHide = this.active.next(),
|
||||
data = {
|
||||
options: o,
|
||||
newHeader: $([]),
|
||||
oldHeader: o.active,
|
||||
newContent: $([]),
|
||||
oldContent: toHide
|
||||
},
|
||||
toShow = (this.active = $([]));
|
||||
this._toggle(toShow, toHide, data);
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the click target
|
||||
var clicked = $(event.currentTarget || target);
|
||||
var clickedIsActive = clicked[0] == this.active[0];
|
||||
|
||||
// if animations are still active, or the active header is the target, ignore click
|
||||
if (this.running || (!o.collapsible && clickedIsActive)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// switch classes
|
||||
this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
|
||||
.find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
|
||||
this.active.next().addClass('ui-accordion-content-active');
|
||||
if (!clickedIsActive) {
|
||||
clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
|
||||
.find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);
|
||||
clicked.next().addClass('ui-accordion-content-active');
|
||||
}
|
||||
|
||||
// find elements to show and hide
|
||||
var toShow = clicked.next(),
|
||||
toHide = this.active.next(),
|
||||
data = {
|
||||
options: o,
|
||||
newHeader: clickedIsActive && o.collapsible ? $([]) : clicked,
|
||||
oldHeader: this.active,
|
||||
newContent: clickedIsActive && o.collapsible ? $([]) : toShow.find('> *'),
|
||||
oldContent: toHide.find('> *')
|
||||
},
|
||||
down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
|
||||
|
||||
this.active = clickedIsActive ? $([]) : clicked;
|
||||
this._toggle(toShow, toHide, data, clickedIsActive, down);
|
||||
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
_toggle: function(toShow, toHide, data, clickedIsActive, down) {
|
||||
|
||||
var o = this.options, self = this;
|
||||
|
||||
this.toShow = toShow;
|
||||
this.toHide = toHide;
|
||||
this.data = data;
|
||||
|
||||
var complete = function() { if(!self) return; return self._completed.apply(self, arguments); };
|
||||
|
||||
// trigger changestart event
|
||||
this._trigger("changestart", null, this.data);
|
||||
|
||||
// count elements to animate
|
||||
this.running = toHide.size() === 0 ? toShow.size() : toHide.size();
|
||||
|
||||
if (o.animated) {
|
||||
|
||||
var animOptions = {};
|
||||
|
||||
if ( o.collapsible && clickedIsActive ) {
|
||||
animOptions = {
|
||||
toShow: $([]),
|
||||
toHide: toHide,
|
||||
complete: complete,
|
||||
down: down,
|
||||
autoHeight: o.autoHeight || o.fillSpace
|
||||
};
|
||||
} else {
|
||||
animOptions = {
|
||||
toShow: toShow,
|
||||
toHide: toHide,
|
||||
complete: complete,
|
||||
down: down,
|
||||
autoHeight: o.autoHeight || o.fillSpace
|
||||
};
|
||||
}
|
||||
|
||||
if (!o.proxied) {
|
||||
o.proxied = o.animated;
|
||||
}
|
||||
|
||||
if (!o.proxiedDuration) {
|
||||
o.proxiedDuration = o.duration;
|
||||
}
|
||||
|
||||
o.animated = $.isFunction(o.proxied) ?
|
||||
o.proxied(animOptions) : o.proxied;
|
||||
|
||||
o.duration = $.isFunction(o.proxiedDuration) ?
|
||||
o.proxiedDuration(animOptions) : o.proxiedDuration;
|
||||
|
||||
var animations = $.ui.accordion.animations,
|
||||
duration = o.duration,
|
||||
easing = o.animated;
|
||||
|
||||
if (!animations[easing]) {
|
||||
animations[easing] = function(options) {
|
||||
this.slide(options, {
|
||||
easing: easing,
|
||||
duration: duration || 700
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
animations[easing](animOptions);
|
||||
|
||||
} else {
|
||||
|
||||
if (o.collapsible && clickedIsActive) {
|
||||
toShow.toggle();
|
||||
} else {
|
||||
toHide.hide();
|
||||
toShow.show();
|
||||
}
|
||||
|
||||
complete(true);
|
||||
|
||||
}
|
||||
|
||||
toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1").blur();
|
||||
toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus();
|
||||
|
||||
},
|
||||
|
||||
_completed: function(cancel) {
|
||||
|
||||
var o = this.options;
|
||||
|
||||
this.running = cancel ? 0 : --this.running;
|
||||
if (this.running) return;
|
||||
|
||||
if (o.clearStyle) {
|
||||
this.toShow.add(this.toHide).css({
|
||||
height: "",
|
||||
overflow: ""
|
||||
});
|
||||
}
|
||||
|
||||
this._trigger('change', null, this.data);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
$.extend($.ui.accordion, {
|
||||
version: "1.7.1",
|
||||
defaults: {
|
||||
active: null,
|
||||
alwaysOpen: true, //deprecated, use collapsible
|
||||
animated: 'slide',
|
||||
autoHeight: true,
|
||||
clearStyle: false,
|
||||
collapsible: false,
|
||||
event: "click",
|
||||
fillSpace: false,
|
||||
header: "> li > :first-child,> :not(li):even",
|
||||
icons: {
|
||||
header: "ui-icon-triangle-1-e",
|
||||
headerSelected: "ui-icon-triangle-1-s"
|
||||
},
|
||||
navigation: false,
|
||||
navigationFilter: function() {
|
||||
return this.href.toLowerCase() == location.href.toLowerCase();
|
||||
}
|
||||
},
|
||||
animations: {
|
||||
slide: function(options, additions) {
|
||||
options = $.extend({
|
||||
easing: "swing",
|
||||
duration: 300
|
||||
}, options, additions);
|
||||
if ( !options.toHide.size() ) {
|
||||
options.toShow.animate({height: "show"}, options);
|
||||
return;
|
||||
}
|
||||
if ( !options.toShow.size() ) {
|
||||
options.toHide.animate({height: "hide"}, options);
|
||||
return;
|
||||
}
|
||||
var overflow = options.toShow.css('overflow'),
|
||||
percentDone,
|
||||
showProps = {},
|
||||
hideProps = {},
|
||||
fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
|
||||
originalWidth;
|
||||
// fix width before calculating height of hidden element
|
||||
var s = options.toShow;
|
||||
originalWidth = s[0].style.width;
|
||||
s.width( parseInt(s.parent().width(),10) - parseInt(s.css("paddingLeft"),10) - parseInt(s.css("paddingRight"),10) - (parseInt(s.css("borderLeftWidth"),10) || 0) - (parseInt(s.css("borderRightWidth"),10) || 0) );
|
||||
|
||||
$.each(fxAttrs, function(i, prop) {
|
||||
hideProps[prop] = 'hide';
|
||||
|
||||
var parts = ('' + $.css(options.toShow[0], prop)).match(/^([\d+-.]+)(.*)$/);
|
||||
showProps[prop] = {
|
||||
value: parts[1],
|
||||
unit: parts[2] || 'px'
|
||||
};
|
||||
});
|
||||
options.toShow.css({ height: 0, overflow: 'hidden' }).show();
|
||||
options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{
|
||||
step: function(now, settings) {
|
||||
// only calculate the percent when animating height
|
||||
// IE gets very inconsistent results when animating elements
|
||||
// with small values, which is common for padding
|
||||
if (settings.prop == 'height') {
|
||||
percentDone = (settings.now - settings.start) / (settings.end - settings.start);
|
||||
}
|
||||
|
||||
options.toShow[0].style[settings.prop] =
|
||||
(percentDone * showProps[settings.prop].value) + showProps[settings.prop].unit;
|
||||
},
|
||||
duration: options.duration,
|
||||
easing: options.easing,
|
||||
complete: function() {
|
||||
if ( !options.autoHeight ) {
|
||||
options.toShow.css("height", "");
|
||||
}
|
||||
options.toShow.css("width", originalWidth);
|
||||
options.toShow.css({overflow: overflow});
|
||||
options.complete();
|
||||
}
|
||||
});
|
||||
},
|
||||
bounceslide: function(options) {
|
||||
this.slide(options, {
|
||||
easing: options.down ? "easeOutBounce" : "swing",
|
||||
duration: options.down ? 1000 : 200
|
||||
});
|
||||
},
|
||||
easeslide: function(options) {
|
||||
this.slide(options, {
|
||||
easing: "easeinout",
|
||||
duration: 700
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
519
vendors/jquery-validate-1.7/demo/multipart/js/ui.core.js
vendored
Normal file
|
@ -0,0 +1,519 @@
|
|||
/*
|
||||
* jQuery UI 1.7.1
|
||||
*
|
||||
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
;jQuery.ui || (function($) {
|
||||
|
||||
var _remove = $.fn.remove,
|
||||
isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
|
||||
|
||||
//Helper functions and ui object
|
||||
$.ui = {
|
||||
version: "1.7.1",
|
||||
|
||||
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
||||
plugin: {
|
||||
add: function(module, option, set) {
|
||||
var proto = $.ui[module].prototype;
|
||||
for(var i in set) {
|
||||
proto.plugins[i] = proto.plugins[i] || [];
|
||||
proto.plugins[i].push([option, set[i]]);
|
||||
}
|
||||
},
|
||||
call: function(instance, name, args) {
|
||||
var set = instance.plugins[name];
|
||||
if(!set || !instance.element[0].parentNode) { return; }
|
||||
|
||||
for (var i = 0; i < set.length; i++) {
|
||||
if (instance.options[set[i][0]]) {
|
||||
set[i][1].apply(instance.element, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
contains: function(a, b) {
|
||||
return document.compareDocumentPosition
|
||||
? a.compareDocumentPosition(b) & 16
|
||||
: a !== b && a.contains(b);
|
||||
},
|
||||
|
||||
hasScroll: function(el, a) {
|
||||
|
||||
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
||||
if ($(el).css('overflow') == 'hidden') { return false; }
|
||||
|
||||
var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
|
||||
has = false;
|
||||
|
||||
if (el[scroll] > 0) { return true; }
|
||||
|
||||
// TODO: determine which cases actually cause this to happen
|
||||
// if the element doesn't have the scroll set, see if it's possible to
|
||||
// set the scroll
|
||||
el[scroll] = 1;
|
||||
has = (el[scroll] > 0);
|
||||
el[scroll] = 0;
|
||||
return has;
|
||||
},
|
||||
|
||||
isOverAxis: function(x, reference, size) {
|
||||
//Determines when x coordinate is over "b" element axis
|
||||
return (x > reference) && (x < (reference + size));
|
||||
},
|
||||
|
||||
isOver: function(y, x, top, left, height, width) {
|
||||
//Determines when x, y coordinates is over "b" element
|
||||
return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
|
||||
},
|
||||
|
||||
keyCode: {
|
||||
BACKSPACE: 8,
|
||||
CAPS_LOCK: 20,
|
||||
COMMA: 188,
|
||||
CONTROL: 17,
|
||||
DELETE: 46,
|
||||
DOWN: 40,
|
||||
END: 35,
|
||||
ENTER: 13,
|
||||
ESCAPE: 27,
|
||||
HOME: 36,
|
||||
INSERT: 45,
|
||||
LEFT: 37,
|
||||
NUMPAD_ADD: 107,
|
||||
NUMPAD_DECIMAL: 110,
|
||||
NUMPAD_DIVIDE: 111,
|
||||
NUMPAD_ENTER: 108,
|
||||
NUMPAD_MULTIPLY: 106,
|
||||
NUMPAD_SUBTRACT: 109,
|
||||
PAGE_DOWN: 34,
|
||||
PAGE_UP: 33,
|
||||
PERIOD: 190,
|
||||
RIGHT: 39,
|
||||
SHIFT: 16,
|
||||
SPACE: 32,
|
||||
TAB: 9,
|
||||
UP: 38
|
||||
}
|
||||
};
|
||||
|
||||
// WAI-ARIA normalization
|
||||
if (isFF2) {
|
||||
var attr = $.attr,
|
||||
removeAttr = $.fn.removeAttr,
|
||||
ariaNS = "http://www.w3.org/2005/07/aaa",
|
||||
ariaState = /^aria-/,
|
||||
ariaRole = /^wairole:/;
|
||||
|
||||
$.attr = function(elem, name, value) {
|
||||
var set = value !== undefined;
|
||||
|
||||
return (name == 'role'
|
||||
? (set
|
||||
? attr.call(this, elem, name, "wairole:" + value)
|
||||
: (attr.apply(this, arguments) || "").replace(ariaRole, ""))
|
||||
: (ariaState.test(name)
|
||||
? (set
|
||||
? elem.setAttributeNS(ariaNS,
|
||||
name.replace(ariaState, "aaa:"), value)
|
||||
: attr.call(this, elem, name.replace(ariaState, "aaa:")))
|
||||
: attr.apply(this, arguments)));
|
||||
};
|
||||
|
||||
$.fn.removeAttr = function(name) {
|
||||
return (ariaState.test(name)
|
||||
? this.each(function() {
|
||||
this.removeAttributeNS(ariaNS, name.replace(ariaState, ""));
|
||||
}) : removeAttr.call(this, name));
|
||||
};
|
||||
}
|
||||
|
||||
//jQuery plugins
|
||||
$.fn.extend({
|
||||
remove: function() {
|
||||
// Safari has a native remove event which actually removes DOM elements,
|
||||
// so we have to use triggerHandler instead of trigger (#3037).
|
||||
$("*", this).add(this).each(function() {
|
||||
$(this).triggerHandler("remove");
|
||||
});
|
||||
return _remove.apply(this, arguments );
|
||||
},
|
||||
|
||||
enableSelection: function() {
|
||||
return this
|
||||
.attr('unselectable', 'off')
|
||||
.css('MozUserSelect', '')
|
||||
.unbind('selectstart.ui');
|
||||
},
|
||||
|
||||
disableSelection: function() {
|
||||
return this
|
||||
.attr('unselectable', 'on')
|
||||
.css('MozUserSelect', 'none')
|
||||
.bind('selectstart.ui', function() { return false; });
|
||||
},
|
||||
|
||||
scrollParent: function() {
|
||||
var scrollParent;
|
||||
if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
||||
}).eq(0);
|
||||
} else {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
||||
}).eq(0);
|
||||
}
|
||||
|
||||
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Additional selectors
|
||||
$.extend($.expr[':'], {
|
||||
data: function(elem, i, match) {
|
||||
return !!$.data(elem, match[3]);
|
||||
},
|
||||
|
||||
focusable: function(element) {
|
||||
var nodeName = element.nodeName.toLowerCase(),
|
||||
tabIndex = $.attr(element, 'tabindex');
|
||||
return (/input|select|textarea|button|object/.test(nodeName)
|
||||
? !element.disabled
|
||||
: 'a' == nodeName || 'area' == nodeName
|
||||
? element.href || !isNaN(tabIndex)
|
||||
: !isNaN(tabIndex))
|
||||
// the element and all of its ancestors must be visible
|
||||
// the browser may report that the area is hidden
|
||||
&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
|
||||
},
|
||||
|
||||
tabbable: function(element) {
|
||||
var tabIndex = $.attr(element, 'tabindex');
|
||||
return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// $.widget is a factory to create jQuery plugins
|
||||
// taking some boilerplate code out of the plugin code
|
||||
function getter(namespace, plugin, method, args) {
|
||||
function getMethods(type) {
|
||||
var methods = $[namespace][plugin][type] || [];
|
||||
return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
|
||||
}
|
||||
|
||||
var methods = getMethods('getter');
|
||||
if (args.length == 1 && typeof args[0] == 'string') {
|
||||
methods = methods.concat(getMethods('getterSetter'));
|
||||
}
|
||||
return ($.inArray(method, methods) != -1);
|
||||
}
|
||||
|
||||
$.widget = function(name, prototype) {
|
||||
var namespace = name.split(".")[0];
|
||||
name = name.split(".")[1];
|
||||
|
||||
// create plugin method
|
||||
$.fn[name] = function(options) {
|
||||
var isMethodCall = (typeof options == 'string'),
|
||||
args = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
// prevent calls to internal methods
|
||||
if (isMethodCall && options.substring(0, 1) == '_') {
|
||||
return this;
|
||||
}
|
||||
|
||||
// handle getter methods
|
||||
if (isMethodCall && getter(namespace, name, options, args)) {
|
||||
var instance = $.data(this[0], name);
|
||||
return (instance ? instance[options].apply(instance, args)
|
||||
: undefined);
|
||||
}
|
||||
|
||||
// handle initialization and non-getter methods
|
||||
return this.each(function() {
|
||||
var instance = $.data(this, name);
|
||||
|
||||
// constructor
|
||||
(!instance && !isMethodCall &&
|
||||
$.data(this, name, new $[namespace][name](this, options))._init());
|
||||
|
||||
// method call
|
||||
(instance && isMethodCall && $.isFunction(instance[options]) &&
|
||||
instance[options].apply(instance, args));
|
||||
});
|
||||
};
|
||||
|
||||
// create widget constructor
|
||||
$[namespace] = $[namespace] || {};
|
||||
$[namespace][name] = function(element, options) {
|
||||
var self = this;
|
||||
|
||||
this.namespace = namespace;
|
||||
this.widgetName = name;
|
||||
this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
|
||||
this.widgetBaseClass = namespace + '-' + name;
|
||||
|
||||
this.options = $.extend({},
|
||||
$.widget.defaults,
|
||||
$[namespace][name].defaults,
|
||||
$.metadata && $.metadata.get(element)[name],
|
||||
options);
|
||||
|
||||
this.element = $(element)
|
||||
.bind('setData.' + name, function(event, key, value) {
|
||||
if (event.target == element) {
|
||||
return self._setData(key, value);
|
||||
}
|
||||
})
|
||||
.bind('getData.' + name, function(event, key) {
|
||||
if (event.target == element) {
|
||||
return self._getData(key);
|
||||
}
|
||||
})
|
||||
.bind('remove', function() {
|
||||
return self.destroy();
|
||||
});
|
||||
};
|
||||
|
||||
// add widget prototype
|
||||
$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);
|
||||
|
||||
// TODO: merge getter and getterSetter properties from widget prototype
|
||||
// and plugin prototype
|
||||
$[namespace][name].getterSetter = 'option';
|
||||
};
|
||||
|
||||
$.widget.prototype = {
|
||||
_init: function() {},
|
||||
destroy: function() {
|
||||
this.element.removeData(this.widgetName)
|
||||
.removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
|
||||
.removeAttr('aria-disabled');
|
||||
},
|
||||
|
||||
option: function(key, value) {
|
||||
var options = key,
|
||||
self = this;
|
||||
|
||||
if (typeof key == "string") {
|
||||
if (value === undefined) {
|
||||
return this._getData(key);
|
||||
}
|
||||
options = {};
|
||||
options[key] = value;
|
||||
}
|
||||
|
||||
$.each(options, function(key, value) {
|
||||
self._setData(key, value);
|
||||
});
|
||||
},
|
||||
_getData: function(key) {
|
||||
return this.options[key];
|
||||
},
|
||||
_setData: function(key, value) {
|
||||
this.options[key] = value;
|
||||
|
||||
if (key == 'disabled') {
|
||||
this.element
|
||||
[value ? 'addClass' : 'removeClass'](
|
||||
this.widgetBaseClass + '-disabled' + ' ' +
|
||||
this.namespace + '-state-disabled')
|
||||
.attr("aria-disabled", value);
|
||||
}
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
this._setData('disabled', false);
|
||||
},
|
||||
disable: function() {
|
||||
this._setData('disabled', true);
|
||||
},
|
||||
|
||||
_trigger: function(type, event, data) {
|
||||
var callback = this.options[type],
|
||||
eventName = (type == this.widgetEventPrefix
|
||||
? type : this.widgetEventPrefix + type);
|
||||
|
||||
event = $.Event(event);
|
||||
event.type = eventName;
|
||||
|
||||
// copy original event properties over to the new event
|
||||
// this would happen if we could call $.event.fix instead of $.Event
|
||||
// but we don't have a way to force an event to be fixed multiple times
|
||||
if (event.originalEvent) {
|
||||
for (var i = $.event.props.length, prop; i;) {
|
||||
prop = $.event.props[--i];
|
||||
event[prop] = event.originalEvent[prop];
|
||||
}
|
||||
}
|
||||
|
||||
this.element.trigger(event, data);
|
||||
|
||||
return !($.isFunction(callback) && callback.call(this.element[0], event, data) === false
|
||||
|| event.isDefaultPrevented());
|
||||
}
|
||||
};
|
||||
|
||||
$.widget.defaults = {
|
||||
disabled: false
|
||||
};
|
||||
|
||||
|
||||
/** Mouse Interaction Plugin **/
|
||||
|
||||
$.ui.mouse = {
|
||||
_mouseInit: function() {
|
||||
var self = this;
|
||||
|
||||
this.element
|
||||
.bind('mousedown.'+this.widgetName, function(event) {
|
||||
return self._mouseDown(event);
|
||||
})
|
||||
.bind('click.'+this.widgetName, function(event) {
|
||||
if(self._preventClickEvent) {
|
||||
self._preventClickEvent = false;
|
||||
event.stopImmediatePropagation();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent text selection in IE
|
||||
if ($.browser.msie) {
|
||||
this._mouseUnselectable = this.element.attr('unselectable');
|
||||
this.element.attr('unselectable', 'on');
|
||||
}
|
||||
|
||||
this.started = false;
|
||||
},
|
||||
|
||||
// TODO: make sure destroying one instance of mouse doesn't mess with
|
||||
// other instances of mouse
|
||||
_mouseDestroy: function() {
|
||||
this.element.unbind('.'+this.widgetName);
|
||||
|
||||
// Restore text selection in IE
|
||||
($.browser.msie
|
||||
&& this.element.attr('unselectable', this._mouseUnselectable));
|
||||
},
|
||||
|
||||
_mouseDown: function(event) {
|
||||
// don't let more than one widget handle mouseStart
|
||||
// TODO: figure out why we have to use originalEvent
|
||||
event.originalEvent = event.originalEvent || {};
|
||||
if (event.originalEvent.mouseHandled) { return; }
|
||||
|
||||
// we may have missed mouseup (out of window)
|
||||
(this._mouseStarted && this._mouseUp(event));
|
||||
|
||||
this._mouseDownEvent = event;
|
||||
|
||||
var self = this,
|
||||
btnIsLeft = (event.which == 1),
|
||||
elIsCancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
|
||||
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.mouseDelayMet = !this.options.delay;
|
||||
if (!this.mouseDelayMet) {
|
||||
this._mouseDelayTimer = setTimeout(function() {
|
||||
self.mouseDelayMet = true;
|
||||
}, this.options.delay);
|
||||
}
|
||||
|
||||
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
||||
this._mouseStarted = (this._mouseStart(event) !== false);
|
||||
if (!this._mouseStarted) {
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// these delegates are required to keep context
|
||||
this._mouseMoveDelegate = function(event) {
|
||||
return self._mouseMove(event);
|
||||
};
|
||||
this._mouseUpDelegate = function(event) {
|
||||
return self._mouseUp(event);
|
||||
};
|
||||
$(document)
|
||||
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
||||
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
||||
|
||||
// preventDefault() is used to prevent the selection of text here -
|
||||
// however, in Safari, this causes select boxes not to be selectable
|
||||
// anymore, so this fix is needed
|
||||
($.browser.safari || event.preventDefault());
|
||||
|
||||
event.originalEvent.mouseHandled = true;
|
||||
return true;
|
||||
},
|
||||
|
||||
_mouseMove: function(event) {
|
||||
// IE mouseup check - mouseup happened when mouse was out of window
|
||||
if ($.browser.msie && !event.button) {
|
||||
return this._mouseUp(event);
|
||||
}
|
||||
|
||||
if (this._mouseStarted) {
|
||||
this._mouseDrag(event);
|
||||
return event.preventDefault();
|
||||
}
|
||||
|
||||
if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
|
||||
this._mouseStarted =
|
||||
(this._mouseStart(this._mouseDownEvent, event) !== false);
|
||||
(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
|
||||
}
|
||||
|
||||
return !this._mouseStarted;
|
||||
},
|
||||
|
||||
_mouseUp: function(event) {
|
||||
$(document)
|
||||
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
|
||||
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
|
||||
|
||||
if (this._mouseStarted) {
|
||||
this._mouseStarted = false;
|
||||
this._preventClickEvent = (event.target == this._mouseDownEvent.target);
|
||||
this._mouseStop(event);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
_mouseDistanceMet: function(event) {
|
||||
return (Math.max(
|
||||
Math.abs(this._mouseDownEvent.pageX - event.pageX),
|
||||
Math.abs(this._mouseDownEvent.pageY - event.pageY)
|
||||
) >= this.options.distance
|
||||
);
|
||||
},
|
||||
|
||||
_mouseDelayMet: function(event) {
|
||||
return this.mouseDelayMet;
|
||||
},
|
||||
|
||||
// These are placeholder methods, to be overriden by extending plugin
|
||||
_mouseStart: function(event) {},
|
||||
_mouseDrag: function(event) {},
|
||||
_mouseStop: function(event) {},
|
||||
_mouseCapture: function(event) { return true; }
|
||||
};
|
||||
|
||||
$.ui.mouse.defaults = {
|
||||
cancel: null,
|
||||
distance: 1,
|
||||
delay: 0
|
||||
};
|
||||
|
||||
})(jQuery);
|
705
vendors/jquery-validate-1.7/demo/multipart/style.css
vendored
Normal file
|
@ -0,0 +1,705 @@
|
|||
/********************************************
|
||||
AUTHOR: Erwin Aligam
|
||||
WEBSITE: http://www.styleshout.com/
|
||||
TEMPLATE NAME: Techmania 1.0
|
||||
TEMPLATE CODE: S-0003
|
||||
VERSION: 1.1
|
||||
*******************************************/
|
||||
/********************************************
|
||||
HTML ELEMENTS
|
||||
********************************************/ /* Top elements */
|
||||
/** { margin:0; padding: 0; }*/
|
||||
body {
|
||||
background-color: #000;
|
||||
color: #555;
|
||||
font: 78%/ 1.6 Verdana, 'Trebuchet MS', arial, sans-serif;
|
||||
text-align: center;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
/* links */
|
||||
a {
|
||||
color: #213540;
|
||||
background: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #3e4255;
|
||||
text-decoration: underline;
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
/* headers */
|
||||
h1,h2,h3 {
|
||||
font-family: 'Trebuchet MS', Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.3em;
|
||||
text-transform: uppercase;
|
||||
color: #339900;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.1em;
|
||||
color: #333;
|
||||
margin: 16px 0 0 18px;
|
||||
}
|
||||
|
||||
h1,h2,h3 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.4em;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
p.error {
|
||||
color: #CC0033;
|
||||
}
|
||||
|
||||
ul,ol {
|
||||
margin: 10px 6px;
|
||||
padding: 0 15px;
|
||||
color: #006699;
|
||||
}
|
||||
|
||||
ul span,ol span {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
/* images */
|
||||
img {
|
||||
border: 2px solid #CCC;
|
||||
}
|
||||
|
||||
img.float-right {
|
||||
margin: 5px 0px 10px 10px;
|
||||
}
|
||||
|
||||
img.float-left {
|
||||
margin: 5px 10px 10px 0px;
|
||||
}
|
||||
|
||||
code {
|
||||
margin: 5px 0;
|
||||
padding: 10px;
|
||||
text-align: left;
|
||||
display: block;
|
||||
overflow: auto;
|
||||
font: 500 1em/ 1.5em 'Lucida Console', 'courier new', monospace;
|
||||
/* white-space: pre; */
|
||||
background: #FAFAFA;
|
||||
border: 1px solid #EAEAEA;
|
||||
border-left: 5px solid #72A545;
|
||||
}
|
||||
|
||||
acronym {
|
||||
cursor: help;
|
||||
border-bottom: 1px solid #777;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 15px;
|
||||
padding: 0 0 0 32px;
|
||||
background: #FAFAFA url(quote.gif) no-repeat 5px 10px !important;
|
||||
background-position: 8px 10px;
|
||||
border: 1px solid #EAEAEA;
|
||||
border-left: 5px solid #72A545;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* form elements */
|
||||
fieldset {
|
||||
margin: 12px 12px 18px;
|
||||
padding-left: 6px;
|
||||
border: 1px solid #004080;
|
||||
color: #006699;
|
||||
}
|
||||
|
||||
fieldset fieldset {
|
||||
border: 1px solid #9ea190;
|
||||
margin: 17px 14px;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 10px 15px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
margin: 5px 3px 0 0;
|
||||
width: 160px;
|
||||
text-align: right;
|
||||
float: left;
|
||||
}
|
||||
|
||||
legend {
|
||||
font-size: 1.2em;
|
||||
padding: 0 12px;
|
||||
font-weight: 900;
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
|
||||
fieldset fieldset legend {
|
||||
font-size: 1em;
|
||||
color: #1a2129;
|
||||
padding: 0 18px;
|
||||
margin-left: 75px;
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 3px;
|
||||
margin: 4px 0;
|
||||
border: 1px solid #CFCED3;
|
||||
font: normal 1em Verdana, sans-serif;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 400px;
|
||||
padding: 4px;
|
||||
font: normal 1em Verdana, sans-serif;
|
||||
border: 1px solid #eee;
|
||||
height: 100px;
|
||||
display: block;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
input.button {
|
||||
margin: 0;
|
||||
font: bold 12px Arial, Sans-serif;
|
||||
border: 1px solid #EAEAEA;
|
||||
padding: 3px 4px;
|
||||
background: #CCC url(buttonbg.gif) repeat-x left bottom;
|
||||
color: #333; /* color: #339900; */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input.submitbutton {
|
||||
background-color: #006699;
|
||||
color: #FFF;
|
||||
background-image: none;
|
||||
font-weight: 900;
|
||||
border: 1px solid #EAEAEA;
|
||||
margin: 0 0 0 200px;
|
||||
}
|
||||
|
||||
/* search */
|
||||
#sidebar #search {
|
||||
background: #f2f2f2;
|
||||
margin: 0 15px;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
#sidebar #search img {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#sidebar #search .textbox {
|
||||
background: #FFF url(input.png) no-repeat top left;
|
||||
border: 1px solid #EAEAEA;
|
||||
font-size: 11px;
|
||||
padding: 3px;
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
#sidebar #search input.searchbutton {
|
||||
margin: 0;
|
||||
font: bold 100% Arial, Sans-serif;
|
||||
border: 1px solid #CCC;
|
||||
background: #CCC url(buttonbg.gif) repeat-x left bottom;
|
||||
padding: 1px;
|
||||
height: 25px;
|
||||
color: #333;
|
||||
width: 55px;
|
||||
}
|
||||
|
||||
/*****************************
|
||||
LAYOUT
|
||||
******************************/
|
||||
#wrap {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
background-color: #FFF;
|
||||
width: 790px;
|
||||
}
|
||||
|
||||
#content-wrap {
|
||||
clear: both;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 790px;
|
||||
}
|
||||
|
||||
/* header */
|
||||
#header {
|
||||
position: relative;
|
||||
clear: left;
|
||||
width: 790px;
|
||||
height: 137px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #000 url(headerbg.jpg) no-repeat left bottom;
|
||||
}
|
||||
|
||||
#header h1#logo-text {
|
||||
float: right;
|
||||
margin: 39px 58px 0 0;
|
||||
padding: 0;
|
||||
font: bolder 3.2em 'Trebuchet MS', Arial, Sans-serif;
|
||||
letter-spacing: -2px;
|
||||
color: #FFF;
|
||||
text-transform: none;
|
||||
/* change the values of top and right to adjust the position of the logo*/
|
||||
top: 35px;
|
||||
right: 30px;
|
||||
}
|
||||
|
||||
#header h2#slogan {
|
||||
float: right;
|
||||
margin: 0 38px 0 0;
|
||||
padding: 0;
|
||||
font: bold 1.5em 'Trebuchet MS', Arial, Sans-serif;
|
||||
text-transform: none;
|
||||
letter-spacing: 1px;
|
||||
color: #FFF;
|
||||
clear: both;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#header h1#logo-text span {
|
||||
color: #CFCED3;
|
||||
}
|
||||
|
||||
/* menu tabs */
|
||||
#header #header-tabs {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 25px;
|
||||
background: #000;
|
||||
font: bold 1.1em Verdana, Tahoma, 'Trebuchet MS', Sans-serif;
|
||||
}
|
||||
|
||||
#header-tabs ul {
|
||||
margin: 0;
|
||||
padding: 2px 0px 0px 0px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#header-tabs li {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#header-tabs a {
|
||||
float: left;
|
||||
background: url(tableft.gif) no-repeat left top;
|
||||
margin: 0;
|
||||
padding: 0 0 0 4px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#header-tabs a span {
|
||||
float: left;
|
||||
display: block;
|
||||
background: url(tabright.gif) no-repeat right top;
|
||||
padding: 7px 15px 4px 8px;
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
/* Commented Backslash Hack hides rule from IE5-Mac \*/
|
||||
#header-tabs a span {
|
||||
float: none;
|
||||
}
|
||||
|
||||
/* End IE5-Mac hack */
|
||||
#header-tabs a:hover span {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#header-tabs a:hover {
|
||||
background-position: 0% -42px;
|
||||
}
|
||||
|
||||
#header-tabs a:hover span {
|
||||
background-position: 100% -42px;
|
||||
}
|
||||
|
||||
#header-tabs #current a {
|
||||
background-position: 0% -42px;
|
||||
}
|
||||
|
||||
#header-tabs #current a span {
|
||||
background-position: 100% -42px;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* main content */
|
||||
#main {
|
||||
width: 748px;
|
||||
margin: 0;
|
||||
padding: 8px 16px;
|
||||
background-color: #F9F9F9;
|
||||
border-left: 5px solid #000;
|
||||
border-right: 5px solid #000;
|
||||
}
|
||||
|
||||
#main h1 {
|
||||
padding: 8px 0 3px 25px;
|
||||
text-transform: none;
|
||||
border-bottom: 2px solid #f2f2f2;
|
||||
color: #339900;
|
||||
}
|
||||
|
||||
/* sidebar */
|
||||
#sidebar { /* float: right;
|
||||
width: 245px;
|
||||
margin: 0 0 10px 0; padding: 0;
|
||||
background-color: inherit; */
|
||||
display: none;
|
||||
}
|
||||
|
||||
#sidebar h1 {
|
||||
padding: 8px 0px 3px 25px;
|
||||
background: url(square_arrow.gif) no-repeat 0% .7em;
|
||||
text-transform: none;
|
||||
color: #339900;
|
||||
}
|
||||
|
||||
#sidebar ul.sidemenu {
|
||||
list-style: none;
|
||||
margin: 10px 15px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#sidebar ul.sidemenu li {
|
||||
margin-bottom: 1px;
|
||||
border: 1px solid #f2f2f2;
|
||||
}
|
||||
|
||||
#sidebar ul.sidemenu a {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 2px 5px 2px 10px;
|
||||
background: #f2f2f2;
|
||||
border-left: 5px solid #CCC;
|
||||
min-height: 18px;
|
||||
}
|
||||
|
||||
* html body #sidebar ul.sidemenu a {
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
#sidebar ul.sidemenu a:hover {
|
||||
padding: 2px 5px 2px 10px;
|
||||
background: #f2f2f2;
|
||||
color: #339900;
|
||||
border-left: 5px solid #72A545;
|
||||
}
|
||||
|
||||
/* footer */
|
||||
#footer {
|
||||
clear: both;
|
||||
height: 40px;
|
||||
color: #CCC;
|
||||
background: #000;
|
||||
margin: 0;
|
||||
font-size: 92%;
|
||||
}
|
||||
|
||||
#footer a {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#footer #footer-left {
|
||||
width: 68%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#footer #footer-right {
|
||||
width: 25%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* alignment classes */
|
||||
.float-left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.float-right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* additional classes */
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gray {
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
.comments {
|
||||
color: #333;
|
||||
background: #FFF;
|
||||
text-align: right;
|
||||
border-top: 1px dashed #EFF0F1;
|
||||
border-bottom: 1px dashed #EFF0F1;
|
||||
padding: 5px 0;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
html {
|
||||
min-height: 100.1%;
|
||||
}
|
||||
|
||||
/* ------ one ------------*/
|
||||
body .mainText {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#demoText h1,.mainText h1 {
|
||||
font-size: 130%;
|
||||
color: #0099FF;
|
||||
text-decoration: none;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
margin: 5px 4px 5px 24px;
|
||||
background: none;
|
||||
padding: 0;
|
||||
border: none;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.mainText h2 {
|
||||
font-size: 110%;
|
||||
color: #000033;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-decoration: none;
|
||||
background: none;
|
||||
margin: 4px 32px 6px 22px;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.mainText h3 {
|
||||
font-size: 120%;
|
||||
font-weight: 900;
|
||||
margin: 14px 0 0 0;
|
||||
text-align: center;
|
||||
color: #000033;
|
||||
}
|
||||
|
||||
.mainText table {
|
||||
width: 95%;
|
||||
border: 1px solid #0099FF;
|
||||
border-collapse: collapse;
|
||||
margin: 18px 7px;
|
||||
}
|
||||
|
||||
.mainText table td {
|
||||
background-color: #99CCFF;
|
||||
color: #000033;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.mainText table th {
|
||||
background-color: #000033;
|
||||
color: #99CCFF;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.mainText .linkPar a {
|
||||
color: #000033;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.mainText .linkPar a:hover {
|
||||
color: #660033;
|
||||
text-decoration: none;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.pusher {
|
||||
cursor: pointer;
|
||||
padding: 3px 10px 3px 22px;
|
||||
font-weight: 900;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* ------------- form specific styles are here -------------- */
|
||||
fieldset {
|
||||
margin: 0;
|
||||
border: 1px solid #C3DE00;
|
||||
padding: 10px;
|
||||
/*border:none;
|
||||
padding:0;*/
|
||||
color: #7563A5;
|
||||
}
|
||||
|
||||
legend {
|
||||
background-color: #FFFFFF;
|
||||
text-align: center;
|
||||
color: #097981;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
label {
|
||||
text-align: right;
|
||||
width: 298px;
|
||||
border-right: 1px dotted #099;
|
||||
padding-right: 5px;
|
||||
margin: 0 0 8px 0;
|
||||
float: left;
|
||||
clear: left;
|
||||
display: block;
|
||||
color: #7563A5;
|
||||
}
|
||||
|
||||
label.checkbox,label.textarea {
|
||||
border: none;
|
||||
}
|
||||
|
||||
label.lgfield {
|
||||
border: none;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
float: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
fieldset input,fieldset select,fieldset textarea {
|
||||
margin-left: 10px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
select.longfield {
|
||||
margin: 0 0 0 115px;
|
||||
}
|
||||
|
||||
input [type="radio"],input [type="checkbox"] {
|
||||
margin: 2px 0 0 4px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 250px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
/*Get Help Form Styles*/
|
||||
p.formDisclaimer {
|
||||
text-align: center;
|
||||
margin: 32px 24px 12px 0;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.buttonWrapper {
|
||||
margin: 28px 0 14px 0;
|
||||
clear: both;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.formspacer {
|
||||
height: 1em;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.hideField {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pushOpen {
|
||||
height: 18em;
|
||||
}
|
||||
|
||||
/* ----- error message for field validation ----- */
|
||||
#stepForm label.warning {
|
||||
text-align: left;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
margin: 0 0 0 10px;
|
||||
float: none;
|
||||
clear: none;
|
||||
display: inline;
|
||||
color: #CC3366;
|
||||
font-size: 10px;
|
||||
border: none;
|
||||
border-top: 1px dotted #CC3366;
|
||||
}
|
||||
|
||||
div.requiredNotice {
|
||||
width: 140px;
|
||||
float: right;
|
||||
margin: 0 24px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h3.stepHeader {
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
margin: 0 0 24px 24px;
|
||||
color: #676cac;
|
||||
}
|
||||
|
||||
ul#stepForm,ul#stepForm li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul#stepForm li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
/* Form Buttons */
|
||||
input.submitbutton,.nextbutton,.prevbutton {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background-color: #663399;
|
||||
padding: 4px;
|
||||
border: 1px solid #339933;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
margin: 7px;
|
||||
}
|
||||
|
||||
input.submitbutton {
|
||||
background-color: #006699;
|
||||
}
|
155
vendors/jquery-validate-1.7/demo/radio-checkbox-select-demo.html
vendored
Normal file
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>Test for jQuery validate() plugin</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../lib/jquery.metadata.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
// only for demo purposes
|
||||
$.validator.setDefaults({
|
||||
submitHandler: function() {
|
||||
alert("submitted!");
|
||||
}
|
||||
});
|
||||
|
||||
$.metadata.setType("attr", "validate");
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#form1").validate();
|
||||
$("#selecttest").validate();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
.block { display: block; }
|
||||
form.cmxform label.error { display: none; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="banner"><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation Plugin</a> Demo</h1>
|
||||
<div id="main">
|
||||
|
||||
<form class="cmxform" id="form1" method="get" action="">
|
||||
<fieldset>
|
||||
<legend>Validating a form with a radio and checkbox buttons</legend>
|
||||
<fieldset>
|
||||
<legend>Gender</legend>
|
||||
<label for="gender_male">
|
||||
<input type="radio" id="gender_male" value="m" name="gender" validate="required:true" />
|
||||
Male
|
||||
</label>
|
||||
<label for="gender_female">
|
||||
<input type="radio" id="gender_female" value="f" name="gender"/>
|
||||
Female
|
||||
</label>
|
||||
<label for="gender" class="error">Please select your gender</label>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Family</legend>
|
||||
<label for="family_single">
|
||||
<input type="radio" id="family_single" value="s" name="family" validate="required:true" />
|
||||
Single
|
||||
</label>
|
||||
<label for="family_married">
|
||||
<input type="radio" id="family_married" value="m" name="family" />
|
||||
Married
|
||||
</label>
|
||||
<label for="family_other">
|
||||
<input type="radio" id="family_other" value="o" name="family" />
|
||||
Other
|
||||
</label>
|
||||
<label for="family" class="error">Please select your family status.</label>
|
||||
</fieldset>
|
||||
<p>
|
||||
<label for="agree">Please agree to our policy</label>
|
||||
<input type="checkbox" class="checkbox" id="agree" name="agree" validate="required:true" />
|
||||
<br/>
|
||||
<label for="agree" class="error block">Please agree to our policy!</label>
|
||||
</p>
|
||||
<fieldset>
|
||||
<legend>Spam</legend>
|
||||
<label for="spam_email">
|
||||
<input type="checkbox" class="checkbox" id="spam_email" value="email" name="spam[]" validate="required:true, minlength:2" />
|
||||
Spam via E-Mail
|
||||
</label>
|
||||
<label for="spam_phone">
|
||||
<input type="checkbox" class="checkbox" id="spam_phone" value="phone" name="spam[]" />
|
||||
Spam via Phone
|
||||
</label>
|
||||
<label for="spam_mail">
|
||||
<input type="checkbox" class="checkbox" id="spam_mail" value="mail" name="spam[]" />
|
||||
Spam via Mail
|
||||
</label>
|
||||
<label for="spam[]" class="error">Please select at least two types of spam.</label>
|
||||
</fieldset>
|
||||
<p>
|
||||
<input class="submit" type="submit" value="Submit"/>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<form id="selecttest">
|
||||
<h2>Some tests with selects</h2>
|
||||
<p>
|
||||
<label for="jungle">Please select a jungle noun</label><br/>
|
||||
<select id="jungle" name="jungle" title="Please select something!" validate="required:true">
|
||||
<option value=""></option>
|
||||
<option value="1">Buga</option>
|
||||
<option value="2">Baga</option>
|
||||
<option value="3">Oi</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="fruit">Please select at least two fruits</label><br/>
|
||||
<select id="fruit" name="fruit" title="Please select at least two fruits" validate="required:true, minlength:2" multiple="multiple">
|
||||
<option value="b">Banana</option>
|
||||
<option value="a">Apple</option>
|
||||
<option value="p">Peach</option>
|
||||
<option value="t">Turtle</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="vegetables">Please select no more than two vergetables</label><br/>
|
||||
<select id="vegetables" name="vegetables" title="Please select no more than two vergetables" validate="required:true, maxlength:2" multiple="multiple">
|
||||
<option value="p">Potato</option>
|
||||
<option value="t">Tomato</option>
|
||||
<option value="s">Salad</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="cars">Please select at least two cars, but no more than three</label><br/>
|
||||
<select id="cars" name="cars" title="Please select at least two cars, but no more than three" validate="required:true, rangelength:[2,3]" multiple="multiple">
|
||||
<option value="m_sl">Mercedes SL</option>
|
||||
<option value="o_c">Opel Corsa</option>
|
||||
<option value="vw_p">VW Polo</option>
|
||||
<option value="t_s">Titanic Skoda</option>
|
||||
</select>
|
||||
</p>
|
||||
|
||||
<p><input type="submit" value="Validate Selecttests"/></p>
|
||||
</form>
|
||||
|
||||
<a href="index.html">Back to main page</a>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
157
vendors/jquery-validate-1.7/demo/tabs/index.html
vendored
Normal file
|
@ -0,0 +1,157 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>jQuery UI tabs integration demo</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css" />
|
||||
|
||||
<script src="../../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js" type="text/javascript"></script>
|
||||
<script src="../../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script id="demo" type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var tabs = $("#tabs").tabs();
|
||||
var validator = $("#signupform").validate({
|
||||
groups: {
|
||||
birthdate: "birthdateDay birthdateMonth birthdateYear"
|
||||
},
|
||||
errorPlacement: function(label, element) {
|
||||
if (/^birthdate/.test(element[0].name)) {
|
||||
label.insertAfter("#birthdateYear");
|
||||
} else {
|
||||
label.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// validate the other two selects when one changes to update the whole group
|
||||
var birthdaySelects = $("#birthdateGroup select").click(function() {
|
||||
birthdaySelects.not(this).valid();
|
||||
})
|
||||
|
||||
// overwrite focusInvalid to activate tab with invalid elements
|
||||
validator.focusInvalid = function() {
|
||||
if( this.settings.focusInvalid ) {
|
||||
try {
|
||||
var focused = $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible");
|
||||
tabs.tabs("select", tabs.find(">div").index(focused.parent().parent()));
|
||||
focused.focus();
|
||||
} catch(e) {
|
||||
// ignore IE throwing errors when focusing hidden elements
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body { font-size: 65.2% }
|
||||
label { display: inline-block; width: 8em; }
|
||||
label.error { color: red; margin-left: 0.5em; width: 20em; }
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form id="signupform">
|
||||
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#logindata">Login data</a></li>
|
||||
<li><a href="#personaldata">Personal data</a></li>
|
||||
<li><a href="#subscriptions">Subscriptions</a></li>
|
||||
</ul>
|
||||
<div id="logindata">
|
||||
<p>
|
||||
<label for="username">Username</label>
|
||||
<input id="username" name="username" class="required" minlength="3" maxlength="20" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="email">Email address</label>
|
||||
<input id="email" name="email" class="required email" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
<input name="password" type="password" class="required" id="password" minlength="4" maxlength="50" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="confirmpassword">Confirm Password</label>
|
||||
<input name="confirmpassword" type="password" class="required" equalTo="#password" id="confirmpassword" />
|
||||
</p>
|
||||
</div>
|
||||
<div id="personaldata">
|
||||
<p>
|
||||
<label for="street">Street</label>
|
||||
<input id="street" name="street" class="required" minlength="3" maxlength="50" type="text" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="city">City</label>
|
||||
<input id="city" name="city" class="required" minlength="3" maxlength="50" type="text" />
|
||||
</p>
|
||||
<p id="birthdateGroup">
|
||||
<label for="birthdateDay">Birthdate</label>
|
||||
<select id="birthdateDay" name="birthdateDay" class="required">
|
||||
<option value="">Day</option>
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>...</option>
|
||||
</select>
|
||||
<select id="birthdateMonth" name="birthdateMonth" class="required">
|
||||
<option value="">Month</option>
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
<option>6</option>
|
||||
<option>7</option>
|
||||
<option>8</option>
|
||||
<option>9</option>
|
||||
<option>10</option>
|
||||
<option>11</option>
|
||||
<option>12</option>
|
||||
</select>
|
||||
<select id="birthdateYear" name="birthdateYear" class="required">
|
||||
<option value="">Year</option>
|
||||
<option>1950</option>
|
||||
<option>1951</option>
|
||||
<option>1952</option>
|
||||
<option>1953</option>
|
||||
<option>1954</option>
|
||||
<option>1955</option>
|
||||
<option>...</option>
|
||||
</select>
|
||||
</p>
|
||||
</div>
|
||||
<div id="subscriptions">
|
||||
<p>
|
||||
<label for="weekly">Weekly Newsletter</label>
|
||||
<input id="weekly" name="weekly" type="checkbox" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="updates">Product Updates</label>
|
||||
<input id="updates" name="updates" type="checkbox" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="terms">Terms and conditions</label>
|
||||
<input id="terms" name="terms" class="required" type="checkbox" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" />
|
||||
</form>
|
||||
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
227
vendors/jquery-validate-1.7/demo/themerollered.html
vendored
Normal file
|
@ -0,0 +1,227 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<title>jQuery validation plug-in - main demo</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="http://jquery-ui.googlecode.com/svn/branches/dev/themes/base/ui.button.css" />
|
||||
|
||||
<script src="../lib/jquery.js" type="text/javascript"></script>
|
||||
<script src="../jquery.validate.js" type="text/javascript"></script>
|
||||
|
||||
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.ui.core.js" type="text/javascript"></script>
|
||||
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.ui.widget.js" type="text/javascript"></script>
|
||||
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery.ui.button.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$.validator.setDefaults({
|
||||
submitHandler: function() { alert("submitted!"); },
|
||||
highlight: function(input) {
|
||||
$(input).addClass("ui-state-highlight");
|
||||
},
|
||||
unhighlight: function(input) {
|
||||
$(input).removeClass("ui-state-highlight");
|
||||
}
|
||||
});
|
||||
|
||||
$().ready(function() {
|
||||
$.fn.themeswitcher && $('<div/>').css({
|
||||
position: "absolute",
|
||||
right: 10,
|
||||
top: 10
|
||||
}).appendTo(document.body).themeswitcher();
|
||||
|
||||
// validate the comment form when it is submitted
|
||||
$("#commentForm").validate();
|
||||
|
||||
// validate signup form on keyup and submit
|
||||
$("#signupForm").validate({
|
||||
rules: {
|
||||
firstname: "required",
|
||||
lastname: "required",
|
||||
username: {
|
||||
required: true,
|
||||
minlength: 2
|
||||
},
|
||||
password: {
|
||||
required: true,
|
||||
minlength: 5
|
||||
},
|
||||
confirm_password: {
|
||||
required: true,
|
||||
minlength: 5,
|
||||
equalTo: "#password"
|
||||
},
|
||||
email: {
|
||||
required: true,
|
||||
email: true
|
||||
},
|
||||
topic: {
|
||||
required: "#newsletter:checked",
|
||||
minlength: 2
|
||||
},
|
||||
agree: "required"
|
||||
},
|
||||
messages: {
|
||||
firstname: "Please enter your firstname",
|
||||
lastname: "Please enter your lastname",
|
||||
username: {
|
||||
required: "Please enter a username",
|
||||
minlength: "Your username must consist of at least 2 characters"
|
||||
},
|
||||
password: {
|
||||
required: "Please provide a password",
|
||||
minlength: "Your password must be at least 5 characters long"
|
||||
},
|
||||
confirm_password: {
|
||||
required: "Please provide a password",
|
||||
minlength: "Your password must be at least 5 characters long",
|
||||
equalTo: "Please enter the same password as above"
|
||||
},
|
||||
email: "Please enter a valid email address",
|
||||
agree: "Please accept our policy"
|
||||
}
|
||||
});
|
||||
|
||||
// propose username by combining first- and lastname
|
||||
$("#username").focus(function() {
|
||||
var firstname = $("#firstname").val();
|
||||
var lastname = $("#lastname").val();
|
||||
if(firstname && lastname && !this.value) {
|
||||
this.value = firstname + "." + lastname;
|
||||
}
|
||||
});
|
||||
|
||||
//code to hide topic selection, disable for demo
|
||||
var newsletter = $("#newsletter");
|
||||
// newsletter topics are optional, hide at first
|
||||
var inital = newsletter.is(":checked");
|
||||
var topics = $("#newsletter_topics")[inital ? "removeClass" : "addClass"]("gray");
|
||||
var topicInputs = topics.find("input").attr("disabled", !inital);
|
||||
// show when newsletter is checked
|
||||
newsletter.click(function() {
|
||||
topics[this.checked ? "removeClass" : "addClass"]("gray");
|
||||
topicInputs.attr("disabled", !this.checked);
|
||||
});
|
||||
|
||||
$("#signupForm input:not(:submit)").addClass("ui-widget-content");
|
||||
|
||||
$(":submit").button();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body { font-size: 62.5%; }
|
||||
label { display: inline-block; width: 100px; }
|
||||
legend { padding: 0.5em; }
|
||||
fieldset fieldset label { display: block; }
|
||||
#commentForm { width: 500px; }
|
||||
#commentForm label { width: 250px; }
|
||||
#commentForm label.error, #commentForm button.submit { margin-left: 253px; }
|
||||
#signupForm { width: 670px; }
|
||||
#signupForm label.error {
|
||||
margin-left: 10px;
|
||||
width: auto;
|
||||
display: inline;
|
||||
}
|
||||
#newsletter_topics label.error {
|
||||
display: none;
|
||||
margin-left: 103px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form class="cmxform" id="commentForm" method="get" action="">
|
||||
<fieldset class="ui-widget ui-widget-content ui-corner-all">
|
||||
<legend class="ui-widget ui-widget-header ui-corner-all">Please provide your name, email address (won't be published) and a comment</legend>
|
||||
<p>
|
||||
<label for="cname">Name (required, at least 2 characters)</label>
|
||||
<input id="cname" name="name" class="required ui-widget-content" minlength="2" />
|
||||
<p>
|
||||
<label for="cemail">E-Mail (required)</label>
|
||||
<input id="cemail" name="email" class="required email ui-widget-content" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="curl">URL (optional)</label>
|
||||
<input id="curl" name="url" class="url ui-widget-content" value="" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="ccomment">Your comment (required)</label>
|
||||
<textarea id="ccomment" name="comment" class="required ui-widget-content"></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<button class="submit" type="submit">Submit</button>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<form class="cmxform" id="signupForm" method="get" action="">
|
||||
<fieldset class="ui-widget ui-widget-content ui-corner-all">
|
||||
<legend class="ui-widget ui-widget-header ui-corner-all">Validating a complete form</legend>
|
||||
<p>
|
||||
<label for="firstname">Firstname</label>
|
||||
<input id="firstname" name="firstname" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="lastname">Lastname</label>
|
||||
<input id="lastname" name="lastname" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="username">Username</label>
|
||||
<input id="username" name="username" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
<input id="password" name="password" type="password" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="confirm_password">Confirm password</label>
|
||||
<input id="confirm_password" name="confirm_password" type="password" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="email">Email</label>
|
||||
<input id="email" name="email" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="agree">Please agree to our policy</label>
|
||||
<input type="checkbox" class="checkbox" id="agree" name="agree" />
|
||||
</p>
|
||||
<p>
|
||||
<label for="newsletter">I'd like to receive the newsletter</label>
|
||||
<input type="checkbox" class="checkbox" id="newsletter" name="newsletter" />
|
||||
</p>
|
||||
<fieldset id="newsletter_topics" class="ui-widget-content ui-corner-all">
|
||||
<legend class="ui-widget-header ui-corner-all">Topics (select at least two) - note: would be hidden when newsletter isn't selected, but is visible here for the demo</legend>
|
||||
<label for="topic_marketflash">
|
||||
<input type="checkbox" id="topic_marketflash" value="marketflash" name="topic" />
|
||||
Marketflash
|
||||
</label>
|
||||
<label for="topic_fuzz">
|
||||
<input type="checkbox" id="topic_fuzz" value="fuzz" name="topic" />
|
||||
Latest fuzz
|
||||
</label>
|
||||
<label for="topic_digester">
|
||||
<input type="checkbox" id="topic_digester" value="digester" name="topic" />
|
||||
Mailing list digester
|
||||
</label>
|
||||
<label for="topic" class="error">Please select at least two topics you'd like to receive.</label>
|
||||
</fieldset>
|
||||
<p>
|
||||
<button class="submit" type="submit">Submit</button>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
_uacct = "UA-2623402-1";
|
||||
urchinTracker();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
75
vendors/jquery-validate-1.7/demo/tinymce/index.html
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>jQuery Validation plugin: integration with TinyMCE</title>
|
||||
|
||||
<script type="text/javascript" src="../../lib/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../jquery.validate.js"></script>
|
||||
<script type="text/javascript" src="tiny_mce.js"></script>
|
||||
<script type="text/javascript">
|
||||
tinyMCE.init({
|
||||
mode : "textareas",
|
||||
theme : "simple",
|
||||
// update validation status on change
|
||||
onchange_callback: function(editor) {
|
||||
tinyMCE.triggerSave();
|
||||
$("#" + editor.id).valid();
|
||||
}
|
||||
});
|
||||
$(function() {
|
||||
var validator = $("#myform").submit(function() {
|
||||
// update underlying textarea before submit validation
|
||||
tinyMCE.triggerSave();
|
||||
}).validate({
|
||||
rules: {
|
||||
title: "required",
|
||||
content: "required"
|
||||
},
|
||||
errorPlacement: function(label, element) {
|
||||
// position error label after generated textarea
|
||||
if (element.is("textarea")) {
|
||||
label.insertAfter(element.next());
|
||||
} else {
|
||||
label.insertAfter(element)
|
||||
}
|
||||
}
|
||||
});
|
||||
validator.focusInvalid = function() {
|
||||
// put focus on tinymce on submit validation
|
||||
if( this.settings.focusInvalid ) {
|
||||
try {
|
||||
var toFocus = $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []);
|
||||
if (toFocus.is("textarea")) {
|
||||
tinyMCE.get(toFocus.attr("id")).focus();
|
||||
} else {
|
||||
toFocus.filter(":visible").focus();
|
||||
}
|
||||
} catch(e) {
|
||||
// ignore IE throwing errors when focusing hidden elements
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!-- /TinyMCE -->
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form id="myform" action="">
|
||||
<h3>TinyMCE and Validation Plugin integration example</h3>
|
||||
|
||||
<label>Some other field</label>
|
||||
<input name="title" />
|
||||
|
||||
<br/>
|
||||
|
||||
<label>Some richt text</label>
|
||||
<textarea id="content" name="content" rows="15" cols="80" style="width: 80%"></textarea>
|
||||
|
||||
<br />
|
||||
<input type="submit" name="save" value="Submit" />
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
1
vendors/jquery-validate-1.7/demo/tinymce/themes/simple/editor_template.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
(function(){var DOM=tinymce.DOM;tinymce.ThemeManager.requireLangPack('simple');tinymce.create('tinymce.themes.SimpleTheme',{init:function(ed,url){var t=this,states=['Bold','Italic','Underline','Strikethrough','InsertUnorderedList','InsertOrderedList'],s=ed.settings;t.editor=ed;ed.onInit.add(function(){ed.onNodeChange.add(function(ed,cm){tinymce.each(states,function(c){cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));});});ed.dom.loadCSS(url+"/skins/"+s.skin+"/content.css");});DOM.loadCSS((s.editor_css?ed.documentBaseURI.toAbsolute(s.editor_css):'')||url+"/skins/"+s.skin+"/ui.css");},renderUI:function(o){var t=this,n=o.targetNode,ic,tb,ed=t.editor,cf=ed.controlManager,sc;n=DOM.insertAfter(DOM.create('span',{id:ed.id+'_container','class':'mceEditor '+ed.settings.skin+'SimpleSkin'}),n);n=sc=DOM.add(n,'table',{cellPadding:0,cellSpacing:0,'class':'mceLayout'});n=tb=DOM.add(n,'tbody');n=DOM.add(tb,'tr');n=ic=DOM.add(DOM.add(n,'td'),'div',{'class':'mceIframeContainer'});n=DOM.add(DOM.add(tb,'tr',{'class':'last'}),'td',{'class':'mceToolbar mceLast',align:'center'});tb=t.toolbar=cf.createToolbar("tools1");tb.add(cf.createButton('bold',{title:'simple.bold_desc',cmd:'Bold'}));tb.add(cf.createButton('italic',{title:'simple.italic_desc',cmd:'Italic'}));tb.add(cf.createButton('underline',{title:'simple.underline_desc',cmd:'Underline'}));tb.add(cf.createButton('strikethrough',{title:'simple.striketrough_desc',cmd:'Strikethrough'}));tb.add(cf.createSeparator());tb.add(cf.createButton('undo',{title:'simple.undo_desc',cmd:'Undo'}));tb.add(cf.createButton('redo',{title:'simple.redo_desc',cmd:'Redo'}));tb.add(cf.createSeparator());tb.add(cf.createButton('cleanup',{title:'simple.cleanup_desc',cmd:'mceCleanup'}));tb.add(cf.createSeparator());tb.add(cf.createButton('insertunorderedlist',{title:'simple.bullist_desc',cmd:'InsertUnorderedList'}));tb.add(cf.createButton('insertorderedlist',{title:'simple.numlist_desc',cmd:'InsertOrderedList'}));tb.renderTo(n);return{iframeContainer:ic,editorContainer:ed.id+'_container',sizeContainer:sc,deltaHeight:-20};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add('simple',tinymce.themes.SimpleTheme);})();
|
BIN
vendors/jquery-validate-1.7/demo/tinymce/themes/simple/img/icons.gif
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
11
vendors/jquery-validate-1.7/demo/tinymce/themes/simple/langs/en.js
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
tinyMCE.addI18n('en.simple',{
|
||||
bold_desc:"Bold (Ctrl+B)",
|
||||
italic_desc:"Italic (Ctrl+I)",
|
||||
underline_desc:"Underline (Ctrl+U)",
|
||||
striketrough_desc:"Strikethrough",
|
||||
bullist_desc:"Unordered list",
|
||||
numlist_desc:"Ordered list",
|
||||
undo_desc:"Undo (Ctrl+Z)",
|
||||
redo_desc:"Redo (Ctrl+Y)",
|
||||
cleanup_desc:"Cleanup messy code"
|
||||
});
|
32
vendors/jquery-validate-1.7/demo/tinymce/themes/simple/skins/default/ui.css
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* Reset */
|
||||
.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
|
||||
|
||||
/* Containers */
|
||||
.defaultSimpleSkin {position:relative}
|
||||
.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}
|
||||
.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}
|
||||
.defaultSimpleSkin .mceToolbar {height:24px;}
|
||||
|
||||
/* Layout */
|
||||
.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}
|
||||
.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
|
||||
|
||||
/* Button */
|
||||
.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}
|
||||
.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
|
||||
.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}
|
||||
.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
|
||||
|
||||
/* Separator */
|
||||
.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}
|
||||
|
||||
/* Theme */
|
||||
.defaultSimpleSkin span.mce_bold {background-position:0 0}
|
||||
.defaultSimpleSkin span.mce_italic {background-position:-60px 0}
|
||||
.defaultSimpleSkin span.mce_underline {background-position:-140px 0}
|
||||
.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}
|
||||
.defaultSimpleSkin span.mce_undo {background-position:-160px 0}
|
||||
.defaultSimpleSkin span.mce_redo {background-position:-100px 0}
|
||||
.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}
|
||||
.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
|
||||
.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
|
1
vendors/jquery-validate-1.7/demo/tinymce/tiny_mce.js
vendored
Normal file
1146
vendors/jquery-validate-1.7/jquery.validate.js
vendored
Normal file
16
vendors/jquery-validate-1.7/jquery.validate.min.js
vendored
Normal file
15
vendors/jquery-validate-1.7/jquery.validate.pack.js
vendored
Normal file
6240
vendors/jquery-validate-1.7/lib/jquery-1.4.2.js
vendored
Normal file
660
vendors/jquery-validate-1.7/lib/jquery.form.js
vendored
Normal file
|
@ -0,0 +1,660 @@
|
|||
/*
|
||||
* jQuery Form Plugin
|
||||
* version: 2.36 (07-NOV-2009)
|
||||
* @requires jQuery v1.2.6 or later
|
||||
*
|
||||
* Examples and documentation at: http://malsup.com/jquery/form/
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
/*
|
||||
Usage Note:
|
||||
-----------
|
||||
Do not use both ajaxSubmit and ajaxForm on the same form. These
|
||||
functions are intended to be exclusive. Use ajaxSubmit if you want
|
||||
to bind your own submit handler to the form. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').bind('submit', function() {
|
||||
$(this).ajaxSubmit({
|
||||
target: '#output'
|
||||
});
|
||||
return false; // <-- important!
|
||||
});
|
||||
});
|
||||
|
||||
Use ajaxForm when you want the plugin to manage all the event binding
|
||||
for you. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').ajaxForm({
|
||||
target: '#output'
|
||||
});
|
||||
});
|
||||
|
||||
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
||||
at the appropriate time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* ajaxSubmit() provides a mechanism for immediately submitting
|
||||
* an HTML form using AJAX.
|
||||
*/
|
||||
$.fn.ajaxSubmit = function(options) {
|
||||
// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
|
||||
if (!this.length) {
|
||||
log('ajaxSubmit: skipping submit process - no element selected');
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof options == 'function')
|
||||
options = { success: options };
|
||||
|
||||
var url = $.trim(this.attr('action'));
|
||||
if (url) {
|
||||
// clean url (don't include hash vaue)
|
||||
url = (url.match(/^([^#]+)/)||[])[1];
|
||||
}
|
||||
url = url || window.location.href || '';
|
||||
|
||||
options = $.extend({
|
||||
url: url,
|
||||
type: this.attr('method') || 'GET',
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
|
||||
}, options || {});
|
||||
|
||||
// hook for manipulating the form data before it is extracted;
|
||||
// convenient for use with rich editors like tinyMCE or FCKEditor
|
||||
var veto = {};
|
||||
this.trigger('form-pre-serialize', [this, options, veto]);
|
||||
if (veto.veto) {
|
||||
log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
|
||||
return this;
|
||||
}
|
||||
|
||||
// provide opportunity to alter form data before it is serialized
|
||||
if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
|
||||
log('ajaxSubmit: submit aborted via beforeSerialize callback');
|
||||
return this;
|
||||
}
|
||||
|
||||
var a = this.formToArray(options.semantic);
|
||||
if (options.data) {
|
||||
options.extraData = options.data;
|
||||
for (var n in options.data) {
|
||||
if(options.data[n] instanceof Array) {
|
||||
for (var k in options.data[n])
|
||||
a.push( { name: n, value: options.data[n][k] } );
|
||||
}
|
||||
else
|
||||
a.push( { name: n, value: options.data[n] } );
|
||||
}
|
||||
}
|
||||
|
||||
// give pre-submit callback an opportunity to abort the submit
|
||||
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
|
||||
log('ajaxSubmit: submit aborted via beforeSubmit callback');
|
||||
return this;
|
||||
}
|
||||
|
||||
// fire vetoable 'validate' event
|
||||
this.trigger('form-submit-validate', [a, this, options, veto]);
|
||||
if (veto.veto) {
|
||||
log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
|
||||
return this;
|
||||
}
|
||||
|
||||
var q = $.param(a);
|
||||
|
||||
if (options.type.toUpperCase() == 'GET') {
|
||||
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
||||
options.data = null; // data is null for 'get'
|
||||
}
|
||||
else
|
||||
options.data = q; // data is the query string for 'post'
|
||||
|
||||
var $form = this, callbacks = [];
|
||||
if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
|
||||
if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
|
||||
|
||||
// perform a load on the target only if dataType is not provided
|
||||
if (!options.dataType && options.target) {
|
||||
var oldSuccess = options.success || function(){};
|
||||
callbacks.push(function(data) {
|
||||
$(options.target).html(data).each(oldSuccess, arguments);
|
||||
});
|
||||
}
|
||||
else if (options.success)
|
||||
callbacks.push(options.success);
|
||||
|
||||
options.success = function(data, status) {
|
||||
for (var i=0, max=callbacks.length; i < max; i++)
|
||||
callbacks[i].apply(options, [data, status, $form]);
|
||||
};
|
||||
|
||||
// are there files to upload?
|
||||
var files = $('input:file', this).fieldValue();
|
||||
var found = false;
|
||||
for (var j=0; j < files.length; j++)
|
||||
if (files[j])
|
||||
found = true;
|
||||
|
||||
var multipart = false;
|
||||
// var mp = 'multipart/form-data';
|
||||
// multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
|
||||
|
||||
// options.iframe allows user to force iframe mode
|
||||
// 06-NOV-09: now defaulting to iframe mode if file input is detected
|
||||
if ((files.length && options.iframe !== false) || options.iframe || found || multipart) {
|
||||
// hack to fix Safari hang (thanks to Tim Molendijk for this)
|
||||
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
|
||||
if (options.closeKeepAlive)
|
||||
$.get(options.closeKeepAlive, fileUpload);
|
||||
else
|
||||
fileUpload();
|
||||
}
|
||||
else
|
||||
$.ajax(options);
|
||||
|
||||
// fire 'notify' event
|
||||
this.trigger('form-submit-notify', [this, options]);
|
||||
return this;
|
||||
|
||||
|
||||
// private function for handling file uploads (hat tip to YAHOO!)
|
||||
function fileUpload() {
|
||||
var form = $form[0];
|
||||
|
||||
if ($(':input[name=submit]', form).length) {
|
||||
alert('Error: Form elements must not be named "submit".');
|
||||
return;
|
||||
}
|
||||
|
||||
var opts = $.extend({}, $.ajaxSettings, options);
|
||||
var s = $.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts);
|
||||
|
||||
var id = 'jqFormIO' + (new Date().getTime());
|
||||
var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ opts.iframeSrc +'" />');
|
||||
var io = $io[0];
|
||||
|
||||
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
|
||||
|
||||
var xhr = { // mock object
|
||||
aborted: 0,
|
||||
responseText: null,
|
||||
responseXML: null,
|
||||
status: 0,
|
||||
statusText: 'n/a',
|
||||
getAllResponseHeaders: function() {},
|
||||
getResponseHeader: function() {},
|
||||
setRequestHeader: function() {},
|
||||
abort: function() {
|
||||
this.aborted = 1;
|
||||
$io.attr('src', opts.iframeSrc); // abort op in progress
|
||||
}
|
||||
};
|
||||
|
||||
var g = opts.global;
|
||||
// trigger ajax global events so that activity/block indicators work like normal
|
||||
if (g && ! $.active++) $.event.trigger("ajaxStart");
|
||||
if (g) $.event.trigger("ajaxSend", [xhr, opts]);
|
||||
|
||||
if (s.beforeSend && s.beforeSend(xhr, s) === false) {
|
||||
s.global && $.active--;
|
||||
return;
|
||||
}
|
||||
if (xhr.aborted)
|
||||
return;
|
||||
|
||||
var cbInvoked = 0;
|
||||
var timedOut = 0;
|
||||
|
||||
// add submitting element to data if we know it
|
||||
var sub = form.clk;
|
||||
if (sub) {
|
||||
var n = sub.name;
|
||||
if (n && !sub.disabled) {
|
||||
options.extraData = options.extraData || {};
|
||||
options.extraData[n] = sub.value;
|
||||
if (sub.type == "image") {
|
||||
options.extraData[name+'.x'] = form.clk_x;
|
||||
options.extraData[name+'.y'] = form.clk_y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// take a breath so that pending repaints get some cpu time before the upload starts
|
||||
setTimeout(function() {
|
||||
// make sure form attrs are set
|
||||
var t = $form.attr('target'), a = $form.attr('action');
|
||||
|
||||
// update form attrs in IE friendly way
|
||||
form.setAttribute('target',id);
|
||||
if (form.getAttribute('method') != 'POST')
|
||||
form.setAttribute('method', 'POST');
|
||||
if (form.getAttribute('action') != opts.url)
|
||||
form.setAttribute('action', opts.url);
|
||||
|
||||
// ie borks in some cases when setting encoding
|
||||
if (! options.skipEncodingOverride) {
|
||||
$form.attr({
|
||||
encoding: 'multipart/form-data',
|
||||
enctype: 'multipart/form-data'
|
||||
});
|
||||
}
|
||||
|
||||
// support timout
|
||||
if (opts.timeout)
|
||||
setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
|
||||
|
||||
// add "extra" data to form if provided in options
|
||||
var extraInputs = [];
|
||||
try {
|
||||
if (options.extraData)
|
||||
for (var n in options.extraData)
|
||||
extraInputs.push(
|
||||
$('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />')
|
||||
.appendTo(form)[0]);
|
||||
|
||||
// add iframe to doc and submit the form
|
||||
$io.appendTo('body');
|
||||
io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
|
||||
form.submit();
|
||||
}
|
||||
finally {
|
||||
// reset attrs and remove "extra" input elements
|
||||
form.setAttribute('action',a);
|
||||
t ? form.setAttribute('target', t) : $form.removeAttr('target');
|
||||
$(extraInputs).remove();
|
||||
}
|
||||
}, 10);
|
||||
|
||||
var domCheckCount = 50;
|
||||
|
||||
function cb() {
|
||||
if (cbInvoked++) return;
|
||||
|
||||
io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
|
||||
|
||||
var ok = true;
|
||||
try {
|
||||
if (timedOut) throw 'timeout';
|
||||
// extract the server response from the iframe
|
||||
var data, doc;
|
||||
|
||||
doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
|
||||
|
||||
var isXml = opts.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
|
||||
log('isXml='+isXml);
|
||||
if (!isXml && (doc.body == null || doc.body.innerHTML == '')) {
|
||||
if (--domCheckCount) {
|
||||
// in some browsers (Opera) the iframe DOM is not always traversable when
|
||||
// the onload callback fires, so we loop a bit to accommodate
|
||||
cbInvoked = 0;
|
||||
setTimeout(cb, 100);
|
||||
return;
|
||||
}
|
||||
log('Could not access iframe DOM after 50 tries.');
|
||||
return;
|
||||
}
|
||||
|
||||
xhr.responseText = doc.body ? doc.body.innerHTML : null;
|
||||
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
|
||||
xhr.getResponseHeader = function(header){
|
||||
var headers = {'content-type': opts.dataType};
|
||||
return headers[header];
|
||||
};
|
||||
|
||||
if (opts.dataType == 'json' || opts.dataType == 'script') {
|
||||
// see if user embedded response in textarea
|
||||
var ta = doc.getElementsByTagName('textarea')[0];
|
||||
if (ta)
|
||||
xhr.responseText = ta.value;
|
||||
else {
|
||||
// account for browsers injecting pre around json response
|
||||
var pre = doc.getElementsByTagName('pre')[0];
|
||||
if (pre)
|
||||
xhr.responseText = pre.innerHTML;
|
||||
}
|
||||
}
|
||||
else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
|
||||
xhr.responseXML = toXml(xhr.responseText);
|
||||
}
|
||||
data = $.httpData(xhr, opts.dataType);
|
||||
}
|
||||
catch(e){
|
||||
ok = false;
|
||||
$.handleError(opts, xhr, 'error', e);
|
||||
}
|
||||
|
||||
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
|
||||
if (ok) {
|
||||
opts.success(data, 'success');
|
||||
if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
|
||||
}
|
||||
if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
|
||||
if (g && ! --$.active) $.event.trigger("ajaxStop");
|
||||
if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
|
||||
|
||||
// clean up
|
||||
setTimeout(function() {
|
||||
$io.remove();
|
||||
xhr.responseXML = null;
|
||||
}, 100);
|
||||
};
|
||||
|
||||
function toXml(s, doc) {
|
||||
if (window.ActiveXObject) {
|
||||
doc = new ActiveXObject('Microsoft.XMLDOM');
|
||||
doc.async = 'false';
|
||||
doc.loadXML(s);
|
||||
}
|
||||
else
|
||||
doc = (new DOMParser()).parseFromString(s, 'text/xml');
|
||||
return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* ajaxForm() provides a mechanism for fully automating form submission.
|
||||
*
|
||||
* The advantages of using this method instead of ajaxSubmit() are:
|
||||
*
|
||||
* 1: This method will include coordinates for <input type="image" /> elements (if the element
|
||||
* is used to submit the form).
|
||||
* 2. This method will include the submit element's name/value data (for the element that was
|
||||
* used to submit the form).
|
||||
* 3. This method binds the submit() method to the form for you.
|
||||
*
|
||||
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
|
||||
* passes the options argument along after properly binding events for submit elements and
|
||||
* the form itself.
|
||||
*/
|
||||
$.fn.ajaxForm = function(options) {
|
||||
return this.ajaxFormUnbind().bind('submit.form-plugin', function() {
|
||||
$(this).ajaxSubmit(options);
|
||||
return false;
|
||||
}).bind('click.form-plugin', function(e) {
|
||||
var target = e.target;
|
||||
var $el = $(target);
|
||||
if (!($el.is(":submit,input:image"))) {
|
||||
// is this a child element of the submit el? (ex: a span within a button)
|
||||
var t = $el.closest(':submit');
|
||||
if (t.length == 0)
|
||||
return;
|
||||
target = t[0];
|
||||
}
|
||||
var form = this;
|
||||
form.clk = target;
|
||||
if (target.type == 'image') {
|
||||
if (e.offsetX != undefined) {
|
||||
form.clk_x = e.offsetX;
|
||||
form.clk_y = e.offsetY;
|
||||
} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
|
||||
var offset = $el.offset();
|
||||
form.clk_x = e.pageX - offset.left;
|
||||
form.clk_y = e.pageY - offset.top;
|
||||
} else {
|
||||
form.clk_x = e.pageX - target.offsetLeft;
|
||||
form.clk_y = e.pageY - target.offsetTop;
|
||||
}
|
||||
}
|
||||
// clear form vars
|
||||
setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
|
||||
});
|
||||
};
|
||||
|
||||
// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
|
||||
$.fn.ajaxFormUnbind = function() {
|
||||
return this.unbind('submit.form-plugin click.form-plugin');
|
||||
};
|
||||
|
||||
/**
|
||||
* formToArray() gathers form element data into an array of objects that can
|
||||
* be passed to any of the following ajax functions: $.get, $.post, or load.
|
||||
* Each object in the array has both a 'name' and 'value' property. An example of
|
||||
* an array for a simple login form might be:
|
||||
*
|
||||
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
|
||||
*
|
||||
* It is this array that is passed to pre-submit callback functions provided to the
|
||||
* ajaxSubmit() and ajaxForm() methods.
|
||||
*/
|
||||
$.fn.formToArray = function(semantic) {
|
||||
var a = [];
|
||||
if (this.length == 0) return a;
|
||||
|
||||
var form = this[0];
|
||||
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
||||
if (!els) return a;
|
||||
for(var i=0, max=els.length; i < max; i++) {
|
||||
var el = els[i];
|
||||
var n = el.name;
|
||||
if (!n) continue;
|
||||
|
||||
if (semantic && form.clk && el.type == "image") {
|
||||
// handle image inputs on the fly when semantic == true
|
||||
if(!el.disabled && form.clk == el) {
|
||||
a.push({name: n, value: $(el).val()});
|
||||
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
var v = $.fieldValue(el, true);
|
||||
if (v && v.constructor == Array) {
|
||||
for(var j=0, jmax=v.length; j < jmax; j++)
|
||||
a.push({name: n, value: v[j]});
|
||||
}
|
||||
else if (v !== null && typeof v != 'undefined')
|
||||
a.push({name: n, value: v});
|
||||
}
|
||||
|
||||
if (!semantic && form.clk) {
|
||||
// input type=='image' are not found in elements array! handle it here
|
||||
var $input = $(form.clk), input = $input[0], n = input.name;
|
||||
if (n && !input.disabled && input.type == 'image') {
|
||||
a.push({name: n, value: $input.val()});
|
||||
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
||||
}
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes form data into a 'submittable' string. This method will return a string
|
||||
* in the format: name1=value1&name2=value2
|
||||
*/
|
||||
$.fn.formSerialize = function(semantic) {
|
||||
//hand off to jQuery.param for proper encoding
|
||||
return $.param(this.formToArray(semantic));
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes all field elements in the jQuery object into a query string.
|
||||
* This method will return a string in the format: name1=value1&name2=value2
|
||||
*/
|
||||
$.fn.fieldSerialize = function(successful) {
|
||||
var a = [];
|
||||
this.each(function() {
|
||||
var n = this.name;
|
||||
if (!n) return;
|
||||
var v = $.fieldValue(this, successful);
|
||||
if (v && v.constructor == Array) {
|
||||
for (var i=0,max=v.length; i < max; i++)
|
||||
a.push({name: n, value: v[i]});
|
||||
}
|
||||
else if (v !== null && typeof v != 'undefined')
|
||||
a.push({name: this.name, value: v});
|
||||
});
|
||||
//hand off to jQuery.param for proper encoding
|
||||
return $.param(a);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value(s) of the element in the matched set. For example, consider the following form:
|
||||
*
|
||||
* <form><fieldset>
|
||||
* <input name="A" type="text" />
|
||||
* <input name="A" type="text" />
|
||||
* <input name="B" type="checkbox" value="B1" />
|
||||
* <input name="B" type="checkbox" value="B2"/>
|
||||
* <input name="C" type="radio" value="C1" />
|
||||
* <input name="C" type="radio" value="C2" />
|
||||
* </fieldset></form>
|
||||
*
|
||||
* var v = $(':text').fieldValue();
|
||||
* // if no values are entered into the text inputs
|
||||
* v == ['','']
|
||||
* // if values entered into the text inputs are 'foo' and 'bar'
|
||||
* v == ['foo','bar']
|
||||
*
|
||||
* var v = $(':checkbox').fieldValue();
|
||||
* // if neither checkbox is checked
|
||||
* v === undefined
|
||||
* // if both checkboxes are checked
|
||||
* v == ['B1', 'B2']
|
||||
*
|
||||
* var v = $(':radio').fieldValue();
|
||||
* // if neither radio is checked
|
||||
* v === undefined
|
||||
* // if first radio is checked
|
||||
* v == ['C1']
|
||||
*
|
||||
* The successful argument controls whether or not the field element must be 'successful'
|
||||
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
||||
* The default value of the successful argument is true. If this value is false the value(s)
|
||||
* for each element is returned.
|
||||
*
|
||||
* Note: This method *always* returns an array. If no valid value can be determined the
|
||||
* array will be empty, otherwise it will contain one or more values.
|
||||
*/
|
||||
$.fn.fieldValue = function(successful) {
|
||||
for (var val=[], i=0, max=this.length; i < max; i++) {
|
||||
var el = this[i];
|
||||
var v = $.fieldValue(el, successful);
|
||||
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
|
||||
continue;
|
||||
v.constructor == Array ? $.merge(val, v) : val.push(v);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value of the field element.
|
||||
*/
|
||||
$.fieldValue = function(el, successful) {
|
||||
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
|
||||
if (typeof successful == 'undefined') successful = true;
|
||||
|
||||
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
|
||||
(t == 'checkbox' || t == 'radio') && !el.checked ||
|
||||
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
|
||||
tag == 'select' && el.selectedIndex == -1))
|
||||
return null;
|
||||
|
||||
if (tag == 'select') {
|
||||
var index = el.selectedIndex;
|
||||
if (index < 0) return null;
|
||||
var a = [], ops = el.options;
|
||||
var one = (t == 'select-one');
|
||||
var max = (one ? index+1 : ops.length);
|
||||
for(var i=(one ? index : 0); i < max; i++) {
|
||||
var op = ops[i];
|
||||
if (op.selected) {
|
||||
var v = op.value;
|
||||
if (!v) // extra pain for IE...
|
||||
v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
|
||||
if (one) return v;
|
||||
a.push(v);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return el.value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the form data. Takes the following actions on the form's input fields:
|
||||
* - input text fields will have their 'value' property set to the empty string
|
||||
* - select elements will have their 'selectedIndex' property set to -1
|
||||
* - checkbox and radio inputs will have their 'checked' property set to false
|
||||
* - inputs of type submit, button, reset, and hidden will *not* be effected
|
||||
* - button elements will *not* be effected
|
||||
*/
|
||||
$.fn.clearForm = function() {
|
||||
return this.each(function() {
|
||||
$('input,select,textarea', this).clearFields();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the selected form elements.
|
||||
*/
|
||||
$.fn.clearFields = $.fn.clearInputs = function() {
|
||||
return this.each(function() {
|
||||
var t = this.type, tag = this.tagName.toLowerCase();
|
||||
if (t == 'text' || t == 'password' || tag == 'textarea')
|
||||
this.value = '';
|
||||
else if (t == 'checkbox' || t == 'radio')
|
||||
this.checked = false;
|
||||
else if (tag == 'select')
|
||||
this.selectedIndex = -1;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets the form data. Causes all form elements to be reset to their original value.
|
||||
*/
|
||||
$.fn.resetForm = function() {
|
||||
return this.each(function() {
|
||||
// guard against an input with the name of 'reset'
|
||||
// note that IE reports the reset function as an 'object'
|
||||
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
|
||||
this.reset();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Enables or disables any matching elements.
|
||||
*/
|
||||
$.fn.enable = function(b) {
|
||||
if (b == undefined) b = true;
|
||||
return this.each(function() {
|
||||
this.disabled = !b;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks/unchecks any matching checkboxes or radio buttons and
|
||||
* selects/deselects and matching option elements.
|
||||
*/
|
||||
$.fn.selected = function(select) {
|
||||
if (select == undefined) select = true;
|
||||
return this.each(function() {
|
||||
var t = this.type;
|
||||
if (t == 'checkbox' || t == 'radio')
|
||||
this.checked = select;
|
||||
else if (this.tagName.toLowerCase() == 'option') {
|
||||
var $sel = $(this).parent('select');
|
||||
if (select && $sel[0] && $sel[0].type == 'select-one') {
|
||||
// deselect all other options
|
||||
$sel.find('option').selected(false);
|
||||
}
|
||||
this.selected = select;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// helper fn for console logging
|
||||
// set $.fn.ajaxSubmit.debug to true to enable debug logging
|
||||
function log() {
|
||||
if ($.fn.ajaxSubmit.debug && window.console && window.console.log)
|
||||
window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,''));
|
||||
};
|
||||
|
||||
})(jQuery);
|