[Phpfreechat-svn] SF.net SVN: phpfreechat: [753] trunk
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-09-12 07:48:26
|
Revision: 753 http://svn.sourceforge.net/phpfreechat/?rev=753&view=rev Author: kerphi Date: 2006-09-12 00:48:17 -0700 (Tue, 12 Sep 2006) Log Message: ----------- [en] New feature: when a new message is posted, the unactive window title is prefixed by the number of new messages (this can be disabled by setting to false the notify_window parameter). [fr] Nouvelle fonctionnalit?\195?\169 : lorsqu'un nouveau message est envoy?\195?\169 dans une fenetre de chat inactive, le titre de cette fenetre est prefixe par le nombre de nouveau messages envoyes (ce comportement peut etre desactive en mettant a false le parametre notify_window) Modified Paths: -------------- trunk/lib/javascript/activity.js trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js trunk/src/pfcglobalconfig.class.php Modified: trunk/lib/javascript/activity.js =================================================================== --- trunk/lib/javascript/activity.js 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/lib/javascript/activity.js 2006-09-12 07:48:17 UTC (rev 753) @@ -3,22 +3,21 @@ initialize: function(subject) { this.onunactivate = function() {}; - this.onactivate = function() {}; + this.onactivate = function() {}; + this.subject = subject; this.isactive = true; - Event.observe(subject, 'mousemove', this._OnFocus, false); - Event.observe(subject, 'mouseout', this._OnBlur, false); + Event.observe(subject, 'mousemove', this._OnFocus.bindAsEventListener(this), false); + Event.observe(subject, 'mouseout', this._OnBlur.bindAsEventListener(this), false); }, _OnFocus: function(e) { -// document.title = 'focus'; this.isactive = true; -// this.onactivate(); + if (this.onactivate) this.onactivate(); }, _OnBlur: function(e) { -// document.title = 'blur'; this.isactive = false; -// this.onunactivate(); + if (this.onunactivate) this.onunactivate(); }, isActive: function() { Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/client/chat.js.tpl.php 2006-09-12 07:48:17 UTC (rev 753) @@ -16,6 +16,7 @@ var pfc_btn_sh_smileys = <?php echo $btn_sh_smileys ? "true" : "false"; ?>; var pfc_btn_sh_whosonline = <?php echo $btn_sh_whosonline ? "true" : "false"; ?>; var pfc_connect_at_startup = <?php echo $connect_at_startup ? "true" : "false"; ?>; +var pfc_notify_window = <?php echo $notify_window ? "true" : "false"; ?>; var pfc_defaultchan = Array(<?php function quoteandescape($v) { return "'".addslashes($v)."'"; } $list = array(); foreach($c->channels as $ch) {$list[] = $ch; } Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/client/pfcclient.js 2006-09-12 07:48:17 UTC (rev 753) @@ -62,19 +62,19 @@ this.el_errors = $('pfc_errors'); this.detectactivity = new DetectActivity(this.el_container); -// this.detectactivity.onunactivate = this.gui.unnotifyWindow; + // restore the window title when user come back to the active zone + if (pfc_notify_window) this.detectactivity.onunactivate = this.gui.unnotifyWindow; /* the events callbacks */ - this.el_words.onkeypress = this.callbackWords_OnKeypress.bindAsEventListener(this); - this.el_words.onkeydown = this.callbackWords_OnKeydown.bindAsEventListener(this); - this.el_words.onfocus = this.callbackWords_OnFocus.bindAsEventListener(this); - this.el_handle.onkeydown = this.callbackHandle_OnKeydown.bindAsEventListener(this); - this.el_handle.onchange = this.callbackHandle_OnChange.bindAsEventListener(this); - this.el_container.onmousemove = this.callbackContainer_OnMousemove.bindAsEventListener(this); - this.el_container.onmousedown = this.callbackContainer_OnMousedown.bindAsEventListener(this); - this.el_container.onmouseup = this.callbackContainer_OnMouseup.bindAsEventListener(this); - document.body.onunload = this.callback_OnUnload.bindAsEventListener(this); - + Event.observe(this.el_words, 'keypress', this.callbackWords_OnKeypress.bindAsEventListener(this), false); + Event.observe(this.el_words, 'keydown', this.callbackWords_OnKeydown.bindAsEventListener(this), false); + Event.observe(this.el_words, 'focus', this.callbackWords_OnFocus.bindAsEventListener(this), false); + Event.observe(this.el_handle, 'keydown', this.callbackHandle_OnKeydown.bindAsEventListener(this), false); + Event.observe(this.el_handle, 'change', this.callbackHandle_OnChange.bindAsEventListener(this), false); + Event.observe(this.el_container, 'mousemove', this.callbackContainer_OnMousemove.bindAsEventListener(this), false); + Event.observe(this.el_container, 'mousedown', this.callbackContainer_OnMousedown.bindAsEventListener(this), false); + Event.observe(this.el_container, 'mouseup', this.callbackContainer_OnMouseup.bindAsEventListener(this), false); + Event.observe(document.body, 'unload', this.callback_OnUnload.bindAsEventListener(this), false); }, refreshGUI: function() @@ -703,7 +703,7 @@ if (this.gui.getTabId() != tabid) this.gui.notifyTab(tabid); // notify the window (change the title) - if (!this.detectactivity.isActive()) + if (!this.detectactivity.isActive() && pfc_notify_window) this.gui.notifyWindow(); } Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/client/pfcgui.js 2006-09-12 07:48:17 UTC (rev 753) @@ -268,7 +268,6 @@ */ notifyWindow: function() { -//alert(this.windownotifynb); this.windownotifynb += 1; var rx = new RegExp('^\\[[0-9]+\\](.*)','ig'); document.title = document.title.replace(rx,'$1'); Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/pfcglobalconfig.class.php 2006-09-12 07:48:17 UTC (rev 753) @@ -65,6 +65,7 @@ var $nickmarker = true; // show/hide nicknames colors var $clock = true; // show/hide dates and hours 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 $showwhosonline = true; var $showsmileys = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |