Hi,
I need to open links from MediaWiki in an external window with a specific size. I used to use JavaScript but afaics JS is not supported by default. Before I start installing any extensions is it possible with MediaWiki? The script looks like this:
<html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <title>vpe Intranet</title> <script language="JavaScript" type="text/JavaScript"> <!-- function PopupWindow(strLink, strSize) { F = window.open(strLink,"Popup",strSize); } // --> </script> </head> - <a href="javascript:PopupWindow('/subwebs/3rdfloor.php','width=1050,height=730')">3. OG</a><br> - <a href="javascript:PopupWindow('/subwebs/4rdfloor.php','width=820,height=420')">4. OG</a><br> - <a href="javascript:PopupWindow('/subwebs/garage.html','width=800,height=680')">Garage</a><br> </body> </html>
Thanks, Helmut
I need to open links from MediaWiki in an external window with a specific size. I used to use JavaScript but afaics JS is not supported by default. Before I start installing any extensions is it possible with MediaWiki? The script looks like this:
Wait, do you want to open ALL external links like this, or just some specific ones?
In the former case, you could probably add the script to MediaWiki:Common.js and then patch makeExternalLink() in includes/Linker.php so that external links call your PopupWindow function by default. In the latter case, adding a few special cases to makeExternalLink() would also work.
Of course, this is most likely not the easiest and/or most elegant solution, but it should work.
Schneelocke schneelocke@gmail.com wrote:
I need to open links from MediaWiki in an external window with a specific size. I used to use JavaScript but afaics JS is not supported by default. Before I start installing any extensions is it possible with MediaWiki? The script looks like this:
Wait, do you want to open ALL external links like this, or just some specific ones?
Only specific ones.
In the former case, you could probably add the script to MediaWiki:Common.js and then patch makeExternalLink() in includes/Linker.php so that external links call your PopupWindow function by default. In the latter case, adding a few special cases to makeExternalLink() would also work.
OK, added the script to MediaWiki:Common.js, how do I call that link? Lets say I have javascript:PopupWindow('/subwebs/3rdfloor.php','width=1050,height=730')" what would be the syntax?
Only specific ones.
As I said, in that case, I'd just change the relevant function (mentioned above) to check for these special cases.
mediawiki-l@lists.wikimedia.org