please add IRC... http://kiwiirc.com/ with notification will work too :smile:
We have FreeNode as IRC. Is it different than Kiwi?
In KiwiIRC you can connect to basically any Network, Freenode is just Freenode.
Should you add Kiwi, please also add an option for Kiwi to specify a custom URL, as Kiwi can also be installed on your own server instead of using their installation.
I'm also currently working on an unread badge script for Kiwi which I'll post here once it's done
Ok, sounds good. I will add it for the next release.
It will be great if you can share the code for unread messages.
So, here's where I am right now:
function checkUnread() {
updateBadge(
(function() {
var activity = 0;
// sum all tabs unread counter
$('.activity').each(function() { activity += parseInt($(this).html()) });
var unseen = false;
// since the current tab always has a 0 counter, we need to count the lines after the last seen line
$('.panel[style*="display: block"] .msg').each(function() {
if(unseen) {
activity++;
} else {
if($(this).hasClass('last_seen')) {
unseen = true;
}
}
});
return activity;
})()
)
}
function updateBadge(e) {
e>= 1 ? document.title = "("+e+") " + originalTitle : document.title=originalTitle
}
var originalTitle = document.title;
setInterval(checkUnread,3000);
I'm having the following issues:
Well, 2 will prove to be quite difficult as
Building takes all the development files then concatenates and minifies them into 2 files - kiwi.js and kiwi.min.js. Each file is wrapped into a closure to prevent runtime access.
I'm not sure how I can overwrite that function. Alternatively resetting the title every 50ms or so seems like an ugly hack.
Any idea how to get around this?
I couldn't finish it, but here's a beginning:
Object.defineProperty(document, 'title', {
set: function(t){
var count = t.match(/\(([^)]+)\)/); // Get text between (...)
count = count ? count[1] : '0';
count = Array.isArray(count.match(/\d+/g)) ? count.match(/\d+/g).join("") : count.match(/\d+/g); // Some services have special characters. Example: (•)
count = count ? parseInt(count) : 0;
console.info(count);
}
});
If you pass an empty function to _set_, it will prevent the title changing. But we need only change the title if there is an unread count "(n)" in the title.
Ah, nice. I'll check it out in the next days and get back to you!
Took a bit longer than expected, but finally, here it is:
var re = /\(\d+\)[ ](.*)/;
function getUnreadCount() {
var activity = 0;
$('.activity').each(function() { activity += parseInt($(this).html()) });
var unseen = false;
$('.panel[style*="display: block"] .msg').each(function() {
if(unseen) {
activity++;
} else {
if($(this).hasClass('last_seen')) {
unseen = true;
}
}
});
return activity;
}
function updateTitle(title) {
count = getUnreadCount();
cleanTitle = title.match(re);
if(cleanTitle !== null && cleanTitle.length > 1)
cleanTitle = cleanTitle[1];
else
cleanTitle = title;
if(count > 0)
title = "(" + getUnreadCount() + ") " + cleanTitle;
else
title = cleanTitle;
$('title').text(title);
}
Object.defineProperty(document, 'title', {
configurable: true,
set: function(title) {
updateTitle(title);
},
get: function() {
return $('title').text();
}
});
setInterval(function() { updateTitle(document.title); }, 3000);
Thanks for your defineProperty hint!
@MrChick Great! So I will add Kiwi in next release. Thank you.
Hi, wouldn't it be good to let the user add the wanted irc server, so everybody can use its own? Because I need the mibbit irc server, and there's only freenode right now.
Thanks.
@Bl4ckb0ne that's exactly what the addition of KiwiIRC is for as discussed in this thread?
Seems like you're adding all the server one by one. What I mean is adding something like hexchat, that can let you add as many servers as you like
That's exactly what KiwiIRC is...?
Give it a try: https://kiwiirc.com/client
No, kiwiirc is a IRC server. Hexchat is a IRC client
KiwiIRC is an IRC client, the hell are you talking about?!
Ow my bad, I didn't see the server and network at the bottom of the page (damn phone screen). Si kiwiirc is a IRC client like hexchat, and not a IRC server. Sorry for the trouble
No problem ;)
Should you add Kiwi, please also add an option for Kiwi to specify a custom URL, as Kiwi can also be installed on your own server instead of using their installation
Is it possible that you forgot this for 0.4.2? ;)
Damn it! Yes... sorry @MrChick. :disappointed:
Please create a new issue for that so I will not forget on next release.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.