[Phpfreechat-svn] SF.net SVN: phpfreechat: [827] trunk
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-08 19:02:27
|
Revision: 827 http://svn.sourceforge.net/phpfreechat/?rev=827&view=rev Author: kerphi Date: 2006-10-08 12:02:16 -0700 (Sun, 08 Oct 2006) Log Message: ----------- [en] Add a blink effect to the tab's notifications. [45min] [fr] Ajout d'un effet de clignotement ?\195?\160 la notification des onglets. [45min] Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcgui.js trunk/src/pfcglobalconfig.class.php trunk/themes/default/style.css Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/src/client/chat.js.tpl.php 2006-10-08 19:02:16 UTC (rev 827) @@ -21,6 +21,8 @@ var pfc_debug = <?php echo $json->encode($debug); ?>; var pfc_btn_sh_smileys = <?php echo $json->encode($btn_sh_smileys); ?>; var pfc_btn_sh_whosonline = <?php echo $json->encode($btn_sh_whosonline); ?>; +var pfc_displaytabimage = <?php echo $json->encode($displaytabimage); ?>; +var pfc_displaytabclosebutton = <?php echo $json->encode($displaytabclosebutton); ?>; var pfc_connect_at_startup = <?php echo $json->encode($connect_at_startup); ?>; var pfc_notify_window = <?php echo $json->encode($notify_window); ?>; var pfc_defaultchan = <?php echo $json->encode($c->channels); ?>; Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/src/client/pfcgui.js 2006-10-08 19:02:16 UTC (rev 827) @@ -8,6 +8,7 @@ initialize: function() { +// this.builder = new pfcGuiBuilder(); this.current_tab = ''; this.current_tab_id = ''; this.tabs = Array(); @@ -210,40 +211,48 @@ li_title.setAttribute('id', 'pfc_channel_title'+tabid); var li_div = document.createElement('div'); + li_div.setAttribute('id', 'pfc_tabdiv'+tabid); li_title.appendChild(li_div); - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_tabimg'+tabid); - if (type == 'ch') - img.setAttribute('src', pfc.res.getFileUrl('images/ch.gif')); - if (type == 'pv') - img.setAttribute('src', pfc.res.getFileUrl('images/pv.gif')); var a1 = document.createElement('a'); - // Element.addClassName(a1, 'pfc_tabtitle'); a1.setAttribute('class', 'pfc_tabtitle'); a1.setAttribute('className', 'pfc_tabtitle'); // for IE6 - a1.appendChild(img); - a1.appendChild(document.createTextNode(name)); a1.setAttribute('href', '#'); a1.pfc_tabid = tabid; a1.onclick = function(){pfc.gui.setTabById(this.pfc_tabid); return false;} li_div.appendChild(a1); + + if (pfc_displaytabimage) + { + var img = document.createElement('img'); + img.setAttribute('id', 'pfc_tabimg'+tabid); + if (type == 'ch') + img.setAttribute('src', pfc.res.getFileUrl('images/ch.gif')); + if (type == 'pv') + img.setAttribute('src', pfc.res.getFileUrl('images/pv.gif')); + a1.appendChild(img); + } - var a2 = document.createElement('a'); - a2.pfc_tabid = tabid; - a2.onclick = function(){ - var res = confirm(pfc.res.getLabel('Do you really want to leave this room ?')); - if (res == true) pfc.sendRequest('/leave', this.pfc_tabid); return false; + // on ajoute le nom du channel + a1.appendChild(document.createTextNode(name)); + + if (pfc_displaytabclosebutton) + { + var a2 = document.createElement('a'); + a2.pfc_tabid = tabid; + a2.onclick = function(){ + var res = confirm(pfc.res.getLabel('Do you really want to leave this room ?')); + if (res == true) pfc.sendRequest('/leave', this.pfc_tabid); return false; + } + a2.alt = pfc.res.getLabel('Close this tab'); + a2.title = a2.alt; + a2.setAttribute('class', 'pfc_tabclose'); + a2.setAttribute('className', 'pfc_tabclose'); // for IE6 + var img = document.createElement('img'); + img.setAttribute('src', pfc.res.getFileUrl('images/tab_remove.gif')); + a2.appendChild(img); + li_div.appendChild(a2); } - a2.alt = pfc.res.getLabel('Close this tab'); - a2.title = a2.alt; - // Element.addClassName(a2, 'pfc_tabclose'); - a2.setAttribute('class', 'pfc_tabclose'); - a2.setAttribute('className', 'pfc_tabclose'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('src', pfc.res.getFileUrl('images/tab_remove.gif')); - a2.appendChild(img); - li_div.appendChild(a2); var div_content = document.createElement('div'); div_content.setAttribute('id', 'pfc_channel_content'+tabid); @@ -291,6 +300,8 @@ { var tabpos = indexOf(this.tabids, tabid); var tabtype = this.tabtypes[tabpos]; + + // handle the tab's image modification var img = $('pfc_tabimg'+tabid); if (img) { @@ -299,6 +310,24 @@ if (tabtype == 'pv') img.src = pfc.res.getFileUrl('images/pv-active.gif'); } + + // handle the blicking effect + var div = $('pfc_tabdiv'+tabid); + if (div) + { + if (div.blinkstat == true) + { + div.setAttribute('class', 'pfc_tabblink1'); + div.setAttribute('className', 'pfc_tabblink1'); // for IE6 + } + else + { + div.setAttribute('class', 'pfc_tabblink2'); + div.setAttribute('className', 'pfc_tabblink2'); // for IE6 + } + div.blinkstat = !div.blinkstat; + div.blinktimeout = setTimeout('pfc.gui.notifyTab(\''+tabid+'\');', 500); + } }, /** @@ -308,6 +337,8 @@ { var tabpos = indexOf(this.tabids, tabid); var tabtype = this.tabtypes[tabpos]; + + // restore the tab's image var img = $('pfc_tabimg'+tabid); if (img) { @@ -316,6 +347,15 @@ if (tabtype == 'pv') img.src = pfc.res.getFileUrl('images/pv.gif'); } + + // stop the blinking effect + var div = $('pfc_tabdiv'+tabid); + if (div) + { + div.removeAttribute('class'); + div.removeAttribute('className'); // for IE6 + clearTimeout(div.blinktimeout); + } }, loadSmileyBox: function() Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/src/pfcglobalconfig.class.php 2006-10-08 19:02:16 UTC (rev 827) @@ -78,6 +78,8 @@ var $openlinknewwindow = true; // used to open the links in a new window var $notify_window = true; // true : appends a prefix to the window title with the number of new posted messages + var $displaytabimage = true; + var $displaytabclosebutton = true; var $showwhosonline = true; var $showsmileys = true; var $btn_sh_whosonline = true; // display show/hide button for who is online Modified: trunk/themes/default/style.css =================================================================== --- trunk/themes/default/style.css 2006-10-07 18:30:07 UTC (rev 826) +++ trunk/themes/default/style.css 2006-10-08 19:02:16 UTC (rev 827) @@ -81,6 +81,10 @@ margin-left: 4px; cursor: pointer; } +/* blinking stuff (tab notifications) */ +ul#pfc_channels_list li div.pfc_tabblink2 { + background-color: #FFF; +} div.pfc_chat { @@ -105,10 +109,11 @@ /* height: 100%;*/ color: #000; /* colors can be overriden by js nickname colorization */ background-color: #FFF; + + /* borders are drawn by this image background */ background-image: url("proxy.php?p=default/images/online-separator.gif"); background-position: left; background-repeat: repeat-y; - /* borders are drawn by the javascript routines */ } div.pfc_online ul { list-style-type: none; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |