mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-25 14:57:31 +00:00
eec5c6fd64
Search commands start withs slash and includes: action, rest, ask
22 lines
439 B
JavaScript
22 lines
439 B
JavaScript
function searchQuery() {
|
|
return {
|
|
value: null,
|
|
valueHtml: null,
|
|
isValid: false,
|
|
setValue: function ( s ) {
|
|
this.value = s;
|
|
this.valueHtml = mw.html.escape( s );
|
|
this.isValid = this.checkValid( s );
|
|
},
|
|
checkValid: function ( s ) {
|
|
return s.length > 0;
|
|
},
|
|
removeCommand: function ( s ) {
|
|
this.setValue( this.value.replace( `/${s} `, '' ) );
|
|
}
|
|
};
|
|
}
|
|
|
|
/** @module searchQuery */
|
|
module.exports = searchQuery;
|