Browse files

added uniform.js (http://uniformjs.com : Sexy forms with jQuery)

  • Loading branch information...
1 parent b93c123 commit 57eb6b3db795e6d100014aa537c91063e4e3fa71 @brandondrew committed Jul 14, 2011
View
219 ajax/libs/uniform/README.textile
@@ -0,0 +1,219 @@
+h1. Uniform
+
+Sexy form elements with jQuery
+
+Version 1.7.5
+
+Requires jQuery 1.4 or newer.
+
+Licensed under:
+MIT License - http://www.opensource.org/licenses/mit-license.php
+
+h2. Installation
+
+Installation of Uniform is quite simple. First, make sure you have jQuery 1.4+ installed. Then you’ll want to link to the jquery.uniform.js file and uniform.default.css in the head area of your page:
+
+bc. <script src="jquery.uniform.js" type="text/javascript"></script>
+<link rel="stylesheet" href="uniform.default.css" type="text/css" media="screen" charset="utf-8" />
+
+h2. Basic usage
+
+Using Uniform can be quite easy as well. Simply call:
+
+$("select").uniform();
+
+To “uniform” all possible form elements, just do something like this:
+
+$("select, input[type=checkbox], input[type=radio], input[type=file], input[type=submit], a.button, button").uniform();
+
+A complete tag in the HEAD section of your site can therefore look like this:
+
+bc. <script type='text/javascript'>
+ $(function(){
+ $("select, input:checkbox, input:radio, input:file").uniform();
+ });
+</script>
+
+Remember that it is essential to first follow the steps in the Installation section here above.
+
+h2. Extra parameters
+
+You can pass in extra parameters to control certain aspects of Uniform. To pass in parameters, use syntax like this:
+
+bc. $("select").uniform({
+ param1: value,
+ param2: value,
+ param3: value
+});
+
+h3. _NEW!_ autoHide(boolean)
+
+*Default:* true
+If this option is set to true, Uniform will hide the new elements if the existing elements are currently hidden using display: none;
+
+*REMEMBER*: If you want to show a select or checkbox you'll need to show the new Uniform div instead of the child element.
+
+h3. selectClass (string)
+
+*Default:* “selector”
+Sets the class given to the wrapper div for select elements.
+
+@$("select").uniform({selectClass: 'mySelectClass'});@
+
+h3. radioClass (string)
+
+*Default:* “radio”
+Sets the class given to the wrapper div for radio elements.
+
+@$(":radio").uniform({radioClass: 'myRadioClass'});@
+
+h3. checkboxClass (string)
+
+*Default:* “checker”
+Sets the class given to the wrapper div for checkbox elements.
+
+@$(":checkbox").uniform({checkboxClass: 'myCheckClass'});@
+
+h3. fileClass (string)
+
+*Default:* “uploader”
+Sets the class given to the wrapper div for file upload elements.
+
+@$(":file").uniform({fileClass: 'myFileClass'});@
+
+h3. filenameClass (string)
+
+*Default:* “filename”
+Sets the class given to div inside a file upload container that spits out the filename.
+
+@$(":file").uniform({filenameClass: 'myFilenameClass'});@
+
+h3. fileBtnClass (string)
+
+*Default:* “action”
+Sets the class given to div inside a file upload container that acts as the “Choose file” button.
+
+@$(":file").uniform({fileBtnClass: 'myFileBtnClass'});@
+
+h3. fileDefaultText (string)
+
+*Default:* “No file selected”
+Sets the text written in the filename div of a file upload input when there is no file selected.
+
+@$(":file").uniform({fileDefaultText: 'Select a file please'});@
+
+h3. fileBtnText(string)
+
+*Default:* “Choose File”
+Sets the text written on the action button inside a file upload input.
+
+@$(":file").uniform({fileBtnText: 'Choose&hellip;'});@
+
+h3. buttonClass(string)
+
+*Default:* "button"
+Sets the class given to a button that's been uniformed
+
+@$("input[type=button]").uniform({buttonClass: 'myBtnClass'});@
+
+h3. checkedClass (string)
+
+*Default:* “checked”
+Sets the class given to elements when they are checked (radios and checkboxes).
+
+@$(":radio, :checkbox").uniform({checkedClass: 'myCheckedClass'});@
+
+h3. focusClass (string)
+
+*Default:* “focus”
+Sets the class given to elements when they are focused.
+
+@$("select").uniform({focusClass: 'myFocusClass'});@
+
+h3. disabledClass (string)
+
+*Default:* “disabled”
+Sets the class given to elements when they are disabled.
+
+@$("select").uniform({disabledClass: 'myDisabledClass'});@
+
+h3. activeClass (string)
+
+*Default:* “active”
+Sets the class given to elements when they are active (pressed).
+
+@$("select").uniform({activeClass: 'myActiveClass'});@
+
+h3. hoverClass (string)
+
+*Default:* “hover”
+Sets the class given to elements when they are currently hovered.
+
+@$("select").uniform({hoverClass: 'myHoverClass'});@
+
+h3. useID (boolean)
+
+*Default:* true
+If true, sets an ID on the container div of each form element. The ID is a prefixed version of the same ID of the form element.
+
+@$("select").uniform({useID: false});@
+
+h3. idPrefix (string)
+
+*Default:* “uniform”
+If useID is set to true, this string is prefixed to element ID’s and attached to the container div of each uniformed element. If you have a checkbox with the ID of “remember-me” the container div would have the ID “uniform-remember-me”.
+
+@$("select").uniform({idPrefix: 'container'});@
+
+h3. resetSelector (boolean/string)
+
+*Default:* false
+This parameter allows you to use a jQuery-style selector to point to a “reset” button in your form if you have one. Use false if you have no “reset” button, or a selector string that points to the reset button if you have one.
+
+@$("select").uniform({resetSelector: 'input[type="reset"]'});@
+
+h2. Additional functions
+
+In addition to the parameters, there are a couple of other ways you can interact with Uniform.
+
+h3. $.uniform.update([elem/selector string]);
+
+If you need to change values on the form dynamically you must tell Uniform to update that element’s style. Fortunately, it’s very simple. Just call this function, and Uniform will do the rest.
+
+@$.uniform.update("#myUpdatedCheckbox");@
+
+If you are lazy, or just don’t specifically know which element to update, you can just leave out the parameter (see below) and Uniform will update all Uniformed elements on the page:
+
+@$.uniform.update();@
+
+h3. $.uniform.restore([elem/selector string]);
+
+If you want to "un-uniform" something, simply call this function. It will remove the inline styles, extra dom elements, and event handlers, effectively restoring the element to it's previous state.
+
+@$.uniform.restore("select");@
+
+h3. $.uniform.elements[]
+
+You can get an array of all the elements that have been Uniformed at any time using this public variable. Wouldn’t advise changing the contents though!
+
+@var uniforms = $.uniform.elements;@
+
+h2. Customizing CSS
+
+To edit the CSS of Uniform it is highly recommended to not edit the theme files, but to override them using CSS. Make sure your CSS file comes after the uniform theme css file in the HEAD section.
+
+It's common to want to resize the selects or other elements. The best way is to set the width property on the div element, span element and the form element itself. Look through the theme CSS in the _presentation_ section to see where the width property is currently set.
+
+h2. Tips & tricks
+
+Uniform is supposed to be pretty simple, but there are a few things that can be tricky. Here are some tips that may make your experience simpler:
+
+Remember to change the CSS classes in the theme if you change the parameters for elements’ classes. This can be tedious work, but if you don’t do it, it’s not going to look correct. Find and Replace is your friend.
+
+Uniform cannot automatically sniff out dynamic value changes. If you make changes to elements in Javascript or using a Reset button of some kind remember to call $.uniform.update(); to sync the changes with Uniform.
+
+Uniform is disabled in IE6. It’s not possible to fix due to the way IE6 handles form elements. If you care about IE6 users, give it a quick look to make sure your “naked” form elements look alright in there.
+
+You’re on your own for styling text inputs and more. Fortunately, things that are not handled by Uniform are pretty easy to skin. :)
+
+If you have ideas, or bugs, please post them in GitHub. We rely on our users for ideas for improvements and bug reports. Otherwise Uniform will stay static.
View
610 ajax/libs/uniform/css/uniform.default.css
@@ -0,0 +1,610 @@
+/*
+
+Uniform Theme: Uniform Default
+Version: 1.6
+By: Josh Pyles
+License: MIT License
+---
+For use with the Uniform plugin:
+http://pixelmatrixdesign.com/uniform/
+---
+Generated by Uniform Theme Generator:
+http://pixelmatrixdesign.com/uniform/themer.html
+
+*/
+
+/* Global Declaration */
+
+div.selector,
+div.selector span,
+div.checker span,
+div.radio span,
+div.uploader,
+div.uploader span.action,
+div.button,
+div.button span {
+ background-image: url(../images/sprite.png);
+ background-repeat: no-repeat;
+ -webkit-font-smoothing: antialiased;
+}
+
+.selector,
+.radio,
+.checker,
+.uploader,
+.button,
+.selector *,
+.radio *,
+.checker *,
+.uploader *,
+.button *{
+ margin: 0;
+ padding: 0;
+}
+
+/* INPUT & TEXTAREA */
+
+input.text,
+input.email,
+input.password,
+textarea.uniform {
+ font-size: 12px;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-weight: normal;
+ padding: 3px;
+ color: #777;
+ background: url('../images/bg-input-focus.png') repeat-x 0px 0px;
+ background: url('../images/bg-input.png') repeat-x 0px 0px;
+ border-top: solid 1px #aaa;
+ border-left: solid 1px #aaa;
+ border-bottom: solid 1px #ccc;
+ border-right: solid 1px #ccc;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ outline: 0;
+}
+
+input.text:focus,
+input.email:focus,
+input.password:focus,
+textarea.uniform:focus {
+ -webkit-box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
+ -moz-box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
+ box-shadow: 0px 0px 4px rgba(0,0,0,0.3);
+ border-color: #999;
+ background: url('../images/bg-input-focus.png') repeat-x 0px 0px;
+}
+
+/* SPRITES */
+
+/* Select */
+
+div.selector {
+ background-position: -483px -130px;
+ line-height: 26px;
+ height: 26px;
+}
+
+div.selector span {
+ background-position: right 0px;
+ height: 26px;
+ line-height: 26px;
+}
+
+div.selector select {
+ /* change these to adjust positioning of select element */
+ top: 0px;
+ left: 0px;
+}
+
+div.selector:active,
+div.selector.active {
+ background-position: -483px -156px;
+}
+
+div.selector:active span,
+div.selector.active span {
+ background-position: right -26px;
+}
+
+div.selector.focus, div.selector.hover, div.selector:hover {
+ background-position: -483px -182px;
+}
+
+div.selector.focus span, div.selector.hover span, div.selector:hover span {
+ background-position: right -52px;
+}
+
+div.selector.focus:active,
+div.selector.focus.active,
+div.selector:hover:active,
+div.selector.active:hover {
+ background-position: -483px -208px;
+}
+
+div.selector.focus:active span,
+div.selector:hover:active span,
+div.selector.active:hover span,
+div.selector.focus.active span {
+ background-position: right -78px;
+}
+
+div.selector.disabled {
+ background-position: -483px -234px;
+}
+
+div.selector.disabled span {
+ background-position: right -104px;
+}
+
+/* Checkbox */
+
+div.checker {
+ width: 19px;
+ height: 19px;
+}
+
+div.checker input {
+ width: 19px;
+ height: 19px;
+}
+
+div.checker span {
+ background-position: 0px -260px;
+ height: 19px;
+ width: 19px;
+}
+
+div.checker:active span,
+div.checker.active span {
+ background-position: -19px -260px;
+}
+
+div.checker.focus span,
+div.checker:hover span {
+ background-position: -38px -260px;
+}
+
+div.checker.focus:active span,
+div.checker:active:hover span,
+div.checker.active:hover span,
+div.checker.focus.active span {
+ background-position: -57px -260px;
+}
+
+div.checker span.checked {
+ background-position: -76px -260px;
+}
+
+div.checker:active span.checked,
+div.checker.active span.checked {
+ background-position: -95px -260px;
+}
+
+div.checker.focus span.checked,
+div.checker:hover span.checked {
+ background-position: -114px -260px;
+}
+
+div.checker.focus:active span.checked,
+div.checker:hover:active span.checked,
+div.checker.active:hover span.checked,
+div.checker.active.focus span.checked {
+ background-position: -133px -260px;
+}
+
+div.checker.disabled span,
+div.checker.disabled:active span,
+div.checker.disabled.active span {
+ background-position: -152px -260px;
+}
+
+div.checker.disabled span.checked,
+div.checker.disabled:active span.checked,
+div.checker.disabled.active span.checked {
+ background-position: -171px -260px;
+}
+
+/* Radio */
+
+div.radio {
+ width: 18px;
+ height: 18px;
+}
+
+div.radio input {
+ width: 18px;
+ height: 18px;
+}
+
+div.radio span {
+ height: 18px;
+ width: 18px;
+ background-position: 0px -279px;
+}
+
+div.radio:active span,
+div.radio.active span {
+ background-position: -18px -279px;
+}
+
+div.radio.focus span,
+div.radio:hover span {
+ background-position: -36px -279px;
+}
+
+div.radio.focus:active span,
+div.radio:active:hover span,
+div.radio.active:hover span,
+div.radio.active.focus span {
+ background-position: -54px -279px;
+}
+
+div.radio span.checked {
+ background-position: -72px -279px;
+}
+
+div.radio:active span.checked,
+div.radio.active span.checked {
+ background-position: -90px -279px;
+}
+
+div.radio.focus span.checked, div.radio:hover span.checked {
+ background-position: -108px -279px;
+}
+
+div.radio.focus:active span.checked,
+div.radio:hover:active span.checked,
+div.radio.focus.active span.checked,
+div.radio.active:hover span.checked {
+ background-position: -126px -279px;
+}
+
+div.radio.disabled span,
+div.radio.disabled:active span,
+div.radio.disabled.active span {
+ background-position: -144px -279px;
+}
+
+div.radio.disabled span.checked,
+div.radio.disabled:active span.checked,
+div.radio.disabled.active span.checked {
+ background-position: -162px -279px;
+}
+
+/* Uploader */
+
+div.uploader {
+ background-position: 0px -297px;
+ height: 28px;
+}
+
+div.uploader span.action {
+ background-position: right -409px;
+ height: 24px;
+ line-height: 24px;
+}
+
+div.uploader span.filename {
+ height: 24px;
+ /* change this line to adjust positioning of filename area */
+ margin: 2px 0px 2px 2px;
+ line-height: 24px;
+}
+
+div.uploader.focus,
+div.uploader.hover,
+div.uploader:hover {
+ background-position: 0px -353px;
+}
+
+div.uploader.focus span.action,
+div.uploader.hover span.action,
+div.uploader:hover span.action {
+ background-position: right -437px;
+}
+
+div.uploader.active span.action,
+div.uploader:active span.action {
+ background-position: right -465px;
+}
+
+div.uploader.focus.active span.action,
+div.uploader:focus.active span.action,
+div.uploader.focus:active span.action,
+div.uploader:focus:active span.action {
+ background-position: right -493px;
+}
+
+div.uploader.disabled {
+ background-position: 0px -325px;
+}
+
+div.uploader.disabled span.action {
+ background-position: right -381px;
+}
+
+div.button {
+ background-position: 0px -523px;
+}
+
+div.button span {
+ background-position: right -643px;
+}
+
+div.button.focus,
+div.button:focus,
+div.button:hover,
+div.button.hover {
+ background-position: 0px -553px;
+}
+
+div.button.focus span,
+div.button:focus span,
+div.button:hover span,
+div.button.hover span {
+ background-position: right -673px;
+}
+
+div.button.active,
+div.button:active {
+ background-position: 0px -583px;
+}
+
+div.button.active span,
+div.button:active span {
+ background-position: right -703px;
+ color: #555;
+}
+
+div.button.disabled,
+div.button:disabled {
+ background-position: 0px -613px;
+}
+
+div.button.disabled span,
+div.button:disabled span {
+ background-position: right -733px;
+ color: #bbb;
+ cursor: default;
+}
+
+/* PRESENTATION */
+
+/* Button */
+
+div.button {
+ height: 30px;
+}
+
+div.button span {
+ margin-left: 13px;
+ height: 22px;
+ padding-top: 8px;
+ font-weight: bold;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ padding-left: 2px;
+ padding-right: 15px;
+}
+
+/* Select */
+div.selector {
+ width: 190px;
+ font-size: 12px;
+}
+
+div.selector select {
+ min-width: 190px;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ border: solid 1px #fff;
+}
+
+div.selector span {
+ padding: 0px 25px 0px 2px;
+ cursor: pointer;
+}
+
+div.selector span {
+ color: #666;
+ width: 158px;
+ text-shadow: 0 1px 0 #fff;
+}
+
+div.selector.disabled span {
+ color: #bbb;
+}
+
+/* Checker */
+div.checker {
+ margin-right: 5px;
+}
+
+/* Radio */
+div.radio {
+ margin-right: 3px;
+}
+
+/* Uploader */
+div.uploader {
+ width: 190px;
+ cursor: pointer;
+}
+
+div.uploader span.action {
+ width: 85px;
+ text-align: center;
+ text-shadow: #fff 0px 1px 0px;
+ background-color: #fff;
+ font-size: 11px;
+ font-weight: bold;
+}
+
+div.uploader span.filename {
+ color: #777;
+ width: 82px;
+ border-right: solid 1px #bbb;
+ font-size: 11px;
+}
+
+div.uploader input {
+ width: 190px;
+}
+
+div.uploader.disabled span.action {
+ color: #aaa;
+}
+
+div.uploader.disabled span.filename {
+ border-color: #ddd;
+ color: #aaa;
+}
+/*
+
+CORE FUNCTIONALITY
+
+Not advised to edit stuff below this line
+-----------------------------------------------------
+*/
+
+.selector,
+.checker,
+.button,
+.radio,
+.uploader {
+ display: -moz-inline-box;
+ display: inline-block;
+ vertical-align: middle;
+ zoom: 1;
+ *display: inline;
+}
+
+.selector select:focus, .radio input:focus, .checker input:focus, .uploader input:focus {
+ outline: 0;
+}
+
+/* Button */
+
+div.button a,
+div.button button,
+div.button input {
+ position: absolute;
+}
+
+div.button {
+ cursor: pointer;
+ position: relative;
+}
+
+div.button span {
+ display: -moz-inline-box;
+ display: inline-block;
+ line-height: 1;
+ text-align: center;
+}
+
+/* Select */
+
+div.selector {
+ position: relative;
+ padding-left: 10px;
+ overflow: hidden;
+}
+
+div.selector span {
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+div.selector select {
+ position: absolute;
+ opacity: 0;
+ filter: alpha(opacity:0);
+ height: 25px;
+ border: none;
+ background: none;
+}
+
+/* Checker */
+
+div.checker {
+ position: relative;
+}
+
+div.checker span {
+ display: -moz-inline-box;
+ display: inline-block;
+ text-align: center;
+}
+
+div.checker input {
+ opacity: 0;
+ filter: alpha(opacity:0);
+ display: inline-block;
+ background: none;
+}
+
+/* Radio */
+
+div.radio {
+ position: relative;
+}
+
+div.radio span {
+ display: -moz-inline-box;
+ display: inline-block;
+ text-align: center;
+}
+
+div.radio input {
+ opacity: 0;
+ filter: alpha(opacity:0);
+ text-align: center;
+ display: inline-block;
+ background: none;
+}
+
+/* Uploader */
+
+div.uploader {
+ position: relative;
+ overflow: hidden;
+ cursor: default;
+}
+
+div.uploader span.action {
+ float: left;
+ display: inline;
+ padding: 2px 0px;
+ overflow: hidden;
+ cursor: pointer;
+}
+
+div.uploader span.filename {
+ padding: 0px 10px;
+ float: left;
+ display: block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ cursor: default;
+}
+
+div.uploader input {
+ opacity: 0;
+ filter: alpha(opacity:0);
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ float: right;
+ height: 25px;
+ border: none;
+ cursor: default;
+}
View
74 ajax/libs/uniform/demo/demo.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="../jquery.uniform.js" type="text/javascript" charset="utf-8"></script>
+ <script type="text/javascript" charset="utf-8">
+ $(function(){
+ $("input, textarea, select, button").uniform();
+ });
+ </script>
+ <link rel="stylesheet" href="../css/uniform.default.css" type="text/css" media="screen">
+ <style type="text/css" media="screen">
+ body {
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ color: #666;
+ padding: 40px;
+ }
+ h1 {
+ margin-top: 0;
+ }
+ ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ }
+ li {
+ margin-bottom: 20px;
+ clear: both;
+ }
+ label {
+ font-size: 10px;
+ font-weight: bold;
+ text-transform: uppercase;
+ display: block;
+ margin-bottom: 3px;
+ clear: both;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Uniform Demo</h1>
+ <form>
+ <ul>
+ <li><label>Message:</label><textarea cols="40" rows="5"></textarea></li>
+ <li><label>Your Name:</label><input type="text" size="40"/></li>
+ <li><label>Your Email:</label><input type="email" size="40"/></li>
+ <li>
+ <label>I found your site:</label>
+ <select>
+ <option>Through Google</option>
+ <option>Through Twitter</option>
+ <option>Other&hellip;</option>
+ <option>&lt;Hi&gt;</option>
+ </select>
+ </li>
+ <li>
+ <label><input type="radio" name="radio" /> Saying hi</label>
+ <label><input type="radio" name="radio" /> Sending feedback</label>
+ </li>
+ <li>
+ <label><input type="checkbox" /> Please contact me back</label>
+ </li>
+ <li>
+ <label>Upload a file:</label>
+ <input type="file" />
+ </li>
+ <li>
+ <input type="submit" />
+ <input type="reset" />
+ </li>
+ </ul>
+ </form>
+ </body>
+</html>
View
BIN ajax/libs/uniform/images/bg-input-focus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN ajax/libs/uniform/images/bg-input.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN ajax/libs/uniform/images/sprite.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
672 ajax/libs/uniform/jquery.uniform.js
@@ -0,0 +1,672 @@
+/*
+
+Uniform v1.7.5
+Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC
+http://pixelmatrixdesign.com
+
+Requires jQuery 1.4 or newer
+
+Much thanks to Thomas Reynolds and Buck Wilson for their help and advice on this
+
+Disabling text selection is made possible by Mathias Bynens <http://mathiasbynens.be/>
+and his noSelect plugin. <http://github.com/mathiasbynens/noSelect-jQuery-Plugin>
+
+Also, thanks to David Kaneda and Eugene Bond for their contributions to the plugin
+
+License:
+MIT License - http://www.opensource.org/licenses/mit-license.php
+
+Enjoy!
+
+*/
+
+(function($) {
+ $.uniform = {
+ options: {
+ selectClass: 'selector',
+ radioClass: 'radio',
+ checkboxClass: 'checker',
+ fileClass: 'uploader',
+ filenameClass: 'filename',
+ fileBtnClass: 'action',
+ fileDefaultText: 'No file selected',
+ fileBtnText: 'Choose File',
+ checkedClass: 'checked',
+ focusClass: 'focus',
+ disabledClass: 'disabled',
+ buttonClass: 'button',
+ activeClass: 'active',
+ hoverClass: 'hover',
+ useID: true,
+ idPrefix: 'uniform',
+ resetSelector: false,
+ autoHide: true
+ },
+ elements: []
+ };
+
+ if($.browser.msie && $.browser.version < 7){
+ $.support.selectOpacity = false;
+ }else{
+ $.support.selectOpacity = true;
+ }
+
+ $.fn.uniform = function(options) {
+
+ options = $.extend($.uniform.options, options);
+
+ var el = this;
+ //code for specifying a reset button
+ if(options.resetSelector != false){
+ $(options.resetSelector).mouseup(function(){
+ function resetThis(){
+ $.uniform.update(el);
+ }
+ setTimeout(resetThis, 10);
+ });
+ }
+
+ function doInput(elem){
+ $el = $(elem);
+ $el.addClass($el.attr("type"));
+ storeElement(elem);
+ }
+
+ function doTextarea(elem){
+ $(elem).addClass("uniform");
+ storeElement(elem);
+ }
+
+ function doButton(elem){
+ var $el = $(elem);
+
+ var divTag = $("<div>"),
+ spanTag = $("<span>");
+
+ divTag.addClass(options.buttonClass);
+
+ if(options.useID && $el.attr("id") != "") divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
+
+ var btnText;
+
+ if($el.is("a") || $el.is("button")){
+ btnText = $el.text();
+ }else if($el.is(":submit") || $el.is(":reset") || $el.is("input[type=button]")){
+ btnText = $el.attr("value");
+ }
+
+ btnText = btnText == "" ? $el.is(":reset") ? "Reset" : "Submit" : btnText;
+
+ spanTag.html(btnText);
+
+ $el.css("opacity", 0);
+ $el.wrap(divTag);
+ $el.wrap(spanTag);
+
+ //redefine variables
+ divTag = $el.closest("div");
+ spanTag = $el.closest("span");
+
+ if($el.is(":disabled")) divTag.addClass(options.disabledClass);
+
+ divTag.bind({
+ "mouseenter.uniform": function(){
+ divTag.addClass(options.hoverClass);
+ },
+ "mouseleave.uniform": function(){
+ divTag.removeClass(options.hoverClass);
+ divTag.removeClass(options.activeClass);
+ },
+ "mousedown.uniform touchbegin.uniform": function(){
+ divTag.addClass(options.activeClass);
+ },
+ "mouseup.uniform touchend.uniform": function(){
+ divTag.removeClass(options.activeClass);
+ },
+ "click.uniform touchend.uniform": function(e){
+ if($(e.target).is("span") || $(e.target).is("div")){
+ if(elem[0].dispatchEvent){
+ var ev = document.createEvent('MouseEvents');
+ ev.initEvent( 'click', true, true );
+ elem[0].dispatchEvent(ev);
+ }else{
+ elem[0].click();
+ }
+ }
+ }
+ });
+
+ elem.bind({
+ "focus.uniform": function(){
+ divTag.addClass(options.focusClass);
+ },
+ "blur.uniform": function(){
+ divTag.removeClass(options.focusClass);
+ }
+ });
+
+ $.uniform.noSelect(divTag);
+ storeElement(elem);
+
+ }
+
+ function doSelect(elem){
+ var $el = $(elem);
+
+ var divTag = $('<div />'),
+ spanTag = $('<span />');
+
+ if(!$el.css("display") == "none" && options.autoHide){
+ divTag.hide();
+ }
+
+ divTag.addClass(options.selectClass);
+
+ if(options.useID && elem.attr("id") != ""){
+ divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
+ }
+
+ var selected = elem.find(":selected:first");
+ if(selected.length == 0){
+ selected = elem.find("option:first");
+ }
+ spanTag.html(selected.html());
+
+ elem.css('opacity', 0);
+ elem.wrap(divTag);
+ elem.before(spanTag);
+
+ //redefine variables
+ divTag = elem.parent("div");
+ spanTag = elem.siblings("span");
+
+ elem.bind({
+ "change.uniform": function() {
+ spanTag.text(elem.find(":selected").html());
+ divTag.removeClass(options.activeClass);
+ },
+ "focus.uniform": function() {
+ divTag.addClass(options.focusClass);
+ },
+ "blur.uniform": function() {
+ divTag.removeClass(options.focusClass);
+ divTag.removeClass(options.activeClass);
+ },
+ "mousedown.uniform touchbegin.uniform": function() {
+ divTag.addClass(options.activeClass);
+ },
+ "mouseup.uniform touchend.uniform": function() {
+ divTag.removeClass(options.activeClass);
+ },
+ "click.uniform touchend.uniform": function(){
+ divTag.removeClass(options.activeClass);
+ },
+ "mouseenter.uniform": function() {
+ divTag.addClass(options.hoverClass);
+ },
+ "mouseleave.uniform": function() {
+ divTag.removeClass(options.hoverClass);
+ divTag.removeClass(options.activeClass);
+ },
+ "keyup.uniform": function(){
+ spanTag.text(elem.find(":selected").html());
+ }
+ });
+
+ //handle disabled state
+ if($(elem).attr("disabled")){
+ //box is checked by default, check our box
+ divTag.addClass(options.disabledClass);
+ }
+ $.uniform.noSelect(spanTag);
+
+ storeElement(elem);
+
+ }
+
+ function doCheckbox(elem){
+ var $el = $(elem);
+
+ var divTag = $('<div />'),
+ spanTag = $('<span />');
+
+ if(!$el.css("display") == "none" && options.autoHide){
+ divTag.hide();
+ }
+
+ divTag.addClass(options.checkboxClass);
+
+ //assign the id of the element
+ if(options.useID && elem.attr("id") != ""){
+ divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
+ }
+
+ //wrap with the proper elements
+ $(elem).wrap(divTag);
+ $(elem).wrap(spanTag);
+
+ //redefine variables
+ spanTag = elem.parent();
+ divTag = spanTag.parent();
+
+ //hide normal input and add focus classes
+ $(elem)
+ .css("opacity", 0)
+ .bind({
+ "focus.uniform": function(){
+ divTag.addClass(options.focusClass);
+ },
+ "blur.uniform": function(){
+ divTag.removeClass(options.focusClass);
+ },
+ "click.uniform touchend.uniform": function(){
+ if(!$(elem).attr("checked")){
+ //box was just unchecked, uncheck span
+ spanTag.removeClass(options.checkedClass);
+ }else{
+ //box was just checked, check span.
+ spanTag.addClass(options.checkedClass);
+ }
+ },
+ "mousedown.uniform touchbegin.uniform": function() {
+ divTag.addClass(options.activeClass);
+ },
+ "mouseup.uniform touchend.uniform": function() {
+ divTag.removeClass(options.activeClass);
+ },
+ "mouseenter.uniform": function() {
+ divTag.addClass(options.hoverClass);
+ },
+ "mouseleave.uniform": function() {
+ divTag.removeClass(options.hoverClass);
+ divTag.removeClass(options.activeClass);
+ }
+ });
+
+ //handle defaults
+ if($(elem).attr("checked")){
+ //box is checked by default, check our box
+ spanTag.addClass(options.checkedClass);
+ }
+
+ //handle disabled state
+ if($(elem).attr("disabled")){
+ //box is checked by default, check our box
+ divTag.addClass(options.disabledClass);
+ }
+
+ storeElement(elem);
+ }
+
+ function doRadio(elem){
+ var $el = $(elem);
+
+ var divTag = $('<div />'),
+ spanTag = $('<span />');
+
+ if(!$el.css("display") == "none" && options.autoHide){
+ divTag.hide();
+ }
+
+ divTag.addClass(options.radioClass);
+
+ if(options.useID && elem.attr("id") != ""){
+ divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
+ }
+
+ //wrap with the proper elements
+ $(elem).wrap(divTag);
+ $(elem).wrap(spanTag);
+
+ //redefine variables
+ spanTag = elem.parent();
+ divTag = spanTag.parent();
+
+ //hide normal input and add focus classes
+ $(elem)
+ .css("opacity", 0)
+ .bind({
+ "focus.uniform": function(){
+ divTag.addClass(options.focusClass);
+ },
+ "blur.uniform": function(){
+ divTag.removeClass(options.focusClass);
+ },
+ "click.uniform touchend.uniform": function(){
+ if(!$(elem).attr("checked")){
+ //box was just unchecked, uncheck span
+ spanTag.removeClass(options.checkedClass);
+ }else{
+ //box was just checked, check span
+ var classes = options.radioClass.split(" ")[0];
+ $("." + classes + " span." + options.checkedClass + ":has([name='" + $(elem).attr('name') + "'])").removeClass(options.checkedClass);
+ spanTag.addClass(options.checkedClass);
+ }
+ },
+ "mousedown.uniform touchend.uniform": function() {
+ if(!$(elem).is(":disabled")){
+ divTag.addClass(options.activeClass);
+ }
+ },
+ "mouseup.uniform touchbegin.uniform": function() {
+ divTag.removeClass(options.activeClass);
+ },
+ "mouseenter.uniform touchend.uniform": function() {
+ divTag.addClass(options.hoverClass);
+ },
+ "mouseleave.uniform": function() {
+ divTag.removeClass(options.hoverClass);
+ divTag.removeClass(options.activeClass);
+ }
+ });
+
+ //handle defaults
+ if($(elem).attr("checked")){
+ //box is checked by default, check span
+ spanTag.addClass(options.checkedClass);
+ }
+ //handle disabled state
+ if($(elem).attr("disabled")){
+ //box is checked by default, check our box
+ divTag.addClass(options.disabledClass);
+ }
+
+ storeElement(elem);
+
+ }
+
+ function doFile(elem){
+ //sanitize input
+ var $el = $(elem);
+
+ var divTag = $('<div />'),
+ filenameTag = $('<span>'+options.fileDefaultText+'</span>'),
+ btnTag = $('<span>'+options.fileBtnText+'</span>');
+
+ if(!$el.css("display") == "none" && options.autoHide){
+ divTag.hide();
+ }
+
+ divTag.addClass(options.fileClass);
+ filenameTag.addClass(options.filenameClass);
+ btnTag.addClass(options.fileBtnClass);
+
+ if(options.useID && $el.attr("id") != ""){
+ divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
+ }
+
+ //wrap with the proper elements
+ $el.wrap(divTag);
+ $el.after(btnTag);
+ $el.after(filenameTag);
+
+ //redefine variables
+ divTag = $el.closest("div");
+ filenameTag = $el.siblings("."+options.filenameClass);
+ btnTag = $el.siblings("."+options.fileBtnClass);
+
+ //set the size
+ if(!$el.attr("size")){
+ var divWidth = divTag.width();
+ //$el.css("width", divWidth);
+ $el.attr("size", divWidth/10);
+ }
+
+ //actions
+ var setFilename = function()
+ {
+ var filename = $el.val();
+ if (filename === '')
+ {
+ filename = options.fileDefaultText;
+ }
+ else
+ {
+ filename = filename.split(/[\/\\]+/);
+ filename = filename[(filename.length-1)];
+ }
+ filenameTag.text(filename);
+ };
+
+ // Account for input saved across refreshes
+ setFilename();
+
+ $el
+ .css("opacity", 0)
+ .bind({
+ "focus.uniform": function(){
+ divTag.addClass(options.focusClass);
+ },
+ "blur.uniform": function(){
+ divTag.removeClass(options.focusClass);
+ },
+ "mousedown.uniform": function() {
+ if(!$(elem).is(":disabled")){
+ divTag.addClass(options.activeClass);
+ }
+ },
+ "mouseup.uniform": function() {
+ divTag.removeClass(options.activeClass);
+ },
+ "mouseenter.uniform": function() {
+ divTag.addClass(options.hoverClass);
+ },
+ "mouseleave.uniform": function() {
+ divTag.removeClass(options.hoverClass);
+ divTag.removeClass(options.activeClass);
+ }
+ });
+
+ // IE7 doesn't fire onChange until blur or second fire.
+ if ($.browser.msie){
+ // IE considers browser chrome blocking I/O, so it
+ // suspends tiemouts until after the file has been selected.
+ $el.bind('click.uniform.ie7', function() {
+ setTimeout(setFilename, 0);
+ });
+ }else{
+ // All other browsers behave properly
+ $el.bind('change.uniform', setFilename);
+ }
+
+ //handle defaults
+ if($el.attr("disabled")){
+ //box is checked by default, check our box
+ divTag.addClass(options.disabledClass);
+ }
+
+ $.uniform.noSelect(filenameTag);
+ $.uniform.noSelect(btnTag);
+
+ storeElement(elem);
+
+ }
+
+ $.uniform.restore = function(elem){
+ if(elem == undefined){
+ elem = $($.uniform.elements);
+ }
+
+ $(elem).each(function(){
+ if($(this).is(":checkbox")){
+ //unwrap from span and div
+ $(this).unwrap().unwrap();
+ }else if($(this).is("select")){
+ //remove sibling span
+ $(this).siblings("span").remove();
+ //unwrap parent div
+ $(this).unwrap();
+ }else if($(this).is(":radio")){
+ //unwrap from span and div
+ $(this).unwrap().unwrap();
+ }else if($(this).is(":file")){
+ //remove sibling spans
+ $(this).siblings("span").remove();
+ //unwrap parent div
+ $(this).unwrap();
+ }else if($(this).is("button, :submit, :reset, a, input[type='button']")){
+ //unwrap from span and div
+ $(this).unwrap().unwrap();
+ }
+
+ //unbind events
+ $(this).unbind(".uniform");
+
+ //reset inline style
+ $(this).css("opacity", "1");
+
+ //remove item from list of uniformed elements
+ var index = $.inArray($(elem), $.uniform.elements);
+ $.uniform.elements.splice(index, 1);
+ });
+ };
+
+ function storeElement(elem){
+ //store this element in our global array
+ elem = $(elem).get();
+ if(elem.length > 1){
+ $.each(elem, function(i, val){
+ $.uniform.elements.push(val);
+ });
+ }else{
+ $.uniform.elements.push(elem);
+ }
+ }
+
+ //noSelect v1.0
+ $.uniform.noSelect = function(elem) {
+ function f() {
+ return false;
+ };
+ $(elem).each(function() {
+ this.onselectstart = this.ondragstart = f; // Webkit & IE
+ $(this)
+ .mousedown(f) // Webkit & Opera
+ .css({ MozUserSelect: 'none' }); // Firefox
+ });
+ };
+
+ $.uniform.update = function(elem){
+ if(elem == undefined){
+ elem = $($.uniform.elements);
+ }
+ //sanitize input
+ elem = $(elem);
+
+ elem.each(function(){
+ //do to each item in the selector
+ //function to reset all classes
+ var $e = $(this);
+
+ if($e.is("select")){
+ //element is a select
+ var spanTag = $e.siblings("span");
+ var divTag = $e.parent("div");
+
+ divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+
+ //reset current selected text
+ spanTag.html($e.find(":selected").html());
+
+ if($e.is(":disabled")){
+ divTag.addClass(options.disabledClass);
+ }else{
+ divTag.removeClass(options.disabledClass);
+ }
+
+ }else if($e.is(":checkbox")){
+ //element is a checkbox
+ var spanTag = $e.closest("span");
+ var divTag = $e.closest("div");
+
+ divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+ spanTag.removeClass(options.checkedClass);
+
+ if($e.is(":checked")){
+ spanTag.addClass(options.checkedClass);
+ }
+ if($e.is(":disabled")){
+ divTag.addClass(options.disabledClass);
+ }else{
+ divTag.removeClass(options.disabledClass);
+ }
+
+ }else if($e.is(":radio")){
+ //element is a radio
+ var spanTag = $e.closest("span");
+ var divTag = $e.closest("div");
+
+ divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+ spanTag.removeClass(options.checkedClass);
+
+ if($e.is(":checked")){
+ spanTag.addClass(options.checkedClass);
+ }
+
+ if($e.is(":disabled")){
+ divTag.addClass(options.disabledClass);
+ }else{
+ divTag.removeClass(options.disabledClass);
+ }
+ }else if($e.is(":file")){
+ var divTag = $e.parent("div");
+ var filenameTag = $e.siblings(options.filenameClass);
+ btnTag = $e.siblings(options.fileBtnClass);
+
+ divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+
+ filenameTag.text($e.val());
+
+ if($e.is(":disabled")){
+ divTag.addClass(options.disabledClass);
+ }else{
+ divTag.removeClass(options.disabledClass);
+ }
+ }else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){
+ var divTag = $e.closest("div");
+ divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
+
+ if($e.is(":disabled")){
+ divTag.addClass(options.disabledClass);
+ }else{
+ divTag.removeClass(options.disabledClass);
+ }
+
+ }
+
+ });
+ };
+
+ return this.each(function() {
+ if($.support.selectOpacity){
+ var elem = $(this);
+
+ if(elem.is("select")){
+ //element is a select
+ if(elem.attr("multiple") != true){
+ //element is not a multi-select
+ if(elem.attr("size") == undefined || elem.attr("size") <= 1){
+ doSelect(elem);
+ }
+ }
+ }else if(elem.is(":checkbox")){
+ //element is a checkbox
+ doCheckbox(elem);
+ }else if(elem.is(":radio")){
+ //element is a radio
+ doRadio(elem);
+ }else if(elem.is(":file")){
+ //element is a file upload
+ doFile(elem);
+ }else if(elem.is(":text, :password, input[type='email']")){
+ doInput(elem);
+ }else if(elem.is("textarea")){
+ doTextarea(elem);
+ }else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){
+ doButton(elem);
+ }
+
+ }
+ });
+ };
+})(jQuery);
View
1 ajax/libs/uniform/jquery.uniform.min.js
@@ -0,0 +1 @@
+(function(a){a.uniform={options:{selectClass:"selector",radioClass:"radio",checkboxClass:"checker",fileClass:"uploader",filenameClass:"filename",fileBtnClass:"action",fileDefaultText:"No file selected",fileBtnText:"Choose File",checkedClass:"checked",focusClass:"focus",disabledClass:"disabled",buttonClass:"button",activeClass:"active",hoverClass:"hover",useID:true,idPrefix:"uniform",resetSelector:false,autoHide:true},elements:[]};if(a.browser.msie&&a.browser.version<7){a.support.selectOpacity=false}else{a.support.selectOpacity=true}a.fn.uniform=function(k){k=a.extend(a.uniform.options,k);var d=this;if(k.resetSelector!=false){a(k.resetSelector).mouseup(function(){function l(){a.uniform.update(d)}setTimeout(l,10)})}function j(l){$el=a(l);$el.addClass($el.attr("type"));b(l)}function g(l){a(l).addClass("uniform");b(l)}function i(o){var m=a(o);var p=a("<div>"),l=a("<span>");p.addClass(k.buttonClass);if(k.useID&&m.attr("id")!=""){p.attr("id",k.idPrefix+"-"+m.attr("id"))}var n;if(m.is("a")||m.is("button")){n=m.text()}else{if(m.is(":submit")||m.is(":reset")||m.is("input[type=button]")){n=m.attr("value")}}n=n==""?m.is(":reset")?"Reset":"Submit":n;l.html(n);m.css("opacity",0);m.wrap(p);m.wrap(l);p=m.closest("div");l=m.closest("span");if(m.is(":disabled")){p.addClass(k.disabledClass)}p.bind({"mouseenter.uniform":function(){p.addClass(k.hoverClass)},"mouseleave.uniform":function(){p.removeClass(k.hoverClass);p.removeClass(k.activeClass)},"mousedown.uniform touchbegin.uniform":function(){p.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"click.uniform touchend.uniform":function(r){if(a(r.target).is("span")||a(r.target).is("div")){if(o[0].dispatchEvent){var q=document.createEvent("MouseEvents");q.initEvent("click",true,true);o[0].dispatchEvent(q)}else{o[0].click()}}}});o.bind({"focus.uniform":function(){p.addClass(k.focusClass)},"blur.uniform":function(){p.removeClass(k.focusClass)}});a.uniform.noSelect(p);b(o)}function e(o){var m=a(o);var p=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){p.hide()}p.addClass(k.selectClass);if(k.useID&&o.attr("id")!=""){p.attr("id",k.idPrefix+"-"+o.attr("id"))}var n=o.find(":selected:first");if(n.length==0){n=o.find("option:first")}l.html(n.html());o.css("opacity",0);o.wrap(p);o.before(l);p=o.parent("div");l=o.siblings("span");o.bind({"change.uniform":function(){l.text(o.find(":selected").html());p.removeClass(k.activeClass)},"focus.uniform":function(){p.addClass(k.focusClass)},"blur.uniform":function(){p.removeClass(k.focusClass);p.removeClass(k.activeClass)},"mousedown.uniform touchbegin.uniform":function(){p.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"click.uniform touchend.uniform":function(){p.removeClass(k.activeClass)},"mouseenter.uniform":function(){p.addClass(k.hoverClass)},"mouseleave.uniform":function(){p.removeClass(k.hoverClass);p.removeClass(k.activeClass)},"keyup.uniform":function(){l.text(o.find(":selected").html())}});if(a(o).attr("disabled")){p.addClass(k.disabledClass)}a.uniform.noSelect(l);b(o)}function f(n){var m=a(n);var o=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){o.hide()}o.addClass(k.checkboxClass);if(k.useID&&n.attr("id")!=""){o.attr("id",k.idPrefix+"-"+n.attr("id"))}a(n).wrap(o);a(n).wrap(l);l=n.parent();o=l.parent();a(n).css("opacity",0).bind({"focus.uniform":function(){o.addClass(k.focusClass)},"blur.uniform":function(){o.removeClass(k.focusClass)},"click.uniform touchend.uniform":function(){if(!a(n).attr("checked")){l.removeClass(k.checkedClass)}else{l.addClass(k.checkedClass)}},"mousedown.uniform touchbegin.uniform":function(){o.addClass(k.activeClass)},"mouseup.uniform touchend.uniform":function(){o.removeClass(k.activeClass)},"mouseenter.uniform":function(){o.addClass(k.hoverClass)},"mouseleave.uniform":function(){o.removeClass(k.hoverClass);o.removeClass(k.activeClass)}});if(a(n).attr("checked")){l.addClass(k.checkedClass)}if(a(n).attr("disabled")){o.addClass(k.disabledClass)}b(n)}function c(n){var m=a(n);var o=a("<div />"),l=a("<span />");if(!m.css("display")=="none"&&k.autoHide){o.hide()}o.addClass(k.radioClass);if(k.useID&&n.attr("id")!=""){o.attr("id",k.idPrefix+"-"+n.attr("id"))}a(n).wrap(o);a(n).wrap(l);l=n.parent();o=l.parent();a(n).css("opacity",0).bind({"focus.uniform":function(){o.addClass(k.focusClass)},"blur.uniform":function(){o.removeClass(k.focusClass)},"click.uniform touchend.uniform":function(){if(!a(n).attr("checked")){l.removeClass(k.checkedClass)}else{var p=k.radioClass.split(" ")[0];a("."+p+" span."+k.checkedClass+":has([name='"+a(n).attr("name")+"'])").removeClass(k.checkedClass);l.addClass(k.checkedClass)}},"mousedown.uniform touchend.uniform":function(){if(!a(n).is(":disabled")){o.addClass(k.activeClass)}},"mouseup.uniform touchbegin.uniform":function(){o.removeClass(k.activeClass)},"mouseenter.uniform touchend.uniform":function(){o.addClass(k.hoverClass)},"mouseleave.uniform":function(){o.removeClass(k.hoverClass);o.removeClass(k.activeClass)}});if(a(n).attr("checked")){l.addClass(k.checkedClass)}if(a(n).attr("disabled")){o.addClass(k.disabledClass)}b(n)}function h(q){var o=a(q);var r=a("<div />"),p=a("<span>"+k.fileDefaultText+"</span>"),m=a("<span>"+k.fileBtnText+"</span>");if(!o.css("display")=="none"&&k.autoHide){r.hide()}r.addClass(k.fileClass);p.addClass(k.filenameClass);m.addClass(k.fileBtnClass);if(k.useID&&o.attr("id")!=""){r.attr("id",k.idPrefix+"-"+o.attr("id"))}o.wrap(r);o.after(m);o.after(p);r=o.closest("div");p=o.siblings("."+k.filenameClass);m=o.siblings("."+k.fileBtnClass);if(!o.attr("size")){var l=r.width();o.attr("size",l/10)}var n=function(){var s=o.val();if(s===""){s=k.fileDefaultText}else{s=s.split(/[\/\\]+/);s=s[(s.length-1)]}p.text(s)};n();o.css("opacity",0).bind({"focus.uniform":function(){r.addClass(k.focusClass)},"blur.uniform":function(){r.removeClass(k.focusClass)},"mousedown.uniform":function(){if(!a(q).is(":disabled")){r.addClass(k.activeClass)}},"mouseup.uniform":function(){r.removeClass(k.activeClass)},"mouseenter.uniform":function(){r.addClass(k.hoverClass)},"mouseleave.uniform":function(){r.removeClass(k.hoverClass);r.removeClass(k.activeClass)}});if(a.browser.msie){o.bind("click.uniform.ie7",function(){setTimeout(n,0)})}else{o.bind("change.uniform",n)}if(o.attr("disabled")){r.addClass(k.disabledClass)}a.uniform.noSelect(p);a.uniform.noSelect(m);b(q)}a.uniform.restore=function(l){if(l==undefined){l=a(a.uniform.elements)}a(l).each(function(){if(a(this).is(":checkbox")){a(this).unwrap().unwrap()}else{if(a(this).is("select")){a(this).siblings("span").remove();a(this).unwrap()}else{if(a(this).is(":radio")){a(this).unwrap().unwrap()}else{if(a(this).is(":file")){a(this).siblings("span").remove();a(this).unwrap()}else{if(a(this).is("button, :submit, :reset, a, input[type='button']")){a(this).unwrap().unwrap()}}}}}a(this).unbind(".uniform");a(this).css("opacity","1");var m=a.inArray(a(l),a.uniform.elements);a.uniform.elements.splice(m,1)})};function b(l){l=a(l).get();if(l.length>1){a.each(l,function(m,n){a.uniform.elements.push(n)})}else{a.uniform.elements.push(l)}}a.uniform.noSelect=function(l){function m(){return false}a(l).each(function(){this.onselectstart=this.ondragstart=m;a(this).mousedown(m).css({MozUserSelect:"none"})})};a.uniform.update=function(l){if(l==undefined){l=a(a.uniform.elements)}l=a(l);l.each(function(){var n=a(this);if(n.is("select")){var m=n.siblings("span");var p=n.parent("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.html(n.find(":selected").html());if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":checkbox")){var m=n.closest("span");var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.removeClass(k.checkedClass);if(n.is(":checked")){m.addClass(k.checkedClass)}if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":radio")){var m=n.closest("span");var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);m.removeClass(k.checkedClass);if(n.is(":checked")){m.addClass(k.checkedClass)}if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":file")){var p=n.parent("div");var o=n.siblings(k.filenameClass);btnTag=n.siblings(k.fileBtnClass);p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);o.text(n.val());if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}else{if(n.is(":submit")||n.is(":reset")||n.is("button")||n.is("a")||l.is("input[type=button]")){var p=n.closest("div");p.removeClass(k.hoverClass+" "+k.focusClass+" "+k.activeClass);if(n.is(":disabled")){p.addClass(k.disabledClass)}else{p.removeClass(k.disabledClass)}}}}}}})};return this.each(function(){if(a.support.selectOpacity){var l=a(this);if(l.is("select")){if(l.attr("multiple")!=true){if(l.attr("size")==undefined||l.attr("size")<=1){e(l)}}}else{if(l.is(":checkbox")){f(l)}else{if(l.is(":radio")){c(l)}else{if(l.is(":file")){h(l)}else{if(l.is(":text, :password, input[type='email']")){j(l)}else{if(l.is("textarea")){g(l)}else{if(l.is("a")||l.is(":submit")||l.is(":reset")||l.is("button")||l.is("input[type=button]")){i(l)}}}}}}}}})}})(jQuery);
View
26 ajax/libs/uniform/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "Uniform",
+ "filename": "jquery.uniform.min.js",
+ "version": "1.5",
+ "description": "Sexy forms with jQuery.",
+ "homepage": "http://uniformjs.com/",
+ "keywords": [
+ "form",
+ "jquery",
+ "theme",
+ "control"
+ ],
+ "maintainers": [
+ {
+ "name": "Josh Pyles",
+ "web": "http://pixelmatrixdesign.com/"
+ }
+ ],
+ "repositories": [
+ {
+ "type": "git",
+ "url": "https://github.com/pixelmatrix/uniform"
+ }
+ ]
+
+}

0 comments on commit 57eb6b3

Please sign in to comment.