Template:FileContentsByBot/areas/doc

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Contains the required markup to represent the coordinates and dimension detected by a bot.

Usage

{{FileContentsByBot/areas |1= |left1= |top1= |height1= |width1= |left2= |top2= |height2= |width2= |10= }}

Template parameters

ParameterDescriptionDefaultStatus
1The item's type. E.g. eye, facePosition. This must be a valid class name (HTML).emptyrequired
left1The first item's leftmost coordinate in px. Number only. Type: Integer.
Field's class: type1-position-left.
emptyrequired
top1The first item's topmost coordinate in px. Number only. Type: Integer.
Field's class: type1-position-top.
emptyrequired
height1The first item's height in px. Number only. Type: Integer.
Field's class: type1-height.
emptyrequired
width1The first item's width in px. Number only. Type: Integer.
Field's class: type1-width.
emptyrequired
left2The second item's leftmost coordinate in px. Number only. Type: Integer.
Field's class: type2-position-left.
emptyoptional
top2The second item's topmost coordinate in px. Number only. Type: Integer.
Field's class: type2-position-top.
emptyoptional
height2The second item's height in px. Number only. Type: Integer.
Field's class: type2-height.
emptyoptional
width2The second item's width in px. Number only. Type: Integer.
Field's class: type2-width.
emptyoptional
10emptyoptional

Additional information

The template is intended to be used in the following namespaces: the File namespace

The template is intended to be used by the following user groups: Bots

Placement:

inside e.g. {{FileContentsByBot/Faces}} (as parameter eyes)

See also

Localization

This template is not intended to be localized.

// Example reading all face's coordinates
$('#fileContentsByBot').find('.face-detected-by-bot').each(function(i, el) {
   var $el = $(el),
       id = $el.find('.face-detected-by-bot-id').text(),
       $eyePos = $el.find('.face-detected-by-bot-eyes');
       alert("Eye 1 of face " + id + " is at " + $eyePos.find('.eye1-position-left').text() + ", "  + $eyePos.find('.eye1-position-top').text() + "px.")
});