Cache clearing, default channel bug fix, embedded image clicking bug fix
authorDarren <darren@darrenwhitlen.com>
Sun, 28 Aug 2011 13:52:53 +0000 (14:52 +0100)
committerDarren <darren@darrenwhitlen.com>
Sun, 28 Aug 2011 13:52:53 +0000 (14:52 +0100)
js/front.js
js/util.js
node/app.js
node/client/index.html.jade

index 0a63fe7ecea836f75c6ccee7492777b3449f72e0..c11e51b75a5e966ca698f4e49b6d7f68ee6142cd 100644 (file)
@@ -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)) {
index ff6c4a013b2659cfe74f3c080d52396f543d9232..af68cc4a1297fd39b924bd9746386eade31a4269 100644 (file)
@@ -55,7 +55,7 @@ var plugins = [
                                // Don't let any future plugins change it (ie. html_safe plugins)
                                event.event_bubbles = false;
 
-                               var img = '<img src="'+url+'" height="100%" width="100%" />';
+                               var img = '<img class="link_img_a" src="'+url+'" height="100%" width="100%" />';
                                return '<a class="link_ext link_img" target="_blank" rel="nofollow" href="'+ url +'" style="height:50px;width:50px;display:block">'+ img +'<div class="tt box"></div></a>';
                        });
                        
index f2e74187ce6c4677e0ba4caea8112ff04a651e0d..47857c27cd578d629cabc9667f4b9289fa295312 100644 (file)
@@ -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] + '\'');
            }
index c27f4518b5be0498b147ea1a7100c60c6317baa8..e9437911dfb655f20800ba56690196d36da36a9f 100644 (file)
@@ -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; });
             }