MediaWiki:Common.js: Difference between revisions

Content deleted Content added
No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 318:
var $footer = $('.ext-aiassistant-footer');
// Wait until the footer exists
if ($footer.length) {
clearInterval(checkFooter);
// Prevent duplicate buttons
if ($('#ai-assistant-close-mobile').length === 0) {
// 1. Create the button
// We use the EXACT same Codex classes as the Send button for visual consistency
var $closeBtn = $('<button>', {
id: 'ai-assistant-close-mobile',
class: 'cdx-button cdx-button--action-progressive cdx-button--weight-primary cdx-button--size-medium cdx-button--framedquiet cdx-button--icon-only', // Removed "primary" class to remove default blue
title: 'Close Assistant',
click: function() {
// Action:1. Hide the panel when clicked
$('.ext-aiassistant-panel').hide();
// 2. SHOW THE CHAT ICON AGAIN
$('.ext-aiassistant-trigger').show();
}
});
 
// 2. Add the "X" Icon (SVG)
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="whitecurrentColor"/></svg></span>';
$closeBtn.html(iconSvg);
 
// 3. Prepend to footer (Places it on the LEFT of the text input)
$footer.prepend($closeBtn);
}
}
}, 200); // Check every 200ms
});