diff --git a/.gitignore b/.gitignore
index fa2ccfb..a64b2d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
#ignore thumbnails created by windows
-Thumbs.db
+*.db
+*.pdf
+*.session
\ No newline at end of file
diff --git a/FelixNagel_Diplomarbeit.pdf b/FelixNagel_Diplomarbeit.pdf
deleted file mode 100644
index e09f450..0000000
Binary files a/FelixNagel_Diplomarbeit.pdf and /dev/null differ
diff --git a/Formular/css/style.css b/Form/css/style.css
similarity index 60%
rename from Formular/css/style.css
rename to Form/css/style.css
index a08af9f..261e230 100644
--- a/Formular/css/style.css
+++ b/Form/css/style.css
@@ -4,9 +4,6 @@ body {
font-family: "Arial","Verdana","sans-serif";
margin: 1em;
}
-#wrapper {
- width: 20em;
-}
h1 {
font-family:"Trebuchet MS","Helvetica";
border-bottom: 1px solid #EEEEEE;
@@ -30,18 +27,17 @@ font-size: 0.6em;
----------------------------------*/
fieldset {
border: 0;
- margin: 0 0 1em 0;
+ margin: 0 1em 1em 0;
padding: 1em;
+ width: 18em;
}
-*:first-child+html fieldset {
- margin: 0 0 2em 0;
+#wrapper .left {
+ float: left;
+
}
legend {
padding: 0.1em 0.3em;
}
-*:first-child+html legend {
- margin: -1.5em 0 1em 0;
-}
label, input {
display:block;
font-size: 0.8em;
@@ -60,18 +56,11 @@ input.radio {
margin: 0.1em 1em 0 0;
}
.pair {
- clear: both;
margin: 0.5em 0;
}
.pair input{
margin: 0.25em 0.5em 0 0.3em;
-}
-*:first-child+html .pair input,
-*:first-child+html .pair input {
- margin: -0.05em 0.5em 0 0.1em;
-}
-* html .pair input {
- margin: -0.07em 0.3em 0 -0;
+ position: relative;
}
.submit {
float: left;
@@ -85,14 +74,33 @@ input.radio {
.info {
margin: 0 0 1em 0;
padding: 0.2em 0.5em;
+ width: 40em;
}
-#ui-formular-error li {
+.ui-formular-error {
+ width: 41em;
+}
+.ui-formular-error li {
font-size: 0.8em;
}
+.ui-formular-error .ui-state-highlight,
+.ui-formular-success .ui-state-highlight {
+ padding: 0.2em 0.5em;
+}
+.ui-formular-error span.ui-icon,
+.ui-formular-success span.ui-icon {
+ float: left;
+ margin-right: 0.3em
+}
-#ui-formular-error{
- position: absolute;
- left: 22em;
- top: 5.3em;
- width: 20em;
+.text.ui-state-hover,
+.text.ui-state-focus {
+ background: none !important;
+}
+
+/* Chrome css bug (would change styles of other browsers too, only to see where the problem is */
+´/*
+select.ui-state-error,
+.ui-widget-content select.ui-state-error {
+color: black;
}
+ */
\ No newline at end of file
diff --git a/Form/css/style_ie.css b/Form/css/style_ie.css
new file mode 100644
index 0000000..cacc870
--- /dev/null
+++ b/Form/css/style_ie.css
@@ -0,0 +1,24 @@
+/* Form Styling
+----------------------------------*/
+.ie6 fieldset {
+ margin: 0;
+}
+
+.ie8 legend,
+.ie7 legend {
+ margin: 0em 0 1em 0;
+}
+
+.ie9 .pair input {
+ margin: -0.1em 0.3em 0 0;
+}
+.ie8 .pair input,
+.ie7 .pair input,
+.ie6 .pair input {
+ margin: -0.09em 0.5em 0 0;
+}
+
+.ie6 .text {
+ margin: 0 !important;
+ padding: 0 !important;
+}
\ No newline at end of file
diff --git a/Form/css/tooltip.css b/Form/css/tooltip.css
new file mode 100644
index 0000000..bde596f
--- /dev/null
+++ b/Form/css/tooltip.css
@@ -0,0 +1,17 @@
+/* Tooltip
+----------------------------------*/
+.ui-tooltip {
+ font-size: 0.8em;
+ padding: 4px 8px;
+ position: absolute;
+ z-index: 9999;
+ -o-box-shadow: 0 0 2px #aaa;
+ -moz-box-shadow: 0 0 2px #aaa;
+ -webkit-box-shadow: 0 0 2px #aaa;
+ box-shadow: 0 0 2px #aaa;
+}
+/* Fades and background-images don't work well together in IE6, drop the image */
+* html .ui-tooltip {
+ background-image: none;
+}
+body .ui-tooltip { border-width:2px; }
\ No newline at end of file
diff --git a/Form/custom-error.html b/Form/custom-error.html
new file mode 100644
index 0000000..06794dd
--- /dev/null
+++ b/Form/custom-error.html
@@ -0,0 +1,252 @@
+
+
+
+
+
+
+
+
+
+
+ ui.formValidator - custom error demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - custom error demo - ui.formValidator
+
+
+
+
+
diff --git a/Form/examples/add_a_field.html b/Form/examples/add_a_field.html
new file mode 100644
index 0000000..9f8b1a0
--- /dev/null
+++ b/Form/examples/add_a_field.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+ ui.formValidator - dependency demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - add a field manually demo - ui.formValidator
+
+
+
+
diff --git a/Form/examples/after_submit.html b/Form/examples/after_submit.html
new file mode 100644
index 0000000..397277f
--- /dev/null
+++ b/Form/examples/after_submit.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ ui.formValidator - dependency demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - dependency demo - ui.formValidator
+
+
+
+
diff --git a/Form/examples/dependency.html b/Form/examples/dependency.html
new file mode 100644
index 0000000..44ebb22
--- /dev/null
+++ b/Form/examples/dependency.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+ ui.formValidator - dependency demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - dependency demo - ui.formValidator
+
+
+
+
diff --git a/Form/examples/username_check.html b/Form/examples/username_check.html
new file mode 100644
index 0000000..7f50e6c
--- /dev/null
+++ b/Form/examples/username_check.html
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+ ui.formValidator - username check demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - username check demo - ui.formValidator
+
+
+
+
diff --git a/Form/index.html b/Form/index.html
new file mode 100644
index 0000000..9c09e6d
--- /dev/null
+++ b/Form/index.html
@@ -0,0 +1,320 @@
+
+
+
+
+
+
+
+
+
+
+ ui.formValidator - standard demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - standard demo - ui.formValidator
+
+
+
+
+
diff --git a/Form/js/jquery.form.js b/Form/js/jquery.form.js
new file mode 100644
index 0000000..1953f93
--- /dev/null
+++ b/Form/js/jquery.form.js
@@ -0,0 +1,1132 @@
+/*!
+ * jQuery Form Plugin
+ * version: 3.23 (11-DEC-2012)
+ * @requires jQuery v1.5 or later
+ *
+ * Examples and documentation at: http://malsup.com/jquery/form/
+ * Project repository: https://github.com/malsup/form
+ * Dual licensed under the MIT and GPL licenses:
+ * http://malsup.github.com/mit-license.txt
+ * http://malsup.github.com/gpl-license-v2.txt
+ */
+/*global ActiveXObject alert */
+;(function($) {
+"use strict";
+
+/*
+ Usage Note:
+ -----------
+ Do not use both ajaxSubmit and ajaxForm on the same form. These
+ functions are mutually exclusive. Use ajaxSubmit if you want
+ to bind your own submit handler to the form. For example,
+
+ $(document).ready(function() {
+ $('#myForm').on('submit', function(e) {
+ e.preventDefault(); // <-- important
+ $(this).ajaxSubmit({
+ target: '#output'
+ });
+ });
+ });
+
+ Use ajaxForm when you want the plugin to manage all the event binding
+ for you. For example,
+
+ $(document).ready(function() {
+ $('#myForm').ajaxForm({
+ target: '#output'
+ });
+ });
+
+ You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
+ form does not have to exist when you invoke ajaxForm:
+
+ $('#myForm').ajaxForm({
+ delegation: true,
+ target: '#output'
+ });
+
+ When using ajaxForm, the ajaxSubmit function will be invoked for you
+ at the appropriate time.
+*/
+
+/**
+ * Feature detection
+ */
+var feature = {};
+feature.fileapi = $(" ").get(0).files !== undefined;
+feature.formdata = window.FormData !== undefined;
+
+/**
+ * ajaxSubmit() provides a mechanism for immediately submitting
+ * an HTML form using AJAX.
+ */
+$.fn.ajaxSubmit = function(options) {
+ /*jshint scripturl:true */
+
+ // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
+ if (!this.length) {
+ log('ajaxSubmit: skipping submit process - no element selected');
+ return this;
+ }
+
+ var method, action, url, $form = this;
+
+ if (typeof options == 'function') {
+ options = { success: options };
+ }
+
+ method = this.attr('method');
+ action = this.attr('action');
+ url = (typeof action === 'string') ? $.trim(action) : '';
+ url = url || window.location.href || '';
+ if (url) {
+ // clean url (don't include hash vaue)
+ url = (url.match(/^([^#]+)/)||[])[1];
+ }
+
+ options = $.extend(true, {
+ url: url,
+ success: $.ajaxSettings.success,
+ type: 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 traditional = options.traditional;
+ if ( traditional === undefined ) {
+ traditional = $.ajaxSettings.traditional;
+ }
+
+ var elements = [];
+ var qx, a = this.formToArray(options.semantic, elements);
+ if (options.data) {
+ options.extraData = options.data;
+ qx = $.param(options.data, traditional);
+ }
+
+ // 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, traditional);
+ if (qx) {
+ q = ( q ? (q + '&' + qx) : qx );
+ }
+ 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 callbacks = [];
+ if (options.resetForm) {
+ callbacks.push(function() { $form.resetForm(); });
+ }
+ if (options.clearForm) {
+ callbacks.push(function() { $form.clearForm(options.includeHidden); });
+ }
+
+ // 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) {
+ var fn = options.replaceTarget ? 'replaceWith' : 'html';
+ $(options.target)[fn](data).each(oldSuccess, arguments);
+ });
+ }
+ else if (options.success) {
+ callbacks.push(options.success);
+ }
+
+ options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
+ var context = options.context || this ; // jQuery 1.4+ supports scope context
+ for (var i=0, max=callbacks.length; i < max; i++) {
+ callbacks[i].apply(context, [data, status, xhr || $form, $form]);
+ }
+ };
+
+ // are there files to upload?
+
+ // [value] (issue #113), also see comment:
+ // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
+ var fileInputs = $('input[type=file]:enabled[value!=""]', this);
+
+ var hasFileInputs = fileInputs.length > 0;
+ var mp = 'multipart/form-data';
+ var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
+
+ var fileAPI = feature.fileapi && feature.formdata;
+ log("fileAPI :" + fileAPI);
+ var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
+
+ var jqxhr;
+
+ // options.iframe allows user to force iframe mode
+ // 06-NOV-09: now defaulting to iframe mode if file input is detected
+ if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
+ // 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, function() {
+ jqxhr = fileUploadIframe(a);
+ });
+ }
+ else {
+ jqxhr = fileUploadIframe(a);
+ }
+ }
+ else if ((hasFileInputs || multipart) && fileAPI) {
+ jqxhr = fileUploadXhr(a);
+ }
+ else {
+ jqxhr = $.ajax(options);
+ }
+
+ $form.removeData('jqxhr').data('jqxhr', jqxhr);
+
+ // clear element array
+ for (var k=0; k < elements.length; k++)
+ elements[k] = null;
+
+ // fire 'notify' event
+ this.trigger('form-submit-notify', [this, options]);
+ return this;
+
+ // utility fn for deep serialization
+ function deepSerialize(extraData){
+ var serialized = $.param(extraData).split('&');
+ var len = serialized.length;
+ var result = {};
+ var i, part;
+ for (i=0; i < len; i++) {
+ // #252; undo param space replacement
+ serialized[i] = serialized[i].replace(/\+/g,' ');
+ part = serialized[i].split('=');
+ result[decodeURIComponent(part[0])] = decodeURIComponent(part[1]);
+ }
+ return result;
+ }
+
+ // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
+ function fileUploadXhr(a) {
+ var formdata = new FormData();
+
+ for (var i=0; i < a.length; i++) {
+ formdata.append(a[i].name, a[i].value);
+ }
+
+ if (options.extraData) {
+ var serializedData = deepSerialize(options.extraData);
+ for (var p in serializedData)
+ if (serializedData.hasOwnProperty(p))
+ formdata.append(p, serializedData[p]);
+ }
+
+ options.data = null;
+
+ var s = $.extend(true, {}, $.ajaxSettings, options, {
+ contentType: false,
+ processData: false,
+ cache: false,
+ type: method || 'POST'
+ });
+
+ if (options.uploadProgress) {
+ // workaround because jqXHR does not expose upload property
+ s.xhr = function() {
+ var xhr = jQuery.ajaxSettings.xhr();
+ if (xhr.upload) {
+ xhr.upload.onprogress = function(event) {
+ var percent = 0;
+ var position = event.loaded || event.position; /*event.position is deprecated*/
+ var total = event.total;
+ if (event.lengthComputable) {
+ percent = Math.ceil(position / total * 100);
+ }
+ options.uploadProgress(event, position, total, percent);
+ };
+ }
+ return xhr;
+ };
+ }
+
+ s.data = null;
+ var beforeSend = s.beforeSend;
+ s.beforeSend = function(xhr, o) {
+ o.data = formdata;
+ if(beforeSend)
+ beforeSend.call(this, xhr, o);
+ };
+ return $.ajax(s);
+ }
+
+ // private function for handling file uploads (hat tip to YAHOO!)
+ function fileUploadIframe(a) {
+ var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
+ var useProp = !!$.fn.prop;
+ var deferred = $.Deferred();
+
+ if ($('[name=submit],[id=submit]', form).length) {
+ // if there is an input with a name or id of 'submit' then we won't be
+ // able to invoke the submit fn on the form (at least not x-browser)
+ alert('Error: Form elements must not have name or id of "submit".');
+ deferred.reject();
+ return deferred;
+ }
+
+ if (a) {
+ // ensure that every serialized input is still enabled
+ for (i=0; i < elements.length; i++) {
+ el = $(elements[i]);
+ if ( useProp )
+ el.prop('disabled', false);
+ else
+ el.removeAttr('disabled');
+ }
+ }
+
+ s = $.extend(true, {}, $.ajaxSettings, options);
+ s.context = s.context || s;
+ id = 'jqFormIO' + (new Date().getTime());
+ if (s.iframeTarget) {
+ $io = $(s.iframeTarget);
+ n = $io.attr('name');
+ if (!n)
+ $io.attr('name', id);
+ else
+ id = n;
+ }
+ else {
+ $io = $('');
+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+ }
+ io = $io[0];
+
+
+ xhr = { // mock object
+ aborted: 0,
+ responseText: null,
+ responseXML: null,
+ status: 0,
+ statusText: 'n/a',
+ getAllResponseHeaders: function() {},
+ getResponseHeader: function() {},
+ setRequestHeader: function() {},
+ abort: function(status) {
+ var e = (status === 'timeout' ? 'timeout' : 'aborted');
+ log('aborting upload... ' + e);
+ this.aborted = 1;
+
+ try { // #214, #257
+ if (io.contentWindow.document.execCommand) {
+ io.contentWindow.document.execCommand('Stop');
+ }
+ }
+ catch(ignore) {}
+
+ $io.attr('src', s.iframeSrc); // abort op in progress
+ xhr.error = e;
+ if (s.error)
+ s.error.call(s.context, xhr, e, status);
+ if (g)
+ $.event.trigger("ajaxError", [xhr, s, e]);
+ if (s.complete)
+ s.complete.call(s.context, xhr, e);
+ }
+ };
+
+ g = s.global;
+ // trigger ajax global events so that activity/block indicators work like normal
+ if (g && 0 === $.active++) {
+ $.event.trigger("ajaxStart");
+ }
+ if (g) {
+ $.event.trigger("ajaxSend", [xhr, s]);
+ }
+
+ if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
+ if (s.global) {
+ $.active--;
+ }
+ deferred.reject();
+ return deferred;
+ }
+ if (xhr.aborted) {
+ deferred.reject();
+ return deferred;
+ }
+
+ // add submitting element to data if we know it
+ sub = form.clk;
+ if (sub) {
+ n = sub.name;
+ if (n && !sub.disabled) {
+ s.extraData = s.extraData || {};
+ s.extraData[n] = sub.value;
+ if (sub.type == "image") {
+ s.extraData[n+'.x'] = form.clk_x;
+ s.extraData[n+'.y'] = form.clk_y;
+ }
+ }
+ }
+
+ var CLIENT_TIMEOUT_ABORT = 1;
+ var SERVER_ABORT = 2;
+
+ function getDoc(frame) {
+ var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document;
+ return doc;
+ }
+
+ // Rails CSRF hack (thanks to Yvan Barthelemy)
+ var csrf_token = $('meta[name=csrf-token]').attr('content');
+ var csrf_param = $('meta[name=csrf-param]').attr('content');
+ if (csrf_param && csrf_token) {
+ s.extraData = s.extraData || {};
+ s.extraData[csrf_param] = csrf_token;
+ }
+
+ // take a breath so that pending repaints get some cpu time before the upload starts
+ function doSubmit() {
+ // 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 (!method) {
+ form.setAttribute('method', 'POST');
+ }
+ if (a != s.url) {
+ form.setAttribute('action', s.url);
+ }
+
+ // ie borks in some cases when setting encoding
+ if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
+ $form.attr({
+ encoding: 'multipart/form-data',
+ enctype: 'multipart/form-data'
+ });
+ }
+
+ // support timout
+ if (s.timeout) {
+ timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
+ }
+
+ // look for server aborts
+ function checkState() {
+ try {
+ var state = getDoc(io).readyState;
+ log('state = ' + state);
+ if (state && state.toLowerCase() == 'uninitialized')
+ setTimeout(checkState,50);
+ }
+ catch(e) {
+ log('Server abort: ' , e, ' (', e.name, ')');
+ cb(SERVER_ABORT);
+ if (timeoutHandle)
+ clearTimeout(timeoutHandle);
+ timeoutHandle = undefined;
+ }
+ }
+
+ // add "extra" data to form if provided in options
+ var extraInputs = [];
+ try {
+ if (s.extraData) {
+ for (var n in s.extraData) {
+ if (s.extraData.hasOwnProperty(n)) {
+ // if using the $.param format that allows for multiple values with the same name
+ if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
+ extraInputs.push(
+ $(' ').attr('value',s.extraData[n].value)
+ .appendTo(form)[0]);
+ } else {
+ extraInputs.push(
+ $(' ').attr('value',s.extraData[n])
+ .appendTo(form)[0]);
+ }
+ }
+ }
+ }
+
+ if (!s.iframeTarget) {
+ // add iframe to doc and submit the form
+ $io.appendTo('body');
+ if (io.attachEvent)
+ io.attachEvent('onload', cb);
+ else
+ io.addEventListener('load', cb, false);
+ }
+ setTimeout(checkState,15);
+ form.submit();
+ }
+ finally {
+ // reset attrs and remove "extra" input elements
+ form.setAttribute('action',a);
+ if(t) {
+ form.setAttribute('target', t);
+ } else {
+ $form.removeAttr('target');
+ }
+ $(extraInputs).remove();
+ }
+ }
+
+ if (s.forceSync) {
+ doSubmit();
+ }
+ else {
+ setTimeout(doSubmit, 10); // this lets dom updates render
+ }
+
+ var data, doc, domCheckCount = 50, callbackProcessed;
+
+ function cb(e) {
+ if (xhr.aborted || callbackProcessed) {
+ return;
+ }
+ try {
+ doc = getDoc(io);
+ }
+ catch(ex) {
+ log('cannot access response document: ', ex);
+ e = SERVER_ABORT;
+ }
+ if (e === CLIENT_TIMEOUT_ABORT && xhr) {
+ xhr.abort('timeout');
+ deferred.reject(xhr, 'timeout');
+ return;
+ }
+ else if (e == SERVER_ABORT && xhr) {
+ xhr.abort('server abort');
+ deferred.reject(xhr, 'error', 'server abort');
+ return;
+ }
+
+ if (!doc || doc.location.href == s.iframeSrc) {
+ // response not received yet
+ if (!timedOut)
+ return;
+ }
+ if (io.detachEvent)
+ io.detachEvent('onload', cb);
+ else
+ io.removeEventListener('load', cb, false);
+
+ var status = 'success', errMsg;
+ try {
+ if (timedOut) {
+ throw 'timeout';
+ }
+
+ var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
+ log('isXml='+isXml);
+ if (!isXml && window.opera && (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
+ log('requeing onLoad callback, DOM not available');
+ setTimeout(cb, 250);
+ return;
+ }
+ // let this fall through because server response could be an empty document
+ //log('Could not access iframe DOM after mutiple tries.');
+ //throw 'DOMException: not available';
+ }
+
+ //log('response detected');
+ var docRoot = doc.body ? doc.body : doc.documentElement;
+ xhr.responseText = docRoot ? docRoot.innerHTML : null;
+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+ if (isXml)
+ s.dataType = 'xml';
+ xhr.getResponseHeader = function(header){
+ var headers = {'content-type': s.dataType};
+ return headers[header];
+ };
+ // support for XHR 'status' & 'statusText' emulation :
+ if (docRoot) {
+ xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
+ xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
+ }
+
+ var dt = (s.dataType || '').toLowerCase();
+ var scr = /(json|script|text)/.test(dt);
+ if (scr || s.textarea) {
+ // see if user embedded response in textarea
+ var ta = doc.getElementsByTagName('textarea')[0];
+ if (ta) {
+ xhr.responseText = ta.value;
+ // support for XHR 'status' & 'statusText' emulation :
+ xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
+ xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
+ }
+ else if (scr) {
+ // account for browsers injecting pre around json response
+ var pre = doc.getElementsByTagName('pre')[0];
+ var b = doc.getElementsByTagName('body')[0];
+ if (pre) {
+ xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
+ }
+ else if (b) {
+ xhr.responseText = b.textContent ? b.textContent : b.innerText;
+ }
+ }
+ }
+ else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
+ xhr.responseXML = toXml(xhr.responseText);
+ }
+
+ try {
+ data = httpData(xhr, dt, s);
+ }
+ catch (e) {
+ status = 'parsererror';
+ xhr.error = errMsg = (e || status);
+ }
+ }
+ catch (e) {
+ log('error caught: ',e);
+ status = 'error';
+ xhr.error = errMsg = (e || status);
+ }
+
+ if (xhr.aborted) {
+ log('upload aborted');
+ status = null;
+ }
+
+ if (xhr.status) { // we've set xhr.status
+ status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
+ }
+
+ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+ if (status === 'success') {
+ if (s.success)
+ s.success.call(s.context, data, 'success', xhr);
+ deferred.resolve(xhr.responseText, 'success', xhr);
+ if (g)
+ $.event.trigger("ajaxSuccess", [xhr, s]);
+ }
+ else if (status) {
+ if (errMsg === undefined)
+ errMsg = xhr.statusText;
+ if (s.error)
+ s.error.call(s.context, xhr, status, errMsg);
+ deferred.reject(xhr, 'error', errMsg);
+ if (g)
+ $.event.trigger("ajaxError", [xhr, s, errMsg]);
+ }
+
+ if (g)
+ $.event.trigger("ajaxComplete", [xhr, s]);
+
+ if (g && ! --$.active) {
+ $.event.trigger("ajaxStop");
+ }
+
+ if (s.complete)
+ s.complete.call(s.context, xhr, status);
+
+ callbackProcessed = true;
+ if (s.timeout)
+ clearTimeout(timeoutHandle);
+
+ // clean up
+ setTimeout(function() {
+ if (!s.iframeTarget)
+ $io.remove();
+ xhr.responseXML = null;
+ }, 100);
+ }
+
+ var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
+ 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.nodeName != 'parsererror') ? doc : null;
+ };
+ var parseJSON = $.parseJSON || function(s) {
+ /*jslint evil:true */
+ return window['eval']('(' + s + ')');
+ };
+
+ var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
+
+ var ct = xhr.getResponseHeader('content-type') || '',
+ xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if (xml && data.documentElement.nodeName === 'parsererror') {
+ if ($.error)
+ $.error('parsererror');
+ }
+ if (s && s.dataFilter) {
+ data = s.dataFilter(data, type);
+ }
+ if (typeof data === 'string') {
+ if (type === 'json' || !type && ct.indexOf('json') >= 0) {
+ data = parseJSON(data);
+ } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
+ $.globalEval(data);
+ }
+ }
+ return data;
+ };
+
+ return deferred;
+ }
+};
+
+/**
+ * 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 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) {
+ options = options || {};
+ options.delegation = options.delegation && $.isFunction($.fn.on);
+
+ // in jQuery 1.3+ we can fix mistakes with the ready state
+ if (!options.delegation && this.length === 0) {
+ var o = { s: this.selector, c: this.context };
+ if (!$.isReady && o.s) {
+ log('DOM not ready, queuing ajaxForm');
+ $(function() {
+ $(o.s,o.c).ajaxForm(options);
+ });
+ return this;
+ }
+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
+ return this;
+ }
+
+ if ( options.delegation ) {
+ $(document)
+ .off('submit.form-plugin', this.selector, doAjaxSubmit)
+ .off('click.form-plugin', this.selector, captureSubmittingElement)
+ .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
+ .on('click.form-plugin', this.selector, options, captureSubmittingElement);
+ return this;
+ }
+
+ return this.ajaxFormUnbind()
+ .bind('submit.form-plugin', options, doAjaxSubmit)
+ .bind('click.form-plugin', options, captureSubmittingElement);
+};
+
+// private event handlers
+function doAjaxSubmit(e) {
+ /*jshint validthis:true */
+ var options = e.data;
+ if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
+ e.preventDefault();
+ $(this).ajaxSubmit(options);
+ }
+}
+
+function captureSubmittingElement(e) {
+ /*jshint validthis:true */
+ var target = e.target;
+ var $el = $(target);
+ if (!($el.is("[type=submit],[type=image]"))) {
+ // is this a child element of the submit el? (ex: a span within a button)
+ var t = $el.closest('[type=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') {
+ 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, elements) {
+ var a = [];
+ if (this.length === 0) {
+ return a;
+ }
+
+ var form = this[0];
+ var els = semantic ? form.getElementsByTagName('*') : form.elements;
+ if (!els) {
+ return a;
+ }
+
+ var i,j,n,v,el,max,jmax;
+ for(i=0, max=els.length; i < max; i++) {
+ el = els[i];
+ 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(), type: el.type });
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ continue;
+ }
+
+ v = $.fieldValue(el, true);
+ if (v && v.constructor == Array) {
+ if (elements)
+ elements.push(el);
+ for(j=0, jmax=v.length; j < jmax; j++) {
+ a.push({name: n, value: v[j]});
+ }
+ }
+ else if (feature.fileapi && el.type == 'file' && !el.disabled) {
+ if (elements)
+ elements.push(el);
+ var files = el.files;
+ if (files.length) {
+ for (j=0; j < files.length; j++) {
+ a.push({name: n, value: files[j], type: el.type});
+ }
+ }
+ else {
+ // #180
+ a.push({ name: n, value: '', type: el.type });
+ }
+ }
+ else if (v !== null && typeof v != 'undefined') {
+ if (elements)
+ elements.push(el);
+ a.push({name: n, value: v, type: el.type, required: el.required});
+ }
+ }
+
+ 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:
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * var v = $('input[type=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 = $('input[type=checkbox]').fieldValue();
+ * // if neither checkbox is checked
+ * v === undefined
+ * // if both checkboxes are checked
+ * v == ['B1', 'B2']
+ *
+ * var v = $('input[type=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;
+ }
+ if (v.constructor == Array)
+ $.merge(val, v);
+ else
+ 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 (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).val();
+};
+
+/**
+ * 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(includeHidden) {
+ return this.each(function() {
+ $('input,select,textarea', this).clearFields(includeHidden);
+ });
+};
+
+/**
+ * Clears the selected form elements.
+ */
+$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
+ var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
+ return this.each(function() {
+ var t = this.type, tag = this.tagName.toLowerCase();
+ if (re.test(t) || tag == 'textarea') {
+ this.value = '';
+ }
+ else if (t == 'checkbox' || t == 'radio') {
+ this.checked = false;
+ }
+ else if (tag == 'select') {
+ this.selectedIndex = -1;
+ }
+ else if (t == "file") {
+ if ($.browser.msie) {
+ $(this).replaceWith($(this).clone());
+ } else {
+ $(this).val('');
+ }
+ }
+ else if (includeHidden) {
+ // includeHidden can be the value true, or it can be a selector string
+ // indicating a special test; for example:
+ // $('#myForm').clearForm('.special:hidden')
+ // the above would clean hidden inputs that have the class of 'special'
+ if ( (includeHidden === true && /hidden/.test(t)) ||
+ (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
+ this.value = '';
+ }
+ });
+};
+
+/**
+ * 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;
+ }
+ });
+};
+
+// expose debug var
+$.fn.ajaxSubmit.debug = false;
+
+// helper fn for console logging
+function log() {
+ if (!$.fn.ajaxSubmit.debug)
+ return;
+ var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
+ if (window.console && window.console.log) {
+ window.console.log(msg);
+ }
+ else if (window.opera && window.opera.postError) {
+ window.opera.postError(msg);
+ }
+}
+
+})(jQuery);
diff --git a/Form/js/jquery.ui.tooltip.js b/Form/js/jquery.ui.tooltip.js
new file mode 100644
index 0000000..ea3cde3
--- /dev/null
+++ b/Form/js/jquery.ui.tooltip.js
@@ -0,0 +1,137 @@
+/*
+ * jQuery UI Tooltip @VERSION
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tooltip
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.position.js
+ */
+(function($) {
+
+var increments = 0;
+
+$.widget("ui.tooltip", {
+ options: {
+ items: "[title]",
+ content: function() {
+ return $(this).attr("title");
+ },
+ position: {
+ my: "left center",
+ at: "right center",
+ offset: "15 0"
+ }
+ },
+ _create: function() {
+ var self = this;
+ this.tooltip = $("
")
+ .attr("id", "ui-tooltip-" + increments++)
+ .attr("role", "tooltip")
+ .attr("aria-hidden", "true")
+ .addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content")
+ .appendTo(document.body)
+ .hide();
+ this.tooltipContent = $("
")
+ .addClass("ui-tooltip-content")
+ .appendTo(this.tooltip);
+ this.opacity = this.tooltip.css("opacity");
+ this.element
+ .bind("focus.tooltip mouseover.tooltip", function(event) {
+ self.open( event );
+ })
+ .bind("blur.tooltip mouseout.tooltip", function(event) {
+ self.close( event );
+ });
+ },
+
+ enable: function() {
+ this.options.disabled = false;
+ },
+
+ disable: function() {
+ this.options.disabled = true;
+ },
+
+ destroy: function() {
+ this.tooltip.remove();
+ $.Widget.prototype.destroy.apply(this, arguments);
+ },
+
+ widget: function() {
+ return this.element.pushStack(this.tooltip.get());
+ },
+
+ open: function(event) {
+ var target = $(event && event.target || this.element).closest(this.options.items);
+ // already visible? possible when both focus and mouseover events occur
+ if (this.current && this.current[0] == target[0])
+ return;
+ var self = this;
+ this.current = target;
+ this.currentTitle = target.attr("title");
+ var content = this.options.content.call(target[0], function(response) {
+ // IE may instantly serve a cached response, need to give it a chance to finish with _show before that
+ setTimeout(function() {
+ // ignore async responses that come in after the tooltip is already hidden
+ if (self.current == target)
+ self._show(event, target, response);
+ }, 13);
+ });
+ if (content) {
+ self._show(event, target, content);
+ }
+ },
+
+ _show: function(event, target, content) {
+ if (!content)
+ return;
+
+ target.attr("title", "");
+
+ if (this.options.disabled)
+ return;
+
+ this.tooltipContent.html(content);
+ this.tooltip.css({
+ top: 0,
+ left: 0
+ }).show().position( $.extend({
+ of: target
+ }, this.options.position )).hide();
+
+ this.tooltip.attr("aria-hidden", "false");
+ target.attr("aria-describedby", this.tooltip.attr("id"));
+
+ this.tooltip.stop(false, true).fadeIn();
+
+ this._trigger( "open", event );
+ },
+
+ close: function(event) {
+ if (!this.current)
+ return;
+
+ var current = this.current;
+ this.current = null;
+ current.attr("title", this.currentTitle);
+
+ if (this.options.disabled)
+ return;
+
+ current.removeAttr("aria-describedby");
+ this.tooltip.attr("aria-hidden", "true");
+
+ this.tooltip.stop(false, true).fadeOut();
+
+ this._trigger( "close", event );
+ }
+
+});
+
+})(jQuery);
\ No newline at end of file
diff --git a/Form/js/ui.formValidator.js b/Form/js/ui.formValidator.js
new file mode 100644
index 0000000..56cb609
--- /dev/null
+++ b/Form/js/ui.formValidator.js
@@ -0,0 +1,651 @@
+/*!
+ * jQuery UI FormValidator (11.10.13)
+ * http://github.com/fnagel/jQuery-Accessible-RIA
+ *
+ * Copyright (c) 2009 Felix Nagel for Namics (Deustchland) GmbH
+ * Copyright (c) 2010-2013 Felix Nagel
+ * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+/*
+USAGE:::::::::::::::::::::::::::
+* Take a look in the html file delivered with this example or visit the wiki (see above)
+* To validate a form element specify its properties in the options forms array:
+ options
+ forms
+ ID [or class of the element]
+ rules
+ msgs
+
+* Forms Array and its children are necessary, possbile values for rules and msg are:
+ required
+ lengthMin
+ lengthMax
+ equalTo (id of to be checked element)
+ regEx (set your own regex)
+ custom (make your own validation function - the fast way)
+
+* Use a regular expression or a predefined value for the RegEx rule:
+ number
+ numberDE
+ numberISO
+ email
+ url
+ plz
+ dateDE
+ dateISO
+ captcha (this is a callback for server side validation, look example)
+
+* public Methods
+disable
+destroy
+enable
+initField parameter is string (name of added field); adds events and internal vars for validation
+formSubmitted submits the form
+validate parameter is string (id attribut); validates a single form element
+
+*/
+(function($) {
+
+$.widget("ui.formValidator", {
+
+ version: '1.8',
+ options: {
+ validateLive: true, // turn on or off live validation
+ validateLiveMsg: true, // disable the "click here to disable live validation" message
+ validateTimeout: 500, // time till live validation, set to "blur" to validate on lost focus only
+ validateTimeoutCaptcha: 3, // multiplied with validateTimeout to protect your server from to much load
+ validateOff: "Please click here to deactivate live validating of this form.",
+ validateOn: "Please clkick here to activate live form validating.",
+ errorSummery: true, // disable error summery
+ errorsTitle: "Please check the following errors:",
+ submitOptions: null, // add every &.ajax option you want, make sure to see addiotional ones of jQuery Form Plugin
+ submitError: "Something wen't wrong while sending your data. Please retry.",
+ submitSuccess: "Your data was succefully submitted, thank you!",
+ selectDefault: "default", // Define default value when using select options
+ noHover: false,
+
+ // callbacks
+ onInit: null,
+ onformSubmitted: null,
+ onError: null,
+ onErrors: null,
+ customError: null, // returns a array with all information about the currectly validated element
+ onShowErrors: null,
+ onShowSuccess: null, // returns true or a string
+ checkCaptcha: null // must deliver a boolean value
+ },
+
+ _create: function() {
+ var options = this.options, self = this;
+ // add virtual buffer form | should be added immediatly
+ self._updateVirtualBuffer();
+
+ // set UID for later usage
+ options.uid = self.element.attr("id") || Math.random().toString(16).slice(2, 10);
+
+ // prevent submitting the form
+ self.element.submit( function (event) {
+ // check if widget is disabled or temp set to disabled by script cause we need to post data
+ if (!options.disabled) {
+ self.formSubmitted();
+ }
+ return options.disabled;
+
+ });
+ // add info Text and provide link to prevent live validating
+ if(options.validateLive && !options.disabled && options.validateLiveMsg) {
+ // add the deactivate live validation message
+ self.element.find(".ui-formular-info").append("\t"+ options.validateOff +"
\n\t\t");
+
+ self._updateVirtualBuffer();
+
+ // toggle live validating and text of the link
+ self.element.find(".ui-formular-live").toggle(
+ function () {
+ options.validateLive = false;
+ $(this).attr("aria-live","polite")
+ .attr("aria-relevant","text")
+ .html(options.validateOn);
+ self._updateVirtualBuffer();
+ },
+ function () {
+ options.validateLive = true;
+ $(this).attr("aria-live","polite")
+ .attr("aria-relevant","text")
+ .html(options.validateOff);
+ self._updateVirtualBuffer();
+ }
+ );
+ }
+
+ // show error summery if enabled or only when form is submitted
+ this.errorElement = self.element.find(".ui-formular-error");
+ if (options.errorSummery && this.errorElement.length) {
+ // set link anchor to form
+ this.errorElement.click(function(event){
+ // get id out of the href anchor
+ var id = $(event.target).closest("a").attr("href").split("#");
+ id = id[1];
+ // focus element or first element of a group
+ var target = (options.forms[id].type == "single") ? options.forms[id].element : options.forms[id].element[0];
+ target.focus();
+ return false;
+ });
+ } else {
+ options.errorSummery = false;
+ }
+
+ // set hover and focus for reset and submit buttons
+ if (!options.noHover) self._makeHover(self.element.find("input:submit, input:reset"));
+
+ // go trough every given form element
+ $.each(options.forms, function(id){
+ self.initField(id);
+ });
+
+ // Callback
+ self._trigger("onInit", 0);
+ },
+
+ // init a form field (events, hover effects, internal vars)
+ initField: function(id) {
+ var options = this.options,
+ self = this;
+ // save element and which form type | add event handler | ARIA
+ // search for "single" elements (which sould be defined by their ID)
+ var element = self.element.find("#"+id);
+ //check if radio group or checkbox group or single checkbox (which sould be defined by their class)
+ if (!element.length) {
+ // get all group elements
+ element = self.element.find("input."+id);
+ // no element found? Only developers should see this
+ if (!element.length) {
+ alert("Error: Configuration corrupted!\n\nCan't find element with id or class = "+id);
+ } else {
+ value = "group";
+ // change label class when hover the label
+ if (!options.noHover) {
+ self._makeHover(element.next());
+ // change label class when hover the form element
+ element.bind("mouseenter", function(){ $(this).next().addClass('ui-state-hover'); })
+ .bind("mouseleave", function(){ $(this).next().removeClass('ui-state-hover'); })
+ .bind("focus", function(){ $(this).next().addClass('ui-state-focus'); })
+ .bind("blur", function(){ $(this).next().removeClass('ui-state-focus'); });
+ }
+ }
+ } else {
+ // form element hover
+ if (!options.noHover) self._makeHover(element);
+ // ARIA
+ if (options.forms[id].rules.required) {
+ element.attr("aria-required", true);
+ }
+ if (element[0].nodeName.toLowerCase() == "select") {
+ // element is a selectfield
+ value = "select";
+ } else {
+ // normal textinput or textarea or file upload
+ value = "single";
+ }
+ }
+ // save info
+ options.forms[id].element = element;
+ options.forms[id].type = value;
+
+ // we use blur as default, as we like to get a validation when a user leave a field empty when tabbing trough
+ var eventBinder = "blur ";
+ // which events should be set? only blur event?
+ if (options.validateTimeout != "blur") {
+ // necessary for not getting too much events
+ if (options.forms[id].type != "group") {
+ // selectboxes need all these events cause of IE (click with UI 1.8.x) and Chrome (change)
+ // please note that single slectboxes (size=1) handled different than multiple, thats why we need keyup
+ // this could be more effecient one day... (i will wait till UI 1.7.1 is not longer used)
+ // text input and textarea get only keyup
+ eventBinder += (options.forms[id].type == "select") ? "click change keyup" : "keyup";
+ } else {
+ // radio buttons and checkboxes get this event
+ eventBinder += "click";
+ }
+ }
+ // add event listener
+ // we always add the blur event, so a required field left empty triggers an error
+ options.forms[id].element.bind(eventBinder, function (e) {
+ // dont fire events if live validation or widget or form field is disabled
+ if (options.validateLive && !options.disabled) {
+ // if tab is pushed do not validate immediatly || if the event is blur do not use timeout
+ if (options.validateTimeout == "blur" || e.type == "blur") {
+ // needed to make clicking on error anchors work
+ window.setTimeout(function() {
+ self.validate(id);
+ }, 150);
+ } else if (e.keyCode != $.ui.keyCode.TAB) {
+ // delete old timeout
+ if(options.forms[id].timeout) window.clearTimeout(options.forms[id].timeout);
+ // extend timeout to prevent server overload
+ var time = (options.forms[id].rules["regEx"] == "captcha") ? options.validateTimeout*options.validateTimeoutCaptcha : options.validateTimeout;
+ // wait before fire event
+ options.forms[id].timeout = window.setTimeout(function() {
+ self.validate(id);
+ }, time);
+ }
+ }
+ });
+ },
+
+ // called when interact with the form | validates the forms | manages which rule applies to which element
+ _validator: function(id) {
+ var options = this.options,
+ self = this;
+ // do nothing if field is disabled
+ if (!options.forms[id].disabled) {
+ // get or make error array
+ var errors = (options.forms[id].errors) ? options.forms[id].errors : [];
+ // get value of the form element(s)
+ var elementValue = self._getValue(id);
+ // got trough every rule and its ruleValue of every given form element
+ $.each(options.forms[id].rules, function(rule, ruleValue){
+ if (elementValue == "") {
+ // unset required error if no form value given and form is not required
+ if (rule != "required") errors[rule] = self._whichError(true, errors[rule]);
+ // if form is required set error
+ if (rule == "required" && ruleValue) errors[rule] = self._whichError(false, errors[rule]);
+ } else {
+ // unset required error if form has some value
+ if (rule == "required" && ruleValue) errors[rule] = self._whichError(true, errors[rule]);
+ switch (rule) {
+ case "regEx":
+ var number = "";
+ switch (ruleValue) {
+ case "number":
+ case "numberDE":
+ case "numberISO":
+ case "email":
+ case "url":
+ case "plz":
+ case "dateDE":
+ case "dateISO":
+ case "captcha":
+ number = self['_' + ruleValue](elementValue);
+ break;
+ // regular expression
+ default:
+ number = self._regEx(elementValue, ruleValue);
+ break;
+ }
+ errors[rule] = self._whichError(number, errors[rule]);
+ break;
+ case "lengthMin":
+ errors[rule] = self._whichError(self._lengthMin(elementValue, ruleValue), errors[rule]);
+ break;
+ case "lengthMax":
+ errors[rule] = self._whichError(self._lengthMax(elementValue, ruleValue), errors[rule]);
+ break;
+ case "equalTo":
+ errors[rule] = self._whichError(self._equalTo(elementValue, ruleValue), errors[rule]);
+ break;
+ case "custom":
+ errors[rule] = self._whichError(ruleValue(elementValue), errors[rule]);
+ break;
+ }
+ }
+ });
+ // save errors
+ options.forms[id].errors = errors;
+ }
+ // callback for customized error messages
+ options.forms[id]["id"] = id;
+ self._trigger("customError", 0, options.forms[id]);
+ },
+
+ // called when form is submitted
+ formSubmitted: function() {
+ var options = this.options, self = this;
+ // Callback
+ self._trigger("onformSubmitted", 0);
+
+ // delete success or error message
+ self.element.find(".ui-formular-success").remove();
+
+ // got trough every given form element
+ $.each(options.forms, function(id){
+ // is a group of radio buttons or checkboxes already validated?
+ var groupValidated = false;
+ // check if the defined id elements exist in the DOM
+ if (options.forms[id].type == "single") {
+ self._validator(id);
+ // if not it must be a radiobox group or a checkbox group
+ } else {
+ // check if the is already validated
+ if (!groupValidated) {
+ groupValidated = true;
+ self._validator(id);
+ }
+ }
+ });
+ self._setErrors(true);
+ },
+
+ // validates a single element
+ validate: function(id) {
+ this._validator(id);
+ this._setErrors(false);
+ },
+
+ // called when forms are validated | write errorsArray to DOM | Take care of ARIA
+ _setErrors: function(submitted){
+ var options = this.options,
+ self = this,
+ hasError = false,
+ addError = false,
+ removeError = false,
+ msgs = "",
+ msg = "";
+
+ // got trough every error form element
+ for (var id in options.forms){
+ // needed to ensure error Class isn't removed if required error still exists
+ var failure = false,
+ target = options.forms[id].element;
+
+ for (var rule in options.forms[id]["errors"]){
+ // set error as corrected
+ if (options.forms[id]["errors"][rule] == "corrected" || options.forms[id].disabled) {
+ // ARIA
+ target.attr("aria-invalid", false);
+ // check for radio group or checkbox group
+ if (options.forms[id].type == "group") target = target.next();
+ // unhighlight error field
+ target.removeClass("ui-state-error");
+ // ARIA: old error deleted
+ removeError = true;
+ // execute callback for every (really) corrected element ; returns the id of the element
+ if (!options.forms[id].disabled) self._trigger("onValid", null, id);
+ } else {
+ if (options.forms[id]["errors"][rule] == "new" || options.forms[id]["errors"][rule] == "old") {
+ if (options.errorSummery) msgs += ' '+options.forms[id].msg[rule]+" \n";
+ // there are errors to show
+ hasError = failure = true;
+ // execute callback for every element with wrong input; returns the ids of the elements
+ self._trigger("onError", null, id);
+ }
+ if (options.forms[id]["errors"][rule] == "new") {
+ // ARIA: new error added
+ addError = true;
+ }
+ }
+ }
+
+ // check at least if there is an error so error class wont be removed
+ if (failure) {
+ target.attr("aria-invalid", true);
+ // check for radio group or checkbox group
+ if (options.forms[id].type == "group") target = target.next();
+ // highlight error field
+ target.addClass("ui-state-error");
+ }
+ }
+
+ // show error summery if enabled or only when form is submitted
+ if (options.errorSummery === true || (options.errorSummery == "onSubmit" && submitted)) self._showErrors({submitted: submitted, hasError: hasError, addError: addError, removeError: removeError, msgs: msgs});
+
+ // no click events if no error is defined
+ if (hasError) {
+ // Callback fired when error exists
+ self._trigger("onErrors", 0);
+ // send data if no errors found
+ } else if(submitted) {
+ self._sendForm();
+ }
+
+ self._updateVirtualBuffer();
+ },
+
+ // called when forms are validated | write errorsArray to DOM | Take care of ARIA
+ _showErrors: function(data){
+ var options = this.options,
+ // take care of ARIA
+ aria = ' aria-live="assertive"';
+
+ if (data["addError"] || data["removeError"]) aria += ' aria-relevant="text';
+ if (data["addError"]) aria += ' additions';
+ if (data["removeError"]) aria += ' removals';
+ if (data["addError"] || data["removeError"]) aria += '"';
+
+ // build up HTML | no content if no error is found
+ if (data["hasError"]) {
+ var html = "\n";
+ html += ' '+"\n";
+ html += '
'+"\n";
+ html += ' '+"\n";
+ html += ' '+options.errorsTitle+"\n";
+ html += '
'+"\n";
+ html += '
'+"\n";
+ html += data["msgs"];
+ html += ' '+"\n";
+ html += '
'+"\n\t\t";
+ // inject error HTML and make onclick event for direct error correction
+ this.errorElement.html(html);
+ // focus error box when form is submitted
+ if (data["submitted"]) this.errorElement.attr("tabindex",-1).focus();
+ } else {
+ this.errorElement.empty();
+ }
+
+ // Callback
+ this._trigger("onShowErrors", 0);
+ },
+
+ // send form
+ _sendForm: function() {
+ var options = this.options, self = this;
+
+ // TODO remove submitHowTo as its legacy support
+ if (options.submitHowTo == "post" || !$.fn.ajaxSubmit) {
+ // prevents revalidating but activates native form event
+ options.disabled = true;
+ // fire native form event
+ self.element.submit();
+ } else {
+ self.element.ajaxSubmit( $.extend( {}, {
+ // TODO remove this as its legacy support
+ iframe: (options.submitHowTo == "iframe") ? true : null,
+ // TODO remove this as its legacy support
+ url: options.submitUrl,
+ error: function(msg) {
+ self._showSuccess(msg);
+ },
+ success: function(msg) {
+ self._showSuccess(msg);
+ }
+ }, options.submitOptions ));
+ }
+ },
+
+ // called when form is submitted
+ _showSuccess: function(value) {
+ var options = this.options,
+ msg = "",
+ icon = "check";
+ // reenable the widget
+ options.disabled = false;
+
+ // fix for safari bug
+ if (jQuery.browser.safari) this.element.find(".ui-formular-success").remove();
+
+ // chose icon to show | choose message
+ switch (value) {
+ case "true":
+ case "1":
+ msg = options.submitSuccess;
+ icon = "check";
+ break;
+ default:
+ if (value == "") {
+ msg = options.submitError;
+ icon = "alert";
+ } else {
+ msg = value;
+ }
+ break;
+ }
+
+ //build up HTML
+ var html = "\n";
+ html += ' '+"\n\t\t";
+ this.element.prepend(html);
+ this.element.find(".ui-formular-success").attr("tabindex",-1).focus();
+ this._updateVirtualBuffer();
+ // Callback
+ this._trigger("onShowSuccess", null, value);
+ },
+
+ // decides if error is new, old or corrected
+ _whichError: function(error, array) {
+ var value = "";
+ if (!error) {
+ value = (array == "new" || array == "old") ? "old" : "new";
+ } else if (array == "new" || array == "old" ) {
+ value = "corrected";
+ }
+ return value;
+ },
+
+ // how many checked / selected options | which value
+ _getValue: function(id) {
+ var options = this.options,
+ value = "";
+
+ switch(options.forms[id].type) {
+ case "single":
+ value = options.forms[id].element.val();
+ break;
+ case "group":
+ var result = options.forms[id].element.filter(':checked');
+ if (result.length) value = result;
+ break;
+ case "select":
+ var result = options.forms[id].element.children("option").filter(':selected');
+ // check if we could select multiple elements
+ if (options.forms[id].element.attr("multiple")) {
+ value = result;
+ } else {
+ // if not multiple items selected, there could be a default option
+ value = (result.val() == options.selectDefault) ? 0 : result.val();
+ }
+ break;
+ }
+ return value;
+ },
+
+ // make hover and focus effects
+ _makeHover: function(element) {
+ element.bind("mouseenter", function(){ $(this).addClass('ui-state-hover'); })
+ .bind("mouseleave", function(){ $(this).removeClass('ui-state-hover'); })
+ .bind("focus", function(){ $(this).addClass('ui-state-focus'); })
+ .bind("blur", function(){ $(this).removeClass('ui-state-focus'); });
+ },
+
+ // Validators (return true when correct)
+ _regEx: function(elementValue, pattern) {
+ pattern = new RegExp(pattern);
+ return pattern.test(elementValue);
+ },
+ _number: function(elementValue) {
+ return /^\d+$/.test(elementValue);
+ },
+ _numberDE: function(elementValue) {
+ return /^[-+]?([0-9]*\,)?[0-9]+$/.test(elementValue);
+ },
+ _numberISO: function(elementValue) {
+ return /^[-+]?([0-9]*\.)?[0-9]+$/.test(elementValue);
+ },
+ _email: function(elementValue) {
+ return /^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/.test(elementValue);
+ },
+ _url: function(elementValue) {
+ return /^(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(elementValue);
+ },
+ _plz: function(elementValue) {
+ return /^\b((?:0[1-46-9]\d{3})|(?:[1-357-9]\d{4})|(?:[4][0-24-9]\d{3})|(?:[6][013-9]\d{3}))\b$/.test(elementValue);
+ },
+ _dateDE: function(elementValue) {
+ return /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(elementValue);
+ },
+ _dateISO: function(elementValue) {
+ return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(elementValue);
+ },
+ _lengthMin: function(elementValue, ruleValue) {
+ return (elementValue.length >= ruleValue) ? true : false;
+ },
+ _lengthMax: function(elementValue, ruleValue) {
+ return (elementValue.length <= ruleValue) ? true : false;
+ },
+ _equalTo: function(elementValue, ruleValue) {
+ return (elementValue == $("#"+ruleValue).val()) ? true : false;
+ },
+ _captcha: function(elementValue, ruleValue) {
+ return this._trigger("checkCaptcha", null, elementValue);
+ },
+
+ // removes instance and attributes
+ destroy: function() {
+ var options = this.options;
+ // go trougfh every form element
+ $.each(options.forms, function(id){
+ options.forms[id].element
+ .removeClass("ui-state-error")
+ .removeClass("ui-state-hover")
+ .removeAttr("aria-invalid")
+ .removeAttr("aria-required")
+ // remove events
+ .unbind();
+ if (options.forms[id].type == "group") {
+ options.forms[id].element.next()
+ .removeClass("ui-state-error")
+ .removeClass("ui-state-hover")
+ .removeAttr("aria-invalid")
+ .removeAttr("aria-required")
+ // remove events
+ .unbind();
+ }
+ });
+ this.element
+ // remove events
+ .unbind(".formValidator")
+ .unbind("submit")
+ // remove data
+ .removeData('formValidator');
+
+ // set original action url if changed
+ if (options.originalUrl != "") this.element.attr("action", options.originalUrl);
+ // remove injected elements
+ this.element.find(".ui-formular-live, .ui-formular-error, .ui-formular-success").remove();
+ $("body>form #virtualBufferForm").parent().remove();
+ // call widget destroy function
+ $.Widget.prototype.destroy.apply(this, arguments);
+ },
+
+ // updates virtual buffer | for older screenreader
+ _updateVirtualBuffer: function() {
+ var form = $("body>form #virtualBufferForm");
+ if(form.length) {
+ (form.val() == "1") ? form.val("0") : form.val("1");
+ } else {
+ var html = ' ';
+ $("body").append(html);
+ }
+ }
+});
+})(jQuery);
\ No newline at end of file
diff --git a/Form/multiple.html b/Form/multiple.html
new file mode 100644
index 0000000..e8ba58d
--- /dev/null
+++ b/Form/multiple.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+
+ ui.formValidator - multiple demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - multiple demo - ui.formValidator
+
+
+
+
+
diff --git a/Form/server.php b/Form/server.php
new file mode 100644
index 0000000..784d8e5
--- /dev/null
+++ b/Form/server.php
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/Form/set-rules.html b/Form/set-rules.html
new file mode 100644
index 0000000..0102e6a
--- /dev/null
+++ b/Form/set-rules.html
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+ ui.formValidator - standard demo - jQuery UI - Felix Nagel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - change rules demo - ui.formValidator
+
+
+
+
+
diff --git a/Formular/css/style_ie.css b/Formular/css/style_ie.css
deleted file mode 100644
index 25c57a6..0000000
--- a/Formular/css/style_ie.css
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Form Styling
-----------------------------------*/
-fieldset {
- margin: 0 0 2em 0;
-}
-legend {
- margin: -1.5em 0 1em 0;
-}
-.pair input {
- margin: -0.05em 0.5em 0 0.1em;
-}
diff --git a/Formular/css/ui-lightness/images/Thumbs.db b/Formular/css/ui-lightness/images/Thumbs.db
deleted file mode 100644
index 34dcd4a..0000000
Binary files a/Formular/css/ui-lightness/images/Thumbs.db and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/Formular/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
deleted file mode 100644
index 954e22d..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/Formular/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
deleted file mode 100644
index 64ece57..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/Formular/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
deleted file mode 100644
index abdc010..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/Formular/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
deleted file mode 100644
index 9b383f4..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/Formular/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
deleted file mode 100644
index a23baad..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/Formular/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
deleted file mode 100644
index 1b1972b..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/Formular/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
deleted file mode 100644
index f127367..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/Formular/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
deleted file mode 100644
index 359397a..0000000
Binary files a/Formular/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-icons_222222_256x240.png b/Formular/css/ui-lightness/images/ui-icons_222222_256x240.png
deleted file mode 100644
index 67560da..0000000
Binary files a/Formular/css/ui-lightness/images/ui-icons_222222_256x240.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/Formular/css/ui-lightness/images/ui-icons_228ef1_256x240.png
deleted file mode 100644
index 7c09067..0000000
Binary files a/Formular/css/ui-lightness/images/ui-icons_228ef1_256x240.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/Formular/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
deleted file mode 100644
index 41cb97c..0000000
Binary files a/Formular/css/ui-lightness/images/ui-icons_ef8c08_256x240.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/Formular/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
deleted file mode 100644
index 3d12259..0000000
Binary files a/Formular/css/ui-lightness/images/ui-icons_ffd27a_256x240.png and /dev/null differ
diff --git a/Formular/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/Formular/css/ui-lightness/images/ui-icons_ffffff_256x240.png
deleted file mode 100644
index 746e6fa..0000000
Binary files a/Formular/css/ui-lightness/images/ui-icons_ffffff_256x240.png and /dev/null differ
diff --git a/Formular/formValidator.pdf b/Formular/formValidator.pdf
deleted file mode 100644
index 31fcf8b..0000000
Binary files a/Formular/formValidator.pdf and /dev/null differ
diff --git a/Formular/index.html b/Formular/index.html
deleted file mode 100644
index 410e156..0000000
--- a/Formular/index.html
+++ /dev/null
@@ -1,248 +0,0 @@
-
-
-
-
-
-
- ui.formValidator - jQuery UI
-
-
-
-
-
-jQuery UI - ui.formValidator
-
-
-
-
-
-
-
-
-
-
diff --git a/Formular/js/jquery.js b/Formular/js/jquery.js
deleted file mode 100644
index 81a7128..0000000
--- a/Formular/js/jquery.js
+++ /dev/null
@@ -1,4241 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.3
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009)
- * Revision: 6104
- */
-(function(){
-
-var
- // Will speed up references to window, and allows munging its name.
- window = this,
- // Will speed up references to undefined, and allows munging its name.
- undefined,
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- jQuery = window.jQuery = window.$ = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context );
- },
-
- // A simple way to check for HTML strings or ID strings
- // (both of which we optimize for)
- quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/;
-
-jQuery.fn = jQuery.prototype = {
- init: function( selector, context ) {
- // Make sure that a selection was provided
- selector = selector || document;
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this[0] = selector;
- this.length = 1;
- this.context = selector;
- return this;
- }
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- var match = quickExpr.exec( selector );
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] )
- selector = jQuery.clean( [ match[1] ], context );
-
- // HANDLE: $("#id")
- else {
- var elem = document.getElementById( match[3] );
-
- // Make sure an element was located
- if ( elem ){
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id != match[3] )
- return jQuery().find( selector );
-
- // Otherwise, we inject the element directly into the jQuery object
- var ret = jQuery( elem );
- ret.context = document;
- ret.selector = selector;
- return ret;
- }
- selector = [];
- }
-
- // HANDLE: $(expr, [context])
- // (which is just equivalent to: $(content).find(expr)
- } else
- return jQuery( context ).find( selector );
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) )
- return jQuery( document ).ready( selector );
-
- // Make sure that old selector state is passed along
- if ( selector.selector && selector.context ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return this.setArray(jQuery.makeArray(selector));
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.3",
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num === undefined ?
-
- // Return a 'clean' array
- jQuery.makeArray( this ) :
-
- // Return just the object
- this[ num ];
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = jQuery( elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" )
- ret.selector = this.selector + (this.selector ? " " : "") + selector;
- else if ( name )
- ret.selector = this.selector + "." + name + "(" + selector + ")";
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Force the current matched set of elements to become
- // the specified array of elements (destroying the stack in the process)
- // You should use pushStack() in order to do this, but maintain the stack
- setArray: function( elems ) {
- // Resetting the length to 0, then using the native Array push
- // is a super-fast way to populate an object with array-like properties
- this.length = 0;
- Array.prototype.push.apply( this, elems );
-
- return this;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem && elem.jquery ? elem[0] : elem
- , this );
- },
-
- attr: function( name, value, type ) {
- var options = name;
-
- // Look for the case where we're accessing a style value
- if ( typeof name === "string" )
- if ( value === undefined )
- return this[0] && jQuery[ type || "attr" ]( this[0], name );
-
- else {
- options = {};
- options[ name ] = value;
- }
-
- // Check to see if we're setting style values
- return this.each(function(i){
- // Set all the styles
- for ( name in options )
- jQuery.attr(
- type ?
- this.style :
- this,
- name, jQuery.prop( this, options[ name ], type, i, name )
- );
- });
- },
-
- css: function( key, value ) {
- // ignore negative width and height values
- if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
- value = undefined;
- return this.attr( key, value, "curCSS" );
- },
-
- text: function( text ) {
- if ( typeof text !== "object" && text != null )
- return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
-
- var ret = "";
-
- jQuery.each( text || this, function(){
- jQuery.each( this.childNodes, function(){
- if ( this.nodeType != 8 )
- ret += this.nodeType != 1 ?
- this.nodeValue :
- jQuery.fn.text( [ this ] );
- });
- });
-
- return ret;
- },
-
- wrapAll: function( html ) {
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).clone();
-
- if ( this[0].parentNode )
- wrap.insertBefore( this[0] );
-
- wrap.map(function(){
- var elem = this;
-
- while ( elem.firstChild )
- elem = elem.firstChild;
-
- return elem;
- }).append(this);
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- return this.each(function(){
- jQuery( this ).contents().wrapAll( html );
- });
- },
-
- wrap: function( html ) {
- return this.each(function(){
- jQuery( this ).wrapAll( html );
- });
- },
-
- append: function() {
- return this.domManip(arguments, true, function(elem){
- if (this.nodeType == 1)
- this.appendChild( elem );
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function(elem){
- if (this.nodeType == 1)
- this.insertBefore( elem, this.firstChild );
- });
- },
-
- before: function() {
- return this.domManip(arguments, false, function(elem){
- this.parentNode.insertBefore( elem, this );
- });
- },
-
- after: function() {
- return this.domManip(arguments, false, function(elem){
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- },
-
- end: function() {
- return this.prevObject || jQuery( [] );
- },
-
- // For internal use only.
- // Behaves like an Array's .push method, not like a jQuery method.
- push: [].push,
-
- find: function( selector ) {
- if ( this.length === 1 && !/,/.test(selector) ) {
- var ret = this.pushStack( [], "find", selector );
- ret.length = 0;
- jQuery.find( selector, this[0], ret );
- return ret;
- } else {
- var elems = jQuery.map(this, function(elem){
- return jQuery.find( selector, elem );
- });
-
- return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
- jQuery.unique( elems ) :
- elems, "find", selector );
- }
- },
-
- clone: function( events ) {
- // Do the clone
- var ret = this.map(function(){
- if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
- // IE copies events bound via attachEvent when
- // using cloneNode. Calling detachEvent on the
- // clone will also remove the events from the orignal
- // In order to get around this, we use innerHTML.
- // Unfortunately, this means some modifications to
- // attributes in IE that are actually only stored
- // as properties will not be copied (such as the
- // the name attribute on an input).
- var clone = this.cloneNode(true),
- container = document.createElement("div");
- container.appendChild(clone);
- return jQuery.clean([container.innerHTML])[0];
- } else
- return this.cloneNode(true);
- });
-
- // Need to set the expando to null on the cloned set if it exists
- // removeData doesn't work here, IE removes it from the original as well
- // this is primarily for IE but the data expando shouldn't be copied over in any browser
- var clone = ret.find("*").andSelf().each(function(){
- if ( this[ expando ] !== undefined )
- this[ expando ] = null;
- });
-
- // Copy the events from the original to the clone
- if ( events === true )
- this.find("*").andSelf().each(function(i){
- if (this.nodeType == 3)
- return;
- var events = jQuery.data( this, "events" );
-
- for ( var type in events )
- for ( var handler in events[ type ] )
- jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
- });
-
- // Return the cloned set
- return ret;
- },
-
- filter: function( selector ) {
- return this.pushStack(
- jQuery.isFunction( selector ) &&
- jQuery.grep(this, function(elem, i){
- return selector.call( elem, i );
- }) ||
-
- jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
- return elem.nodeType === 1;
- }) ), "filter", selector );
- },
-
- closest: function( selector ) {
- var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null;
-
- return this.map(function(){
- var cur = this;
- while ( cur && cur.ownerDocument ) {
- if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) )
- return cur;
- cur = cur.parentNode;
- }
- });
- },
-
- not: function( selector ) {
- if ( typeof selector === "string" )
- // test special case where just one selector is passed in
- if ( isSimple.test( selector ) )
- return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
- else
- selector = jQuery.multiFilter( selector, this );
-
- var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
- return this.filter(function() {
- return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
- });
- },
-
- add: function( selector ) {
- return this.pushStack( jQuery.unique( jQuery.merge(
- this.get(),
- typeof selector === "string" ?
- jQuery( selector ) :
- jQuery.makeArray( selector )
- )));
- },
-
- is: function( selector ) {
- return !!selector && jQuery.multiFilter( selector, this ).length > 0;
- },
-
- hasClass: function( selector ) {
- return !!selector && this.is( "." + selector );
- },
-
- val: function( value ) {
- if ( value === undefined ) {
- var elem = this[0];
-
- if ( elem ) {
- if( jQuery.nodeName( elem, 'option' ) )
- return (elem.attributes.value || {}).specified ? elem.value : elem.text;
-
- // We need to handle select boxes special
- if ( jQuery.nodeName( elem, "select" ) ) {
- var index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type == "select-one";
-
- // Nothing was selected
- if ( index < 0 )
- return null;
-
- // Loop through all the selected options
- for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
- var option = options[ i ];
-
- if ( option.selected ) {
- // Get the specifc value for the option
- value = jQuery(option).val();
-
- // We don't need an array for one selects
- if ( one )
- return value;
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- }
-
- // Everything else, we just grab the value
- return (elem.value || "").replace(/\r/g, "");
-
- }
-
- return undefined;
- }
-
- if ( typeof value === "number" )
- value += '';
-
- return this.each(function(){
- if ( this.nodeType != 1 )
- return;
-
- if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
- this.checked = (jQuery.inArray(this.value, value) >= 0 ||
- jQuery.inArray(this.name, value) >= 0);
-
- else if ( jQuery.nodeName( this, "select" ) ) {
- var values = jQuery.makeArray(value);
-
- jQuery( "option", this ).each(function(){
- this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
- jQuery.inArray( this.text, values ) >= 0);
- });
-
- if ( !values.length )
- this.selectedIndex = -1;
-
- } else
- this.value = value;
- });
- },
-
- html: function( value ) {
- return value === undefined ?
- (this[0] ?
- this[0].innerHTML :
- null) :
- this.empty().append( value );
- },
-
- replaceWith: function( value ) {
- return this.after( value ).remove();
- },
-
- eq: function( i ) {
- return this.slice( i, +i + 1 );
- },
-
- slice: function() {
- return this.pushStack( Array.prototype.slice.apply( this, arguments ),
- "slice", Array.prototype.slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function(elem, i){
- return callback.call( elem, i, elem );
- }));
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- },
-
- domManip: function( args, table, callback ) {
- if ( this[0] ) {
- var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
- scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
- first = fragment.firstChild,
- extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
-
- if ( first )
- for ( var i = 0, l = this.length; i < l; i++ )
- callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );
-
- if ( scripts )
- jQuery.each( scripts, evalScript );
- }
-
- return this;
-
- function root( elem, cur ) {
- return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
- }
- }
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-function evalScript( i, elem ) {
- if ( elem.src )
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
-
- else
- jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-
- if ( elem.parentNode )
- elem.parentNode.removeChild( elem );
-}
-
-function now(){
- return +new Date;
-}
-
-jQuery.extend = jQuery.fn.extend = function() {
- // copy reference to target object
- var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) )
- target = {};
-
- // extend jQuery itself if only one argument is passed
- if ( length == i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ )
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null )
- // Extend the base object
- for ( var name in options ) {
- var src = target[ name ], copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy )
- continue;
-
- // Recurse if we're merging object values
- if ( deep && copy && typeof copy === "object" && !copy.nodeType )
- target[ name ] = jQuery.extend( deep,
- // Never move original objects, clone them
- src || ( copy.length != null ? [ ] : { } )
- , copy );
-
- // Don't bring in undefined values
- else if ( copy !== undefined )
- target[ name ] = copy;
-
- }
-
- // Return the modified object
- return target;
-};
-
-// exclude the following css properties to add px
-var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
- // cache defaultView
- defaultView = document.defaultView || {},
- toString = Object.prototype.toString;
-
-jQuery.extend({
- noConflict: function( deep ) {
- window.$ = _$;
-
- if ( deep )
- window.jQuery = _jQuery;
-
- return jQuery;
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return toString.call(obj) === "[object Function]";
- },
-
- isArray: function( obj ) {
- return toString.call(obj) === "[object Array]";
- },
-
- // check if an element is in a (or is an) XML document
- isXMLDoc: function( elem ) {
- return elem.documentElement && !elem.body ||
- elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
- },
-
- // Evalulates a script in a global context
- globalEval: function( data ) {
- data = jQuery.trim( data );
-
- if ( data ) {
- // Inspired by code by Andrea Giammarchi
- // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
- var head = document.getElementsByTagName("head")[0] || document.documentElement,
- script = document.createElement("script");
-
- script.type = "text/javascript";
- if ( jQuery.support.scriptEval )
- script.appendChild( document.createTextNode( data ) );
- else
- script.text = data;
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709).
- head.insertBefore( script, head.firstChild );
- head.removeChild( script );
- }
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0, length = object.length;
-
- if ( args ) {
- if ( length === undefined ) {
- for ( name in object )
- if ( callback.apply( object[ name ], args ) === false )
- break;
- } else
- for ( ; i < length; )
- if ( callback.apply( object[ i++ ], args ) === false )
- break;
-
- // A special, fast, case for the most common use of each
- } else {
- if ( length === undefined ) {
- for ( name in object )
- if ( callback.call( object[ name ], name, object[ name ] ) === false )
- break;
- } else
- for ( var value = object[0];
- i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
- }
-
- return object;
- },
-
- prop: function( elem, value, type, i, name ) {
- // Handle executable functions
- if ( jQuery.isFunction( value ) )
- value = value.call( elem, i );
-
- // Handle passing in a number to a CSS property
- return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
- value + "px" :
- value;
- },
-
- className: {
- // internal only, use addClass("class")
- add: function( elem, classNames ) {
- jQuery.each((classNames || "").split(/\s+/), function(i, className){
- if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
- elem.className += (elem.className ? " " : "") + className;
- });
- },
-
- // internal only, use removeClass("class")
- remove: function( elem, classNames ) {
- if (elem.nodeType == 1)
- elem.className = classNames !== undefined ?
- jQuery.grep(elem.className.split(/\s+/), function(className){
- return !jQuery.className.has( classNames, className );
- }).join(" ") :
- "";
- },
-
- // internal only, use hasClass("class")
- has: function( elem, className ) {
- return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
- }
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {};
- // Remember the old values, and insert the new ones
- for ( var name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- callback.call( elem );
-
- // Revert the old values
- for ( var name in options )
- elem.style[ name ] = old[ name ];
- },
-
- css: function( elem, name, force ) {
- if ( name == "width" || name == "height" ) {
- var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
-
- function getWH() {
- val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
- var padding = 0, border = 0;
- jQuery.each( which, function() {
- padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
- border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
- });
- val -= Math.round(padding + border);
- }
-
- if ( jQuery(elem).is(":visible") )
- getWH();
- else
- jQuery.swap( elem, props, getWH );
-
- return Math.max(0, val);
- }
-
- return jQuery.curCSS( elem, name, force );
- },
-
- curCSS: function( elem, name, force ) {
- var ret, style = elem.style;
-
- // We need to handle opacity special in IE
- if ( name == "opacity" && !jQuery.support.opacity ) {
- ret = jQuery.attr( style, "opacity" );
-
- return ret == "" ?
- "1" :
- ret;
- }
-
- // Make sure we're using the right name for getting the float value
- if ( name.match( /float/i ) )
- name = styleFloat;
-
- if ( !force && style && style[ name ] )
- ret = style[ name ];
-
- else if ( defaultView.getComputedStyle ) {
-
- // Only "float" is needed here
- if ( name.match( /float/i ) )
- name = "float";
-
- name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
-
- var computedStyle = defaultView.getComputedStyle( elem, null );
-
- if ( computedStyle )
- ret = computedStyle.getPropertyValue( name );
-
- // We should always get a number back from opacity
- if ( name == "opacity" && ret == "" )
- ret = "1";
-
- } else if ( elem.currentStyle ) {
- var camelCase = name.replace(/\-(\w)/g, function(all, letter){
- return letter.toUpperCase();
- });
-
- ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
- // Remember the original values
- var left = style.left, rsLeft = elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- elem.runtimeStyle.left = elem.currentStyle.left;
- style.left = ret || 0;
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret;
- },
-
- clean: function( elems, context, fragment ) {
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" )
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
- var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
- if ( match )
- return [ context.createElement( match[1] ) ];
- }
-
- var ret = [], scripts = [], div = context.createElement("div");
-
- jQuery.each(elems, function(i, elem){
- if ( typeof elem === "number" )
- elem += '';
-
- if ( !elem )
- return;
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" ) {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
- return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
- all :
- front + ">" + tag + ">";
- });
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tags = jQuery.trim( elem ).toLowerCase();
-
- var wrap =
- // option or optgroup
- !tags.indexOf("", "" ] ||
-
- !tags.indexOf("", "" ] ||
-
- tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
- [ 1, "" ] ||
-
- !tags.indexOf("", " " ] ||
-
- // matched above
- (!tags.indexOf(" ", " " ] ||
-
- !tags.indexOf("", " " ] ||
-
- // IE can't serialize and
+
+
+
+
+
+
+
+
+
+
+
+jQuery UI - Gallery Demo with History support via jQuery Adress- ui.ariaLightbox
+
+
+
+