Page MenuHomePhabricator

The links on imagemap should contain information about "missing article" and "external link".
Open, MediumPublic

Description

One deficiency with imagemap is that there is no way for the user (or a script) to know if the page of this link actually exists. It would be very useful to have this available. IMO, this can be accomplished with zero regressions by adding
the patch looks somewhat like so: (ImageMap_body.php, near line 211)

if ( $externLink ) {
        $attribs['href'] = $title;
        $attribs['class'] = 'plainlinks';
        if ( $wgNoFollowLinks ) {
                $attribs['rel'] = 'nofollow';
        }

+ } elseif (! $title->exists()) {
+ $attribs['class'] = 'new';

} elseif ( $title->getFragment() != '' && $title->getPrefixedDBkey() == '' ) {
        # XXX: kluge to handle [[#Fragment]] links, should really fix getLocalURL()
        # in Title.php to return an empty string in this case
        $attribs['href'] = $title->getFragmentForURL();

or somesuch (totally untested, but very simple. not sure if "new" links actually need the next "elseif").

to see a script that would profit from this, please see

http://he.wikipedia.org/wiki/Mediawiki:Imagemap-Highlight.js

(This script extract the hotsopts from imagemap and create a "table of contents" below it, with the appropriate text and links. hovering above a toc item highlights the imagemap area or areas associated with it. the above patch would allow to distinguish "red links" for non-existing pages).


Version: unspecified
Severity: normal

Details

Reference
bz36175

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:19 AM
bzimport added a project: ImageMap.
bzimport set Reference to bz36175.
bzimport added a subscriber: Unknown Object (MLST).

this issue also cause iamgemap links not to respect $wgExternalLinkTarget (i.e., links from imagemap do not open with target = "_blank")

peace.

Hi kipod! Sorry that nobody has taken a look at this report yet and given feedback. Thanks for your patch!

You are welcome to use Developer access

https://www.mediawiki.org/wiki/Developer_access

to submit this as a Git branch directly into Gerrit:

https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier for us to review it quickly.
Thanks again! We appreciate your contribution.

Thanks. i may bite the bullet and do it eventually, but in the meantime, please note that the developer access is not really usable (at least it was not the last time i looked) to someone who uses windoze.

peace.

When was the last time you looked? There has been progress in the past weeks. And where was the problem? In Gerri? Labs?

Check http://www.mediawiki.org/wiki/Git/Workflow#Windows

Your feedback is welcome if you run into any problems. Thank you!

Is this bug a good candidate for Google Code-in? Someone to take this patch and doing the necessary changes to submit a Gerrit changeset?

https://www.mediawiki.org/wiki/Google_Code-In

kipod: Could you upload the patch as a patch file?

will do shortly (shortly=in a couple of days. my environment is not up and running ATM).

peace.

kipod: Could you upload the patch as a file? See http://tools.wmflabs.org/gerrit-patch-uploader/ - no need to set up anything like git-review, diff is enough.

kipod: Could you upload the patch as a file? See http://tools.wmflabs.org/gerrit-patch-uploader/ - no need to set up anything like git-review, diff is enough.

i guess i am not up to creating a nice patch, and might not be up to it for a while.

my snippet above may or may not work, but fulfilling the request should be easy enough for anyone who *does* have a functional MW development environment.
anyone?

peace.