PageSourceSearch

https://www.songsforteaching.com/content/cache/skins/SongsForTeaching/javascript/global.js?3715r2=1

js songsforteaching.com collected 2026-10-01 11:33:00 UTC 6,293 bytes, 49 lines download raw bytes

1
2function removeEmptyZones()
3{$("#left,#right").each(function(){if($(this).is("empty")||$.trim($(this).html())=="")
4{$(this).remove();}});}
5function setContentWidth()
6{if($("#content .panel").length>0)
7{if($("#content .wrap-panels").length<1)
8{$("#content .panel").wrapAll('<div class="wrap-panels"></div>');}}
9var width=$("#main").width();if($("#left:visible").length)
10{width-=$("#left").width();$("#content .wrap,#content .wrap-panels").addClass("padding-left");}
11else
12{$("#content .wrap, #content .wrap-panels").removeClass("padding-left");}
13if($("#right:visible").length>0)
14{width-=$("#right").width();$("#content .wrap,#content .wrap-panels").addClass("padding-right");}
15else
16{$("#content .wrap,#content .wrap-panels").removeClass("padding-right");}
17$("#content").width(width-2);}
18function setCatalogViewFlexible()
19{var top=null;var maxHeight=0;var itemsInRow=0;$(".catalog-view-flexible .catalog-product").each(function(){$(this).css("width","");$(this).css("height","");});$(".catalog-view-flexible .catalog-product").each(function(){var o=$(this).offset();if(top==null)
20{top=o.top;itemsInRow=0;}
21if(top==o.top)itemsInRow++;maxHeight=parseInt($(this).height()>maxHeight?$(this).height():maxHeight);});var width=parseInt(Math.floor($(".catalog-view-flexible").width()/itemsInRow));if(maxHeight<220)maxHeight=220;$(".catalog-view-flexible .catalog-product").each(function(){$(this).width(width+'px');$(this).height(maxHeight+'px');});}
22function setCountriesStates(countrySelector,currentCountry,stateSelector,currentState,provinceSelector,currentProvince,countriesStates){$(countrySelector+" select").change(function(){var currentCountry=$(countrySelector+" select option:selected").attr("value");var _currentCountry=currentCountry;for(i=1;i<=5;i++)
23{if(_currentCountry.length<5)_currentCountry='0'+_currentCountry;}
24_currentCountry='c'+_currentCountry;if(countriesStates[_currentCountry].states)
25{var statesHTML='';statesHTML+='<option value="">'+msg.select_state_or_province+'</option>';jQuery.each(countriesStates[_currentCountry].states,function(stateId,stateName){var _stateId=parseInt(stateId.substring(1),10);statesHTML+='<option value="'+_stateId+'" '+(_stateId==currentState?'selected="selected"':'')+'>'+stateName+'</option>';});$(stateSelector+" select").html(statesHTML);var currentState=$(stateSelector+' select option:selected').attr('value');if(currentState<1)
26{$(stateSelector+' select option:first').attr('selected','selected');}
27else
28{$(stateSelector+' select').val(currentState);}
29$(provinceSelector).hide();$(stateSelector).show();}
30else
31{$(stateSelector).hide();$(provinceSelector).show();}});var countriesHTML='';jQuery.each(countriesStates,function(countryId,countryData){var _countryId=parseInt(countryId.substr(1,5),10);countriesHTML+='<option value="'+_countryId+'" '+(_countryId==currentCountry?'selected="selected"':'')+'>'+countryData.country_name+'</option>';});$(countrySelector+" select").html(countriesHTML);var currentCountry=$(countrySelector+" select option:selected").attr("value");if(currentCountry<1)
32{$(countrySelector+' select option:first').attr('selected','selected');}
33else
34{$(countrySelector+' select').val(currentCountry);}
35$(countrySelector+" select").change();var _currentCountry=currentCountry;for(i=1;i<=5;i++)
36{if(_currentCountry.length<5)_currentCountry='0'+_currentCountry;}
37_currentCountry='c'+_currentCountry;if(countriesStates[_currentCountry].states!=null&&countriesStates[_currentCountry].states!='undefined'&&countriesStates[_currentCountry].states)
38{var statesHTML='';statesHTML+='<option value="">'+msg.select_state_or_province+'</option>';jQuery.each(countriesStates[_currentCountry].states,function(stateId,stateName){var _stateId=parseInt(stateId.substr(1,5),10);statesHTML+='<option value="'+_stateId+'" '+(_stateId==currentState?'selected="selected"':'')+'>'+stateName+'</option>';});$(stateSelector+" select").html(statesHTML);$(provinceSelector).hide();$(stateSelector).show();}
39else
40{$(provinceSelector+" input[type='text']").val(currentProvince);$(stateSelector).hide();$(provinceSelector).show();}}
41jQuery.fn.editableSelectSetValue=function(val)
42{$(this).val(val);$(this).prevAll("input[type='text']:first").val(val);}
43jQuery.fn.editableSelect=function()
44{if($(this).data('editable-select-options')!=null&&$(this).data('editable-select-options')!='undefined')return this;var edit=$('<input type="text" class="editable-select-text"/>').val($(this).find('option:selected').html()).click(function(){if($(this).nextAll('div.editable-select-options:first').is(":visible"))
45{$(this).nextAll('div.editable-select-options:first').slideUp("fast");}
46else
47{$('div.editable-select-options').slideUp("fast");var pos=$(this).position();var w=$(this).width()+parseInt($(this).css('padding-left'))+parseInt($(this).css('padding-right'));$(this).nextAll('div.editable-select-options:first').css({position:'absolute',top:$(this).height()+2+parseInt($(this).css('padding-top'))+parseInt($(this).css('padding-bottom')),left:0,width:w<180?180:w}).slideDown("fast");}}).change(function(){$(this).nextAll('input[type="hidden"]:first').val($(this).val()).trigger('change');$(this).nextAll('div.editable-select-options:first').slideUp("fast");});if($(this).attr("style")!="undefined"&&$(this).attr("style")!="")
48{$(edit).attr('style',$(this).attr("style"));}
49var hidden=$('<input type="hidden"/>').attr('name',$(this).attr("name")).attr('id',$(this).attr("id")).data('editable-select-options',true).val($(this).val());var options="";jQuery.each($(this).find("option"),function(optIndex,opt){t=$.trim($(opt).html());options=options+'<li><a href="#'+escape($(opt).attr('value'))+'"><div>'+(t==""?"&nbsp;":t)+'</div></a></li>'});var dropDown=$('<div class="editable-select-options" style="display:none;"><ul>'+options+'</ul></div>');$(edit).replaceAll(this);$(hidden).insertAfter(edit);$(dropDown).insertAfter(hidden);$(dropDown).find('ul li a').click(function(event){event.stopPropagation();var val=unescape($(this).attr('href').substring(1));var valCaption=unescape($(this).find('div').html());if(valCaption=="&nbsp;")valCaption="";$(hidden).val(valCaption).trigger('change');$(edit).val(valCaption);$(edit).nextAll('div.editable-select-options:first').slideUp("fast");return false;});$(this).data('editable-select-options',true);return this;}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.