Page MenuHomeWickedGov Phorge

SpecialPage.js
No OneTemporary

Size
694 B
Referenced Files
None
Subscribers
None

SpecialPage.js

'use strict';
/**
* @class
*
* @constructor
*/
function SpecialPage() {
this.templateSearchWidget = document.getElementById( 'ext-TemplateData-SpecialTemplateSearch-widget' );
if ( !this.templateSearchWidget ) {
// Throw an error if the required elements are not found
throw new Error( 'Required elements not found' );
}
}
/**
* Initialize the special page
*/
SpecialPage.prototype.init = function () {
const searchForm = new mw.templateData.TemplateSearchLayout();
this.templateSearchWidget.append( searchForm.$element[ 0 ] );
searchForm.focus();
searchForm.on( 'choose', ( item ) => {
location.href = mw.util.getUrl( item.title );
} );
};
module.exports = SpecialPage;

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 22, 23:46 (2 d, 17 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
10/d0/676c0e3f0e7f86033b84dd30ad6f
Default Alt Text
SpecialPage.js (694 B)

Event Timeline