rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
return capitalize(testName) + "Test"; | return "The" + capitalize(testName) + "Test"; | function testMethodName(testName) { return capitalize(testName) + "Test";} |
debug('<span class="pass">PASS</span> ' + msg + '</span>'); | debug('<span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>'); | function testPassed(msg){ debug('<span class="pass">PASS</span> ' + msg + '</span>');} |
assertEquals('$sel->open("http: | assertEquals('$sel->open_ok("http: | function testPerlRCFormat() { var format = this.formats.findFormat("perl-rc"); var f = format.getFormatter(); assertEquals('$sel->is_text_present_ok("hello");', f.formatCommand(new Command('assertTextPresent', 'hello'))); assertEquals('ok(not $sel->is_text_present("hello"));', f.formatCommand(new Command('assertTextNotPresent', 'hello'))); assertEquals('$abc = $sel->is_text_present("test");', f.formatCommand(new Command('storeTextPresent', 'test', 'abc'))); assertEquals('sleep 1 until $sel->is_text_present("test");', f.formatCommand(new Command('waitForTextPresent', 'test'))); assertEquals('sleep 1 while $sel->is_text_present("test");', f.formatCommand(new Command('waitForTextNotPresent', 'test'))); assertEquals('$sel->text_is("abc[\\@id=\'\\$\'\]", "def");', f.formatCommand(new Command('assertText', 'abc[@id=\'$\']', 'def'))); assertEquals('$sel->location_is("abc");', f.formatCommand(new Command('assertLocation', 'abc'))); assertEquals('$sel->location_isnt("abc");', f.formatCommand(new Command('assertNotLocation', 'abc'))); assertEquals('$def = $sel->get_text("abc");', f.formatCommand(new Command('storeText', 'abc', 'def'))); assertEquals('sleep 1 until "def" eq $sel->get_text("abc");', f.formatCommand(new Command('waitForText', 'abc', 'def'))); assertEquals('sleep 1 while "def" eq $sel->get_text("abc");', f.formatCommand(new Command('waitForNotText', 'abc', 'def'))); assertEquals('$sel->open("http://www.google.com/");', f.formatCommand(new Command('open', 'http://www.google.com/')));} |
SeleniumIDE.testRecorderPopup = function(event) { | SeleniumIDE.Overlay.testRecorderPopup = function(event) { | SeleniumIDE.testRecorderPopup = function(event) { if (event.target.id != "contentAreaContextMenu") return; contextMenu = event.target; for (var i = contextMenu.childNodes.length - 1; i >= 0; i--) { var item = contextMenu.childNodes[i]; if (item.id && /^selenium-ide-check-/.test(item.id)) { contextMenu.removeChild(item); } } var recorder = SeleniumIDE.Loader.getTopEditor(); if (recorder) { var CheckBuilders = SeleniumIDE.Loader.getTopEditor().window.CheckBuilders; for (var i = 0; i < CheckBuilders.builders.length; i++) { var builder = CheckBuilders.builders[i]; var menuitem = document.createElement("menuitem"); var focusedWindow = contextMenu.ownerDocument.commandDispatcher.focusedWindow; var command = CheckBuilders.callBuilder(builder, focusedWindow/*window.gBrowser.contentWindow*/); menuitem.setAttribute("id", "selenium-ide-check-" + builder.name); menuitem.setAttribute("disabled", command.disabled ? 'true' : 'false'); menuitem.setAttribute("label", command.command + ' ' + command.target + ' ' + command.value); menuitem._Selenium_IDE_command = command; contextMenu.appendChild(menuitem); } }} |
assertEquals('assert /ab[cd]/ !~ @selenium.get_text("test")', nextCommand()); | function testRubyRCFormat() { var format = this.formats.findFormat("ruby-rc"); var f = format.getFormatter(); this.formatter = f; assertEquals('assert @selenium.is_text_present("hello")', nextCommand()); assertEquals('assert [email protected]_text_present("hello")', nextCommand()); assertEquals('abc = @selenium.is_text_present("test")', nextCommand()); assertEquals('assert !60.times{ break if (@selenium.is_text_present("test") rescue false); sleep 1 }', nextCommand()); assertEquals('assert !60.times{ break unless (@selenium.is_text_present("test") rescue true); sleep 1 }', nextCommand()); assertEquals('assert_equal "def", @selenium.get_text("abc")', nextCommand()); assertEquals('assert_equal "abc", @selenium.get_location', nextCommand()); assertEquals('assert_not_equal "abc", @selenium.get_location', nextCommand()); assertEquals('@selenium.type "theText", @selenium.get_eval("\'abc\'")', nextCommand()); assertEquals('assert_equal ["", "abc", "ab,c"], @selenium.get_select_options("theSelect")', nextCommand()); assertEquals('assert_not_equal "abc", @selenium.get_location', nextCommand()); assertEquals('def = @selenium.get_text("abc")', nextCommand()); assertEquals('assert !60.times{ break if ("def" == @selenium.get_text("abc") rescue false); sleep 1 }', nextCommand()); assertEquals('assert !60.times{ break unless (/foo.*/ =~ @selenium.get_value("abc") rescue true); sleep 1 }', nextCommand()); assertEquals('assert !60.times{ break unless ("def" == @selenium.get_text("abc") rescue true); sleep 1 }', nextCommand()); assertEquals('@selenium.open "http://www.google.com/"', nextCommand()); assertEquals('@selenium.wait_for_page_to_load "30000"', nextCommand()); assertEquals('sleep 1', nextCommand()); assertEquals("# line 1\n# line 2", f.formatComment(this.commands.shift()));} |
|
assertEquals('assert /^def(.|[\\r\\n])*$/ =~ @selenium.get_text("abc")', nextCommand()); | assertEquals('assert /^def[\\s\\S]*$/ =~ @selenium.get_text("abc")', nextCommand()); | function testRubyRCFormat() { var format = this.formats.findFormat("ruby-rc"); var f = format.getFormatter(); this.formatter = f; assertEquals('assert @selenium.is_text_present("hello")', nextCommand()); assertEquals('assert [email protected]_text_present("hello")', nextCommand()); assertEquals('abc = @selenium.is_text_present("test")', nextCommand()); assertEquals('assert /ab[cd]/ !~ @selenium.get_text("test")', nextCommand()); assertEquals('assert !60.times{ break if (@selenium.is_text_present("test") rescue false); sleep 1 }', nextCommand()); assertEquals('assert !60.times{ break unless (@selenium.is_text_present("test") rescue true); sleep 1 }', nextCommand()); assertEquals('assert_equal "def", @selenium.get_text("abc")', nextCommand()); assertEquals('assert /^def(.|[\\r\\n])*$/ =~ @selenium.get_text("abc")', nextCommand()); assertEquals('assert_equal "abc", @selenium.get_location', nextCommand()); assertEquals('assert_not_equal "abc", @selenium.get_location', nextCommand()); assertEquals('@selenium.type "theText", @selenium.get_eval("\'abc\'")', nextCommand()); assertEquals('assert_equal ["", "abc", "ab,c"], @selenium.get_select_options("theSelect")', nextCommand()); assertEquals('assert_not_equal "abc", @selenium.get_location', nextCommand()); assertEquals('def = @selenium.get_text("abc")', nextCommand()); assertEquals('assert !60.times{ break if ("def" == @selenium.get_text("abc") rescue false); sleep 1 }', nextCommand()); assertEquals('assert !60.times{ break unless (/foo.*/ =~ @selenium.get_value("abc") rescue true); sleep 1 }', nextCommand()); assertEquals('assert !60.times{ break unless ("def" == @selenium.get_text("abc") rescue true); sleep 1 }', nextCommand()); assertEquals('@selenium.open "http://www.google.com/"', nextCommand()); assertEquals('@selenium.wait_for_page_to_load "30000"', nextCommand()); assertEquals('sleep 1', nextCommand()); assertEquals("# line 1\n# line 2", f.formatComment(this.commands.shift()));} |
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); | this.isIE = (navigator.appName == "Microsoft Internet Explorer"); | function TinyMCE_Cleanup() { this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); this.rules = tinyMCE.clearArray(new Array()); // Default config this.settings = { indent_elements : 'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object', newline_before_elements : 'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td', newline_after_elements : 'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script', newline_before_after_elements : 'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div', indent_char : '\t', indent_levels : 1, entity_encoding : 'raw', valid_elements : '*[*]', entities : '', url_converter : '', invalid_elements : '', verify_html : false }; this.vElements = tinyMCE.clearArray(new Array()); this.vElementsRe = ''; this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/; this.codeElementsRe = /^(SCRIPT|STYLE)$/; this.serializationId = 0; this.mceAttribs = { href : 'mce_href', src : 'mce_src', type : 'mce_type' };} |
this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/; | this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|AREA)$/; | function TinyMCE_Cleanup() { this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); this.rules = tinyMCE.clearArray(new Array()); // Default config this.settings = { indent_elements : 'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object', newline_before_elements : 'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td', newline_after_elements : 'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script', newline_before_after_elements : 'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div', indent_char : '\t', indent_levels : 1, entity_encoding : 'raw', valid_elements : '*[*]', entities : '', url_converter : '', invalid_elements : '', verify_html : false }; this.vElements = tinyMCE.clearArray(new Array()); this.vElementsRe = ''; this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/; this.codeElementsRe = /^(SCRIPT|STYLE)$/; this.serializationId = 0; this.mceAttribs = { href : 'mce_href', src : 'mce_src', type : 'mce_type' };} |
var self = this; | function TinyMCE_ContextMenu(settings) { // Default value function function defParam(key, def_val) { settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val; } var self = this; this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); // Setup contextmenu div this.contextMenuDiv = document.createElement("div"); this.contextMenuDiv.className = "contextMenu"; this.contextMenuDiv.setAttribute("class", "contextMenu"); this.contextMenuDiv.style.display = "none"; this.contextMenuDiv.style.position = 'absolute'; this.contextMenuDiv.style.zindex = 1000; this.contextMenuDiv.style.left = '0'; this.contextMenuDiv.style.top = '0'; this.contextMenuDiv.unselectable = "on"; document.body.appendChild(this.contextMenuDiv); // Setup default values defParam("commandhandler", ""); defParam("spacer_image", "images/spacer.gif"); this.items = new Array(); this.settings = settings; this.html = ""; // IE Popup if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { this.pop = window.createPopup(); doc = this.pop.document; doc.open(); doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>'); doc.close(); }}; |
|
valid_child_elements : s.valid_child_elements, | function TinyMCE_Control(settings) { var t, i, to, fu, p, x, fn, fu, pn, s = settings; this.undoRedoLevel = true; this.isTinyMCE_Control = true; // Default settings this.settings = s; this.settings['theme'] = tinyMCE.getParam("theme", "default"); this.settings['width'] = tinyMCE.getParam("width", -1); this.settings['height'] = tinyMCE.getParam("height", -1); this.selection = new TinyMCE_Selection(this); this.undoRedo = new TinyMCE_UndoRedo(this); this.cleanup = new TinyMCE_Cleanup(); this.shortcuts = new Array(); this.hasMouseMoved = false; this.cleanup.init({ valid_elements : s.valid_elements, extended_valid_elements : s.extended_valid_elements, entities : s.entities, entity_encoding : s.entity_encoding, debug : s.cleanup_debug, url_converter : 'TinyMCE_Cleanup.prototype._urlConverter', indent : s.apply_source_formatting, invalid_elements : s.invalid_elements, verify_html : s.verify_html, fix_content_duplication : s.fix_content_duplication }); // Wrap old theme t = this.settings['theme']; if (!tinyMCE.hasTheme(t)) { fn = tinyMCE.callbacks; to = {}; for (i=0; i<fn.length; i++) { if ((fu = window['TinyMCE_' + t + "_" + fn[i]])) to[fn[i]] = fu; } tinyMCE.addTheme(t, to); } // Wrap old plugins this.plugins = new Array(); p = tinyMCE.getParam('plugins', '', true, ','); if (p.length > 0) { for (i=0; i<p.length; i++) { pn = p[i]; if (pn.charAt(0) == '-') pn = pn.substring(1); if (!tinyMCE.hasPlugin(pn)) { fn = tinyMCE.callbacks; to = {}; for (x=0; x<fn.length; x++) { if ((fu = window['TinyMCE_' + pn + "_" + fn[x]])) to[fn[x]] = fu; } tinyMCE.addPlugin(pn, to); } this.plugins[this.plugins.length] = pn; } }}; |
|
this.minorVersion = "0.6.1"; this.releaseDate = "2006-05-04"; | this.minorVersion = "0.8"; this.releaseDate = "2006-10-23"; | function TinyMCE_Engine() { this.majorVersion = "2"; this.minorVersion = "0.6.1"; this.releaseDate = "2006-05-04"; this.instances = new Array(); this.switchClassCache = new Array(); this.windowArgs = new Array(); this.loadedFiles = new Array(); this.pendingFiles = new Array(); this.loadingIndex = 0; this.configs = new Array(); this.currentConfig = 0; this.eventHandlers = new Array(); // Browser check var ua = navigator.userAgent; this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1); this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1); this.isGecko = ua.indexOf('Gecko') != -1; this.isSafari = ua.indexOf('Safari') != -1; this.isOpera = ua.indexOf('Opera') != -1; this.isMac = ua.indexOf('Mac') != -1; this.isNS7 = ua.indexOf('Netscape/7') != -1; this.isNS71 = ua.indexOf('Netscape/7.1') != -1; this.dialogCounter = 0; this.plugins = new Array(); this.themes = new Array(); this.menus = new Array(); this.loadedPlugins = new Array(); this.buttonMap = new Array(); this.isLoaded = false; // Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those if (this.isOpera) { this.isMSIE = true; this.isGecko = false; this.isSafari = false; } // TinyMCE editor id instance counter this.idCounter = 0;}; |
var ua = navigator.userAgent; | ua = navigator.userAgent; | function TinyMCE_Engine() { this.majorVersion = "2"; this.minorVersion = "0.6.1"; this.releaseDate = "2006-05-04"; this.instances = new Array(); this.switchClassCache = new Array(); this.windowArgs = new Array(); this.loadedFiles = new Array(); this.pendingFiles = new Array(); this.loadingIndex = 0; this.configs = new Array(); this.currentConfig = 0; this.eventHandlers = new Array(); // Browser check var ua = navigator.userAgent; this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1); this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1); this.isGecko = ua.indexOf('Gecko') != -1; this.isSafari = ua.indexOf('Safari') != -1; this.isOpera = ua.indexOf('Opera') != -1; this.isMac = ua.indexOf('Mac') != -1; this.isNS7 = ua.indexOf('Netscape/7') != -1; this.isNS71 = ua.indexOf('Netscape/7.1') != -1; this.dialogCounter = 0; this.plugins = new Array(); this.themes = new Array(); this.menus = new Array(); this.loadedPlugins = new Array(); this.buttonMap = new Array(); this.isLoaded = false; // Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those if (this.isOpera) { this.isMSIE = true; this.isGecko = false; this.isSafari = false; } // TinyMCE editor id instance counter this.idCounter = 0;}; |
this.isIE = this.isMSIE; this.isRealIE = this.isMSIE && !this.isOpera; | function TinyMCE_Engine() { this.majorVersion = "2"; this.minorVersion = "0.6.1"; this.releaseDate = "2006-05-04"; this.instances = new Array(); this.switchClassCache = new Array(); this.windowArgs = new Array(); this.loadedFiles = new Array(); this.pendingFiles = new Array(); this.loadingIndex = 0; this.configs = new Array(); this.currentConfig = 0; this.eventHandlers = new Array(); // Browser check var ua = navigator.userAgent; this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1); this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1); this.isGecko = ua.indexOf('Gecko') != -1; this.isSafari = ua.indexOf('Safari') != -1; this.isOpera = ua.indexOf('Opera') != -1; this.isMac = ua.indexOf('Mac') != -1; this.isNS7 = ua.indexOf('Netscape/7') != -1; this.isNS71 = ua.indexOf('Netscape/7.1') != -1; this.dialogCounter = 0; this.plugins = new Array(); this.themes = new Array(); this.menus = new Array(); this.loadedPlugins = new Array(); this.buttonMap = new Array(); this.isLoaded = false; // Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those if (this.isOpera) { this.isMSIE = true; this.isGecko = false; this.isSafari = false; } // TinyMCE editor id instance counter this.idCounter = 0;}; |
|
result.target = window.document.title; | result.target = SeleniumIDE.getRecorderWindow().exactMatchPattern(window.document.title); | title: function(window, element) { var result = { name: "Title" }; if (window.document) { result.target = window.document.title; } else { result.disabled = true; } return result; }, |
var t = this.currentDocument.title; if (typeof(t) == "string") { t = t.trim(); } return t; | var t = this.document().title; if (typeof(t) == "string") { t = t.trim(); } return t; | this.title = function() { var t = this.currentDocument.title; if (typeof(t) == "string") { t = t.trim(); } return t; }; |
toColorPart: function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits; }, | Number.prototype.toColorPart = function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits; } | toColorPart: function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits; }, |
Number.prototype.toColorPart = function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits; } | toColorPart: function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits; }, | Number.prototype.toColorPart = function() { var digits = this.toString(16); if (this < 16) return '0' + digits; return digits;} |
function ToCurrency (s) | function ToCurrency (s, validator) | function ToCurrency (s){ /* NYI */ return null;} |
function ToDate (s) | function ToDate (s, validator) | function ToDate (s){ /* NYI */ return null;} |
return null; | var m, day, month, year; var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. ?)(\\d{1,2})\\4(\\d{1,2})\\s*$"); m = s.match(yearFirstExp); if (m != null && (m[2].length == 4 || validator.dateorder == "ymd")) { day = m[6]; month = m[5]; year = (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10), validator.cutoffyear) } else { if (validator.dateorder == "ymd") return null; var yearLastExp = new RegExp("^\\s*(\\d{1,2})([-/]|\\. ?)(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$"); m = s.match(yearLastExp); if (m == null) return null; if (validator.dateorder == "mdy") { day = m[3]; month = m[1]; } else { day = m[1]; month = m[3]; } year = (m[5].length == 4) ? m[5] : GetFullYear(parseInt(m[6], 10), validator.cutoffyear) } month -= 1; var date = new Date(year, month, day); return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null; | function ToDate (s){ /* NYI */ return null;} |
function ToDouble (s) | function ToDouble (s, validator) | function ToDouble (s){ if ((v = parseFloat(s)) != s - 0) return null; else return v;} |
return this; | return parseFloat(this); | toFloat: function(){ return this; } |
Element[Element.visible(element) ? 'show' : 'hide'](element); | Element[Element.visible(element) ? 'hide' : 'show'](element); | toggle: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); Element[Element.visible(element) ? 'show' : 'hide'](element); } }, |
element.style.display = (element.style.display == 'none' ? '' : 'none'); | Element[Element.visible(element) ? 'show' : 'hide'](element); | toggle: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); element.style.display = (element.style.display == 'none' ? '' : 'none'); } }, |
queue: { position:'end', scope:(element.id || 'global') } | queue: { position:'end', scope:(element.id || 'global'), limit: 1 } | toggle: function(element, effect) { element = $(element); effect = (effect || 'appear').toLowerCase(); var options = Object.extend({ queue: { position:'end', scope:(element.id || 'global') } }, arguments[2] || {}); Effect[Element.visible(element) ? Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); } |
element.style.display = (element.style.display == 'none' ? '' : 'none'); | Element[Element.visible(element) ? 'hide' : 'show'](element); | toggle: function() { for (var i = 0; i < arguments.length; i++) { var element = $(arguments[i]); element.style.display = (element.style.display == 'none' ? '' : 'none'); } }, |
button.childNodes[0].data = "-"; | button.src = "minus.jpg"; | function toggle(button,id) { var n = document.getElementById(id).style; if (n.display == "none") { button.childNodes[0].data = "-"; n.display = "inline"; } else { button.childNodes[0].data = "+"; n.display = "none"; }} |
button.childNodes[0].data = "+"; | button.src = "plus.jpg"; | function toggle(button,id) { var n = document.getElementById(id).style; if (n.display == "none") { button.childNodes[0].data = "-"; n.display = "inline"; } else { button.childNodes[0].data = "+"; n.display = "none"; }} |
var editor = file.breakpointEditors[lineNum]; if (editor) { editor.childNodes[0].childNodes[1].childNodes[0].checked = !row.hasStyleClass("disabled"); setConditionFieldText(editor, lineNum); } | function toggleBreakpoint(row, file, lineNum){ if (row.hasStyleClass("disabled")) row.removeStyleClass("disabled"); else row.addStyleClass("disabled"); var temp = file.breakpoints[lineNum]; file.breakpoints[lineNum] = file.disabledBreakpoints[lineNum]; file.disabledBreakpoints[lineNum] = temp;} |
|
var hack = row.offsetTop; | function toggleBreakpoint(row, file, lineNum){ if (row.hasStyleClass("disabled")) row.removeStyleClass("disabled"); else row.addStyleClass("disabled"); var temp = file.breakpoints[lineNum]; file.breakpoints[lineNum] = file.disabledBreakpoints[lineNum]; file.disabledBreakpoints[lineNum] = temp; var editor = file.breakpointEditors[lineNum]; if (editor) { editor.childNodes[0].childNodes[1].childNodes[0].checked = !row.hasStyleClass("disabled"); setConditionFieldText(editor, lineNum); }} |
|
if (hasStyleClass(row, "disabled")) removeStyleClass(row, "disabled"); | if (row.hasStyleClass("disabled")) row.removeStyleClass("disabled"); | function toggleBreakpoint(row, file, lineNum){ if (hasStyleClass(row, "disabled")) removeStyleClass(row, "disabled"); else addStyleClass(row, "disabled"); var temp = file.breakpoints[lineNum]; file.breakpoints[lineNum] = file.disabledBreakpoints[lineNum]; file.disabledBreakpoints[lineNum] = temp;} |
addStyleClass(row, "disabled"); | row.addStyleClass("disabled"); | function toggleBreakpoint(row, file, lineNum){ if (hasStyleClass(row, "disabled")) removeStyleClass(row, "disabled"); else addStyleClass(row, "disabled"); var temp = file.breakpoints[lineNum]; file.breakpoints[lineNum] = file.disabledBreakpoints[lineNum]; file.disabledBreakpoints[lineNum] = temp;} |
if (pendingAction) { clearTimeout(pendingAction); pendingAction = null; } | function toggleBreakpointEditor(event){ var row = event.target.parentNode; var file = files[currentFile]; var lineNum = parseInt(event.target.title); if (row.hasStyleClass("breakpoint")) { var editor = file.breakpointEditors[lineNum]; if (!editor) { var sourcesDocument = document.getElementById("sources").contentDocument; editor = sourcesDocument.createElement("div"); editor.className = "editor"; editor.id = lineNum; editor.innerHTML = breakpointEditorHTML; // set the enabled checkbox to the correct state editor.getElementsByTagName("input")[0].checked = !row.hasStyleClass("disabled"); // set the condition field to reflect the breakpoint setConditionFieldText(editor, lineNum); row.childNodes[1].appendChild(editor); file.breakpointEditors[lineNum] = editor; } else { row.childNodes[1].removeChild(editor); file.breakpointEditors[lineNum] = null; } }} |
|
editor.query(' | editor.query('. | function toggleBreakpointEditorOnLine(lineNum){ if (pendingAction) { clearTimeout(pendingAction); pendingAction = null; } var file = files[currentFile]; bp = file.breakpoints[lineNum]; if (bp) { var editor = bp.editor; if (!editor) { var sourcesDocument = document.getElementById("sources").contentDocument; editor = sourcesDocument.createElement("div"); editor.className = "editor"; editor.id = lineNum; editor.innerHTML = breakpointEditorHTML; bp.row.childNodes[1].appendChild(editor); bp.editor = editor; file.breakpoints[lineNum] = bp; editor.query('//input[@class="enable"]').checked = bp.enabled; editor.query('//select[@class="editorDropdown"]').selectedIndex = bp.type; updateBreakpointTypeOnLine(lineNum); editor.query('//span[@class="hitCounter"]').innerText = bp.hitcount; setConditionFieldText(bp); } else { saveBreakpointOnLine(lineNum); bp.row.childNodes[1].removeChild(editor); bp.editor = null; } }} |
editor.query(' | editor.query('. | function toggleBreakpointOnLine(lineNum){ var breakpoint = files[currentFile].breakpoints[lineNum]; pendingAction = null; if (breakpoint.enabled) breakpoint.row.addStyleClass("disabled"); else breakpoint.row.removeStyleClass("disabled"); var hack = breakpoint.row.offsetTop; // force a relayout if needed. breakpoint.enabled = !breakpoint.enabled; var editor = breakpoint.editor; if (editor) { editor.query('//input[@class="enable"]').checked = breakpoint.enabled; setConditionFieldText(editor, lineNum); }} |
SeleniumIDE.toggleCheckType = function() { | SeleniumIDE.Overlay.toggleCheckType = function() { | SeleniumIDE.toggleCheckType = function() { var CheckBuilders = SeleniumIDE.Loader.getTopEditor().window.CheckBuilders; CheckBuilders.useAssert = !CheckBuilders.useAssert;} |
parent.update(); | headerUpdate(); | function toggleMute(xy){ document.location = "setVolume?mute="+xy; if (window.screen.width < 800) setTimeout("reload()", 1000); else parent.update();} |
document.getElementById("noSelection").style.display = null; | document.getElementById("noSelection").style.removeProperty("display"); | function toggleNoSelection(state){ noSelection = state; if (noSelection) { for (var i = 0; i < tabNames.length; i++) document.getElementById(tabNames[i] + "Pane").style.display = "none"; document.getElementById("noSelection").style.display = null; } else { document.getElementById("noSelection").style.display = "none"; switchPane(currentPane); }} |
li.nextSibling.style.display = null; | li.nextSibling.style.removeProperty("display"); | function toggleStyleShorthand(event){ var li = event.currentTarget.parentNode; if (li.className.indexOf("expanded") != -1) { li.className = li.className.replace(/ expanded/, ""); li.nextSibling.style.display = "none"; expandedStyleShorthands[li.shorthand] = false; } else { li.className += " expanded"; li.nextSibling.style.display = null; expandedStyleShorthands[li.shorthand] = true; } stylePropertiesScrollArea.refresh();} |
if (previous) previous.syncModel(true); | this.toggleView = function(view) { log.debug("toggle view"); if (this.view != null) { this.view.onHide(); } this.view = view; this.view.testCase = this.testCase; this.view.refresh(); }; |
|
function ToInteger (s) | function ToInteger (s, validator) | function ToInteger (s){ if ((v = parseInt(s, 10)) != s - 0) return null; else return v;} |
if (value && name) obj[encodeURIComponent(name)] = encodeURIComponent(value); | if (value && name) obj[name] = value; | toObject: function(){ var obj = {}; $each(this.getElementsByTagName('*'), function(el){ var name = $(el).name; var value = el.getValue(); if (value && name) obj[encodeURIComponent(name)] = encodeURIComponent(value); }); return obj; }, |
return this.toArray().join(' '); | return this.expression; | toString: function() { return this.toArray().join(' '); } |
function ToString (s) | function ToString (s, validator) | function ToString (s){ return s;} |
if (element.offsetParent) { while (element.offsetParent) { currentTop += element.offsetTop element = element.offsetParent; if (element == stop) break; } | while (element.offsetParent) { currentTop += element.offsetTop element = element.offsetParent; if (element == stop) break; | function totalOffsetTop(element, stop){ var currentTop = 0; if (element.offsetParent) { while (element.offsetParent) { currentTop += element.offsetTop element = element.offsetParent; if (element == stop) break; } } return currentTop;} |
var nodes = this.listNode.childNodes; | var nodes = $A(this.listNode.childNodes); | this.toXml = function() { var parentName = "query-history"; var queryName = "query"; var xml = "<" + parentName + ">\n"; // values() yields an unstable order, // so we use listNode.childNodes instead. var nodes = this.listNode.childNodes; var query = null; for (var i = 0; i < nodes.length; i++) { // XPath would be data($query/*[1]/text()[1]) query = nodes[i].firstChild.firstChild.nodeValue; if (null != query && "" != query) { // I'm tempted to wrap each query in a CDATA, // but the query might use CDATA sections too. xml += "<" + queryName + ">" + escapeXml(query) + "</" + queryName + ">\n"; } } xml += "</" + parentName + ">\n"; //debug.print("QueryHistory.toXml: " + xml); return xml; } |
query = nodes[i].firstChild.firstChild.nodeValue; | query = this.getListItemValue(nodes[i]); | this.toXml = function() { var parentName = "query-history"; var queryName = "query"; var xml = "<" + parentName + ">\n"; // values() yields an unstable order, // so we use listNode.childNodes instead. var nodes = this.listNode.childNodes; var query = null; for (var i = 0; i < nodes.length; i++) { // XPath would be data($query/*[1]/text()[1]) query = nodes[i].firstChild.firstChild.nodeValue; if (null != query && "" != query) { // I'm tempted to wrap each query in a CDATA, // but the query might use CDATA sections too. xml += "<" + queryName + ">" + escapeXml(query) + "</" + queryName + ">\n"; } } xml += "</" + parentName + ">\n"; //debug.print("QueryHistory.toXml: " + xml); return xml; } |
debug.print("QueryHistory.toXml: " + xml); | this.toXml = function() { var parentName = "query-history"; var queryName = "query"; var xml = "<" + parentName + ">\n"; // values() yields an unstable order, // so we use listNode.childNodes instead. var nodes = this.listNode.childNodes; var query = null; for (var i = 0; i < nodes.length; i++) { // XPath would be data($query/*[1]/text()[1]) query = nodes[i].firstChild.firstChild.nodeValue; if (null != query && "" != query) { // I'm tempted to wrap each query in a CDATA, // but the query might use CDATA sections too. xml += "<" + queryName + ">" + escapeXml(query) + "</" + queryName + ">\n"; } } xml += "</" + parentName + ">\n"; //debug.print("QueryHistory.toXml: " + xml); return xml; } |
|
debug.print("QueryHistory.toXml: " + xml); | this.toXml = function() { var parentName = "query-history"; var queryName = "query"; var xml = "<" + parentName + ">\n"; // values() yields an unstable order, // so we use listNode.childNodes instead. var nodes = $A(this.listNode.childNodes); var query = null; for (var i = 0; i < nodes.length; i++) { query = this.getListItemValue(nodes[i]); if (null != query && "" != query) { // I'm tempted to wrap each query in a CDATA, // but the query might use CDATA sections too. xml += "<" + queryName + ">" + escapeXml(query) + "</" + queryName + ">\n"; } } xml += "</" + parentName + ">\n"; debug.print("QueryHistory.toXml: " + xml); return xml; } |
|
else { glocale = 0 ; } | function translateInit() // load prefs, initalise options menu and fill other menus{ document.getElementById("contentAreaContextMenu").addEventListener("popupshowing",onTranslatePopup,false); // get the variables strong in translate.properties gTranslateBundle = document.getElementById("bundle-translate"); if (! gTranslateBundle) { alert("no bundle"); // alert if tranlate.properties is invalid } // read the preferences file and set the language if their is one const preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(""); if(preferencesService.prefHasUserValue("translate.userlanguage")) { glocale = preferencesService.getIntPref("translate.userlanguage"); } initOptionsMenu(); initMenus();} |
|
glocale = preferencesService.getIntPref("translate.userlanguage"); | if(preferencesService.prefHasUserValue("translate.userlanguage")) { glocale = preferencesService.getIntPref("translate.userlanguage"); } | function translateInit(){ document.getElementById("contentAreaContextMenu").addEventListener("popupshowing",onTranslatePopup,false); gTranslateBundle = document.getElementById("bundle-translate"); if (! gTranslateBundle) { alert("no bundle"); } const preferencesService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch(""); glocale = preferencesService.getIntPref("translate.userlanguage"); initOptionsMenu(); initMenus(); } |
return Math.round((this.trackLength / (this.range.end - this.range.start)) * (value - this.range.start)) + "px"; | return Math.round( ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * (value - this.range.start)) + "px"; | translateToPx: function(value) { return Math.round((this.trackLength / (this.range.end - this.range.start)) * (value - this.range.start)) + "px"; }, |
return ((offset/this.trackLength) * (this.range.end - this.range.start)) + this.range.start; | return ((offset/(this.trackLength-this.handleLength) * (this.range.end-this.range.start)) + this.range.start); | translateToValue: function(offset) { return ((offset/this.trackLength) * (this.range.end - this.range.start)) + this.range.start; }, |
HTMLElement[p] = null; window[p] = null; document[p] = null; el[p] = null; | HTMLElement[p] = window[p] = document[p] = el[p] = null; | trash: function(){ window.removeEvent('unload', Garbage.trash); Garbage.elements.each(function(el){ el.removeEvents(); for (var p in Element.prototype){ HTMLElement[p] = null; window[p] = null; document[p] = null; el[p] = null; } el.extend = null; }); } |
function TreeView(recorder, document, tree) { | function TreeView(editor, document, tree) { | function TreeView(recorder, document, tree) { this.log = new Log("TreeView"); this.recorder = recorder; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.recorder.testManager.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; /* this.onKeydown = function(event) { self.log.debug("onKeydown"); }; tree.addEventListener("keydown", this.onKeydown, true); */ function loadSeleniumCommands() { const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); var scope = new Object(); var actions = new Array(); var asserts = new Array(); var verifies = new Array(); subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-api.js', scope); if (recorder.options.userExtensionsURL) { try { subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); } catch (error) { this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); } } var waitActions = ['click', 'select', 'type', 'check', 'uncheck', 'fireEvent', 'goBack']; for (func in scope.Selenium.prototype) { //this.log.debug("func=" + func); if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); actions.push(action); if (waitActions.indexOf(action) >= 0) { actions.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { asserts.push(func); verifies.push("verify" + func.substr(6)); } else if (func.match(/^get.+/)) { asserts.push("assert" + func.substr(3)); verifies.push("verify" + func.substr(3)); } } actions.push("pause"); actions.sort(); asserts.sort(); verifies.sort(); var allCommands = actions.concat(asserts, verifies); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < allCommands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = allCommands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
this.recorder = recorder; | this.editor = editor; | function TreeView(recorder, document, tree) { this.log = new Log("TreeView"); this.recorder = recorder; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.recorder.testManager.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; /* this.onKeydown = function(event) { self.log.debug("onKeydown"); }; tree.addEventListener("keydown", this.onKeydown, true); */ function loadSeleniumCommands() { const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); var scope = new Object(); var actions = new Array(); var asserts = new Array(); var verifies = new Array(); subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-api.js', scope); if (recorder.options.userExtensionsURL) { try { subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); } catch (error) { this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); } } var waitActions = ['click', 'select', 'type', 'check', 'uncheck', 'fireEvent', 'goBack']; for (func in scope.Selenium.prototype) { //this.log.debug("func=" + func); if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); actions.push(action); if (waitActions.indexOf(action) >= 0) { actions.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { asserts.push(func); verifies.push("verify" + func.substr(6)); } else if (func.match(/^get.+/)) { asserts.push("assert" + func.substr(3)); verifies.push("verify" + func.substr(3)); } } actions.push("pause"); actions.sort(); asserts.sort(); verifies.sort(); var allCommands = actions.concat(asserts, verifies); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < allCommands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = allCommands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
var text = this.recorder.testManager.getSourceForCommands(commands); | var text = this.editor.testManager.getSourceForCommands(commands); | function TreeView(recorder, document, tree) { this.log = new Log("TreeView"); this.recorder = recorder; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.recorder.testManager.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; /* this.onKeydown = function(event) { self.log.debug("onKeydown"); }; tree.addEventListener("keydown", this.onKeydown, true); */ function loadSeleniumCommands() { const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); var scope = new Object(); var actions = new Array(); var asserts = new Array(); var verifies = new Array(); subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-api.js', scope); if (recorder.options.userExtensionsURL) { try { subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); } catch (error) { this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); } } var waitActions = ['click', 'select', 'type', 'check', 'uncheck', 'fireEvent', 'goBack']; for (func in scope.Selenium.prototype) { //this.log.debug("func=" + func); if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); actions.push(action); if (waitActions.indexOf(action) >= 0) { actions.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { asserts.push(func); verifies.push("verify" + func.substr(6)); } else if (func.match(/^get.+/)) { asserts.push("assert" + func.substr(3)); verifies.push("verify" + func.substr(3)); } } actions.push("pause"); actions.sort(); asserts.sort(); verifies.sort(); var allCommands = actions.concat(asserts, verifies); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < allCommands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = allCommands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
if (recorder.options.userExtensionsURL) { | if (editor.options.userExtensionsURL) { | function TreeView(recorder, document, tree) { this.log = new Log("TreeView"); this.recorder = recorder; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.recorder.testManager.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; /* this.onKeydown = function(event) { self.log.debug("onKeydown"); }; tree.addEventListener("keydown", this.onKeydown, true); */ function loadSeleniumCommands() { const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); var scope = new Object(); var actions = new Array(); var asserts = new Array(); var verifies = new Array(); subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-api.js', scope); if (recorder.options.userExtensionsURL) { try { subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); } catch (error) { this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); } } var waitActions = ['click', 'select', 'type', 'check', 'uncheck', 'fireEvent', 'goBack']; for (func in scope.Selenium.prototype) { //this.log.debug("func=" + func); if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); actions.push(action); if (waitActions.indexOf(action) >= 0) { actions.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { asserts.push(func); verifies.push("verify" + func.substr(6)); } else if (func.match(/^get.+/)) { asserts.push("assert" + func.substr(3)); verifies.push("verify" + func.substr(3)); } } actions.push("pause"); actions.sort(); asserts.sort(); verifies.sort(); var allCommands = actions.concat(asserts, verifies); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < allCommands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = allCommands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); | subScriptLoader.loadSubScript(editor.options.userExtensionsURL, scope); | function TreeView(recorder, document, tree) { this.log = new Log("TreeView"); this.recorder = recorder; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.recorder.testManager.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; /* this.onKeydown = function(event) { self.log.debug("onKeydown"); }; tree.addEventListener("keydown", this.onKeydown, true); */ function loadSeleniumCommands() { const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); var scope = new Object(); var actions = new Array(); var asserts = new Array(); var verifies = new Array(); subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-api.js', scope); if (recorder.options.userExtensionsURL) { try { subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); } catch (error) { this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); } } var waitActions = ['click', 'select', 'type', 'check', 'uncheck', 'fireEvent', 'goBack']; for (func in scope.Selenium.prototype) { //this.log.debug("func=" + func); if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); actions.push(action); if (waitActions.indexOf(action) >= 0) { actions.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { asserts.push(func); verifies.push("verify" + func.substr(6)); } else if (func.match(/^get.+/)) { asserts.push("assert" + func.substr(3)); verifies.push("verify" + func.substr(3)); } } actions.push("pause"); actions.sort(); asserts.sort(); verifies.sort(); var allCommands = actions.concat(asserts, verifies); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < allCommands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = allCommands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); | this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + editor.options.userExtensionsURL + "\nerror=" + error); | function TreeView(recorder, document, tree) { this.log = new Log("TreeView"); this.recorder = recorder; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.recorder.testManager.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; /* this.onKeydown = function(event) { self.log.debug("onKeydown"); }; tree.addEventListener("keydown", this.onKeydown, true); */ function loadSeleniumCommands() { const subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); var scope = new Object(); var actions = new Array(); var asserts = new Array(); var verifies = new Array(); subScriptLoader.loadSubScript('chrome://selenium-ide/content/selenium/selenium-api.js', scope); if (recorder.options.userExtensionsURL) { try { subScriptLoader.loadSubScript(recorder.options.userExtensionsURL, scope); } catch (error) { this.editor.showAlert("Failed to load user-extensions.js!\nfile=" + recorder.options.userExtensionsURL + "\nerror=" + error); } } var waitActions = ['click', 'select', 'type', 'check', 'uncheck', 'fireEvent', 'goBack']; for (func in scope.Selenium.prototype) { //this.log.debug("func=" + func); if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); actions.push(action); if (waitActions.indexOf(action) >= 0) { actions.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { asserts.push(func); verifies.push("verify" + func.substr(6)); } else if (func.match(/^get.+/)) { asserts.push("assert" + func.substr(3)); verifies.push("verify" + func.substr(3)); } } actions.push("pause"); actions.sort(); asserts.sort(); verifies.sort(); var allCommands = actions.concat(asserts, verifies); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < allCommands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = allCommands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
commands.push("assert" + r[2]); commands.push("verify" + r[2]); commands.push("store" + r[2]); commands.push("waitFor" + r[2]); | var base = r[2]; commands.push("assert" + base); commands.push("verify" + base); commands.push("store" + base); commands.push("waitFor" + base); var r2; if ((r = func.match(/^is(.*)Present$/))) { base = r[1]; commands.push("assert" + base + "NotPresent"); commands.push("verify" + base + "NotPresent"); } else { commands.push("assertNot" + base); commands.push("verifyNot" + base); } | function TreeView(editor, document, tree) { this.log = new Log("TreeView"); this.editor = editor; tree.view = this; this.tree = tree; this.document = document; this.rowCount = 0; this.recordIndex = 0; this.undoStack = []; this.redoStack = []; var self = this; var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": case "cmd_paste": case "cmd_selectAll": case "cmd_undo": case "cmd_redo": case "cmd_selenium_startpoint": case "cmd_selenium_breakpoint": case "cmd_selenium_exec_command": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": case "cmd_copy": case "cmd_cut": return self.selection.getRangeCount() > 0; case "cmd_paste": return self.clipboard != null; case "cmd_undo": return self.undoStack.length > 0; case "cmd_redo": return self.redoStack.length > 0; case "cmd_selenium_startpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_breakpoint": return self.selection.getRangeCount() > 0; case "cmd_selenium_exec_command": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; case "cmd_copy": self.copy(); break; case "cmd_cut": self.cut(); break; case "cmd_paste": self.paste(); break; case "cmd_undo": self.undo(); break; case "cmd_redo": self.redo(); break; case "cmd_selenium_breakpoint": self.setBreakpoint(); break; case "cmd_selenium_startpoint": self.setStartPoint(); break; case "cmd_selenium_exec_command": self.executeCurrentCommand(); break; } }, onEvent : function(evt) {} }; this.tree.controllers.appendController(controller); this.atomService = Components.classes["@mozilla.org/atom-service;1"]. getService(Components.interfaces.nsIAtomService); var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]. getService(Components.interfaces.nsIClipboard); function createTransferable() { return Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); } function createClipboardString() { return Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); } this.putCommandsToClipboard = function(commands) { var trans = createTransferable(); var str = createClipboardString(); trans.addDataFlavor("text/unicode"); var text = this.editor.clipboardFormat.getSourceForCommands(commands); str.data = text; trans.setTransferData("text/unicode", str, text.length * 2); clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard); this.clipboard = commands; window.updateCommands('clipboard'); }; this.getCommandsFromClipboard = function() { // not reading from a real clipboard... return this.clipboard; }; this.setTextBox = function(id,value,disabled) { this.document.getElementById(id).value = value; this.document.getElementById(id).disabled = disabled; }; this.getCommand = function(row) { if (row < this.testCase.commands.length) { return this.testCase.commands[row]; } else { return this.newCommand; } }; function loadSeleniumCommands() { var commands = []; var nonWaitActions = ['open', 'selectWindow', 'chooseCancelOnNextConfirmation', 'answerOnNextPrompt', 'close', 'setContext', 'setTimeout']; for (func in this.editor.seleniumAPI.Selenium.prototype) { //this.log.debug("func=" + func); var r; if (func.match(/^do[A-Z]/)) { var action = func.substr(2,1).toLowerCase() + func.substr(3); commands.push(action); if (!action.match(/^waitFor/) && nonWaitActions.indexOf(action) < 0) { commands.push(action + "AndWait"); } } else if (func.match(/^assert.+/)) { commands.push(func); commands.push("verify" + func.substr(6)); } else if ((r = func.match(/^(get|is)(.+)$/))) { commands.push("assert" + r[2]); commands.push("verify" + r[2]); commands.push("store" + r[2]); commands.push("waitFor" + r[2]); } } commands.push("pause"); commands.sort(); var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray); for (var i = 0; i < commands.length; i++) { var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); string.data = commands[i]; array.AppendElement(string); } var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch); autocomplete.setSeleniumCommands(array); } loadSeleniumCommands();} |
TreeView_SetNodeFlag (document.forms[0][idArray[0] + "_PopulatedStates"], idArray[1], true); | function TreeView_PopulateCallback (data, ids){ var idArray = ids.split (" "); var tree = getTree (idArray[0]); var spanId = idArray[0] + "_" + idArray[1]; var node = document.getElementById (spanId); node.populated = true; if (data != "*") { node.innerHTML = data; } else { if (tree.showImage && tree.noExpandImage != null) { var image = document.getElementById (spanId + "_img"); image.src = tree.noExpandImage; } } TreeView_ToggleExpand (idArray[0], idArray[1]);} |
|
if (listeners != null) { | if ((listeners != null) && (listeners.length > 0)) { | triggerEvent: function (type, evt) { // prep evt object with object & div references if (evt == null) { evt = new Object(); } evt.object = this.object; evt.element = this.element; // execute all callbacks registered for specified type var listeners = this.listeners[type]; if (listeners != null) { for (var i = 0; i < listeners.length; i++) { var callback = listeners[i]; var continueChain; if (callback.obj != null) { // use the 'call' method to bind the context to callback.obj continueChain = callback.func.call(callback.obj, evt); } else { continueChain = callback.func(evt); } if ((continueChain != null) && (continueChain == false)) { // if callback returns false, execute no more callbacks. break; } } // don't fall through to other DOM elements Event.stop(evt); } }, |
Event.stop(evt); | if (!this.fallThrough) { Event.stop(evt); } | triggerEvent: function (type, evt) { // prep evt object with object & div references if (evt == null) { evt = new Object(); } evt.object = this.object; evt.element = this.element; // execute all callbacks registered for specified type var listeners = this.listeners[type]; if ((listeners != null) && (listeners.length > 0)) { for (var i = 0; i < listeners.length; i++) { var callback = listeners[i]; var continueChain; if (callback.obj != null) { // use the 'call' method to bind the context to callback.obj continueChain = callback.func.call(callback.obj, evt); } else { continueChain = callback.func(evt); } if ((continueChain != null) && (continueChain == false)) { // if callback returns false, execute no more callbacks. break; } } // don't fall through to other DOM elements Event.stop(evt); } }, |
evt.shiftKey = shiftKeyDown; evt.metaKey = metaKeyDown; evt.altKey = altKeyDown; evt.ctrlKey = controlKeyDown; | try { evt.shiftKey = shiftKeyDown; evt.metaKey = metaKeyDown; evt.altKey = altKeyDown; evt.ctrlKey = controlKeyDown; } catch (e) { LOG.exception(e); } | function triggerEvent(element, eventType, canBubble, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown) { canBubble = (typeof(canBubble) == undefined) ? true : canBubble; if (element.fireEvent) { var evt = createEventObject(element, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown); element.fireEvent('on' + eventType, evt); } else { var evt = document.createEvent('HTMLEvents'); evt.shiftKey = shiftKeyDown; evt.metaKey = metaKeyDown; evt.altKey = altKeyDown; evt.ctrlKey = controlKeyDown; evt.initEvent(eventType, canBubble, true); element.dispatchEvent(evt); }} |
evt.which = keycode; | function triggerKeyEvent(element, eventType, keySequence, canBubble, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown) { var keycode = getKeyCodeFromKeySequence(keySequence); canBubble = (typeof(canBubble) == undefined) ? true : canBubble; if (element.fireEvent) { var keyEvent = createEventObject(element, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown); keyEvent.keyCode = keycode; element.fireEvent('on' + eventType, keyEvent); } else { var evt; if (window.KeyEvent) { evt = document.createEvent('KeyEvents'); evt.initKeyEvent(eventType, true, true, window, controlKeyDown, altKeyDown, shiftKeyDown, metaKeyDown, keycode, keycode); } else { evt = document.createEvent('UIEvents'); evt.shiftKey = shiftKeyDown; evt.metaKey = metaKeyDown; evt.altKey = altKeyDown; evt.ctrlKey = controlKeyDown; evt.initUIEvent(eventType, true, true, window, 1); evt.keyCode = keycode; } element.dispatchEvent(evt); }} |
|
function triggerKeyEvent(element, eventType, keycode, canBubble) { | function triggerKeyEvent(element, eventType, keySequence, canBubble) { var keycode = getKeyCodeFromKeySequence(keySequence); | function triggerKeyEvent(element, eventType, keycode, canBubble) { canBubble = (typeof(canBubble) == undefined) ? true : canBubble; if (element.fireEvent) { var w = parent.frames['myiframe'] if (w==null) { w = window; } keyEvent = w.document.createEventObject(); keyEvent.keyCode=keycode; element.fireEvent('on' + eventType, keyEvent); } else { var evt; if( window.KeyEvent ) { evt = document.createEvent('KeyEvents'); evt.initKeyEvent(eventType, true, true, window, false, false, false, false, keycode, keycode); } else { evt = document.createEvent('UIEvents'); evt.initUIEvent( eventType, true, true, window, 1 ); evt.keyCode = keycode; } element.dispatchEvent(evt); }} |
var ieEvent = document.createEventObject(); ieEvent.detail = 0; ieEvent.screenX = screenX; ieEvent.screenY = screenY; ieEvent.clientX = clientX; ieEvent.clientY = clientY; ieEvent.ctrlKey = false; ieEvent.altKey = false; ieEvent.shiftKey = false; ieEvent.metaKey = false; ieEvent.button = 0; ieEvent.relatedTarget = null; try { window.event = ieEvent; } catch(e) { selenium.browserbot.getCurrentWindow().selenium_event = ieEvent; } element.fireEvent('on' + eventType, ieEvent); | var ieEvent = document.createEventObject(); ieEvent.detail = 0; ieEvent.screenX = screenX; ieEvent.screenY = screenY; ieEvent.clientX = clientX; ieEvent.clientY = clientY; ieEvent.ctrlKey = false; ieEvent.altKey = false; ieEvent.shiftKey = false; ieEvent.metaKey = false; ieEvent.button = 1; ieEvent.relatedTarget = null; try { window.event = ieEvent; } catch(e) { selenium.browserbot.getCurrentWindow().selenium_event = ieEvent; } element.fireEvent('on' + eventType, ieEvent); | function triggerMouseEvent(element, eventType, canBubble, clientX, clientY) { clientX = clientX ? clientX : 0; clientY = clientY ? clientY : 0; // TODO: set these attributes -- they don't seem to be needed by the initial test cases, but that could change... var screenX = 0; var screenY = 0; canBubble = (typeof(canBubble) == undefined) ? true : canBubble; if (element.fireEvent) { if (!screenX && !screenY && !clientX && !clientY) { element.fireEvent('on' + eventType); } else { var ieEvent = document.createEventObject(); ieEvent.detail = 0; ieEvent.screenX = screenX; ieEvent.screenY = screenY; ieEvent.clientX = clientX; ieEvent.clientY = clientY; ieEvent.ctrlKey = false; ieEvent.altKey = false; ieEvent.shiftKey = false; ieEvent.metaKey = false; ieEvent.button = 0; ieEvent.relatedTarget = null; // when we go this route, window.event is never set to contain the event we have just created. // ideally we could just slide it in as follows in the try-block below, but this normally // doesn't work. This is why I try to avoid this code path, which is only required if we need to // set attributes on the event (e.g., clientX). try { window.event = ieEvent; } catch(e) { // getting an "Object does not support this action or property" error. Save the event away // for future reference. // TODO: is there a way to update window.event? // work around for http://jira.openqa.org/browse/SEL-280 -- make the event available somewhere: selenium.browserbot.getCurrentWindow().selenium_event = ieEvent; } element.fireEvent('on' + eventType, ieEvent); } } else { var evt = document.createEvent('MouseEvents'); if (evt.initMouseEvent) { evt.initMouseEvent(eventType, canBubble, true, document.defaultView, 1, screenX, screenY, clientX, clientY, false, false, false, false, 0, null) } else { // Safari // TODO we should be initialising other mouse-event related attributes here evt.initEvent(eventType, canBubble, true); } element.dispatchEvent(evt); }} |
else { | else { LOG.error("element doesen't has initMouseEvent"); | function triggerMouseEvent(element, eventType, canBubble, clientX, clientY) { clientX = clientX ? clientX : 0; clientY = clientY ? clientY : 0; // TODO: set these attributes -- they don't seem to be needed by the initial test cases, but that could change... var screenX = 0; var screenY = 0; canBubble = (typeof(canBubble) == undefined) ? true : canBubble; if (element.fireEvent) { if (!screenX && !screenY && !clientX && !clientY) { element.fireEvent('on' + eventType); } else { var ieEvent = element.ownerDocument.createEventObject(); ieEvent.detail = 0; ieEvent.screenX = screenX; ieEvent.screenY = screenY; ieEvent.clientX = clientX; ieEvent.clientY = clientY; ieEvent.ctrlKey = false; ieEvent.altKey = false; ieEvent.shiftKey = false; ieEvent.metaKey = false; ieEvent.button = 1; ieEvent.relatedTarget = null; // when we go this route, window.event is never set to contain the event we have just created. // ideally we could just slide it in as follows in the try-block below, but this normally // doesn't work. This is why I try to avoid this code path, which is only required if we need to // set attributes on the event (e.g., clientX). try { window.event = ieEvent; } catch(e) { // getting an "Object does not support this action or property" error. Save the event away // for future reference. // TODO: is there a way to update window.event? // work around for http://jira.openqa.org/browse/SEL-280 -- make the event available somewhere: selenium.browserbot.getCurrentWindow().selenium_event = ieEvent; } element.fireEvent('on' + eventType, ieEvent); } } else { var evt = document.createEvent('MouseEvents'); if (evt.initMouseEvent) { evt.initMouseEvent(eventType, canBubble, true, document.defaultView, 1, screenX, screenY, clientX, clientY, false, false, false, false, 0, null) } else { // Safari // TODO we should be initialising other mouse-event related attributes here evt.initEvent(eventType, canBubble, true); } element.dispatchEvent(evt); }} |
evt.initMouseEvent(eventType, canBubble, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | if (evt.initMouseEvent) { evt.initMouseEvent(eventType, canBubble, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null) } else { evt.initEvent(eventType, canBubble, true); } | function triggerMouseEvent(element, eventType, canBubble) { canBubble = (typeof(canBubble) == undefined) ? true : canBubble; if (element.fireEvent) { element.fireEvent('on' + eventType); } else { var evt = document.createEvent('MouseEvents'); evt.initMouseEvent(eventType, canBubble, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); element.dispatchEvent(evt); }} |
var undoIndex = -1; | var undoIndex = -1, doc; | triggerNodeChange : function(focus, setup_content) { if (tinyMCE.selectedInstance) { var inst = tinyMCE.selectedInstance; var editorId = inst.editorId; var elm = (typeof(setup_content) != "undefined" && setup_content) ? tinyMCE.selectedElement : inst.getFocusElement(); var undoIndex = -1; var undoLevels = -1; var anySelection = false; var selectedText = inst.selection.getSelectedText(); if (setup_content && tinyMCE.isGecko && inst.isHidden()) elm = inst.getBody(); inst.switchSettings(); if (tinyMCE.settings["auto_resize"]) { var doc = inst.getDoc(); inst.iframeElement.style.width = doc.body.offsetWidth + "px"; inst.iframeElement.style.height = doc.body.offsetHeight + "px"; } if (tinyMCE.selectedElement) anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0); if (tinyMCE.settings['custom_undo_redo']) { undoIndex = inst.undoRedo.undoIndex; undoLevels = inst.undoRedo.undoLevels.length; } tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content); } if (this.selectedInstance && (typeof(focus) == "undefined" || focus)) this.selectedInstance.contentWindow.focus(); }, |
if (tinyMCE.settings["auto_resize"]) { var doc = inst.getDoc(); inst.iframeElement.style.width = doc.body.offsetWidth + "px"; inst.iframeElement.style.height = doc.body.offsetHeight + "px"; } | triggerNodeChange : function(focus, setup_content) { if (tinyMCE.selectedInstance) { var inst = tinyMCE.selectedInstance; var editorId = inst.editorId; var elm = (typeof(setup_content) != "undefined" && setup_content) ? tinyMCE.selectedElement : inst.getFocusElement(); var undoIndex = -1; var undoLevels = -1; var anySelection = false; var selectedText = inst.selection.getSelectedText(); if (setup_content && tinyMCE.isGecko && inst.isHidden()) elm = inst.getBody(); inst.switchSettings(); if (tinyMCE.settings["auto_resize"]) { var doc = inst.getDoc(); inst.iframeElement.style.width = doc.body.offsetWidth + "px"; inst.iframeElement.style.height = doc.body.offsetHeight + "px"; } if (tinyMCE.selectedElement) anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0); if (tinyMCE.settings['custom_undo_redo']) { undoIndex = inst.undoRedo.undoIndex; undoLevels = inst.undoRedo.undoLevels.length; } tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content); } if (this.selectedInstance && (typeof(focus) == "undefined" || focus)) this.selectedInstance.contentWindow.focus(); }, |
|
var e, nl = new Array(), i, s; | var e, nl = [], i, s; | triggerSave : function(skip_cleanup, skip_callback) { var e, nl = new Array(), i, s; this.switchSettings(); s = tinyMCE.settings; // Force hidden tabs visible while serializing if (tinyMCE.isMSIE && !tinyMCE.isOpera) { e = this.iframeElement; do { if (e.style && e.style.display == 'none') { e.style.display = 'block'; nl[nl.length] = {elm : e, type : 'style'}; } if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) { e.className = s.display_tab_class; nl[nl.length] = {elm : e, type : 'class'}; } } while ((e = e.parentNode) != null) } tinyMCE.settings['preformatted'] = false; // Default to false if (typeof(skip_cleanup) == "undefined") skip_cleanup = false; // Default to false if (typeof(skip_callback) == "undefined") skip_callback = false; tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML); // Remove visual aids when cleanup is disabled if (this.settings['cleanup'] == false) { tinyMCE.handleVisualAid(this.getBody(), true, false, this); tinyMCE._setEventsEnabled(this.getBody(), true); } tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body); var htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true); htm = tinyMCE._customCleanup(this, "submit_content", htm); if (!skip_callback && tinyMCE.settings['save_callback'] != "") var content = eval(tinyMCE.settings['save_callback'] + "(this.formTargetElementId,htm,this.getBody());"); // Use callback content if available if ((typeof(content) != "undefined") && content != null) htm = content; // Replace some weird entities (Bug: #1056343) htm = tinyMCE.regexpReplace(htm, "(", "(", "gi"); htm = tinyMCE.regexpReplace(htm, ")", ")", "gi"); htm = tinyMCE.regexpReplace(htm, ";", ";", "gi"); htm = tinyMCE.regexpReplace(htm, """, """, "gi"); htm = tinyMCE.regexpReplace(htm, "^", "^", "gi"); if (this.formElement) this.formElement.value = htm; if (tinyMCE.isSafari && this.formElement) this.formElement.innerText = htm; // Hide them again (tabs in MSIE) for (i=0; i<nl.length; i++) { if (nl[i].type == 'style') nl[i].elm.style.display = 'none'; else nl[i].elm.className = s.hidden_tab_class; } } |
if (tinyMCE.isMSIE && !tinyMCE.isOpera) { | if (tinyMCE.isRealIE) { | triggerSave : function(skip_cleanup, skip_callback) { var e, nl = new Array(), i, s; this.switchSettings(); s = tinyMCE.settings; // Force hidden tabs visible while serializing if (tinyMCE.isMSIE && !tinyMCE.isOpera) { e = this.iframeElement; do { if (e.style && e.style.display == 'none') { e.style.display = 'block'; nl[nl.length] = {elm : e, type : 'style'}; } if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) { e.className = s.display_tab_class; nl[nl.length] = {elm : e, type : 'class'}; } } while ((e = e.parentNode) != null) } tinyMCE.settings['preformatted'] = false; // Default to false if (typeof(skip_cleanup) == "undefined") skip_cleanup = false; // Default to false if (typeof(skip_callback) == "undefined") skip_callback = false; tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML); // Remove visual aids when cleanup is disabled if (this.settings['cleanup'] == false) { tinyMCE.handleVisualAid(this.getBody(), true, false, this); tinyMCE._setEventsEnabled(this.getBody(), true); } tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body); var htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true); htm = tinyMCE._customCleanup(this, "submit_content", htm); if (!skip_callback && tinyMCE.settings['save_callback'] != "") var content = eval(tinyMCE.settings['save_callback'] + "(this.formTargetElementId,htm,this.getBody());"); // Use callback content if available if ((typeof(content) != "undefined") && content != null) htm = content; // Replace some weird entities (Bug: #1056343) htm = tinyMCE.regexpReplace(htm, "(", "(", "gi"); htm = tinyMCE.regexpReplace(htm, ")", ")", "gi"); htm = tinyMCE.regexpReplace(htm, ";", ";", "gi"); htm = tinyMCE.regexpReplace(htm, """, """, "gi"); htm = tinyMCE.regexpReplace(htm, "^", "^", "gi"); if (this.formElement) this.formElement.value = htm; if (tinyMCE.isSafari && this.formElement) this.formElement.innerText = htm; // Hide them again (tabs in MSIE) for (i=0; i<nl.length; i++) { if (nl[i].type == 'style') nl[i].elm.style.display = 'none'; else nl[i].elm.className = s.hidden_tab_class; } } |
function trim(s) { return s.replace(/^\s+|\s+$/g, ""); } | function trim(s) { return s == null ? null : s.replace(/^\s+|\s+$/g, ""); } | function trim(s) { return s.replace(/^\s+|\s+$/g, ""); } |
var grid = getTableGrid(table); var cpos = getCellPos(grid, td); | var grid = getTableGrid(table), cpos = getCellPos(grid, td); var cells, lastElm; | function trimRow(table, tr, td, new_tr) { var grid = getTableGrid(table); var cpos = getCellPos(grid, td); // Time to crop away some if (new_tr.cells.length != tr.childNodes.length) { var cells = tr.childNodes; var lastElm = null; for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) { var remove = true; var sd = getColRowSpan(td); // Remove due to rowspan if (inArray(cells, td)) { new_tr.childNodes[x]._delete = true; } else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan for (var i=x; i<x+td.colSpan; i++) new_tr.childNodes[i]._delete = true; } if ((lastElm == null || td != lastElm) && sd.rowspan > 1) td.rowSpan = sd.rowspan + 1; lastElm = td; } deleteMarked(tableElm); } } |
var cells = tr.childNodes; var lastElm = null; | cells = tr.childNodes; lastElm = null; | function trimRow(table, tr, td, new_tr) { var grid = getTableGrid(table); var cpos = getCellPos(grid, td); // Time to crop away some if (new_tr.cells.length != tr.childNodes.length) { var cells = tr.childNodes; var lastElm = null; for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) { var remove = true; var sd = getColRowSpan(td); // Remove due to rowspan if (inArray(cells, td)) { new_tr.childNodes[x]._delete = true; } else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan for (var i=x; i<x+td.colSpan; i++) new_tr.childNodes[i]._delete = true; } if ((lastElm == null || td != lastElm) && sd.rowspan > 1) td.rowSpan = sd.rowspan + 1; lastElm = td; } deleteMarked(tableElm); } } |
if(topline+ypos-edit_top<line.length-1) { | if(ypos<line.length-1) { | function try_next_line(){ /* Yes, it's possible */ if(topline+ypos-edit_top<line.length-1) { ypos++; if(ypos>edit_top+lines_on_screen-1) scroll(1); /* Scroll up one line */ if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; return(true); } console.beep(); return(false);} |
if(ypos>edit_top+lines_on_screen-1) | if(ypos>=topline+lines_on_screen) | function try_next_line(){ /* Yes, it's possible */ if(topline+ypos-edit_top<line.length-1) { ypos++; if(ypos>edit_top+lines_on_screen-1) scroll(1); /* Scroll up one line */ if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; return(true); } console.beep(); return(false);} |
if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; | if(last_xpos>=0) xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; | function try_next_line(){ /* Yes, it's possible */ if(topline+ypos-edit_top<line.length-1) { ypos++; if(ypos>edit_top+lines_on_screen-1) scroll(1); /* Scroll up one line */ if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; return(true); } console.beep(); return(false);} |
if(ypos-edit_top+topline>0) { | if(ypos>0) { | function try_prev_line(){ /* Yes, it's possible */ if(ypos-edit_top+topline>0) { ypos--; if(ypos<edit_top) { scroll(-1); /* Scroll down one line */ ypos++; } if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; return(true); } console.beep(); return(false);} |
if(ypos<edit_top) { | if(ypos<topline) | function try_prev_line(){ /* Yes, it's possible */ if(ypos-edit_top+topline>0) { ypos--; if(ypos<edit_top) { scroll(-1); /* Scroll down one line */ ypos++; } if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; return(true); } console.beep(); return(false);} |
ypos++; } if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; | if(last_xpos>=0) xpos=last_xpos; if(xpos>line[ypos].text.length) xpos=line[ypos].text.length; | function try_prev_line(){ /* Yes, it's possible */ if(ypos-edit_top+topline>0) { ypos--; if(ypos<edit_top) { scroll(-1); /* Scroll down one line */ ypos++; } if(xpos>line[ypos-edit_top+topline].text.length+1) xpos=line[ypos-edit_top+topline].text.length+1; return(true); } console.beep(); return(false);} |
window.setTimeout(execTypeCharacterCommand, commandCount * commandDelay); | window.setTimeout(execTypeCharacterCommand, commandCount * commandDelay, c); | function typeCharacterCommand(c) { if (commandDelay > 0) { window.setTimeout(execTypeCharacterCommand, commandCount * commandDelay); commandCount++; } else { execTypeCharacterCommand(c); }} |
CollapsedFieldsets.display(i); | CollapsedFieldsets.show(i); | uncollapse_all: function() { var fieldsets = document.getElementsByTagName('fieldset'); for (var i=0; i<fieldsets.length; i++) { if (fieldsets[i].className.match(CollapsedFieldsets.collapsed_re)) { CollapsedFieldsets.display(i); } } } |
delete element._overflow; | element._overflow = null; | undoClipping: function(element) { element = $(element); if (!element._overflow) return; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; delete element._overflow; return element; } |
if (!element._overflow) return; | if (!element._overflow) return element; | undoClipping: function(element) { element = $(element); if (!element._overflow) return; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; element._overflow = null; return element; } |
return div.childNodes[0].nodeValue; | return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; | unescapeHTML: function() { var div = document.createElement('div'); div.innerHTML = this.stripTags(); return div.childNodes[0].nodeValue; }, |
return div.childNodes[0].nodeValue; } | return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; }, | unescapeHTML: function() { var div = document.createElement('div'); div.innerHTML = this.stripTags(); return div.childNodes[0].nodeValue; } |
if (doc.__gmId) { | if (doc && doc.__gmId) { | this.unloadDoc = function(e) { var doc = e.originalTarget; if (doc.__gmId) { delete docMenuCommands[doc.__gmId]; } } |
this.options.selectedFormat = this.testManager.currentFormatInfo.id; optionsManager.save(this.options, 'selectedFormat'); | function unloadRecorder() { if (this.options.rememberBaseURL == 'true'){ this.options.baseURL = document.getElementById("baseURL").value; optionsManager.save(this.options, 'baseURL'); } this.options.selectedFormat = this.testManager.currentFormatInfo.id; optionsManager.save(this.options, 'selectedFormat'); this.eventManager.stopForAllBrowsers();} |
|
if (listeners[i].obj == obj && listeners[i].type == type) { | if (listeners[i].obj == obj && listeners[i].func == func) { | unregister: function (type, obj, func) { var listeners = this.listeners[type]; for (var i = 0; i < listeners.length; i++) { if (listeners[i].obj == obj && listeners[i].type == type) { listeners.splice(i, 1); break; } } }, |
this.sentps = false; | function Unregistered_Client(id,socket) { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.pinged = false; // Sent PING? this.sentps = false; // Sent PASS/SERVER? this.local = true; // FIXME: this is redundant. this.criteria_met = false; // Have we met registration criteria? // Variables containing user/server information as we receive it. this.id = id; this.nick = "*"; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.password = ""; this.ircclass = 0; this.idletime = time(); this.ip = socket.remote_ip_address; this.pending_resolve = false; this.pending_resolve_time = time(); // Variables (consts, really) that point to various state information this.socket = socket; ////////// FUNCTIONS // Functions we use to control clients (specific) this.work = Unregistered_Commands; this.quit = Unregistered_Quit; this.check_timeout = IRCClient_check_timeout; this.check_sendq = IRCClient_check_sendq; this.resolve_check = Unregistered_Resolve_Check; this.welcome = Unregistered_Welcome; // Output helper functions (shared) this.rawout = rawout; this.originatorout = originatorout; this.ircout = ircout; this.sendq = new IRC_Queue(); this.recvq = new IRC_Queue(); this.server_notice = IRCClient_server_notice; this.check_nickname = IRCClient_check_nickname; // Numerics (shared) this.numeric = IRCClient_numeric; this.numeric451 = IRCClient_numeric451; this.numeric461 = IRCClient_numeric461; this.numeric462 = IRCClient_numeric462; ////////// EXECUTION // We're a local socket that must be polled. Local_Sockets[id] = socket.descriptor; Local_Sockets_Map[id] = this; rebuild_socksel_array = true; log(format("%04u",socket.descriptor) + " Accepted new connection: " + this.ip + " port " + socket.remote_port); if ((this.ip.slice(0,4) == "127.") || (this.ip.slice(0,3) == "10.") || (this.ip.slice(0,8) == "192.168.") || (this.ip.slice(0,7) == "172.16." )) { this.hostname = servername; this.pending_resolve_time = false; } else { this.pending_resolve = load(true,"dnshelper.js",this.ip); } this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready.");} |
|
this.sendps = true; | function Unregistered_Client(id,socket) { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.pinged = false; // Sent PING? this.sentps = false; // Sent PASS/SERVER? this.local = true; // FIXME: this is redundant. this.criteria_met = false; // Have we met registration criteria? // Variables containing user/server information as we receive it. this.id = id; this.nick = "*"; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.password = ""; this.ircclass = 0; this.idletime = time(); this.ip = socket.remote_ip_address; this.pending_resolve = false; this.pending_resolve_time = time(); // Variables (consts, really) that point to various state information this.socket = socket; ////////// FUNCTIONS // Functions we use to control clients (specific) this.work = Unregistered_Commands; this.quit = Unregistered_Quit; this.check_timeout = IRCClient_check_timeout; this.check_sendq = IRCClient_check_sendq; this.resolve_check = Unregistered_Resolve_Check; this.welcome = Unregistered_Welcome; // Output helper functions (shared) this.rawout = rawout; this.originatorout = originatorout; this.ircout = ircout; this.sendq = new IRC_Queue(); this.recvq = new IRC_Queue(); this.server_notice = IRCClient_server_notice; this.check_nickname = IRCClient_check_nickname; // Numerics (shared) this.numeric = IRCClient_numeric; this.numeric451 = IRCClient_numeric451; this.numeric461 = IRCClient_numeric461; this.numeric462 = IRCClient_numeric462; ////////// EXECUTION // We're a local socket that must be polled. Local_Sockets[id] = socket.descriptor; Local_Sockets_Map[id] = this; rebuild_socksel_array = true; log(format("%04u",socket.descriptor) + " Accepted new connection: " + this.ip + " port " + socket.remote_port); if ((this.ip.slice(0,4) == "127.") || (this.ip.slice(0,3) == "10.") || (this.ip.slice(0,8) == "192.168.") || (this.ip.slice(0,7) == "172.16." )) { this.hostname = servername; this.pending_resolve_time = false; } else { this.pending_resolve = load(true,"dnshelper.js",this.ip); } this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready.");} |
|
this.outgoing = false; | function Unregistered_Client(id,socket) { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.pinged = false; // Sent PING? this.local = true; // FIXME: this is redundant. this.criteria_met = false; // Have we met registration criteria? // Variables containing user/server information as we receive it. this.id = id; this.nick = "*"; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.password = ""; this.ircclass = 0; this.idletime = time(); this.ip = socket.remote_ip_address; this.pending_resolve = false; this.pending_resolve_time = time(); this.sendps = true; // Send the PASS/SERVER pair by default. // Variables (consts, really) that point to various state information this.socket = socket; ////////// FUNCTIONS // Functions we use to control clients (specific) this.work = Unregistered_Commands; this.quit = Unregistered_Quit; this.check_timeout = IRCClient_check_timeout; this.check_sendq = IRCClient_check_sendq; this.resolve_check = Unregistered_Resolve_Check; this.welcome = Unregistered_Welcome; // Output helper functions (shared) this.rawout = rawout; this.originatorout = originatorout; this.ircout = ircout; this.sendq = new IRC_Queue(); this.recvq = new IRC_Queue(); this.server_notice = IRCClient_server_notice; this.check_nickname = IRCClient_check_nickname; // Numerics (shared) this.numeric = IRCClient_numeric; this.numeric451 = IRCClient_numeric451; this.numeric461 = IRCClient_numeric461; this.numeric462 = IRCClient_numeric462; ////////// EXECUTION // We're a local socket that must be polled. Local_Sockets[id] = socket.descriptor; Local_Sockets_Map[id] = this; rebuild_socksel_array = true; log(format("%04u",socket.descriptor) + " Accepted new connection: " + this.ip + " port " + socket.remote_port); if ((this.ip.slice(0,4) == "127.") || (this.ip.slice(0,3) == "10.") || (this.ip.slice(0,8) == "192.168.") || (this.ip.slice(0,7) == "172.16." )) { this.hostname = servername; this.pending_resolve_time = false; } else { this.pending_resolve = load(true,"dnshelper.js",this.ip); } this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready.");} |
|
this.pending_resolve_time = false; | function Unregistered_Client(id,socket) { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.pinged = false; // Sent PING? this.sentps = false; // Sent PASS/SERVER? this.local = true; // FIXME: this is redundant. this.criteria_met = false; // Have we met registration criteria? // Variables containing user/server information as we receive it. this.id = id; this.nick = "*"; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.password = ""; this.ircclass = 0; this.idletime = time(); this.ip = socket.remote_ip_address; this.pending_resolve = false; this.pending_resolve_time = time(); // Variables (consts, really) that point to various state information this.socket = socket; ////////// FUNCTIONS // Functions we use to control clients (specific) this.work = Unregistered_Commands; this.quit = Unregistered_Quit; this.check_timeout = IRCClient_check_timeout; this.resolve_check = Unregistered_Resolve_Check; this.welcome = Unregistered_Welcome; // Output helper functions (shared) this.rawout = rawout; this.originatorout = originatorout; this.ircout = ircout; this.server_notice = IRCClient_server_notice; this.check_nickname = IRCClient_check_nickname; // Numerics (shared) this.numeric = IRCClient_numeric; this.numeric451 = IRCClient_numeric451; this.numeric461 = IRCClient_numeric461; this.numeric462 = IRCClient_numeric462; ////////// EXECUTION // We're a local socket that must be polled. Local_Sockets[id] = socket.descriptor; Local_Sockets_Map[id] = this; rebuild_socksel_array = true; log(format("%04u",socket.descriptor) + " Accepted new connection: " + this.ip + " port " + socket.remote_port); if ((this.ip.slice(0,4) == "127.") || (this.ip.slice(0,3) == "10.") || (this.ip.slice(0,8) == "192.168.") || (this.ip.slice(0,7) == "172.16." )) { this.hostname = servername; } else { this.pending_resolve = load(true,"dnshelper.js",this.ip); } this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready.");} |
|
rebuild_socksel_array(); | rebuild_socksel_array = true; | function Unregistered_Client(id,socket) { ////////// VARIABLES // Bools/Flags that change depending on connection state. this.pinged = false; // Sent PING? this.sentps = false; // Sent PASS/SERVER? this.local = true; // FIXME: this is redundant. // Variables containing user/server information as we receive it. this.id = id; this.nick = "*"; this.realname = ""; this.uprefix = ""; this.hostname = ""; this.password = ""; this.ircclass = 0; this.idletime = time(); // Variables (consts, really) that point to various state information this.socket = socket; ////////// FUNCTIONS // Functions we use to control clients (specific) this.work = Unregistered_Commands; this.quit = Unregistered_Quit; this.check_timeout = IRCClient_check_timeout; // Output helper functions (shared) this.rawout = rawout; this.originatorout = originatorout; this.ircout = ircout; this.server_notice = IRCClient_server_notice; this.check_nickname = IRCClient_check_nickname; // Numerics (shared) this.numeric = IRCClient_numeric; this.numeric451 = IRCClient_numeric451; this.numeric461 = IRCClient_numeric461; this.numeric462 = IRCClient_numeric462; ////////// EXECUTION // We're a local socket that must be polled. Local_Sockets[id] = socket.descriptor; Local_Sockets_Map[id] = this; rebuild_socksel_array(); log(format("%04u",socket.descriptor) + " Accepted new connection: " + socket.remote_ip_address + " port " + socket.remote_port); if ((socket.remote_ip_address.slice(0,4) == "127.") || (socket.remote_ip_address.slice(0,3) == "10.") || (socket.remote_ip_address.slice(0,8) == "192.168.") || (socket.remote_ip_address.slice(0,7) == "172.16." )) { this.hostname = servername; } else { var went_into_hostname; var possible_hostname; if (debug && resolve_hostnames) went_into_hostname = time(); if (resolve_hostnames) possible_hostname = resolve_host(socket.remote_ip_address); if (resolve_hostnames && possible_hostname) { this.hostname = possible_hostname; if(server.client_update != undefined) server.client_update(socket,this.nick,this.hostname); } else { this.hostname = 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."); } } this.server_notice("*** " + VERSION + " (" + serverdesc + ") Ready.");} |
this.password = cmd[1]; | this.password = IRC_string(cmd[1]); | function Unregistered_Commands() { var cmdline; var cmd; var command; if (!this.socket.is_connected) { this.quit(); return 0; } cmdline=this.socket.recvline(4096,0); Global_CommandLine = cmdline; if (!cmdline) return 0; // Only accept up to 512 bytes from unregistered clients. cmdline = cmdline.slice(0,512); // Kludge for broken clients. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline = cmdline.slice(1); if (debug) log(LOG_DEBUG,"[UNREG]: " + cmdline); cmd = cmdline.split(" "); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // We allow non-matching :<origin> commands through FOR NOW, // since some *broken* IRC clients use this in the unreg stage. command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); } // we ignore all numerics from unregistered clients. if (command.match(/^[0-9]+/)) return 0; switch(command) { case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.rawout("PONG " + servername + " :" + IRC_string(cmdline)); break; case "CAPAB": break; // Silently ignore, for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = IRC_string(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1] || this.password) break; this.password = cmd[1]; break; case "PONG": this.pinged = false; break; case "SERVER": if ((this.nick != "*") || this.criteria_met) { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } if (Servers[cmd[1].toLowerCase()]) { this.quit("Server already exists."); return 0; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && IRC_match(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && IRC_match(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (IRC_match(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.outgoing && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("Server not configured."); return 0; } // Take care of registration right now. Servers[cmd[1].toLowerCase()] = new IRC_Server; var new_server = Servers[cmd[1].toLowerCase()]; Local_Servers[this.id] = new_server; Local_Sockets_Map[this.id] = new_server; rebuild_socksel_array = true; new_server.socket = this.socket; new_server.hops = cmd[2]; new_server.info = IRC_string(cmdline); new_server.parent = cmd[1]; new_server.linkparent = servername; new_server.id = this.id; new_server.flags = this_nline.flags; new_server.nick = cmd[1]; new_server.hostname = this.hostname; new_server.recvq = this.recvq; new_server.sendq = this.sendq; if (!qwk_slave) { // qwk slaves should never be hubs. for (hl in HLines) { if (HLines[hl].servername.toLowerCase() == cmd[1].toLowerCase()) { new_server.hub = true; break; } } // nor should they be ulined. for (u in ULines) { if (ULines[u] == cmd[1]) { new_server.uline = true; break; } } } new_server.finalize_server_connect("TS",this.sendps); break; case "USER": if (this.uprefix) break; if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = IRC_string(cmdline).slice(0,50); this.uprefix = parse_username(cmd[1]); break; case "QUIT": this.quit(); return 0; case "NOTICE": break; // drop silently default: this.numeric451(); break; } if (!this.criteria_met && this.uprefix && (this.nick != "*") ) { var usernum; if (this.password) { usernum = system.matchuser(this.uprefix); if (!usernum) usernum = system.matchuser(this.nick); if (usernum) { var bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if (!usernum) this.uprefix = "~" + this.uprefix; this.criteria_met = true; if (this.hostname && !this.pending_resolve_time) this.welcome(); }} |
if (this_nline.flags&NLINE_IS_DREAMFORGE) new_server.type = DREAMFORGE; | function Unregistered_Commands() { var cmdline; var cmd; var command; if (!this.socket.is_connected) { this.quit(); return 0; } cmdline=this.socket.recvline(4096,0); Global_CommandLine = cmdline; if (!cmdline) return 0; // Only accept up to 512 bytes from unregistered clients. cmdline = cmdline.slice(0,512); // Kludge for broken clients. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline = cmdline.slice(1); if (debug) log(LOG_DEBUG,"[UNREG]: " + cmdline); cmd = cmdline.split(" "); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // We allow non-matching :<origin> commands through FOR NOW, // since some *broken* IRC clients use this in the unreg stage. command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); } // we ignore all numerics from unregistered clients. if (command.match(/^[0-9]+/)) return 0; switch(command) { case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.rawout("PONG " + servername + " :" + IRC_string(cmdline)); break; case "CAPAB": break; // Silently ignore, for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = IRC_string(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1] || this.password) break; this.password = cmd[1]; break; case "PONG": this.pinged = false; break; case "SERVER": if ((this.nick != "*") || this.criteria_met) { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } if (Servers[cmd[1].toLowerCase()]) { this.quit("Server already exists."); return 0; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && IRC_match(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && IRC_match(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (IRC_match(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.outgoing && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("Server not configured."); return 0; } // Take care of registration right now. Servers[cmd[1].toLowerCase()] = new IRC_Server; var new_server = Servers[cmd[1].toLowerCase()]; Local_Servers[this.id] = new_server; Local_Sockets_Map[this.id] = new_server; rebuild_socksel_array = true; new_server.socket = this.socket; new_server.hops = cmd[2]; new_server.info = IRC_string(cmdline); new_server.parent = cmd[1]; new_server.linkparent = servername; new_server.id = this.id; new_server.flags = this_nline.flags; new_server.nick = cmd[1]; new_server.hostname = this.hostname; new_server.recvq = this.recvq; new_server.sendq = this.sendq; if (!qwk_slave) { // qwk slaves should never be hubs. for (hl in HLines) { if (HLines[hl].servername.toLowerCase() == cmd[1].toLowerCase()) { new_server.hub = true; break; } } // nor should they be ulined. for (u in ULines) { if (ULines[u] == cmd[1]) { new_server.uline = true; break; } } } new_server.finalize_server_connect("TS",this.sendps); break; case "USER": if (this.uprefix) break; if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = IRC_string(cmdline).slice(0,50); this.uprefix = parse_username(cmd[1]); break; case "QUIT": this.quit(); return 0; case "NOTICE": break; // drop silently default: this.numeric451(); break; } if (!this.criteria_met && this.uprefix && (this.nick != "*") ) { var usernum; if (this.password) { usernum = system.matchuser(this.uprefix); if (!usernum) usernum = system.matchuser(this.nick); if (usernum) { var bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if (!usernum) this.uprefix = "~" + this.uprefix; this.criteria_met = true; if (this.hostname && !this.pending_resolve_time) this.welcome(); }} |
|
Global_CommandLine = cmdline; | function Unregistered_Commands() { var cmdline; var cmd; var command; if (!this.socket.is_connected) { this.quit(); return 0; } cmdline=this.socket.recvline(4096,0); if (!cmdline) return 0; // Only accept up to 512 bytes from unregistered clients. cmdline = cmdline.slice(0,512); // Kludge for broken clients. if ((cmdline[0] == "\r") || (cmdline[0] == "\n")) cmdline = cmdline.slice(1); if (debug) log("[UNREG]: " + cmdline); cmd = cmdline.split(" "); if (cmdline[0] == ":") { // Silently ignore NULL originator commands. if (!cmd[1]) return 0; // We allow non-matching :<origin> commands through FOR NOW, // since some *broken* IRC clients use this in the unreg stage. command = cmd[1].toUpperCase(); cmdline = cmdline.slice(cmdline.indexOf(" ")+1); } else { command = cmd[0].toUpperCase(); } // we ignore all numerics from unregistered clients. if (command.match(/^[0-9]+/)) return 0; switch(command) { case "PING": if (!cmd[1]) { this.numeric(409,":No origin specified."); break; } this.rawout("PONG " + servername + " :" + IRC_string(cmdline)); break; case "CAPAB": break; // Silently ignore, for now. case "NICK": if (!cmd[1]) { this.numeric(431, ":No nickname given."); break; } var the_nick = IRC_string(cmd[1]).slice(0,max_nicklen); if (this.check_nickname(the_nick)) this.nick = the_nick; break; case "PASS": if (!cmd[1]) break; this.password = cmd[1]; break; case "PONG": this.pinged = false; break; case "SERVER": if (this.nick != "*") { this.numeric462(); break; } if (!cmd[3]) { this.numeric461("SERVER"); break; } if (Servers[cmd[1].toLowerCase()]) { this.quit("Server already exists."); return 0; } var this_nline = 0; var qwk_slave = false; var qwkid = cmd[1].slice(0,cmd[1].indexOf(".")).toUpperCase(); for (nl in NLines) { if ((NLines[nl].flags&NLINE_CHECK_QWKPASSWD) && IRC_match(cmd[1],NLines[nl].servername)) { if (check_qwk_passwd(qwkid,this.password)) { this_nline = NLines[nl]; break; } } else if ((NLines[nl].flags&NLINE_CHECK_WITH_QWKMASTER) && IRC_match(cmd[1],NLines[nl].servername)) { for (qwkm_nl in NLines) { if (NLines[qwkm_nl].flags&NLINE_IS_QWKMASTER) { var qwk_master = searchbyserver(NLines[qwkm_nl].servername); if (!qwk_master) { this.quit("No QWK master available for authorization."); return 0; } else { qwk_master.rawout(":" + servername + " PASS " + this.password + " :" + qwkid + " QWK"); qwk_slave = true; } } } } else if ((NLines[nl].password == this.password) && (IRC_match(cmd[1],NLines[nl].servername)) ) { this_nline = NLines[nl]; break; } } if ( (!this_nline || ( (this_nline.password == "*") && !this.sentps && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { this.quit("Server not configured."); return 0; } // Take care of registration right now. Servers[cmd[1].toLowerCase()] = new IRC_Server; var new_server = Servers[cmd[1].toLowerCase()]; Local_Servers[this.id] = new_server; Local_Sockets_Map[this.id] = new_server; rebuild_socksel_array = true; new_server.socket = this.socket; new_server.hops = cmd[2]; new_server.info = IRC_string(cmdline); new_server.parent = cmd[1]; new_server.linkparent = servername; new_server.id = this.id; new_server.flags = this_nline.flags; new_server.nick = cmd[1]; new_server.hostname = this.hostname; if (!qwk_slave) { // qwk slaves should never be hubs. for (hl in HLines) { if (HLines[hl].servername.toLowerCase() == cmd[1].toLowerCase()) { new_server.hub = true; break; } } // nor should they be ulined. for (u in ULines) { if (ULines[u] == cmd[1]) { new_server.uline = true; break; } } } new_server.finalize_server_connect("TS"); break; case "USER": if (!cmd[4]) { this.numeric461("USER"); break; } this.realname = IRC_string(cmdline).slice(0,50); var unreg_username = parse_username(cmd[1]); this.uprefix = "~" + unreg_username; break; case "QUIT": this.quit(); return 0; case "NOTICE": break; // drop silently default: this.numeric451(); break; } if (this.uprefix && isklined(this.uprefix + "@" + this.hostname)) { this.numeric(465, ":You've been K:Lined from this server."); this.quit("You've been K:Lined from this server."); return 0; } if (this.password && (unreg_username || (this.nick != "*"))) { var usernum; if (unreg_username) usernum = system.matchuser(unreg_username); if (!usernum && (this.nick != "*")) usernum = system.matchuser(this.nick); if (usernum) { var bbsuser = new User(usernum); if (this.password.toUpperCase() == bbsuser.security.password) this.uprefix = parse_username(bbsuser.handle).toLowerCase().slice(0,10); } } if ( (true_array_len(Local_Users) + true_array_len(Local_Servers)) > hcc_total) hcc_total = true_array_len(Local_Users) + true_array_len(Local_Servers); if (true_array_len(Local_Users) > hcc_users) hcc_users = true_array_len(Local_Users); if (this.realname && this.uprefix && (this.nick != "*")) { // Check for a valid I:Line. var my_iline; // FIXME: We don't compare connecting port. for(thisILine in ILines) { if ((IRC_match(this.uprefix + "@" + this.socket.remote_ip_address, ILines[thisILine].ipmask)) && (IRC_match(this.uprefix + "@" + this.hostname, ILines[thisILine].hostmask)) ) { my_iline = ILines[thisILine]; break; } } if (!my_iline) { this.numeric(463, ":Your host isn't among the privileged."); this.quit("You are not authorized to use this server."); return 0; } if (my_iline.password && (my_iline.password!=this.password)) { this.numeric(464, ":Password Incorrect."); this.quit("Denied."); return 0; } if (!this.check_nickname(this.nick)) return 0; // Amazing. We meet the registration criteria. Users[this.nick.toUpperCase()] = new IRC_User(this.id); new_user = Users[this.nick.toUpperCase()]; Local_Sockets_Map[this.id] = new_user; Local_Users[this.id] = new_user; rebuild_socksel_array = true; new_user.socket = this.socket; new_user.nick = this.nick; new_user.uprefix = this.uprefix; new_user.hostname = this.hostname; new_user.realname = this.realname; new_user.created = time(); if (this.socket.remote_ip_address) new_user.ip = this.socket.remote_ip_address; new_user.ircclass = my_iline.ircclass; hcc_counter++; this.numeric("001", ":Welcome to the Synchronet IRC Service, " + new_user.nuh); this.numeric("002", ":Your host is " + servername + ", running " + VERSION); this.numeric("003", ":This server was created " + strftime("%a %b %e %Y at %H:%M:%S %Z",server_uptime)); this.numeric("004", servername + " " + VERSION + " oiwbgscrkfydnhF biklmnopstv"); this.numeric("005", "MODES=" + max_modes + " MAXCHANNELS=" + max_user_chans + " CHANNELLEN=" + max_chanlen + " MAXBANS=" + max_bans + " NICKLEN=" + max_nicklen + " TOPICLEN=" + max_topiclen + " KICKLEN=" + max_kicklen + " CHANTYPES=#& PREFIX=(ov)@+ NETWORK=Synchronet CASEMAPPING=ascii CHANMODES=b,k,l,imnpst STATUSMSG=@+ :are available on this server."); new_user.lusers(); new_user.motd(); umode_notice(USERMODE_CLIENT,"Client","Client connecting: " + this.nick + " (" + this.uprefix + "@" + this.hostname + ") [" + this.socket.remote_ip_address + "] {1}"); if (server.client_update != undefined) server.client_update(this.socket, this.nick, this.hostname); server_bcast_to_servers("NICK " + this.nick + " 1 " + this.created + " + " + this.uprefix + " " + this.hostname + " " + servername + " 0 " + ip_to_int(new_user.ip) + " :" + this.realname); // we're no longer unregistered. delete Unregistered[this]; }} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.