var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); /* * jNice * version: 1.0 (11.26.08) * by Sean Mooney (sean@whitespace-creative.com) * Examples at: http://www.whitespace-creative.com/jquery/jnice/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * To Use: place in the head * * * * And apply the jNice class to the form you want to style * * To Do: Add textareas, Add File upload * ******************************************** */ (function($){ $.fn.jNice = function(options){ var self = this; var safari = $.browser.safari; /* We need to check for safari to fix the input:text problem */ /* Apply document listener */ $(document).mousedown(checkExternalClick); /* each form */ return this.each(function(){ $('input:submit, input:reset, input:button', this).each(ButtonAdd); $('button').focus(function(){ $(this).addClass('jNiceFocus')}).blur(function(){ $(this).removeClass('jNiceFocus')}); $('input:text:visible, input:password', this).each(TextAdd); /* If this is safari we need to add an extra class */ if (safari){$('.jNiceInputWrapper').each(function(){$(this).addClass('jNiceSafari').find('input').css('width', $(this).width()+11);});} $('input:checkbox', this).each(CheckAdd); $('input:radio', this).each(RadioAdd); $('select', this).each(function(index){ SelectAdd(this, index); }); /* Add a new handler for the reset action */ $(this).bind('reset',function(){var action = function(){ Reset(this); }; window.setTimeout(action, 10); }); $('.jNiceHidden').css({opacity:0}); }); };/* End the Plugin */ var Reset = function(form){ var sel; $('.jNiceSelectWrapper select', form).each(function(){sel = (this.selectedIndex<0) ? 0 : this.selectedIndex; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});}); $('a.jNiceCheckbox, a.jNiceRadio', form).removeClass('jNiceChecked'); $('input:checkbox, input:radio', form).each(function(){if(this.checked){$('a', $(this).parent()).addClass('jNiceChecked');}}); }; var RadioAdd = function(){ var $input = $(this).addClass('jNiceHidden').wrap(''); var $wrapper = $input.parent(); var $a = $(''); $wrapper.prepend($a); /* Click Handler */ $a.click(function(){ var tid = $(this).parents('li').attr('class'); var lang = $(this).parents('li').find('label').attr('class'); initSort(tid,lang); var $input = $(this).addClass('jNiceChecked').siblings('input').attr('checked',true); /* uncheck all others of same name */ $('input:radio[name="'+ $input.attr('name') +'"]').not($input).each(function(){ $(this).attr('checked',false).siblings('.jNiceRadio').removeClass('jNiceChecked'); }); return false; }); $input.click(function(){ if(this.checked){ var $input = $(this).siblings('.jNiceRadio').addClass('jNiceChecked').end(); /* uncheck all others of same name */ $('input:radio[name="'+ $input.attr('name') +'"]').not($input).each(function(){ $(this).attr('checked',false).siblings('.jNiceRadio').removeClass('jNiceChecked'); }); } }).focus(function(){ $a.addClass('jNiceFocus'); }).blur(function(){ $a.removeClass('jNiceFocus'); }); /* set the default state */ if (this.checked){ $a.addClass('jNiceChecked'); } }; var CheckAdd = function(){ var $input = $(this).addClass('jNiceHidden').wrap(''); var $wrapper = $input.parent().append(''); /* Click Handler */ var $a = $wrapper.find('.jNiceCheckbox').click(function(){ var $a = $(this); var input = $a.siblings('input')[0]; if (input.checked===true){ input.checked = false; $a.removeClass('jNiceChecked'); } else { input.checked = true; $a.addClass('jNiceChecked'); } return false; }); $input.click(function(){ if(this.checked){ $a.addClass('jNiceChecked'); } else { $a.removeClass('jNiceChecked'); } }).focus(function(){ $a.addClass('jNiceFocus'); }).blur(function(){ $a.removeClass('jNiceFocus'); }); /* set the default state */ if (this.checked){$('.jNiceCheckbox', $wrapper).addClass('jNiceChecked');} }; var TextAdd = function(){ var $input = $(this).addClass('jNiceInput').wrap('
'); var $wrapper = $input.parents('.jNiceInputWrapper'); $input.focus(function(){ $wrapper.addClass('jNiceInputWrapper_hover'); }).blur(function(){ $wrapper.removeClass('jNiceInputWrapper_hover'); }); }; var ButtonAdd = function(){ var value = $(this).attr('value'); $(this).replaceWith('