}
},
createWindow : function(){
- var dock_icon, win, content, panel;
+ var win, content, panel;
panel = $$('.con_panel')[0];
- dock_icon = document.createElement("span");
- this.dock_icon = dock_icon;
+ this.dock_icon = document.createElement("span");
// dock_icon.className = "icon_active";
this.dock_icon.className = "icon_waiting";
panel.appendChild(dock_icon);
});
this.dock_icon.win = win;
// $('cons').appendChild(panel);
- content = $$('.querytemplate').first().cloneNode(true);
- content.style.display = 'block';
+ content = $$('.querytemplate').first().cloneNode(true);
win.getContent().appendChild(content);
+ $$('#'+win.getContent().id+' .content').first().update();
+ $$('#'+win.getContent().id+' .textbox').first().value="";
+ content.style.display = 'block';
// win.show();
$(dock_icon).update(win.getTitle().split(' ')[0]);
Event.observe(this.dock_icon, "mouseup", Windows.restore);
return this;
},
setTopic : function(topic) {
+ this.topic = topic;
if(topic){
this.topic=topic;
- this.win.setTitle(this.name + " - Topic: " + topic);
+ this.win.setTitle('<div class="topic" style="width:'+(parseInt(this.win.getSize()['width'])-22)+'px;"> <b>' + this.name + '</b> - Topic: ' + topic + '</div>');
}
},
+ getTopic : function() {
+ return this.topic;
+ },
setWaiting : function(mode) {
if(mode == 0) {
if(this.dock_icon.className == "dock_icon")
connection.send(data);
}
IRCConnection.getSettings = function() {
- settings='';
+
+ var obj, aliases = [], performs = [], strAliases = $$('.aliases tbody').first().innerHTML, strPerform = $$('.perform tbody').first().innerHTML;
+ settings = {};
+ if(strAliases.match(/<tr>.+<\/tr>/)){
+ for (var x=0; x<strAliases.match(/<tr>.*?<\/tr>/g).length; x++){
+ if(strAliases.match(/<tr>.*?<\/tr>/g)[x].match(/<td>(.*?)<\/td><td>(.*?)<\/td>/)){
+ obj = {};
+ obj.key = strAliases.match(/<tr>.*?<\/tr>/g)[x].match(/<td>(.*?)<\/td><td>(.*?)<\/td>/)[1];
+ obj.value = strAliases.match(/<tr>.*?<\/tr>/g)[x].match(/<td>(.*?)<\/td><td>(.*?)<\/td>/)[2];
+ }
+ aliases.push(obj);
+ }
+ }
+ settings.aliases=aliases;
+ if(strPerform.match(/<tr>.+<\/tr>/)){
+ for (var x=0; x<strPerform.match(/<tr>.*?<\/tr>/g).length; x++){
+ performs.push(strPerform.match(/<tr>.*?<\/tr>/g)[x].match(/<td>(.*?)<\/td>/)[1]);
+ }
+ }
+ settings.perform=performs;
+
new Ajax.Request('/settings', {
method:'post',
contentType:'application/json',
if(data.nma == "on") $('config')['nma'].checked = true;
if(data.nmakey != "") $('config')['nmakey'].value = data.nmakey;
if(data.nmapriority != "") $('config')['nmapriority'].value = data.nmapriority;
- settings = data;
+ data.aliases = JSON.parse(data.aliases);
+ data.perform = JSON.parse(data.perform);
+ settings = data;
+ } else {
+ settings = JSON.parse(localStorage.getItem('settings'));
+ settings.aliases = JSON.parse(settings.aliases);
+ settings.perform = JSON.parse(settings.perform);
+ }
+ if(settings.aliases){
+ var elmAliases = $$('.aliases tbody').first();
+ if(elmAliases){
+ $$('.aliases tbody').each(function(elm){
+ elm.update();
+ for(var x=0; x<settings.aliases.length; x++){
+ elm.update(elm.innerHTML + '<tr><td>' + settings.aliases[x].key + '</td><td>' + settings.aliases[x].value+ '</td></tr>\n');
+ }
+ });
+ $$('.aliases tbody tr').each(function(elm){
+ Event.observe(elm, "mousedown", function(event) {
+ $$('.aliases tbody tr').each(function(tr){tr.removeClassName('selected')});
+ var td = Event.element(event); debug(td.parentNode);
+ td.parentNode.addClassName('selected')
+ });
+ });
+ }
}
+ if(settings.perform){
+ var elmPerform = $$('.perform tbody').first();
+ if(elmPerform){
+ $$('.perform tbody').each(function(elm){
+ elm.update();
+ for(var x=0; x<settings.perform.length; x++){
+ elm.update(elm.innerHTML + '<tr><td>' + settings.perform[x] + '</td></tr>\n');
+ }
+ });
+ $$('.perform tbody tr').each(function(elm){
+ Event.observe(elm, "mousedown", function(event) {
+ $$('.perform tbody tr').each(function(tr){tr.removeClassName('selected')});
+ var td = Event.element(event); debug(td.parentNode);
+ td.parentNode.addClassName('selected')
+ });
+ });
+ }
+ }
}
- });
-
+ });
}
IRCConnection.saveSettings = function(data) {
+ var obj, aliases = [], performs = [], strAliases = $$('.aliases tbody').first().innerHTML, strPerform = $$('.perform tbody').first().innerHTML;
+ settings = {};
+ settings=data;
+ if(strAliases.match(/<tr.*>.+<\/tr>/g)){
+ for (var x=0; x<strAliases.match(/<tr.*>.+<\/tr>/gi).length; x++){
+ obj = {};
+ obj.key = strAliases.match(/<tr.*>.*?<\/tr>/g)[x].match(/<td.*>(.+)<\/td><td>(.+)<\/td>/)[1];
+ obj.value = strAliases.match(/<tr.*>.*?<\/tr>/g)[x].match(/<td.*>(.+)<\/td><td>(.+)<\/td>/)[2];
+ aliases.push(obj);
+ }
+ }
+ settings.aliases=aliases;
+ if(strPerform.match(/<tr.*>.+<\/tr>/)){
+ for (var x=0; x<strPerform.match(/<tr.*>.*?<\/tr>/g).length; x++){
+ performs.push(strPerform.match(/<tr.*>.*?<\/tr>/g)[x].match(/<td>(.*?)<\/td>/)[1]);
+ }
+ }
+ settings.perform=performs;
new Ajax.Request('/settings', {
method:'post',
contentType:'application/json',
- postBody:JSON.stringify(data),
+ postBody:JSON.stringify(settings),
asynchronous:true,
onSuccess: function (req) {
- // sendInfoResponse(req.responseText);
IRCConnection.getSettings();
}
- });
+ });
+ localStorage.setItem('settings', JSON.stringify(settings));
}
- IRCConnection.showSettings = function() {
+ IRCConnection.showSettings = function() {
IRCConnection.getSettings();
Dialog.confirm($('settings').innerHTML, {
className:"alphacube",
showEffect:Element.show,
hideEffect:Element.hide
});
+
+ $$('.aliases tbody tr').each(function(elm){
+ Event.observe(elm, "mousedown", function(event) {
+ $$('.aliases tbody tr').each(function(tr){tr.removeClassName('selected')});
+ var td = Event.element(event);
+ td.parentNode.addClassName('selected')
+ });
+
+ });
+
+ $$('.perform tbody tr').each(function(elm){
+ Event.observe(elm, "mousedown", function(event) {
+ $$('.perform tbody tr').each(function(tr){tr.removeClassName('selected')});
+ var td = Event.element(event);
+ td.parentNode.addClassName('selected')
+ });
+
+ });
+
+ $$('.set1 .alias_edit input').each(function(elm){
+ Event.observe(elm, "mouseup", function(event) {
+ var edit = Event.element(event);
+ if(edit.value=="add"){
+ Dialog.confirm($('dialog_alias').innerHTML, {
+ className:"alphacube",
+ width:250,
+ okLabel: "save",
+ cancelLabel: "cancel",
+ ok:function() {
+ $$('.aliases tbody').first().update($$('.aliases tbody').first().innerHTML + "<tr><td>" + $F('input_alias') + "</td><td>" + $F('input_cmd') +" </td></tr>\n");
+ $$('.aliases tbody tr').each(function(elm){
+ Event.observe(elm, "mousedown", function(event) {
+ $$('.aliases tbody tr').each(function(tr){tr.removeClassName('selected')});
+ var td = Event.element(event);
+ td.parentNode.addClassName('selected')
+ });
+
+ });
+ return true;
+ },
+ showEffect:Element.show,
+ hideEffect:Element.hide
+ });
+ } else if(edit.value=="del"){
+ var x=0, a;
+ $$('.aliases tbody tr').each(function(tr){
+ if(tr.className == "selected"){
+ a=x;
+ tr.remove();
+ }
+ x++;
+ });
+ $$('.aliases tbody tr')[a].addClassName('selected');
+ } else if(edit.value=="edit"){
+ Dialog.confirm($('dialog_alias').innerHTML, {
+ className:"alphacube",
+ width:250,
+ okLabel: "save",
+ cancelLabel: "cancel",
+ ok:function() {
+ $$('.aliases tbody tr').each(function(tr){
+ if(tr.className=="selected") {
+ tr.update('<td>' + $$('.form_alias input')[0].value + '</td><td>' + $$('.form_alias input')[1].value + '</td>');
+ tr.removeClassName('selected');
+ }
+ });
+ return true;
+ },
+ showEffect:Element.show,
+ hideEffect:Element.hide
+ });
+ $$('.aliases tbody tr').each(function(tr){
+ if(tr.className=="selected") {
+ $$('.form_alias input')[0].value=tr.innerHTML.match(/<td>(.*?)<\/td><td>(.*?)<\/td>/)[1];
+ $$('.form_alias input')[1].value=tr.innerHTML.match(/<td>(.*?)<\/td><td>(.*?)<\/td>/)[2];
+ }
+ });
+ }
+ });
+ });
+
+ $$('.set1 .perform_edit input').each(function(elm){
+ Event.observe(elm, "mouseup", function(event) {
+ var edit = Event.element(event);
+ if(edit.value=="add"){
+ Dialog.confirm($('dialog_perform').innerHTML, {
+ className:"alphacube",
+ width:250,
+ okLabel: "save",
+ cancelLabel: "cancel",
+ ok:function() {
+ $$('.perform tbody').first().update($$('.perform tbody').first().innerHTML + "<tr><td>" + $F('input_perform') + "</td></tr>\n");
+ $$('.perform tbody tr').each(function(elm){
+ Event.observe(elm, "mousedown", function(event) {
+ $$('.perform tbody tr').each(function(tr){tr.removeClassName('selected')});
+ var td = Event.element(event);
+ td.parentNode.addClassName('selected')
+ });
+
+ });
+ return true;
+ },
+ showEffect:Element.show,
+ hideEffect:Element.hide
+ });
+ } else if(edit.value=="del"){
+ var x=0, a;
+ $$('.perform tbody tr').each(function(tr){
+ if(tr.className == "selected"){
+ tr.remove();
+ a=x;
+ }
+ x++;
+ });
+ $$('.perform tbody tr')[a].addClassName('selected');
+ } else if(edit.value=="edit"){
+ Dialog.confirm($('dialog_perform').innerHTML, {
+ className:"alphacube",
+ width:250,
+ okLabel: "save",
+ cancelLabel: "cancel",
+ ok:function() {
+ $$('.perform tbody tr').each(function(tr){
+ if(tr.className=="selected") {
+ tr.update('<td>' + $$('.form_perform input')[0].value + '</td>');
+ tr.removeClassName('selected');
+ }
+ });
+ return true;
+ },
+ showEffect:Element.show,
+ hideEffect:Element.hide
+ });
+ $$('.perform tbody tr').each(function(tr){
+ if(tr.className=="selected") {
+ $$('.form_perform input')[0].value=tr.innerHTML.match(/<td>(.*?)<\/td>/)[1];
+ }
+ });
+ }
+ });
+ });
+
+
}
IRCConnection.create = function() {
Dialog.confirm($('login').innerHTML, {
}
IRCConnection.handleInput = function(title, data) {
- title = title.split(' ')[0];
+// title = title.split(' ')[0];
+// debug('TITLE ' + title);
+ if(getActiveChan()) title = getActiveChan().name;
+ else title = "status";
if (data.substring(0,1) == "/") {
var cmd = data.substring(1);
cmd = cmd.replace(cmd.split(' ')[0], cmd.split(' ')[0].toUpperCase());
case "PART":
if(title != 'status')
cmd = 'PART ' + title + ' :' + cmd.substring(5);
+ else
+ if(title.substring(0,1) == "#") cmd = 'PART ' + cmd.split(' ')[1] + ' :' + cmd.split(' ')[2];
+ else cmd = "";
break;
case "QUIT":
IRCConnection.quit();
objQuery.win.show();
channels.push(objQuery);
return;
+ default:
+ var cmds;
+ if(settings.aliases){
+ debug('jo aliases');
+ for (var x=0; x<settings.aliases.length;x++){
+ if(cmd.match(/^\w{0,8}/)[0] == settings.aliases[x].key.substring(1).match(/^\w{0,8}/)[0].toUpperCase()){
+ cmds = settings.aliases[x].value.split(';');
+ var string, args;
+ for (var y=0; y<cmds.length; y++){
+ args1 = cmd.replace(/^\w{0,8} /,'').replace(/\s$/, '').split(' ');
+ args2 = cmds[y].substring(1).replace(/^\w{0,8} /,'').replace(/\s$/, '').split(' ');
+ string = cmds[y].substring(1).match(/^\w{0,8}/)[0].toUpperCase();
+ for (var z=0; z<args2.length; z++){
+ string = string + " " + args2[z];
+ }
+ if(args1){
+ if(string.match(/\$1/)) string = string.replace(/\$1/, args1[0]) || '';
+ if(string.match(/\$2/)) string = string.replace(/\$2/, args1[1]) || '';
+ if(string.match(/\$3/)) string = string.replace(/\$3/, args1[2]) || '';
+ if(string.match(/\$selectedchan/)) string = string.replace(/\$selectedchan/, getActiveChan().name) || '';
+ if(string.match(/\$nick/)) string = string.replace(/\$nick/, nickname) || '';
+ }
+ cmd = "";
+ IRCConnection.handleInput(title, '/'+string);
+// connection.send(string);
+ }
+ }
+ }
+ }
+ break;
}
}
- connection.send(cmd);
+ if(cmd) connection.send(cmd);
} else if(title != "status" && data.replace(/\s/g ,'') != "") connection.send('PRIVMSG ' + title + ' :' + data);
}
+ IRCConnection.getChannels = function() {
+ return channels;
+ }
+
IRCConnection.handleRaw = function(data) {
var raw = data.substring(3);
var reg1 = /^:([^!]+)!.*PRIVMSG ([^ ]+) :/i;
var objChan = getChannelByName(replyTo);
var objUser = objChan.getUserByNick(nick);
msg = stripCodes(raw.replace(/^:([^!]+)!.*PRIVMSG\ \#[\w\_\-\^]+\ \:/, ''));
- if(objChan.name != getActiveChan.name)
+ if(objChan.name != getActiveChan().name)
objChan.setWaiting(0);
if(msg.indexOf(nickname)>-1){
- if(objChan.name != getActiveChan.name)
+ if(objChan.name != getActiveChan().name)
objChan.setWaiting(1);
context = 'hl';
}
objChan.addMessage(msg);
} else{
var objQuery, objUser;
- msg = stripCodes(raw.replace(/.*PRIVMSG [\w\_\-\^]+ :/, ''));
+ msg = stripCodes(raw.replace(/.*PRIVMSG [\w\@\.\_\-\^]+ :/, ''));
if(hasQueryWithName(replyTo)){
objQuery = getChannelByName(replyTo);
objUser = objQuery.user;
}
}
if(msg.indexOf(nickname)>-1){
- if(objQuery.name != getActiveChan.name)
+ if(objQuery.name != getActiveChan().name)
objQuery.setWaiting(1);
context = 'hl';
}
}
}
-
- IRCConnection.getChannels = function() {
- return channels;
- }
-
+
if (raw.match(reg2)) {
// JOIN
var chan = raw.replace(reg2, '').replace(/^:/, '').replace(/\s$/, ''), host = raw.match(/^:([^!]+)!([^!]+)@([\w.\-_]+)/)[0].substring(1).split('!');
var msg = '<span class="statusmessage"><time> <font color="#0f0">→</font> <b>' + host[0] + '</b> (' + host[1] + ') joined the channel.</span>';
- debug('CHANNAME ' +chan);
var objChannel;
if(host[0] == nickname){
objChannel = Object.create(Channel).init(chan);
if (raw.match(/^:([^!]+)!.*TOPIC /)) {
// CHANGE TOPIC
var host = raw.match(/^:([^!]+)!([^!]+)@([\w.\-_]+)/)[0].substring(1).split('!');
- var arrD = raw.replace(/^:([^!]+)!.*TOPIC /, '').split(' ');
- var objChannel = getChannelByName(arrD[0]);
- var msg = '<span class="statusmessage"><time> <b>' + host[0] + '</b> changed the topic to <b>' + arrD[1].substring(1) + '</b></span>';
- objChannel.setTopic(arrD[1].substring(1));
+ var arrM = raw.match(/^:([^!]+)!.*TOPIC (\#[\w\_\-\^]+) \:(.+)/);
+ debug(arrM[1] + " " + arrM[2] + " " + arrM[3]);
+ var objChannel = getChannelByName(arrM[2]);
+ var msg = '<span class="statusmessage"><time> <b>' + host[0] + '</b> changed the topic to <b>' + arrM[3] + '</b></span>';
+ objChannel.setTopic(arrM[3]);
objChannel.addMessage(msg);
}
if (raw.match(reg8) || raw.match(/^NOTICE /)) {
// TOPIC
debug('TOPIC');
var topic = raw.replace(/^\:.+\s332\ .+\ \#[\w\_\-\^]+\ \:/, '');
- var objChan = getChannelByName(raw.replace(/^:.+ 332 /, '').replace(/ :.+/, '').split(' ')[1].replace(/\s$/, ''));
+ var objChan = getChannelByName(raw.match(/^\:.+\s332\ .+\ (\#[\w\_\-\^]+) \:/)[1]);
objChan.setTopic(stripCodes(topic));
}
if(raw.match(/\:.+\s352/)){
msg = '<span class="logmessage"><time> Your message couldn\'t be sent to the channel';
objChan.addMessage(msg);
}
- if(raw.match(/\:[A-Za-z0-9.]+ 001 ([A-Za-z0-9_\-\[\]\\^{}|`]+)/)){
- nickname = raw.match(/\:[A-Za-z0-9.]+ 001 ([A-Za-z0-9_\-\[\]\\^{}|`]+)/)[1];
+ if(raw.match(/^\:[a-zA-Z0-9.-]+ 001/)){
+ debug('jo 001');
+ nickname = raw.match(/\:[a-zA-Z0-9.-]+ 001 ([A-Za-z0-9_\-\[\]\\^{}|`]+)/)[1];
+ window.setTimeout(function(){
+ if(settings.perform){
+ debug('jo perform1');
+ for (var x=0; x<settings.perform.length; x++){
+ debug('jo send');
+ IRCConnection.handleInput('status', settings.perform[x].replace(/\$nick/, nickname));
+ }
+ }
+ }, 1500);
debug('NICK ' +nickname);
}
- if(raw.match(/\:[A-Za-z0-9.]+ 3(1[1-9]|2[0-9]|30)/)){
+ if(raw.match(/\:[A-Za-z0-9.-]+ 3(1[1-9]|2[0-9]|30)/)){
// WHOIS
var objChan = getActiveChan();
if(objChan){
}
}
}
-
IRCConnection.quit = function() {
$$('.con_panel span').each(function(icon) {
icon.win.close();
$$('.con_panel').each(function(panel) {
panel.remove();
});
+ channels = [];
connection.close();
}
}
function getColor(i) {
- debug('JAU I ' + i);
var c = ["FFF","000","00007F","009000","FF0000","7F0000","9F009F","FF7F00","FFFF00","00F800","00908F","00FFFF","0000FF","FF00FF","7F7F7F","CFD0CF"];
return c[parseInt(i)];
}
IRCConnection.getActiveChan = getActiveChan;
function getActiveChan() {
+ var chan;
for(var x=0; x<channels.length;x++)
- if(channels[x].dock_icon.className == 'icon_active' && channels[x].win.getTitle().substring(0,1) == '#')
- return channels[x];
- return null;
+ if(channels[x].dock_icon.className == 'icon_active')
+ chan = channels[x];
+ if(!chan && channels && channels.length > 0)
+ chan = channels[0];
+ return chan;
}
function getChannelByName(name){
panel.addClassName('dont_select');
panel.style.display = "none";
childs = $('cons').childNodes.length;
- panel.style.top = (childs-2) * 26 + "px";
+ panel.style.top = (childs-2) * 26 + "px";
+// panel.update('<span class="dock_icon">+</div>');
return panel;
}
// $('span').hide();
return;
}
- connection = new WebSocket(location.href.split('http://').join('ws://'));
+ connection = new WebSocket(location.href.split('http://').join('ws://').replace(/\/$/,'').replace(/\#/,''));
connection.win = win;
connection.onopen = function () {
if(data[0] && data[1]) {
<link href="windows_js_1.3/themes/lighting.css" rel="stylesheet" type="text/css" />
<link href="windows_js_1.3/themes/mac_os_x.css" rel="stylesheet" type="text/css" />
<link href="windows_js_1.3/themes/debug.css" rel="stylesheet" type="text/css" />
- <link href="./main.css" rel="stylesheet" type="text/css" />
<link href="windows_js_1.3/themes/spread.css" rel="stylesheet" type="text/css" />
<link href="windows_js_1.3/themes/alert.css" rel="stylesheet" type="text/css" />
<link href="windows_js_1.3/themes/alert_lite.css" rel="stylesheet" type="text/css" />
<link href="windows_js_1.3/themes/alphacube.css" rel="stylesheet" type="text/css" />
+ <link href="main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="web_socket.js"></script>
<script type="text/javascript" src="windows_js_1.3/javascripts/prototype.js"></script>
<body onload="init();" onunload="backup();">
<div id="cons">
<div id="dock">
-<a href="JavaScript:IRCConnection.create();">new connection</a>
-<a href="JavaScript:IRCConnection.showSettings();" style="padding-left:10px;">settings</a>
+ <a href="JavaScript:IRCConnection.create();">new connection</a>
+<a href="JavaScript:IRCConnection.showSettings();" style="padding-left:10px;">settings</a>
<div id="theme">Theme
<select>
<option>Mac OS X</option>
</div>
</div>
</div>
+
+<div id="dialog_alias" style="display:none;">
+ <form id="form_alias" class="form_alias">
+ <center>
+ <span class="login_input"><b>Alias</b><br /><input type="text" id="input_alias" name="input_alias" value="" /></span>
+ <span class="login_input"><b>Full Command</b><br /><input type="text" id="input_cmd" name="input_cmd" value="" /></span>
+ </center>
+ </form>
+</div>
+<div id="dialog_perform" style="display:none;">
+ <form id="form_perform" class="form_perform">
+ <table><tr><td>
+ <span class="login_input"><b>Command</b><br /><input type="text" id="input_perform" name="input_alias" value="" /></span>
+ </td></tr></table>
+ </form>
+</div>
<div id="settings" style="display:none;">
+<article>
+<span><a href="JavaScript:showSettingsPane('link1');" class="link1 active">User Interface</a>
+<a href="JavaScript:showSettingsPane('link2');" class="link2">Notifications</a></span>
<form id="config" action="#">
- <p><span class="config_label"><b>User Interface</b></span><span class="config_input"></span></p>
+<section class="set1">
+ <p><span class="config_label"><b>Behavior</b></span><span class="config_input"></span></p>
<div style="clear:both"></div>
<p><span class="config_label">on invite</span>
<span class="config_input"><input type="radio" name="invite" id="ask" value="ask" checked="checked">ask<br /><input type="radio" name="invite" id="join" value="join">join automatically<br /><input type="radio" name="invite" id="ignore" value="ignore">do nothing</span></p>
<p><span class="config_label" style="width:320px;"><input type="checkbox" id="codes" name="codes">show message colors and formating</span><span class="config_input"></span></p>
<p><span class="config_label" style="width:220px;"><input type="checkbox" id="hold" name="hold">hold connection on close</span><span class="config_input"></span></p>
- <div style="clear:both"></div>
+ <p><div style="clear:both"></div></p>
+ <p><span class="config_label"><b>Aliases</b></span><span class="config_input"></span></p>
+ <p><span class="config_label" style="width:320px;font-size:8pt;">Available variables are: $1, $2, $3, $selectedchan and $nick.<br />Use ; to seperate multiple commands within the same alias.</span></p>
+ <p>
+ <span class="config_label">
+ <center>
+ <div style="margin:5px; border: 1px solid #64355A;width:380px;height:60px;overflow-x:hidden;overflow-y:auto;">
+ <table cellpadding="0" cellspacing="0" class="aliases">
+ <thead><tr><td style="width:100px;"><b>Alias</b></td><td><b>Full Command</b></td></thead>
+ <tbody>
+ <tr><td>/j</td><td>/join $1</td></tr>
+ <tr><td>/q</td><td>/quit</td></tr>
+ </tbody>
+ </table>
+ </div>
+ </center>
+ <table>
+ <tr><td>
+ <span class="alias_edit"><input type="button" value="add"><input type="button" value="del"><input type="button" value="edit"></span>
+ </td></tr>
+ </table>
+ </span></p>
+ <p><div style="clear:both"></div></p>
+ <p><span class="config_label"><b>Perform</b></span><span class="config_input"></span></p>
+ <p>
+ <span class="config_label">
+ <center>
+ <div style="margin:5px; border: 1px solid #64355A;width:380px;height:55px;overflow-x:hidden;overflow-y:auto;">
+ <table cellpadding="0" cellspacing="0" class="perform">
+ <tbody>
+ <tr><td>/mode $nick +x</td></tr>
+ </tbody>
+ </table>
+ </div>
+ </center>
+ <table>
+ <tr><td>
+ <span class="perform_edit"><input type="button" value="add"><input type="button" value="del"><input type="button" value="edit"></span>
+ </td></tr>
+ </table>
+ </span></p>
+ <p><div style="clear:both"></div></p>
+</section>
+<section class="set2">
<p><span class="config_label"><b>Notifications</b></span><span class="config_input"></span></p>
<div style="clear:both"></div>
<p><span class="config_label" style="width:220px;"><input type="checkbox" id="ooh" name="ooh">only on hold</span></p>
<p><span class="config_label"><input type="checkbox" id="growl" name="growl">Growl</span><span class="config_input">Growl IP:Port<br /><input type="text" id="growlip" name="growlip"><br />Growl Password<br /><input type="text" id="growlpw" name="growlpw"></span></p>
<p><span class="config_label"><input type="checkbox" id="prowl" name="prowl">Prowl</span><span class="config_input">Prowl API key<br /><input type="text" id="prowlkey" name="prowlkey"><br />Prowl Priority<br /><input type="text" id="prowlpriority" name="prowlpriority"></span></p>
<p><span class="config_label"><input type="checkbox" id="nma" name="nma">Notify My Android</span><span class="config_input">NMA key<br /><input type="text" id="nmakey" name="nmakey"><br />NMA Priority<br /><input type="text" id="nmapriority" name="nmapriority"></span></p>
- <div style="clear:both"></div>
+ <div style="clear:both"></div>
+</section>
</form>
+</article>
</div>
<div id="login" style="display:none;">
<form class="conconfig" action="#">
<p style="display:none;"><span class="login_label">Nick-PW</span> <span class="login_input"><input type="password" id="nickpw" /></span></p>
</form>
</div>
-<span id="tabindex">0</span>
+<span id="tabindex" style="display:none;">0</span>
<div class="querytemplate">
<table style="width:100%;height:90%;border-collapse:collapse;background-color:#fff;table-layout:fixed;overflow:hidden;">
<tr>
</tr>
</table>
</div>
-
<div class="channeltemplate">
<table style="width:100%;height:90%;border-collapse:collapse;background-color:#fff;table-layout:fixed;overflow:hidden;">
<tr>
element.win.toFront();
},
close: function(id, event) {
+
var win = this.getWindow(id)
if (win && win.visible) {
$$('.con_panel span').each(function(icon) {
}
});
if (win.getTitle() == "status"){
- IRCConnection.quit();
+ IRCConnection.quit();
+// IRCConnection.channels = "";
$$('#dock a').first().show();
} else {
- if (win.getTitle().substring(0,1) == "#"){
- IRCConnection.handleInput(win.getTitle(), '/part BYE BYE');
+ if (win.getTitle().match(/\#/g)){
+ IRCConnection.handleInput(IRCConnection.getActiveChan().name, '/part BYE BYE');
// IRCConnection.delChannel(win.getTitle().split(' ')[0]);
} else {
IRCConnection.delChannel(win.getTitle());
currentTheme = index;
}
+function showSettingsPane(link){
+ if(link=="link1"){
+ $$('article .set1').each(function(set){set.style.display='block'});
+ $$('article .set2').each(function(set){set.style.display='none'});
+ $$('article .link1').each(function(link){link.addClassName('active')});
+ $$('article .link2').each(function(link){link.removeClassName('active')});
+ } else {
+ $$('article .set1').each(function(set){set.style.display='none'});
+ $$('article .set2').each(function(set){set.style.display='block'});
+ $$('article .link1').each(function(link){link.removeClassName('active')});
+ $$('article .link2').each(function(link){link.addClassName('active')});
+ }
+}
+
function getSelection(el)
{
// var textComponent = document.getElementById('Editor');
function refreshUserLists(){
var objChannel = IRCConnection.getActiveChan();
- if(objChannel) objChannel.updateUserList();
+ if(objChannel && objChannel.name.match(/\#/)) objChannel.updateUserList();
}
function handleTab(e){
objChannel = Object.create(Channel).init(channels[x].name);
objChannel.users = channels[x].users;
objChannel.createWindow();
- objChannel.setTopic(channels[x].topic);
objChannel.win.setLocation(parseInt(channels[x].win.options.top), parseInt(channels[x].win.options.left));
objChannel.win.setSize(parseInt(channels[x].win.options.width), parseInt(channels[x].win.options.height));
+ objChannel.setTopic(channels[x].topic);
$$('#'+objChannel.win.getContent().id+' td div').each(function(td){td.style.height = objChannel.win.getSize()['height']-23+'px'});
IRCConnection.channels.push(objChannel);
objChannel.updateUserList();
function init(){
getEmoticons();
IRCConnection.getSettings();
+// IRCConnection.saveSettings($('config').serialize(true));
resume();
window.setInterval("refreshUserLists()", 20000);
$$("#theme select").first().selectedIndex = currentTheme;
});
},
onEndResize: function(eventName, mwin) {
+ Windows.focus(mwin.getId());
+ mwin.toFront();
if(mwin.getSize()['width'] < 300)
mwin.setSize(300, mwin.getSize()['height']);
if(mwin.getSize()['height'] < 200)
if (mwin.getTitle() == "status") {
mwin.getContent().childNodes[1].childNodes[1].style.height = mwin.getSize()['height']-23+'px';
} else {
- if (mwin.getTitle() != "Debug") {
- $$('#'+mwin.getContent().id+' td')[1].style.height = mwin.getSize()['height']-23+'px';
+ if (mwin.getTitle() && mwin.getTitle() != "Debug") {
+ if(mwin.getTitle().match(/\#/)){
+ $$('#'+mwin.getContent().id+' td')[1].style.height = mwin.getSize()['height']-23+'px';
+ IRCConnection.getActiveChan().setTopic(IRCConnection.getActiveChan().getTopic());
+ }
+// debug($$('#'+mwin.getContent().id+' td')[1].style.height);
+// $$('#'+mwin.getContent().id+' .content').last().style.height = mwin.getSize()['height']-23+'px';
+// debug($$('#'+mwin.getContent().id+' td')[1].style.height);
+// debug($$('#'+mwin.getContent().id+' td input').first().style.top);
$$('#'+mwin.getContent().id+' td div').each(function(td){td.style.height = mwin.getSize()['height']-23+'px'});
}
}