rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
( (this_nline.password == "*") && !this.sentps && | ( (this_nline.password == "*") && | 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.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; 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"); 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(); }} |
new_server.finalize_server_connect("TS"); | new_server.finalize_server_connect("TS",this.sendps); | 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.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; 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"); 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(); }} |
) && !qwk_slave) { | ) && !qwk_slave && !this.outgoing) { | 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_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(); }} |
new_server.parent = cmd[1].toLowerCase(); | new_server.parent = 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); 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; } 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; } if (Servers[cmd[1].toUpperCase()]) { this.quit("Server already exists."); 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].toLowerCase(); 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]; }} |
if (Servers[cmd[1].toUpperCase()]) { | if (Servers[cmd[1].toLowerCase()]) { | 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].toUpperCase()]) { 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]; }} |
return 0; } if (Servers[cmd[1].toUpperCase()]) { this.quit("Server already exists."); | 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; } 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; } if (Servers[cmd[1].toUpperCase()]) { this.quit("Server already exists."); 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]; }} |
|
if (legal_command) { if (!Profile[command]) Profile[command] = new StatsM; Profile[command].executions++; Profile[command].ticks += system.clock_ticks - clockticks; } | 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,1)); 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],0).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 = IRC_string(cmd[1],0); 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) && wildmatch(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) && wildmatch(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) && (wildmatch(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,3); 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; } } } if (this_nline.flags&NLINE_IS_DREAMFORGE) new_server.type = DREAMFORGE; 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,4).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(); }} |
|
( (this_nline.password == "*") && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave && !this.outgoing) { | ( (this_nline.password == "*") && !this.outgoing && !(this_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave) { | 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_nline.flags&NLINE_CHECK_QWKPASSWD) ) ) && !qwk_slave && !this.outgoing) { 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.hostname && !this.pending_resolve) | if (this.hostname && !this.pending_resolve_time) | 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("[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.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 (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) this.welcome(); }} |
rebuild_socksel_array(); | rebuild_socksel_array = true; | 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; } 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; } if (Servers[cmd[1].toUpperCase()]) { this.quit("Server already exists."); 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(); new_server.socket = this.socket; new_server.hops = cmd[2]; new_server.info = IRC_string(cmdline); new_server.parent = cmd[1].toLowerCase(); 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(); 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]; }} |
if(server.clients != undefined) log(LOG_DEBUG,format("%d clients", server.clients)); | function Unregistered_Quit(msg) { if (msg) this.rawout("ERROR :" + msg); if (server.client_remove!=undefined) server.client_remove(this.socket); this.socket.close(); delete Local_Sockets[this.id]; delete Local_Sockets_Map[this.id]; delete Unregistered[this.id]; delete this; rebuild_socksel_array = true;} |
|
rebuild_socksel_array(); | rebuild_socksel_array = true; | function Unregistered_Quit(msg) { if (msg) this.rawout("ERROR :" + msg); this.socket.close(); delete Local_Sockets[this.id]; delete Local_Sockets_Map[this.id]; delete Unregistered[this.id]; delete this; rebuild_socksel_array();} |
if (my_resolved) { | if (my_resolved && my_resolved!=null) { | function Unregistered_Resolve_Check() { var my_resolved = this.pending_resolve.read(); if (my_resolved) { if (my_resolved.search(/[.]/)) this.hostname = my_resolved; else this.hostname = servername; this.pending_resolve_time = false; } else if ( (time() - this.pending_resolve_time) > 5) { this.hostname = this.ip; this.pending_resolve_time = false; } if (this.criteria_met && !this.pending_resolve_time) this.welcome(); return 0;} |
this.pending_resolve = false; return 1; | this.pending_resolve_time = false; } else if ( (time() - this.pending_resolve_time) > 5) { this.hostname = this.ip; this.pending_resolve_time = false; | function Unregistered_Resolve_Check() { var my_resolved = this.pending_resolve.read(); if (my_resolved) { if (my_resolved.search(/[.]/)) this.hostname = my_resolved; else this.hostname = servername; this.pending_resolve = false; return 1; } if ( (time() - this.pending_resolve_time) > 5) { this.hostname = this.ip; this.pending_resolve = false; return 1; } if (this.criteria_met) this.welcome(); return 0;} |
if ( (time() - this.pending_resolve_time) > 5) { this.hostname = this.ip; this.pending_resolve = false; return 1; } if (this.criteria_met) | if (this.criteria_met && !this.pending_resolve_time) | function Unregistered_Resolve_Check() { var my_resolved = this.pending_resolve.read(); if (my_resolved) { if (my_resolved.search(/[.]/)) this.hostname = my_resolved; else this.hostname = servername; this.pending_resolve = false; return 1; } if ( (time() - this.pending_resolve_time) > 5) { this.hostname = this.ip; this.pending_resolve = false; return 1; } if (this.criteria_met) this.welcome(); return 0;} |
if(!this.active) return; Event.stopObserving(document, "mouseup", this.eventMouseUp); Event.stopObserving(document, "mousemove", this.eventMouseMove); Event.stopObserving(document, "keypress", this.eventKeypress); | unregisterEvents: function() { if(!this.active) return; Event.stopObserving(document, "mouseup", this.eventMouseUp); Event.stopObserving(document, "mousemove", this.eventMouseMove); Event.stopObserving(document, "keypress", this.eventKeypress); }, |
|
if (contextMenu!==undefined) { | if (contextMenu) { | UnregisterWindowClick: function(component) { var document=component.ownerDocument; var contextMenu=f_popup._OldContextMenu; if (contextMenu!==undefined) { f_popup._OldContextMenu=undefined; document.body.oncontextmenu=contextMenu; } f_core.Debug("f_popup", "Unregister popup on "+component.id); f_popup.Callbacks=undefined; f_popup.Component=undefined; f_popup.Popup=undefined; // Dans le cas IE pas de Register Window click if (f_popup.Ie_enablePopup()) { return; } if (!f_popup._Installed) { return; } f_popup._Installed=undefined; document.removeEventListener("mousedown", f_popup._OnMouseDown, true); document.removeEventListener("click", f_popup._OnClick, true); document.removeEventListener("dblclick", f_popup._OnClick, true);// document.removeEventListener("blur", f_popup._OnBlur, true); document.removeEventListener("focus", f_popup._OnFocus, true); document.removeEventListener("keydown", f_popup._OnKeyDown, true); document.removeEventListener("keyup", f_popup._OnKeyUp, true); document.removeEventListener("keypress", f_popup._OnKeyPress, true); }, |
if (contextMenu==f_popup.NO_CONTEXT_POPUP) { contextMenu=null; } else if (!contextMenu) { contextMenu=null; } | UnregisterWindowClick: function(component) { var document=component.ownerDocument; var contextMenu=f_popup._OldContextMenu; if (contextMenu!==undefined) { f_popup._OldContextMenu=undefined; document.body.oncontextmenu=contextMenu; } f_core.Debug("f_popup", "Unregister popup on "+component.id); f_popup.Callbacks=undefined; f_popup.Component=undefined; f_popup.Popup=undefined; // Dans le cas IE pas de Register Window click if (f_popup.Ie_enablePopup()) { return; } if (!f_popup._Installed) { return; } f_popup._Installed=undefined; document.removeEventListener("mousedown", f_popup._OnMouseDown, true); document.removeEventListener("click", f_popup._OnClick, true); document.removeEventListener("dblclick", f_popup._OnClick, true);// document.removeEventListener("blur", f_popup._OnBlur, true); document.removeEventListener("focus", f_popup._OnFocus, true); document.removeEventListener("keydown", f_popup._OnKeyDown, true); document.removeEventListener("keyup", f_popup._OnKeyUp, true); document.removeEventListener("keypress", f_popup._OnKeyPress, true); }, |
|
Element.removeClassName(this.trElement, "selected"); | removeClassName(this.trElement, "selected"); | unselect: function() { Element.removeClassName(this.trElement, "selected"); }, |
for(;l>line.length;l++) | for(;l<line.length;l++) | function unwrap_line(l){ var done=false; var words; var space; var re; var lines=0; var ret=-1; var first=true; var old_lines=line.length; while(!done && line[l+1]!=undefined) { if(line[l]==undefined) { draw_line(l); l++; break; } /* There's a hardcr... all done now. */ if(line[l].hardcr) break; space=79-line[l].text.length; if(space<1) break; /* Attempt to unkludge... */ if(line[l].kludged) { re=new RegExp("^([^\\s]{1,"+space+"}\\s*)",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=words[1]; line[l].attr+=line[l+1].attr.substr(0,words[1].length); line[l+1].text=line[l+1].text.substr(words[1].length); line[l+1].attr=line[l+1].attr.substr(words[1].length); space-=words[1].length; if(first) ret=words[1].length; if(line[l+1].text.length==0) { line[l].kludged=false; line[l].hardcr=line[l+1].hardcr; line.splice(l+1,1); } if(words[1].search(/\s/)!=-1) line[l].kludged=false; lines++; } else line[l].kludged=false; } /* Get first word(s) of next line */ re=new RegExp("^(.{1,"+space+"}(?![^\\s])\\s*)",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=words[1]; line[l].attr+=line[l+1].attr.substr(0,words[1].length); line[l+1].text=line[l+1].text.substr(words[1].length); line[l+1].attr=line[l+1].attr.substr(words[1].length); if(first) { if(ret==-1) ret=words[1].length; else ret+=words[1].length; } if(line[l+1].text.length==0) { line[l].hardcr=line[l+1].hardcr; line.splice(l+1,1); } lines++; } else { /* Nothing on the next line... can't be kludged */ if(line[l].kludged) line[l].kludged=false; if(line[l+1].text.length==0) { line[l].hardcr=line[l+1].hardcr; line.splice(l+1,1); /* * We deleted a line... now we need to redraw that line * and everything after it. */ var i; for(i=l+1;i<topline+lines_on_screen;i++) draw_line(i); } done=true; } if(lines>0) draw_line(l); l++; first=false; } if(lines>0) { draw_line(l++); } if(old_lines!=line.length) { /* We need to redraw everything... line(s) deleted */ for(;l>line.length;l++) draw_line(l); } return(ret);} |
var ret=0; var nline; | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
|
while(!done && line[l+1]!=undefined) { | while(!done && line[l]!=undefined && line[l+1]!=undefined) { | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
words=''; line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; | space=79-line[l].text.length; | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); | re=new RegExp("^(.{1,"+space+"}(?![^\\s])\\s*)",""); | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); | line[l].text+=words[1]; line[l].attr+=line[l+1].attr.substr(0,words[1].length); line[l+1].text=line[l+1].text.substr(words[1].length); line[l+1].attr=line[l+1].attr.substr(words[1].length); if(first) { if(ret==-1) ret=words[1].length; else ret+=words[1].length; | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
else | else { if(line[l].kludged) line[l].kludged=false; if(line[l+1].text.length==0) { line[l].hardcr=line[l+1].hardcr; line.splice(l+1,1); } | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
redraw_line(l); | } if(lines>0) draw_line(l); | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
redraw_line(l); | if(lines>0) draw_line(l); | function unwrap_line(l){ var ret=0; var nline; var done=false; var words; var space; var re; while(!done && line[l+1]!=undefined) { /* There's a hardcr... all done now. */ if(line[l].hardcr) break; words=''; /* Trim whitespace from end */ line[l].text=line[l].text.replace(/\s+$/,''); space=79-line[l].text.length-1; if(space<1) break; /* Get first word(s) of next line */ re=new RegExp("^([^\\s]{1,"+space+"})(?![^\\s])",""); words=line[l+1].text.match(re); if(words != null) { line[l].text+=" "+words[1]; line[l].attr[line[l].attr.length]=curattr; line[l].attr.splice(line[l].text.length,0,line[l+1].attr.slice(0,words[1].length)); line[l+1].text=line[l+1].text.substr(words[0].length+1); line[l+1].attr.splice(0,words[0].length+1); /* Trim spaces from the start of the line now. */ words=line[l+1].text.match(/^\s+/); if(words!=null) { line[l+1].text=line[l+1].text.substr(words[0].length); line[l+1].attr.splice(0,words[0].length); } } else done=true; redraw_line(l); l++; } redraw_line(l); return(ret);} |
html = typeof html == 'undefined' ? '' : html.toString(); | Element.Methods.update = function(element, html) { element = $(element); var tagName = element.tagName.toUpperCase(); if (['THEAD','TBODY','TR','TD'].indexOf(tagName) > -1) { var div = document.createElement('div'); switch (tagName) { case 'THEAD': case 'TBODY': div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>'; depth = 2; break; case 'TR': div.innerHTML = '<table><tbody><tr>' + html.stripScripts() + '</tr></tbody></table>'; depth = 3; break; case 'TD': div.innerHTML = '<table><tbody><tr><td>' + html.stripScripts() + '</td></tr></tbody></table>'; depth = 4; } $A(element.childNodes).each(function(node){ element.removeChild(node) }); depth.times(function(){ div = div.firstChild }); $A(div.childNodes).each( function(node){ element.appendChild(node) }); } else { element.innerHTML = html.stripScripts(); } setTimeout(function() {html.evalScripts()}, 10); return element; } |
|
Draggables.notify('onStart'); | Draggables.notify('onStart', this); | update: function(event) { if(this.active) { if(!this.dragging) { var style = this.element.style; this.dragging = true; if(style.position=="") style.position = "relative"; style.zIndex = this.options.zindex; Draggables.notify('onStart'); if(this.options.starteffect) this.options.starteffect(this.element); } Droppables.show(event, this.element); this.draw(event); if(this.options.change) this.options.change(this); // fix AppleWebKit rendering if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); Event.stop(event); } } |
if(style.position=="") style.position = "relative"; style.zIndex = this.options.zindex; | if(Element.getStyle(this.element,'position')=='') style.position = "relative"; if(this.options.zindex) { this.options.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); style.zIndex = this.options.zindex; } | update: function(event) { if(this.active) { if(!this.dragging) { var style = this.element.style; this.dragging = true; if(style.position=="") style.position = "relative"; style.zIndex = this.options.zindex; if(this.options.ghosting) { this._clone = this.element.cloneNode(true); Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone, this.element); } Draggables.notify('onStart', this); if(this.options.starteffect) this.options.starteffect(this.element); } Droppables.show(event, this.element); this.draw(event); if(this.options.change) this.options.change(this); // fix AppleWebKit rendering if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); Event.stop(event); } } |
h += '<tr><td><a href="javascript:void(0);" onmousedown="' + tinyMCE.xmlEncode(m[i].js) + ';return false;"><span' + c +'>' + t + '</span></a>'; | h += '<tr><td><a href="#" onclick="return tinyMCE.cancelEvent(event);" onmousedown="return tinyMCE.cancelEvent(event);" onmouseup="' + tinyMCE.xmlEncode(m[i].js) + ';return tinyMCE.cancelEvent(event);"><span' + c +'>' + t + '</span></a>'; | update : function() { var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings; if (this.settings.drop_menu) h += '<span class="mceMenuLine"></span>'; h += '<table border="0" cellpadding="0" cellspacing="0">'; for (i=0; i<m.length; i++) { t = tinyMCE.xmlEncode(m[i].text); c = m[i].class_name ? ' class="' + m[i].class_name + '"' : ''; switch (m[i].type) { case 'separator': h += '<tr class="' + s.separator_class + '"><td>'; break; case 'title': h += '<tr class="' + s.title_class + '"><td><span' + c +'>' + t + '</span>'; break; case 'disabled': h += '<tr class="' + s.disabled_class + '"><td><span' + c +'>' + t + '</span>'; break; default: h += '<tr><td><a href="javascript:void(0);" onmousedown="' + tinyMCE.xmlEncode(m[i].js) + ';return false;"><span' + c +'>' + t + '</span></a>'; } h += '</td></tr>'; } h += '</table>'; e.innerHTML = h; this.needsUpdate = false; this.updateBlocker(); }, |
if(style.position=="") style.position = "relative"; style.zIndex = this.options.zindex; | if(Element.getStyle(this.element,'position')=='') style.position = "relative"; if(this.options.zindex) { this.options.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); style.zIndex = this.options.zindex; } if(this.options.ghosting) { this._clone = this.element.cloneNode(true); Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone, this.element); } | update: function(event) { if(this.active) { if(!this.dragging) { var style = this.element.style; this.dragging = true; if(style.position=="") style.position = "relative"; style.zIndex = this.options.zindex; Draggables.notify('onStart', this); if(this.options.starteffect) this.options.starteffect(this.element); } Droppables.show(event, this.element); this.draw(event); if(this.options.change) this.options.change(this); // fix AppleWebKit rendering if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); Event.stop(event); } } |
if(!this.dragging) { this.dragging = true; if(this.activeHandle.style.position=="") style.position = "relative"; } | if(!this.dragging) this.dragging = true; | update: function(event) { if(this.active) { if(!this.dragging) { this.dragging = true; if(this.activeHandle.style.position=="") style.position = "relative"; } this.draw(event); // fix AppleWebKit rendering if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); Event.stop(event); } }, |
depth.times(function(){ div = div.childNodes[0] }); | depth.times(function(){ div = div.firstChild }); | Element.Methods.update = function(element, html) { element = $(element); var tagName = element.tagName.toUpperCase(); if (['THEAD','TBODY','TR','TD'].indexOf(tagName) > -1) { var div = document.createElement('div'); switch (tagName) { case 'THEAD': case 'TBODY': div.innerHTML = '<table><tbody>' + html.stripScripts() + '</tbody></table>'; depth = 2; break; case 'TR': div.innerHTML = '<table><tbody><tr>' + html.stripScripts() + '</tr></tbody></table>'; depth = 3; break; case 'TD': div.innerHTML = '<table><tbody><tr><td>' + html.stripScripts() + '</td></tr></tbody></table>'; depth = 4; } $A(element.childNodes).each(function(node){ element.removeChild(node) }); depth.times(function(){ div = div.childNodes[0] }); $A(div.childNodes).each( function(node){ element.appendChild(node) }); } else { element.innerHTML = html.stripScripts(); } setTimeout(function() {html.evalScripts()}, 10); return element; } |
notshown = GXml.value(x.getElementsByTagName('notshown')[0]) | var notshown = GXml.value(x.getElementsByTagName('notshown')[0]) | function update_place_list() { var bounds = map.getBoundsLatLng(); var r = GXmlHttp.create(); url = "/cgi-bin/list.fcg?type=xml;topleft_lat=" + bounds.maxY + ";topleft_long="+ bounds.minX + ";bottomright_lat=" + bounds.minY + ";bottomright_long=" + bounds.maxX r.open("GET", url, true); r.onreadystatechange = function(){ if (r.readyState ==4) { x = r.responseXML newhtml = GXml.value(x.getElementsByTagName('newhtml')[0]) notshown = GXml.value(x.getElementsByTagName('notshown')[0]) markers = x.getElementsByTagName('result'); for (m=0; m<marker.length; m++) { map.removeOverlay(marker[m]) } marker = [] for (m=0; m<markers.length; m++) { lat = parseFloat(markers[m].getAttribute('lat')) lng = parseFloat(markers[m].getAttribute('lng')) zoom = parseInt(markers[m].getAttribute('zoom'), 10) var id = parseInt(markers[m].getAttribute('id'), 10) bubble = GXml.value(markers[m]) marker[m] = window.createPin(id, new GPoint(lng, lat), zoom, bubble) map.addOverlay(marker[m]) } document.getElementById('list').innerHTML = newhtml document.getElementById('notshown').innerHTML = ', ' + notshown + ' ' + (notshown==1?'entry':'entries') + ' not shown' } } r.send(null)}; |
url = "/cgi-bin/list.cgi?type=xml;topleft_lat=" + bounds.maxY + ";topleft_long="+ bounds.minX + ";bottomright_lat=" + bounds.minY + ";bottomright_long=" + bounds.maxX | url = "/cgi-bin/list.fcg?type=xml;topleft_lat=" + bounds.maxY + ";topleft_long="+ bounds.minX + ";bottomright_lat=" + bounds.minY + ";bottomright_long=" + bounds.maxX | function update_place_list() { var bounds = map.getBoundsLatLng(); var r = GXmlHttp.create(); url = "/cgi-bin/list.cgi?type=xml;topleft_lat=" + bounds.maxY + ";topleft_long="+ bounds.minX + ";bottomright_lat=" + bounds.minY + ";bottomright_long=" + bounds.maxX r.open("GET", url, true); r.onreadystatechange = function(){ if (r.readyState ==4) { x = r.responseXML newhtml = GXml.value(x.getElementsByTagName('newhtml')[0]) markers = x.getElementsByTagName('result'); for (m=0; m<marker.length; m++) { map.removeOverlay(marker[m]) } marker = [] for (m=0; m<markers.length; m++) { lat = parseFloat(markers[m].getAttribute('lat')) lng = parseFloat(markers[m].getAttribute('lng')) zoom = parseInt(markers[m].getAttribute('zoom'), 10) bubble = GXml.value(markers[m]) marker[m] = window.createPin(new GPoint(lng, lat), zoom, bubble) map.addOverlay(marker[m]) } document.getElementById('list').innerHTML = newhtml } } r.send(null)}; |
lat = markers[m].getAttribute('lat') lng = markers[m].getAttribute('lng') zoom = markers[m].getAttribute('zoom') marker[m] = window.createPin(new GPoint(lng, lat), zoom, "Foo") | lat = parseFloat(markers[m].getAttribute('lat')) lng = parseFloat(markers[m].getAttribute('lng')) zoom = parseInt(markers[m].getAttribute('zoom'), 10) bubble = GXml.value(markers[m]) marker[m] = window.createPin(new GPoint(lng, lat), zoom, bubble) | function update_place_list() { var bounds = map.getBoundsLatLng(); var r = GXmlHttp.create(); url = "/cgi-bin/list.cgi?type=xml;topleft_lat=" + bounds.maxY + ";topleft_long="+ bounds.minX + ";bottomright_lat=" + bounds.minY + ";bottomright_long=" + bounds.maxX r.open("GET", url, true); r.onreadystatechange = function(){ if (r.readyState ==4) { x = r.responseXML markers = x.getElementsByTagName('result'); for (m=0; m<marker.length; m++) { map.removeOverlay(marker[m]) } marker = [] for (m=0; m<markers.length; m++) { lat = markers[m].getAttribute('lat') lng = markers[m].getAttribute('lng') zoom = markers[m].getAttribute('zoom') marker[m] = window.createPin(new GPoint(lng, lat), zoom, "Foo") map.addOverlay(marker[m]) } } } r.send(null)}; |
cmd.value += " input " + value( 'vlm_broadcast_input' ); | cmd.value += " input " + sanitize_input( value( 'vlm_broadcast_input' ) ); | function update_vlm_add_broadcast(){ var cmd = document.getElementById( 'vlm_command' ); if( value( 'vlm_broadcast_name' ) ) { cmd.value = "new " + addunderscores( value( 'vlm_broadcast_name' ) ) + " broadcast"; if( checked( 'vlm_broadcast_enabled' ) ) { cmd.value += " enabled"; } if( checked( 'vlm_broadcast_loop' ) ) { cmd.value += " loop"; } if( value( 'vlm_broadcast_input' ) ) { cmd.value += " input " + value( 'vlm_broadcast_input' ); } if( value( 'vlm_broadcast_output' ) ) { cmd.value += " output " + value( 'vlm_broadcast_output' ); } } else { cmd.value = ""; }} |
cmd.value += " input " + value( 'vlm_vod_input' ); | cmd.value += " input " + sanitize_input( value( 'vlm_vod_input' ) ); | function update_vlm_add_vod(){ var cmd = document.getElementById( 'vlm_command' ); if( value( 'vlm_vod_name' ) ) { cmd.value = "new " + addunderscores( value( 'vlm_vod_name' ) ) + " vod"; if( checked( 'vlm_vod_enabled' ) ) { cmd.value += " enabled"; } if( value( 'vlm_vod_input' ) ) { cmd.value += " input " + value( 'vlm_vod_input' ); } if( value( 'vlm_vod_output' ) ) { cmd.value += " output " + value( 'vlm_vod_output' ); } } else { cmd.value = ""; }} |
var label = editor.query(' var dropdown = editor.query(' | var label = editor.query('. var dropdown = editor.query('. | function updateBreakpointTypeOnLine(line){ var breakpoint = files[currentFile].breakpoints[line]; var editor = breakpoint.editor; var label = editor.query('//label[@class="conditionLabel"]'); var dropdown = editor.query('//select[@class="editorDropdown"]'); breakpoint.type = dropdown.selectedIndex; switch(breakpoint.type) { case 0: label.innerText = "Condition:"; break; case 1: label.innerText = "Expression:"; break; }} |
updateCallback = function (progress, status, pb) { | var updateCallback = function (progress, status, pb) { | updateCallback = function (progress, status, pb) { if (progress == 100) { pb.stopMonitoring(); window.location = window.location.href.split('op=')[0] +'op=finished'; } } |
this.render(); | if(this.entryCount==1 && this.options.autoSelect) { this.selectEntry(); this.hide(); } else { this.render(); } | updateChoices: function(choices) { if(!this.changed && this.hasFocus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.firstChild); if(this.update.firstChild && this.update.firstChild.childNodes) { this.entryCount = this.update.firstChild.childNodes.length; for (var i = 0; i < this.entryCount; i++) { var entry = this.getEntry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entryCount = 0; } this.stopIndicator(); this.index = 0; this.render(); } }, |
if(!this.changed && this.has_focus) { | if(!this.changed && this.hasFocus) { | updateChoices: function(choices) { if(!this.changed && this.has_focus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.firstChild); if(this.update.firstChild && this.update.firstChild.childNodes) { this.entry_count = this.update.firstChild.childNodes.length; for (var i = 0; i < this.entry_count; i++) { entry = this.get_entry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entry_count = 0; } this.stopIndicator(); this.index = 0; this.render(); } }, |
this.entry_count = | this.entryCount = | updateChoices: function(choices) { if(!this.changed && this.has_focus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.firstChild); if(this.update.firstChild && this.update.firstChild.childNodes) { this.entry_count = this.update.firstChild.childNodes.length; for (var i = 0; i < this.entry_count; i++) { entry = this.get_entry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entry_count = 0; } this.stopIndicator(); this.index = 0; this.render(); } }, |
for (var i = 0; i < this.entry_count; i++) { entry = this.get_entry(i); | for (var i = 0; i < this.entryCount; i++) { var entry = this.getEntry(i); | updateChoices: function(choices) { if(!this.changed && this.has_focus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.firstChild); if(this.update.firstChild && this.update.firstChild.childNodes) { this.entry_count = this.update.firstChild.childNodes.length; for (var i = 0; i < this.entry_count; i++) { entry = this.get_entry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entry_count = 0; } this.stopIndicator(); this.index = 0; this.render(); } }, |
this.entry_count = 0; | this.entryCount = 0; | updateChoices: function(choices) { if(!this.changed && this.has_focus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.firstChild); if(this.update.firstChild && this.update.firstChild.childNodes) { this.entry_count = this.update.firstChild.childNodes.length; for (var i = 0; i < this.entry_count; i++) { entry = this.get_entry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entry_count = 0; } this.stopIndicator(); this.index = 0; this.render(); } }, |
this.container.innerHTML = this.request.transport.responseText; if (this.options.insertion) { | if (!this.options.insertion) { | updateContent: function() { this.container.innerHTML = this.request.transport.responseText; if (this.options.insertion) { this.container.innerHTML = this.request.transport.responseText; } else { new this.options.insertion(this.container, this.request.transport.responseText); } if (this.options.effect) { new this.options.effect(this.container); } if (this.onComplete) { setTimeout((function() {this.onComplete(this.request)}).bind(this), 10); } } |
this.container.innerHTML = this.request.transport.responseText; if (this.onComplete) this.onComplete(this.request); | if (!this.options.insertion) { this.container.innerHTML = this.request.transport.responseText; } else { new this.options.insertion(this.container, this.request.transport.responseText); } if (this.onComplete) { setTimeout((function() {this.onComplete(this.request)}).bind(this), 10); } | updateContent: function() { this.container.innerHTML = this.request.transport.responseText; if (this.onComplete) this.onComplete(this.request); } |
if (!tinyMCE.isMSIE) | if (!tinyMCE.isIE) | updateContent : function(form_element_name) { // Find MCE instance linked to given form element and copy it's value var formElement = document.getElementById(form_element_name); for (var n in tinyMCE.instances) { var inst = tinyMCE.instances[n]; if (!tinyMCE.isInstance(inst)) continue; inst.switchSettings(); if (inst.formElement == formElement) { var doc = inst.getDoc(); tinyMCE._setHTML(doc, inst.formElement.value); if (!tinyMCE.isMSIE) doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid); } } }, |
setTimeout(this.onComplete.bind(this), 10); | setTimeout((function() {this.onComplete( this.transport)}).bind(this), 10); | updateContent: function() { var receiver = this.responseIsSuccess() ? this.containers.success : this.containers.failure; var match = new RegExp(Ajax.Updater.ScriptFragment, 'img'); var response = this.transport.responseText.replace(match, ''); var scripts = this.transport.responseText.match(match); if (receiver) { if (this.options.insertion) { new this.options.insertion(receiver, response); } else { receiver.innerHTML = response; } } if (this.responseIsSuccess()) { if (this.onComplete) setTimeout(this.onComplete.bind(this), 10); } if (this.options.evalScripts && scripts) { match = new RegExp(Ajax.Updater.ScriptFragment, 'im'); setTimeout((function() { for (var i = 0; i < scripts.length; i++) eval(scripts[i].match(match)[1]); }).bind(this), 10); } } |
setTimeout((function() {this.onComplete( this.transport)}).bind(this), 10); | setTimeout(this.onComplete.bind(this), 10); | updateContent: function() { var receiver = this.responseIsSuccess() ? this.containers.success : this.containers.failure; var match = new RegExp(Ajax.Updater.ScriptFragment, 'img'); var response = this.transport.responseText.replace(match, ''); var scripts = this.transport.responseText.match(match); if (receiver) { if (this.options.insertion) { new this.options.insertion(receiver, response); } else { receiver.innerHTML = response; } } if (this.responseIsSuccess()) { if (this.onComplete) setTimeout((function() {this.onComplete( this.transport)}).bind(this), 10); } if (this.options.evalScripts && scripts) { match = new RegExp(Ajax.Updater.ScriptFragment, 'im'); setTimeout((function() { for (var i = 0; i < scripts.length; i++) eval(scripts[i].match(match)[1]); }).bind(this), 10); } } |
p[0] += (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0); p[1] += (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0); | updateDrag: function(event, pointer) { if(!this.dragging) this.startDrag(event); Position.prepare(); Droppables.show(pointer, this.element); Draggables.notify('onDrag', this, event); this.draw(pointer); if(this.options.change) this.options.change(this); if(this.options.scroll) { this.stopScrolling(); var p; if (this.options.scroll == window) { with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } } else { p = Position.page(this.options.scroll); p[0] += this.options.scroll.scrollLeft; p[1] += this.options.scroll.scrollTop; p.push(p[0]+this.options.scroll.offsetWidth); p.push(p[1]+this.options.scroll.offsetHeight); } var speed = [0,0]; if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); this.startScrolling(speed); } // fix AppleWebKit rendering if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); Event.stop(event); }, |
|
updateElement: function(value) { var last_token_pos = this.findLastToken(); if (last_token_pos != -1) { var new_value = this.element.value.substr(0, last_token_pos + 1); var whitespace = this.element.value.substr(last_token_pos + 1).match(/^\s+/); | updateElement: function(selectedElement) { if (this.options.updateElement) { this.options.updateElement(selectedElement); return; } var value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); var lastTokenPos = this.findLastToken(); if (lastTokenPos != -1) { var newValue = this.element.value.substr(0, lastTokenPos + 1); var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); | updateElement: function(value) { var last_token_pos = this.findLastToken(); if (last_token_pos != -1) { var new_value = this.element.value.substr(0, last_token_pos + 1); var whitespace = this.element.value.substr(last_token_pos + 1).match(/^\s+/); if (whitespace) new_value += whitespace[0]; this.element.value = new_value + value; } else { this.element.value = value; } }, |
new_value += whitespace[0]; this.element.value = new_value + value; | newValue += whitespace[0]; this.element.value = newValue + value; | updateElement: function(value) { var last_token_pos = this.findLastToken(); if (last_token_pos != -1) { var new_value = this.element.value.substr(0, last_token_pos + 1); var whitespace = this.element.value.substr(last_token_pos + 1).match(/^\s+/); if (whitespace) new_value += whitespace[0]; this.element.value = new_value + value; } else { this.element.value = value; } }, |
} | } this.element.focus(); if (this.options.afterUpdateElement) this.options.afterUpdateElement(this.element, selectedElement); | updateElement: function(value) { var last_token_pos = this.findLastToken(); if (last_token_pos != -1) { var new_value = this.element.value.substr(0, last_token_pos + 1); var whitespace = this.element.value.substr(last_token_pos + 1).match(/^\s+/); if (whitespace) new_value += whitespace[0]; this.element.value = new_value + value; } else { this.element.value = value; } }, |
} | } this.element.focus(); | updateElement: function(selectedElement) { if (this.options.updateElement) return(this.options.updateElement(selectedElement)); var value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); var lastTokenPos = this.findLastToken(); if (lastTokenPos != -1) { var newValue = this.element.value.substr(0, lastTokenPos + 1); var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); if (whitespace) newValue += whitespace[0]; this.element.value = newValue + value; } else { this.element.value = value; } }, |
var value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal').unescapeHTML(); | var value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); | updateElement: function(selectedElement) { if (this.options.updateElement) return(this.options.updateElement(selectedElement)); var value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal').unescapeHTML(); var lastTokenPos = this.findLastToken(); if (lastTokenPos != -1) { var newValue = this.element.value.substr(0, lastTokenPos + 1); var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); if (whitespace) newValue += whitespace[0]; this.element.value = newValue + value; } else { this.element.value = value; } }, |
span.textContent = attr.value; | span.textContent = "\"" + attr.value + "\""; | function updateElementAttributes(){ var focusedNode = Inspector.focusedDOMNode(); var attributesList = document.getElementById("elementAttributesList") attributesList.innerHTML = ""; if (!focusedNode.attributes.length) attributesList.innerHTML = "<span class=\"disabled\">(none)</span>"; for (i = 0; i < focusedNode.attributes.length; i++) { var attr = focusedNode.attributes[i]; var li = document.createElement("li"); var span = document.createElement("span"); span.className = "property"; if (attr.namespaceURI) span.title = attr.namespaceURI; span.textContent = attr.name; li.appendChild(span); span = document.createElement("span"); span.className = "value"; span.textContent = attr.value; span.title = attr.value; li.appendChild(span); if (attr.style) { span = document.createElement("span"); span.className = "mapped"; span.innerHTML = "(<a href=\"javascript:selectMappedStyleRule('" + attr.name + "')\">mapped style</a>)"; li.appendChild(span); } attributesList.appendChild(li); } elementAttributesScrollArea.refresh();} |
span.title = span.textContent; | span.title = attr.value; | function updateElementAttributes(){ var focusedNode = Inspector.focusedDOMNode(); var attributesList = document.getElementById("elementAttributesList") attributesList.innerHTML = ""; if (!focusedNode.attributes.length) attributesList.innerHTML = "<span class=\"disabled\">(none)</span>"; for (i = 0; i < focusedNode.attributes.length; i++) { var attr = focusedNode.attributes[i]; var li = document.createElement("li"); var span = document.createElement("span"); span.className = "property"; if (attr.namespaceURI) span.title = attr.namespaceURI; span.textContent = attr.name; li.appendChild(span); span = document.createElement("span"); span.className = "value"; span.textContent = attr.value; span.title = span.textContent; li.appendChild(span); if (attr.style) { span = document.createElement("span"); span.className = "mapped"; span.innerHTML = "(<a href=\"javascript:selectMappedStyleRule('" + attr.name + "')\">mapped style</a>)"; li.appendChild(span); } attributesList.appendChild(li); } elementAttributesScrollArea.refresh();} |
var re = /\\/gi; | var ch = 0; | function updateFilename(elem){ var str = elem.value; var re = /\\/gi; str.replace(re, '/'); var ch = str.lastIndexOf('/'); var e = document.getElementById('filename'); if(e) e.value = str.substring(ch + 1); var d = document.getElementById('filename-div'); if(d) d.innerHTML = str.substring(ch + 1);} |
str.replace(re, '/'); var ch = str.lastIndexOf('/'); | ch = str.lastIndexOf('/'); if(ch == -1) ch = str.lastIndexOf('\\'); | function updateFilename(elem){ var str = elem.value; var re = /\\/gi; str.replace(re, '/'); var ch = str.lastIndexOf('/'); var e = document.getElementById('filename'); if(e) e.value = str.substring(ch + 1); var d = document.getElementById('filename-div'); if(d) d.innerHTML = str.substring(ch + 1);} |
file.lines = null; | function updateFileSource(source, url, force){ var fileIndex = filesLookup[url]; if (!fileIndex || !source.length) return; var file = files[fileIndex]; if (force || file.source.length != source.length || file.source != source) { file.source = source; file.loaded = false; file.lines = null; if (file.element) { file.element.parentNode.removeChild(file.element); file.element = null; } if (currentFile == fileIndex) loadFile(fileIndex, false); }} |
|
if (e.hasAttribute("checked")) { this.options["formats." + formatInfo.id + "." + name] = e.checked ? 'true' : 'false'; | if (e.checked != undefined) { this.options["formats." + this.formatInfo.id + "." + name] = e.checked.toString(); | function updateFormatOptions() { if (this.format && this.format.options) { for (name in this.format.options) { var e = document.getElementById("options_" + name); if (e) { if (e.hasAttribute("checked")) { this.options["formats." + formatInfo.id + "." + name] = e.checked ? 'true' : 'false'; } else { this.options["formats." + formatInfo.id + "." + name] = e.value; } } } }} |
this.options["formats." + formatInfo.id + "." + name] = e.value; | this.options["formats." + this.formatInfo.id + "." + name] = e.value; | function updateFormatOptions() { if (this.format && this.format.options) { for (name in this.format.options) { var e = document.getElementById("options_" + name); if (e) { if (e.hasAttribute("checked")) { this.options["formats." + formatInfo.id + "." + name] = e.checked ? 'true' : 'false'; } else { this.options["formats." + formatInfo.id + "." + name] = e.value; } } } }} |
var value = this.options["formats." + formatInfo.id + "." + name] || format.options[name]; if (e.hasAttribute("checked")) { | var value = this.options["formats." + formatInfo.id + "." + name]; if (value == null) { value = format.options[name]; } if (e.checked != undefined) { | function updateFormatSelection() { this.updateFormatOptions(); var formatListBox = document.getElementById("format-list"); var formatId = formatListBox.selectedItem.value; var formatInfo = this.testManager.findFormatInfo(formatId); document.getElementById("format-name").value = formatInfo.name; document.getElementById("delete-button").disabled = formatInfo.save ? false : true; document.getElementById("rename-button").disabled = formatInfo.save ? false : true; var configBox = document.getElementById("format-config"); try { var format = formatInfo.getFormat(); } catch (error) { alert("an error occured: " + error); var format = {}; } var newConfigBox; if (format.createConfigForm) { newConfigBox = format.createConfigForm(document); } else { newConfigBox = document.createElement("box"); newConfigBox.setAttribute("id", "format-config"); var note = document.createElement("description"); newConfigBox.appendChild(note); note.appendChild(document.createTextNode("There are no options.")); } configBox.parentNode.replaceChild(newConfigBox, configBox); configBox = newConfigBox; if (format.options) { for (name in format.options) { var e = document.getElementById("options_" + name); if (e) { var value = this.options["formats." + formatInfo.id + "." + name] || format.options[name]; if (e.hasAttribute("checked")) { e.checked = 'true' == value; } else { e.value = value; } } } } var self = this; this.format = format; this.formatInfo = formatInfo; configBox.addEventListener("blur", function(event) { self.updateFormatOptions(); /* var e = event.target; var r; if (formatInfo && (r = /^options_(.*)$/.exec(e.id)) != null) { self.options["formats." + formatInfo.id + "." + r[1]] = e.value; }*/ }, true);} |
var formatListBox = document.getElementById("format-list"); var formatId = formatListBox.selectedItem.value; var formatInfo = this.testManager.findFormatInfo(formatId); document.getElementById("format-name").value = formatInfo.name; document.getElementById("delete-button").disabled = formatInfo.save ? false : true; document.getElementById("rename-button").disabled = formatInfo.save ? false : true; var configBox = document.getElementById("format-config"); try { var format = formatInfo.getFormat(); } catch (error) { alert("an error occured: " + error); var format = {}; } var newConfigBox; if (format.createConfigForm) { newConfigBox = format.createConfigForm(document); } else { newConfigBox = document.createElement("box"); newConfigBox.setAttribute("id", "format-config"); var note = document.createElement("description"); newConfigBox.appendChild(note); note.appendChild(document.createTextNode("There are no options.")); } configBox.parentNode.replaceChild(newConfigBox, configBox); configBox = newConfigBox; if (format.options) { for (name in format.options) { var e = document.getElementById("options_" + name); if (e) { var value = this.options["formats." + formatInfo.id + "." + name]; if (value == null) { value = format.options[name]; } if (e.checked != undefined) { e.checked = 'true' == value; } else { e.value = value; } } } } var self = this; this.format = format; this.formatInfo = formatInfo; configBox.addEventListener("blur", function(event) { self.updateFormatOptions(); }, true); | this.showFormatDialog(); | function updateFormatSelection() { this.updateFormatOptions(); var formatListBox = document.getElementById("format-list"); var formatId = formatListBox.selectedItem.value; var formatInfo = this.testManager.findFormatInfo(formatId); document.getElementById("format-name").value = formatInfo.name; document.getElementById("delete-button").disabled = formatInfo.save ? false : true; document.getElementById("rename-button").disabled = formatInfo.save ? false : true; var configBox = document.getElementById("format-config"); try { var format = formatInfo.getFormat(); } catch (error) { alert("an error occured: " + error); var format = {}; } var newConfigBox; if (format.createConfigForm) { newConfigBox = format.createConfigForm(document); } else { newConfigBox = document.createElement("box"); newConfigBox.setAttribute("id", "format-config"); var note = document.createElement("description"); newConfigBox.appendChild(note); note.appendChild(document.createTextNode("There are no options.")); } configBox.parentNode.replaceChild(newConfigBox, configBox); configBox = newConfigBox; if (format.options) { for (name in format.options) { var e = document.getElementById("options_" + name); if (e) { var value = this.options["formats." + formatInfo.id + "." + name]; if (value == null) { value = format.options[name]; } if (e.checked != undefined) { e.checked = 'true' == value; } else { e.value = value; } } } } var self = this; this.format = format; this.formatInfo = formatInfo; configBox.addEventListener("blur", function(event) { self.updateFormatOptions(); /* var e = event.target; var r; if (formatInfo && (r = /^options_(.*)$/.exec(e.id)) != null) { self.options["formats." + formatInfo.id + "." + r[1]] = e.value; }*/ }, true);} |
addStyleClass(tr, "current"); | tr.addStyleClass("current"); | function updateFunctionStack(){ var stackframeTable = document.getElementById("stackframeTable"); stackframeTable.innerHTML = ""; // clear the content currentStack = new Array(); var stack = DebuggerDocument.currentFunctionStack(); for(var i = 0; i < stack.length; i++) { var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = stack[i]; tr.appendChild(td); tr.addEventListener("click", selectStackFrame, true); stackframeTable.appendChild(tr); var frame = new ScriptCallFrame(stack[i], i, tr); tr.callFrame = frame; currentStack.push(frame); if (i == 0) { addStyleClass(tr, "current"); frame.loadVariables(); currentCallFrame = frame; } }} |
currentStack = DebuggerDocument.currentFunctionStack(); for(var i = 0; i < currentStack.length; i++) { | currentStack = new Array(); var stack = DebuggerDocument.currentFunctionStack(); for(var i = 0; i < stack.length; i++) { | function updateFunctionStack(){ var stackframeTable = document.getElementById("stackframeTable"); stackframeTable.innerHTML = ""; // clear the content currentStack = DebuggerDocument.currentFunctionStack(); for(var i = 0; i < currentStack.length; i++) { var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = currentStack[i]; tr.appendChild(td); stackframeTable.appendChild(tr); } var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = "Global"; tr.appendChild(td); stackframeTable.appendChild(tr);} |
td.innerText = currentStack[i]; | td.innerText = stack[i]; | function updateFunctionStack(){ var stackframeTable = document.getElementById("stackframeTable"); stackframeTable.innerHTML = ""; // clear the content currentStack = DebuggerDocument.currentFunctionStack(); for(var i = 0; i < currentStack.length; i++) { var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = currentStack[i]; tr.appendChild(td); stackframeTable.appendChild(tr); } var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = "Global"; tr.appendChild(td); stackframeTable.appendChild(tr);} |
var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = "Global"; tr.appendChild(td); stackframeTable.appendChild(tr); | function updateFunctionStack(){ var stackframeTable = document.getElementById("stackframeTable"); stackframeTable.innerHTML = ""; // clear the content currentStack = DebuggerDocument.currentFunctionStack(); for(var i = 0; i < currentStack.length; i++) { var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = currentStack[i]; tr.appendChild(td); stackframeTable.appendChild(tr); } var tr = document.createElement("tr"); var td = document.createElement("td"); td.className = "stackNumber"; td.innerText = i; tr.appendChild(td); td = document.createElement("td"); td.innerText = "Global"; tr.appendChild(td); stackframeTable.appendChild(tr);} |
|
}, | } | updateLink: function() { center = this.map.getCenter(); zoom = this.map.getZoom(); lat = Math.round(center.lat*100000)/100000; lon = Math.round(center.lon*100000)/100000; this.element.href = this.base+"?lat="+lat+"&lon="+lon+"&zoom="+zoom; }, |
document.getElementById("noMetrics").style.display = null; | document.getElementById("noMetrics").style.removeProperty("display"); | function updateMetricsPane(){ var style; var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.ELEMENT_NODE) style = focusedNode.ownerDocument.defaultView.getComputedStyle(focusedNode); if (!style || style.length == 0) { document.getElementById("noMetrics").style.display = null; document.getElementById("marginBoxTable").style.display = "none"; return; } document.getElementById("noMetrics").style.display = "none"; document.getElementById("marginBoxTable").style.display = null; setBoxMetrics(style, "margin", ""); setBoxMetrics(style, "border", "-width"); setBoxMetrics(style, "padding", ""); var size = style.getPropertyValue("width").replace(/px$/, "") + " \u00D7 " + style.getPropertyValue("height").replace(/px$/, ""); document.getElementById("content").textContent = size; if (noMarginDisplayType[style.display] == "no") document.getElementById("marginBoxTable").setAttribute("hide", "yes"); else document.getElementById("marginBoxTable").removeAttribute("hide"); if (noPaddingDisplayType[style.display] == "no") document.getElementById("paddingBoxTable").setAttribute("hide", "yes"); else document.getElementById("paddingBoxTable").removeAttribute("hide");} |
document.getElementById("marginBoxTable").style.display = null; | document.getElementById("marginBoxTable").style.removeProperty("display"); | function updateMetricsPane(){ var style; var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.ELEMENT_NODE) style = focusedNode.ownerDocument.defaultView.getComputedStyle(focusedNode); if (!style || style.length == 0) { document.getElementById("noMetrics").style.display = null; document.getElementById("marginBoxTable").style.display = "none"; return; } document.getElementById("noMetrics").style.display = "none"; document.getElementById("marginBoxTable").style.display = null; setBoxMetrics(style, "margin", ""); setBoxMetrics(style, "border", "-width"); setBoxMetrics(style, "padding", ""); var size = style.getPropertyValue("width").replace(/px$/, "") + " \u00D7 " + style.getPropertyValue("height").replace(/px$/, ""); document.getElementById("content").textContent = size; if (noMarginDisplayType[style.display] == "no") document.getElementById("marginBoxTable").setAttribute("hide", "yes"); else document.getElementById("marginBoxTable").removeAttribute("hide"); if (noPaddingDisplayType[style.display] == "no") document.getElementById("paddingBoxTable").setAttribute("hide", "yes"); else document.getElementById("paddingBoxTable").removeAttribute("hide");} |
var style; var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.ELEMENT_NODE) style = focusedNode.ownerDocument.defaultView.getComputedStyle(focusedNode); if (!style || style.length == 0) { document.getElementById("noMetrics").style.display = null; document.getElementById("marginBoxTable").style.display = "none"; return; } document.getElementById("noMetrics").style.display = "none"; document.getElementById("marginBoxTable").style.display = null; setBoxMetrics(style, "margin", ""); setBoxMetrics(style, "border", "-width"); setBoxMetrics(style, "padding", ""); var size = style.getPropertyValue("width").replace(/px$/, "") + " \u00D7 " + style.getPropertyValue("height").replace(/px$/, ""); document.getElementById("content").textContent = size; | function updateMetricsPane(){} |
|
document.getElementById("nodeContents").style.display = null; | document.getElementById("nodeContents").style.removeProperty("display"); | function updateNodePane(){ var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE || focusedNode.nodeType == Node.COMMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = "none"; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName; refreshScrollbars();} |
document.getElementById("elementAttributes").style.display = null; | document.getElementById("elementAttributes").style.removeProperty("display"); | function updateNodePane(){ var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE || focusedNode.nodeType == Node.COMMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = "none"; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName; refreshScrollbars();} |
document.getElementById("nodeNamespaceRow").style.display = null; | document.getElementById("nodeNamespaceRow").style.removeProperty("display"); | function updateNodePane(){ var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE || focusedNode.nodeType == Node.COMMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = "none"; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName; refreshScrollbars();} |
document.getElementById("nodeXpathValue").textContent = xpathForNode(focusedNode); | function updateNodePane() { var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE || focusedNode.nodeType == Node.COMMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = "none"; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeXpathValue").textContent = xpathForNode(focusedNode); document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName; refreshScrollbars();} |
|
document.getElementById("nodeXpathValue").textContent = xpathForNode(focusedNode); | function updateNodePane() { var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = "none"; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName; refreshScrollbars();} |
|
updateElementAttributes(); | function updateNodePane() { var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = null; if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } document.getElementById("nodeContentsScrollview").innerHTML = "<span class=\"disabled\">Loading...</span>"; nodeContentsScrollArea.refresh(); clearTimeout(nodeUpdateTimeout); nodeUpdateTimeout = setTimeout("delayedNodePaneUpdate()", 250); } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName;} |
|
document.getElementById("nodeContents").style.display = null; | document.getElementById("nodeContents").style.display = "none"; | function updateNodePane() { var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = null; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } document.getElementById("nodeContentsScrollview").innerHTML = "<span class=\"disabled\">Loading...</span>"; nodeContentsScrollArea.refresh(); clearTimeout(nodeUpdateTimeout); nodeUpdateTimeout = setTimeout("delayedNodePaneUpdate()", 250); } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName;} |
document.getElementById("nodeContentsScrollview").innerHTML = "<span class=\"disabled\">Loading...</span>"; nodeContentsScrollArea.refresh(); clearTimeout(nodeUpdateTimeout); nodeUpdateTimeout = setTimeout("delayedNodePaneUpdate()", 250); | function updateNodePane() { var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = null; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } document.getElementById("nodeContentsScrollview").innerHTML = "<span class=\"disabled\">Loading...</span>"; nodeContentsScrollArea.refresh(); clearTimeout(nodeUpdateTimeout); nodeUpdateTimeout = setTimeout("delayedNodePaneUpdate()", 250); } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName;} |
|
refreshScrollbars(); | function updateNodePane() { var focusedNode = Inspector.focusedDOMNode(); if (focusedNode.nodeType == Node.TEXT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = null; document.getElementById("nodeContentsScrollview").textContent = focusedNode.nodeValue; nodeContentsScrollArea.refresh(); } else if (focusedNode.nodeType == Node.ELEMENT_NODE) { document.getElementById("elementAttributes").style.display = null; document.getElementById("nodeContents").style.display = null; updateElementAttributes(); if (focusedNode.namespaceURI.length > 0) { document.getElementById("nodeNamespace").textContent = focusedNode.namespaceURI; document.getElementById("nodeNamespace").title = focusedNode.namespaceURI; document.getElementById("nodeNamespaceRow").style.display = null; } else { document.getElementById("nodeNamespaceRow").style.display = "none"; } document.getElementById("nodeContentsScrollview").innerHTML = "<span class=\"disabled\">Loading...</span>"; nodeContentsScrollArea.refresh(); clearTimeout(nodeUpdateTimeout); nodeUpdateTimeout = setTimeout("delayedNodePaneUpdate()", 250); } else if (focusedNode.nodeType == Node.DOCUMENT_NODE) { document.getElementById("nodeNamespaceRow").style.display = "none"; document.getElementById("elementAttributes").style.display = "none"; document.getElementById("nodeContents").style.display = "none"; } document.getElementById("nodeType").textContent = nodeTypeName(focusedNode); document.getElementById("nodeName").textContent = focusedNode.nodeName;} |
|
span.textContent = name; | span.textContent = name + ": "; | function updatePropertiesPane(){ // FIXME: Like the style pane, this should have a top item that's "all properties" // and separate items for each item in the prototype chain. For now, we implement // only the "all properties" part, and only for enumerable properties. var focusedNode = Inspector.focusedDOMNode(); var list = document.getElementById("jsPropertiesList"); list.innerHTML = ""; for (var name in focusedNode) { var li = document.createElement("li"); var span = document.createElement("span"); span.className = "property"; span.textContent = name; li.appendChild(span); var value = focusedNode[name]; span = document.createElement("span"); span.className = "value"; span.textContent = value; span.title = value; li.appendChild(span); list.appendChild(li); } jsPropertiesScrollArea.refresh();} |
span.title = value; | function updatePropertiesPane(){ // FIXME: Like the style pane, this should have a top item that's "all properties" // and separate items for each item in the prototype chain. For now, we implement // only the "all properties" part, and only for enumerable properties. var focusedNode = Inspector.focusedDOMNode(); var list = document.getElementById("jsPropertiesList"); list.innerHTML = ""; for (var name in focusedNode) { var li = document.createElement("li"); var span = document.createElement("span"); span.className = "property"; span.textContent = name; li.appendChild(span); var value = focusedNode[name]; span = document.createElement("span"); span.className = "value"; span.textContent = value; li.appendChild(span); list.appendChild(li); } jsPropertiesScrollArea.refresh();} |
|
if(this.map.projection != this.ovmap.map.projection) { | if(this.map.getProjection() != this.ovmap.getProjection()) { | updateRectToMap: function() { if(this.map.units != 'degrees') { if(this.map.projection != this.ovmap.map.projection) { alert('The overview map only works when it is in the same projection as the main map'); } } var pxBounds = this.getRectBoundsFromMapBounds(this.map.getExtent()); this.setRectPxBounds(pxBounds); }, |
if (!newSize.equals(this.getSize())) { | var oldSize = this.getSize(); if (oldSize == null) this.size = oldSize = newSize; if (!newSize.equals(oldSize)) { var dx = (newSize.w - oldSize.w) / 2, dy = (newSize.h - oldSize.h) / 2; var lcStyle = this.layerContainerDiv.style; lcStyle.left = (parseInt(lcStyle.left) + dx) + "px"; lcStyle.top = (parseInt(lcStyle.top ) + dy) + "px"; this.layerContainerOrigin = this.center.clone(); this.size = newSize; | updateSize: function() { var newSize = this.getCurrentSize(); if (!newSize.equals(this.getSize())) { this.events.element.offsets = null; this.size = newSize; } }, |
this.size = newSize; | updateSize: function() { var newSize = this.getCurrentSize(); if (!newSize.equals(this.getSize())) { this.events.element.offsets = null; this.size = newSize; } }, |
|
if (this.size.w == 0 && this.size.h == 0) { this.size.w = parseInt(this.div.style.width); this.size.h = parseInt(this.div.style.height); } | updateSize: function() { this.size = new OpenLayers.Size( this.div.clientWidth, this.div.clientHeight); this.events.div.offsets = null; // Workaround for the fact that hidden elements return 0 for size. if (this.size.w == 0 && this.size.h == 0) { var dim = Element.getDimensions(this.div); this.size.w = dim.width; this.size.h = dim.height; } }, |
|
var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2); var zoom = this.getZoom(); this.zoom = null; this.setCenter(center, zoom); | updateSize: function() { var newSize = this.getCurrentSize(); var oldSize = this.getSize(); if (oldSize == null) this.size = oldSize = newSize; if (!newSize.equals(oldSize)) { //notify layers of mapresize for(var i=0; i < this.layers.length; i++) { this.layers[i].onMapResize(); } var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2); var zoom = this.getZoom(); this.zoom = null; this.setCenter(center, zoom); // store the new size this.size = newSize; // the div might have moved on the page, also this.events.element.offsets = null; } }, |
|
if (this.baseLayer != null) { var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2); var centerLL = this.getLonLatFromViewPortPx(center); var zoom = this.getZoom(); this.zoom = null; this.setCenter(this.getCenter(), zoom); } | updateSize: function() { var newSize = this.getCurrentSize(); var oldSize = this.getSize(); if (oldSize == null) this.size = oldSize = newSize; if (!newSize.equals(oldSize)) { //notify layers of mapresize for(var i=0; i < this.layers.length; i++) { this.layers[i].onMapResize(); } var center = new OpenLayers.Pixel(newSize.w /2, newSize.h / 2); var zoom = this.getZoom(); this.zoom = null; this.setCenter(center, zoom); // store the new size this.size = newSize; // the div might have moved on the page, also this.events.element.offsets = null; } }, |
|
this.size.w = parseInt(this.div.style.width); this.size.h = parseInt(this.div.style.height); | var dim = Element.getDimensions(this.div); this.size.w = dim.width; this.size.h = dim.height; | updateSize: function() { this.size = new OpenLayers.Size( this.div.clientWidth, this.div.clientHeight); this.events.div.offsets = null; // Workaround for the fact that hidden elements return 0 for size. if (this.size.w == 0 && this.size.h == 0) { this.size.w = parseInt(this.div.style.width); this.size.h = parseInt(this.div.style.height); } }, |
this.textbox.value = recorder.testManager.getSourceForTestCase(this.testCase); | this.textbox.value = this.lastValue = recorder.testManager.getSourceForTestCase(this.testCase); | this.updateView = function() { var scrollTop = this.textbox.inputField.scrollTop; //this.textbox.value = this.testCase.getSource(this.recorder.options, "New Test"); this.textbox.value = recorder.testManager.getSourceForTestCase(this.testCase); this.textbox.inputField.scrollTop = scrollTop; //log.debug("source=" + getSource()); }; |
function upHandler(e) {if (!e) e = window.event; | function upHandler(scwEvt) { if (!scwEvt) scwEvt = window.event; | function upHandler(e) {if (!e) e = window.event; if (document.removeEventListener) {document.removeEventListener('mousemove', moveHandler, true); // Capture phase document.removeEventListener('mouseup', upHandler, true); // Capture phase } else {elementToDrag.detachEvent('onmouseup', upHandler); // Bubbling phase elementToDrag.detachEvent('onmousemove', moveHandler); // Bubbling phase elementToDrag.releaseCapture(); } scwStopPropagation(e); } |
scwStopPropagation(e); } | scwStopPropagation(scwEvt); } | function upHandler(e) {if (!e) e = window.event; if (document.removeEventListener) {document.removeEventListener('mousemove', moveHandler, true); // Capture phase document.removeEventListener('mouseup', upHandler, true); // Capture phase } else {elementToDrag.detachEvent('onmouseup', upHandler); // Bubbling phase elementToDrag.detachEvent('onmousemove', moveHandler); // Bubbling phase elementToDrag.releaseCapture(); } scwStopPropagation(e); } |
var button = input.name.substr(5, input.name.length - 6).replace('][', '-'); var wrapper = button + '-wrapper'; var hide = button + '-hide'; | var base = input.id.substring(5, input.id.length - 4); var button = base + '-button'; var wrapper = base + '-wrapper'; var hide = base + '-hide'; | function uploadAutoAttach() { var inputs = document.getElementsByTagName('input'); for (i = 0; input = inputs[i]; i++) { if (input && hasClass(input, 'upload')) { var uri = input.value; // Extract the button ID based on a substring of the input name: edit[foo][bar] -> foo-bar var button = input.name.substr(5, input.name.length - 6).replace('][', '-'); var wrapper = button + '-wrapper'; var hide = button + '-hide'; var upload = new jsUpload(uri, button, wrapper, hide); } }} |
var button = input.id.substr(5); | var button = input.name.substr(5, input.name.length - 6).replace('][', '-'); | function uploadAutoAttach() { var acdb = []; var inputs = document.getElementsByTagName('input'); for (i = 0; input = inputs[i]; i++) { if (input && hasClass(input, 'upload')) { var uri = input.value; var button = input.id.substr(5); var wrapper = button + '-wrapper'; var hide = button + '-hide'; var upload = new jsUpload(uri, button, wrapper, hide); } }} |
cocoon.sendPage("redirect.xml", { "url" : redirectUri }); | cocoon.redirectTo(redirectUri); | function uploadDocument() { var documentRoot = cocoon.parameters["documentRoot"]; var cocoonFlowHelper = new Packages.org.apache.lenya.cms.cocoon.flow.FlowHelper(); var redirectUri = cocoonFlowHelper.getRequestURI(cocoon); var servletContextPath = cocoonFlowHelper.getPageEnvelope(cocoon).getPublication().getServletContext(); //var uploadHelper = new Packages.org.apache.lenya.cms.authoring.UploadHelper(documentRoot + "/authoring/al/140"); var uploadHelper = new Packages.org.apache.lenya.cms.authoring.UploadHelper(servletContextPath + "/lenya/pubs/default/content"); var uploaded = false; while (!uploaded) { cocoon.sendPageAndWait("form.xml", { "error-messages" : null, //"error-messages" : uploadHelper.getErrorMessages(), "form-title" : "Upload Document" }); if (cocoon.request.getParameter("upload-regulation")) { var part = cocoon.request.get("upload-regulation"); uploaded = uploadHelper.save(part); } } cocoon.sendPage("redirect.xml", { "url" : redirectUri });} |
s = s.replace(/[^\w\s-]/g, ''); | s = s.replace(/[^-A-Z0-9\s]/gi, ''); | function URLify(s, num_chars) { // changes, e.g., "Petty theft" to "petty_theft" // remove all these words from the string before urlifying removelist = ["a", "an", "as", "at", "before", "but", "by", "for", "from", "is", "in", "into", "like", "of", "off", "on", "onto", "per", "since", "than", "the", "this", "that", "to", "up", "via", "with"]; r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi'); s = s.replace(r, ''); s = s.replace(/[^\w\s-]/g, ''); // remove unneeded chars s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces s = s.replace(/\s+/g, '-'); // convert spaces to hyphens s = s.toLowerCase(); // convert to lowercase return s.substring(0, num_chars);// trim to first num_chars chars} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.