מדיה ויקי:Gadget-ondemand-Imagemap-Highlight.js: הבדלים בין גרסאות בדף

ניסוי
 
 
(10 גרסאות ביניים של 3 משתמשים אינן מוצגות)
שורה 19: שורה 19:




function drawMarker(context, areas) { // this is where the magic is done.
function drawMarker(context, areas) { // mthis is where the magic is done.


function drawPoly(coords) {
function drawPoly(coords) {
שורה 114: שורה 114:
var someli; // select arbitrary one
var someli; // select arbitrary one
$('area', map).each(function() {
$('area', map).each(function() {
var text = this.title;
var text = mw.html.escape(this.title);
var li = lis[text]; // title already met? use the same li
var li = lis[text]; // title already met? use the same li
if (!li) { //no? create a new one.
if (!li) { //no? create a new one.
שורה 127: שורה 127:
li.data('areas').push(this); //add the area to the li
li.data('areas').push(this); //add the area to the li
someli = li; // whichever - we just want one...
someli = li; // whichever - we just want one...
$(this).on('mouseover mouseout', function(e) {li.trigger(e);});
$(this).on('mouseover mouseout',  
function(e) {
li.trigger(e.type);
});
});
});
if (someli) someli.trigger('mouseout');
if (someli) someli.trigger('mouseout');
ol.addClass('mw-collapsed')
mw.loader.using('jquery.makeCollapsible').then( function () {
.makeCollapsible();
ol.addClass('mw-collapsed')
.makeCollapsible();
});
}
}