[Phpfreechat-svn] SF.net SVN: phpfreechat: [1188] trunk/data/public/js/pfcgui.js
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2007-09-20 08:06:25
|
Revision: 1188 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1188&view=rev Author: kerphi Date: 2007-09-20 01:06:25 -0700 (Thu, 20 Sep 2007) Log Message: ----------- cleanup Modified Paths: -------------- trunk/data/public/js/pfcgui.js Modified: trunk/data/public/js/pfcgui.js =================================================================== --- trunk/data/public/js/pfcgui.js 2007-09-15 19:16:13 UTC (rev 1187) +++ trunk/data/public/js/pfcgui.js 2007-09-20 08:06:25 UTC (rev 1188) @@ -444,325 +444,5 @@ elt.onclick = function(){ pfc.switch_text_color(this.bbc); } clist.appendChild(elt); } -/* - }, - -// buildChat is not used. Use templates instead. - - buildChat: function() - { - var container = $('pfc_container'); - - // clean the chat box - container.innerHTML = ''; - - // minimize/maximize button - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_minmax'); - if (pfc_start_minimized) - img.setAttribute('src', pfc.res.getFileUrl('images/maximize.gif')); - else - img.setAttribute('src', pfc.res.getFileUrl('images/minimize.gif')); - img.setAttribute('alt', ''); - img.onclick = function(){ pfc.swap_minimize_maximize(); } - container.appendChild(img); - - // title - var h2 = document.createElement('h2'); - h2.setAttribute('id', 'pfc_title'); - h2.innerHTML = pfc_title; - container.appendChild(h2); - - // content expandable - var contentexp = document.createElement('div'); - contentexp.setAttribute('id', 'pfc_content_expandable'); - container.appendChild(contentexp); - - // channels : <div id="pfc_channels"> - var channels = document.createElement('div'); - channels.setAttribute('id', 'pfc_channels'); - contentexp.appendChild(channels); - // channels list : <ul id="pfc_channels_list"> - var channelslist = document.createElement('ul'); - channelslist.setAttribute('id', 'pfc_channels_list'); - channels.appendChild(channelslist); - // channels content : <div id="pfc_channels_content"> - var channelscontent = document.createElement('div'); - channelscontent.setAttribute('id', 'pfc_channels_content'); - channels.appendChild(channelscontent); - - // input container : <div id="pfc_input_container"> - var inputcontainer = document.createElement('div'); - inputcontainer.setAttribute('id', 'pfc_input_container'); - contentexp.appendChild(inputcontainer); - - // this is the table which will contains input word and send button - // (I didn't found a cleaner way to align these input elements horizontaly in the same line) - var table1 = document.createElement('table'); - table1.setAttribute('style','border-collapse:collapse;margin:0;padding:0;'); - var tbody1 = document.createElement('tbody'); - table1.appendChild(tbody1); - var tr1 = document.createElement('tr'); - var td1 = document.createElement('td'); - var td2 = document.createElement('td'); - td1.setAttribute('width', '100%'); - tbody1.appendChild(tr1); - tr1.appendChild(td1); - tr1.appendChild(td2); - inputcontainer.appendChild(table1); - - // input words : <input id="pfc_words" type="text" ... /> - var inputwords = document.createElement('input'); - inputwords.setAttribute('id', 'pfc_words'); - inputwords.setAttribute('type', 'text'); - inputwords.setAttribute('title', pfc.res.getLabel("Enter your message here")); - inputwords.setAttribute('maxlength', pfc_max_text_len); - td1.appendChild(inputwords); - - // send button : <input id="pfc_send" type="button" ... /> - var sendbtn = document.createElement('input'); - sendbtn.setAttribute('id', 'pfc_send'); - sendbtn.setAttribute('type', 'button'); - sendbtn.setAttribute('value', pfc.res.getLabel("Send")); - sendbtn.setAttribute('title', pfc.res.getLabel("Click here to send your message")); - sendbtn.onclick = function(){ pfc.doSendMessage(); } - td2.appendChild(sendbtn); - - // command container : <div id="pfc_cmd_container"> - var cmdcontainer = document.createElement('div'); - cmdcontainer.setAttribute('id', 'pfc_cmd_container'); - inputcontainer.appendChild(cmdcontainer); - - // move the phpfreechat logo into the cmd container box - var a = document.createElement('a'); - a.setAttribute('id', 'pfc_logo'); - a.setAttribute('href','http://www.phpfreechat.net'); - if (pfc_openlinknewwindow) - a.onclick = function(){ window.open(this.href,'_blank'); return false; } - var img = document.createElement('img'); - img.setAttribute('src', 'http://www.phpfreechat.net/pub/logo_80x15.gif'); - img.setAttribute('alt', pfc.res.getLabel("PHP FREE CHAT [powered by phpFreeChat-%s]",pfc_version)); - img.title = img.alt; - a.appendChild(img); - cmdcontainer.appendChild(a); - - // handle box : <input id="pfc_handle" type="button" ... - var handle = document.createElement('p'); - handle.setAttribute('id', 'pfc_handle'); - handle.setAttribute('title', pfc.res.getLabel("Enter your nickname here")); - handle.appendChild(document.createTextNode(pfc.nickname)); - handle.onclick = function(){ pfc.askNick(''); } - cmdcontainer.appendChild(handle); - - // buttons : <div class="pfc_btn"> - - // button login/logout - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_loginlogout_btn'); - btn.setAttribute('class', 'pfc_btn') - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_loginlogout'); - img.setAttribute('src', pfc.res.getFileUrl('images/logout.gif')); - img.onclick = function(){ pfc.connect_disconnect(); } - btn.appendChild(img); - cmdcontainer.appendChild(btn); - - // button nickname color on/off - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_nickmarker_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_nickmarker'); - img.setAttribute('src', pfc.res.getFileUrl('images/color-on.gif')); - img.onclick = function(){ pfc.nickmarker_swap(); } - btn.appendChild(img); - cmdcontainer.appendChild(btn); - - // button clock on/off - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_clock_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_clock'); - img.setAttribute('src', pfc.res.getFileUrl('images/clock-on.gif')); - img.onclick = function(){ pfc.clock_swap(); } - btn.appendChild(img); - cmdcontainer.appendChild(btn); - - // button sound on/off - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_sound_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_sound'); - img.setAttribute('src', pfc.res.getFileUrl('images/sound-on.gif')); - img.onclick = function(){ pfc.sound_swap(); } - btn.appendChild(img); - cmdcontainer.appendChild(btn); - - // button smileys on/off - if (pfc_btn_sh_smileys) - { - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_showHideSmileysbtn_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_showHideSmileysbtn'); - img.setAttribute('src', pfc.res.getFileUrl('images/smiley-on.gif')); - img.onclick = function(){ pfc.showHideSmileys(); } - btn.appendChild(img); - cmdcontainer.appendChild(btn); - } - - // button whoisonline on/off - if (pfc_btn_sh_whosonline) - { - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_showHideWhosOnlineBtn_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_showHideWhosOnlineBtn'); - img.setAttribute('src', pfc.res.getFileUrl('images/online-on.gif')); - img.onclick = function(){ pfc.showHideWhosOnline(); } - btn.appendChild(img); - cmdcontainer.appendChild(btn); - } - - // bbcode container : <div id="pfc_bbcode_container"> - bbcontainer = document.createElement('div'); - bbcontainer.setAttribute('id', 'pfc_bbcode_container'); - inputcontainer.appendChild(bbcontainer); - - // bbcode strong - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_bt_strong_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_bt_strong'); - img.setAttribute('class', 'pfc_bt_strong'); - 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]',true); } - btn.appendChild(img); - bbcontainer.appendChild(btn); - - // bbcode italics - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_bt_italics_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_bt_italics'); - img.setAttribute('class', 'pfc_bt_italics'); - 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]',true); } - btn.appendChild(img); - bbcontainer.appendChild(btn); - - // bbcode underline - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_bt_underline_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_bt_underline'); - img.setAttribute('class', 'pfc_bt_underline'); - 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]',true); } - btn.appendChild(img); - bbcontainer.appendChild(btn); - - // bbcode del - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_bt_delete_btn'); - btn.setAttribute('class', 'pfc_btn') - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_bt_delete'); - img.setAttribute('class', 'pfc_bt_delete'); - 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]',true); } - btn.appendChild(img); - bbcontainer.appendChild(btn); - - // bbcode mail - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_bt_mail_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_bt_mail'); - img.setAttribute('class', 'pfc_bt_mail'); - 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]',true); } - btn.appendChild(img); - bbcontainer.appendChild(btn); - - // bbcode color - var btn = document.createElement('div'); - btn.setAttribute('id', 'pfc_bt_color_btn'); - btn.setAttribute('class', 'pfc_btn'); - btn.setAttribute('className', 'pfc_btn'); // for IE6 - var img = document.createElement('img'); - img.setAttribute('id', 'pfc_bt_color'); - img.setAttribute('class', 'pfc_bt_color'); - img.setAttribute('className', 'pfc_bt_color'); // for IE6 - img.setAttribute('title', pfc.res.getLabel("Color")); - img.setAttribute('src', pfc.res.getFileUrl('images/bt_color.gif')); - img.onclick = function(){ pfc.minimize_maximize('pfc_colorlist','inline'); } - btn.appendChild(img); - bbcontainer.appendChild(btn); - // color list - var clist = document.createElement('div'); - clist.setAttribute('id', 'pfc_colorlist'); - bbcontainer.appendChild(clist); - var clist_v = pfc_bbcode_color_list; - for (var i=0 ; i<clist_v.length ; i++) - { - var bbc = clist_v[i]; - var elt = document.createElement('img'); - elt.bbc = bbc; - elt.setAttribute('class', 'pfc_color'); - elt.setAttribute('className', 'pfc_color'); // for IE6 - elt.setAttribute('id', 'pfc_color_'+bbc); - elt.style.backgroundColor = '#'+bbc; - elt.setAttribute('src', pfc.res.getFileUrl('images/color_transparent.gif')); - elt.setAttribute('alt', bbc); - elt.onclick = function(){ pfc.switch_text_color(this.bbc); } - clist.appendChild(elt); - } - - // 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(); - - // sound container box : <div id="pfc_sound_container"> - var soundcontainerbox = document.createElement('div'); - soundcontainerbox.setAttribute('id', 'pfc_sound_container'); - container.appendChild(soundcontainerbox); - */ } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |