Extension talk:LaunchExternal

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] Thank you

I'm sure this is useful.

Very useful but doesn't work on mozilla v.2.0.0.18 thank you.

Great extension!

Works great on our intranet wiki.

I have a request, is possible to add code to render the color of the link to another color? This will help my users visually see what is local and what is not.

Thanks raudelh@tgce.com

[edit] split() deprecated

Evidently, function split() is deprecated. What would be a good replacement? Tisane 23:30, 11 March 2010 (UTC)

[edit] changes

Hello, I made some changes in your code :

<       $arrInput = split("::",$input); // use a different display then the file reference...
---
>       #modified separator of link: using "|" (JPA)
>       $arrInput = explode("|",$input,2);      // use a different display then the file reference...
40a42
>       $href = str_replace("'","%27",$reference);
52c54
<         return  "<a href='" . $reference . "' target='new'>" . ($display == "" ? $reference : $display) . "$server</a>";
---
>         return  "<a href='" . $href . "' target='new'>" . ($display == "" ? $reference : $display) . "$server</a>";

The first modification use explode instead of split, and pipe as separator (which is more conform to mediawiki style) The second replace apostrophe by urlencode character, otherwise a link with an apostroph causes a syntax error.

JP Ayanidès, 2010-03-15

[edit] Add to Custom Buttons

Hi!

Works great!

But I can´t add it to my custom buttuns:

var button = {
        "imageFile": "images/buttons/extbutton.jpg", // image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "open external", // text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "<ext>", // the text to use to mark the beginning of the block
        "tagClose": "</ext>",      // the text to use to mark the end of the block (if any)
        "sampleText": "file:\\Server\Path\file(opt.)"  // the sample text to place inside the block
};
mwCustomEditButtons.push(button);

When adding this to Common.js, the page fails with Error 500.

The Problem is the tagOpen and TagClose part.

I need to put the last part of the tagOpent to the sample text.

"tagOpen": "<ex", // the text to use to mark the beginning of the block
"tagClose": "</ext>",      // the text to use to mark the end of the block (if any)
"sampleText": "t>file:\\\\Server\\Path\\file(opt.)"

[edit] Link hiding

I have a small issue: although <ext> and </ext> work perfectly, there is a problem with masking long URL's (like certain PHP get commands we use). Is there a way to "mask" the URL into something nice? I have tried the HTML <a href=> but that does not work. Vadra, Dec 6th 2010

[edit] Using LaunchExternal in a Templates

When using this extension in a template, the parameter is not parsed (see Manual:Tag_extensions#Extensions_and_Templates).

I've modified this to work :

  1. function launchExternal ( $input, array $args, Parser $parser, PPFrame $frame ) {
    
  2.     global $wgServer;
    
  3.         global $wgAddServerName_EXT;
    
  4.  
    
  5.    $input= $parser->recursiveTagParse( $input, $frame );
    
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox