/* * jQuery serializeObject Plugin: https://github.com/fojas/jQuery-serializeObject * */ !function($){ $.serializeObject = function(obj){ var o={},lookup=o,a = obj; $.each(a,function(){ var named = this.name.replace(/\[([^\]]+)?\]/g,',$1').split(','), cap = named.length - 1, i = 0; for(;i. The name of * the University may not be used to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ (function($) { $.fn.localize = function(locale) { this.find('*').contents().each(function() { var translated = false; var source = ''; if (typeof(this.data) == 'string') { source = $.trim(this.data); if (source && (translated = (locale.sub[source] || locale.top[source]))) { this.data = translated; } } if (this.nodeName == 'IMG' && this.attributes['src']) { source = this.attributes['src'].nodeValue; if (source && (translated = (locale.sub[source] || locale.top[source]))) { $(this).attr('src', translated); } } if (this.nodeName == "A" && this.attributes['href']) { source = $.trim(this.attributes['href'].nodeValue); if (source && (translated = (locale.sub[source] || locale.top[source]))) { $(this).attr('href', translated); } } if (this.nodeName == "INPUT" && this.attributes['type']) { if (this.attributes['value'] && ['submit', 'reset', 'button'].indexOf(this.attributes['type'].nodeValue.toLowerCase()) > -1) { source = $.trim(this.attributes['value'].nodeValue); if (source && (translated = (locale.sub[source] || locale.top[source]))) { $(this).attr('value', translated); } } } return this; }); }; })(jQuery);