[Phpfreechat-svn] SF.net SVN: phpfreechat: [556] trunk/themes/default/templates
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-06-08 19:35:16
|
Revision: 556 Author: kerphi Date: 2006-06-08 12:35:08 -0700 (Thu, 08 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=556&view=rev Log Message: ----------- Change the smileys box position : move it below the input area Modified Paths: -------------- trunk/themes/default/templates/chat.html.tpl.php trunk/themes/default/templates/pfcclient.js.tpl.php trunk/themes/default/templates/pfcgui.js.tpl.php trunk/themes/default/templates/style.css.tpl.php Modified: trunk/themes/default/templates/chat.html.tpl.php =================================================================== --- trunk/themes/default/templates/chat.html.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/chat.html.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -58,7 +58,13 @@ echo '<img src="'.$c->getFileUrlFromTheme('images/color_'.$bbc.'.gif').'" alt="color '.$bbc.'" onclick="pfc.switch_text_color(\''.$bbc.'\')" id="'.$prefix.'color_'.$bbc.'" class="'.$prefix.'color" /> '; } ?> - </div> + </div> + + <div id="<?php echo $prefix; ?>smileys"> + <?php foreach($smileys as $s_file => $s_str) { ?> + <img src="<?php echo $s_file; ?>" alt="<?php echo $s_str[0]; ?>" title="<?php echo $s_str[0]; ?>" onclick="pfc.insertSmiley(String('<?php echo $s_str[0]; ?>').unescapeHTML());" /> +<?php } ?> + </div> </div> </div> Modified: trunk/themes/default/templates/pfcclient.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/pfcclient.js.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -225,7 +225,6 @@ // do not switch to the new created tab // keep it in the background // this.gui.setTabById(tabid); - this.refresh_Smileys(); this.refresh_WhosOnline(); } else @@ -1367,16 +1366,11 @@ refresh_Smileys: function() { // first of all : show/hide the smiley box - var root = $('<?php echo $prefix; ?>channels_content'); - var contentlist = this.getElementsByClassName(root, '<?php echo $prefix; ?>smileys', ''); - for(var i = 0; i < contentlist.length; i++) - { - var content = contentlist[i]; - if (this.showsmileys) - content.style.display = 'block'; - else - content.style.display = 'none'; - } + var content = $('<?php echo $prefix; ?>smileys'); + if (this.showsmileys) + content.style.display = 'block'; + else + content.style.display = 'none'; // then switch the button icon var btn = $('<?php echo $prefix; ?>showHideSmileysbtn'); @@ -1398,8 +1392,6 @@ btn.title = btn.alt; } } - this.refresh_Chat(); - this.refresh_OnlineAndSmileys(); }, @@ -1449,56 +1441,8 @@ btn.title = btn.alt; } this.refresh_Chat(); - this.refresh_OnlineAndSmileys(); }, - - /** - * Resize online and smileys - */ - refresh_OnlineAndSmileys: function() - { - var style = $H(); - var root = $('<?php echo $prefix; ?>channels_content'); - // resize the smiley area - var contentlist = this.getElementsByClassName(root, '<?php echo $prefix; ?>smileys', ''); - for(var i = 0; i < contentlist.length; i++) - { - var smileydiv = contentlist[i]; - if (this.showwhosonline) - { - style['height'] = ''; - Element.setStyle(smileydiv, style); - } - else - { - style['height'] = '100%'; - Element.setStyle(smileydiv, style); - } - } - - // resize the nickname list area - var contentlist = this.getElementsByClassName(root, '<?php echo $prefix; ?>online', ''); - for(var i = 0; i < contentlist.length; i++) - { - var onlinediv = contentlist[i]; - if (this.showsmileys) - { - style['height'] = ''; - Element.setStyle(onlinediv, style); - } - else - { - style['height'] = '100%'; - Element.setStyle(onlinediv, style); - } - } - - // for IE7 CSS refresh - // if fixes the smiley and online boxes resize problem on IE6 - if (document.recalc) setTimeout('document.recalc(true);', 0); - }, - /** * Resize chat */ @@ -1511,7 +1455,7 @@ { var chatdiv = contentlist[i]; var style = $H(); - if (!this.showwhosonline && !this.showsmileys) + if (!this.showwhosonline) { style['width'] = '100%'; Element.setStyle(chatdiv, style); Modified: trunk/themes/default/templates/pfcgui.js.tpl.php =================================================================== --- trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/pfcgui.js.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -17,7 +17,6 @@ this.tabtypes = Array(); this.chatcontent = $H(); this.onlinecontent = $H(); - this.smileycontent = $H(); this.scrollpos = $H(); }, @@ -93,7 +92,7 @@ cc.setAttribute('id', '<?php echo $prefix; ?>chat_'+tabid); Element.addClassName(cc, '<?php echo $prefix; ?>chat'); // I set the border style here because seting it in the CSS is not taken in account - cc.style.borderRight = "1px solid #555"; + //cc.style.borderRight = "1px solid #555"; this.chatcontent[tabid] = cc; return cc; }, @@ -107,7 +106,7 @@ oc.setAttribute('id', '<?php echo $prefix; ?>online_'+tabid); Element.addClassName(oc, '<?php echo $prefix; ?>online'); // I set the border style here because seting it in the CSS is not taken in account - oc.style.borderBottom = "1px solid #555"; + oc.style.borderLeft = "1px solid #555"; // Create a dummy div to add padding var div = document.createElement('div'); @@ -117,33 +116,6 @@ this.onlinecontent[tabid] = oc; return oc; }, - getSmileysContentFromTabId: function(tabid) - { - // return the smileys content if it exists - var sc = this.smileycontent[tabid]; - if (sc) return sc; - - sc = document.createElement('div'); - sc.setAttribute('id', '<?php echo $prefix; ?>smileys_'+tabid); - Element.addClassName(sc, '<?php echo $prefix; ?>smileys'); - // I set the border style here because setting it in the CSS is not take into account - sc.style.borderTop = "1px solid #555"; - var div = document.createElement('div'); - div.style.padding = "5px"; - var s = null; - <?php foreach($smileys as $s_file => $s_str) { ?> - s = document.createElement('img'); - s.setAttribute('src','<?php echo $s_file; ?>'); - s.setAttribute('alt','<?php echo $s_str[0]; ?>'); - s.setAttribute('title','<?php echo $s_str[0]; ?>'); - s.setAttribute('onclick','pfc.insertSmiley(String(\'<?php echo $s_str[0]; ?>\').unescapeHTML());'); - div.appendChild(s); - <?php } ?> - sc.appendChild(div); - - this.smileycontent[tabid] = sc; - return sc; - }, removeTabById: function(tabid) { @@ -240,10 +212,8 @@ var div_chat = this.getChatContentFromTabId(tabid); var div_online = this.getOnlineContentFromTabId(tabid); - var div_smileys = this.getSmileysContentFromTabId(tabid); div_content.appendChild(div_chat); div_content.appendChild(div_online); - div_content.appendChild(div_smileys); $('<?php echo $prefix; ?>channels_list').appendChild(li_title); $('<?php echo $prefix; ?>channels_content').appendChild(div_content); Modified: trunk/themes/default/templates/style.css.tpl.php =================================================================== --- trunk/themes/default/templates/style.css.tpl.php 2006-06-08 19:33:09 UTC (rev 555) +++ trunk/themes/default/templates/style.css.tpl.php 2006-06-08 19:35:08 UTC (rev 556) @@ -95,18 +95,6 @@ overflow: auto; } -div.<?php echo $prefix; ?>smileys { - position: absolute; - bottom: 0; - right: 0; - padding: 0; - width: 20%; - height: 60%; - overflow: auto; - text-align: center; - background-color: #FFF; - /* borders are drawn by the javascript routines */ -} div.<?php echo $prefix; ?>online { position: absolute; right: 0; @@ -114,7 +102,7 @@ padding: 0; overflow: auto; width: 20%; - height: 40%; + height: 100%; color: #000; /* colors can be overriden by js nickname colorization */ background-color: #FFF; /* borders are drawn by the javascript routines */ @@ -257,3 +245,13 @@ cursor: crosshair; } +div#<?php echo $prefix; ?>smileys { + background-color: #FFF; + border: 1px solid #555; + padding: 4px; + margin-top: 4px; +} + +div#<?php echo $prefix; ?>smileys img { + cursor: pointer; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |