用户:我的老婆叫王冠

出自【暗黑百科】DiabloWiki_凯恩之角

(修订版本间的差异)
跳转到: 导航, 搜索
(以内容“ 此人很懒 什么也没留下”创建新页面)
第1行: 第1行:
-
 
此人很懒
此人很懒
什么也没留下
什么也没留下
 +
 +
{{extension
 +
|name        = ImageMap
 +
|author      = Tim Starling
 +
|username    = Tim Starling
 +
|status      = stable
 +
|type        = tag
 +
|hook 1      = ParserFirstCallInit
 +
|image      =
 +
|version    = continuous updates
 +
|update      = 
 +
|mediawiki  = 1.11+
 +
|download    = {{WikimediaDownload|ImageMap}}
 +
|needs-updatephp = no
 +
|readme      =
 +
|description = Allows clickable HTML image maps
 +
|example    = [http://fr.wikimini.org/wiki/Wikimini:Enfants_et_ados Children's encyclopedia]
 +
|changelog  = [https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/ImageMap.git;a=log log]
 +
|parameters  =
 +
|rights      =
 +
|hook1      = ParserFirstCallInit
 +
|license    = {{Tim Starling license}}
 +
|bugzilla    = ImageMap
 +
|pagedrive1  = true
 +
}}
 +
'''ImageMap''' is an extension which allows clickable [[w:Image map|image maps]]. An image map is a list of coordinates in a specific image, which hyperlinks areas of the image to multiple destinations (in contrast to a normal image link, in which the entire area of the image links to a single destination). For example, a map of the world may have each country hyperlinked to further information about that country. The intention of an image map is to provide an easy way of linking various parts of an image without dividing the image into separate image files.
 +
==Examples==
 +
{{anchor|Syntax examples}}
 +
=== Simple example without caption ===
 +
<pre style="overflow:auto">
 +
<imagemap>
 +
Image:Example2.png|150px|alt=Alt text
 +
default [[Main Page|Go to main page]]
 +
</imagemap>
 +
</pre>
 +
<imagemap>
 +
Image:Example2.png|150px|alt=Alt text
 +
default [[Main Page|Go to main page]]
 +
</imagemap>
 +
The above example always links to the [[Main Page]], no matter where you click on it. To find out more about the image, click on the blue "i" icon [[Image:Desc-20.png|link=|alt=]].
 +
=== Complex example with caption ===
 +
<pre style="overflow:auto;">
 +
<imagemap>
 +
Image:JoshuaReynoldsParty.jpg|thumb|left|400px|alt=Dining room with nine men seated around a table. The dinner has been finished, and a large man at the head talks and gesticulates while the others eagerly listen. The men wear wigs and clothing of late 18th century Britain, and the furniture, hangings, and chandelier are of similar vintage. A liveried servant is entering with a tray bearing two high-shouldered decanters of wine.|Image map example. Clicking on a person in the picture causes the browser to load the appropriate article.
 +
poly 133 343 124 287 159 224 189 228 195 291 222 311 209 343 209 354 243 362 292 466 250 463 [[w:Samuel Johnson|Dr Johnson - Dictionary writer]]
 +
poly 76 224 84 255 43 302 62 400 123 423 121 361 137 344 122 290 111 234 96 225 [[w:James Boswell|Boswell - Biographer]]
 +
poly 190 276 208 240 229 228 247 238 250 258 286 319 282 323 223 323 220 301 200 295 [[w:Joshua Reynolds|Sir Joshua Reynolds - Host]]
 +
poly 308 317 311 270 328 261 316 246 320 228 343 227 357 240 377 274 366 284 352 311 319 324 [[w:David Garrick|David Garrick - actor]]
 +
poly 252 406 313 343 341 343 366 280 383 273 372 251 378 222 409 228 414 280 420 292 390 300 374 360 359 437 306 418 313 391 272 415 [[w:Edmund Burke|Edmund Burke - statesman]]
 +
rect 418 220 452 287 [[w:Pasquale Paoli|Pasqual Paoli - Corsican patriot]]
 +
poly 455 238 484 253 505 303 495 363 501 377 491 443 429 439 423 375 466 352 [[w:Charles Burney|Charles Burney - music historian]]
 +
poly 501 279 546 237 567 239 572 308 560 326 537 316 530 300 502 289 [[w:Thomas Warton|Thomas Warton - poet laureate]]
 +
poly 572 453 591 446 572 373 603 351 562 325 592 288 573 260 573 248 591 243 615 254 637 280 655 334 705 396 656 419 625 382 609 391 613 453 [[w:Oliver Goldsmith|Oliver Goldsmith - writer]]
 +
rect 450 86 584 188 [[w:Joshua Reynolds|prob.The Infant Academy 1782]]
 +
rect 286 87 376 191 [[w:Joshua Reynolds|unknown painting]]
 +
circle 100 141 20 [[w:Joshua Reynolds|An unknown portrait]]
 +
poly 503 192 511 176 532 176 534 200 553 219 554 234 541 236 525 261 506 261 511 220 515 215 [[w:Francis Barber|servant - poss. Francis Barber]]
 +
rect 12 10 702 500 [[w:The Club (Literary Club)|Use button to enlarge or use hyperlinks]]
 +
</imagemap>
 +
</pre>
 +
<imagemap>
 +
Image:JoshuaReynoldsParty.jpg|thumb|center|400px|alt=Dining room with nine men seated around a table. The dinner has been finished, and a large man at the head talks and gesticulates while the others eagerly listen. The men wear wigs and clothing of late 18th century Britain, and the furniture, hangings, and chandelier are of similar vintage. A liveried servant is entering with a tray bearing two high-shouldered decanters of wine.|Image map example. Clicking on a person in the picture causes the browser to load the appropriate article.
 +
poly 133 343 124 287 159 224 189 228 195 291 222 311 209 343 209 354 243 362 292 466 250 463 [[w:Samuel Johnson|Dr Johnson - Dictionary writer]]
 +
poly 76 224 84 255 43 302 62 400 123 423 121 361 137 344 122 290 111 234 96 225 [[w:James Boswell|Boswell - Biographer]]
 +
poly 190 276 208 240 229 228 247 238 250 258 286 319 282 323 223 323 220 301 200 295 [[w:Joshua Reynolds|Sir Joshua Reynolds - Host]]
 +
poly 308 317 311 270 328 261 316 246 320 228 343 227 357 240 377 274 366 284 352 311 319 324 [[w:David Garrick|David Garrick - actor]]
 +
poly 252 406 313 343 341 343 366 280 383 273 372 251 378 222 409 228 414 280 420 292 390 300 374 360 359 437 306 418 313 391 272 415 [[w:Edmund Burke|Edmund Burke - statesman]]
 +
rect 418 220 452 287 [[w:Pasquale Paoli|Pasqual Paoli - Corsican patriot]]
 +
poly 455 238 484 253 505 303 495 363 501 377 491 443 429 439 423 375 466 352 [[w:Charles Burney|Charles Burney - music historian]]
 +
poly 501 279 546 237 567 239 572 308 560 326 537 316 530 300 502 289 [[w:Thomas Warton|Thomas Warton - poet laureate]]
 +
poly 572 453 591 446 572 373 603 351 562 325 592 288 573 260 573 248 591 243 615 254 637 280 655 334 705 396 656 419 625 382 609 391 613 453 [[w:Oliver Goldsmith|Oliver Goldsmith - writer]]
 +
rect 450 86 584 188 [[w:Joshua Reynolds|prob.The Infant Academy 1782]]
 +
rect 286 87 376 191 [[w:Joshua Reynolds|unknown painting]]
 +
circle 100 141 20 [[w:Joshua Reynolds|An unknown portrait]]
 +
poly 503 192 511 176 532 176 534 200 553 219 554 234 541 236 525 261 506 261 511 220 515 215 [[w:Francis Barber|servant - poss. Francis Barber]]
 +
rect 12 10 702 500 [[w:The Club (Literary Club)|Use button to enlarge or use hyperlinks]]
 +
</imagemap>
 +
The above example links to many different pages, depending on where you click it. To find out more about the image, click on the double-rectangle icon [[Image:Magnify-clip.png|link=|alt=]].
 +
==Syntax description==
 +
The contents of an &lt;imagemap> tag consists of blank lines, comments (starting with #) and logical lines. The first logical line specifies the image to be displayed. This must be in the same format as an ordinary MediaWiki image link, except without the enclosing <nowiki>[[</nowiki> and <nowiki>]]</nowiki>. If the first line specifies a "<code>thumb</code>" or "<code>frame</code>" image, then the first line's caption and any {{para|alt}} parameter are treated as the image's caption and alt text in the usual way; otherwise, the first line's {{para|alt}} parameter (or, if absent, any caption) specifies the image's alt text. In neither case does the image itself have title text (often used for tooltips); any title text is taken from the regions described in later lines.
 +
Further lines are split into tokens, separated by whitespace. The function of each line is determined by the first token in the line. '''All coordinates are according to the full-size image, not the visible image'''.  They should be specified as distance from left edge (horizontal pixel count), distance from top (vertical pixel count).
 +
; desc : Specifies the location of the image description link. May be either top-right, bottom-right, bottom-left, top-left or none. This puts a blue "i" icon [[Image:Desc-20.png|link=|alt=]] in the specified corner, linking to the image description page. The default is bottom-right. To hide the description link, set it to <tt>none</tt>. Possible values: <tt>top-right</tt>, <tt>bottom-right</tt>, <tt>bottom-left</tt>, <tt>top-left</tt>, <tt>none</tt>. This parameter is ignored for "<code>thumb</code>" or "<code>frame</code>" images, which instead employ the usual double-rectangle icon [[Image:Magnify-clip.png|link=|alt=]].
 +
::''Example:''
 +
:::<nowiki><imagemap></nowiki>
 +
:::<nowiki>Image:PolierMartinWombwellZoffany.jpg|thumb|200px|Colonel Antoine Polier</nowiki>
 +
:::<nowiki>rect 269 140 344 305 [[Claude Martin]]</nowiki>
 +
:::<nowiki>rect 124 147 181 298 [[Antoine Polier|Antoine-Louis Polier]]</nowiki>
 +
:::desc none
 +
:::<nowiki></imagemap></nowiki>
 +
; poly: A polygon. The coordinates of the vertices are given, followed by a link in square brackets.<br>'''Polygons must be defined before any other form!'''
 +
; rect : A rectangle. The parameters are the coordinates of the top-left and bottom-right corners, followed by a title to link to in square brackets. 
 +
; circle: A circle. The first two parameters are the coordinates of the center, the third is the radius. The coordinates are followed by a link in square brackets.
 +
; default: This gives the default link, where no other regions are specified. 
 +
All coordinates are specified relative to the source image. The image can be scaled using thumbnail syntax, in which case the image map coordinates will be automatically scaled as well. 
 +
All links are given in either the form <nowiki>[[Page title]]</nowiki> or <nowiki>[[Page title|description]]</nowiki>. In the latter case, the part after the pipe "|" becomes the title attribute of the link—in most browsers, it will pop up as a tooltip when the user hovers over it; the part after the pipe also becomes the alt text for the link. If no explicit link description is given, the page title is used.
 +
Areas which overlap give precedence to the first link listed.
 +
== Installation Guide ==
 +
# [[Download from Git|Download the files from Git]] or [[Special:ExtensionDistributor/ImageMap|download a snapshot]] (select your version of MediaWiki) and place the files under <tt>[[Manual:$IP|$IP]]/extensions/ImageMap</tt>
 +
# Add to the end of [[Manual:LocalSettings.php|LocalSettings.php]]: <syntaxhighlight lang="php" enclose="div">require_once("$IP/extensions/ImageMap/ImageMap.php");</syntaxhighlight>
 +
# Installation can now be verified through [[Special:Version]] on your wiki<br clear="all" />
 +
;Troubleshooting:
 +
# Check to see if your php DOM is turned on. You may need to install it if it is not.
 +
# Check whether [[Manual:Image Administration|ImageMagick]] is installed, since this extension relies on /usr/bin/convert for the resizing. If it is not present, you could get a page with only XML errors (tip: use the back-button in the browser, because you can still edit the page).
 +
=== Parameters to allow external links ===
 +
{{note|1=This parameter has been removed in the latest version (Revision 23292).  It now always permits external links.}}
 +
For older releases:
 +
:Note that the extension parameters must be below the extension's require_once()
 +
:* <tt>$wgImageMapAllowExternalLinks = false</tt>
 +
:*:Set this to true to enable external links (
 +
http://www.example.com
 +
) as link destination
 +
==Usage with templates==
 +
If you want this extension (as with most tag extensions) to parse template parameters, magic words, or parser functions, you will need to use [[Help:Magic_words#Miscellaneous|'''#tag''' syntax]], such as [http://en.wikipedia.org/w/index.php?title=Template:Click&action=edit&oldid=203294753 w:Template:Click] did.
 +
==See also==
 +
;Instructions
 +
* Read [[Extension:ImageMap (Alternate)#Choosing an ImageMap Extension|choosing an ImageMap extension]] before deciding on which ImageMap extension to use.
 +
* A simple guide on how to use the Image Map editor with the ImageMap extension can be found [http://www.wikihow.com/Use-the-MediaWiki-ImageMap-Extension on wikiHow].
 +
* Existing image maps examples: [[w:Category:Wikipedia image maps]]
 +
;Online tools
 +
* [http://toolserver.org/~dapete/ImageMapEdit/ImageMapEdit.html?en Image Map Edit]
 +
* [http://www.maschek.hu/imagemap/imgmap Online image map editor], supports all shapes, Extension:ImageMap compatible. 
 +
* [http://www.image-maps.com/index.php? Basic on-line image mapper].
 +
;Extensions
 +
* [[meta:User:Dapete/ImageMapEdit#English|A graphical tool to determine the coordinates]] 
 +
* In case you use [[Extension:FCKeditor_(Official)|FCKEditor]] or [[Extension:WYSIWYG|WYSIWYG]] on your wiki [http://martinezdelizarrondo.com/fckplugins/imgmap/docs/install.html?en plugin] for ImageMap may be added which makes imagemapping from within your wiki a breeze ([http://code.google.com/p/imgmap/downloads/list Zip file download]).
 +
* The [[Extension:ImageMapConversion]] can be used to convert HTML format image map information into the format for this extension.
 +
 +
{{OnWikimedia}}
 +
{{languages}}
 +
[[Category:Link extensions]]
 +
[[Category:Image map extensions]]

在2012年4月2日 (一) 14:39所做的修订版本

此人很懒 什么也没留下

模板:Extension ImageMap is an extension which allows clickable image maps. An image map is a list of coordinates in a specific image, which hyperlinks areas of the image to multiple destinations (in contrast to a normal image link, in which the entire area of the image links to a single destination). For example, a map of the world may have each country hyperlinked to further information about that country. The intention of an image map is to provide an easy way of linking various parts of an image without dividing the image into separate image files.

目录

Examples

模板:Anchor

Simple example without caption

<imagemap>
Image:Example2.png|150px|alt=Alt text
default [[Main Page|Go to main page]]
</imagemap>

错误: 图像不正确或者不存在

The above example always links to the Main Page, no matter where you click on it. To find out more about the image, click on the blue "i" icon 文件:Desc-20.png.

Complex example with caption

<imagemap>
Image:JoshuaReynoldsParty.jpg|thumb|left|400px|alt=Dining room with nine men seated around a table. The dinner has been finished, and a large man at the head talks and gesticulates while the others eagerly listen. The men wear wigs and clothing of late 18th century Britain, and the furniture, hangings, and chandelier are of similar vintage. A liveried servant is entering with a tray bearing two high-shouldered decanters of wine.|Image map example. Clicking on a person in the picture causes the browser to load the appropriate article.
poly 133 343 124 287 159 224 189 228 195 291 222 311 209 343 209 354 243 362 292 466 250 463 [[w:Samuel Johnson|Dr Johnson - Dictionary writer]]
poly 76 224 84 255 43 302 62 400 123 423 121 361 137 344 122 290 111 234 96 225 [[w:James Boswell|Boswell - Biographer]]
poly 190 276 208 240 229 228 247 238 250 258 286 319 282 323 223 323 220 301 200 295 [[w:Joshua Reynolds|Sir Joshua Reynolds - Host]]
poly 308 317 311 270 328 261 316 246 320 228 343 227 357 240 377 274 366 284 352 311 319 324 [[w:David Garrick|David Garrick - actor]]
poly 252 406 313 343 341 343 366 280 383 273 372 251 378 222 409 228 414 280 420 292 390 300 374 360 359 437 306 418 313 391 272 415 [[w:Edmund Burke|Edmund Burke - statesman]]
rect 418 220 452 287 [[w:Pasquale Paoli|Pasqual Paoli - Corsican patriot]]
poly 455 238 484 253 505 303 495 363 501 377 491 443 429 439 423 375 466 352 [[w:Charles Burney|Charles Burney - music historian]]
poly 501 279 546 237 567 239 572 308 560 326 537 316 530 300 502 289 [[w:Thomas Warton|Thomas Warton - poet laureate]]
poly 572 453 591 446 572 373 603 351 562 325 592 288 573 260 573 248 591 243 615 254 637 280 655 334 705 396 656 419 625 382 609 391 613 453 [[w:Oliver Goldsmith|Oliver Goldsmith - writer]]
rect 450 86 584 188 [[w:Joshua Reynolds|prob.The Infant Academy 1782]]
rect 286 87 376 191 [[w:Joshua Reynolds|unknown painting]]
circle 100 141 20 [[w:Joshua Reynolds|An unknown portrait]]
poly 503 192 511 176 532 176 534 200 553 219 554 234 541 236 525 261 506 261 511 220 515 215 [[w:Francis Barber|servant - poss. Francis Barber]]
rect 12 10 702 500 [[w:The Club (Literary Club)|Use button to enlarge or use hyperlinks]]
</imagemap>

错误: 图像不正确或者不存在

The above example links to many different pages, depending on where you click it. To find out more about the image, click on the double-rectangle icon .

Syntax description

The contents of an <imagemap> tag consists of blank lines, comments (starting with #) and logical lines. The first logical line specifies the image to be displayed. This must be in the same format as an ordinary MediaWiki image link, except without the enclosing [[ and ]]. If the first line specifies a "thumb" or "frame" image, then the first line's caption and any 模板:Para parameter are treated as the image's caption and alt text in the usual way; otherwise, the first line's 模板:Para parameter (or, if absent, any caption) specifies the image's alt text. In neither case does the image itself have title text (often used for tooltips); any title text is taken from the regions described in later lines. Further lines are split into tokens, separated by whitespace. The function of each line is determined by the first token in the line. All coordinates are according to the full-size image, not the visible image. They should be specified as distance from left edge (horizontal pixel count), distance from top (vertical pixel count).

desc 
Specifies the location of the image description link. May be either top-right, bottom-right, bottom-left, top-left or none. This puts a blue "i" icon 文件:Desc-20.png in the specified corner, linking to the image description page. The default is bottom-right. To hide the description link, set it to none. Possible values: top-right, bottom-right, bottom-left, top-left, none. This parameter is ignored for "thumb" or "frame" images, which instead employ the usual double-rectangle icon .
Example:
<imagemap>
Image:PolierMartinWombwellZoffany.jpg|thumb|200px|Colonel Antoine Polier
rect 269 140 344 305 [[Claude Martin]]
rect 124 147 181 298 [[Antoine Polier|Antoine-Louis Polier]]
desc none
</imagemap>
poly
A polygon. The coordinates of the vertices are given, followed by a link in square brackets.
Polygons must be defined before any other form!
rect 
A rectangle. The parameters are the coordinates of the top-left and bottom-right corners, followed by a title to link to in square brackets.
circle
A circle. The first two parameters are the coordinates of the center, the third is the radius. The coordinates are followed by a link in square brackets.
default
This gives the default link, where no other regions are specified.

All coordinates are specified relative to the source image. The image can be scaled using thumbnail syntax, in which case the image map coordinates will be automatically scaled as well. All links are given in either the form [[Page title]] or [[Page title|description]]. In the latter case, the part after the pipe "|" becomes the title attribute of the link—in most browsers, it will pop up as a tooltip when the user hovers over it; the part after the pipe also becomes the alt text for the link. If no explicit link description is given, the page title is used. Areas which overlap give precedence to the first link listed.

Installation Guide

  1. Download the files from Git or download a snapshot (select your version of MediaWiki) and place the files under $IP/extensions/ImageMap
  2. Add to the end of LocalSettings.php: <syntaxhighlight lang="php" enclose="div">require_once("$IP/extensions/ImageMap/ImageMap.php");</syntaxhighlight>
  3. Installation can now be verified through Special:Version on your wiki
Troubleshooting
  1. Check to see if your php DOM is turned on. You may need to install it if it is not.
  2. Check whether ImageMagick is installed, since this extension relies on /usr/bin/convert for the resizing. If it is not present, you could get a page with only XML errors (tip: use the back-button in the browser, because you can still edit the page).

Parameters to allow external links

模板:Note For older releases:

Note that the extension parameters must be below the extension's require_once()
  • $wgImageMapAllowExternalLinks = false
    Set this to true to enable external links (

http://www.example.com ) as link destination

Usage with templates

If you want this extension (as with most tag extensions) to parse template parameters, magic words, or parser functions, you will need to use #tag syntax, such as w:Template:Click did.

See also

Instructions
Online tools
Extensions

模板:OnWikimedia 模板:Languages

个人工具
分享到: 更多
名字空间
变换
动作
网站地图
暗黑破坏神 III
暗黑破坏神 II
暗黑破坏神
工具箱
编辑箱
关于暗黑百科