rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
else if (arguments.length == 3) | else if (l3 === undefined) | function sc_map(proc, l1, l2) { /// export if (arguments.length == 2) return sc_map1(proc, l1); else if (arguments.length == 3) return sc_map2(proc, l1, l2); // else var nbApplyArgs = arguments.length - 1; var applyArgs = new Array(nbApplyArgs); var revres = null; while (l1 !== null) { for (var i = 0; i < nbApplyArgs; i++) { applyArgs[i] = arguments[i + 1].car; arguments[i + 1] = arguments[i + 1].cdr; } revres = sc_cons(proc.apply(null, applyArgs), revres); } return sc_destReverseAppend(revres, null);} |
function sc_minus(x, y) { if (y === undefined) | function sc_minus(x) { if (arguments.length === 1) | function sc_minus(x, y) { /// export - -fx -fl if (y === undefined) return -x; else return x - y;} |
else return x - y; | else { var res = x; for (var i = 1; i < arguments.length; i++) res -= arguments[i]; return res; } | function sc_minus(x, y) { /// export - -fx -fl if (y === undefined) return -x; else return x - y;} |
return port.peekChar(); | var t = port.peekChar(); return t === SC_EOF_OBJECT? t: new sc_Char(t); | function sc_peekChar(port) { /// export if (port === undefined) // we assume the port hasn't been given. port = SC_DEFAULT_IN; // THREAD: shared var... return port.peekChar();} |
return port.readChar(); | var t = port.readChar(); return t === SC_EOF_OBJECT? t: new sc_Char(t); | function sc_readChar(port) { /// export if (port === undefined) // we assume the port hasn't been given. port = SC_DEFAULT_IN; // THREAD: shared var... return port.readChar();} |
res = sc_cons(s.charAt(i), res); | res = sc_cons(new sc_Char(s.charAt(i)), res); | function sc_string2list_immutable(s) { /// export var res = null; for (var i = s.length - 1; i >= 0; i--) res = sc_cons(s.charAt(i), res); return res;} |
sc_symbol2number(s.val, radix); | sc_symbol2number_mutable(s.val, radix); | function sc_string2number_mutable(s, radix) { /// export sc_symbol2number(s.val, radix);} |
sc_symbol2number_mutable(s.val, radix); | return sc_symbol2number_mutable(s.val, radix); | function sc_string2number_mutable(s, radix) { /// export sc_symbol2number_mutable(s.val, radix);} |
return s.charAt(k); | return new sc_Char(s.charAt(k)); | function sc_stringRef_immutable(s, k) { /// export return s.charAt(k);} |
return s.val.charAt(k); | return new sc_Char(s.val.charAt(k)); | function sc_stringRef_mutable(s, k) { /// export return s.val.charAt(k);} |
return arguments; | return new sc_Values(arguments); | function sc_values() { /// export return arguments;} |
var outp = new sc_StringOutputPort(); | var outp = new sc_StringOutputPort_immutable(); | function sc_withOutputToString_immutable(thunk) { /// export var tmp = SC_DEFAULT_OUT; // THREAD: shared var. var outp = new sc_StringOutputPort(); SC_DEFAULT_OUT = outp; var tmp2 = thunk(); SC_DEFAULT_OUT = tmp; return outp.close();} |
return new sc_String(sc_withOutputToString_immutable(thunk)); | var tmp = SC_DEFAULT_OUT; var outp = new sc_StringOutputPort_mutable(); SC_DEFAULT_OUT = outp; var tmp2 = thunk(); SC_DEFAULT_OUT = tmp; return outp.close(); | function sc_withOutputToString_mutable(thunk) { /// export return new sc_String(sc_withOutputToString_immutable(thunk));} |
for(thiskl in KLines) { if (KLines[thiskl].hostmask && match_irc_mask(theuser.uprefix + "@" + theuser.hostname,KLines[thiskl].hostmask)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); } | if (isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); | function scan_for_klined_clients() { for(thisUser in Clients) { if (Clients[thisUser]) { theuser=Clients[thisUser]; if (theuser.local && !theuser.server && (theuser.conntype == TYPE_USER)) { for(thiskl in KLines) { if (KLines[thiskl].hostmask && match_irc_mask(theuser.uprefix + "@" + theuser.hostname,KLines[thiskl].hostmask)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); } } } }} |
var kline=isklined(theuser.uprefix + "@" + theuser.hostname)); | var kline=isklined(theuser.uprefix + "@" + theuser.hostname); | function scan_for_klined_clients() { for(thisUser in Local_Users) { var theuser=Local_Users[thisUser]; var kline=isklined(theuser.uprefix + "@" + theuser.hostname)); if (kline) theuser.quit("User has been K:Lined (" + kline.reason + ")"); if (iszlined(theuser.ip)) theuser.quit("User has been Z:Lined"); }} |
theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")",true); | theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); | function scan_for_klined_clients() { for(thisUser in Clients) { if (Clients[thisUser]) { theuser=Clients[thisUser]; if (theuser.local && !theuser.server && (theuser.conntype == TYPE_USER)) { if (isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")",true); if (iszlined(theuser.ip)) theuser.quit("User has been Z:Lined",true); } } }} |
theuser.quit("User has been Z:Lined",true); | theuser.quit("User has been Z:Lined"); | function scan_for_klined_clients() { for(thisUser in Clients) { if (Clients[thisUser]) { theuser=Clients[thisUser]; if (theuser.local && !theuser.server && (theuser.conntype == TYPE_USER)) { if (isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")",true); if (iszlined(theuser.ip)) theuser.quit("User has been Z:Lined",true); } } }} |
if (theuser.uprefix && isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); | var kline=isklined(theuser.uprefix + "@" + theuser.hostname)); if (kline) theuser.quit("User has been K:Lined (" + kline.reason + ")"); | function scan_for_klined_clients() { for(thisUser in Local_Users) { var theuser=Local_Users[thisUser]; if (theuser.uprefix && isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); if (iszlined(theuser.ip)) theuser.quit("User has been Z:Lined"); }} |
theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); | theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")",true); | function scan_for_klined_clients() { for(thisUser in Clients) { if (Clients[thisUser]) { theuser=Clients[thisUser]; if (theuser.local && !theuser.server && (theuser.conntype == TYPE_USER)) { if (isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); if (iszlined(theuser.ip)) theuser.quit("User has been Z:Lined"); } } }} |
theuser.quit("User has been Z:Lined"); | theuser.quit("User has been Z:Lined",true); | function scan_for_klined_clients() { for(thisUser in Clients) { if (Clients[thisUser]) { theuser=Clients[thisUser]; if (theuser.local && !theuser.server && (theuser.conntype == TYPE_USER)) { if (isklined(theuser.uprefix + "@" + theuser.hostname)) theuser.quit("User has been K:Lined (" + KLines[thiskl].reason + ")"); if (iszlined(theuser.ip)) theuser.quit("User has been Z:Lined"); } } }} |
return "\x01H\x01Y\x014"+channels.current.topic.substr(0,80)+SPACEx80.substr(0,(80-channels.current.topic.length)>0?(80-channels.current.topic.length):0)+"\x01N\x01W\x010"; | return "\x01H\x01Y\x014"+channels.current.topic.substr(0,79)+SPACEx80.substr(0,(79-channels.current.topic.length)>0?(79-channels.current.topic.length):0)+"\x01N\x01W\x010"; | function Screen() { console.clear(); this.line=new Array(console.screen_rows-3); this.rows=console.screen_rows-3; // Title, Status, and input rows are not counted. this.update_input_line=Screen_update_input_line; this.print_line=Screen_print_line; this.update_statline=Screen_update_statline; this.statusline getter=function() { // THIS NEEDS TO GO INTO THE SCREEN BUFFER!!! ToDo bbs.nodesync(); if(connected) { if(channels != undefined) { if(channels.current != undefined) { return "\x01N\x014 Nick: "+nick+" Channel: "+channels.current.display+SPACEx80.substr(0,79-34-nick.length-channels.current.display.length)+" /quit to exit \x01N\x010\x01W"; } } } return "\x01N\x014 Nick: "+nick+" Channel: No Channel"+SPACEx80.substr(0,79-44-nick.length)+" /quit to exit \x01N\x010\x01W"; }; this.topicline getter=function() { if(connected) { if(channels != undefined) { if(channels.current != undefined) { return "\x01H\x01Y\x014"+channels.current.topic.substr(0,80)+SPACEx80.substr(0,(80-channels.current.topic.length)>0?(80-channels.current.topic.length):0)+"\x01N\x01W\x010"; } } } return "\x01H\x01Y\x014No Topic"+SPACEx80.substr(0,72)+"\x01N\x01W\x010"; } this.input_buffer=""; this.input_pos=0; this.handle_key=Screen_handle_key; this.update=Screen_update; this.print_line("\1n\1hSynchronet \1cInternet Relay Chat \1wModule \1n" + REVISION + "\r\n");} |
return "\x01H\x01Y\x014No Topic"+SPACEx80.substr(0,72)+"\x01N\x01W\x010"; | return "\x01H\x01Y\x014No Topic"+SPACEx80.substr(0,71)+"\x01N\x01W\x010"; | function Screen() { console.clear(); this.line=new Array(console.screen_rows-3); this.rows=console.screen_rows-3; // Title, Status, and input rows are not counted. this.update_input_line=Screen_update_input_line; this.print_line=Screen_print_line; this.update_statline=Screen_update_statline; this.statusline getter=function() { // THIS NEEDS TO GO INTO THE SCREEN BUFFER!!! ToDo bbs.nodesync(); if(connected) { if(channels != undefined) { if(channels.current != undefined) { return "\x01N\x014 Nick: "+nick+" Channel: "+channels.current.display+SPACEx80.substr(0,79-34-nick.length-channels.current.display.length)+" /quit to exit \x01N\x010\x01W"; } } } return "\x01N\x014 Nick: "+nick+" Channel: No Channel"+SPACEx80.substr(0,79-44-nick.length)+" /quit to exit \x01N\x010\x01W"; }; this.topicline getter=function() { if(connected) { if(channels != undefined) { if(channels.current != undefined) { return "\x01H\x01Y\x014"+channels.current.topic.substr(0,80)+SPACEx80.substr(0,(80-channels.current.topic.length)>0?(80-channels.current.topic.length):0)+"\x01N\x01W\x010"; } } } return "\x01H\x01Y\x014No Topic"+SPACEx80.substr(0,72)+"\x01N\x01W\x010"; } this.input_buffer=""; this.input_pos=0; this.handle_key=Screen_handle_key; this.update=Screen_update; this.print_line("\1n\1hSynchronet \1cInternet Relay Chat \1wModule \1n" + REVISION + "\r\n");} |
console.crlf(); | function Screen_handle_key(key) { var commands=[null]; var command=null; var nickmatch=""; var lastspace=0; switch(key) { case "\r": if(this.input_buffer=="") { break; } history.addline(this.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } this.input_buffer=this.input_buffer.replace(/%C/g,"\x03"); this.input_buffer=this.input_buffer.replace(/%%/g,"%"); if(this.input_buffer.substr(0,1)=="/" && this.input_buffer.substr(1,1)!="/") { commands=this.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(this.input_buffer.substr(0,1)=="/") { this.input_buffer=this.input_buffer.substr(1); } if(channels.current==undefined) { this.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(this.input_buffer); this.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+this.input_buffer); } } this.input_buffer=""; this.input_pos=0; this.update_input_line(); break; case "\x08": if(this.input_pos > 0) { this.input_buffer=this.input_buffer.slice(0,this.input_pos-1)+this.input_buffer.slice(this.input_pos); this.input_pos--; this.update_input_line(); } break; case "\x0b": this.input_buffer=this.input_buffer+"%C"; this.input_pos+=2; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.previous; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.next; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x1d": // Left arrow if(this.input_pos > 0) { this.input_pos--; } this.update_input_line(); break; case "\x02": // Home this.input_pos=0; this.update_input_line() break; case "\x05": // End this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x06": // right arrow if(this.input_pos < (this.input_buffer.length)) { this.input_pos++; } this.update_input_line(); break; case "\t": // Tab lastspace=this.input_buffer.lastIndexOf(" ",this.input_pos); nickmatch=channels.current.matchnick(this.input_buffer.substr(lastspace+1,this.input_pos-lastspace-1)); if(nickmatch != null) { this.input_buffer=this.input_buffer.substr(0,lastspace+1)+nickmatch+(lastspace==-1?": ":" ")+this.input_buffer.substr(this.input_pos); this.input_pos=lastspace+2+nickmatch.length; if(lastspace==-1) this.input_pos++; } this.update_input_line(); break; default: if(ascii(key)<ascii(' ')) { if(ascii(key) != 27 && console.handle_ctrlkey!=undefined) { console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-2); console.handle_ctrlkey(key,0); // for now console.print(this.topicline); console.print(this.statusline); this.update_input_line(); } } else { this.input_buffer=this.input_buffer.slice(0,this.input_pos)+key+this.input_buffer.slice(this.input_pos); this.input_pos++; this.update_input_line(); } }} |
|
var my_eol = this.input_buffer.length; this.input_pos = my_eol; | function Screen_handle_key(key) { var commands=[null]; var command=null; switch(key) { case "\r": if(this.input_buffer=="") { break; } history.addline(this.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } this.input_buffer=this.input_buffer.replace(/%C/g,"\x03"); this.input_buffer=this.input_buffer.replace(/%%/g,"%"); if(this.input_buffer.substr(0,1)=="/" && this.input_buffer.substr(1,1)!="/") { commands=this.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(this.input_buffer.substr(0,1)=="/") { this.input_buffer=this.input_buffer.substr(1); } if(channels.current==undefined) { this.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(this.input_buffer); this.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+this.input_buffer); } } this.input_buffer=""; this.input_pos=0; this.update_input_line(); break; case "\x08": if(this.input_pos > 0) { this.input_buffer=this.input_buffer.slice(0,this.input_pos-1)+this.input_buffer.slice(this.input_pos); this.input_pos--; this.update_input_line(); } break; case "\x0b": this.input_buffer=this.input_buffer+"%C"; this.input_pos+=2; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.previous; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.next; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x1d": // Left arrow if(this.input_pos > 0) { this.input_pos--; } this.update_input_line(); break; case "\x02": // Home this.input_pos=0; this.update_input_line() break; case "\x05": // End this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x06": // right arrow if(this.input_pos < (this.input_buffer.length)) { this.input_pos++; } this.update_input_line(); break; case "\t": // Tab this.input_buffer=channels.current.matchnick(this.input_buffer); this.update_input_line(); break; default: if(ascii(key)<ascii(' ')) { if(ascii(key) != 27 && console.handle_ctrlkey!=undefined) { console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.handle_ctrlkey(key,0); // for now console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line(); } } else { this.input_buffer=this.input_buffer.slice(0,this.input_pos)+key+this.input_buffer.slice(this.input_pos); this.input_pos++; this.update_input_line(); } }} |
|
screen.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+screen.input_buffer); | function Screen_handle_key(key) { var commands=[null]; var command=null; switch(key) { case "\r": if(screen.input_buffer=="") { break; } history.addline(screen.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } screen.input_buffer=screen.input_buffer.replace(/%C/g,"\x03"); screen.input_buffer=screen.input_buffer.replace(/%%/g,"%"); if(screen.input_buffer.substr(0,1)=="/" && screen.input_buffer.substr(1,1)!="/") { commands=screen.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(screen.input_buffer.substr(0,1)=="/") { screen.input_buffer=screen.input_buffer.substr(1); } if(channels.current==undefined) { screen.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(screen.input_buffer); } screen.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+screen.input_buffer); } screen.input_buffer=""; screen.update_input_line(); break; case "\x08": screen.input_buffer=screen.input_buffer.slice(0,-1); screen.update_input_line(); break; case "\x0b": screen.input_buffer=screen.input_buffer+"%C"; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=screen.input_buffer; } screen.input_buffer=history.previous; screen.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=screen.input_buffer; } screen.input_buffer=history.next; screen.update_input_line() break; case "\x1d": // Left arrow channels.index-=1; if(channels.index<0) { channels.index=channels.length-1; } screen.update_statline(); break; case "\x06": // right arrow channels.index+=1; if(channels.index>=channels.length) { channels.index=0; } screen.update_statline(); break; case "\t": // Tab screen.input_buffer=channels.current.matchnick(screen.input_buffer); screen.update_input_line(); break; default: screen.input_buffer=screen.input_buffer+key; screen.update_input_line(); }} |
|
var nickmatch=""; var lastspace=0; | function Screen_handle_key(key) { var commands=[null]; var command=null; switch(key) { case "\r": if(this.input_buffer=="") { break; } history.addline(this.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } this.input_buffer=this.input_buffer.replace(/%C/g,"\x03"); this.input_buffer=this.input_buffer.replace(/%%/g,"%"); if(this.input_buffer.substr(0,1)=="/" && this.input_buffer.substr(1,1)!="/") { commands=this.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(this.input_buffer.substr(0,1)=="/") { this.input_buffer=this.input_buffer.substr(1); } if(channels.current==undefined) { this.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(this.input_buffer); this.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+this.input_buffer); } } this.input_buffer=""; this.input_pos=0; this.update_input_line(); break; case "\x08": if(this.input_pos > 0) { this.input_buffer=this.input_buffer.slice(0,this.input_pos-1)+this.input_buffer.slice(this.input_pos); this.input_pos--; this.update_input_line(); } break; case "\x0b": this.input_buffer=this.input_buffer+"%C"; this.input_pos+=2; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.previous; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.next; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x1d": // Left arrow if(this.input_pos > 0) { this.input_pos--; } this.update_input_line(); break; case "\x02": // Home this.input_pos=0; this.update_input_line() break; case "\x05": // End this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x06": // right arrow if(this.input_pos < (this.input_buffer.length)) { this.input_pos++; } this.update_input_line(); break; case "\t": // Tab this.input_buffer=channels.current.matchnick(this.input_buffer); // Always go to the end of the line on a tab. -- Cyan var my_eol = this.input_buffer.length; this.input_pos = my_eol; this.update_input_line(); break; default: if(ascii(key)<ascii(' ')) { if(ascii(key) != 27 && console.handle_ctrlkey!=undefined) { console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.handle_ctrlkey(key,0); // for now console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line(); } } else { this.input_buffer=this.input_buffer.slice(0,this.input_pos)+key+this.input_buffer.slice(this.input_pos); this.input_pos++; this.update_input_line(); } }} |
|
this.input_buffer=channels.current.matchnick(this.input_buffer); var my_eol = this.input_buffer.length; this.input_pos = my_eol; | lastspace=this.input_buffer.lastIndexOf(" ",this.input_pos); nickmatch=channels.current.matchnick(this.input_buffer.substr(lastspace+1,this.input_pos-lastspace-1)); if(nickmatch != null) { this.input_buffer=this.input_buffer.substr(0,lastspace+1)+nickmatch+(lastspace==-1?": ":" ")+this.input_buffer.substr(this.input_pos); this.input_pos=lastspace+2+nickmatch.length; if(lastspace==-1) this.input_pos++; } | function Screen_handle_key(key) { var commands=[null]; var command=null; switch(key) { case "\r": if(this.input_buffer=="") { break; } history.addline(this.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } this.input_buffer=this.input_buffer.replace(/%C/g,"\x03"); this.input_buffer=this.input_buffer.replace(/%%/g,"%"); if(this.input_buffer.substr(0,1)=="/" && this.input_buffer.substr(1,1)!="/") { commands=this.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(this.input_buffer.substr(0,1)=="/") { this.input_buffer=this.input_buffer.substr(1); } if(channels.current==undefined) { this.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(this.input_buffer); this.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+this.input_buffer); } } this.input_buffer=""; this.input_pos=0; this.update_input_line(); break; case "\x08": if(this.input_pos > 0) { this.input_buffer=this.input_buffer.slice(0,this.input_pos-1)+this.input_buffer.slice(this.input_pos); this.input_pos--; this.update_input_line(); } break; case "\x0b": this.input_buffer=this.input_buffer+"%C"; this.input_pos+=2; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.previous; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.next; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x1d": // Left arrow if(this.input_pos > 0) { this.input_pos--; } this.update_input_line(); break; case "\x02": // Home this.input_pos=0; this.update_input_line() break; case "\x05": // End this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x06": // right arrow if(this.input_pos < (this.input_buffer.length)) { this.input_pos++; } this.update_input_line(); break; case "\t": // Tab this.input_buffer=channels.current.matchnick(this.input_buffer); // Always go to the end of the line on a tab. -- Cyan var my_eol = this.input_buffer.length; this.input_pos = my_eol; this.update_input_line(); break; default: if(ascii(key)<ascii(' ')) { if(ascii(key) != 27 && console.handle_ctrlkey!=undefined) { console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.handle_ctrlkey(key,0); // for now console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line(); } } else { this.input_buffer=this.input_buffer.slice(0,this.input_pos)+key+this.input_buffer.slice(this.input_pos); this.input_pos++; this.update_input_line(); } }} |
console.ansi_gotoxy(1,console.screen_rows-1); | console.ansi_gotoxy(1,console.screen_rows-2); | function Screen_handle_key(key) { var commands=[null]; var command=null; switch(key) { case "\r": if(this.input_buffer=="") { break; } history.addline(this.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } this.input_buffer=this.input_buffer.replace(/%C/g,"\x03"); this.input_buffer=this.input_buffer.replace(/%%/g,"%"); if(this.input_buffer.substr(0,1)=="/" && this.input_buffer.substr(1,1)!="/") { commands=this.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(this.input_buffer.substr(0,1)=="/") { this.input_buffer=this.input_buffer.substr(1); } if(channels.current==undefined) { this.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(this.input_buffer); this.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+this.input_buffer); } } this.input_buffer=""; this.input_pos=0; this.update_input_line(); break; case "\x08": if(this.input_pos > 0) { this.input_buffer=this.input_buffer.slice(0,this.input_pos-1)+this.input_buffer.slice(this.input_pos); this.input_pos--; this.update_input_line(); } break; case "\x0b": this.input_buffer=this.input_buffer+"%C"; this.input_pos+=2; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.previous; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.next; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x1d": // Left arrow if(this.input_pos > 0) { this.input_pos--; } this.update_input_line(); break; case "\x02": // Home this.input_pos=0; this.update_input_line() break; case "\x05": // End this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x06": // right arrow if(this.input_pos < (this.input_buffer.length)) { this.input_pos++; } this.update_input_line(); break; case "\t": // Tab this.input_buffer=channels.current.matchnick(this.input_buffer); // Always go to the end of the line on a tab. -- Cyan var my_eol = this.input_buffer.length; this.input_pos = my_eol; this.update_input_line(); break; default: if(ascii(key)<ascii(' ')) { if(ascii(key) != 27 && console.handle_ctrlkey!=undefined) { console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.handle_ctrlkey(key,0); // for now console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line(); } } else { this.input_buffer=this.input_buffer.slice(0,this.input_pos)+key+this.input_buffer.slice(this.input_pos); this.input_pos++; this.update_input_line(); } }} |
console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); | function Screen_handle_key(key) { var commands=[null]; var command=null; switch(key) { case "\r": if(this.input_buffer=="") { break; } history.addline(this.input_buffer); while(history.line.length>MAX_HIST) { history.shift(); } this.input_buffer=this.input_buffer.replace(/%C/g,"\x03"); this.input_buffer=this.input_buffer.replace(/%%/g,"%"); if(this.input_buffer.substr(0,1)=="/" && this.input_buffer.substr(1,1)!="/") { commands=this.input_buffer.split(" "); command=commands.shift(); command=command.substr(1); command=command.toUpperCase(); send_command(command,commands.join(" ")); } else { if(this.input_buffer.substr(0,1)=="/") { this.input_buffer=this.input_buffer.substr(1); } if(channels.current==undefined) { this.print_line("\x01H\x01RYou are not in a channel!\x01N\x01W"); } else { channels.current.send(this.input_buffer); this.print_line("\x01N\x01M<\x01N\x01W"+nick+"\x01N\x01M>\x01N\x01W "+this.input_buffer); } } this.input_buffer=""; this.input_pos=0; this.update_input_line(); break; case "\x08": if(this.input_pos > 0) { this.input_buffer=this.input_buffer.slice(0,this.input_pos-1)+this.input_buffer.slice(this.input_pos); this.input_pos--; this.update_input_line(); } break; case "\x0b": this.input_buffer=this.input_buffer+"%C"; this.input_pos+=2; break; case "\x1e": // Up arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.previous; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x0a": // Down arrow if(history.index==null) { history.incomplete=this.input_buffer; } this.input_buffer=history.next; this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x1d": // Left arrow if(this.input_pos > 0) { this.input_pos--; } this.update_input_line(); break; case "\x02": // Home this.input_pos=0; this.update_input_line() break; case "\x05": // End this.input_pos=this.input_buffer.length; this.update_input_line() break; case "\x06": // right arrow if(this.input_pos < (this.input_buffer.length)) { this.input_pos++; } this.update_input_line(); break; case "\t": // Tab this.input_buffer=channels.current.matchnick(this.input_buffer); // Always go to the end of the line on a tab. -- Cyan var my_eol = this.input_buffer.length; this.input_pos = my_eol; this.update_input_line(); break; default: if(ascii(key)<ascii(' ')) { if(ascii(key) != 27 && console.handle_ctrlkey!=undefined) { console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.handle_ctrlkey(key,0); // for now console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line(); } } else { this.input_buffer=this.input_buffer.slice(0,this.input_pos)+key+this.input_buffer.slice(this.input_pos); this.input_pos++; this.update_input_line(); } }} |
|
console.ansi_gotoxy(1,console.screen_rows-2); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); | function Screen_print_line(line) { var i=0; var lastspace=0; var linestart=0; var prev_colour=""; var last_colour=""; var cname=""; var topic=""; console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-2); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-2); // Remove bold line=line.replace(/\x02/g,""); // mIRC colour codes line=line.replace(/\x03([0-9\,]{1,5})/g, function(str,p1,offset,s) { var p2; var ending=null; var codes=[null]; var ret=null; ending=""; codes=p1.split(","); p1=codes[0]; codes.shift(); p2=codes[0]; codes.shift(); ending=","+codes.join(","); if(p2==undefined) { p2="-1"; } if(p2.length>2) { ending=p2.substr(2)+ending; p2=p2.substr(0,2); } if(p1.length>2) { ending=p1.substr(2)+ending; p1=p1.substr(0,2); } p1=Number(p1); p2=Number(p2); p1=p1 % 16; if(p2>=0 && p2<=99) { p2=Number(p2) % 8; } else { p2=8; } switch(p1) { case 0: ret="\x01H\x01W"; break; case 1: ret="\x01N\x01K"; break; case 2: ret="\x01N\x01B"; break; case 3: ret="\x01N\x01G"; break; case 4: ret="\x01N\x01R"; break; case 5: ret="\x01N\x01Y"; break; case 6: ret="\x01H\x01M"; break; case 7: // This is supposed to be ORANGE damnit! ret="\x01H\x01R"; break; case 8: ret="\x01H\x01Y"; break; case 9: ret="\x01H\x01G"; break; case 10: ret="\x01N\x01C"; break; case 11: ret="\x01H\x01C"; break; case 12: ret="\x01H\x01B"; break; case 13: ret="\x01H\x01M"; break; case 14: ret="\x01H\x01K"; break; case 15: ret="\x01N\x01W"; break; default: ret=""; } switch(p2) { case 0: ret=ret+"\x017"; break; case 1: ret=ret+"\x010"; break; case 2: ret=ret+"\x014"; break; case 3: ret=ret+"\x012"; break; case 4: ret=ret+"\x011"; break; case 5: ret=ret+"\x013"; break; case 6: ret=ret+"\x015"; break; case 7: // This is supposed to be ORANGE damnit! ret=ret+"\x016"; break; } return ret+ending; } ); if(line.length > 78) { // Word Wrap... for(var j=0;j<=line.length;j++) { switch(line.charAt(j)) { case "\x01": last_colour=last_colour+line.substr(j,2); j+=1; break; case " ": lastspace=j; default: if(i>=78) { if(lastspace==linestart-1) { lastspace=j; } console.print(prev_colour+line.substring(linestart,lastspace+1)); prev_colour=last_colour; console.crlf(); this.line.shift(); this.line.push(prev_colour+line.substring(linestart,lastspace+1)); linestart=lastspace+1; j=lastspace; i=0; } i+=1; } } } if(i<=78) { console.print(prev_colour+line.substr(linestart)); this.line.shift(); this.line.push(prev_colour+line.substr(linestart)); console.crlf(); } if(!connected) { cname="No channel"; topic="Not in channel"; } else if (channels==undefined) { cname="No channel"; topic="Not in channel"; } else if (channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.topicline); console.print(this.statusline); console.crlf(); this.update_input_line();} |
|
console.crlf(); | function Screen_print_line(line) { var i=0; var lastspace=0; var linestart=0; var prev_colour=""; var last_colour=""; var cname=""; var topic=""; console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-2); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-2); // Remove bold line=line.replace(/\x02/g,""); // mIRC colour codes line=line.replace(/\x03([0-9\,]{1,5})/g, function(str,p1,offset,s) { var p2; var ending=null; var codes=[null]; var ret=null; ending=""; codes=p1.split(","); p1=codes[0]; codes.shift(); p2=codes[0]; codes.shift(); ending=","+codes.join(","); if(p2==undefined) { p2="-1"; } if(p2.length>2) { ending=p2.substr(2)+ending; p2=p2.substr(0,2); } if(p1.length>2) { ending=p1.substr(2)+ending; p1=p1.substr(0,2); } p1=Number(p1); p2=Number(p2); p1=p1 % 16; if(p2>=0 && p2<=99) { p2=Number(p2) % 8; } else { p2=8; } switch(p1) { case 0: ret="\x01H\x01W"; break; case 1: ret="\x01N\x01K"; break; case 2: ret="\x01N\x01B"; break; case 3: ret="\x01N\x01G"; break; case 4: ret="\x01N\x01R"; break; case 5: ret="\x01N\x01Y"; break; case 6: ret="\x01H\x01M"; break; case 7: // This is supposed to be ORANGE damnit! ret="\x01H\x01R"; break; case 8: ret="\x01H\x01Y"; break; case 9: ret="\x01H\x01G"; break; case 10: ret="\x01N\x01C"; break; case 11: ret="\x01H\x01C"; break; case 12: ret="\x01H\x01B"; break; case 13: ret="\x01H\x01M"; break; case 14: ret="\x01H\x01K"; break; case 15: ret="\x01N\x01W"; break; default: ret=""; } switch(p2) { case 0: ret=ret+"\x017"; break; case 1: ret=ret+"\x010"; break; case 2: ret=ret+"\x014"; break; case 3: ret=ret+"\x012"; break; case 4: ret=ret+"\x011"; break; case 5: ret=ret+"\x013"; break; case 6: ret=ret+"\x015"; break; case 7: // This is supposed to be ORANGE damnit! ret=ret+"\x016"; break; } return ret+ending; } ); if(line.length > 78) { // Word Wrap... for(var j=0;j<=line.length;j++) { switch(line.charAt(j)) { case "\x01": last_colour=last_colour+line.substr(j,2); j+=1; break; case " ": lastspace=j; default: if(i>=78) { if(lastspace==linestart-1) { lastspace=j; } console.print(prev_colour+line.substring(linestart,lastspace+1)); prev_colour=last_colour; console.crlf(); this.line.shift(); this.line.push(prev_colour+line.substring(linestart,lastspace+1)); linestart=lastspace+1; j=lastspace; i=0; } i+=1; } } } if(i<=78) { console.print(prev_colour+line.substr(linestart)); this.line.shift(); this.line.push(prev_colour+line.substr(linestart)); console.crlf(); } if(!connected) { cname="No channel"; topic="Not in channel"; } else if (channels==undefined) { cname="No channel"; topic="Not in channel"; } else if (channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.topicline); console.print(this.statusline); console.crlf(); this.update_input_line();} |
|
if(i<78) { | if(i<=78) { | function Screen_print_line(line) { var i=0; var lastspace=0; var linestart=0; var prev_colour=""; var last_colour=""; var cname=""; var topic=""; console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); // Remove bold line=line.replace(/\x02/g,""); // mIRC colour codes line=line.replace(/\x03([0-9\,]{1,5})/g, function(str,p1,offset,s) { var p2; var ending=null; var codes=[null]; var ret=null; ending=""; codes=p1.split(","); p1=codes[0]; codes.shift(); p2=codes[0]; codes.shift(); ending=","+codes.join(","); if(p2==undefined) { p2="-1"; } if(p2.length>2) { ending=p2.substr(2)+ending; p2=p2.substr(0,2); } if(p1.length>2) { ending=p1.substr(2)+ending; p1=p1.substr(0,2); } p1=Number(p1); p2=Number(p2); p1=p1 % 16; if(p2>=0 && p2<=99) { p2=Number(p2) % 8; } else { p2=8; } switch(p1) { case 0: ret="\x01H\x01W"; break; case 1: ret="\x01N\x01K"; break; case 2: ret="\x01N\x01B"; break; case 3: ret="\x01N\x01G"; break; case 4: ret="\x01N\x01R"; break; case 5: ret="\x01N\x01Y"; break; case 6: ret="\x01H\x01M"; break; case 7: // This is supposed to be ORANGE damnit! ret="\x01H\x01R"; break; case 8: ret="\x01H\x01Y"; break; case 9: ret="\x01H\x01G"; break; case 10: ret="\x01N\x01C"; break; case 11: ret="\x01H\x01C"; break; case 12: ret="\x01H\x01B"; break; case 13: ret="\x01H\x01M"; break; case 14: ret="\x01H\x01K"; break; case 15: ret="\x01N\x01W"; break; default: ret=""; } switch(p2) { case 0: ret=ret+"\x017"; break; case 1: ret=ret+"\x010"; break; case 2: ret=ret+"\x014"; break; case 3: ret=ret+"\x012"; break; case 4: ret=ret+"\x011"; break; case 5: ret=ret+"\x013"; break; case 6: ret=ret+"\x015"; break; case 7: // This is supposed to be ORANGE damnit! ret=ret+"\x016"; break; } return ret+ending; } ); if(line.length > 78) { // Word Wrap... for(var j=0;j<=line.length;j++) { switch(line.charAt(j)) { case "\x01": last_colour=last_colour+line.substr(j,2); j+=1; break; case " ": lastspace=j; default: if(i>=78) { if(lastspace==linestart-1) { lastspace=j; } console.print(prev_colour+line.substring(linestart,lastspace+1)); prev_colour=last_colour; console.crlf(); this.line.shift(); this.line.push(prev_colour+line.substring(linestart,lastspace+1)); linestart=lastspace+1; j=lastspace; i=0; } i+=1; } } } if(i<78) { console.print(prev_colour+line.substr(linestart)); this.line.shift(); this.line.push(prev_colour+line.substr(linestart)); console.crlf(); } if(!connected) { cname="No channel"; topic="Not in channel"; } else if (channels==undefined) { cname="No channel"; topic="Not in channel"; } else if (channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line();} |
console.ansi_gotoxy(1,console.screen_rows-1); | console.ansi_gotoxy(1,console.screen_rows-2); | function Screen_print_line(line) { var i=0; var lastspace=0; var linestart=0; var prev_colour=""; var last_colour=""; var cname=""; var topic=""; console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); // Remove bold line=line.replace(/\x02/g,""); // mIRC colour codes line=line.replace(/\x03([0-9\,]{1,5})/g, function(str,p1,offset,s) { var p2; var ending=null; var codes=[null]; var ret=null; ending=""; codes=p1.split(","); p1=codes[0]; codes.shift(); p2=codes[0]; codes.shift(); ending=","+codes.join(","); if(p2==undefined) { p2="-1"; } if(p2.length>2) { ending=p2.substr(2)+ending; p2=p2.substr(0,2); } if(p1.length>2) { ending=p1.substr(2)+ending; p1=p1.substr(0,2); } p1=Number(p1); p2=Number(p2); p1=p1 % 16; if(p2>=0 && p2<=99) { p2=Number(p2) % 8; } else { p2=8; } switch(p1) { case 0: ret="\x01H\x01W"; break; case 1: ret="\x01N\x01K"; break; case 2: ret="\x01N\x01B"; break; case 3: ret="\x01N\x01G"; break; case 4: ret="\x01N\x01R"; break; case 5: ret="\x01N\x01Y"; break; case 6: ret="\x01H\x01M"; break; case 7: // This is supposed to be ORANGE damnit! ret="\x01H\x01R"; break; case 8: ret="\x01H\x01Y"; break; case 9: ret="\x01H\x01G"; break; case 10: ret="\x01N\x01C"; break; case 11: ret="\x01H\x01C"; break; case 12: ret="\x01H\x01B"; break; case 13: ret="\x01H\x01M"; break; case 14: ret="\x01H\x01K"; break; case 15: ret="\x01N\x01W"; break; default: ret=""; } switch(p2) { case 0: ret=ret+"\x017"; break; case 1: ret=ret+"\x010"; break; case 2: ret=ret+"\x014"; break; case 3: ret=ret+"\x012"; break; case 4: ret=ret+"\x011"; break; case 5: ret=ret+"\x013"; break; case 6: ret=ret+"\x015"; break; case 7: // This is supposed to be ORANGE damnit! ret=ret+"\x016"; break; } return ret+ending; } ); if(line.length > 78) { // Word Wrap... for(var j=0;j<=line.length;j++) { switch(line.charAt(j)) { case "\x01": last_colour=last_colour+line.substr(j,2); j+=1; break; case " ": lastspace=j; default: if(i>=78) { if(lastspace==linestart-1) { lastspace=j; } console.print(prev_colour+line.substring(linestart,lastspace+1)); prev_colour=last_colour; console.crlf(); this.line.shift(); this.line.push(prev_colour+line.substring(linestart,lastspace+1)); linestart=lastspace+1; j=lastspace; i=0; } i+=1; } } } if(i<=78) { console.print(prev_colour+line.substr(linestart)); this.line.shift(); this.line.push(prev_colour+line.substr(linestart)); console.crlf(); } if(!connected) { cname="No channel"; topic="Not in channel"; } else if (channels==undefined) { cname="No channel"; topic="Not in channel"; } else if (channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line();} |
console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); | function Screen_print_line(line) { var i=0; var lastspace=0; var linestart=0; var prev_colour=""; var last_colour=""; var cname=""; var topic=""; console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows-1); console.clearline(); console.ansi_gotoxy(1,console.screen_rows); console.clearline(); console.ansi_gotoxy(1,console.screen_rows-1); // Remove bold line=line.replace(/\x02/g,""); // mIRC colour codes line=line.replace(/\x03([0-9\,]{1,5})/g, function(str,p1,offset,s) { var p2; var ending=null; var codes=[null]; var ret=null; ending=""; codes=p1.split(","); p1=codes[0]; codes.shift(); p2=codes[0]; codes.shift(); ending=","+codes.join(","); if(p2==undefined) { p2="-1"; } if(p2.length>2) { ending=p2.substr(2)+ending; p2=p2.substr(0,2); } if(p1.length>2) { ending=p1.substr(2)+ending; p1=p1.substr(0,2); } p1=Number(p1); p2=Number(p2); p1=p1 % 16; if(p2>=0 && p2<=99) { p2=Number(p2) % 8; } else { p2=8; } switch(p1) { case 0: ret="\x01H\x01W"; break; case 1: ret="\x01N\x01K"; break; case 2: ret="\x01N\x01B"; break; case 3: ret="\x01N\x01G"; break; case 4: ret="\x01N\x01R"; break; case 5: ret="\x01N\x01Y"; break; case 6: ret="\x01H\x01M"; break; case 7: // This is supposed to be ORANGE damnit! ret="\x01H\x01R"; break; case 8: ret="\x01H\x01Y"; break; case 9: ret="\x01H\x01G"; break; case 10: ret="\x01N\x01C"; break; case 11: ret="\x01H\x01C"; break; case 12: ret="\x01H\x01B"; break; case 13: ret="\x01H\x01M"; break; case 14: ret="\x01H\x01K"; break; case 15: ret="\x01N\x01W"; break; default: ret=""; } switch(p2) { case 0: ret=ret+"\x017"; break; case 1: ret=ret+"\x010"; break; case 2: ret=ret+"\x014"; break; case 3: ret=ret+"\x012"; break; case 4: ret=ret+"\x011"; break; case 5: ret=ret+"\x013"; break; case 6: ret=ret+"\x015"; break; case 7: // This is supposed to be ORANGE damnit! ret=ret+"\x016"; break; } return ret+ending; } ); if(line.length > 78) { // Word Wrap... for(var j=0;j<=line.length;j++) { switch(line.charAt(j)) { case "\x01": last_colour=last_colour+line.substr(j,2); j+=1; break; case " ": lastspace=j; default: if(i>=78) { if(lastspace==linestart-1) { lastspace=j; } console.print(prev_colour+line.substring(linestart,lastspace+1)); prev_colour=last_colour; console.crlf(); this.line.shift(); this.line.push(prev_colour+line.substring(linestart,lastspace+1)); linestart=lastspace+1; j=lastspace; i=0; } i+=1; } } } if(i<=78) { console.print(prev_colour+line.substr(linestart)); this.line.shift(); this.line.push(prev_colour+line.substr(linestart)); console.crlf(); } if(!connected) { cname="No channel"; topic="Not in channel"; } else if (channels==undefined) { cname="No channel"; topic="Not in channel"; } else if (channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line();} |
|
var key=console.inkey(); | var key=console.inkey(100); | function Screen_update() { while(1) { var key=console.inkey(); if(key!="") this.handle_key(key); else break; }} |
function Screen_update() { | function Screen_update(wait) { | function Screen_update() { while(1) { var key=console.inkey(100); if(key!="") this.handle_key(key); else break; }} |
var key=console.inkey(100); | var key=console.inkey(wait); | function Screen_update() { while(1) { var key=console.inkey(100); if(key!="") this.handle_key(key); else break; }} |
else { sleep(1); } | function Screen_update() { var key=console.inkey(); if(key!="") { this.handle_key(key); }} |
|
if(line_len-this.input_pos < 49) { | if(line_len-this.input_pos < 39) { | function Screen_update_input_line() { var line_pos=this.input_pos; var line_str=this.input_buffer; var line_start=0; var line_len=this.input_buffer.length; if(line_len-this.input_pos < 49) { line_start=line_len-78; } else if (this.input_pos < 49) { line_start=0; } else { line_start=this.input_pos-49; } if(line_start<0) { line_start=0; } line_pos=this.input_pos-line_start; line_str=this.input_buffer.slice(line_start,78); if(line_start>0) { line_str='+'+line_str.slice(1); } if(line_start+78 < line_len) { line_str=line_str.slice(0,77)+'+'; } console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows); console.clearline(); printf("%s",line_str); console.ansi_gotoxy(line_pos+1,console.screen_rows);} |
else if (this.input_pos < 49) { | else if (this.input_pos < 39) { | function Screen_update_input_line() { var line_pos=this.input_pos; var line_str=this.input_buffer; var line_start=0; var line_len=this.input_buffer.length; if(line_len-this.input_pos < 49) { line_start=line_len-78; } else if (this.input_pos < 49) { line_start=0; } else { line_start=this.input_pos-49; } if(line_start<0) { line_start=0; } line_pos=this.input_pos-line_start; line_str=this.input_buffer.slice(line_start,78); if(line_start>0) { line_str='+'+line_str.slice(1); } if(line_start+78 < line_len) { line_str=line_str.slice(0,77)+'+'; } console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows); console.clearline(); printf("%s",line_str); console.ansi_gotoxy(line_pos+1,console.screen_rows);} |
line_start=this.input_pos-49; | line_start=this.input_pos-39; | function Screen_update_input_line() { var line_pos=this.input_pos; var line_str=this.input_buffer; var line_start=0; var line_len=this.input_buffer.length; if(line_len-this.input_pos < 49) { line_start=line_len-78; } else if (this.input_pos < 49) { line_start=0; } else { line_start=this.input_pos-49; } if(line_start<0) { line_start=0; } line_pos=this.input_pos-line_start; line_str=this.input_buffer.slice(line_start,78); if(line_start>0) { line_str='+'+line_str.slice(1); } if(line_start+78 < line_len) { line_str=line_str.slice(0,77)+'+'; } console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows); console.clearline(); printf("%s",line_str); console.ansi_gotoxy(line_pos+1,console.screen_rows);} |
line_str=this.input_buffer.slice(line_start,78); | line_str=this.input_buffer.substr(line_start,78); | function Screen_update_input_line() { var line_pos=this.input_pos; var line_str=this.input_buffer; var line_start=0; var line_len=this.input_buffer.length; if(line_len-this.input_pos < 49) { line_start=line_len-78; } else if (this.input_pos < 49) { line_start=0; } else { line_start=this.input_pos-49; } if(line_start<0) { line_start=0; } line_pos=this.input_pos-line_start; line_str=this.input_buffer.slice(line_start,78); if(line_start>0) { line_str='+'+line_str.slice(1); } if(line_start+78 < line_len) { line_str=line_str.slice(0,77)+'+'; } console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows); console.clearline(); printf("%s",line_str); console.ansi_gotoxy(line_pos+1,console.screen_rows);} |
line_str='+'+line_str.slice(1); | line_str='+'+line_str.substr(1); | function Screen_update_input_line() { var line_pos=this.input_pos; var line_str=this.input_buffer; var line_start=0; var line_len=this.input_buffer.length; if(line_len-this.input_pos < 49) { line_start=line_len-78; } else if (this.input_pos < 49) { line_start=0; } else { line_start=this.input_pos-49; } if(line_start<0) { line_start=0; } line_pos=this.input_pos-line_start; line_str=this.input_buffer.slice(line_start,78); if(line_start>0) { line_str='+'+line_str.slice(1); } if(line_start+78 < line_len) { line_str=line_str.slice(0,77)+'+'; } console.line_counter=0; // defeat pause console.ansi_gotoxy(1,console.screen_rows); console.clearline(); printf("%s",line_str); console.ansi_gotoxy(line_pos+1,console.screen_rows);} |
console.crlf(); | function Screen_update_statline() { var cname=""; var topic=""; console.ansi_gotoxy(1,console.screen_rows-2); if(channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.topicline); console.print(this.statusline); this.update_input_line();} |
|
console.ansi_gotoxy(1,console.screen_rows-1); | console.ansi_gotoxy(1,console.screen_rows-2); | function Screen_update_statline() { var cname=""; var topic=""; console.ansi_gotoxy(1,console.screen_rows-1); if(channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line();} |
console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); | function Screen_update_statline() { var cname=""; var topic=""; console.ansi_gotoxy(1,console.screen_rows-1); if(channels.current==undefined) { cname="No channel"; topic="Not in channel"; } else { cname=channels.current.display; topic=channels.current.topic; } console.print(this.statusline); console.crlf(); console.ansi_gotoxy(1,1); console.clearline(); console.print(this.topicline); this.update_input_line();} |
|
case "includes": case "excludes": script[match[1]].push(match[2]); | case "include": case "exclude": script[match[1]+"s"].push(match[2]); | function ScriptDownloader(url) { var dm = Components.classes["@mozilla.org/download-manager;1"].getService(Components.interfaces.nsIDownloadManager) var ioservice = Components.classes["@mozilla.org/network/io-service;1"].getService(); var sourceUri = ioservice.newURI(url, null, null); var targetFile = getTempFile(); var targetUri = ioservice.newFileURI(targetFile) var persist = makeWebBrowserPersist(); var sysListener = null; var download = null; var self = this; var timerId = null; this.start = function() { try { dm.addDownload(0, sourceUri, targetUri, parseScriptName(sourceUri), null, null, null, persist) dm.open(window._content, targetFile.path) download = dm.getDownload(targetFile.path); download.persist = persist; persist.saveURI(sourceUri, null, null, null, null, targetFile); // this seems like a huge hack, but it was actually the most reliable // way I could find to determine when downloading is complete timerId = window.setInterval(checkLoad, 200); } catch (e) { handleErrors(e); } } function checkLoad() { // if the download is complete, stop. if (download.percentComplete == 100) { window.clearInterval(timerId); handleLoad(); } // if not complete yet, double-check that somebody hasn't cancelled it else if (dm.getDownload(targetFile.path) == null) { // the download is no longer active window.clearInterval(timerId); return; } // otherwise, do nothing. downloading continues. } function handleLoad() { closeDownloadManager(); // validate that we downloaded ok if (!targetFile.exists() || targetFile.fileSize == 0) { alert("The file does not exist or was removed."); return; } // initialize a new script object var script = new Script(); script.id = targetFile.leafName; script.enabled = true; script.includes = []; script.excludes = []; // crack open the file so we can look for metadata in the comments var fileStream = Components.classes["@mozilla.org/network/file-input-stream;1"] .createInstance(Components.interfaces.nsIFileInputStream); fileStream.init(targetFile, 1, 0, false); // read one line at a time looking for start meta delimiter or EOF var lineStream = fileStream.QueryInterface(Components.interfaces.nsILineInputStream); var result = {}; var foundMeta = false; while (lineStream.readLine(result)) { if (result.value.indexOf("// ==UserScript==") == 0) { foundMeta = true; break; } } // gather up meta lines if (foundMeta) { while (lineStream.readLine(result)) { if (result.value.indexOf("// ==/UserScript==") == 0) { break; } var match = result.value.match(/\/\/ \@(\S+)\s+([^\n]+)/); if (match != null) { switch (match[1]) { case "name": case "namespace": case "description": script[match[1]] = match[2]; break; case "includes": case "excludes": script[match[1]].push(match[2]); break; } } } } fileStream.close(); // if no meta info, default to reasonable values if (script.name == null) { script.name = parseScriptName(sourceUri); } if (script.namespace == null) { script.namespace = sourceUri.host; } if (script.includes.length == 0) { script.includes.push("*"); } // open install dialog var result = {}; window.openDialog("chrome://greasemonkey/content/install.xul", "manager", "resizable,centerscreen,modal", script, targetFile, result); closeDownloadManager(); if (result.value) { alert("Success! Refresh page to see changes."); } } function handleErrors(e) { //todo: need to handle this somehow. perhaps nsIUriChecker? //if (e.name == "NS_ERROR_FILE_NOT_FOUND") { // alert("User script could not be found. Please check the name and try again."); // window.status = defaultStatus; //} //else { alert("Could not download user script\n\n" + e.toString()); //} } function closeDownloadManager() { var wm = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator); var en = wm.getEnumerator(""); var n = 0; var dlm = null; while (en.hasMoreElements()) { var w = en.getNext(); if (w.location.href == "chrome://mozapps/content/downloads/downloads.xul") { dlm = w; break; } } if (dlm != null) { dlm.close(); } }} |
this.draw(Draggables._lastPointer); | Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); | scroll: function() { var current = new Date(); var delta = current - this.lastScrolled; this.lastScrolled = current; if(this.options.scroll == window) { with (this._getWindowScroll(this.options.scroll)) { if (this.scrollSpeed[0] || this.scrollSpeed[1]) { var d = delta / 1000; this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); } } } else { this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; } Position.prepare(); Droppables.show(Draggables._lastPointer, this.element); Draggables.notify('onDrag', this); this.draw(Draggables._lastPointer); if(this.options.change) this.options.change(this); }, |
Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); | if (this._isScrollChild) { Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); } | scroll: function() { var current = new Date(); var delta = current - this.lastScrolled; this.lastScrolled = current; if(this.options.scroll == window) { with (this._getWindowScroll(this.options.scroll)) { if (this.scrollSpeed[0] || this.scrollSpeed[1]) { var d = delta / 1000; this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); } } } else { this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; } Position.prepare(); Droppables.show(Draggables._lastPointer, this.element); Draggables.notify('onDrag', this); Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); if(this.options.change) this.options.change(this); }, |
for(i=0; i<lines_on_screen; i++) { redraw_line(i+topline); } | for(i=0; i<lines_on_screen; i++) draw_line(i+topline); | function scroll(count){ var i; topline+=count; if(topline+lines_on_screen>=line.length) topline=line.length-lines_on_screen; if(topline<0) topline=0; for(i=0; i<lines_on_screen; i++) { redraw_line(i+topline); }} |
console.gotoxy(1,edit_top+i); | function scroll(count){ var i; topline+=count; if(topline+lines_on_screen>=line.length) topline=line.length-lines_on_screen; if(topline<0) topline=0; for(i=0; i<lines_on_screen; i++) { console.gotoxy(1,edit_top+i); if(line[i+topline]!=undefined) line[i+topline].draw(); else { console.attributes=7; console.cleartoeol(); } }} |
|
line[i+topline].draw(); | line[i+topline].draw(edit_top+i); | function scroll(count){ var i; topline+=count; if(topline+lines_on_screen>=line.length) topline=line.length-lines_on_screen; if(topline<0) topline=0; for(i=0; i<lines_on_screen; i++) { console.gotoxy(1,edit_top+i); if(line[i+topline]!=undefined) line[i+topline].draw(); else { console.attributes=7; console.cleartoeol(); } }} |
if ((e.target.tagName == "IMG") || (linuxImage != null) || (currentImage != null)) | if ((e.target.tagName.toLowerCase() == "img") || (linuxImage != null) || (currentImage != null)) | function ScrollImage(e){ var imageToScroll; // Scroll wheel invoked while right button down, zoom target image if ((window._content.document.location == currentURL) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { switch (nsIPrefBranchObj.getIntPref("scrollZoomMode")) { // Mixed Mode (default) case 0: if ((e.target.tagName == "IMG") || (linuxImage != null) || (currentImage != null)) { if (linuxImage != null) { currentImage = linuxImage; } else if (e.target.tagName == "IMG") { currentImage = e.target; } } else { currentImage = null; } imageToScroll = currentImage; break; // Only Scroll when mouse over image mode case 1: if ((e.target.tagName == "IMG") || (linuxImage != null)) { if (linuxImage != null) { imageToScroll = linuxImage; } else if (e.target.tagName == "IMG") { imageToScroll = e.target; } } else { imageToScroll = null; } break; // Only Scroll the image that was right mouse clicked mode case 2: if (currentImage != null) { imageToScroll = currentImage; } else { imageToScroll = null; } break; default: imageToScroll = null; break; } if (imageToScroll != null) { e.preventDefault(); e.stopPropagation(); haveZoomed = true; var oizImage = new izImage(imageToScroll); if (((e.detail < 0) && !nsIPrefBranchObj.getBoolPref("reversescrollzoom")) || ((e.detail > 0) && nsIPrefBranchObj.getBoolPref("reversescrollzoom"))) var zoomFactor = 1/(1+(nsIPrefBranchObj.getIntPref("scrollvalue")/100)); else var zoomFactor = 1+(nsIPrefBranchObj.getIntPref("scrollvalue")/100); oizImage.zoom(zoomFactor); reportStatus(oizImage); } } else { cancelScrollZoom(); }} |
} else if (e.target.tagName == "IMG") { | } else if (e.target.tagName.toLowerCase() == "img") { | function ScrollImage(e){ var imageToScroll; // Scroll wheel invoked while right button down, zoom target image if ((window._content.document.location == currentURL) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { switch (nsIPrefBranchObj.getIntPref("scrollZoomMode")) { // Mixed Mode (default) case 0: if ((e.target.tagName == "IMG") || (linuxImage != null) || (currentImage != null)) { if (linuxImage != null) { currentImage = linuxImage; } else if (e.target.tagName == "IMG") { currentImage = e.target; } } else { currentImage = null; } imageToScroll = currentImage; break; // Only Scroll when mouse over image mode case 1: if ((e.target.tagName == "IMG") || (linuxImage != null)) { if (linuxImage != null) { imageToScroll = linuxImage; } else if (e.target.tagName == "IMG") { imageToScroll = e.target; } } else { imageToScroll = null; } break; // Only Scroll the image that was right mouse clicked mode case 2: if (currentImage != null) { imageToScroll = currentImage; } else { imageToScroll = null; } break; default: imageToScroll = null; break; } if (imageToScroll != null) { e.preventDefault(); e.stopPropagation(); haveZoomed = true; var oizImage = new izImage(imageToScroll); if (((e.detail < 0) && !nsIPrefBranchObj.getBoolPref("reversescrollzoom")) || ((e.detail > 0) && nsIPrefBranchObj.getBoolPref("reversescrollzoom"))) var zoomFactor = 1/(1+(nsIPrefBranchObj.getIntPref("scrollvalue")/100)); else var zoomFactor = 1+(nsIPrefBranchObj.getIntPref("scrollvalue")/100); oizImage.zoom(zoomFactor); reportStatus(oizImage); } } else { cancelScrollZoom(); }} |
if ((e.target.tagName == "IMG") || (linuxImage != null)) | if ((e.target.tagName.toLowerCase() == "img") || (linuxImage != null)) | function ScrollImage(e){ var imageToScroll; // Scroll wheel invoked while right button down, zoom target image if ((window._content.document.location == currentURL) && (nsIPrefBranchObj.getBoolPref("usescroll"))) { switch (nsIPrefBranchObj.getIntPref("scrollZoomMode")) { // Mixed Mode (default) case 0: if ((e.target.tagName == "IMG") || (linuxImage != null) || (currentImage != null)) { if (linuxImage != null) { currentImage = linuxImage; } else if (e.target.tagName == "IMG") { currentImage = e.target; } } else { currentImage = null; } imageToScroll = currentImage; break; // Only Scroll when mouse over image mode case 1: if ((e.target.tagName == "IMG") || (linuxImage != null)) { if (linuxImage != null) { imageToScroll = linuxImage; } else if (e.target.tagName == "IMG") { imageToScroll = e.target; } } else { imageToScroll = null; } break; // Only Scroll the image that was right mouse clicked mode case 2: if (currentImage != null) { imageToScroll = currentImage; } else { imageToScroll = null; } break; default: imageToScroll = null; break; } if (imageToScroll != null) { e.preventDefault(); e.stopPropagation(); haveZoomed = true; var oizImage = new izImage(imageToScroll); if (((e.detail < 0) && !nsIPrefBranchObj.getBoolPref("reversescrollzoom")) || ((e.detail > 0) && nsIPrefBranchObj.getBoolPref("reversescrollzoom"))) var zoomFactor = 1/(1+(nsIPrefBranchObj.getIntPref("scrollvalue")/100)); else var zoomFactor = 1+(nsIPrefBranchObj.getIntPref("scrollvalue")/100); oizImage.zoom(zoomFactor); reportStatus(oizImage); } } else { cancelScrollZoom(); }} |
var inst = this.instance; var pos, doc, scrollX, scrollY, height; pos = tinyMCE.getAbsPosition(node); doc = inst.getDoc(); scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft; scrollY = doc.body.scrollTop + doc.documentElement.scrollTop; height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight; | var inst = this.instance, w = inst.getWin(), vp = inst.getViewPort(), pos = tinyMCE.getAbsPosition(node), cvp, p, cwin; | scrollToNode : function(node) { var inst = this.instance; var pos, doc, scrollX, scrollY, height; // Scroll to node position pos = tinyMCE.getAbsPosition(node); doc = inst.getDoc(); scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft; scrollY = doc.body.scrollTop + doc.documentElement.scrollTop; height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight; // Only scroll if out of visible area if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height))) inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); }, |
if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height))) inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); | if (pos.absLeft < vp.left || pos.absLeft > vp.left + vp.width || pos.absTop < vp.top || pos.absTop > vp.top + (vp.height-25)) w.scrollTo(pos.absLeft, pos.absTop - vp.height + 25); if (inst.settings.auto_resize) { cwin = inst.getContainerWin(); cvp = tinyMCE.getViewPort(cwin); p = this.getAbsPosition(node); if (p.absLeft < cvp.left || p.absLeft > cvp.left + cvp.width || p.absTop < cvp.top || p.absTop > cvp.top + cvp.height) cwin.scrollTo(p.absLeft, p.absTop - cvp.height + 25); } | scrollToNode : function(node) { var inst = this.instance; var pos, doc, scrollX, scrollY, height; // Scroll to node position pos = tinyMCE.getAbsPosition(node); doc = inst.getDoc(); scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft; scrollY = doc.body.scrollTop + doc.documentElement.scrollTop; height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight; // Only scroll if out of visible area if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height))) inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); }, |
function scwEventTrigger(e) {if (!e) e = event; return e.target||e.srcElement; } | function scwEventTrigger(scwEvt) { if (!scwEvt) scwEvt = event; return scwEvt.target || scwEvt.srcElement; } | function scwEventTrigger(e) {if (!e) e = event; return e.target||e.srcElement; } |
{document.getElementById('scw').style.visibility='hidden'; if (document.getElementById('scwIframe')) {document.getElementById('scwIframe').style.visibility='hidden';} | { scwID('scw').style.visibility = 'hidden'; if (scwID('scwIframe')) { scwID('scwIframe').style.visibility = 'hidden'; } | function scwHide() {document.getElementById('scw').style.visibility='hidden'; if (document.getElementById('scwIframe')) {document.getElementById('scwIframe').style.visibility='hidden';} if (typeof scwNextAction!='undefined' && scwNextAction!=null) {scwNextActionReturn = scwNextAction(); // Explicit null set to prevent closure causing memory leak scwNextAction = null; } } |
{scwTargetEle.value = scwOutputDate.scwFormat(scwDateOutputFormat); scwHide(); } | { if (typeof scwTargetEle.value == 'undefined') { scwTriggerEle.scwTextNode. replaceData(0, scwTriggerEle.scwLength, scwOutputDate.scwFormat(scwDateOutputFormat)); } else { scwTargetEle.value = scwOutputDate.scwFormat(scwDateOutputFormat); } scwHide(); } | function scwSetOutput(scwOutputDate) {scwTargetEle.value = scwOutputDate.scwFormat(scwDateOutputFormat); scwHide(); } |
q = refinements[ref].getElementsByTagName('query')[0] q = GXml.value(q) d = refinements[ref].getElementsByTagName('description')[0] d = GXml.value(d) | q = GXml.value(refinements[ref].getElementsByTagName('query')[0]) d = GXml.value(refinements[ref].getElementsByTagName('description')[0]) | function search(s) { document.getElementById('Submit1').value = 'Searching...'; var r = GXmlHttp.create(); r.open("GET", "/lookup.php?output=xml&q=" + s, true); r.onreadystatechange = function(){ if (r.readyState == 4) { document.getElementById('Submit1').value = 'Search'; x = r.responseXML c = x.getElementsByTagName('center')[0] s = x.getElementsByTagName('span')[0] if (c && s) { p = GPoint.fromLatLngXml(c) s = GSize.fromLatLngXml(s) z = map.spec.getLowestZoomLevel(p, s, map.viewSize) map.centerAndZoom(p, z) document.getElementById('search_results').style.display = 'none' return 1; } refinements = x.getElementsByTagName('refinement'); if (refinements.length) { var out = '<p>More than one match:</p><ul>' for (ref=0; ref<refinements.length; ref++) { q = refinements[ref].getElementsByTagName('query')[0] q = GXml.value(q) d = refinements[ref].getElementsByTagName('description')[0] d = GXml.value(d) out += '<li><a href="#needsJS" onclick=\'window.search("' + q + '"); return false;\'>' + d + '</a>' } out += '</ul>' d = document.getElementById('search_results') d.innerHTML = out d.style.display = 'block' return 1; } error = x.getElementsByTagName('error')[0] if (error) { d = document.getElementById('search_results') d.innerHTML = GXml.value(error) d.style.display = 'block' } } } r.send(null);}; |
for (nb=0;nb<NickHistory.length;nb++) { if (NickHistory[nb] && (bufnick.toUpperCase() == NickHistory[nb].oldnick.toUpperCase())) { | for (nb=NickHistory.length-1;nb>-1;nb--) { if (bufnick.toUpperCase() == NickHistory[nb].oldnick.toUpperCase()) { | function search_nickbuf(bufnick) { for (nb=0;nb<NickHistory.length;nb++) { if (NickHistory[nb] && (bufnick.toUpperCase() == NickHistory[nb].oldnick.toUpperCase())) { if (!Users[NickHistory[nb].newnick.toUpperCase()]) return search_nickbuf(NickHistory[nb].newnick); else return Users[NickHistory[nb].newnick.toUpperCase()]; } } return 0;} |
return search_nickbuf(NickHistory[nb].newnick); | bufnick = NickHistory[nb].newnick; | function search_nickbuf(bufnick) { for (nb=0;nb<NickHistory.length;nb++) { if (NickHistory[nb] && (bufnick.toUpperCase() == NickHistory[nb].oldnick.toUpperCase())) { if (!Users[NickHistory[nb].newnick.toUpperCase()]) return search_nickbuf(NickHistory[nb].newnick); else return Users[NickHistory[nb].newnick.toUpperCase()]; } } return 0;} |
return NickHistory[nb].newnick; | return Users[NickHistory[nb].newnick.toUpperCase()]; | function search_nickbuf(bufnick) { for (nb=0;nb<NickHistory.length;nb++) { if (NickHistory[nb] && (bufnick.toUpperCase() == NickHistory[nb].oldnick.toUpperCase())) { if (!Users[NickHistory[nb].newnick.toUpperCase()]) return search_nickbuf(NickHistory[nb].newnick); else return NickHistory[nb].newnick; } } return 0;} |
for (nb=0;nb<nick_buffer;nb++) { | for (nb=0;nb<NickHistory.length;nb++) { | function search_nickbuf(bufnick) { for (nb=0;nb<nick_buffer;nb++) { if (NickHistory[nb] && (bufnick.toUpperCase() == NickHistory[nb].oldnick.toUpperCase())) { if (!searchbynick(NickHistory[nb].newnick)) return search_nickbuf(NickHistory[nb].newnick); else return NickHistory[nb].newnick; } } return 0;} |
Client=Clients[thisClient]; if ((nick.toUpperCase() == Client.nick.toUpperCase()) && Client.conntype && !Client.server) | var Client=Clients[thisClient]; if (Client && nick.toUpperCase() == Client.nick.toUpperCase() && Client.conntype && !Client.server) | function searchbynick(nick) { if (!nick) return 0; for(thisClient in Clients) { Client=Clients[thisClient]; if ((nick.toUpperCase() == Client.nick.toUpperCase()) && Client.conntype && !Client.server) return Client; // success! } return 0; // failure} |
if (!nick) return 0; | function searchbynick(nick) { for(thisClient in Clients) { Client=Clients[thisClient]; if ((nick.toUpperCase() == Client.nick.toUpperCase()) && Client.conntype && !Client.server) return Client; // success! } return 0; // failure} |
|
function searchbyserver(server_name,ignore_wildcards) { if (!server_name) | function searchbyserver(servnick) { if (!servnick) | function searchbyserver(server_name,ignore_wildcards) { if (!server_name) return 0; if ((ignore_wildcards && (servername.toUpperCase() == server_name.toUpperCase()) ) || (!ignore_wildcards && IRC_match(servername,server_name)) ) return -1; // the server passed to us is our own. for(thisServer in Servers) { var Server=Servers[thisServer]; if ((ignore_wildcards && (Server.nick.toUpperCase() == server_name.toUpperCase())) || (!ignore_wildcards && IRC_match(Server.nick,server_name) ) ) return Server; } // No wildcards implies not doing searches on nicks, either. if (ignore_wildcards) return 0; // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Users) { var Nick=Users[thisNick]; if (IRC_match(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
if ((ignore_wildcards && (servername.toUpperCase() == server_name.toUpperCase()) ) || (!ignore_wildcards && IRC_match(servername,server_name)) ) return -1; for(thisServer in Servers) { var Server=Servers[thisServer]; if ((ignore_wildcards && (Server.nick.toUpperCase() == server_name.toUpperCase())) || (!ignore_wildcards && IRC_match(Server.nick,server_name) ) ) return Server; } if (ignore_wildcards) return 0; for(thisNick in Users) { var Nick=Users[thisNick]; if (IRC_match(Nick.nick,server_name)) return searchbyserver(Nick.servername); | var server_try = search_server_only(servnick); if (server_try) { return server_try; } else { for(thisNick in Users) { var Nick=Users[thisNick]; if (IRC_match(Nick.nick,servnick)) return search_server_only(Nick.servername); } | function searchbyserver(server_name,ignore_wildcards) { if (!server_name) return 0; if ((ignore_wildcards && (servername.toUpperCase() == server_name.toUpperCase()) ) || (!ignore_wildcards && IRC_match(servername,server_name)) ) return -1; // the server passed to us is our own. for(thisServer in Servers) { var Server=Servers[thisServer]; if ((ignore_wildcards && (Server.nick.toUpperCase() == server_name.toUpperCase())) || (!ignore_wildcards && IRC_match(Server.nick,server_name) ) ) return Server; } // No wildcards implies not doing searches on nicks, either. if (ignore_wildcards) return 0; // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Users) { var Nick=Users[thisNick]; if (IRC_match(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
log("ignore wildcards? " + ignore_wildcards); | function searchbyserver(server_name,ignore_wildcards) { if (!server_name) return 0; log("ignore wildcards? " + ignore_wildcards); if ((ignore_wildcards && (servername.toUpperCase() == server_name.toUpperCase()) ) || (!ignore_wildcards && match_irc_mask(servername,server_name)) ) return -1; // the server passed to us is our own. for(thisServer in Clients) { var Server=Clients[thisServer]; if ((ignore_wildcards && (Server.conntype == TYPE_SERVER) && (Server.nick.toUpperCase() == server_name.toUpperCase())) || (!ignore_wildcards &&(Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) ) return Server; } // No wildcards implies not doing searches on nicks, either. if (ignore_wildcards) return 0; // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Clients) { var Nick=Clients[thisNick]; if (!Nick.server && match_irc_mask(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
|
function searchbyserver(server_name) { | function searchbyserver(server_name,ignore_wildcards) { | function searchbyserver(server_name) { if (!server_name) return 0; if (match_irc_mask(servername,server_name)) return -1; // the server passed to us is our own. for(thisServer in Clients) { Server=Clients[thisServer]; if ( (Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) return Server; } // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Clients) { Nick=Clients[thisNick]; if (!Nick.server && match_irc_mask(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
if (match_irc_mask(servername,server_name)) | log("ignore wildcards? " + ignore_wildcards); if ((ignore_wildcards && (servername.toUpperCase() == server_name.toUpperCase()) ) || (!ignore_wildcards && match_irc_mask(servername,server_name)) ) | function searchbyserver(server_name) { if (!server_name) return 0; if (match_irc_mask(servername,server_name)) return -1; // the server passed to us is our own. for(thisServer in Clients) { Server=Clients[thisServer]; if ( (Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) return Server; } // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Clients) { Nick=Clients[thisNick]; if (!Nick.server && match_irc_mask(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
Server=Clients[thisServer]; if ( (Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) | var Server=Clients[thisServer]; if ((ignore_wildcards && (Server.conntype == TYPE_SERVER) && (Server.nick.toUpperCase() == server_name.toUpperCase())) || (!ignore_wildcards &&(Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) ) | function searchbyserver(server_name) { if (!server_name) return 0; if (match_irc_mask(servername,server_name)) return -1; // the server passed to us is our own. for(thisServer in Clients) { Server=Clients[thisServer]; if ( (Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) return Server; } // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Clients) { Nick=Clients[thisNick]; if (!Nick.server && match_irc_mask(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
Nick=Clients[thisNick]; | var Nick=Clients[thisNick]; | function searchbyserver(server_name) { if (!server_name) return 0; if (match_irc_mask(servername,server_name)) return -1; // the server passed to us is our own. for(thisServer in Clients) { Server=Clients[thisServer]; if ( (Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) return Server; } // if we've had no success so far, try nicknames and glean a server // from there. for(thisNick in Clients) { Nick=Clients[thisNick]; if (!Nick.server && match_irc_mask(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; // looks like we failed after all that hard work :(} |
if ((server_name.toUpperCase() == Server.nick.toUpperCase()) && (Server.conntype == TYPE_SERVER) ) | if ( (Server.conntype == TYPE_SERVER) && match_irc_mask(Server.nick,server_name) ) | function searchbyserver(server_name) { for(thisServer in Clients) { Server=Clients[thisServer]; if ((server_name.toUpperCase() == Server.nick.toUpperCase()) && (Server.conntype == TYPE_SERVER) ) return Server; } return 0;} |
return 0; | for(thisNick in Clients) { Nick=Clients[thisNick]; if (!Nick.server && match_irc_mask(Nick.nick,server_name)) return searchbyserver(Nick.servername); } return 0; | function searchbyserver(server_name) { for(thisServer in Clients) { Server=Clients[thisServer]; if ((server_name.toUpperCase() == Server.nick.toUpperCase()) && (Server.conntype == TYPE_SERVER) ) return Server; } return 0;} |
return [element.name, element.options[index].value]; | return [element.name, (index >= 0) ? element.options[index].value : '']; | select: function(element) { var index = element.selectedIndex; return [element.name, element.options[index].value]; } |
Element.addClassName(this.trElement, "selected"); | addClassName(this.trElement, "selected"); | select: function() { Element.addClassName(this.trElement, "selected"); safeScrollIntoView(this.trElement); }, |
var value = ''; if (element.type == 'select-one') { var index = element.selectedIndex; if (index >= 0) value = element.options[index].value || element.options[index].text; } else { value = new Array(); for (var i = 0; i < element.length; i++) { var opt = element.options[i]; if (opt.selected) value.push(opt.value || opt.text); } } return [element.name, value]; } | return Form.Element.Serializers[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); }, | select: function(element) { var value = ''; if (element.type == 'select-one') { var index = element.selectedIndex; if (index >= 0) value = element.options[index].value || element.options[index].text; } else { value = new Array(); for (var i = 0; i < element.length; i++) { var opt = element.options[i]; if (opt.selected) value.push(opt.value || opt.text); } } return [element.name, value]; } |
this.element.value = value; | this.updateElement(value); | select_entry: function() { this.active = false; value = Element.collectTextNodesIgnoreClass(this.get_current_entry(), 'informal').unescapeHTML(); this.element.value = value; this.element.focus(); } |
} | }, | select_entry: function() { this.active = false; value = Element.collectTextNodesIgnoreClass(this.get_current_entry(), 'informal').unescapeHTML(); this.element.value = value; this.element.focus(); } |
this.hide(); | select_entry: function() { this.hide(); this.active = false; value = Element.collectTextNodesIgnoreClass(this.get_current_entry(), 'informal').unescapeHTML(); this.element.value = value; this.element.focus(); } |
|
function SelectAll(prefix) { | function SelectAll(prefix, checkbox_state) { | function SelectAll(prefix) { for (var i = 0; i < document.chk.elements.length; i++) { if ((document.chk.elements[i].name.substr(0, prefix.length) == prefix) && (document.chk.elements[i].style.visibility != 'hidden')) { document.chk.elements[i].checked = !(document.chk.elements[i].checked); } }} |
document.chk.elements[i].checked = !(document.chk.elements[i].checked); | document.chk.elements[i].checked = checkbox_state; | function SelectAll(prefix) { for (var i = 0; i < document.chk.elements.length; i++) { if ((document.chk.elements[i].name.substr(0, prefix.length) == prefix) && (document.chk.elements[i].style.visibility != 'hidden')) { document.chk.elements[i].checked = !(document.chk.elements[i].checked); } }} |
if (sourceList.options[i] != null) | if ((sourceList.options[i] != null) && (sourceList.options[i].value != "")) | function selectAll(sourceList){ for(var i = 0; i < sourceList.options.length; i++) { if (sourceList.options[i] != null) sourceList.options[i].selected = true; } return true;} |
NewWindow("cgi-bin/selectAudio?requester=webif", "audio", "200", "100", "no"); | NewWindow("cgi-bin/selectAudio?requester=webif", "audio", "250", "130", "no"); | function selectAudio(){ NewWindow("cgi-bin/selectAudio?requester=webif", "audio", "200", "100", "no");} |
this.setTextBox("commandTarget", command.target, false); this.setTextBox("commandValue", command.value, false); | this.setTextBox("commandTarget", this.encodeText(command.target), false); this.setTextBox("commandValue", this.encodeText(command.value), false); | selectCommand: function() { if (this.tree.currentIndex >= 0) { var command = this.getCommand(this.tree.currentIndex); this.currentCommand = command; if (command.type == 'command') { this.setTextBox("commandAction", command.command, false); this.setTextBox("commandTarget", command.target, false); this.setTextBox("commandValue", command.value, false); } else if (command.type == 'comment') { this.setTextBox("commandAction", command.comment, false); this.setTextBox("commandTarget", '', true); this.setTextBox("commandValue", '', true); } this.selectRecordIndex(this.tree.currentIndex); } else { this.setTextBox("commandAction", '', true); this.setTextBox("commandTarget", '', true); this.setTextBox("commandValue", '', true); this.currentCommand = null; } window.updateCommands('select'); }, |
this.element.focus(); | selectEntry: function() { this.active = false; this.updateElement(this.getCurrentEntry()); this.element.focus(); }, |
|
saveSelectedFormat(); | function selectFormatFromMenu() { var e = document.getElementById("popup_formats"); var i; for (i = e.childNodes.length - 1; i >= 0; i--) { var checked = e.childNodes[i].getAttribute("checked"); if (checked == 'true') { this.testManager.selectFormat(e.childNodes[i].getAttribute("value")); break; } }} |
|
function selectImage(Image) | function selectImage(image) | function selectImage(Image){ document.location = "/cgi-bin/setConfigMultiBoot?image="+image; } |
document.location = "/cgi-bin/setConfigMultiBoot?image="+image; | document.location = "/cgi-bin/setConfigMultiBoot?image="+image; setTimeout("reload()", 500); | function selectImage(Image){ document.location = "/cgi-bin/setConfigMultiBoot?image="+image; } |
var value = new Array(); | var value = []; | selectMany: function(element) { var value = new Array(); for (var i = 0; i < element.length; i++) { var opt = element.options[i]; if (opt.selected) { var optValue = opt.value; if (!optValue && !('value' in opt)) optValue = opt.text; value.push(optValue); } } return [element.name, value]; } |
if (opt.selected) { var optValue = opt.value; if (!optValue && !('value' in opt)) optValue = opt.text; value.push(optValue); } | if (opt.selected) value.push(opt.value || opt.text); | selectMany: function(element) { var value = new Array(); for (var i = 0; i < element.length; i++) { var opt = element.options[i]; if (opt.selected) { var optValue = opt.value; if (!optValue && !('value' in opt)) optValue = opt.text; value.push(optValue); } } return [element.name, value]; } |
if (tinyMCE.isMSIE) { rng = inst.getBody().createTextRange(); | if (inst.settings.auto_resize) inst.resizeToContent(); if (tinyMCE.isRealIE) { rng = inst.getDoc().body.createTextRange(); | selectNode : function(node, collapse, select_text_node, to_start) { var inst = this.instance, sel, rng, nodes; if (!node) return; if (typeof(collapse) == "undefined") collapse = true; if (typeof(select_text_node) == "undefined") select_text_node = false; if (typeof(to_start) == "undefined") to_start = true; if (tinyMCE.isMSIE) { rng = inst.getBody().createTextRange(); try { rng.moveToElementText(node); if (collapse) rng.collapse(to_start); rng.select(); } catch (e) { // Throws illigal agrument in MSIE some times } } else { sel = this.getSel(); if (!sel) return; if (tinyMCE.isSafari) { sel.setBaseAndExtent(node, 0, node, node.innerText.length); if (collapse) { if (to_start) sel.collapseToStart(); else sel.collapseToEnd(); } this.scrollToNode(node); return; } rng = inst.getDoc().createRange(); if (select_text_node) { // Find first textnode in tree nodes = tinyMCE.getNodeTree(node, new Array(), 3); if (nodes.length > 0) rng.selectNodeContents(nodes[0]); else rng.selectNodeContents(node); } else rng.selectNode(node); if (collapse) { // Special treatment of textnode collapse if (!to_start && node.nodeType == 3) { rng.setStart(node, node.nodeValue.length); rng.setEnd(node, node.nodeValue.length); } else rng.collapse(to_start); } sel.removeAllRanges(); sel.addRange(rng); } this.scrollToNode(node); // Set selected element tinyMCE.selectedElement = null; if (node.nodeType == 1) tinyMCE.selectedElement = node; }, |
value = opt.value; if (!value && !('value' in opt)) value = opt.text; | value = opt.value || opt.text; | selectOne: function(element) { var value = '', opt, index = element.selectedIndex; if (index >= 0) { opt = element.options[index]; value = opt.value; if (!value && !('value' in opt)) value = opt.text; } return [element.name, value]; }, |
var ret = new Array(); var partial = new Array(); var entry = instance.getEntry(); | var ret = []; var partial = []; var entry = instance.getToken(); | selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } |
var found_pos = instance.options.ignore_case ? | var foundPos = instance.options.ignoreCase ? | selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } |
while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { | while (foundPos != -1) { if (foundPos == 0 && elem.length != entry.length) { | selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } |
} else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); | } else if (entry.length >= instance.options.partialChars && instance.options.partialSearch && foundPos != -1) { if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" + elem.substr(foundPos, entry.length) + "</strong>" + elem.substr( foundPos + entry.length) + "</li>"); | selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } |
found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); | foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : elem.indexOf(entry, foundPos + 1); | selector: function(instance) { var ret = new Array(); // Beginning matches var partial = new Array(); // Inside matches var entry = instance.getEntry(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (found_pos != -1) { if (found_pos == 0 && elem.length != entry.length) { ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" + elem.substr(entry.length) + "</li>"); break; } else if (entry.length >= instance.options.partial_chars && instance.options.partial_search && found_pos != -1) { if (instance.options.full_search || /\s/.test(elem.substr(found_pos-1,1))) { partial.push("<li>" + elem.substr(0, found_pos) + "<strong>" + elem.substr(found_pos, entry.length) + "</strong>" + elem.substr( found_pos + entry.length) + "</li>"); break; } } found_pos = instance.options.ignore_case ? elem.toLowerCase().indexOf(entry.toLowerCase(), found_pos + 1) : elem.indexOf(entry, found_pos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) return "<ul>" + ret.join('') + "</ul>"; } |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.