MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 283: | Line 283: | ||
var nav = document.createElement( 'div' ); | var nav = document.createElement( 'div' ); | ||
nav.id = 'gr-toc-doc-nav'; | nav.id = 'gr-toc-doc-nav'; | ||
nav.setAttribute( ' | nav.setAttribute( 'class', 'toc-nav-links'); | ||
var base = [ | var base = [ | ||
| Line 296: | Line 292: | ||
].join( ';' ); | ].join( ';' ); | ||
function makeBtn( href, label | function makeBtn( href, label ) { | ||
var a = document.createElement( 'a' ); | var a = document.createElement( 'a' ); | ||
a.href = href; | a.href = href; | ||
a.textContent = label; | a.textContent = label; | ||
a.setAttribute( ' | a.setAttribute( 'class', 'toc-nav-link-item'); | ||
a.addEventListener( 'mouseover', function () { this.style.opacity = '0.72'; } ); | a.addEventListener( 'mouseover', function () { this.style.opacity = '0.72'; } ); | ||
a.addEventListener( 'mouseout', function () { this.style.opacity = '1'; } ); | a.addEventListener( 'mouseout', function () { this.style.opacity = '1'; } ); | ||
| Line 307: | Line 303: | ||
/* Bhashya page: show मूलम् (→ /Moola filtered view) */ | /* Bhashya page: show मूलम् (→ /Moola filtered view) */ | ||
if ( showMoolaPage ) nav.appendChild( makeBtn( moolaPageUrl, 'मूलम् | if ( showMoolaPage ) nav.appendChild( makeBtn( moolaPageUrl, 'मूलम्' ) ); | ||
/* Teeka page: show मूल (→ primary bhashya) */ | /* Teeka page: show मूल (→ primary bhashya) */ | ||
if ( showMoolaBack ) nav.appendChild( makeBtn( moolaUrl, 'मूल | if ( showMoolaBack ) nav.appendChild( makeBtn( moolaUrl, 'मूल' ) ); | ||
/* Either page type: show उल्लेख when available */ | /* Either page type: show उल्लेख when available */ | ||
if ( showUllekha ) nav.appendChild( makeBtn( ullekhaUrl, 'उल्लेख | if ( showUllekha ) nav.appendChild( makeBtn( ullekhaUrl, 'उल्लेख') ); | ||
var tocContents = toc.querySelector( '.vector-toc-contents' ); | var tocContents = toc.querySelector( '.vector-toc-contents' ); | ||