Commit graph

64 commits

Author SHA1 Message Date
Timo Tijhof 17bc7c71fa Minor code clean up
Follows-up 92dcd85c9.

* Consistent ordering of 'static' and 'public'.
* Avoid mixed use of '#' and '//' for inline comments.
* Remove redundant isset() around loop over array that always exists.
* Improve documentation of return types.

Change-Id: I40cbdd3e68b9d176f680d6c114f96372cceba414
2016-03-03 17:51:11 +00:00
Reedy b54a588f08 $title is not always defined.
Bug: T68361
Change-Id: I43682f7abc4229504ccb8c7c33527efc65508ff8
2015-12-10 22:51:18 +00:00
Kunal Mehta 4165dd5ae7 Move ParserFirstCallInit hook into static function
Change-Id: Iddaa86a53ad5977e61a0493d48173a8fdd7d3cfd
2015-05-02 23:29:25 -07:00
kghbln 527f092a26 Added or improved file documentation
* the general file documentation was added, expanded or fixed
* added check for the initialisation of the extension

Change-Id: I04a9a22f81ca3df72d7561faae32f8792dea65e8
2013-11-26 20:40:28 +01:00
Alexandre Emsenhuber fe1e7bf887 Misc fixes for ImageMap extension
- Replace usage of deprecated method Title::escapeLocalURL() by
  Title::getLocalURL() (no further escape since both usages will
  actually be escaped later)
- Use $wgExtensionAssetsPath instead of $wgScriptPath

Change-Id: Ib125bd64f52bfe19e199c2f8efe299b564775d13
2012-09-01 14:25:01 +02:00
Siebrand Mazeland f2601b987c Maintenance for ImageMap extension.
* Replace deprecated methods.
* Consistency fixes for error messages and update doc.
* Use __DIR__ instead of dirname( __FILE__ ).
* Update code formatting.
* Correct doc for ImageMap::error().

Change-Id: Ia528deaa6b13136b0379f8dbca7d3b0029f06880
2012-08-30 18:12:52 +02:00
Jon Robson 5d07e3b07d add noresize class to div that contains map and img (bug 20030) to optimise for mobile
the mobile site (extension MobileFrontend) resizes images to have a max width of 100%
in the case of images with image maps this causes serious problems as it breaks the image
map (see bug 20030 for example)

this can be overriden by using the class noresize on the element that contains the image
this adds horizontal scrolling to the element

Change-Id: I66c972cb62bd3a86ec77e355748bdd7c5a15e7c2
2012-05-17 13:09:12 +01:00
Sam Reed 92dcd85c98 Fix unused variables
Fix trailing whitespace

Add/Improve documentation

