language handling for js

This commit is contained in:
Jana Deutschländer 2017-01-04 18:09:30 +01:00
commit 4fca1d16bb
5 changed files with 104 additions and 18 deletions

View file

@ -77,3 +77,9 @@ if (typeof console === "undefined" || typeof console.log === "undefined") {
console.log = function() {};
}
}
var wikiLang = "de";
/**
* anonymous func: get page language
*/
(function($){ $("html").attr("lang"); if(typeof(l)!= 'undefined' && l.length>=2) wikiLang=l.substr(0,2).toLowerCase(); if(wikiLang!='de'&& wikiLang!='en') wikiLang='de'; })(jQuery);

View file

@ -2,6 +2,7 @@
var mainMenu = function(){
var $menu = $('.nav-main').find('> ul');
try{
if($menu.length > 0){
var $toggler = $menu.find('> li.level1 > .li'),
@ -23,27 +24,12 @@
}
});
});
//FIXME: store current nav state with local storage
}
}
/*var $link = $this.find('#plugin__qc__link'),
$container = $this.find('#plugin__qc__wrapper');
if($container.length < 1){
$this.remove();
}else{
$container.attr('aria-hidden','true');
var $icon = $container.find('#plugin__qc__icon');
$container.find('#plugin__qc__out').removeAttr('style');
$link.on( 'click', function(e){
e.preventDefault();
$icon.trigger('click');
var oldState = ($link.attr('aria-expanded')=== "true" );
$container.attr('aria-hidden',oldState);
$(this).attr('aria-expanded',!oldState);
});
}*/
}catch(err){