Jump to content

MediaWiki:Common.js: Difference between revisions

From National War Memorial
Created page with " // Scroll to top on page load or refresh window.addEventListener('load', function() { window.scrollTo({ top: 0, behavior: 'smooth' }); }); →--- VERIFIED BADGE SCRIPT (Twitter-style, inline with title) ---: mw.loader.using('mediawiki.util').then(function () { $(function () { →Badge + Popup HTML (matches your CSS exactly): const badgeHTML = ` <span class="verified-badge" aria-label="Verified"> <img class="badge-icon" s..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 28: Line 28:
                 alt="Verified icon">
                 alt="Verified icon">
              
              
             <div class="popup-text">
             <div class="popup-text">The Blue checkmark indicates a verified profile, memorial or official authenticated by <a href="https://nationalwarmemorial.org">NationalWarMemorial.org.</a>  
Profiles or memorials marked with the Blue Tick have been officially verified by <a href="#">NationalWarMemorial.org.</a> Verification confirms the authenticity of the martyr’s identity, service details, and records, based on official documents, family validation, or authorized sources.
It represents confirmed service history, validated identity, and recognition as part of India’s permanent national archive.
             </div>
             </div>
           </div>
           </div>

Latest revision as of 03:58, 22 December 2025


// Scroll to top on page load or refresh
window.addEventListener('load', function() {
    window.scrollTo({ top: 0, behavior: 'smooth' });
});



/* --- VERIFIED BADGE SCRIPT (Twitter-style, inline with title) --- */
mw.loader.using('mediawiki.util').then(function () {
  $(function () {

    /* Badge + Popup HTML (matches your CSS exactly) */
    const badgeHTML = `
      <span class="verified-badge" aria-label="Verified">
        <img class="badge-icon" 
             src="https://upload.wikimedia.org/wikipedia/commons/e/e4/Twitter_Verified_Badge.svg" 
             width="20" height="20" 
             alt="Verified">

        <div class="verified-popup" role="dialog" aria-hidden="true">
          <div class="popup-title">Verified</div>

          <div class="popup-description">
            <img class="inline-verified-icon"
                 src="https://upload.wikimedia.org/wikipedia/commons/e/e4/Twitter_Verified_Badge.svg"
                 width="16" height="16"
                 alt="Verified icon">
            
            <div class="popup-text">The Blue checkmark indicates a verified profile, memorial or official authenticated by <a href="https://nationalwarmemorial.org">NationalWarMemorial.org.</a> 
It represents confirmed service history, validated identity, and recognition as part of India’s permanent national archive.
            </div>
          </div>
        </div>
      </span>
    `;

    /* Add badge inline with page title */
    const heading = $(".firstHeading");
    heading.css({
      "display": "inline-flex",
      "align-items": "center",
      "gap": "6px"
    });

    heading.append(badgeHTML);

  });
});