From b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Thu, 13 Aug 2009 17:46:09 -0400 Subject: Rewrote Admin panel The following database changes must be made: * A TEXT column called "text" must be added to the end of "polloftheweek" * The transferPollRss.php script must be run * The "pollrss" table must be dropped Closes #113 --- theme/admin/js/uni-form.jquery.js | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 theme/admin/js/uni-form.jquery.js (limited to 'theme/admin/js/uni-form.jquery.js') diff --git a/theme/admin/js/uni-form.jquery.js b/theme/admin/js/uni-form.jquery.js new file mode 100755 index 0000000..9786dde --- /dev/null +++ b/theme/admin/js/uni-form.jquery.js @@ -0,0 +1,41 @@ +jQuery.fn.uniform = function(settings) { + settings = jQuery.extend({ + valid_class : 'valid', + invalid_class : 'invalid', + focused_class : 'focused', + holder_class : 'ctrlHolder', + field_selector : 'input, select, textarea' + }, settings); + + return this.each(function() { + var form = jQuery(this); + + // Focus specific control holder + var focusControlHolder = function(element) { + var parent = element.parent(); + + while(typeof(parent) == 'object') { + if(parent) { + if(parent[0] && (parent[0].className.indexOf(settings.holder_class) >= 0)) { + parent.addClass(settings.focused_class); + return; + } // if + } // if + parent = jQuery(parent.parent()); + } // while + }; + + // Select form fields and attach them higlighter functionality + form.find(settings.field_selector).focus(function() { + form.find('.' + settings.focused_class).removeClass(settings.focused_class); + focusControlHolder(jQuery(this)); + }).blur(function() { + form.find('.' + settings.focused_class).removeClass(settings.focused_class); + }); + }); +}; + +// Auto set on page load... +$(document).ready(function() { + jQuery('form.uniForm').uniform(); +}); \ No newline at end of file -- cgit 1.4.1