Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Please sign up or log in to edit the wiki.

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/*

<pre><nowiki>
*/ 

// IE is just barely compliant, if you use a deprecated style of
//  attribute setting
navigator.appVersion.indexOf("MSIE") > 0 ? isIE = true : isIE = false;

function tengwarMediawikiConsole()
{

  this.gadgetList = new Array();


  this.registerGadget = function(gadget)
  {
    this.gadgetList[this.gadgetList.length] = gadget;
  }

  this.format = function(gadgetId)
  {
    var gadget = this.gadgetList[gadgetId];

    /* if (! supportsRegexp()) { exit; } */

    this.textarea.focus();


}
  this.start = function()
  {
    var wps = document.getElementById('editpage-copywarn');
    if (! wps) {
      return;
    }

    var tengwarSection = document.createElement("div");
    tengwarSection.setAttribute("id", "tengwar_section");
    setStyle(tengwarSection, "margin-bottom: 1em;");

    var logoSection = document.createElement("div");
    setStyle(logoSection, "font-size: 12px; margin-left: 0em; border: thick 10px black; background-color: black; font-family: Arial; position: relative; bottom: -0em; color: white; width:100px; text-align:center;");
    logoSection.appendChild(document.createTextNode("Insert Tengwar:"));

    var consoleSection = document.createElement("div");
    setStyle(consoleSection, "border: solid 1px black; padding: .5em; ");

    var table = document.createElement("table");
    var tbody = document.createElement("tbody");
    var tr = document.createElement("tr");
    var td = document.createElement("td");

    var tr2 = document.createElement("tr");
    var td2 = document.createElement("td");


    var gadget, p, anchor, img, extra;
    for (i = 0; i < this.gadgetList.length; i++)
    {


      gadget = this.gadgetList[i];

      p = document.createElement("div");
      p.setAttribute("title", gadget.title);


      img = document.createElement("img");
      img.setAttribute("src", gadget.image1);
      anchor = document.createElement("a");
      anchor.setAttribute("href", gadget.link1);
      anchor.appendChild(document.createTextNode(gadget.title));
      anchor.appendChild(img);
      setStyle(anchor, " color: black;");
      extra = document.createElement("span");
      extra.appendChild(document.createTextNode("\u00a0 \u00a0 \u00a0"));

if (gadget.newline1 == "no"){
      extra.appendChild(anchor);
      td.appendChild(extra);
      tr.appendChild(td);
      p.appendChild(tr);
      tbody.appendChild(p);
}
if (gadget.newline1 == "yes"){
      extra.appendChild(anchor);
      td2.appendChild(extra);
      tr2.appendChild(td2);
      p.appendChild(tr2);
      tbody.appendChild(p);
}
    }
    table.appendChild(tbody);
   setStyle(td, "height:25px;");
   setStyle(td2, "height:25px;");
    setStyle(consoleSection, "text-align: center; border: solid 1px black; padding: .5em;");


    consoleSection.appendChild(table);

    tengwarSection.appendChild(logoSection);
    tengwarSection.appendChild(consoleSection);
      setStyle(tengwarSection, " margin-top: 15px;");
    wps.parentNode.insertBefore(tengwarSection, wps);
  }

  this.setStatus = function(status)
  {
void(0);
  }
}

function setStyle(element, style)
{
  if (isIE) {
    element.style.cssText = style;
  } else {
    element.setAttribute("style", style);
  }
}


function TGAGadget()
{
  this.title = "a ";
  this.image1 = "http://tolkiengateway.net/w/images/b/b5/A_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:a_tengwar.png]]','','');";
  this.newline1 = "no";


}

function TGBGadget()
{
  this.title = "b ";
  this.image1 = "http://tolkiengateway.net/w/images/0/09/B_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:b_tengwar.png]]','','');";
  this.newline1 = "no";

}

function TGCGadget()
{
  this.title = "c ";
  this.image1 = "http://tolkiengateway.net/w/images/f/f1/C_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:c_tengwar.png]]','','');";
  this.newline1 = "no";

}

function TGDGadget()
{
  this.title = "d ";
  this.image1 = "http://tolkiengateway.net/w/images/8/8d/D_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:d_tengwar.png]]','','');";
  this.newline1 = "no";

}

function TGEGadget()
{
  this.title = "e ";
  this.image1 = "http://tolkiengateway.net/w/images/f/f4/E_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:e_tengwar.png]]','','');";
  this.newline1 = "no";

}

