rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
this.div.style.overflow = 'hidden';
initialize: function(bounds, borderColor, borderWidth) { if (arguments.length > 0) { this.bounds = bounds; this.div = OpenLayers.Util.createDiv(); this.events = new OpenLayers.Events(this, this.div, null); this.setBorder(borderColor, borderWidth); } },
markers = new Array();
initialize: function(name) { OpenLayers.Layer.prototype.initialize.apply(this, arguments); },
if (this.document.originalBody == undefined) { this.document.originalBody = this.document.body.innerHTML; } else { this.document.body.innerHTML = this.document.originalBody; addBreakpointSupport(this.document); }
this._resetTestCase();
initialize : function(testDocument, isJavaScript, commandFactory) { this.commandFactory = commandFactory; this.waitForConditionTimeout = 30 * 1000; // 30 seconds this.isJavaScript = isJavaScript; se = selenium; global.se = selenium; this.document = testDocument; this.document.bgColor = ""; this.currentRow = null; this.currentRowIndex = 0; this.commandRows = new Array(); this.headerRow = null; // used for selenium tests in javascript this.currentItem = null; this.commandAgenda = new Array(); if (this.document.originalBody == undefined) { this.document.originalBody = this.document.body.innerHTML; } else { this.document.body.innerHTML = this.document.originalBody; addBreakpointSupport(this.document); } var tables = this.document.getElementsByTagName("table"); for (var i = 0; i < tables.length; i++) { var candidateRows = tables[i].rows; for (var j = 0; j < candidateRows.length; j++) { if (!this.headerRow) { this.headerRow = candidateRows[j]; } if (isCommandRow(candidateRows[j])) { this._addCommandRow(candidateRows[j]); } } } if (isJavaScript) { var script = this.document.getElementById('sejs') // the script source var fname = 'Selenium JavaScript'; parse_result = parse(script.innerHTML, fname, 0); var x2 = new ExecutionContext(GLOBAL_CODE); ExecutionContext.current = x2; execute(parse_result, x2) } },
if (candidateRows[j].cells.length >= 3) {
if (isCommandRow(candidateRows[j])) {
initialize : function(testDocument, isJavaScript, commandFactory) { this.commandFactory = commandFactory; this.waitForConditionTimeout = 30 * 1000; // 30 seconds this.isJavaScript = isJavaScript; se = selenium; global.se = selenium; this.document = testDocument; this.document.bgColor = ""; this.currentRow = null; this.currentRowIndex = 0; this.commandRows = new Array(); this.headerRow = null; // used for selenium tests in javascript this.currentItem = null; this.commandAgenda = new Array(); var tables = this.document.getElementsByTagName("table"); for (var i = 0; i < tables.length; i++) { var candidateRows = tables[i].rows; for (var j = 0; j < candidateRows.length; j++) { if (!this.headerRow) { this.headerRow = candidateRows[j]; } if (candidateRows[j].cells.length >= 3) { this._addCommandRow(candidateRows[j]); } } } if (isJavaScript) { var script = this.document.getElementById('sejs') // the script source var fname = 'Selenium JavaScript'; parse_result = parse(script.innerHTML, fname, 0); var x2 = new ExecutionContext(GLOBAL_CODE); ExecutionContext.current = x2; execute(parse_result, x2) } },
function initialize() { userEventsInit(); document.onmousemove = mousePosition; }
function initialize() { userEventsInit(); }
function initialize() //runs at onload of window { userEventsInit(); //set up all user events document.onmousemove = mousePosition; //moz }
image.src = (display == "block")? "images/minus.gif" : "images/plus.gif";
image.src = (display == "block")? "../images/minus.gif" : "../images/plus.gif";
function initializeMenu(module) { var menuId = module + "Menu"; var triggerId = module + "Trig"; var imageId = module + "Image"; var menu = document.getElementById(menuId); var trigger = document.getElementById(triggerId); var image = document.getElementById(imageId); var state = readCookie(module); menu.style.display = state; var display = menu.style.display; image.src = (display == "block")? "images/minus.gif" : "images/plus.gif"; trigger.onclick = function() { var display = menu.style.display; if (display == "block") { image.src = "images/plus.gif"; menu.style.display = "none"; document.cookie = module + "=none"; } else { image.src = "images/minus.gif"; menu.style.display = "block"; document.cookie = module + "=block"; } return false; }}
image.src = "images/plus.gif";
image.src = "../images/plus.gif";
function initializeMenu(module) { var menuId = module + "Menu"; var triggerId = module + "Trig"; var imageId = module + "Image"; var menu = document.getElementById(menuId); var trigger = document.getElementById(triggerId); var image = document.getElementById(imageId); var state = readCookie(module); menu.style.display = state; var display = menu.style.display; image.src = (display == "block")? "images/minus.gif" : "images/plus.gif"; trigger.onclick = function() { var display = menu.style.display; if (display == "block") { image.src = "images/plus.gif"; menu.style.display = "none"; document.cookie = module + "=none"; } else { image.src = "images/minus.gif"; menu.style.display = "block"; document.cookie = module + "=block"; } return false; }}
image.src = "images/minus.gif";
image.src = "../images/minus.gif";
function initializeMenu(module) { var menuId = module + "Menu"; var triggerId = module + "Trig"; var imageId = module + "Image"; var menu = document.getElementById(menuId); var trigger = document.getElementById(triggerId); var image = document.getElementById(imageId); var state = readCookie(module); menu.style.display = state; var display = menu.style.display; image.src = (display == "block")? "images/minus.gif" : "images/plus.gif"; trigger.onclick = function() { var display = menu.style.display; if (display == "block") { image.src = "images/plus.gif"; menu.style.display = "none"; document.cookie = module + "=none"; } else { image.src = "images/minus.gif"; menu.style.display = "block"; document.cookie = module + "=block"; } return false; }}
if (tinyMCE.isGecko) doc.body.spellcheck = tinyMCE.getParam("gecko_spellcheck");
function initIframe(doc) { var dir = tinyMCE.selectedInstance.settings['directionality']; doc.body.dir = dir; resizeInputs();}
gPanelContainer().addEventListener("mousedown",onMouseDown,true);
gPanelContainer().addEventListener("mousedown",izOnMouseDown,true);
function initImageZoom() { // Check the version to display initilisation page if appropriate var oldVersion = nsIPrefBranchObj.getCharPref("version"); if (oldVersion < version) { nsIPrefBranchObj.setCharPref("version", version); try { // try to save the prefs because we don't want to reset the home page if prefs can't be saved nsIPrefServiceObj.savePrefFile(null); nsIPrefServiceObj.readUserPrefs(null); if (nsIPrefBranchObj.getCharPref("version") == version) window.openDialog("chrome://imagezoom/content/install.xul", "", "chrome,centerscreen", oldVersion); } catch(e) { //alert(e); } } // For Mozilla and Firefox if (document.getElementById("contentAreaContextMenu")){ document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", imageZoomMenu, false); } // For Thunderbird else if (document.getElementById("messagePaneContext")){ document.getElementById("messagePaneContext").addEventListener("popupshowing", imageZoomMenu, false); } // Add events for the mouse functions gPanelContainer().addEventListener("mousedown",onMouseDown,true); // Add Image Zooming to text reduce command var cmdZoomReduce = document.getElementById("cmd_textZoomReduce"); var prevCmd = cmdZoomReduce.getAttribute("oncommand"); cmdZoomReduce.setAttribute("oncommand", prevCmd + " ZoomImageManager.prototype.getInstance().pageLoad();"); // Add Image Zooming to text enlarge command var cmdZoomEnlarge = document.getElementById("cmd_textZoomEnlarge"); prevCmd = cmdZoomEnlarge.getAttribute("oncommand"); cmdZoomEnlarge.setAttribute("oncommand", prevCmd + " ZoomImageManager.prototype.getInstance().pageLoad();"); // Add Image Zooming to text reset command var cmdZoomReset = document.getElementById("cmd_textZoomReset"); prevCmd = cmdZoomReset.getAttribute("oncommand"); cmdZoomReset.setAttribute("oncommand", prevCmd + " ZoomImageManager.prototype.getInstance().pageLoad();"); imagezoomBundle = document.getElementById("bundle_ImageZoom"); }
contextSubMenuLabel = document.getElementById("context-zoomsub").getAttribute("label") + " (%zoom% %)";
function initImageZoom() { // Check the version to display initilisation page if appropriate var oldVersion = nsIPrefBranchObj.getCharPref("version"); if (oldVersion < version) { nsIPrefBranchObj.setCharPref("version", version); try { // try to save the prefs because we don't want to reset the home page if prefs can't be saved nsIPrefServiceObj.savePrefFile(null); nsIPrefServiceObj.readUserPrefs(null); if (nsIPrefBranchObj.getCharPref("version") == version) window.openDialog("chrome://imagezoom/content/install.xul", "", "chrome,centerscreen", oldVersion); } catch(e) { //alert(e); } } // For Mozilla and Firefox if (document.getElementById("contentAreaContextMenu")){ document.getElementById("contentAreaContextMenu").addEventListener("popupshowing", imageZoomMenu, false); } // For Thunderbird else if (document.getElementById("messagePaneContext")){ document.getElementById("messagePaneContext").addEventListener("popupshowing", imageZoomMenu, false); } // Add events for the mouse functions gPanelContainer().addEventListener("mousedown",izOnMouseDown,true); // Add Image Zooming to text reduce command var cmdZoomReduce = document.getElementById("cmd_textZoomReduce"); var prevCmd = cmdZoomReduce.getAttribute("oncommand"); cmdZoomReduce.setAttribute("oncommand", prevCmd + " ZoomImageManager.prototype.getInstance().pageChange();"); // Add Image Zooming to text enlarge command var cmdZoomEnlarge = document.getElementById("cmd_textZoomEnlarge"); prevCmd = cmdZoomEnlarge.getAttribute("oncommand"); cmdZoomEnlarge.setAttribute("oncommand", prevCmd + " ZoomImageManager.prototype.getInstance().pageChange();"); // Add Image Zooming to text reset command var cmdZoomReset = document.getElementById("cmd_textZoomReset"); prevCmd = cmdZoomReset.getAttribute("oncommand"); cmdZoomReset.setAttribute("oncommand", prevCmd + " ZoomImageManager.prototype.getInstance().pageChange();"); imagezoomBundle = document.getElementById("bundle_ImageZoom"); }
if(this.layer.opacity != null) { OpenLayers.Util.setOpacity(this.imgDiv, this.layer.opacity); }
initImgDiv: function() { if (this.layer.alpha) { this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null, this.position, this.size, null, "absolute", null, null, true); } else { this.imgDiv = OpenLayers.Util.createImage(null, this.position, this.size, null, "absolute", null, true); } this.layer.div.appendChild(this.imgDiv); },
if (tinyMCE.isGecko) { tinyMCE.addEvent(inst.getDoc(), "keyup", TinyMCE_NonEditablePlugin._fixKeyUp); }
initInstance : function(inst) { tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/noneditable/css/noneditable.css"); // Ugly hack if (tinyMCE.isMSIE5_0) tinyMCE.settings['plugins'] = tinyMCE.settings['plugins'].replace(/noneditable/gi, 'Noneditable'); if (tinyMCE.isGecko) { tinyMCE.addEvent(inst.getDoc(), "keyup", TinyMCE_NonEditablePlugin._fixKeyUp); // tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_NonEditablePlugin._selectAll); // tinyMCE.addEvent(inst.getDoc(), "mouseup", TinyMCE_NonEditablePlugin._selectAll); } },
var menupopup = document.createElement("menupopup");
var menupopup = listbox.firstChild;
function initListBox(){ var listbox = document.getElementById("translate.prefs.language.selection"); var menupopup = document.createElement("menupopup"); var listitem ; for(var i = 0;i < PGTRANSLATE_LANGUAGEPAIRS.length ; i++) { listitem = document.createElement("menuitem"); listitem.setAttribute("label",PGTRANSLATE_LANGUAGEUNICODE[i]); listitem.setAttribute("value",i); menupopup.appendChild(listitem); } listbox.appendChild(menupopup);}
toolbarItem.setAttribute("oncommand","quick_translate();");
toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();");
function initMenus(){ var languagePair; var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //setup up context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //setup toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate if(glocale == 0) { toolbarItem.setAttribute("oncommand","quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');"); } // add menus if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { //alert(toolChildren[i].nodeName); if(toolChildren[i].nodeName == "menuitem") { // alert("removing"); toolMenu.removeChild(toolChildren[i]); } //alert(i); } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { //alert(cloneMenu.childNodes.length); toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { //alert(cloneMenu.childNodes.length); toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); //alert(langSelected.childNodes[glocale].getAttribute("checked")); } }
toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');");
toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');");
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement;
if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement;
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]);
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
if(isToolbar) { toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]);
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); }
if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } }
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild);
if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); }
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolbarItem.appendChild(toolbarMenuPopupElement);
if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); }
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');");
if(glocale = 0) { toolbarItem.setAttribute("oncommand","quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');"); }
function initMenus(){ var languagePair; var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //setup up context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //setup toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); // toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');"); // add menus if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { //alert(toolChildren[i].nodeName); if(toolChildren[i].nodeName == "menuitem") { // alert("removing"); toolMenu.removeChild(toolChildren[i]); } //alert(i); } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { //alert(cloneMenu.childNodes.length); toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { //alert(cloneMenu.childNodes.length); toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); //alert(langSelected.childNodes[glocale].getAttribute("checked")); } }
toolbarItem.setAttribute("class","translate-tool-" + languagePairs[glocale][0]); toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + languagePairs[glocale][0] + "');");
function initMenus(){ var languagePair; var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; for(var i = 1; i < languagePairs[glocale].length ; i++) { languagePair = languagePairs[glocale][i] + "_" + languagePairs[glocale][0]; //setup up context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //setup toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); }
if(glocale = 0)
if(glocale == 0)
function initMenus(){ var languagePair; var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; var toolbarItem = document.getElementById("translate-pg"); var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //setup up context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //setup toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } //set toolbar icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate if(glocale = 0) { toolbarItem.setAttribute("oncommand","quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom('en_" + glanguagePairs[glocale][0] + "');"); } // add menus if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { //alert(toolChildren[i].nodeName); if(toolChildren[i].nodeName == "menuitem") { // alert("removing"); toolMenu.removeChild(toolChildren[i]); } //alert(i); } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { //alert(cloneMenu.childNodes.length); toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); toolbarItem.appendChild(toolbarMenuPopupElement); // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { //alert(cloneMenu.childNodes.length); toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); //alert(langSelected.childNodes[glocale].getAttribute("checked")); } }
var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement;
var toolbarItem = document.getElementById("translate-pg");
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator");
var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); var toolMenuPopupElement = document.createElement("menupopup"); var toolMenuItemLabel; var toolMenuItemTooltiptext; var toolMenuItemOncommand ; var toolMenuItemElement;
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement);
toolMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolMenuItemElement = document.createElement("menuitem"); toolMenuItemElement.setAttribute("label",toolMenuItemLabel); toolMenuItemElement.setAttribute("tooltiptext",toolMenuItemTooltiptext); toolMenuItemElement.setAttribute("oncommand",toolMenuItemOncommand); toolMenuPopupElement.appendChild(toolMenuItemElement);
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
if(isToolbar) { toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } }
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); }
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
var cloneMenu = toolbarMenuPopupElement.cloneNode(true); var nodeLength = cloneMenu.childNodes.length;
var nodeLength = toolMenuPopupElement.childNodes.length;
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); }
toolMenu.insertBefore(toolMenuPopupElement.childNodes[0],toolMenuSeperator); }
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); var nodeLength = cloneMenu.childNodes.length;
var nodeLength = toolMenuPopupElement.childNodes.length;
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator);
toolMenu.insertBefore(toolMenuPopupElement.childNodes[0],toolMenuSeperator);
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
langSelected.childNodes[glocale].setAttribute("checked","true"); }
langSelected.childNodes[glocale].setAttribute("checked","true"); } toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]);
function initMenus() //initialises the context menu and the toolbar menu{ var languagePair; // set up context menu variables var contextItem = document.getElementById("translate-context"); var contextMenuPopupElement = document.createElement("menupopup"); var contextMenuItemLabel; var contextMenuItemTooltiptext; var contextMenuItemOncommand; var contextMenuItemElement; //set up toolbar variables var toolbarItem = document.getElementById("translate-pg"); if( toolbarItem) { var isToolbar = true; } else { var isToolbar = false; } var toolbarMenuPopupElement = document.createElement("menupopup"); var toolbarMenuItemLabel; var toolbarMenuItemTooltiptext; var toolbarMenuItemOncommand ; var toolbarMenuItemElement; var toolMenu = document.getElementById("translate-tool-menu"); var toolMenuSeperator = document.getElementById("translate-options-separator"); for(var i = 1; i < glanguagePairs[glocale].length ; i++) { languagePair = glanguagePairs[glocale][i] + "_" + glanguagePairs[glocale][0]; //add menuitems to the context menu contextMenuItemLabel = gTranslateBundle.getString("context.menu." + languagePair + ".label"); contextMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); contextMenuItemOncommand = "translateSelection('" + languagePair + "');"; contextMenuItemElement = document.createElement("menuitem"); contextMenuItemElement.setAttribute("label",contextMenuItemLabel); contextMenuItemElement.setAttribute("tooltiptext",contextMenuItemTooltiptext); contextMenuItemElement.setAttribute("oncommand",contextMenuItemOncommand); contextMenuPopupElement.appendChild(contextMenuItemElement); //add menuitems to the toolbutton menu toolbarMenuItemLabel = gTranslateBundle.getString("toolbar.menu." + languagePair + ".label"); toolbarMenuItemTooltiptext = gTranslateBundle.getString(languagePair + ".tooltip"); toolbarMenuItemOncommand = "translateFrom('" + languagePair + "');"; toolbarMenuItemElement = document.createElement("menuitem"); toolbarMenuItemElement.setAttribute("label",toolbarMenuItemLabel); toolbarMenuItemElement.setAttribute("tooltiptext",toolbarMenuItemTooltiptext); toolbarMenuItemElement.setAttribute("oncommand",toolbarMenuItemOncommand); toolbarMenuPopupElement.appendChild(toolbarMenuItemElement); } if(isToolbar) { //set toolbar button class, which inturns sets the icon toolbarItem.setAttribute("class","translate-tool-" + glanguagePairs[glocale][0]); //setup quick translate (english uses googles quick translate, all other languages default to english translation) if(glocale == 0) { toolbarItem.setAttribute("oncommand","if (event.target==this) quick_translate();"); } else { toolbarItem.setAttribute("oncommand","if (event.target==this) translateFrom(\'en_" + glanguagePairs[glocale][0] + "\');"); } } // here's where we add menus if they aren't already there, if they are, then we remove them then add the new ones if(contextItem.hasChildNodes()) //if Firefox has already started, then replace existing childnodes, otherwise append them { contextItem.replaceChild(contextMenuPopupElement,contextItem.firstChild); if(isToolbar) { toolbarItem.replaceChild(toolbarMenuPopupElement,toolbarItem.firstChild); } // deals with adding languages to the tool menu, basically we add a clone of the toolbar menu. // Tricky part is to remove existing menuitems var toolChildren = toolMenu.childNodes; for (var i in toolChildren) { if(toolChildren[i].nodeName == "menuitem") { toolMenu.removeChild(toolChildren[i]); } } var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } } else { // adds both context menu and toolbar menu contextItem.appendChild(contextMenuPopupElement); if(isToolbar) { toolbarItem.appendChild(toolbarMenuPopupElement); } // creates list of translation languages in the tool menu var cloneMenu = toolbarMenuPopupElement.cloneNode(true); // use a clone because insertBefore moves elements and does NOT copy var nodeLength = cloneMenu.childNodes.length; for( var i = 0 ; i < nodeLength ;i++) { toolMenu.insertBefore(cloneMenu.childNodes[0],toolMenuSeperator); } var langSelected = document.getElementById("langSelect"); langSelected.childNodes[glocale].setAttribute("checked","true"); } }
if (this.options.selectedFormat != null) { try { testManager.selectFormat(this.options.selectedFormat); } catch (error) { log.error("failed to select format: " + error); } }
function initOptions() { if (this.options.rememberBaseURL == 'true' && this.options.baseURL != null){ if (document.getElementById("baseURL").value == '') { document.getElementById("baseURL").value = this.options.baseURL; } } if (this.options.selectedFormat != null) { try { testManager.selectFormat(this.options.selectedFormat); } catch (error) { log.error("failed to select format: " + error); } }}
this.resolutions.sort( function ascend(a,b) { return(b-a); });
initResolutions: function() { if ((this.scales != null) || (this.resolutions != null)) { //preset levels if (this.scales != null) { this.resolutions = new Array(); for(var i = 0; i < this.scales.length; i++) { this.resolutions[i] = OpenLayers.Util.getResolutionFromScale(this.scales[i], this.units); } } this.numZoomLevels = this.resolutions.length; } else { //maxResolution and numZoomLevels this.resolutions = new Array(); // determine maxResolution if (this.minScale) { this.maxResolution = OpenLayers.Util.getResolutionFromScale(this.minScale, this.units); } else if (this.maxResolution == "auto") { var viewSize = this.map.getSize(); var wRes = this.maxExtent.getWidth() / viewSize.w; var hRes = this.maxExtent.getHeight()/ viewSize.h; this.maxResolution = Math.max(wRes, hRes); } // determine minResolution if (this.maxScale != null) { this.minResolution = OpenLayers.Util.getResolutionFromScale(this.maxScale); } else if ((this.minResolution == "auto") && (this.minExtent != null)){ var viewSize = this.map.getSize(); var wRes = this.minExtent.getWidth() / viewSize.w; var hRes = this.minExtent.getHeight()/ viewSize.h; this.minResolution = Math.max(wRes, hRes); } // determine numZoomLevels if (this.minResolution != null) { var ratio = this.maxResolution / this.minResolution; this.numZoomLevels = Math.floor(Math.log(ratio) / Math.log(2)) + 1; } // now we have numZoomLevels and maxResolution, // we can populate the resolutions array for (var i=0; i < this.numZoomLevels; i++) { this.resolutions.push(this.maxResolution / Math.pow(2, i)); } } },
tmp = tmp.replace("&", "&amp;"); tmp = tmp.replace("<", "&lt;"); tmp = tmp.replace(">", "&gt;"); tmp = tmp.replace(" ", "&nbsp;"); tmp = tmp.replace("\n", "<br />"); tmp = tmp.replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp");
tmp = tmp.replace(/&/g, "&amp;"); tmp = tmp.replace(/</g, "&lt;"); tmp = tmp.replace(/>/g, "&gt;"); tmp = tmp.replace(/ /g, "&nbsp;"); tmp = tmp.replace(/\n/g, "<br />"); tmp = tmp.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp");
function initRuntime() { function escapeHTML(s) { var tmp = s; tmp = tmp.replace("&", "&amp;"); tmp = tmp.replace("<", "&lt;"); tmp = tmp.replace(">", "&gt;"); tmp = tmp.replace(" ", "&nbsp;"); tmp = tmp.replace("\n", "<br />"); tmp = tmp.replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp"); return tmp; } document.write("<div id='stdout'></div>"); SC_DEFAULT_OUT = new sc_GenericOutputPort( function(s) { var stdout = document.getElementById('stdout'); stdout.innerHTML = stdout.innerHTML + escapeHTML(s); }); SC_ERROR_OUT = SC_DEFAULT_OUT;}
return false;
input: function(element) { switch (element.type.toLowerCase()) { case 'hidden': case 'text': return Form.Element.Serializers.textarea(element); case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); } },
case 'password':
input: function(element) { switch (element.type.toLowerCase()) { case 'hidden': case 'text': return Form.Element.Serializers.textarea(element); case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); } },
case 'hidden': case 'password': case 'text': return Form.Element.Serializers.textarea(element);
input: function(element) { switch (element.type.toLowerCase()) { case 'hidden': case 'password': case 'text': return Form.Element.Serializers.textarea(element); case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); } return false; },
default: return Form.Element.Serializers.textarea(element);
input: function(element) { switch (element.type.toLowerCase()) { case 'hidden': case 'password': case 'text': return Form.Element.Serializers.textarea(element); case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); } return false; },
inputElement.innerText = historyArray[historySize - historyIndex].childNodes[0].innerText;
var item = historyArray[historySize - historyIndex].childNodes[0]; while(item.className.indexOf("expression") == -1) { historyIndex++; item = historyArray[historySize - historyIndex].childNodes[0]; } inputElement.innerText = item.innerText;
function inputKeyDown(event){ if (event.keyCode == 13 && !event.altKey) { if (mainWindow.isPaused() && mainWindow.currentStack) { sendScript(inputElement.innerText); inputElement.innerText = ""; inputElement.focus(); } else alert("The debugger needs to be paused.\tIn order to evaluate your script input you need to pause the debugger in the context of another script."); event.preventDefault(); } else if (event.keyCode == 38 && !event.altKey) { var history = document.getElementById("history"); if(historyIndex == -1) storedInput = inputElement.innerText; var historyArray = history.childNodes; var historySize = historyArray.length - 1; if(historyIndex < historySize) { historyIndex++; inputElement.innerText = historyArray[historySize - historyIndex].childNodes[0].innerText; } event.preventDefault(); } else if (event.keyCode == 40 && !event.altKey) { if(historyIndex >= 0) { var history = document.getElementById("history"); historyIndex--; if (historyIndex == -1) inputElement.innerText = storedInput; else { var historyArray = history.childNodes; inputElement.innerText = historyArray[(historyArray.length - 1) - historyIndex].childNodes[0].innerText; } } event.preventDefault(); }}
inputElement.innerText = historyArray[(historyArray.length - 1) - historyIndex].childNodes[0].innerText;
var historySize = historyArray.length - 1; var item = historyArray[historySize - historyIndex].childNodes[0]; while(item.className.indexOf("expression") == -1) { historyIndex--; item = historyArray[historySize - historyIndex].childNodes[0]; } inputElement.innerText = item.innerText;
function inputKeyDown(event){ if (event.keyCode == 13 && !event.altKey) { if (mainWindow.isPaused() && mainWindow.currentStack) { sendScript(inputElement.innerText); inputElement.innerText = ""; inputElement.focus(); } else alert("The debugger needs to be paused.\tIn order to evaluate your script input you need to pause the debugger in the context of another script."); event.preventDefault(); } else if (event.keyCode == 38 && !event.altKey) { var history = document.getElementById("history"); if(historyIndex == -1) storedInput = inputElement.innerText; var historyArray = history.childNodes; var historySize = historyArray.length - 1; if(historyIndex < historySize) { historyIndex++; inputElement.innerText = historyArray[historySize - historyIndex].childNodes[0].innerText; } event.preventDefault(); } else if (event.keyCode == 40 && !event.altKey) { if(historyIndex >= 0) { var history = document.getElementById("history"); historyIndex--; if (historyIndex == -1) inputElement.innerText = storedInput; else { var historyArray = history.childNodes; inputElement.innerText = historyArray[(historyArray.length - 1) - historyIndex].childNodes[0].innerText; } } event.preventDefault(); }}
if (!AutoValidator.validate(formObj)) { alert(tinyMCE.getLang('lang_invalid_data')); return false; }
function insertAction() { var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); var elm = inst.getFocusElement(); var formObj = document.forms[0]; var src = formObj.src.value; var onmouseoversrc = formObj.onmouseoversrc.value; var onmouseoutsrc = formObj.onmouseoutsrc.value; if (tinyMCE.getParam("accessibility_warnings")) { if (formObj.alt.value == "") { var answer = confirm(tinyMCE.getLang('lang_advimage_missing_alt', '', true)); if (answer == true) { formObj.alt.value = " "; } } else { var answer = true; } if (!answer) return; } if (onmouseoversrc && onmouseoversrc != "") onmouseoversrc = "this.src='" + convertURL(onmouseoversrc, tinyMCE.imgElement) + "';"; if (onmouseoutsrc && onmouseoutsrc != "") onmouseoutsrc = "this.src='" + convertURL(onmouseoutsrc, tinyMCE.imgElement) + "';"; if (elm != null && elm.nodeName == "IMG") { setAttrib(elm, 'src', convertURL(src, tinyMCE.imgElement)); setAttrib(elm, 'mce_src', src); setAttrib(elm, 'alt'); setAttrib(elm, 'title'); setAttrib(elm, 'border'); setAttrib(elm, 'vspace'); setAttrib(elm, 'hspace'); setAttrib(elm, 'width'); setAttrib(elm, 'height'); setAttrib(elm, 'onmouseover', onmouseoversrc); setAttrib(elm, 'onmouseout', onmouseoutsrc); setAttrib(elm, 'id'); setAttrib(elm, 'dir'); setAttrib(elm, 'lang'); setAttrib(elm, 'longdesc'); setAttrib(elm, 'usemap'); setAttrib(elm, 'style'); setAttrib(elm, 'class', getSelectValue(formObj, 'classlist')); setAttrib(elm, 'align', getSelectValue(formObj, 'align')); //tinyMCEPopup.execCommand("mceRepaint"); // Repaint if dimensions changed if (formObj.width.value != orgImageWidth || formObj.height.value != orgImageHeight) inst.repaint(); // Refresh in old MSIE if (tinyMCE.isMSIE5) elm.outerHTML = elm.outerHTML; } else { var html = "<img"; html += makeAttrib('src', convertURL(src, tinyMCE.imgElement)); html += makeAttrib('mce_src', src); html += makeAttrib('alt'); html += makeAttrib('title'); html += makeAttrib('border'); html += makeAttrib('vspace'); html += makeAttrib('hspace'); html += makeAttrib('width'); html += makeAttrib('height'); html += makeAttrib('onmouseover', onmouseoversrc); html += makeAttrib('onmouseout', onmouseoutsrc); html += makeAttrib('id'); html += makeAttrib('dir'); html += makeAttrib('lang'); html += makeAttrib('longdesc'); html += makeAttrib('usemap'); html += makeAttrib('style'); html += makeAttrib('class', getSelectValue(formObj, 'classlist')); html += makeAttrib('align', getSelectValue(formObj, 'align')); html += " />"; tinyMCEPopup.execCommand("mceInsertContent", false, html); } tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCEPopup.close();}
insertContent: function() { this.element.parentNode.insertBefore(this.fragment, this.element.nextSibling);
insertContent: function(fragments) { fragments.each((function(fragment) { this.element.parentNode.insertBefore(fragment, this.element.nextSibling); }).bind(this));
insertContent: function() { this.element.parentNode.insertBefore(this.fragment, this.element.nextSibling); }
function insertImage(nodeid) {
function insertImage() {
function insertImage(nodeid) { var src = document.forms['image'].assetName.value; var title = document.forms['image'].caption.value; var type = document.forms['image'].type.value; var height = document.forms['image'].height.value; var width = document.forms['image'].width.value; window.opener.SetUrl( nodeid + '/' + src, width, height, title ); window.close(); }
window.opener.SetUrl( nodeid + '/' + src, width, height, title );
window.opener.SetUrl( src, width, height, title );
function insertImage(nodeid) { var src = document.forms['image'].assetName.value; var title = document.forms['image'].caption.value; var type = document.forms['image'].type.value; var height = document.forms['image'].height.value; var width = document.forms['image'].width.value; window.opener.SetUrl( nodeid + '/' + src, width, height, title ); window.close(); }
} else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file: else if (href.substring(0, 2) == "\\\\") filepath = "file: tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, "");
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
filepath = "file:
filepath = "file:\/\/" + href.replace(/\\/gi, "\/");
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var fileTabElm = document.getElementById("file_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file://" + href.replace(/\\/gi, "/"); else if (href.substring(0, 2) == "\\\\") filepath = "file://///" + href.replace(/\\/gi, "/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
filepath = "file:
filepath = "file:\/\/\/" + href.replace(/\\/gi, "\/");
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var fileTabElm = document.getElementById("file_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file://" + href.replace(/\\/gi, "/"); else if (href.substring(0, 2) == "\\\\") filepath = "file://///" + href.replace(/\\/gi, "/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
var href = document.forms[0].attach.value;
var href = document.forms[0].attach_file.value;
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var fileTabElm = document.getElementById("file_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file:\/\/" + href.replace(/\\/gi, "\/"); else if (href.substring(0, 2) == "\\\\") filepath = "file:\/\/\/" + href.replace(/\\/gi, "\/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
var href = document.forms[0].filepath.value; var filepath="";
var href = document.forms[0].filepaths.value; var filepaths="";
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var fileTabElm = document.getElementById("file_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file:\/\/" + href.replace(/\\/gi, "\/"); else if (href.substring(0, 2) == "\\\\") filepath = "file:\/\/\/" + href.replace(/\\/gi, "\/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
filepath = "file:\/\/" + href.replace(/\\/gi, "\/");
filepaths = "file:\/\/" + href.replace(/\\/gi, "\/");
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var fileTabElm = document.getElementById("file_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file:\/\/" + href.replace(/\\/gi, "\/"); else if (href.substring(0, 2) == "\\\\") filepath = "file:\/\/\/" + href.replace(/\\/gi, "\/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
filepath = "file:\/\/\/" + href.replace(/\\/gi, "\/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, "");
filepaths = "file:\/\/\/" + href.replace(/\\/gi, "\/"); tinyMCE.themes['wikieditor'].insertLink(filepaths, "", text, "", "", dummy, "");
function insertLink() { var wikiTabElm = document.getElementById("wiki_tab"); var webTabElm = document.getElementById("web_tab"); var fileTabElm = document.getElementById("file_tab"); var attachTabElm = document.getElementById("attachments_tab"); var emailTabElm = document.getElementById("email_tab"); var dummy; tinyMCEPopup.restoreSelection(); if (wikiTabElm.className == "current") { var href = document.forms[0].wiki_page.value; var space = document.forms[0].wiki_space.value; var wikitext = document.forms[0].wiki_text.value; tinyMCE.themes['wikieditor'].insertLink(href, "", wikitext, space, "", dummy, ""); } else if (webTabElm.className == "current") { var webtext = document.forms[0].web_text.value; var href = document.forms[0].web_page.value; tinyMCE.themes['wikieditor'].insertLink(href, "", webtext, "", "", dummy, ""); } else if (attachTabElm.className == "current") { var href = document.forms[0].attach.value; var text = document.forms[0].attach_text.value; tinyMCE.themes['wikieditor'].insertLink("wikiattachment:-:" + href, "", text, "", "", dummy, ""); } else if (fileTabElm.className == "current") { var text = document.forms[0].file_text.value; var href = document.forms[0].filepath.value; var filepath=""; if (":" == href.charAt(href.indexOf("\\") - 1)) filepath = "file:\/\/" + href.replace(/\\/gi, "\/"); else if (href.substring(0, 2) == "\\\\") filepath = "file:\/\/\/" + href.replace(/\\/gi, "\/"); tinyMCE.themes['wikieditor'].insertLink(filepath, "", text, "", "", dummy, ""); } else if (emailTabElm.className == "current") { var text = document.forms[0].email_text.value; var email = document.forms[0].email.value; href = "mailto:" + email; tinyMCE.themes['wikieditor'].insertLink(href, "", text, "", "", dummy, ""); } tinyMCEPopup.close();}
{var str = "<div class='exportDocName'>";
{var str = "<div class='importDoc'>";
function insertNewDoc(id, value, language){var str = "<div class='exportDocName'>"; str += "<input type='checkBox' name='pages' value='" + value + "' class='selCheckedDoc' id='sel_" + value + "' checked />"; // Add language var sLanguage = ""; if (language!=null) sLanguage = "" + language; var htmlLanguage = "<input type=\"hidden\" name=\"language_" + value + "\" value=\"" + sLanguage + "\" />"; str += htmlLanguage; // Add name str += value; if ((language!=null)&&(language!="")) { str += " (" + language + ")"; } str += "</div>"; new Insertion.Bottom(id, str);}
if (!AutoValidator.validate(formObj)) { alert(tinyMCE.getLang('lang_invalid_data')); return false; }
function insertTable() { var formObj = document.forms[0]; var inst = tinyMCE.selectedInstance; var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className; var html = ''; var elm = tinyMCE.tableElm; var cellLimit, rowLimit, colLimit; tinyMCEPopup.restoreSelection(); // Get form data cols = formObj.elements['cols'].value; rows = formObj.elements['rows'].value; border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value; width = formObj.elements['width'].value; height = formObj.elements['height'].value; bordercolor = formObj.elements['bordercolor'].value; bgcolor = formObj.elements['bgcolor'].value; className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value; id = formObj.elements['id'].value; summary = formObj.elements['summary'].value; style = formObj.elements['style'].value; dir = formObj.elements['dir'].value; lang = formObj.elements['lang'].value; background = formObj.elements['backgroundimage'].value; cellLimit = tinyMCE.getParam('table_cell_limit', false); rowLimit = tinyMCE.getParam('table_row_limit', false); colLimit = tinyMCE.getParam('table_col_limit', false); // Validate table size if (colLimit && cols > colLimit) { alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit})); return false; } else if (rowLimit && rows > rowLimit) { alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit})); return false; } else if (cellLimit && cols * rows > cellLimit) { alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit})); return false; } // Update table if (action == "update") { inst.execCommand('mceBeginUndoLevel'); tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true); tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true); tinyMCE.setAttrib(elm, 'border', border, true); tinyMCE.setAttrib(elm, 'align', align); tinyMCE.setAttrib(elm, 'class', className); tinyMCE.setAttrib(elm, 'style', style); tinyMCE.setAttrib(elm, 'id', id); tinyMCE.setAttrib(elm, 'summary', summary); tinyMCE.setAttrib(elm, 'dir', dir); tinyMCE.setAttrib(elm, 'lang', lang); // Not inline styles if (!tinyMCE.getParam("inline_styles")) tinyMCE.setAttrib(elm, 'width', width, true); // Remove these since they are not valid XHTML tinyMCE.setAttrib(elm, 'borderColor', ''); tinyMCE.setAttrib(elm, 'bgColor', ''); tinyMCE.setAttrib(elm, 'background', ''); tinyMCE.setAttrib(elm, 'height', ''); if (background != '') elm.style.backgroundImage = "url('" + background + "')"; else elm.style.backgroundImage = ''; if (tinyMCE.getParam("inline_styles")) elm.style.borderWidth = border + "px"; if (tinyMCE.getParam("inline_styles")) { if (width != '') elm.style.width = getCSSSize(width); } if (bordercolor != "") { elm.style.borderColor = bordercolor; elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; elm.style.borderWidth = border == "" ? "1px" : border; } else elm.style.borderColor = ''; elm.style.backgroundColor = bgcolor; elm.style.height = getCSSSize(height); tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst); // Fix for stange MSIE align bug tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML; tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst); tinyMCE.triggerNodeChange(); inst.execCommand('mceEndUndoLevel'); // Repaint if dimensions changed if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) inst.repaint(); tinyMCEPopup.close(); return true; } // Create new table html += '<table'; html += makeAttrib('id', id); html += makeAttrib('border', border); html += makeAttrib('cellpadding', cellpadding); html += makeAttrib('cellspacing', cellspacing); html += makeAttrib('width', width); //html += makeAttrib('height', height); //html += makeAttrib('bordercolor', bordercolor); //html += makeAttrib('bgcolor', bgcolor); html += makeAttrib('align', align); html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0)); html += makeAttrib('style', style); html += makeAttrib('summary', summary); html += makeAttrib('dir', dir); html += makeAttrib('lang', lang); html += '>'; for (var y=0; y<rows; y++) { html += "<tr>"; for (var x=0; x<cols; x++) html += '<td>&nbsp;</td>'; html += "</tr>"; } html += "</table>"; inst.execCommand('mceBeginUndoLevel'); inst.execCommand('mceInsertContent', false, html); tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close();}
true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top);
true : (((bounds.bottom > this.bottom) && (bounds.bottom < this.top)) || ((this.bottom > bounds.bottom) && (this.bottom < bounds.top)));
intersectsBounds:function(bounds, inclusive) { if (inclusive == null) { inclusive = true; } var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top); var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.top > this.bottom) && (bounds.top < this.top); var inRight = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.right > this.left) && (bounds.right < this.right); var inLeft = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.left > this.left) && (bounds.left < this.right); return (this.containsBounds(bounds, true, inclusive) || bounds.containsBounds(this, true, inclusive) || (inTop || inBottom ) && (inLeft || inRight )); },
true : (bounds.top > this.bottom) && (bounds.top < this.top);
true : (((bounds.top > this.bottom) && (bounds.top < this.top)) || ((this.top > bounds.bottom) && (this.top < bounds.top)));
intersectsBounds:function(bounds, inclusive) { if (inclusive == null) { inclusive = true; } var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top); var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.top > this.bottom) && (bounds.top < this.top); var inRight = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.right > this.left) && (bounds.right < this.right); var inLeft = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.left > this.left) && (bounds.left < this.right); return (this.containsBounds(bounds, true, inclusive) || bounds.containsBounds(this, true, inclusive) || (inTop || inBottom ) && (inLeft || inRight )); },
true : (bounds.right > this.left) && (bounds.right < this.right);
true : (((bounds.right > this.left) && (bounds.right < this.right)) || ((this.right > bounds.left) && (this.right < bounds.right)));
intersectsBounds:function(bounds, inclusive) { if (inclusive == null) { inclusive = true; } var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top); var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.top > this.bottom) && (bounds.top < this.top); var inRight = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.right > this.left) && (bounds.right < this.right); var inLeft = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.left > this.left) && (bounds.left < this.right); return (this.containsBounds(bounds, true, inclusive) || bounds.containsBounds(this, true, inclusive) || (inTop || inBottom ) && (inLeft || inRight )); },
true : (bounds.left > this.left) && (bounds.left < this.right);
true : (((bounds.left > this.left) && (bounds.left < this.right)) || ((this.left > bounds.left) && (this.left < bounds.right)));
intersectsBounds:function(bounds, inclusive) { if (inclusive == null) { inclusive = true; } var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top); var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.top > this.bottom) && (bounds.top < this.top); var inRight = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.right > this.left) && (bounds.right < this.right); var inLeft = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.left > this.left) && (bounds.left < this.right); return (this.containsBounds(bounds, true, inclusive) || bounds.containsBounds(this, true, inclusive) || (inTop || inBottom ) && (inLeft || inRight )); },
(inTop || inBottom ) && (inLeft || inRight ));
((inTop || inBottom ) && (inLeft || inRight )));
intersectsBounds:function(bounds, inclusive) { if (inclusive == null) { inclusive = true; } var inBottom = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.bottom > this.bottom) && (bounds.bottom < this.top); var inTop = (bounds.bottom == this.bottom && bounds.top == this.top) ? true : (bounds.top > this.bottom) && (bounds.top < this.top); var inRight = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.right > this.left) && (bounds.right < this.right); var inLeft = (bounds.right == this.right && bounds.left == this.left) ? true : (bounds.left > this.left) && (bounds.left < this.right); return (this.containsBounds(bounds, true, inclusive) || bounds.containsBounds(this, true, inclusive) || (inTop || inBottom ) && (inLeft || inRight )); },
bounds.containsBounds(this, true, inclusive));
bounds.containsBounds(this, true, inclusive) || (inTop || inBottom ) && (inLeft || inRight ));
intersectsBounds:function(bounds, inclusive) { if (inclusive == null) { inclusive = true; } return (this.containsBounds(bounds, true, inclusive) || bounds.containsBounds(this, true, inclusive)); },
tmp_mode = "-";
var tmp_mode = "-";
function inverse_chanmode(bitlist) { tmp_mode = "-"; if (bitlist&CHANMODE_INVITE) tmp_mode += "i"; if (bitlist&CHANMODE_KEY) tmp_mode += "k"; if (bitlist&CHANMODE_LIMIT) tmp_mode += "l"; if (bitlist&CHANMODE_MODERATED) tmp_mode += "m"; if (bitlist&CHANMODE_NOOUTSIDE) tmp_mode += "n"; if (bitlist&CHANMODE_PRIVATE) tmp_mode += "p"; if (bitlist&CHANMODE_SECRET) tmp_mode += "s"; if (bitlist&CHANMODE_TOPIC) tmp_mode += "t"; return tmp_mode;}
}));
}), 'rgb');
invert: function(){ return new Color(this.map(function(value){ return 255 - value; })); },
currentDocument = null;
this.invoke=function () { try { fn(); } finally { removeLoadListener(getIframe(), self.invoke); } }
var range = getIPRangeManager().getIPRange(iprangeId);
var range = getAccreditableManager().getIPRangeManager().getIPRange(iprangeId);
function iprange_change_groups(iprangeId) { var range = getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var iterator = getGroupManager().getGroups(); var groups = new java.util.ArrayList(); while (iterator.hasNext()) { var group = iterator.next(); if (!rangeGroups.contains(group)) { groups.add(group); } } while (true) { sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : "index.html" });}
var iterator = getGroupManager().getGroups();
var iterator = getAccreditableManager().getGroupManager().getGroups();
function iprange_change_groups(iprangeId) { var range = getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var iterator = getGroupManager().getGroups(); var groups = new java.util.ArrayList(); while (iterator.hasNext()) { var group = iterator.next(); if (!rangeGroups.contains(group)) { groups.add(group); } } while (true) { sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : "index.html" });}
sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", {
cocoon.sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", {
function iprange_change_groups(iprangeId) { var range = getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var iterator = getGroupManager().getGroups(); var groups = new java.util.ArrayList(); while (iterator.hasNext()) { var group = iterator.next(); if (!rangeGroups.contains(group)) { groups.add(group); } } while (true) { sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : "index.html" });}
var group = getGroupManager().getGroup(groupId);
var group = getAccreditableManager().getGroupManager().getGroup(groupId);
function iprange_change_groups(iprangeId) { var range = getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var iterator = getGroupManager().getGroups(); var groups = new java.util.ArrayList(); while (iterator.hasNext()) { var group = iterator.next(); if (!rangeGroups.contains(group)) { groups.add(group); } } while (true) { sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : "index.html" });}
var group = getGroupManager().getGroup(rangeGroupId);
var group = getAccreditableManager().getGroupManager().getGroup(rangeGroupId);
function iprange_change_groups(iprangeId) { var range = getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var iterator = getGroupManager().getGroups(); var groups = new java.util.ArrayList(); while (iterator.hasNext()) { var group = iterator.next(); if (!rangeGroups.contains(group)) { groups.add(group); } } while (true) { sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : "index.html" });}
sendPageAndWait("ipranges/groups.xml", {
sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", {
function iprange_change_groups(iprangeId) { var range = getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var iterator = getGroupManager().getGroups(); var groups = new java.util.ArrayList(); while (iterator.hasNext()) { var group = iterator.next(); if (!rangeGroups.contains(group)) { groups.add(group); } } while (true) { sendPageAndWait("ipranges/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : "index.html" });}
var ipRangeManager = getIPRangeManager(); var ipRangeId = cocoon.request.get("iprange-id"); var range = ipRangeManager.getIPRange(ipRangeId); var name = range.getName(); var showPage = true;
resolve(); try { var ipRangeManager = getAccreditableManager().getIPRangeManager(); var ipRangeId = cocoon.request.get("iprange-id"); var range = ipRangeManager.getIPRange(ipRangeId); var name = range.getName(); var showPage = true; while (showPage) { cocoon.sendPageAndWait("ipranges/confirm-delete-common.xml", { "type" : "IP range", "id" : ipRangeId, "name" : name }); if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { ipRangeManager.remove(range); range['delete'](); showPage = false; } }
function iprange_delete_iprange() { var ipRangeManager = getIPRangeManager(); var ipRangeId = cocoon.request.get("iprange-id"); var range = ipRangeManager.getIPRange(ipRangeId); var name = range.getName(); var showPage = true; while (showPage) { sendPageAndWait("ipranges/confirm-delete-common.xml", { "type" : "IP range", "id" : ipRangeId, "name" : name }); if (cocoon.request.get("submit")) { ipRangeManager.remove(range); range['delete'](); showPage = false; } } sendPage("redirect.html", { "url" : "../ipranges.html" });}
while (showPage) { sendPageAndWait("ipranges/confirm-delete-common.xml", { "type" : "IP range", "id" : ipRangeId, "name" : name }); if (cocoon.request.get("submit")) { ipRangeManager.remove(range); range['delete'](); showPage = false; } } sendPage("redirect.html", { "url" : "../ipranges.html" });
cocoon.sendPage("redirect.html", { "url" : "../ipranges.html" }); } finally { release(); }
function iprange_delete_iprange() { var ipRangeManager = getIPRangeManager(); var ipRangeId = cocoon.request.get("iprange-id"); var range = ipRangeManager.getIPRange(ipRangeId); var name = range.getName(); var showPage = true; while (showPage) { sendPageAndWait("ipranges/confirm-delete-common.xml", { "type" : "IP range", "id" : ipRangeId, "name" : name }); if (cocoon.request.get("submit")) { ipRangeManager.remove(range); range['delete'](); showPage = false; } } sendPage("redirect.html", { "url" : "../ipranges.html" });}
sendPage("redirect.html", { "url" : redirectUri });
cocoon.redirectTo(redirectUri);
function iprangeChangeGroups() { var redirectUri = getRequestUri(); var iprangeId = getAccreditableId(); var range = getAccreditableManager().getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var groupArray = getAccreditableManager().getGroupManager().getGroups(); var groups = new java.util.ArrayList(); for (var i = 0; i < groupArray.length; i++) { if (!rangeGroups.contains(groupArray[i])) { groups.add(groupArray[i]); } } while (true) { cocoon.sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getAccreditableManager().getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getAccreditableManager().getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } sendPage("redirect.html", { "url" : redirectUri });}
cocoon.sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", {
cocoon.sendPageAndWait("ipranges/groups.xml", {
function iprangeChangeGroups() { var redirectUri = getRequestUri(); var iprangeId = getAccreditableId(); var range = getAccreditableManager().getIPRangeManager().getIPRange(iprangeId); var rangeGroupArray = range.getGroups(); var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray)); var groupArray = getAccreditableManager().getGroupManager().getGroups(); var groups = new java.util.ArrayList(); for (var i = 0; i < groupArray.length; i++) { if (!rangeGroups.contains(groupArray[i])) { groups.add(groupArray[i]); } } while (true) { cocoon.sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", { "iprange-id" : iprangeId, "groups" : groups, "iprange-groups" : rangeGroups }); var groupId = cocoon.request.get("group"); if (cocoon.request.get("add_group") && groupId != "") { var group = getAccreditableManager().getGroupManager().getGroup(groupId); if (!rangeGroups.contains(group)) { rangeGroups.add(group); groups.remove(group); } } var rangeGroupId = cocoon.request.get("iprange_group"); if (cocoon.request.get("remove_group") && rangeGroupId != "") { var group = getAccreditableManager().getGroupManager().getGroup(rangeGroupId); if (rangeGroups.contains(group)) { rangeGroups.remove(group); groups.add(group); } } if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { range.removeFromAllGroups(); var iterator = rangeGroups.iterator(); while (iterator.hasNext()) { var group = iterator.next(); group.add(range); } range.save(); break; } } cocoon.redirectTo(redirectUri);}
cocoon.sendPage("redirect.html", { "url" : redirectUri });
cocoon.redirectTo(redirectUri);
function iprangeDeleteIPRange() { resolve(); try { var redirectUri = getRequestUri(); var ipRangeManager = getAccreditableManager().getIPRangeManager(); var ipRangeId = cocoon.request.get("iprange-id"); var range = ipRangeManager.getIPRange(ipRangeId); var name = range.getName(); var showPage = true; while (showPage) { cocoon.sendPageAndWait("ipranges/confirm-delete-common.xml", { "type" : "IP Range", "id" : ipRangeId, "name" : name }); if (cocoon.request.get("cancel")) { break; } if (cocoon.request.get("submit")) { ipRangeManager.remove(range); range['delete'](); showPage = false; } } cocoon.sendPage("redirect.html", { "url" : redirectUri }); } finally { release(); }}
this.queue = new Array();
this.queue = new Array;
function IRC_Queue() { this.queue = new Array(); this.bytes = 0; this.add = Queue_Add;}
this.check_nickname=IRCClient_check_nickname;
function IRC_Server() { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.hub = false; // are we a hub? this.local = true; // are we a local socket? this.pinged = false; // have we sent a PING? this.server = true; // yep, we're a server. this.uline = false; // are we services? // Variables containing user/server information as we receive it. this.flags = 0; this.hops = 0; this.hostname = ""; this.id = 0; this.ip = ""; this.ircclass = 0; this.linkparent=""; this.nick = ""; this.parent = 0; this.info = ""; this.idletime = time(); // Variables (consts, really) that point to various state information this.socket = ""; ////////// FUNCTIONS // Functions we use to control clients (specific) this.quit = Server_Quit; this.work = Server_Work; this.netsplit = IRCClient_netsplit; // Socket functions this.ircout=ircout; this.originatorout=originatorout; this.rawout=rawout; // IRC protocol sending functions this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; // Output helpers this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; // Global Functions this.check_timeout=IRCClient_check_timeout; this.set_chanmode=IRCClient_set_chanmode; // Output helper functions (shared)}
this.type = BAHAMUT;
function IRC_Server() { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.hub = false; // are we a hub? this.local = true; // are we a local socket? this.pinged = false; // have we sent a PING? this.server = true; // yep, we're a server. this.uline = false; // are we services? // Variables containing user/server information as we receive it. this.flags = 0; this.hops = 0; this.hostname = ""; this.id = 0; this.ip = ""; this.ircclass = 0; this.linkparent=""; this.nick = ""; this.parent = 0; this.info = ""; this.idletime = time(); // Variables (consts, really) that point to various state information this.socket = ""; ////////// FUNCTIONS // Functions we use to control clients (specific) this.quit = Server_Quit; this.work = Server_Work; this.netsplit = IRCClient_netsplit; // Socket functions this.ircout=ircout; this.originatorout=originatorout; this.rawout=rawout; this.sendq = new IRC_Queue(); this.recvq = new IRC_Queue(); // IRC protocol sending functions this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.globops=IRCClient_globops; // Output helpers this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; // Global Functions this.check_timeout=IRCClient_check_timeout; this.check_sendq=IRCClient_check_sendq; this.set_chanmode=IRCClient_set_chanmode; this.check_nickname=IRCClient_check_nickname; // Output helper functions (shared)}
this.do_msg=IRCClient_do_msg;
function IRC_Server() { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.hub = false; // are we a hub? this.local = true; // are we a local socket? this.pinged = false; // have we sent a PING? this.server = true; // yep, we're a server. this.uline = false; // are we services? // Variables containing user/server information as we receive it. this.flags = 0; this.hops = 0; this.hostname = ""; this.id = 0; this.ip = ""; this.ircclass = 0; this.linkparent=""; this.nick = ""; this.parent = 0; this.info = ""; this.idletime = time(); // Variables (consts, really) that point to various state information this.socket = ""; ////////// FUNCTIONS // Functions we use to control clients (specific) this.quit = Server_Quit; this.work = Server_Work; this.netsplit = IRCClient_netsplit; // Socket functions this.ircout=ircout; this.originatorout=originatorout; this.rawout=rawout; // IRC protocol sending functions this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; // Output helpers this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; this.do_msg=IRCClient_do_msg; // Global Functions this.check_timeout=IRCClient_check_timeout; this.set_chanmode=IRCClient_set_chanmode; this.check_nickname=IRCClient_check_nickname; // Output helper functions (shared)}
for(sw_counter=0;sw_counter<startword;sw_counter++) {
for(sw_counter=0;sw_counter<arg;sw_counter++) {
function IRC_string(str,arg) { var cindex; if (arg) { for(sw_counter=0;sw_counter<startword;sw_counter++) { str=str.slice(str.indexOf(" ")+1); } } cindex = str.indexOf(":")+1; if (!cindex) cindex = str.lastIndexOf(" ")+1; if (!cindex) return str; return(str.slice(cindex));}
this.channels = new Array;
this.channels = new Object;
function IRC_User(id) { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.flagged_for_quit = false; // QUIT later? this.local = true; // are we a local socket? this.pinged = false; // sent PING? this.server = false; // No, we're not a server. this.uline = false; // Are we services? // Variables containing user/server information as we receive it. this.away = ""; this.channels = new Array; this.connecttime = time(); this.created = 0; this.flags = 0; this.hops = 0; this.hostname = ""; this.idletime = time(); this.invited = ""; this.ircclass = 0; this.mode = 0; this.nick = ""; this.parent = 0; this.realname = ""; this.servername = servername; this.talkidle = time(); this.uprefix = ""; this.id = id; // Variables (consts, really) that point to various state information this.socket = ""; ////////// FUNCTIONS // Functions we use to control clients (specific) this.quit = User_Quit; this.work = User_Work; // Socket functions this.ircout=ircout; this.originatorout=originatorout; this.rawout=rawout; this.sendq = new IRC_Queue(); this.recvq = new IRC_Queue(); // Output helper functions (shared) this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.do_admin=IRCClient_do_admin; this.do_connect=IRCClient_do_connect; this.do_info=IRCClient_do_info; this.do_join=IRCClient_do_join; this.do_links=IRCClient_do_links; this.do_msg=IRCClient_do_msg; this.do_part=IRCClient_do_part; this.do_stats=IRCClient_do_stats; this.do_summon=IRCClient_do_summon; this.do_trace=IRCClient_do_trace; this.do_users=IRCClient_do_users; this.do_whois=IRCClient_do_whois; this.global=IRCClient_global; this.globops=IRCClient_globops; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.part_all=IRCClient_part_all; this.server_notice=IRCClient_server_notice; this.services_msg=IRCClient_services_msg; this.trace_all_opers=IRCClient_trace_all_opers; // WHO this.do_basic_who=IRCClient_do_basic_who; this.do_complex_who=IRCClient_do_complex_who; this.do_who_usage=IRCClient_do_who_usage; this.match_who_mask=IRCClient_match_who_mask; // LIST this.do_basic_list=IRCClient_do_basic_list; this.do_complex_list=IRCClient_do_complex_list; this.do_list_usage=IRCClient_do_list_usage; // Global functions this.check_nickname=IRCClient_check_nickname; this.check_timeout=IRCClient_check_timeout; this.check_sendq=IRCClient_check_sendq; this.get_usermode=IRCClient_get_usermode; this.netsplit=IRCClient_netsplit; this.onchanwith=IRCClient_onchanwith; this.rmchan=IRCClient_RMChan; this.setusermode=IRCClient_setusermode; this.set_chanmode=IRCClient_set_chanmode; // Numerics this.numeric=IRCClient_numeric; this.numeric200=IRCClient_numeric200; this.numeric201=IRCClient_numeric201; this.numeric202=IRCClient_numeric202; this.numeric203=IRCClient_numeric203; this.numeric204=IRCClient_numeric204; this.numeric205=IRCClient_numeric205; this.numeric206=IRCClient_numeric206; this.numeric208=IRCClient_numeric208; this.numeric261=IRCClient_numeric261; this.numeric321=IRCClient_numeric321; this.numeric322=IRCClient_numeric322; this.numeric331=IRCClient_numeric331; this.numeric332=IRCClient_numeric332; this.numeric333=IRCClient_numeric333; this.numeric351=IRCClient_numeric351; this.numeric352=IRCClient_numeric352; this.numeric353=IRCClient_numeric353; this.numeric382=IRCClient_numeric382; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; // Getters this.nuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); };}
this.do_basic_list=IRCClient_do_basic_list; this.do_complex_list=IRCClient_do_complex_list; this.do_list_usage=IRCClient_do_list_usage;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric200=IRCClient_numeric200; this.numeric201=IRCClient_numeric201; this.numeric202=IRCClient_numeric202; this.numeric203=IRCClient_numeric203; this.numeric204=IRCClient_numeric204; this.numeric205=IRCClient_numeric205; this.numeric206=IRCClient_numeric206; this.numeric208=IRCClient_numeric208; this.numeric261=IRCClient_numeric261; this.numeric322=IRCClient_numeric322; this.numeric331=IRCClient_numeric331; this.numeric332=IRCClient_numeric332; this.numeric333=IRCClient_numeric333; this.numeric351=IRCClient_numeric351; this.numeric352=IRCClient_numeric352; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.onchanwith=IRCClient_onchanwith; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_trace=IRCClient_do_trace; this.trace_all_opers=IRCClient_trace_all_opers; this.do_connect=IRCClient_do_connect; this.do_basic_who=IRCClient_do_basic_who; this.do_complex_who=IRCClient_do_complex_who; this.do_who_usage=IRCClient_do_who_usage; this.match_who_mask=IRCClient_match_who_mask; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.check_timeout=IRCClient_check_timeout; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
if (possible_hostname) {
if (resolve_hostnames && possible_hostname) {
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.hops=0; this.server=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.decip=0; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.decip = ip_to_dec(this.socket.remote_ip_address); this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
server_wallops("!DEBUG: resolve_host took " + went_into_hostname + " seconds.");
oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds.");
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.hops=0; this.server=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.decip=0; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; server_wallops("!DEBUG: resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.decip = ip_to_dec(this.socket.remote_ip_address); this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** Synchronet IRC Daemon (" + serverdesc + ") Ready."); }}
this.reintroduce_nick=IRCClient_reintroduce_nick;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_connect=IRCClient_do_connect; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
this.numeric412=IRCClient_numeric412;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.decip=0; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.decip = ip_to_dec(this.socket.remote_ip_address); this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric200=IRCClient_numeric200; this.numeric201=IRCClient_numeric201; this.numeric202=IRCClient_numeric202; this.numeric203=IRCClient_numeric203; this.numeric204=IRCClient_numeric204; this.numeric205=IRCClient_numeric205; this.numeric206=IRCClient_numeric206; this.numeric208=IRCClient_numeric208; this.numeric261=IRCClient_numeric261; this.numeric321=IRCClient_numeric321; this.numeric322=IRCClient_numeric322; this.numeric331=IRCClient_numeric331; this.numeric332=IRCClient_numeric332; this.numeric333=IRCClient_numeric333; this.numeric351=IRCClient_numeric351; this.numeric352=IRCClient_numeric352; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.onchanwith=IRCClient_onchanwith; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_trace=IRCClient_do_trace; this.trace_all_opers=IRCClient_trace_all_opers; this.do_connect=IRCClient_do_connect; this.do_basic_who=IRCClient_do_basic_who; this.do_complex_who=IRCClient_do_complex_who; this.do_who_usage=IRCClient_do_who_usage; this.match_who_mask=IRCClient_match_who_mask; this.do_basic_list=IRCClient_do_basic_list; this.do_complex_list=IRCClient_do_complex_list; this.do_list_usage=IRCClient_do_list_usage; this.global=IRCClient_global; this.globops=IRCClient_globops; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.check_timeout=IRCClient_check_timeout; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; umode_notice(USERMODE_DEBUG,"Debug", "resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
this.do_trace=IRCClient_do_trace; this.trace_all_opers=IRCClient_trace_all_opers;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric322=IRCClient_numeric322; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_connect=IRCClient_do_connect; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
this.numeric331=IRCClient_numeric331; this.numeric332=IRCClient_numeric332; this.numeric333=IRCClient_numeric333;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric200=IRCClient_numeric200; this.numeric201=IRCClient_numeric201; this.numeric202=IRCClient_numeric202; this.numeric203=IRCClient_numeric203; this.numeric204=IRCClient_numeric204; this.numeric205=IRCClient_numeric205; this.numeric206=IRCClient_numeric206; this.numeric208=IRCClient_numeric208; this.numeric261=IRCClient_numeric261; this.numeric322=IRCClient_numeric322; this.numeric351=IRCClient_numeric351; this.numeric352=IRCClient_numeric352; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.onchanwith=IRCClient_onchanwith; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_trace=IRCClient_do_trace; this.trace_all_opers=IRCClient_trace_all_opers; this.do_connect=IRCClient_do_connect; this.do_basic_who=IRCClient_do_basic_who; this.do_complex_who=IRCClient_do_complex_who; this.do_who_usage=IRCClient_do_who_usage; this.match_who_mask=IRCClient_match_who_mask; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.check_timeout=IRCClient_check_timeout; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
log("Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port);
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.hops=0; this.server=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric353=IRCClient_numeric353; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.decip=0; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); log("Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; server_wallops("!DEBUG: resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.decip = ip_to_dec(this.socket.remote_ip_address); this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** Synchronet IRC Daemon (" + serverdesc + ") Ready."); }}
oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds.");
umode_notice(USERMODE_DEBUG,"Debug", "resolve_host took " + went_into_hostname + " seconds.");
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric200=IRCClient_numeric200; this.numeric201=IRCClient_numeric201; this.numeric202=IRCClient_numeric202; this.numeric203=IRCClient_numeric203; this.numeric204=IRCClient_numeric204; this.numeric205=IRCClient_numeric205; this.numeric206=IRCClient_numeric206; this.numeric208=IRCClient_numeric208; this.numeric261=IRCClient_numeric261; this.numeric321=IRCClient_numeric321; this.numeric322=IRCClient_numeric322; this.numeric331=IRCClient_numeric331; this.numeric332=IRCClient_numeric332; this.numeric333=IRCClient_numeric333; this.numeric351=IRCClient_numeric351; this.numeric352=IRCClient_numeric352; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.onchanwith=IRCClient_onchanwith; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_trace=IRCClient_do_trace; this.trace_all_opers=IRCClient_trace_all_opers; this.do_connect=IRCClient_do_connect; this.do_basic_who=IRCClient_do_basic_who; this.do_complex_who=IRCClient_do_complex_who; this.do_who_usage=IRCClient_do_who_usage; this.match_who_mask=IRCClient_match_who_mask; this.do_basic_list=IRCClient_do_basic_list; this.do_complex_list=IRCClient_do_complex_list; this.do_list_usage=IRCClient_do_list_usage; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.check_timeout=IRCClient_check_timeout; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.finalize_server_connect=IRCClient_finalize_server_connect; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
this.server_notice("*** Synchronet IRC Daemon (" + serverdesc + ") Ready.");
this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready.");
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.hops=0; this.server=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.decip=0; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.decip = ip_to_dec(this.socket.remote_ip_address); this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** Synchronet IRC Daemon (" + serverdesc + ") Ready."); }}
this.numeric445=IRCClient_numeric445; this.numeric446=IRCClient_numeric446;
function IRCClient(socket,new_id,local_client,do_newconn) { this.pinged=false; this.nick = ""; this.away = ""; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.conntype = TYPE_UNREGISTERED; this.ircclass = 0; this.flags = 0; this.idletime = ""; this.invited = ""; this.password = ""; this.sentps = false; this.local = local_client; this.mode = USERMODE_NONE; this.socket = socket; this.channels = new Array(); this.searchbyiline=IRCClient_searchbyiline; this.quit=IRCClient_Quit; this.netsplit=IRCClient_netsplit; this.ircnuh getter = function() { return(this.nick + "!" + this.uprefix + "@" + this.hostname); }; this.isulined getter = function() { for (my_ul in ULines) { if (this.nick.toUpperCase() == ULines[my_ul].toUpperCase()) return 1; } return 0; }; this.hops=0; this.server=false; this.hub=false; this.servername = servername; this.affect_mode_list=IRCClient_affect_mode_list; this.tweaktmpmode=IRCClient_tweaktmpmode; this.tweaktmpmodelist=IRCClient_tweaktmpmodelist; this.rmchan=IRCClient_RMChan; this.rawout=IRCClient_rawout; this.originatorout=IRCClient_originatorout; this.ircout=IRCClient_ircout; this.server_notice=IRCClient_server_notice; this.setusermode=IRCClient_setusermode; this.numeric=IRCClient_numeric; this.numeric351=IRCClient_numeric351; this.numeric353=IRCClient_numeric353; this.numeric391=IRCClient_numeric391; this.numeric401=IRCClient_numeric401; this.numeric402=IRCClient_numeric402; this.numeric403=IRCClient_numeric403; this.numeric411=IRCClient_numeric411; this.numeric412=IRCClient_numeric412; this.numeric440=IRCClient_numeric440; this.numeric441=IRCClient_numeric441; this.numeric442=IRCClient_numeric442; this.numeric451=IRCClient_numeric451; this.numeric461=IRCClient_numeric461; this.numeric462=IRCClient_numeric462; this.numeric481=IRCClient_numeric481; this.numeric482=IRCClient_numeric482; this.lusers=IRCClient_lusers; this.motd=IRCClient_motd; this.names=IRCClient_names; this.set_chanmode=IRCClient_set_chanmode; this.get_usermode=IRCClient_get_usermode; this.onchannel=IRCClient_onchannel; this.num_channels_on=IRCClient_num_channels_on; this.bcast_to_uchans_unique=IRCClient_bcast_to_uchans_unique; this.check_nickname=IRCClient_check_nickname; this.bcast_to_channel=IRCClient_bcast_to_channel; this.bcast_to_list=IRCClient_bcast_to_list; this.bcast_to_channel_servers=IRCClient_bcast_to_channel_servers; this.bcast_to_servers=IRCClient_bcast_to_servers; this.bcast_to_servers_raw=IRCClient_bcast_to_servers_raw; this.do_join=IRCClient_do_join; this.do_part=IRCClient_do_part; this.do_whois=IRCClient_do_whois; this.do_msg=IRCClient_do_msg; this.do_admin=IRCClient_do_admin; this.do_info=IRCClient_do_info; this.do_stats=IRCClient_do_stats; this.do_users=IRCClient_do_users; this.do_summon=IRCClient_do_summon; this.do_links=IRCClient_do_links; this.do_connect=IRCClient_do_connect; this.global=IRCClient_global; this.services_msg=IRCClient_services_msg; this.part_all=IRCClient_part_all; this.server_commands=IRCClient_server_commands; this.unregistered_commands=IRCClient_unregistered_commands; this.registered_commands=IRCClient_registered_commands; this.id=new_id; this.created=time(); this.parent=0; this.work=IRCClient_work; this.server_nick_info=IRCClient_server_nick_info; this.server_chan_info=IRCClient_server_chan_info; this.server_info=IRCClient_server_info; this.synchronize=IRCClient_synchronize; this.reintroduce_nick=IRCClient_reintroduce_nick; this.ip=""; this.linkparent=""; if (this.socket && local_client && do_newconn) { log(format("%04u",this.socket.descriptor) + " Accepted new connection: " + this.socket.remote_ip_address + " port " + this.socket.remote_port); this.nick = "*"; this.realname = ""; this.away = ""; this.uprefix = ""; this.mode = USERMODE_NONE; if (this.socket.remote_ip_address == "127.0.0.1") { this.hostname = servername; } else { if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(this.socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(this.socket,this.nick, this.hostname); } else this.hostname = this.socket.remote_ip_address; if (debug && resolve_hostnames) { went_into_hostname = time() - went_into_hostname; if (went_into_hostname == "NaN") went_into_hostname=0; oper_notice("DEBUG","resolve_host took " + went_into_hostname + " seconds."); } } if (this.socket.remote_ip_address) this.ip = this.socket.remote_ip_address; this.connecttime = time(); this.idletime = time(); this.talkidle = time(); this.conntype = TYPE_UNREGISTERED; this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready."); }}
set_ban = create_ban_mask(chan_tmplist[x][tmp_index]);
var set_ban = create_ban_mask(chan_tmplist[x][tmp_index]);
function IRCClient_affect_mode_list(list_bit,chan) { for (x=list_bit;x<=(list_bit+1);x++) { for (tmp_index in chan_tmplist[x]) { if (list_bit >= CHANLIST_BAN) { if (x == CHANLIST_BAN) { set_ban = create_ban_mask(chan_tmplist[x][tmp_index]); if (chan.count_modelist(CHANLIST_BAN) >= max_bans) { this.numeric(478, chan.nam + " " + set_ban + " :Cannot add ban, channel's ban list is full."); } else if (set_ban && !chan.isbanned(set_ban)) { addmodes += "b"; addmodeargs += " " + set_ban; banid = chan.add_modelist(set_ban,CHANLIST_BAN); chan.bantime[banid] = time(); chan.bancreator[banid] = this.ircnuh; } } else if (x == CHANLIST_UNBAN) { for (ban in chan.modelist[CHANLIST_BAN]) { if (chan_tmplist[CHANLIST_UNBAN][tmp_index].toUpperCase() == chan.modelist[CHANLIST_BAN][ban].toUpperCase()) { delmodes += "b"; delmodeargs += " " + chan_tmplist[CHANLIST_UNBAN][tmp_index]; banid = chan.del_modelist(chan_tmplist[CHANLIST_UNBAN][tmp_index],CHANLIST_BAN); delete chan.bantime[banid]; delete chan.bancreator[banid]; } } } } else { tmp_nick = searchbynick(chan_tmplist[x][tmp_index]); if (!tmp_nick) tmp_nick = searchbynick(search_nickbuf(chan_tmplist[x][tmp_index])); if (tmp_nick) { // FIXME: check for user existing on channel? if ((x == list_bit) && (!chan.ismode(tmp_nick.id,list_bit))) { addmodes += MODECHAR[list_bit]; addmodeargs += " " + tmp_nick.nick; chan.add_modelist(tmp_nick.id,x); } else if (chan.ismode(tmp_nick.id,list_bit)) { delmodes += MODECHAR[list_bit]; delmodeargs += " " + tmp_nick.nick; chan.del_modelist(tmp_nick.id,list_bit); } } else { this.numeric401(chan_tmplist[x][tmp_index]); } } } }}
banid = chan.add_modelist(set_ban,CHANLIST_BAN);
var banid = chan.add_modelist(set_ban,CHANLIST_BAN);
function IRCClient_affect_mode_list(list_bit,chan) { for (x=list_bit;x<=(list_bit+1);x++) { for (tmp_index in chan_tmplist[x]) { if (list_bit >= CHANLIST_BAN) { if (x == CHANLIST_BAN) { set_ban = create_ban_mask(chan_tmplist[x][tmp_index]); if (chan.count_modelist(CHANLIST_BAN) >= max_bans) { this.numeric(478, chan.nam + " " + set_ban + " :Cannot add ban, channel's ban list is full."); } else if (set_ban && !chan.isbanned(set_ban)) { addmodes += "b"; addmodeargs += " " + set_ban; banid = chan.add_modelist(set_ban,CHANLIST_BAN); chan.bantime[banid] = time(); chan.bancreator[banid] = this.ircnuh; } } else if (x == CHANLIST_UNBAN) { for (ban in chan.modelist[CHANLIST_BAN]) { if (chan_tmplist[CHANLIST_UNBAN][tmp_index].toUpperCase() == chan.modelist[CHANLIST_BAN][ban].toUpperCase()) { delmodes += "b"; delmodeargs += " " + chan_tmplist[CHANLIST_UNBAN][tmp_index]; banid = chan.del_modelist(chan_tmplist[CHANLIST_UNBAN][tmp_index],CHANLIST_BAN); delete chan.bantime[banid]; delete chan.bancreator[banid]; } } } } else { tmp_nick = searchbynick(chan_tmplist[x][tmp_index]); if (!tmp_nick) tmp_nick = searchbynick(search_nickbuf(chan_tmplist[x][tmp_index])); if (tmp_nick) { // FIXME: check for user existing on channel? if ((x == list_bit) && (!chan.ismode(tmp_nick.id,list_bit))) { addmodes += MODECHAR[list_bit]; addmodeargs += " " + tmp_nick.nick; chan.add_modelist(tmp_nick.id,x); } else if (chan.ismode(tmp_nick.id,list_bit)) { delmodes += MODECHAR[list_bit]; delmodeargs += " " + tmp_nick.nick; chan.del_modelist(tmp_nick.id,list_bit); } } else { this.numeric401(chan_tmplist[x][tmp_index]); } } } }}
banid = chan.del_modelist(chan_tmplist[CHANLIST_UNBAN][tmp_index],CHANLIST_BAN);
var banid = chan.del_modelist(chan_tmplist[CHANLIST_UNBAN][tmp_index],CHANLIST_BAN);
function IRCClient_affect_mode_list(list_bit,chan) { for (x=list_bit;x<=(list_bit+1);x++) { for (tmp_index in chan_tmplist[x]) { if (list_bit >= CHANLIST_BAN) { if (x == CHANLIST_BAN) { set_ban = create_ban_mask(chan_tmplist[x][tmp_index]); if (chan.count_modelist(CHANLIST_BAN) >= max_bans) { this.numeric(478, chan.nam + " " + set_ban + " :Cannot add ban, channel's ban list is full."); } else if (set_ban && !chan.isbanned(set_ban)) { addmodes += "b"; addmodeargs += " " + set_ban; banid = chan.add_modelist(set_ban,CHANLIST_BAN); chan.bantime[banid] = time(); chan.bancreator[banid] = this.ircnuh; } } else if (x == CHANLIST_UNBAN) { for (ban in chan.modelist[CHANLIST_BAN]) { if (chan_tmplist[CHANLIST_UNBAN][tmp_index].toUpperCase() == chan.modelist[CHANLIST_BAN][ban].toUpperCase()) { delmodes += "b"; delmodeargs += " " + chan_tmplist[CHANLIST_UNBAN][tmp_index]; banid = chan.del_modelist(chan_tmplist[CHANLIST_UNBAN][tmp_index],CHANLIST_BAN); delete chan.bantime[banid]; delete chan.bancreator[banid]; } } } } else { tmp_nick = searchbynick(chan_tmplist[x][tmp_index]); if (!tmp_nick) tmp_nick = searchbynick(search_nickbuf(chan_tmplist[x][tmp_index])); if (tmp_nick) { // FIXME: check for user existing on channel? if ((x == list_bit) && (!chan.ismode(tmp_nick.id,list_bit))) { addmodes += MODECHAR[list_bit]; addmodeargs += " " + tmp_nick.nick; chan.add_modelist(tmp_nick.id,x); } else if (chan.ismode(tmp_nick.id,list_bit)) { delmodes += MODECHAR[list_bit]; delmodeargs += " " + tmp_nick.nick; chan.del_modelist(tmp_nick.id,list_bit); } } else { this.numeric401(chan_tmplist[x][tmp_index]); } } } }}
tmp_nick = searchbynick(chan_tmplist[x][tmp_index]);
var tmp_nick = searchbynick(chan_tmplist[x][tmp_index]);
function IRCClient_affect_mode_list(list_bit,chan) { for (x=list_bit;x<=(list_bit+1);x++) { for (tmp_index in chan_tmplist[x]) { if (list_bit >= CHANLIST_BAN) { if (x == CHANLIST_BAN) { set_ban = create_ban_mask(chan_tmplist[x][tmp_index]); if (chan.count_modelist(CHANLIST_BAN) >= max_bans) { this.numeric(478, chan.nam + " " + set_ban + " :Cannot add ban, channel's ban list is full."); } else if (set_ban && !chan.isbanned(set_ban)) { addmodes += "b"; addmodeargs += " " + set_ban; banid = chan.add_modelist(set_ban,CHANLIST_BAN); chan.bantime[banid] = time(); chan.bancreator[banid] = this.ircnuh; } } else if (x == CHANLIST_UNBAN) { for (ban in chan.modelist[CHANLIST_BAN]) { if (chan_tmplist[CHANLIST_UNBAN][tmp_index].toUpperCase() == chan.modelist[CHANLIST_BAN][ban].toUpperCase()) { delmodes += "b"; delmodeargs += " " + chan_tmplist[CHANLIST_UNBAN][tmp_index]; banid = chan.del_modelist(chan_tmplist[CHANLIST_UNBAN][tmp_index],CHANLIST_BAN); delete chan.bantime[banid]; delete chan.bancreator[banid]; } } } } else { tmp_nick = searchbynick(chan_tmplist[x][tmp_index]); if (!tmp_nick) tmp_nick = searchbynick(search_nickbuf(chan_tmplist[x][tmp_index])); if (tmp_nick) { // FIXME: check for user existing on channel? if ((x == list_bit) && (!chan.ismode(tmp_nick.id,list_bit))) { addmodes += MODECHAR[list_bit]; addmodeargs += " " + tmp_nick.nick; chan.add_modelist(tmp_nick.id,x); } else if (chan.ismode(tmp_nick.id,list_bit)) { delmodes += MODECHAR[list_bit]; delmodeargs += " " + tmp_nick.nick; chan.del_modelist(tmp_nick.id,list_bit); } } else { this.numeric401(chan_tmplist[x][tmp_index]); } } } }}