📄 pfcclient.js.tpl.php
字号:
this.colorizeNicks($('<?php echo $prefix; ?>online')); } else { nickmarker_icon.src = "<?php echo $c->getFileUrlFromTheme('images/color-off.gif'); ?>"; nickmarker_icon.alt = this.i18n.show_nickname_color; nickmarker_icon.title = nickmarker_icon.alt; var elts = this.getElementsByClassName(root, '<?php echo $prefix; ?>nickmarker', ''); for(var i = 0; elts.length > i; i++) { /* this is not supported in konqueror =>>> elts[i].removeAttribute('style');*/ elts[i].style.color = ''; } var elts = this.getElementsByClassName($('<?php echo $prefix; ?>online'), '<?php echo $prefix; ?>nickmarker', ''); for(var i = 0; elts.length > i; i++) { /* this is not supported in konqueror =>>> elts[i].removeAttribute('style');*/ elts[i].style.color = ''; } } }, /** * Date/Hour show/hide */ clock_swap: function() { if (this.clock) { this.clock = false; } else { this.clock = true; } this.refresh_clock(); setCookie('<?php echo $prefix; ?>clock', this.clock); }, refresh_clock: function( root ) { var clock_icon = $('<?php echo $prefix; ?>clock'); if (!root) root = $('<?php echo $prefix; ?>chat'); if (this.clock) { clock_icon.src = "<?php echo $c->getFileUrlFromTheme('images/clock-on.gif'); ?>"; clock_icon.alt = this.i18n.hide_clock; clock_icon.title = clock_icon.alt; this.showClass(root, '<?php echo $prefix; ?>date', '<?php echo $prefix; ?>invisible', true); this.showClass(root, '<?php echo $prefix; ?>heure', '<?php echo $prefix; ?>invisible', true); } else { clock_icon.src = "<?php echo $c->getFileUrlFromTheme('images/clock-off.gif'); ?>"; clock_icon.alt = this.i18n.show_clock; clock_icon.title = clock_icon.alt; this.showClass(root, '<?php echo $prefix; ?>date', '<?php echo $prefix; ?>invisible', false); this.showClass(root, '<?php echo $prefix; ?>heure', '<?php echo $prefix; ?>invisible', false); } /* browser automaticaly scroll up misteriously when showing the dates */ $('<?php echo $prefix; ?>chat').scrollTop += 30; }, /** * Connect/disconnect button */ connect_disconnect: function() { if (this.isconnected) this.handleRequest('/quit'); else this.handleRequest('/connect'); }, refresh_loginlogout: function() { var loginlogout_icon = $('<?php echo $prefix; ?>loginlogout'); if (this.isconnected) { this.updateNickList(this.nicklist); loginlogout_icon.src = "<?php echo $c->getFileUrlFromTheme('images/logout.gif'); ?>"; loginlogout_icon.alt = this.i18n.logout; loginlogout_icon.title = loginlogout_icon.alt; } else { this.clearMessages(); this.clearNickList(); loginlogout_icon.src = "<?php echo $c->getFileUrlFromTheme('images/login.gif'); ?>"; loginlogout_icon.alt = this.i18n.login; loginlogout_icon.title = loginlogout_icon.alt; } }, /** * Minimize/Maximized the chat zone */ swap_minimize_maximize: function() { if (this.minmax_status) { this.minmax_status = false; } else { this.minmax_status = true; } setCookie('<?php echo $prefix; ?>minmax_status', this.minmax_status); this.refresh_minimize_maximize(); }, refresh_minimize_maximize: function() { var content = $('<?php echo $prefix; ?>content_expandable'); var btn = $('<?php echo $prefix; ?>minmax'); if (this.minmax_status) { btn.src = "<?php echo $c->getFileUrlFromTheme('images/maximize.gif'); ?>"; btn.alt = this.i18n.maximize; btn.title = btn.alt; content.style.display = 'none'; } else { btn.src = "<?php echo $c->getFileUrlFromTheme('images/minimize.gif'); ?>"; btn.alt = this.i18n.minimize; btn.title = btn.alt; content.style.display = 'block'; } }, /** * BBcode ToolBar */ insert_text: function(open, close) { var msgfield = $('<?php echo $prefix; ?>words'); // IE support if (document.selection && document.selection.createRange) { msgfield.focus(); sel = document.selection.createRange(); sel.text = open + sel.text + close; msgfield.focus(); } // Moz support else if (msgfield.selectionStart || msgfield.selectionStart == '0') { 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(); } // Fallback support for other browsers else { msgfield.value += open + close; msgfield.focus(); } return; }, /** * Minimize/Maximize none/inline */ minimize_maximize: function(idname, type) { var element = $(idname); if(element.style) { if(element.style.display == type ) { element.style.display = 'none'; } else { element.style.display = type; } } }, switch_text_color: function(color) { /* clear any existing borders on the color buttons */ var colorbtn = this.getElementsByClassName($('<?php echo $prefix; ?>colorlist'), '<?php echo $prefix; ?>color', ''); for(var i = 0; colorbtn.length > i; i++) colorbtn[i].style.border = 'none'; /* assign the new border style to the selected button */ this.current_text_color = color; setCookie('<?php echo $prefix; ?>current_text_color', this.current_text_color); var idname = '<?php echo $prefix; ?>color_' + color; $(idname).style.border = '1px solid #666'; $(idname).style.padding = '1px'; // assigne the new color to the input text box this.el_words.style.color = '#'+color; this.el_words.focus(); }, /** * Smiley show/hide */ showHideSmileys: function() { if (this.showsmileys) { this.showsmileys = false; } else { this.showsmileys = true; } setCookie('<?php echo $prefix; ?>showsmileys', this.showsmileys); this.refresh_Smileys(); }, refresh_Smileys: function() { var content = $('<?php echo $prefix; ?>smileys'); var btn = $('<?php echo $prefix; ?>showHideSmileysbtn'); if (this.showsmileys) { if (btn) { btn.src = "<?php echo $c->getFileUrlFromTheme('images/smiley-on.gif'); ?>"; btn.alt = this.i18n.hidesmiley; btn.title = btn.alt; } content.style.display = 'block'; } else { if (btn) { btn.src = "<?php echo $c->getFileUrlFromTheme('images/smiley-off.gif'); ?>"; btn.alt = this.i18n.showsmiley; btn.title = btn.alt; } content.style.display = 'none'; } this.refresh_Chat(); this.refresh_OnlineAndSmileys(); }, /** * Show Hide who's online */ showHideWhosOnline: function() { if (this.showwhosonline) { this.showwhosonline = false; } else { this.showwhosonline = true; } setCookie('<?php echo $prefix; ?>showwhosonline', this.showwhosonline); this.refresh_WhosOnline(); }, refresh_WhosOnline: function() { var content = $('<?php echo $prefix; ?>online'); var btn = $('<?php echo $prefix; ?>showHideWhosOnlineBtn'); if (!btn) return; if (this.showwhosonline) { btn.src = "<?php echo $c->getFileUrlFromTheme('images/online-on.gif'); ?>"; btn.alt = this.i18n.hideonline; btn.title = btn.alt; content.style.display = 'block'; } else { btn.src = "<?php echo $c->getFileUrlFromTheme('images/online-off.gif'); ?>"; btn.alt = this.i18n.showonline; btn.title = btn.alt; content.style.display = 'none'; } this.refresh_Chat(); this.refresh_OnlineAndSmileys(); }, /** * Resize online and smileys */ refresh_OnlineAndSmileys: function() { var onlinediv = $('<?php echo $prefix; ?>online'); var smileysdiv = $('<?php echo $prefix; ?>smileys'); var style = $H(); if (this.showwhosonline) { style['height'] = ''; Element.setStyle(smileysdiv, style); } else { style['height'] = '100%'; Element.setStyle(smileysdiv, style); } 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 */ refresh_Chat: function() { var chatdiv = $('<?php echo $prefix; ?>chat'); var style = $H(); if (!this.showwhosonline && !this.showsmileys) { style['width'] = '100%'; Element.setStyle(chatdiv, style); } else { style['width'] = ''; Element.setStyle(chatdiv, style); } } };<?php include($c->getFileUrlFromTheme('templates/pfcclient-custo.js.tpl.php')); ?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -