Thread: [Phpfreechat-svn] SF.net SVN: phpfreechat: [678] trunk/src/client
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-08-18 15:03:34
|
Revision: 678 Author: kerphi Date: 2006-08-18 08:03:13 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=678&view=rev Log Message: ----------- Bug fix: the nickname box position was broken on IE6, I replaced it by a <p> with appropriate css rules. Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js trunk/themes/default/style.css Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-08-17 21:10:14 UTC (rev 677) +++ trunk/src/client/pfcclient.js 2006-08-18 15:03:13 UTC (rev 678) @@ -301,7 +301,7 @@ if (resp == "ok" || resp == "notchanged" || resp == "changed" || resp == "connected") { - this.el_handle.value = param; + this.el_handle.innerHTML = param; this.nickname = param; } else if (resp == "isused") Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-08-17 21:10:14 UTC (rev 677) +++ trunk/src/client/pfcgui.js 2006-08-18 15:03:13 UTC (rev 678) @@ -381,11 +381,10 @@ cmdcontainer.appendChild(logo); // handle box : <input id="pfc_handle" type="button" ... - var handle = document.createElement('input'); + var handle = document.createElement('p'); handle.setAttribute('id', 'pfc_handle'); - handle.setAttribute('type', 'button'); handle.setAttribute('title', pfc.res.getLabel("Enter your nickname here")); - handle.setAttribute('value', pfc.nickname); + handle.appendChild(document.createTextNode(pfc.nickname)); handle.onclick = function(){ pfc.askNick(''); } cmdcontainer.appendChild(handle); Modified: trunk/themes/default/style.css =================================================================== --- trunk/themes/default/style.css 2006-08-17 21:10:14 UTC (rev 677) +++ trunk/themes/default/style.css 2006-08-18 15:03:13 UTC (rev 678) @@ -172,15 +172,24 @@ div#pfc_cmd_container { position: relative; margin-top: 5px; + margin-bottom: 5px; width: 100%; } +div#pfc_cmd_container * { + margin-right: 2px; +} -input#pfc_handle { - border: black solid 1px; - padding: 0 4px 0 4px; +p#pfc_handle { + display: inline; + cursor: pointer; + border: 1px solid #555; + padding: 2px 10px 2px 10px; color: black; - text-align: center; margin-bottom: 5px; + font-weight: bold; + background-color: #EEE; + font-size: 70%; /* these two line fix a display problem in IE6 : */ + vertical-align: middle; /* the nickname box bottom border is hidden without these lines */ } a#pfc_logo { @@ -202,6 +211,10 @@ /* border: 1px solid #000;*/ } +div#pfc_bbcode_container * { + margin-right: 2px; +} + div#pfc_errors { display: none; margin-top: 5px; @@ -255,6 +268,9 @@ padding: 4px; margin-top: 4px; } +div#pfc_smileys * { + margin-right: 2px; +} div#pfc_smileys img { cursor: pointer; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-08-22 12:24:33
|
Revision: 685 Author: kerphi Date: 2006-08-22 05:24:26 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=685&view=rev Log Message: ----------- [en] Add a popup dialog to ask some text for the bbcode buttons (thanks to Mephisto). [fr] Ajout d'un popup pour demander d'entrer du texte lorsque l'utilisateur a selectionn?\195?\169 un texte vide au moment d'appliquer un bbcode (merci ?\195?\160 Mephisto). Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-08-19 20:54:57 UTC (rev 684) +++ trunk/src/client/chat.js.tpl.php 2006-08-22 12:24:26 UTC (rev 685) @@ -57,31 +57,32 @@ <?php $labels_to_load = -array( "Do you really want to leave this room ?", - "Hide nickname marker", - "Show nickname marker", - "Hide dates and hours", - "Show dates and hours", - "Disconnect", - "Connect", - "Magnify", - "Cut down", - "Hide smiley box", - "Show smiley box", - "Hide online users box", - "Show online users box", - "Please enter your nickname", - "Private message", - "Close this tab", - "Enter your message here", - "Enter your nickname here", - "Bold", - "Italics", - "Underline", - "Delete", - "Mail", - "Color", - "PHP FREE CHAT [powered by phpFreeChat-%s]", +array( "Do you really want to leave this room ?", // _pfc + "Hide nickname marker", // _pfc + "Show nickname marker", // _pfc + "Hide dates and hours", // _pfc + "Show dates and hours", // _pfc + "Disconnect", // _pfc + "Connect", // _pfc + "Magnify", // _pfc + "Cut down", // _pfc + "Hide smiley box", // _pfc + "Show smiley box", // _pfc + "Hide online users box", // _pfc + "Show online users box", // _pfc + "Please enter your nickname", // _pfc + "Private message", // _pfc + "Close this tab", // _pfc + "Enter your message here", // _pfc + "Enter your nickname here", // _pfc + "Bold", // _pfc + "Italics", // _pfc + "Underline", // _pfc + "Delete", // _pfc + "Mail", // _pfc + "Color", // _pfc + "PHP FREE CHAT [powered by phpFreeChat-%s]", // _pfc + "Enter the text to format", // _pfc ); foreach($labels_to_load as $l) { Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-08-19 20:54:57 UTC (rev 684) +++ trunk/src/client/pfcclient.js 2006-08-22 12:24:26 UTC (rev 685) @@ -1185,8 +1185,15 @@ { msgfield.focus(); sel = document.selection.createRange(); - sel.text = open + sel.text + close; - msgfield.focus(); + var text = sel.text; + if (text == "") + text = prompt(this.res.getLabel('Enter the text to format'),''); + if (text.length > 0) + { + sel.text = open + text + close; + // @todo move the cursor just after the BBCODE, this doesn't work when the text to enclose is selected, IE6 keeps the whole selection active after the operation. + msgfield.focus(); + } } // Moz support @@ -1195,16 +1202,30 @@ var startPos = msgfield.selectionStart; var endPos = msgfield.selectionEnd; - msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length); - msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length; - msgfield.focus(); + var text = msgfield.value.substring(startPos, endPos); + var extralength = 0; + if (startPos == endPos) + { + text = prompt(this.res.getLabel('Enter the text to format'),''); + extralength = text.length; + } + if (text.length > 0) + { + msgfield.value = msgfield.value.substring(0, startPos) + open + text + close + msgfield.value.substring(endPos, msgfield.value.length); + msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + extralength + close.length; + msgfield.focus(); + } } // Fallback support for other browsers else { - msgfield.value += open + close; - msgfield.focus(); + var text = prompt(this.res.getLabel('Enter the text to format'),''); + if (text.length > 0) + { + msgfield.value += open + text + close; + msgfield.focus(); + } } return; }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-08-22 13:58:49
|
Revision: 690 Author: kerphi Date: 2006-08-22 06:58:44 -0700 (Tue, 22 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=690&view=rev Log Message: ----------- Fix the insert_text prompt feature Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-08-22 13:46:23 UTC (rev 689) +++ trunk/src/client/pfcclient.js 2006-08-22 13:58:44 UTC (rev 690) @@ -656,7 +656,7 @@ line += ' <span class="pfc_nick">'; line += '‹'; line += '<span '; - line += 'onclick="pfc.insert_text(\'' + sender + ', \',\'\')" '; + line += 'onclick="pfc.insert_text(\'' + sender + ', \',\'\',false)" '; line += 'class="pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(sender)) +'">'; line += sender; line += '</span>'; @@ -791,7 +791,7 @@ var nobr = document.createElement('nobr'); var span = document.createElement('span'); span.pfc_nick = nicks[i]; - span.onclick = function(){pfc.insert_text(this.pfc_nick+", ",""); return false;} + span.onclick = function(){pfc.insert_text(this.pfc_nick+", ","",false); return false;} span.appendChild(document.createTextNode(nicks[i])); span.setAttribute('class', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); span.setAttribute('className', 'pfc_nickmarker pfc_nick_'+ hex_md5(_to_utf8(nicks[i]))); // for IE6 @@ -1176,7 +1176,7 @@ /** * BBcode ToolBar */ - insert_text: function(open, close) + insert_text: function(open, close, promptifselempty) { var msgfield = $('pfc_words'); @@ -1186,9 +1186,10 @@ msgfield.focus(); sel = document.selection.createRange(); var text = sel.text; - if (text == "") + if (text == "" && promptifselempty) text = prompt(this.res.getLabel('Enter the text to format'),''); - if (text.length > 0) + if (text == null) text = ""; + if (text.length > 0 || !promptifselempty) { sel.text = open + text + close; // @todo move the cursor just after the BBCODE, this doesn't work when the text to enclose is selected, IE6 keeps the whole selection active after the operation. @@ -1204,12 +1205,12 @@ var text = msgfield.value.substring(startPos, endPos); var extralength = 0; - if (startPos == endPos) + if (startPos == endPos && promptifselempty) { text = prompt(this.res.getLabel('Enter the text to format'),''); extralength = text.length; } - if (text.length > 0) + if (text.length > 0 || !promptifselempty) { msgfield.value = msgfield.value.substring(0, startPos) + open + text + close + msgfield.value.substring(endPos, msgfield.value.length); msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + extralength + close.length; @@ -1221,7 +1222,7 @@ else { var text = prompt(this.res.getLabel('Enter the text to format'),''); - if (text.length > 0) + if (text.length > 0 || !promptifselempty) { msgfield.value += open + text + close; msgfield.focus(); Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-08-22 13:46:23 UTC (rev 689) +++ trunk/src/client/pfcgui.js 2006-08-22 13:58:44 UTC (rev 690) @@ -474,7 +474,7 @@ img.setAttribute('className', 'pfc_bt_strong'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Bold")); img.setAttribute('src', pfc.res.getFileUrl('images/bt_strong.gif')); - img.onclick = function(){ pfc.insert_text('[b]','[/b]'); } + img.onclick = function(){ pfc.insert_text('[b]','[/b]',true); } btn.appendChild(img); bbcontainer.appendChild(btn); @@ -487,7 +487,7 @@ img.setAttribute('className', 'pfc_bt_italics'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Italics")); img.setAttribute('src', pfc.res.getFileUrl('images/bt_em.gif')); - img.onclick = function(){ pfc.insert_text('[i]','[/i]'); } + img.onclick = function(){ pfc.insert_text('[i]','[/i]',true); } btn.appendChild(img); bbcontainer.appendChild(btn); @@ -500,7 +500,7 @@ img.setAttribute('className', 'pfc_bt_underline'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Underline")); img.setAttribute('src', pfc.res.getFileUrl('images/bt_ins.gif')); - img.onclick = function(){ pfc.insert_text('[u]','[/u]'); } + img.onclick = function(){ pfc.insert_text('[u]','[/u]',true); } btn.appendChild(img); bbcontainer.appendChild(btn); @@ -513,7 +513,7 @@ img.setAttribute('className', 'pfc_bt_delete'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Delete")); img.setAttribute('src', pfc.res.getFileUrl('images/bt_del.gif')); - img.onclick = function(){ pfc.insert_text('[s]','[/s]'); } + img.onclick = function(){ pfc.insert_text('[s]','[/s]',true); } btn.appendChild(img); bbcontainer.appendChild(btn); @@ -526,7 +526,7 @@ img.setAttribute('className', 'pfc_bt_mail'); // for IE6 img.setAttribute('title', pfc.res.getLabel("Mail")); img.setAttribute('src', pfc.res.getFileUrl('images/bt_mail.gif')); - img.onclick = function(){ pfc.insert_text('[email]','[/email]'); } + img.onclick = function(){ pfc.insert_text('[email]','[/email]',true); } btn.appendChild(img); bbcontainer.appendChild(btn); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-08-26 12:02:01
|
Revision: 706 Author: kerphi Date: 2006-08-26 05:01:52 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=706&view=rev Log Message: ----------- [en] Bug fix: each commands which displayed an info message (/identify, /rehash ...) just cleared the screen on IE6. I found a workaround by moving the info message into the red error box. [fr] Bug fix?\194?\160: toutes les commandes qui affichaient un message en retour (/identify, /rehash ...) provoquaient l'effacement de l'?\195?\169cran sous IE6. J'ai trouv?\195?\169 un moyen de contourner le probl?\195?\168me en affichant le message d'information dans la boite des erreurs. Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js trunk/themes/default/style.css Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-08-26 09:31:12 UTC (rev 705) +++ trunk/src/client/pfcclient.js 2006-08-26 12:01:52 UTC (rev 706) @@ -601,28 +601,26 @@ displayMsg: function( cmd, msg ) { + this.setError(msg); + + // @todo find a better crossbrowser way to display messages +/* // get the current selected tab container var tabid = this.gui.getTabId(); var container = this.gui.getChatContentFromTabId(tabid); + // to fix IE6 display bug + // http://sourceforge.net/tracker/index.php?func=detail&aid=1545403&group_id=158880&atid=809601 div = document.createElement('div'); - div.style.padding = "2px 5px 2px 5px"; - - pre = document.createElement('pre'); - pre.setAttribute('class', 'pfc_info pfc_info_'+cmd); - pre.setAttribute('className', 'pfc_info pfc_info_'+cmd); // for IE6 - // Element.addClassName(pre, 'pfc_info'); - // Element.addClassName(pre, 'pfc_info_'+cmd); - pre.style.border = "1px solid #555"; - pre.style.padding = "5px"; - pre.innerHTML = msg; - div.appendChild(pre); - + // div.style.padding = "2px 5px 2px 5px"; // this will clear the screen in IE6 + div.innerHTML = '<div class="pfc_info pfc_info_'+cmd+'" style="margin:5px">'+msg+'</div>'; + // finaly append this to the message list container.appendChild(div); this.gui.scrollDown(tabid, div); +*/ }, - + handleComingRequest: function( cmds ) { var msg_html = $H(); Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-08-26 09:31:12 UTC (rev 705) +++ trunk/src/client/pfcgui.js 2006-08-26 12:01:52 UTC (rev 706) @@ -561,16 +561,16 @@ clist.appendChild(img); } + // error box : <p id="pfc_errors"> + var errorbox = document.createElement('div'); + errorbox.setAttribute('id', 'pfc_errors'); + inputcontainer.appendChild(errorbox); + // smiley box : <div id="pfc_smileys"> var smileybox = document.createElement('div'); smileybox.setAttribute('id', 'pfc_smileys'); inputcontainer.appendChild(smileybox); this.loadSmileyBox(); - - // error box : <p id="pfc_errors"> - var errorbox = document.createElement('div'); - errorbox.setAttribute('id', 'pfc_errors'); - contentexp.appendChild(errorbox); } }; Modified: trunk/themes/default/style.css =================================================================== --- trunk/themes/default/style.css 2006-08-26 09:31:12 UTC (rev 705) +++ trunk/themes/default/style.css 2006-08-26 12:01:52 UTC (rev 706) @@ -217,16 +217,13 @@ div#pfc_errors { display: none; - margin-top: 5px; - padding: 2px; - height: 18px; - + padding: 5px; border: 1px solid #555; - color: #FC4A1F; - background-color: #FFBA76; - text-align: center; + color: #EC4B0F; + background-color: #FFBB77; font-style: italic; - font-weight: bold; + font-family: monospace; + font-size: 90%; } /* commands */ @@ -243,12 +240,19 @@ } /* commands info */ -pre.pfc_info { +.pfc_info { color: #888; + + /* to fix IE6 display bug */ + /* http://sourceforge.net/tracker/index.php?func=detail&aid=1545403&group_id=158880&atid=809601 */ + font-family: sans-serif; /* do NOT setup monospace font or it will not work in IE6 */ + font-style: italic; background-color: #EEE; + font-size: 80%; } + div#pfc_colorlist { display: none; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-11 16:36:41
|
Revision: 751 http://svn.sourceforge.net/phpfreechat/?rev=751&view=rev Author: kerphi Date: 2006-09-11 09:36:33 -0700 (Mon, 11 Sep 2006) Log Message: ----------- working progress : window notifier Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-11 11:55:53 UTC (rev 750) +++ trunk/src/client/pfcclient.js 2006-09-11 16:36:33 UTC (rev 751) @@ -690,14 +690,16 @@ line += '<span class="pfc_words">'+ this.parseMessage(param) +'</span> '; line += '</div>'; - // notify the hidden tab a message has been received - // don't notify anything if this is old messages if (oldmsg == 0) if (cmd == 'send' || cmd == 'me') { + // notify the hidden tab a message has been received + // don't notify anything if this is old messages var tabid = recipientid; if (this.gui.getTabId() != tabid) this.gui.notifyTab(tabid); + // notify the window (change the title) + this.gui.notifyWindow(); } if (msg_html[recipientid] == null) Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-11 11:55:53 UTC (rev 750) +++ trunk/src/client/pfcgui.js 2006-09-11 16:36:33 UTC (rev 751) @@ -263,6 +263,16 @@ }, /** + * This function change the window title in order to catch the attention + */ + notifyWindow: function() + { + var el_title = document.getElementsByTagName('title'); +// el_title[0].innerHTML = '[*]'; + }, + + + /** * This function change the tab icon in order to catch the attention */ notifyTab: function(tabid) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |