[Phpfreechat-svn] SF.net SVN: phpfreechat: [540] trunk/themes/default/templates/pfcgui.js.tpl.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-05-31 15:40:18
|
Revision: 540 Author: kerphi Date: 2006-05-31 08:40:12 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=540&view=rev Log Message: ----------- Behavior improvements: when leaving a room, a pop up ask if the user really want to quit. And the current tab stay active when a none active tab is removed. Modified Paths: -------------- trunk/themes/default/templates/pfcgui.js.tpl.php Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-05-31 15:23:17 UTC (rev 539) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-05-31 15:40:12 UTC (rev 540) @@ -19,7 +19,6 @@ this.onlinecontent = $H(); this.smileycontent = $H(); this.scrollpos = $H(); - // this.tabprefixs = Array(); }, /** @@ -166,8 +165,8 @@ this.tabids = this.tabids.without(this.tabids[tabpos]); this.tabs = this.tabs.without(this.tabs[tabpos]); this.tabtypes = this.tabtypes.without(this.tabtypes[tabpos]); - // this.tabprefixs = this.tabprefixs.without(this.tabprefixs[tabpos]); - tabpos--; if (tabpos<0) tabpos = 0; + tabpos = this.tabids.indexOf(this.getTabId()); + if (tabpos<0) tabpos = 0; this.setTabById(this.tabids[tabpos]); return name; }, @@ -198,7 +197,6 @@ this.tabs.push(name); this.tabids.push(tabid); this.tabtypes.push(type); - // this.tabprefixs.push(prefix); var li_title = document.createElement('li'); li_title.setAttribute('id', '<?php echo $prefix; ?>channel_title'+tabid); @@ -223,7 +221,10 @@ var a2 = document.createElement('a'); a2.pfc_tabid = tabid; - a2.onclick = function(){pfc.sendRequest('/leave', this.pfc_tabid); return false;} + a2.onclick = function(){ + var res = confirm('<?php echo _pfc("Do you really want to leave this room ?"); ?>'); + if (res == true) pfc.sendRequest('/leave', this.pfc_tabid); return false; + } a2.alt = this.i18n._('Close this tab'); a2.title = a2.alt; Element.addClassName(a2, '<?php echo $prefix; ?>tabclose'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |