In-browser extracted to it's own plugin. Link colours
authorDarren <darren@darrenwhitlen.com>
Sat, 3 Sep 2011 23:47:57 +0000 (00:47 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 3 Sep 2011 23:47:57 +0000 (00:47 +0100)
css/default.css
js/front.js
js/util.js
node/app.js
node/client/index.html.jade

index bda917a040cf0edf46b8ae68c8c750a81566ed94..c700bfcd7006c30191890731286a548a7a3bdada 100644 (file)
@@ -14,6 +14,10 @@ body, html {
 }\r
 #kiwi ul { list-style:none; }\r
 \r
+#kiwi a {\r
+       color: #36C; text-decoration:none;\r
+       cursor: pointer;\r
+}\r
 #kiwi #login a {\r
        color: #8D9713;\r
        text-decoration:none;\r
@@ -45,18 +49,17 @@ body, html {
        /*height: 35px;*/\r
 }\r
 #kiwi .windowlist ul li, #kiwi .utilityviewlist ul li {\r
-       float: left;\r
-       list-style: inline;\r
-       padding:5px;\r
-       margin:3px;\r
+       float: left; list-style: inline;\r
+       display:inline; position:relative;\r
+       padding:5px; margin:3px;\r
        border: 1px solid #333;\r
        background-color: #eee;\r
-       display: inline;\r
+       \r
+       cursor: pointer;\r
+\r
        line-height: 1.4em;\r
        vertical-align: middle;\r
        \r
-       position:relative;\r
-       \r
        border-radius:5px;\r
        -moz-border-radius:5px;\r
        -webkit-border-radius:5px;\r
@@ -93,7 +96,7 @@ body, html {
 #kiwi .userlist ul.active { display:block; }\r
 #kiwi .userlist ul li { padding:1px 2px; cursor:pointer; }\r
 #kiwi .userlist ul li:hover { background-color:#FAF7D3; }\r
-#kiwi .userlist ul li a.nick { display:block; }\r
+#kiwi .userlist ul li a.nick { display:block; color:black; }\r
 \r
 #kiwi .userlist ul li .userbox { margin:0px 5px 5px 5px; font-size:.9em; }\r
 #kiwi .userlist ul li .userbox a { display:block; text-decoration:none; border-bottom: 1px dashed #aaa; }\r
index 7f46057f559887140cdd405825a10d82afb11ef2..c51e5c6d41e584a73c4876d4807508e65ec16930 100644 (file)
@@ -6,6 +6,7 @@ var front = {
     cur_channel: '',
     windows: {},
     tabviews: {},
+    utilityviews: {},
     boxes: {},
     
     buffer: [],
@@ -166,38 +167,6 @@ var front = {
             front.joinChannel($(this).text());
             return false;
         });
-
-        $('#windows a.link_ext').live('mouseover', function () {
-            var a = $(this);
-            var tt = $('.tt', a);
-
-            if (tt.text() === '') {
-                var tooltip = $('<a class="link_ext_browser">Open in Kiwi..</a>');
-                tt.append(tooltip);
-            }
-
-            tt.css('top', -tt.outerHeight()+'px');
-            tt.css('left', (a.outerWidth() / 2) - (tt.outerWidth() / 2));
-        });
-        $('#windows a.link_ext').live('mouseout', function () {
-            var a = $(this);
-            var tt = $('.tt', a);
-        });
-        $('#windows a.link_ext').live('click', function (e) {
-            var a = $(this);
-            
-            switch (e.target.className) {
-            case 'link_ext':
-            case 'link_img_a':
-                return true;
-                break;
-            case 'link_ext_browser':
-                var t = new Utilityview('Browser', a.attr('href'));
-                t.show();
-                break;
-            }
-            return false;
-        });
         
     },
     
