From: Darren Date: Sun, 28 Aug 2011 13:52:53 +0000 (+0100) Subject: Cache clearing, default channel bug fix, embedded image clicking bug fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c89b9fdfa39466d416576727dbdaa305f07e856c;p=KiwiIRC.git Cache clearing, default channel bug fix, embedded image clicking bug fix --- diff --git a/js/front.js b/js/front.js index 0a63fe7..c11e51b 100644 --- a/js/front.js +++ b/js/front.js @@ -84,6 +84,9 @@ var front = { tmp = nick.val().split(' '); gateway.nick = tmp[0]; + + init_data.channel = $('#channel').val(); + front.doLayout(); try { front.run('/connect ' + netsel.val()); @@ -103,15 +106,18 @@ var front = { //$('#kiwi').bind("resize", front.doLayoutSize, false); front.doLayout(); - //front.windowAdd('server'); front.tabviewAdd('server'); // Any pre-defined nick? - if (typeof init_data.nick === "string") { + if (typeof window.init_data.nick === "string") { $('#kiwi .formconnectwindow .nick').val(init_data.nick); } + + // Any pre-defined channels? + if (typeof window.init_data.channel === 'string') { + $('#channel').val(init_data.channel); + } - //gateway.session_id = 'testses'; $('#kiwi .cur_topic').keydown(function (e) { if (e.which === 13) { @@ -174,6 +180,7 @@ var front = { switch (e.target.className) { case 'link_ext': + case 'link_img_a': return true; break; case 'link_ext_browser': @@ -430,7 +437,7 @@ var front = { onNotice: function (e, data) { var nick = (data.nick === undefined) ? '' : data.nick; var enick = '[' + nick + ']'; - + if (front.tabviewExists(data.target)) { front.tabviews[data.target.toLowerCase()].addMsg(null, enick, data.msg, 'notice'); } else if (front.tabviewExists(nick)) { diff --git a/js/util.js b/js/util.js index ff6c4a0..af68cc4 100644 --- a/js/util.js +++ b/js/util.js @@ -55,7 +55,7 @@ var plugins = [ // Don't let any future plugins change it (ie. html_safe plugins) event.event_bubbles = false; - var img = ''; + var img = ''; return ''+ img +'
'; }); diff --git a/node/app.js b/node/app.js index f2e7418..47857c2 100644 --- a/node/app.js +++ b/node/app.js @@ -819,6 +819,13 @@ this.startControll = function () { } break; + case 'cache': + if (parts[1] === 'clear') { + kiwi.cache.html = {}; + console.log('HTML cache cleared'); + } + break; + default: console.log('Unknown command \'' + parts[0] + '\''); } diff --git a/node/client/index.html.jade b/node/client/index.html.jade index c27f451..e943791 100644 --- a/node/client/index.html.jade +++ b/node/client/index.html.jade @@ -45,7 +45,6 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb") var chans = document.location.hash.match(/[#&]+[^ ,\\007]+/g); if(chans != null && chans.length > 0) { init_data.channel = chans.join(','); - $('#channel').val(init_data.channel); } front.init(); @@ -58,10 +57,6 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb") function addEvents(){ $('.more_link').click(function(){ $('.content.bottom').slideDown('fast'); $('.network').focus(); return false; }); - $('.formconnectwindow').submit(function(){ - init_data.channel = $('#channel').val(); - return false; - }); $('a.connect').click(function(){ $('.formconnectwindow').submit(); return false; }); }