User:Oxguy3/myskin.js

/******************************/ /* ************************** */ /* * VECTOR.COMBINED.MIN.JS * */ /* ************************** */ /******************************/

$(document).ready(function{if(!wgVectorEnabledModules.collapsiblenav){return true;} var map={'ltr':{'msie':'>=',7,'opera':'>=',9.6,'konqueror':'>=',4.0,'blackberry':false,'ipod':false,'iphone':false,'ps3':false},'rtl':{'msie':'>=',7,'opera':'>=',9.6,'konqueror':'>=',4.0,'blackberry':false,'ipod':false,'iphone':false,'ps3':false}};if(!mw.usability.testBrowser(map)){return true;} var version=1;if(wgCollapsibleNavForceNewVersion){version=2;}else{if(wgCollapsibleNavBucketTest){version=$.cookie('vector-nav-pref-version');if(version==null){version=Math.round(Math.random+1);$.cookie('vector-nav-pref-version',version,{'expires':30,'path':'/'});}}} if(version==2){var limit=5;var threshold=3;$('#p-lang ul').addClass('secondary').before(' ');var languages=['en','fr','de','es','pt','it','ru','ja','nl','pl','zh','sv','ar','tr','uk','fi','no','ca','ro','hu','ksh','id','he','cs','vi','ko','sr','fa','da','eo','sk','th','lt','vo','bg','sl','hr','hi','et','mk','simple','new','ms','nn','gl','el','eu','ka','tl','bn','lv','ml','bs','te','la','az','sh','war','br','is','mr','be-x-old','sq','cy','lb','ta','zh-classical','an','jv','ht','oc','bpy','ceb','ur','zh-yue','pms','scn','be','roa-rup','qu','af','sw','nds','fy','lmo','wa','ku','hy','su','yi','io','os','ga','ast','nap','vec','gu','cv','bat-smg','kn','uz','zh-min-nan','si','als','yo','li','gan','arz','sah','tt','bar','gd','tg','kk','pam','hsb','roa-tara','nah','mn','vls','gv','mi','am','ia','co','ne','fo','nds-nl','glk','mt','ang','wuu','dv','km','sco','bcl','mg','my','diq','tk','szl','ug','fiu-vro','sc','rm','nrm','ps','nv','hif','bo','se','sa','pnb','map-bms','lad','lij','crh','fur','kw','to','pa','jbo','ba','ilo','csb','wo','xal','krc','ckb','pag','ln','frp','mzn','ce','nov','kv','eml','gn','ky','pdc','lo','haw','mhr','dsb','stq','tpi','arc','hak','ie','so','bh','ext','mwl','sd','ig','myv','ay','iu','na','cu','pi','kl','ty','lbe','ab','got','sm','as','mo','ee','zea','av','ace','kg','bm','cdo','cbk-zam','kab','om','chr','pap','udm','ks','zu','rmy','cr','ch','st','ik','mdf','kaa','aa','fj','srn','tet','or','pnt','bug','ss','ts','pcd','pih','za','sg','lg','bxr','xh','ak','ha','bi','ve','tn','ff','dz','ti','ki','ny','rw','chy','tw','sn','tum','ng','rn','mh','ii','cho','hz','kr','ho','mus','kj'];var acceptLangCookie=$.cookie('accept-language');if(acceptLangCookie!=null){if(acceptLangCookie!=''){languages=acceptLangCookie.split(',').concat(languages);}}else{$.getJSON(wgScriptPath+'/api.php?action=query&meta=userinfo&uiprop=acceptlang&format=json',function(data){var langs=[];if(typeof data.query!='undefined'&&typeof data.query.userinfo!='undefined'&&typeof data.query.userinfo.acceptlang!='undefined'){for(var j=0;j<data.query.userinfo.acceptlang.length;j++){if(data.query.userinfo.acceptlang[j].q!=0){langs.push(data.query.userinfo.acceptlang[j]['*']);}}} $.cookie('accept-language',langs.join(','),{'path':'/','expires':30});});} var $primary=$('#p-lang ul.primary');var $secondary=$('#p-lang ul.secondary');if($secondary.children.length<limit+threshold){limit+=threshold;} var count=0;for(var i=0;i<languages.length;i++){var $link=$secondary.find('.interwiki-'+languages[i]);if($link.length){if(count++ div.portal:first').addClass('first persistent');$('#mw-panel').addClass('collapsible-nav');$('#mw-panel > div.portal:not(.persistent)').each(function(i){var id=$(this).attr('id');var state=$.cookie('vector-nav-'+id);if(state=='true'||(state==null&&i<1)||(state==null&&version==1&&id=='p-lang')){$(this).addClass('expanded').find('div.body').show;}else{$(this).addClass('collapsed');} if(state!=null){$.cookie('vector-nav-'+$(this).attr('id'),state,{'expires':30,'path':'/'});}});function toggle($element){$.cookie('vector-nav-'+$element.parent.attr('id'),$element.parent.is('.collapsed'),{'expires':30,'path':'/'});$element.parent.toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle('fast');} var $headings=$('#mw-panel > div.portal:not(.persistent) > h5');var tabIndex=mw.usability.getMaxTabIndex+1;$('#searchInput').attr('tabindex',tabIndex++);$headings.each(function{$(this).attr('tabindex',tabIndex++);});$headings.keydown(function(event){if(event.which==13||event.which==32){toggle($(this));}}).mousedown(function{toggle($(this));$(this).blur;return false;});});$(document).ready(function{if(!wgVectorEnabledModules.collapsibletabs){return true;} var rtl=$('body').is('.rtl');$.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$(ele);$.collapsibleTabs.getSettings($($.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$.collapsibleTabs.getSettings($moving);var target=data.collapsedContainer;$moving.css("position","relative").css((rtl?'left':'right'),0).animate({width:'1px'},"normal",function{$(this).hide;$(' ').insertAfter(this);$(this).remove.prependTo(target).data('collapsibleTabsSettings',data);$(this).attr('style','display:list-item;');$.collapsibleTabs.getSettings($($.collapsibleTabs.getSettings($(ele)).expandedContainer)).shifting=false;$.collapsibleTabs.handleResize;});};$.collapsibleTabs.moveToExpanded=function(ele){var $moving=$(ele);$.collapsibleTabs.getSettings($($.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$.collapsibleTabs.getSettings($moving);var $target=$(data.expandedContainer).find('span.placeholder:first');var expandedWidth=data.expandedWidth;$moving.css("position","relative").css((rtl?'right':'left'),0).css('width','1px');$target.replaceWith($moving.remove.css('width','1px').data('collapsibleTabsSettings',data).animate({width:expandedWidth+"px"},"normal",function{$(this).attr('style','display:block;');$.collapsibleTabs.getSettings($($.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=false;$.collapsibleTabs.handleResize;}));};$('#p-views ul').bind("beforeTabCollapse",function{if($('#p-cactions').css('display')=='none') $("#p-cactions").addClass("filledPortlet").removeClass("emptyPortlet").find('h5').css('width','1px').animate({'width':'26px'},390);}).bind("beforeTabExpand",function{if($('#p-cactions li').length==1) $("#p-cactions h5").animate({'width':'1px'},370,function{$(this).attr('style','').parent.addClass("emptyPortlet").removeClass("filledPortlet");});}).collapsibleTabs({expandCondition:function(eleWidth){if(rtl){return($('#right-navigation').position.left+$('#right-navigation').width+1)<($('#left-navigation').position.left-eleWidth);}else{return($('#left-navigation').position.left+$('#left-navigation').width+1)<($('#right-navigation').position.left-eleWidth);}},collapseCondition:function{if(rtl){return($('#right-navigation').position.left+$('#right-navigation').width)>$('#left-navigation').position.left;}else{return($('#left-navigation').position.left+$('#left-navigation').width)>$('#right-navigation').position.left;}}});});$(document).ready(function{if(!wgVectorEnabledModules.editwarning||$('#wpTextbox1').length==0){return true;} $('#wpTextbox1, #wpSummary').each(function{$(this).data('origtext',$(this).val);});var fallbackWindowOnBeforeUnload=window.onbeforeunload;var ourWindowOnBeforeUnload=function{var fallbackResult=undefined;var retval=undefined;var thisFunc=arguments.callee;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload;} if(fallbackResult!==undefined){retval=fallbackResult;}else{if(wgAction=='submit'||$('#wpTextbox1').data('origtext')!=$('#wpTextbox1').val||$('#wpSummary').data('origtext')!=$('#wpSummary').val){retval=mw.usability.getMsg('vector-editwarning-warning');}} window.onbeforeunload=null;if(retval!==undefined){setTimeout(function{window.onbeforeunload=thisFunc;});return retval;}};var pageShowHandler=function{window.onbeforeunload=ourWindowOnBeforeUnload;};pageShowHandler;if(window.addEventListener){window.addEventListener('pageshow',pageShowHandler,false);}else if(window.attachEvent){window.attachEvent('pageshow',pageShowHandler);} $('form').submit(function{window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;if(wgVectorEnabledModules.simplesearch&&skin=='vector'&&typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];} $(document).ready(function{if(!wgVectorEnabledModules.simplesearch||wgVectorPreferences.simplesearch.disablesuggest||skin!='vector'){return true;} var mod={'browsers':{'ltr':{'opera':'>=',9.6,'docomo':false,'blackberry':false,'ipod':false,'iphone':false},'rtl':{'opera':'>=',9.6,'docomo':false,'blackberry':false,'ipod':false,'iphone':false}}};if(!$.wikiEditor.isSupported(mod)){return true;} if('placeholder'in document.createElement('input')){$('div#simpleSearch > input#searchInput').attr('placeholder',mw.usability.getMsg('vector-simplesearch-search'));}else{$('div#simpleSearch > input#searchInput').each(function{var $input=$(this);$input.bind('blur',function{if($input.val.length==0){$input.val(mw.usability.getMsg('vector-simplesearch-search')).addClass('placeholder');}}).bind('focus',function{if($input.hasClass('placeholder')){$input.val().removeClass('placeholder');}}).parents('form').bind('submit',function{$input.trigger('focus');});if($input.val==){$input.trigger('blur');}});} $('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$(this);var request=$.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$(this).data('request',request);},cancel:function{var request=$(this).data('request');if(request&&typeof request.abort=='function'){request.abort;$(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit;}},delay:120,positionFromLeft:$('body').is('.rtl'),highlightInput:true}).bind('paste cut',function(e){$(this).trigger('keypress');});$('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit;}},special:{render:function(query){if($(this).children.length==0){$(this).show $label=$(' ').addClass('special-label').text(mw.usability.getMsg('vector-simplesearch-containing')).appendTo($(this));$query=$(' ').addClass('special-query').text(query).appendTo($(this));$query.autoEllipsis;}else{$(this).find('.special-query').empty.text(query).autoEllipsis;}},select:function($textbox){$textbox.closest('form').append($(' ').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit;}},$region:$('#simpleSearch')});});