MediaWiki:Gadget-ImageAnnotator.js: Difference between revisions
Content deleted Content added
Migrate from legacy globals and hardcoded script paths to using getUrl() and wikiScript(); Also hoist functions that were nested in if() blocks, Javascript doesn't support this and just hoists them unconditonally to the nearest top of a function scope. |
spaceywacy |
||
Line 163:
'div', null
, { lineHeight : '0px' // IE
,fontSize
,width
,height
}
)
Line 433:
new LAPI.Edit(
'' , editor_width, 6
, { box
,preview
,save
,revert
,cancel
,nullsave : ImageAnnotator_config.mayDelete()
? ImageAnnotator.UI.get('wpImageAnnotatorDelete', true).capitalizeFirst()
: null
,post
}
, {
onsave
,onpreview : this.onpreview.bind(this)
,oncancel
,ongettext: function (text) {
if (text == null) return '';
Line 487:
IA.get_cover()
, this.get_editor.bind(this)
, { activate
,deactivate
,close_button : null // We have a cancel button anyway
,mode
,anchor
,mouse_offset
,max_pixels
,z_index
,open_delay
,hide_delay
,onclose
}
, IA.tooltip_styles
Line 948:
LAPI.make(
'div', null
, { cssFloat
,styleFloat: (IA.is_rtl ? 'right' : 'left') // For IE...
,width
,position
}
);
Line 1,374:
// for drawing rectangles onto the image if there is only one image and editing is allowed.
haveAjax
button_div
add_button
cover
border
definer
mouse_in
mouse_out
annotation_class
// Format of notes in Wikitext. Note: there are two formats, an old one and a new one.
Line 1,392:
// important, because the old format also used the ImageNote template, but for a different
// purpose.
note_delim
[
{ start
,end
,content_start
,content_end
}
,{ start
,end
,content_start
,content_end
}
],
Line 1,781:
}
}
return { scope
,file_div
,img
,realName
,isThumbnail: is_thumb
,isOther
,thumb
,iconOnly
,noCaption
};
}
Line 1,969:
LAPI.Ajax.apiGet(
'query'
, { titles
,prop
,inprop
,iiprop
}
, function (request, json_result) {
Line 2,297:
self.base_y = mouse_pos.y - origin.y;
Object.merge(
{ left
,top
,width
,height
,display: ''
}
Line 2,330:
LAPI.make(
'div', null
,{ border
,display
,position
,top
,left
,width
,height
,padding
,lineHeight
,fontSize
,zIndex
}
);
Line 2,731:
if (!self.zoom) {
self.zoom =
LAPI.make('div',
{ id: '
top: '0px',
left: '0px', border:
zIndex:
▲ }
);
var src = self.viewers[0].img.getAttribute('src', 2);
Line 2,750:
if (self.zoom_factor > self.viewers[0].factors.dx || self.zoom_factor > self.viewers[0].factors.dy)
self.zoom_factor = Math.min(self.viewers[0].factors.dx, self.viewers[0].factors.dy);
self.zoom.appendChild(LAPI.make('div', null, { position : 'relative' }));
// Calculate zoom size and source link
var zoom_width = Math.floor(self.viewers[0].thumb.width * self.zoom_factor);
Line 2,773:
LAPI.make(
'div', null
, { width
,height
,borderLeft
,position
,top
,left
}
)
Line 2,785:
LAPI.make(
'div', null
, { width
,height
,borderTop
,position
,top
,left
}
)
Line 2,920:
var shim;
if (!self.cover) {
var pos = { position
,left
,top
,width
,height
};
self.cover = LAPI.make('div', null, pos);
Line 2,946:
shim = LAPI.make('div', null, pos);
Object.merge(
{ top
,backgroundImage: 'url(' + self.viewers[0].img.src + ')'
,zIndex
}
, shim.style
|