MediaWiki:Common.js: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 312:
/* ======================================================= */
$(function() {
// Run an interval to check for the footer appearing (handles slow loading)
// Only run on mobile devices
if (window.innerWidth > 768) return;
 
var checkFooter = setInterval(function() {
var $footer = $('.ext-aiassistant-footer');
Line 321 ⟶ 319:
clearInterval(checkFooter);
// Prevent duplicates
if ($('#ai-assistant-close-mobile').length === 0) {
var $closeBtn = $('<button>', {
id: 'ai-assistant-close-mobile',
class:// 'cdx-buttonUse cdx-button--weight-'quiet cdx-button--icon-only', //class Removedso "primary"it classdoesn't conflict with toour removecustom defaultCSS bluecolors
class: 'cdx-button cdx-button--weight-quiet cdx-button--icon-only',
title: 'Close Assistant',
click: function() {
// 1. Hide the panel
$('.ext-aiassistant-panel').hide();
// 2. SHOW THE CHAT ICON AGAIN
$('// 2.ext-aiassistant-trigger').show FORCE SHOW THE CHAT ICON (TRIGGER);
// We use attr('style') to override any !important hidden rules
$('.ext-aiassistant-trigger').attr('style', 'display: block !important');
}
});
 
// Icon SVG (X shape)
var iconSvg = '<span class="cdx-icon cdx-icon--medium"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path d="M4.34 2.93l12.73 12.73-1.41 1.41L2.93 4.35z"/><path d="M17.07 4.34L4.34 17.07l-1.41-1.41L15.66 2.93z" fill="currentColor"/></svg></span>';
$closeBtn.html(iconSvg);
 
// Prepend to put it on the Left side
$footer.prepend($closeBtn);
}