function TGFGadget()
{
  this.title = "f ";
  this.image1 = "http://tolkiengateway.net/w/images/a/ac/F_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:f_tengwar.png]]','','');";
  this.newline1 = "no";

}
function TGGGadget()
{
  this.title = "g ";
  this.image1 = "http://tolkiengateway.net/w/images/2/24/G_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:g_tengwar.png]]','','');";
  this.newline1 = "no";

}
function TGHGadget()
{
  this.title = "h ";
  this.image1 = "http://tolkiengateway.net/w/images/7/7e/H_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:h_tengwar.png]]','','');";
  this.newline1 = "no";

}
function TGIGadget()
{
  this.title = "i ";
  this.image1 = "http://tolkiengateway.net/w/images/b/bd/I_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:i_tengwar.png]]','','');";
  this.newline1 = "no";

}
function TGJGadget()
{
  this.title = "j ";
  this.image1 = "http://tolkiengateway.net/w/images/f/f0/J_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:j_tengwar.png]]','','');";
  this.newline1 = "no";

}
function TGKGadget()
{
  this.title = "k ";
  this.image1 = "http://tolkiengateway.net/w/images/9/90/K_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:k_tengwar.png]]','','');";
  this.newline1 = "no";
}
function TGLGadget()
{
  this.title = "l ";
  this.image1 = "http://tolkiengateway.net/w/images/b/bf/L_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:l_tengwar.png]]','','');";
  this.newline1 = "no";

}
function TGMGadget()
{
  this.title = "m ";
  this.image1 = "http://tolkiengateway.net/w/images/f/ff/M_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:m_tengwar.png]]','','');";
  this.newline1 = "no";
}
function TGNGadget()
{
  this.title = "n ";
  this.image1 = "http://tolkiengateway.net/w/images/a/a7/N_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:n_tengwar.png]]','','');";
  this.newline1 = "yes";
}
function TGOGadget()
{
  this.title = "o ";
  this.image1 = "http://tolkiengateway.net/w/images/4/41/O_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:o_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGPGadget()
{
  this.title = "p ";
  this.image1 = "http://tolkiengateway.net/w/images/7/7a/P_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:p_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGQGadget()
{
  this.title = "q ";
  this.image1 = "http://tolkiengateway.net/w/images/4/46/Q_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:q_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGRGadget()
{
  this.title = "r ";
  this.image1 = "http://tolkiengateway.net/w/images/3/30/R_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:r_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGSGadget()
{
  this.title = "s ";
  this.image1 = "http://tolkiengateway.net/w/images/f/fc/S_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:s_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGTGadget()
{
  this.title = "t ";
  this.image1 = "http://tolkiengateway.net/w/images/7/78/T_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:t_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGUGadget()
{
  this.title = "u ";
  this.image1 = "http://tolkiengateway.net/w/images/4/42/U_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:u_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGVGadget()
{
  this.title = "v ";
  this.image1 = "http://tolkiengateway.net/w/images/e/e5/V_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:v_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGWGadget()
{
  this.title = "w ";
  this.image1 = "http://tolkiengateway.net/w/images/e/eb/W_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:w_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGXGadget()
{
  this.title = "x ";
  this.image1 = "http://tolkiengateway.net/w/images/0/09/X_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:x_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGYGadget()
{
  this.title = "y ";
  this.image1 = "http://tolkiengateway.net/w/images/e/e9/Y_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:y_tengwar.png]]','','');";
  this.newline1 = "yes";

}
function TGZGadget()
{
  this.title = "z ";
  this.image1 = "http://tolkiengateway.net/w/images/0/0e/Z_tengwar.png";
  this.link1 = "javascript:insertTags('[[Image:z_tengwar.png]]','','');";
  this.newline1 = "yes";

}

function addTGCommands()
{
  tengwarConsole = new tengwarMediawikiConsole();

  tengwarConsole.registerGadget(new TGAGadget());
  tengwarConsole.registerGadget(new TGBGadget());
  tengwarConsole.registerGadget(new TGCGadget());
  tengwarConsole.registerGadget(new TGDGadget());
  tengwarConsole.registerGadget(new TGEGadget());

  tengwarConsole.registerGadget(new TGFGadget());
  tengwarConsole.registerGadget(new TGGGadget());
  tengwarConsole.registerGadget(new TGHGadget());
  tengwarConsole.registerGadget(new TGIGadget());
  tengwarConsole.registerGadget(new TGJGadget());
  tengwarConsole.registerGadget(new TGKGadget());
  tengwarConsole.registerGadget(new TGLGadget());
  tengwarConsole.registerGadget(new TGMGadget());
  tengwarConsole.registerGadget(new TGNGadget());
  tengwarConsole.registerGadget(new TGOGadget());
  tengwarConsole.registerGadget(new TGPGadget());
  tengwarConsole.registerGadget(new TGQGadget());
  tengwarConsole.registerGadget(new TGRGadget());
  tengwarConsole.registerGadget(new TGSGadget());
  tengwarConsole.registerGadget(new TGTGadget());
  tengwarConsole.registerGadget(new TGUGadget());
  tengwarConsole.registerGadget(new TGVGadget());
  tengwarConsole.registerGadget(new TGWGadget());
  tengwarConsole.registerGadget(new TGXGadget());
  tengwarConsole.registerGadget(new TGYGadget());
  tengwarConsole.registerGadget(new TGZGadget());

  tengwarConsole.start();
}



hookEvent("load", addTGCommands); 
//addOnloadHook(addTGCommands);

/* </nowiki></pre> 
*/