User:Radar33/link-title/doc/old

= ==Usage== =

This template makes the rollover tooltip text display the specified text.


 * Full Capability Usage:

= ==Explanation== =

This template is supposed to make the following code compatible with Wikipedia.


 * It will work for internal links if I input
 * It will work for external links if I input

But the above is a little tedious so this template is supposed to make this process eaiser.

For example: If I were to paste this code into some .html file, it works properly and makes the popup-text (usually a little yellow box) say "Wikipedia policies and guidelines". See image:


 * [[Image:Ajl772NonWikiExample.png]]

= ===Javascript process in non-wiki space=== =

The following script works in non-wiki space to produce the desired results.

 function iif(condition,truepart,falsepart) { if(condition) { return truepart; }  else {    return falsepart; } } function linktitle(url,text,title,wiki) { var t1 = 0; var t2 = 0; var t3 = 0; var t4 = 0; if (title) { t3 = 1; }  if (text) { t2 = 1; }  if (wiki) { t4 = 1; }  document.writeln("&lt;span class='plainlinks'&gt;["+iif(t4,"[&lt;span title='"+title+"'&gt;" +iif(t2,text,url)+"&lt;/span&gt;]",url+iif(t3," &lt;span title='"+title+"'&gt;" +iif(t2,text,url)+"&lt;/span&gt;",iif(t2," "+text,"")))+"]&lt;/span&gt;&lt;br&gt;"); } linktitle(" http://www.google.com/ ","","",0);

= ==See also== =