Explicit member variable declaration
2012-01-28 17:05:20 +00:00
Victor Vasiliev f680478d60 Allow ImageMap to output maps without any links.
I see no reason why we would want to disallow such behavior, and in some cases it may be useful (I'm told that this simplifies significantly one of ruwiki's map templates).
2012-01-15 21:25:24 +00:00
Sam Reed 62181c2802 Swap else if for elseif
Trimming trailing whitespace also
2011-06-17 16:26:31 +00:00
Chad Horohoe 9c827b969a Remove useless check for wfFindFile() 2011-06-17 04:47:28 +00:00
Aaron Schulz baa253d1be Follow-up changes to r84610:
* Cleaned up mImageTimeKeys format
* ImageMap: Removed redundant addImage call (makeImage handes this)
* ParserFunctions: added time/sha1 to addImage() call
* Removed excess ampersands in hooks
* Added some function doc comments
2011-04-04 01:22:08 +00:00
Sam Reed 1ad5ff9a20 Remainder of some more undefined variables 2011-01-23 10:35:15 +00:00
Sam Reed 5752923f1f Start removing/fixing calls to deprecated methods in WMF used extensions 2010-10-29 15:14:44 +00:00
Sam Reed 22daeabc99 Remove some more unused globals
Kill a couple of other unused variables
2010-07-25 17:12:50 +00:00
Chad Horohoe 0622c1bc85 Revert r66934 (Removing wfLoadExtensionMessages() from everything). I disagree on principle...we branch extensions for this very reason. But people want trunk extensions compatible for several versions back, meh. 2010-05-27 15:56:53 +00:00
Chad Horohoe 2dba5f12e7 Large commit. Removed 800+ references to no-op wfLoadExtensionMessages() 2010-05-26 22:25:32 +00:00
Chad Horohoe 34ec4be752 No more Image::newFromName/newFromTitle. wfFindFile() takes strings or titles. 2009-03-19 12:34:14 +00:00
Tim Starling 773484526e (bug 16471) Use random ID to avoid conflicts when cached HTML fragments are used. 2008-12-19 07:03:27 +00:00
Ilmari Karonen 82a6ced1e7 avoid spamming logs with "PHP Strict Standards: Non-static method DOMDocument::loadXML() should not be called statically" with E_NOTICE and E_STRICT enabled 2008-12-02 18:02:13 +00:00
Tim Starling 8b9001a9c4 Fixed bug 15675: show an error if a polygon has an odd number of coordinates. 2008-10-06 07:03:23 +00:00
Tim Starling 348ac261ce Fixed bug 14052: tidy inserting <p> tags randomly. Put the <map> inside one of the divs that we are creating anyway. 2008-10-06 06:58:13 +00:00
Tim Starling c2620407f2 Add check for XML validity in case that's what caused bug 13316. 2008-10-06 06:05:48 +00:00
Tim Starling 5649415804 Fix for bug 8718. Cooperate with image centering by specifying widths on divs so that the margin:auto trick can work. 2008-10-06 04:24:20 +00:00
Tim Starling 910ed42183 Minor tweak for IE. 2008-10-06 03:37:30 +00:00
Tim Starling 8fa0c0c96c Proposed fix for bug 9126: use negative top margin. Like YouTube QuickList icons. Committing for cross-browser test. 2008-10-06 03:10:34 +00:00
Tim Starling fd5ed58955 Run the post-internalParse() parser stages on the output of makeImage() before attempting to parse it as XHTML, in particular: unstrip, RLH and normalizeCharReferences(). Fixes invalid character references as per complaint on wikitech-l. 2008-09-16 02:17:55 +00:00
Aryeh Gregor 0ad5f18f00 [ImageMap] No position: relative if unneeded
This helps work around bug 9126 a little.  Suggested by Splarka.
2008-09-15 15:26:11 +00:00
Tim Starling e8b86326ba It's incorrect to use both Sanitizer::escapeHtmlAllowEntities() and Parser::recursiveTagParse(). Parser::recursiveTagParse() accepts plain wikitext as input, and will handle any invalid entities itself.
Note that ideally, ImageMap would parse the image options in the same way as the parser does image links. This would mean replaceVariables(), removeHTMLtags(), doTableStuff(), <hr/>, doDoubleUnderscore(), doHeadings(), DateFormatter::reformat(), doAllQuotes(), replaceExternalLinks() and replaceInternalLinks2(). But recursiveTagParse() is almost the same anyway: only doMagicLinks() and formatHeadings() are added, and RIL/REL are done in the opposite order.
2008-09-15 07:10:40 +00:00
Alex Z. a7a3bb17b6 Sanitizer::escapeHtmlAllowEntities() only exists in 1.14, so this is unnecessary. 2008-09-09 22:31:06 +00:00
Alex Z. 7ebc0b3151 Actually parse the options so links and templates will work in captions, code adapted from Cite extension. 2008-09-09 22:12:28 +00:00
Alex Z. c69b88dab7 modify r40671, use Sanitizer::escapeHtmlAllowEntities instead to allow &amp; and the like. 2008-09-09 20:14:14 +00:00
Alex Z. 196385c1d4 (bug 15289) '&' and '<' in captions no longer cause ImageMap to fail, converted with htmlspecialchars. 2008-09-09 19:39:03 +00:00
Chad Horohoe b310a721d4 Make ImageMap behave and obey the Bad image list. 2008-08-02 03:23:05 +00:00
Chad Horohoe bb73c9b697 Ignore that...I'm an idiot. 2008-06-16 15:08:56 +00:00
Chad Horohoe 129a7a6e11 Helps to declare the global. 2008-06-16 15:02:28 +00:00
Chad Horohoe a9bfe4753f No point in allowing external images in an ImageMap if we don't allow external images period. 2008-06-16 14:58:52 +00:00
Aaron Schulz 435c410e30 E_STRICT. Even though manual says it can be called statically, it still spews notices anyway... 2008-05-14 23:12:52 +00:00
Brion Vibber 911f906650 suppress deprecated warning by using wfFindFile() if available instead of Image::newFromTitle 2008-04-26 18:24:23 +00:00
Aaron Schulz 899287ffaa Remove redundant line 2008-04-21 01:14:51 +00:00
Aaron Schulz 1e67927711 * Clean up some of the version metadata in FlaggedRevs.
* Have ImageMap add images to parserout like parser does. Not doing so also causes FlaggedRevs to think the review metadata was incomplete.
2008-03-09 10:37:04 +00:00
Tim Starling ae56a192c3 Bug 12806: fix double-escaping in external links 2008-01-27 01:58:39 +00:00
Brion Vibber acf2a86d63 * (bug 12651) Don't record special:, media:, and interwiki links in ImageMap in the internal link tables 2008-01-16 06:08:01 +00:00
Siebrand Mazeland 51fe46fae7 * use wfLoadExtensionMessages for ImageMap
* Delay message loading
* add version in extension credits
* update Translate extension
2008-01-11 08:41:57 +00:00
Raimond Spekking 5354f591e9 * Use class=error for error messages to be consistent with other error messages. 2007-08-07 21:48:01 +00:00
Ilmari Karonen 8cae4703e6 kluge to handle [[#Fragment]] links, should really fix getLocalURL() in Title.php to return an empty string in this case 2007-08-07 17:01:38 +00:00
Aryeh Gregor 8e63292a31 Extensions too! 2007-06-29 01:36:09 +00:00
Tim Starling 629b3a6b0b Removed $wgImageMapAllowExternalLinks, feature enabled unconditionally. Not sure why you wouldn't want that. 2007-06-23 11:01:10 +00:00
Tim Starling 7d51767fd2 Used Image::newFromTitle() as per Brion's suggestion 2007-05-30 15:38:23 +00:00
Tim Starling 2331e0b099 Pre-emptively migrated extensions to the filerepo-work file creation method, with backwards compatibility. Fixed the indenting in SmoothGallery. 2007-05-28 01:44:57 +00:00