MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 18: | Line 18: | ||
}); | }); | ||
/* === | /* === Transightee custom footer injection === */ | ||
(function () { | (function () { | ||
function | function html() { | ||
return '' + | |||
'<div id="tg-footer" class="tg-footer">' + | |||
' <div class="tg-inner">' + | |||
' <div class="tg-grid">' + | |||
' <div class="tg-col">' + | |||
' <h3>Use Cases</h3>' + | |||
' <ul>' + | |||
' <li><a href="/wiki/All_Use_Cases">All use cases</a></li>' + | |||
' <li><a href="/wiki/Fleet_Telematics">Fleet telematics</a></li>' + | |||
' <li><a href="/wiki/Logistics_and_Delivery_Services">Logistics & delivery services</a></li>' + | |||
' <li><a href="/wiki/Car_Sharing_Rental_Leasing">Car sharing, rental & leasing</a></li>' + | |||
' <li><a href="/wiki/E-Mobility_Management">E-mobility management</a></li>' + | |||
' <li><a href="/wiki/Utility_and_Emergency_Transport">Utility & emergency transport</a></li>' + | |||
' <li><a href="/wiki/Agriculture_Construction_Mining">Agriculture, construction & mining</a></li>' + | |||
' <li><a href="/wiki/Assets_and_Workforce">Assets & workforce</a></li>' + | |||
' <li><a href="/wiki/Driver_Safety">Driver safety</a></li>' + | |||
' </ul>' + | |||
' </div>' + | |||
' <div class="tg-col">' + | |||
' <h3>Products</h3>' + | |||
' <ul>' + | |||
' <li><a href="/wiki/Trackers">Trackers</a></li>' + | |||
' <li><a href="/wiki/Accessories">Accessories</a></li>' + | |||
' <li><a href="/wiki/Solutions">Solutions</a></li>' + | |||
' </ul>' + | |||
' </div>' + | |||
' <div class="tg-col">' + | |||
' <h3>Support</h3>' + | |||
' <ul>' + | |||
' <li><a href="/wiki/Product_Support">Product support</a></li>' + | |||
' <li><a href="/wiki/Wiki_Knowledge_Base">Wiki knowledge base</a></li>' + | |||
' <li><a href="/wiki/Community_Forum">Community forum</a></li>' + | |||
' <li><a href="/wiki/Warranty_and_Repair">Warranty & repair</a></li>' + | |||
' <li><a href="/wiki/EOL_Products">EOL products</a></li>' + | |||
' </ul>' + | |||
' </div>' + | |||
' <div class="tg-col">' + | |||
' <h3>About Us</h3>' + | |||
' <ul>' + | |||
' <li><a href="/wiki/Mission_Vision_Values">Mission, vision & values</a></li>' + | |||
' <li><a href="/wiki/Brand_Guidelines">Brand guidelines</a></li>' + | |||
' <li><a href="/wiki/Career">Career</a></li>' + | |||
' <li><a href="/wiki/Contacts">Contacts</a></li>' + | |||
' </ul>' + | |||
' </div>' + | |||
' </div>' + | |||
' <div class="tg-bottom">' + | |||
' <div>Copyright © 2024, Transightee</div>' + | |||
' <div class="tg-social">' + | |||
' <a href="https://facebook.com/" aria-label="Facebook">f</a>' + | |||
' <a href="https://linkedin.com/" aria-label="LinkedIn">in</a>' + | |||
' <a href="https://twitter.com/" aria-label="X/Twitter">x</a>' + | |||
' <a href="https://youtube.com/" aria-label="YouTube">▶</a>' + | |||
' <a href="https://instagram.com/" aria-label="Instagram">◉</a>' + | |||
' </div>' + | |||
' </div>' + | |||
' </div>' + | |||
'</div>'; | |||
} | } | ||
function | function mountPoint() { | ||
return document.querySelector(' | return document.querySelector('.mw-footer-container') || document.body; | ||
} | } | ||
function | function insert() { | ||
if (document.getElementById('tg-footer')) | if (document.getElementById('tg-footer')) return; | ||
var | var wrapper = document.createElement('div'); | ||
wrapper.innerHTML = html(); | |||
mountPoint().appendChild(wrapper.firstChild); | |||
} | } | ||
// Run | // Run after page content is loaded (Vector 2022 uses JS navigation) | ||
mw.hook('wikipage.content').add( | mw.hook('wikipage.content').add(insert); | ||
if (document.readyState === 'loading') { | if (document.readyState === 'loading') { | ||
document.addEventListener('DOMContentLoaded', | document.addEventListener('DOMContentLoaded', insert); | ||
} else { | } else { | ||
insert(); | |||
} | } | ||
})(); | })(); | ||
Revision as of 06:30, 1 September 2025
$(document).ready(function() {
$('input#searchInput').attr('placeholder', 'Search for Transight Wiki');
});
// Open all external links in a new tab
$(document).ready(function () {
$("a.external").attr("target", "_blank");
});
mw.loader.using('mediawiki.util', function () {
// Force small text
document.documentElement.classList.remove('vector-feature-custom-font-size-standard', 'vector-feature-custom-font-size-large');
document.documentElement.classList.add('vector-feature-custom-font-size-small');
// Force wide layout
document.documentElement.classList.remove('vector-feature-limited-width');
document.documentElement.classList.add('vector-feature-wide-width');
});
/* === Transightee custom footer injection === */
(function () {
function html() {
return '' +
'<div id="tg-footer" class="tg-footer">' +
' <div class="tg-inner">' +
' <div class="tg-grid">' +
' <div class="tg-col">' +
' <h3>Use Cases</h3>' +
' <ul>' +
' <li><a href="/wiki/All_Use_Cases">All use cases</a></li>' +
' <li><a href="/wiki/Fleet_Telematics">Fleet telematics</a></li>' +
' <li><a href="/wiki/Logistics_and_Delivery_Services">Logistics & delivery services</a></li>' +
' <li><a href="/wiki/Car_Sharing_Rental_Leasing">Car sharing, rental & leasing</a></li>' +
' <li><a href="/wiki/E-Mobility_Management">E-mobility management</a></li>' +
' <li><a href="/wiki/Utility_and_Emergency_Transport">Utility & emergency transport</a></li>' +
' <li><a href="/wiki/Agriculture_Construction_Mining">Agriculture, construction & mining</a></li>' +
' <li><a href="/wiki/Assets_and_Workforce">Assets & workforce</a></li>' +
' <li><a href="/wiki/Driver_Safety">Driver safety</a></li>' +
' </ul>' +
' </div>' +
' <div class="tg-col">' +
' <h3>Products</h3>' +
' <ul>' +
' <li><a href="/wiki/Trackers">Trackers</a></li>' +
' <li><a href="/wiki/Accessories">Accessories</a></li>' +
' <li><a href="/wiki/Solutions">Solutions</a></li>' +
' </ul>' +
' </div>' +
' <div class="tg-col">' +
' <h3>Support</h3>' +
' <ul>' +
' <li><a href="/wiki/Product_Support">Product support</a></li>' +
' <li><a href="/wiki/Wiki_Knowledge_Base">Wiki knowledge base</a></li>' +
' <li><a href="/wiki/Community_Forum">Community forum</a></li>' +
' <li><a href="/wiki/Warranty_and_Repair">Warranty & repair</a></li>' +
' <li><a href="/wiki/EOL_Products">EOL products</a></li>' +
' </ul>' +
' </div>' +
' <div class="tg-col">' +
' <h3>About Us</h3>' +
' <ul>' +
' <li><a href="/wiki/Mission_Vision_Values">Mission, vision & values</a></li>' +
' <li><a href="/wiki/Brand_Guidelines">Brand guidelines</a></li>' +
' <li><a href="/wiki/Career">Career</a></li>' +
' <li><a href="/wiki/Contacts">Contacts</a></li>' +
' </ul>' +
' </div>' +
' </div>' +
' <div class="tg-bottom">' +
' <div>Copyright © 2024, Transightee</div>' +
' <div class="tg-social">' +
' <a href="https://facebook.com/" aria-label="Facebook">f</a>' +
' <a href="https://linkedin.com/" aria-label="LinkedIn">in</a>' +
' <a href="https://twitter.com/" aria-label="X/Twitter">x</a>' +
' <a href="https://youtube.com/" aria-label="YouTube">▶</a>' +
' <a href="https://instagram.com/" aria-label="Instagram">◉</a>' +
' </div>' +
' </div>' +
' </div>' +
'</div>';
}
function mountPoint() {
return document.querySelector('.mw-footer-container') || document.body;
}
function insert() {
if (document.getElementById('tg-footer')) return;
var wrapper = document.createElement('div');
wrapper.innerHTML = html();
mountPoint().appendChild(wrapper.firstChild);
}
// Run after page content is loaded (Vector 2022 uses JS navigation)
mw.hook('wikipage.content').add(insert);
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', insert);
} else {
insert();
}
})();