Otvori glavni meni
Početna
Slučajna
Prijavi me
Postavke
O Sandžakpedija
Odricanje odgovornosti
Traži
Ramazan mubarek olsun 🌙
Vaktija »
Izmjene
← Starija izmjena
Novija izmjena →
MediaWiki:Common.js
(pogledaj izvor)
Verzija na dan 19 maj 2020 u 23:10
Dodan 631 bajt
,
23:10, 19 maj 2020
nema sažetka izmjene
Red 1:
Red 1:
/* Bilo koja JavaScript će biti učitana za sve korisnike pri svakom učitavanju stranice. */
/* Bilo koja JavaScript će biti učitana za sve korisnike pri svakom učitavanju stranice. */
−
document.getElementById
('
searchform
').
action
=
'/index
.
php'
;
+
( function ( mw, $ ) {
−
document
.
getElementsByName
('search')[
0
]
.id = 'searchInput'
;
+
$( function () {
+
$
( '
.searchboxInput
' ).
autocomplete( { //This is the class Name of your desired input
+
source: function( request, response ) {
+
// Create a new Api object (see [[RL/DM#mediawiki.api]]
+
var api
=
new mw
.
Api()
;
+
// Start a "GET" request
+
api
.
get
(
{
+
action:
'
opensearch',
+
search
: request.term, // This is the current value of the user's input
+
suggest:
'
'
+
}
)
.done( function ( data ) {
+
response( data
[
1
]
); // set the results as the autocomplete options
+
} );
+
}
+
} );
+
} );
+
}( mediaWiki, jQuery ) )
;
Sila
Birokrati
,
Administratori interfejsa
,
Administratori
4.478
izmjena