• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

displaytabclosebutton property

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
1 post • Page 1 of 1

Postby h4ever » Tue Jun 08, 2010 9:58 pm

NEW FEATURE CREATED
I added a property displaytabclosebutton to pfcGlobalConfig.class .
This way you will not see the dialog box to confirm leaving room.
This is not official code. pfcGlobalConfig.class code:

/**
* <p>New Parameter to abort the confirmation before closing tab
* (Default value: false)</p>
*/
var $displaytabconfirmclose = false;

* * * * * * * *

index.php

$params["displaytabconfirmclose"] = false; // New Parameter to abort the confirmation before closing tab

* * * * * * * *
public/js/pfcgui.js (L 253 the IF block changed):

if (pfc_displaytabclosebutton || type == 'pv')
{
var a2 = document.createElement('a');
a2.pfc_tabid = tabid;
a2.pfc_tabname = name;
a2.pfc_tabtype = type;
a2.onclick = function(){
var msg = (type == 'pv' ? 'Are you sure you want to close this tab ?' :
'Do you really want to leave this room ?');
if (pfc_displaytabconfirmclose) var res = confirm(pfc.res.getLabel(msg));
else var res = true;
if (res == true)
pfc.sendRequest('/leave',this.pfc_tabid);
return false;
}

* * * * * *

themes/default/chat.js.tpl.php (L 57 added):

var pfc_displaytabconfirmclose = <?php echo $json->encode($displaytabconfirmclose); ?>;
Last edited by h4ever on Tue Jun 08, 2010 10:10 pm, edited 1 time in total.
h4ever
Member
 
Posts: 43
Joined: Fri Jun 04, 2010 11:10 am
Top

Post a reply
1 post • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: Google [Bot] and 11 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub