MediaWiki:Common.js: Difference between revisions
From Luminys WIKI
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
} | } | ||
function Run(){ | // function Run(){ | ||
let title = $("#firstHeading").text() | // let title = $("#firstHeading").text() | ||
if(title == "Main Page") title = "Luminys Knowledge Base (Wiki)" | // if(title == "Main Page") title = "Luminys Knowledge Base (Wiki)" | ||
$("#mw-header-container").prepend("<div id='mw-header-lm-title'><div style='text-align:center'>"+title+"</div></div>") | // $("#mw-header-container").prepend("<div id='mw-header-lm-title'><div style='text-align:center'>"+title+"</div></div>") | ||
$("#mw-header-container").prepend(` | // $("#mw-header-container").prepend(` | ||
<div style="background:white;position: absolute;top: 0;width: 100%;"> | // <div style="background:white;position: absolute;top: 0;width: 100%;"> | ||
<div style="display:flex; flex-direction:row; align-content: center; align-items:baseline;align-self: center; margin: 0 77.5px;"> | // <div style="display:flex; flex-direction:row; align-content: center; align-items:baseline;align-self: center; margin: 0 77.5px;"> | ||
<div style="width:14em;"></div> | // <div style="width:14em;"></div> | ||
<a href="/" style="height:66px;margin-right:10px"><img src="https://blog.luminyscorp.com/content/images/2024/07/luminys-logo-1.png" style="height:26px;margin:20px;" alt="Luminys Logo"> </a> | // <a href="/" style="height:66px;margin-right:10px"><img src="https://blog.luminyscorp.com/content/images/2024/07/luminys-logo-1.png" style="height:26px;margin:20px;" alt="Luminys Logo"> </a> | ||
<div class=""> | // <div class=""> | ||
<div class="hidden md:block ml-6 font-medium w-full lg:flex lg:w-auto "> | // <div class="hidden md:block ml-6 font-medium w-full lg:flex lg:w-auto "> | ||
<ul id="lm-header"> | // <ul id="lm-header"> | ||
<li><a href='/Main_Page'>Home</a></li> | // <li><a href='/Main_Page'>Home</a></li> | ||
<li><a href="/Main_Page#How-to_Instructions">Instructions</a></li> | // <li><a href="/Main_Page#How-to_Instructions">Instructions</a></li> | ||
<li><a href="/Main_Page#Data_Sheet,User_Manual_&_Firmware">Product Support</a></li> | // <li><a href="/Main_Page#Data_Sheet,User_Manual_&_Firmware">Product Support</a></li> | ||
<li><a href="/Main_Page#How-to_Videos">Videos</a></li> | // <li><a href="/Main_Page#How-to_Videos">Videos</a></li> | ||
</ul> | // </ul> | ||
</div> | // </div> | ||
</div> | // </div> | ||
</div> | // </div> | ||
</div> | // </div> | ||
`); | // `); | ||
//let logined = getCookie('my_wikiUserID'); | // //let logined = getCookie('my_wikiUserID'); | ||
let logined = window.mediaWiki.user.getName() | // let logined = window.mediaWiki.user.getName() | ||
if(!logined){ $("#mw-page-header-links").hide(); } | // if(!logined){ $("#mw-page-header-links").hide(); } | ||
} | // } | ||
$(function () { | // $(function () { | ||
Run(); | // Run(); | ||
}); | // }); |
Revision as of 12:07, 11 September 2024
// http://mediawiki.i.donnie.fun:8085/MediaWiki:Common.js /* Any JavaScript here will be loaded for all users on every page load. */ function getCookie(name) { let cookie = {}; document.cookie.split(';').forEach(function(el) { let split = el.split('='); cookie[split[0].trim()] = split.slice(1).join("="); }) return cookie[name]; } // function Run(){ // let title = $("#firstHeading").text() // if(title == "Main Page") title = "Luminys Knowledge Base (Wiki)" // $("#mw-header-container").prepend("<div id='mw-header-lm-title'><div style='text-align:center'>"+title+"</div></div>") // $("#mw-header-container").prepend(` // <div style="background:white;position: absolute;top: 0;width: 100%;"> // <div style="display:flex; flex-direction:row; align-content: center; align-items:baseline;align-self: center; margin: 0 77.5px;"> // <div style="width:14em;"></div> // <a href="/" style="height:66px;margin-right:10px"><img src="https://blog.luminyscorp.com/content/images/2024/07/luminys-logo-1.png" style="height:26px;margin:20px;" alt="Luminys Logo"> </a> // <div class=""> // <div class="hidden md:block ml-6 font-medium w-full lg:flex lg:w-auto "> // <ul id="lm-header"> // <li><a href='/Main_Page'>Home</a></li> // <li><a href="/Main_Page#How-to_Instructions">Instructions</a></li> // <li><a href="/Main_Page#Data_Sheet,User_Manual_&_Firmware">Product Support</a></li> // <li><a href="/Main_Page#How-to_Videos">Videos</a></li> // </ul> // </div> // </div> // </div> // </div> // `); // //let logined = getCookie('my_wikiUserID'); // let logined = window.mediaWiki.user.getName() // if(!logined){ $("#mw-page-header-links").hide(); } // } // $(function () { // Run(); // });