User:Jeiara/monaco.js

/* renderGoogleCharts - By w:User:Ciencia Al Poder "Jesús Martínez Novo" Replaces links to google charts with images of the chart The title and alternate text of the image will be the text of the link If the link is placed inside a element with class="nochart", the link won't be touched

function renderGoogleCharts{ if (!document.getElementById('bodyContent')) return; var as = document.getElementById('bodyContent').getElementsByTagName('a'); for (var i = as.length-1; i>=0; i--){ if (as[i].href.indexOf('http://chart.apis.google.com/chart?') == 0){ if ((' '+as[i].parentNode.className+' ').indexOf(' nochart ') == -1){ var img = document.createElement('img'); img.src = as[i].href; var content = as[i].textContent || as[i].innerHTML || 'This is a chart' img.alt = content; img.title = content; as[i].parentNode.replaceChild(img, as[i]); } } } }

addOnloadHook(renderGoogleCharts);

// Dependencies var dom = 'http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js';

// OPTIONAL: Drag & Drop (only required if enabling Drag & Drop) var drag = 'http://yui.yahooapis.com/2.6.0/build/dragdrop/dragdrop-min.js';

// Source file var container = 'http://yui.yahooapis.com/2.6.0/build/container/container-min.js';

importScriptURI(dom); importScriptURI(drag); importScriptURI(container);

YAHOO.example.panels = function{ var panel_four; panel_four = new YAHOO.widget.Panel("panel_four", 					{ 						close:true, 						visible:false,  						draggable:true,						context:['anchorElement','bl','tr']					} 				); // Instantiate a Panel from script YAHOO.example.panels.panel_four.setHeader("Panel #2 from Script"); YAHOO.example.panels.panel_four.setBody("This is a dynamically generated Panel."); YAHOO.example.panels.panel_four.setFooter("End of Panel #2"); YAHOO.example.panels.panel_four.render(document.body); }; YAHOO.util.Event.addListener(window,'load',YAHOO.example.panels);

/** ImageTags pop-up Javascript ******************************************************* * *  Description: Inserts a link with the text: "Add Image Tags", * that activates a pop-up menu listing image tags. * by user:Jeiara for terminator.wikia.com */ function insertImageTags {

// Script used for specific page: Special:MultipleUpload if (wgPageName == "Special:MultipleUpload") {

// Obtain reference to table containing form inputs var tableRef = document.getElementById('upload').getElementsByTagName('table')[0]; var tRows = tableRef.rows; var num = -1; // Find only the Summary input boxes for (var i=0; i<tRows.length; i++) { var inputElements = tRows[i].getElementsByTagName('input'); for (var j=0; j<inputElements.length; j++) { // Extract only input name of Summary boxes if (inputElements[j].name.split("_")[0] == 'wpUploadDescription') { num++; // Increase uploads description quantity var aRow = tableRef.rows[i]; // Insert "Add Image Tags" link after Summary box var insertLink = document.createElement('a'); insertLink.id = 'insertLink_'+ num; insertLink.href = '#'; insertLink.innerHTML = 'Add Image Tags'; insertLink.onclick = function{YAHOO.example.panels.panel_four.show;} aRow.insertCell(j+1).appendChild(insertLink); }         }              }   }

}

addOnloadHook( insertImageTags );

function menuImageTags {

//YAHOO.util.Event.addListener(window,'load',YAHOO.example.panels); YAHOO.example.panels.panel_four.render; Event.addListener("show1", "click", YAHOO.example.container.panel1.show, YAHOO.example.container.panel1, true); }

//addOnloadHook( menuImageTags );