Jump to content

MediaWiki:Common.js: Difference between revisions

The comprehensive free global encyclopedia of CEOs, corporate leadership, and business excellence
Remove duplicate copyright footer JavaScript - copyright text is already in MediaWiki:Copyright
Tag: Replaced
Restore copyright footer at bottom of page - single occurrence only
Line 1: Line 1:
/* Common.js - Site-wide JavaScript */
/* Common.js - Site-wide JavaScript */
/* Copyright footer is handled by MediaWiki:Copyright message - no JavaScript needed */
 
/* Add copyright footer to bottom of page (single occurrence) */
$(document).ready(function() {
    // Only add if not already present
    if ($('body').html().indexOf('CEO.wiki is operated as an independent') === -1) {
        var copyright = '<div id="footer-info-copyright" style="text-align: center; padding: 20px; background: #f8f9fa; border-top: 1px solid #ddd; margin-top: 40px; font-size: 0.85em; line-height: 1.6;">Text is available under the <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="nofollow">Creative Commons Attribution-ShareAlike 4.0 License</a>; additional terms may apply. By using this site, you agree to the <a href="/wiki/CEO.wiki:Terms_of_Use">Terms of Use</a>, <a href="/wiki/CEO.wiki:Privacy_Policy">Privacy Policy</a>, and all <a href="/wiki/CEO.wiki:General_disclaimer">disclaimers</a>. CEO.wiki is operated as an independent collaborative encyclopedia project and is not affiliated with Wikipedia or the Wikimedia Foundation. See our <a href="/wiki/CEO.wiki:Takedown_Request_Policy">Takedown Request Policy</a> for content concerns.</div>';
       
        // Try to find the best place to append it
        if ($('.mw-footer').length) {
            $('.mw-footer').after(copyright);
        } else if ($('#footer').length) {
            $('#footer').after(copyright);
        } else if ($('.mw-page-container').length) {
            $('.mw-page-container').append(copyright);
        } else {
            $('body').append(copyright);
        }
    }
});

Revision as of 18:20, 21 October 2025

/* Common.js - Site-wide JavaScript */

/* Add copyright footer to bottom of page (single occurrence) */
$(document).ready(function() {
    // Only add if not already present
    if ($('body').html().indexOf('CEO.wiki is operated as an independent') === -1) {
        var copyright = '<div id="footer-info-copyright" style="text-align: center; padding: 20px; background: #f8f9fa; border-top: 1px solid #ddd; margin-top: 40px; font-size: 0.85em; line-height: 1.6;">Text is available under the <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="nofollow">Creative Commons Attribution-ShareAlike 4.0 License</a>; additional terms may apply. By using this site, you agree to the <a href="/wiki/CEO.wiki:Terms_of_Use">Terms of Use</a>, <a href="/wiki/CEO.wiki:Privacy_Policy">Privacy Policy</a>, and all <a href="/wiki/CEO.wiki:General_disclaimer">disclaimers</a>. CEO.wiki is operated as an independent collaborative encyclopedia project and is not affiliated with Wikipedia or the Wikimedia Foundation. See our <a href="/wiki/CEO.wiki:Takedown_Request_Policy">Takedown Request Policy</a> for content concerns.</div>';
        
        // Try to find the best place to append it
        if ($('.mw-footer').length) {
            $('.mw-footer').after(copyright);
        } else if ($('#footer').length) {
            $('#footer').after(copyright);
        } else if ($('.mw-page-container').length) {
            $('.mw-page-container').append(copyright);
        } else {
            $('body').append(copyright);
        }
    }
});