@@ -1147,36 +1116,34 @@ var front = {
  *   MISC VIEW
  */
 
-var Utilityview = function (name, src) {
-
-    var tmp_divname = 'kiwi_window_' + name;
-    var tmp_userlistname = 'kiwi_userlist_' + name;
-    var tmp_tabname = 'kiwi_tab_' + name;
+var Utilityview = function (name) {
+    var rand_name = randomString(15);
+    var tmp_divname = 'kiwi_window_' + rand_name;
+    var tmp_userlistname = 'kiwi_userlist_' + rand_name;
+    var tmp_tabname = 'kiwi_tab_' + rand_name;
     
-    this.name = name;
-    this.topic = src;
+    this.name = rand_name;
+    this.title = name;
+    this.topic = ' ';
 
-    if (!front.tabviewExists(name)) {
-        $('#kiwi .windows .scroller').append('<div id="' + tmp_divname + '" class="messages"></div>');
-        $('#kiwi .utilityviewlist ul').append('<li id="' + tmp_tabname + '" onclick="front.tabviews[\'' + name.toLowerCase() + '\'].show();">' + name + '</li>');
-    }
+    $('#kiwi .windows .scroller').append('<div id="' + tmp_divname + '" class="messages"></div>');
+
+    this.tab = $('<li id="' + tmp_tabname + '">' + this.title + '</li>');
+    this.tab.click(function(){
+        front.utilityviews[rand_name.toLowerCase()].show();
+    });
+    $('#kiwi .utilityviewlist ul').append(this.tab);
     
     this.div = $('#' + tmp_divname);
     this.div.css('overflow', 'hidden');
 
-    this.tab = $('#' + tmp_tabname);
-
-    this.iframe = $('<iframe border="0" class="utility_view" src="" style="width:100%;height:100%;border:none;"></iframe>');
-    if(src) this.iframe.attr('src', src);
-    this.div.append(this.iframe);
-
-    front.tabviews[name.toLowerCase()] = this;
+    front.utilityviews[rand_name.toLowerCase()] = this;
 };
 
 Utilityview.prototype.name = null;
+Utilityview.prototype.title = null;
 Utilityview.prototype.div = null;
 Utilityview.prototype.tab = null;
-Utilityview.prototype.iframe = null;
 Utilityview.prototype.topic = ' ';
 Utilityview.prototype.show = function () {
     $('#kiwi .messages').removeClass("active");
@@ -1207,7 +1174,7 @@ Utilityview.prototype.close = function () {
     if (front.cur_channel === this) {
         front.tabviews.server.show();
     }
-    delete front.tabviews[this.name.toLowerCase()];
+    delete front.utilityviews[this.name.toLowerCase()];
 };
 
 Utilityview.prototype.addPartImage = function () {
index af68cc4a1297fd39b924bd9746386eade31a4269..f186ed933f6396d0f9999c8e3db4aa6327e3a8ce 100644 (file)
@@ -144,6 +144,49 @@ var plugins = [
                        
                        return event;
                }
+       },
+
+
+       {
+               name: "inBrowser",
+               oninit: function(event, opts){
+               $('#windows a.link_ext').live('mouseover', function () {
+                   var a = $(this);
+                   var tt = $('.tt', a);
+
+                   if (tt.text() === '') {
+                       var tooltip = $('<a class="link_ext_browser">Open in Kiwi..</a>');
+                       tt.append(tooltip);
+                   }
+
+                   tt.css('top', -tt.outerHeight()+'px');
+                   tt.css('left', (a.outerWidth() / 2) - (tt.outerWidth() / 2));
+               });
+               $('#windows a.link_ext').live('mouseout', function () {
+                   var a = $(this);
+                   var tt = $('.tt', a);
+               });
+               $('#windows a.link_ext').live('click', function (e) {
+                   var a = $(this);
+                   
+                   switch (e.target.className) {
+                   case 'link_ext':
+                   case 'link_img_a':
+                       return true;
+                       break;
+                   case 'link_ext_browser':
+                       var t = new Utilityview('Browser');
+                       t.topic = a.attr('href');
+
+                                       t.iframe = $('<iframe border="0" class="utility_view" src="" style="width:100%;height:100%;border:none;"></iframe>');
+                                   t.iframe.attr('src', a.attr('href'));
+                                   t.div.append(t.iframe);
+                       t.show();
+                       break;
+                   }
+                   return false;
+               });
+               }
        }
 ];
 
index 4cf93078511bf5657a8992e2d2cf9df78d8e2784..bb581a3b29eedaa9c160eef04ddcd9ea0d168377 100644 (file)
@@ -828,6 +828,7 @@ this.manageControll = function (data) {
     case 'cache':
         if (parts[1] === 'clear') {
             kiwi.cache.html = {};
+            kiwi.cache.alljs = '';
             console.log('HTML cache cleared');
         }
         break;
index 12ec9d53322bb37ddfcd05456d96d65991291f6c..28e1c98660ce31400222ef02ca6574b6ac4a005f 100644 (file)
@@ -22,7 +22,7 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
         //script(type="text/javascript", src="js/front.js")
         //script(type="text/javascript", src="js/iscroll.js")
         script(type="text/javascript", src="js/all.js")
-        script(type="text/javascript", src="js/plugins.js")
+        //script(type="text/javascript", src="js/plugins.js")
 
         - if (touchscreen)
             script(type="text/javascript", src="js/touchscreen_tweaks.js")
@@ -171,7 +171,7 @@ html(xmlns="http://www.w3.org/1999/xhtml", lang="en-gb")
             div.control
                 div.msginput
                     div.nick
-                        a(href="#")
+                        a
                         | :
                     input(type="text", name="kiwi_msginput", id="kiwi_msginput")
                 div.plugins