Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Hiding the progress status on Firefox

  • Loading branch information...
commit f4794aa5472c45f14efe851d004ebec6f5970008 1 parent 0241fa0
@choptastic choptastic authored
Showing with 5 additions and 5 deletions.
  1. +4 −4 www/nitrogen.js
  2. +1 −1  www/nitrogen.min.js
View
8 www/nitrogen.js
@@ -322,10 +322,7 @@ NitrogenClass.prototype.$attach_upload_handle_dragdrop = function(form,input,set
var prog = parseInt(data.loaded / data.total * 100,10);
// TODO: Convert this to a progress bar
// Neede to add #progress{} element to continue with that
- if(data.loaded == data.total)
- jQuery(form).children(".upload_progress").fadeOut();
- else
- jQuery(form).children(".upload_progress").text(prog + "% (" + data.loaded + "/" + data.total + " bytes)");
+ jQuery(form).children(".upload_progress").text(prog + "% (" + data.loaded + "/" + data.total + " bytes)");
},
progress: function(e,data) {
// Single file progress
@@ -381,7 +378,10 @@ NitrogenClass.prototype.$increment_pending_upload_counter = function(form,increm
counter+=incrementer;
$(form).data("pending_uploads",counter);
if(counter==0)
+ {
+ jQuery(form).children(".upload_progress").fadeOut();
Nitrogen.$alert_unfinished_files(form);
+ }
}
View
2  www/nitrogen.min.js
@@ -1 +1 @@
-function NitrogenClass(a){this.$url=document.location.href;this.$div=document;this.$anchor_root_path=document;this.$params=new Object();this.$event_queue=new Array();this.$event_is_running=false;this.$system_event_queue=new Array();this.$system_event_is_running=false;this.$system_event_obj=null;this.$going_away=false;this.$live_validation_data_field="LV_live_validation";return this}NitrogenClass.prototype.$path_alias=function(a){if(a==="page"){return document}else{return a}};NitrogenClass.prototype.$anchor=function(a,b){this.$anchor_path=this.$path_alias(a);this.$target_path=this.$path_alias(b)};NitrogenClass.prototype.$anchor_root=function(a){this.$anchor_root_path=a};NitrogenClass.prototype.$set_param=function(a,b){this.$params[a]=b};NitrogenClass.prototype.$destroy=function(){document.comet_started=false;this.$going_away=true;this.$system_event_queue=new Array();if(this.$system_event_obj!==null){this.$system_event_obj.abort()}this.$system_event_is_running=false};NitrogenClass.prototype.$queue_event=function(d,c,b,a){this.$event_queue.push({validationGroup:d,eventContext:c,extraParam:b,ajaxSettings:a})};NitrogenClass.prototype.$queue_system_event=function(a){this.$system_event_queue.push({eventContext:a})};NitrogenClass.prototype.$event_loop=function(){var a=this;if(!this.$system_event_is_running&&this.$system_event_queue.length>0){var b=this.$system_event_queue.shift();this.$do_system_event(b.eventContext)}if(!this.$event_is_running&&this.$event_queue.length>0){var b=this.$event_queue.shift();this.$do_event(b.validationGroup,b.eventContext,b.extraParam,b.ajaxSettings)}if(this.$system_event_queue.length==0||this.$event_queue.length==0){if(this.$going_away){return}else{setTimeout(function(){a.$event_loop()},50);return}}if(this.$event_is_running||this.$system_event_is_running){setTimeout(function(){a.$event_loop()},10);return}setTimeout(function(){a.$event_loop()},1)};NitrogenClass.prototype.$validate_and_serialize=function(b){var a=true,c={},d=this;jQuery(":input").not(".no_postback").each(function(e){var f=Nitrogen.$get_validation(this);if(f&&f.group==b&&!f.validate()){a=false}else{if((this.type=="radio"||this.type=="checkbox")&&!this.checked){return}c[d.$make_id(this)]=this.value}});return a&&c||null};NitrogenClass.prototype.$add_validation=function(b,a){if($(b)){if(!$(b).data(Nitrogen.$live_validation_data_field)){$(b).data(Nitrogen.$live_validation_data_field,new LiveValidation(b,a))}return Nitrogen.$get_validation(b)}else{return null}};NitrogenClass.prototype.$get_validation=function(a){return $(a).data(Nitrogen.$live_validation_data_field)};NitrogenClass.prototype.$destroy_specific_validation=function(b,c){var a=NitrogenClass.$get_validation(c);if(a.group==b){Nitrogen.$destroy_target_validation(element)}};NitrogenClass.prototype.$destroy_target_validation=function(b){var a=Nitrogen.$get_validation(b);if(a){a.destroy();$(b).data(Nitrogen.$live_validation_data_field,null)}};NitrogenClass.prototype.$destroy_validation_group=function(a){jQuery(":input").not(".no_postback").each(function(b){var c=Nitrogen.$get_validation(this);if(c&&c.group==a){Nitrogen.$destroy_target_validation(this)}})};NitrogenClass.prototype.$destroy_all_validation=function(){$("*").each(function(){Nitrogen.$destroy_target_validation(this)})};NitrogenClass.prototype.$make_id=function(c){var b=[];var d=new RegExp(".wfid_(.[^\\s]*)","g");while(c&&c.className){var e=c.className.match(/wfid_([^\s])+/g);if(e){b.unshift.apply(b,e)}c=c.parentNode}return b.join(".")};NitrogenClass.prototype.$do_event=function(validationGroup,eventContext,extraParam,ajaxSettings){var n=this;var s=jQuery.extend({dataType:"text",cache:false,success:null,error:null},ajaxSettings);this.$event_is_running=true;var validationParams=this.$validate_and_serialize(validationGroup);if(validationParams==null){this.$event_is_running=false;return}var params=jQuery.extend({},n.$params,validationParams,{eventContext:eventContext});jQuery.ajax({url:this.$url,type:"post",data:[jQuery.param(params),extraParam||""].join("&"),dataType:s.dataType,cache:s.cache,success:function(data,textStatus){n.$event_is_running=false;typeof s.success=="function"&&s.success(data,textStatus)||eval(data)},error:function(xmlHttpRequest,textStatus,errorThrown){n.$event_is_running=false;typeof s.success=="function"&&s.error(xmlHttpRequest,textStatus,errorThrown)}})};NitrogenClass.prototype.$do_system_event=function(eventContext){var n=this;n.$system_event_is_running=true;var params=jQuery.extend({},n.$params,{eventContext:eventContext,is_system_event:1});n.$system_event_obj=$.ajax({url:this.$url,type:"post",data:jQuery.param(params),dataType:"text",cache:false,success:function(data,textStatus){n.$system_event_is_running=false;n.$system_event_obj=null;var pc=n.$params.pageContext;eval(data);n.$set_param("pageContext",pc)},error:function(xmlHttpRequest,textStatus,errorThrown){n.$system_event_is_running=false;n.$system_event_obj=null}})};NitrogenClass.prototype.$send_pending_files=function(c,a){var b=null;if(typeof(c.$nitrogen_pending_files)=="object"){while(b=c.$nitrogen_pending_files.shift()){b.submit()}}};NitrogenClass.prototype.$attach_upload_handle_dragdrop=function(d,a,c){var b=this;if(typeof(c)=="undefined"){c={}}if(typeof(d.$nitrogen_pending_files)=="undefined"){d.$nitrogen_pending_files=[]}jQuery.getScript("/nitrogen/jquery.fileupload.min.js",function(){var e=jQuery(d).children(".upload_drop");jQuery(a).fileupload({dropZone:(c.droppable?e:null),singleFileUploads:true,sequentialUploads:true,url:b.$url,paramName:"file",formData:function(){d.elements.pageContext.value=b.$params.pageContext;var f=jQuery(d).serializeArray();return f},start:function(f){d.pageContext.value=b.$params.pageContext;jQuery(d).children(".upload_progress").fadeIn().text("Uploading...")},progressall:function(h,f){var g=parseInt(f.loaded/f.total*100,10);if(f.loaded==f.total){jQuery(d).children(".upload_progress").fadeOut()}else{jQuery(d).children(".upload_progress").text(g+"% ("+f.loaded+"/"+f.total+" bytes)")}},progress:function(g,f){},send:function(g,f){},stop:function(g,f){},always:function(g,f){},fail:function(h,g,f){Nitrogen.$increment_pending_upload_counter(d,-1)},add:function(g,f){jQuery.each(f.files,function(h,j){jQuery(d).children(".upload_droplist").prepend(jQuery("<li></li>").attr("filename",j.name).text(j.name));Nitrogen.$increment_pending_upload_counter(d,1)});if(c.autoupload){f.submit()}else{d.$nitrogen_pending_files.push(f)}},done:function(h,g){if(typeof g.result=="string"){var f=g.result}else{if(typeof g.result=="object"){var f=g.result[0].body.innerHTML}else{var f=""}}jQuery.globalEval(f);Nitrogen.$increment_pending_upload_counter(d,-1)}})})};NitrogenClass.prototype.$increment_pending_upload_counter=function(b,c){var a=$(b).data("pending_uploads");if(typeof(a)=="undefined"){a=0}a+=c;$(b).data("pending_uploads",a);if(a==0){Nitrogen.$alert_unfinished_files(b)}};NitrogenClass.prototype.$upload_finished=function(a){jQuery(".upload_droplist").children('li[filename="'+a+'"]').css("text-decoration","line-through").addClass("upload_successful").fadeOut()};NitrogenClass.prototype.$alert_unfinished_files=function(c){var b=$(c).find(".upload_droplist li:not(.upload_successful):visible");if(b.length>0){$(c).find(".upload_droplist li:not(.upload_successful)").css("color","red").fadeOut("slow");var a=$(b).get().map(function(d){return $(d).text()}).join("\r\n");alert("There was an error uploading the following file(s):\r\n"+a+"\r\n\r\nThis is likely due to the file(s) being too large or a misconfiguration on the server")}};function obj(b,a){return objs(b,a).get(0)}function objs(j,b){j=jQuery.trim(j);if(!b){b=Nitrogen.$anchor_path}else{b=Nitrogen.$path_alias(b)}if(j.indexOf(",")!=-1){var k=j.split(",");var f=$();for(var d=0;d<k.length;d++){f=f.add(objs(k[d],b))}return f}if(j=="page"||j==".page"){return jQuery(document)}j=j.replace(/##/g,".wfid_");j=j.replace(/\bme\b/g,b);if(j.indexOf(" ")==-1&&j.indexOf(".")==-1&&j.indexOf("#")==-1){var c=objs(".wfid_"+j,b);if(c.length>0){return c}if(c.length==0&&jQuery.inArray(j.toLowerCase(),Nitrogen.$valid_elements)==-1){return jQuery()}}var h=new RegExp(/^body\b/);if(h.test(j)){return jQuery(j)}var g=jQuery(Nitrogen.$anchor_root_path).find(b);var c=g.find(j);if(c.length>0){return c}var c=g.parentsUntil(Nitrogen.$anchor_root_path);for(var d=0;d<c.length;d++){var e=jQuery(c.get(d)).find(j);if(e.length>0){return e}}return jQuery(j)}NitrogenClass.prototype.$valid_elements=["a","abbr","acronym","address","applet","area","b","base","basefont","bdo","big","blockquote","body","br","button","caption","center","cite","code","col","colgroup","dd","del","dfn","dir","div","dl","dt","em","fieldset","font","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","hr","html","i","iframe","img","input","ins","isindex","kbd","label","legend","li","link","map","menu","meta","noframes","noscript","object","ol","optgroup","option","p","param","pre","q","s","samp","script","select","small","span","strike","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","u","ul","var"];NitrogenClass.prototype.$observe_event=function(a,d,b,c){objs(d,a).bind(b,c)};NitrogenClass.prototype.$update=function(b,c,a){objs(c,b).html(a)};NitrogenClass.prototype.$replace=function(b,c,a){objs(c,b).replaceWith(a)};NitrogenClass.prototype.$insert_top=function(b,c,a){objs(c,b).prepend(a)};NitrogenClass.prototype.$insert_bottom=function(b,c,a){objs(c,b).append(a)};NitrogenClass.prototype.$insert_before=function(b,c,a){objs(c,b).before(a)};NitrogenClass.prototype.$insert_after=function(b,c,a){objs(c,b).after(a)};NitrogenClass.prototype.$remove=function(a,b){objs(b,a).remove()};NitrogenClass.prototype.$return_false=function(b,a){return false};NitrogenClass.prototype.$is_key_code=function(b,c,a){return(b&&b.keyCode==c&&b.shiftKey==a)};NitrogenClass.prototype.$go_next=function(a){var b=obj(a);if(b.focus){b.focus()}if(b.select){b.select()}if(b.click){b.click()}};NitrogenClass.prototype.$disable_selection=function(a){a.onselectstart=function(){return false};a.unselectable="on";a.style.MozUserSelect="none";a.style.cursor="default"};NitrogenClass.prototype.$set_value=function(b,a,c){if(!a.id){a=objs(a)}a.each(function(d,e){if(e.value!=undefined){e.value=c}else{if(e.checked!=undefined){e.checked=c}else{if(e.src!=undefined){e.src=c}else{$(e).html(c)}}}})};NitrogenClass.prototype.$get_value=function(b,a){if(!a.id){a=objs(a)}el=a.get(0);if(el.value!=undefined){return el.value}else{if(el.checked!=undefined){return el.checked}else{if(el.src!=undefined){return el.src}else{return $(el).html()}}}};NitrogenClass.prototype.$normalize_param=function(a,c){var b="";if(a){b=a}if(a&&c){b=a+"="+c}return a+"&"+c};NitrogenClass.prototype.$encode_arguments_object=function(d){if(!Bert){alert("Bert.js library not included in template.")}var b=new Array();for(var c=0;c<d.length;c++){b.push(d[c])}var e=Bert.encode(b);return"args="+this.$urlencode(e)};NitrogenClass.prototype.$urlencode=function(a){return escape(a).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40")};NitrogenClass.prototype.$datepicker=function(b,a){jQuery(b).datepicker(a)};NitrogenClass.prototype.$autocomplete=function(d,a,b,c){var e=this;jQuery.extend(a,{select:function(g,h){var f=(h.item)&&'{"id":"'+h.item.id+'","value":"'+h.item.value+'"}'||"";e.$queue_event(null,c,"select_item="+e.$urlencode(f))},source:function(g,f){e.$queue_event(null,b,"search_term="+g.term,{dataType:"json",success:function(h){f(h)}})}});jQuery(d).autocomplete(a)};NitrogenClass.prototype.$draggable=function(b,a,c){objs(b).each(function(d,e){e.$drag_tag=c;jQuery(e).draggable(a)})};NitrogenClass.prototype.$droppable=function(c,b,a){var d=this;b.drop=function(f,g){var e=g.draggable[0].$drag_tag;d.$queue_event(null,a,"drag_item="+e)};objs(c).each(function(e,f){jQuery(f).droppable(b)})};NitrogenClass.prototype.$sortitem=function(a,b){var c=obj(a);c.$sort_tag=b;c.$drag_tag=b};NitrogenClass.prototype.$sortblock=function(a,c,b){var d=this;c.update=function(){var e="";for(var g=0;g<this.childNodes.length;g++){var f=this.childNodes[g];if(e!=""){e+=","}if(f.$sort_tag){e+=f.$sort_tag}}d.$queue_event(null,b,"sort_items="+e)};objs(a).sortable(c)};NitrogenClass.prototype.$from_alien=function(a){var b=$("input#"+a).val();objs(a).val(b)};var Nitrogen=new NitrogenClass();var page=document;Nitrogen.$event_loop();
+function NitrogenClass(a){this.$url=document.location.href;this.$div=document;this.$anchor_root_path=document;this.$params=new Object();this.$event_queue=new Array();this.$event_is_running=false;this.$system_event_queue=new Array();this.$system_event_is_running=false;this.$system_event_obj=null;this.$going_away=false;this.$live_validation_data_field="LV_live_validation";return this}NitrogenClass.prototype.$path_alias=function(a){if(a==="page"){return document}else{return a}};NitrogenClass.prototype.$anchor=function(a,b){this.$anchor_path=this.$path_alias(a);this.$target_path=this.$path_alias(b)};NitrogenClass.prototype.$anchor_root=function(a){this.$anchor_root_path=a};NitrogenClass.prototype.$set_param=function(a,b){this.$params[a]=b};NitrogenClass.prototype.$destroy=function(){document.comet_started=false;this.$going_away=true;this.$system_event_queue=new Array();if(this.$system_event_obj!==null){this.$system_event_obj.abort()}this.$system_event_is_running=false};NitrogenClass.prototype.$queue_event=function(d,c,b,a){this.$event_queue.push({validationGroup:d,eventContext:c,extraParam:b,ajaxSettings:a})};NitrogenClass.prototype.$queue_system_event=function(a){this.$system_event_queue.push({eventContext:a})};NitrogenClass.prototype.$event_loop=function(){var a=this;if(!this.$system_event_is_running&&this.$system_event_queue.length>0){var b=this.$system_event_queue.shift();this.$do_system_event(b.eventContext)}if(!this.$event_is_running&&this.$event_queue.length>0){var b=this.$event_queue.shift();this.$do_event(b.validationGroup,b.eventContext,b.extraParam,b.ajaxSettings)}if(this.$system_event_queue.length==0||this.$event_queue.length==0){if(this.$going_away){return}else{setTimeout(function(){a.$event_loop()},50);return}}if(this.$event_is_running||this.$system_event_is_running){setTimeout(function(){a.$event_loop()},10);return}setTimeout(function(){a.$event_loop()},1)};NitrogenClass.prototype.$validate_and_serialize=function(b){var a=true,c={},d=this;jQuery(":input").not(".no_postback").each(function(e){var f=Nitrogen.$get_validation(this);if(f&&f.group==b&&!f.validate()){a=false}else{if((this.type=="radio"||this.type=="checkbox")&&!this.checked){return}c[d.$make_id(this)]=this.value}});return a&&c||null};NitrogenClass.prototype.$add_validation=function(b,a){if($(b)){if(!$(b).data(Nitrogen.$live_validation_data_field)){$(b).data(Nitrogen.$live_validation_data_field,new LiveValidation(b,a))}return Nitrogen.$get_validation(b)}else{return null}};NitrogenClass.prototype.$get_validation=function(a){return $(a).data(Nitrogen.$live_validation_data_field)};NitrogenClass.prototype.$destroy_specific_validation=function(b,c){var a=NitrogenClass.$get_validation(c);if(a.group==b){Nitrogen.$destroy_target_validation(element)}};NitrogenClass.prototype.$destroy_target_validation=function(b){var a=Nitrogen.$get_validation(b);if(a){a.destroy();$(b).data(Nitrogen.$live_validation_data_field,null)}};NitrogenClass.prototype.$destroy_validation_group=function(a){jQuery(":input").not(".no_postback").each(function(b){var c=Nitrogen.$get_validation(this);if(c&&c.group==a){Nitrogen.$destroy_target_validation(this)}})};NitrogenClass.prototype.$destroy_all_validation=function(){$("*").each(function(){Nitrogen.$destroy_target_validation(this)})};NitrogenClass.prototype.$make_id=function(c){var b=[];var d=new RegExp(".wfid_(.[^\\s]*)","g");while(c&&c.className){var e=c.className.match(/wfid_([^\s])+/g);if(e){b.unshift.apply(b,e)}c=c.parentNode}return b.join(".")};NitrogenClass.prototype.$do_event=function(validationGroup,eventContext,extraParam,ajaxSettings){var n=this;var s=jQuery.extend({dataType:"text",cache:false,success:null,error:null},ajaxSettings);this.$event_is_running=true;var validationParams=this.$validate_and_serialize(validationGroup);if(validationParams==null){this.$event_is_running=false;return}var params=jQuery.extend({},n.$params,validationParams,{eventContext:eventContext});jQuery.ajax({url:this.$url,type:"post",data:[jQuery.param(params),extraParam||""].join("&"),dataType:s.dataType,cache:s.cache,success:function(data,textStatus){n.$event_is_running=false;typeof s.success=="function"&&s.success(data,textStatus)||eval(data)},error:function(xmlHttpRequest,textStatus,errorThrown){n.$event_is_running=false;typeof s.success=="function"&&s.error(xmlHttpRequest,textStatus,errorThrown)}})};NitrogenClass.prototype.$do_system_event=function(eventContext){var n=this;n.$system_event_is_running=true;var params=jQuery.extend({},n.$params,{eventContext:eventContext,is_system_event:1});n.$system_event_obj=$.ajax({url:this.$url,type:"post",data:jQuery.param(params),dataType:"text",cache:false,success:function(data,textStatus){n.$system_event_is_running=false;n.$system_event_obj=null;var pc=n.$params.pageContext;eval(data);n.$set_param("pageContext",pc)},error:function(xmlHttpRequest,textStatus,errorThrown){n.$system_event_is_running=false;n.$system_event_obj=null}})};NitrogenClass.prototype.$send_pending_files=function(c,a){var b=null;if(typeof(c.$nitrogen_pending_files)=="object"){while(b=c.$nitrogen_pending_files.shift()){b.submit()}}};NitrogenClass.prototype.$attach_upload_handle_dragdrop=function(d,a,c){var b=this;if(typeof(c)=="undefined"){c={}}if(typeof(d.$nitrogen_pending_files)=="undefined"){d.$nitrogen_pending_files=[]}jQuery.getScript("/nitrogen/jquery.fileupload.min.js",function(){var e=jQuery(d).children(".upload_drop");jQuery(a).fileupload({dropZone:(c.droppable?e:null),singleFileUploads:true,sequentialUploads:true,url:b.$url,paramName:"file",formData:function(){d.elements.pageContext.value=b.$params.pageContext;var f=jQuery(d).serializeArray();return f},start:function(f){d.pageContext.value=b.$params.pageContext;jQuery(d).children(".upload_progress").fadeIn().text("Uploading...")},progressall:function(h,f){var g=parseInt(f.loaded/f.total*100,10);jQuery(d).children(".upload_progress").text(g+"% ("+f.loaded+"/"+f.total+" bytes)")},progress:function(g,f){},send:function(g,f){},stop:function(g,f){},always:function(g,f){},fail:function(h,g,f){Nitrogen.$increment_pending_upload_counter(d,-1)},add:function(g,f){jQuery.each(f.files,function(h,j){jQuery(d).children(".upload_droplist").prepend(jQuery("<li></li>").attr("filename",j.name).text(j.name));Nitrogen.$increment_pending_upload_counter(d,1)});if(c.autoupload){f.submit()}else{d.$nitrogen_pending_files.push(f)}},done:function(h,g){if(typeof g.result=="string"){var f=g.result}else{if(typeof g.result=="object"){var f=g.result[0].body.innerHTML}else{var f=""}}jQuery.globalEval(f);Nitrogen.$increment_pending_upload_counter(d,-1)}})})};NitrogenClass.prototype.$increment_pending_upload_counter=function(b,c){var a=$(b).data("pending_uploads");if(typeof(a)=="undefined"){a=0}a+=c;$(b).data("pending_uploads",a);if(a==0){jQuery(b).children(".upload_progress").fadeOut();Nitrogen.$alert_unfinished_files(b)}};NitrogenClass.prototype.$upload_finished=function(a){jQuery(".upload_droplist").children('li[filename="'+a+'"]').css("text-decoration","line-through").addClass("upload_successful").fadeOut()};NitrogenClass.prototype.$alert_unfinished_files=function(c){var b=$(c).find(".upload_droplist li:not(.upload_successful):visible");if(b.length>0){$(c).find(".upload_droplist li:not(.upload_successful)").css("color","red").fadeOut("slow");var a=$(b).get().map(function(d){return $(d).text()}).join("\r\n");alert("There was an error uploading the following file(s):\r\n"+a+"\r\n\r\nThis is likely due to the file(s) being too large or a misconfiguration on the server")}};function obj(b,a){return objs(b,a).get(0)}function objs(j,b){j=jQuery.trim(j);if(!b){b=Nitrogen.$anchor_path}else{b=Nitrogen.$path_alias(b)}if(j.indexOf(",")!=-1){var k=j.split(",");var f=$();for(var d=0;d<k.length;d++){f=f.add(objs(k[d],b))}return f}if(j=="page"||j==".page"){return jQuery(document)}j=j.replace(/##/g,".wfid_");j=j.replace(/\bme\b/g,b);if(j.indexOf(" ")==-1&&j.indexOf(".")==-1&&j.indexOf("#")==-1){var c=objs(".wfid_"+j,b);if(c.length>0){return c}if(c.length==0&&jQuery.inArray(j.toLowerCase(),Nitrogen.$valid_elements)==-1){return jQuery()}}var h=new RegExp(/^body\b/);if(h.test(j)){return jQuery(j)}var g=jQuery(Nitrogen.$anchor_root_path).find(b);var c=g.find(j);if(c.length>0){return c}var c=g.parentsUntil(Nitrogen.$anchor_root_path);for(var d=0;d<c.length;d++){var e=jQuery(c.get(d)).find(j);if(e.length>0){return e}}return jQuery(j)}NitrogenClass.prototype.$valid_elements=["a","abbr","acronym","address","applet","area","b","base","basefont","bdo","big","blockquote","body","br","button","caption","center","cite","code","col","colgroup","dd","del","dfn","dir","div","dl","dt","em","fieldset","font","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","hr","html","i","iframe","img","input","ins","isindex","kbd","label","legend","li","link","map","menu","meta","noframes","noscript","object","ol","optgroup","option","p","param","pre","q","s","samp","script","select","small","span","strike","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","u","ul","var"];NitrogenClass.prototype.$observe_event=function(a,d,b,c){objs(d,a).bind(b,c)};NitrogenClass.prototype.$update=function(b,c,a){objs(c,b).html(a)};NitrogenClass.prototype.$replace=function(b,c,a){objs(c,b).replaceWith(a)};NitrogenClass.prototype.$insert_top=function(b,c,a){objs(c,b).prepend(a)};NitrogenClass.prototype.$insert_bottom=function(b,c,a){objs(c,b).append(a)};NitrogenClass.prototype.$insert_before=function(b,c,a){objs(c,b).before(a)};NitrogenClass.prototype.$insert_after=function(b,c,a){objs(c,b).after(a)};NitrogenClass.prototype.$remove=function(a,b){objs(b,a).remove()};NitrogenClass.prototype.$return_false=function(b,a){return false};NitrogenClass.prototype.$is_key_code=function(b,c,a){return(b&&b.keyCode==c&&b.shiftKey==a)};NitrogenClass.prototype.$go_next=function(a){var b=obj(a);if(b.focus){b.focus()}if(b.select){b.select()}if(b.click){b.click()}};NitrogenClass.prototype.$disable_selection=function(a){a.onselectstart=function(){return false};a.unselectable="on";a.style.MozUserSelect="none";a.style.cursor="default"};NitrogenClass.prototype.$set_value=function(b,a,c){if(!a.id){a=objs(a)}a.each(function(d,e){if(e.value!=undefined){e.value=c}else{if(e.checked!=undefined){e.checked=c}else{if(e.src!=undefined){e.src=c}else{$(e).html(c)}}}})};NitrogenClass.prototype.$get_value=function(b,a){if(!a.id){a=objs(a)}el=a.get(0);if(el.value!=undefined){return el.value}else{if(el.checked!=undefined){return el.checked}else{if(el.src!=undefined){return el.src}else{return $(el).html()}}}};NitrogenClass.prototype.$normalize_param=function(a,c){var b="";if(a){b=a}if(a&&c){b=a+"="+c}return a+"&"+c};NitrogenClass.prototype.$encode_arguments_object=function(d){if(!Bert){alert("Bert.js library not included in template.")}var b=new Array();for(var c=0;c<d.length;c++){b.push(d[c])}var e=Bert.encode(b);return"args="+this.$urlencode(e)};NitrogenClass.prototype.$urlencode=function(a){return escape(a).replace(/\+/g,"%2B").replace(/%20/g,"+").replace(/\*/g,"%2A").replace(/\//g,"%2F").replace(/@/g,"%40")};NitrogenClass.prototype.$datepicker=function(b,a){jQuery(b).datepicker(a)};NitrogenClass.prototype.$autocomplete=function(d,a,b,c){var e=this;jQuery.extend(a,{select:function(g,h){var f=(h.item)&&'{"id":"'+h.item.id+'","value":"'+h.item.value+'"}'||"";e.$queue_event(null,c,"select_item="+e.$urlencode(f))},source:function(g,f){e.$queue_event(null,b,"search_term="+g.term,{dataType:"json",success:function(h){f(h)}})}});jQuery(d).autocomplete(a)};NitrogenClass.prototype.$draggable=function(b,a,c){objs(b).each(function(d,e){e.$drag_tag=c;jQuery(e).draggable(a)})};NitrogenClass.prototype.$droppable=function(c,b,a){var d=this;b.drop=function(f,g){var e=g.draggable[0].$drag_tag;d.$queue_event(null,a,"drag_item="+e)};objs(c).each(function(e,f){jQuery(f).droppable(b)})};NitrogenClass.prototype.$sortitem=function(a,b){var c=obj(a);c.$sort_tag=b;c.$drag_tag=b};NitrogenClass.prototype.$sortblock=function(a,c,b){var d=this;c.update=function(){var e="";for(var g=0;g<this.childNodes.length;g++){var f=this.childNodes[g];if(e!=""){e+=","}if(f.$sort_tag){e+=f.$sort_tag}}d.$queue_event(null,b,"sort_items="+e)};objs(a).sortable(c)};NitrogenClass.prototype.$from_alien=function(a){var b=$("input#"+a).val();objs(a).val(b)};var Nitrogen=new NitrogenClass();var page=document;Nitrogen.$event_loop();
Please sign in to comment.
Something went wrong with that request. Please try again.