From: Lo?c C. <lo...@us...> - 2001-04-03 20:15:43
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv5636/chat/lib/index_libs Added Files: server_time.lib.js set_msg_color.lib.js Log Message: The first dev. version that works! Still many things to do, of course... --- NEW FILE --- // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | Set of functions used to display and to remove the server time at the | // | status bar. | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: server_time.lib.js,v 1.1 2001/04/03 20:15:39 loic1 Exp $ // // Display the server time at the status bar. // /** * Displays the server time at the status bar * * @access public */ function pmcClock() { var curDate = new Date(); var calcDate = new Date(curDate - jsClockGap); var calcHours = calcDate.getHours(); var calcMinuts = calcDate.getMinutes(); var calcSeconds = calcDate.getSeconds(); if (calcHours < 10) calcHours = '0' + calcHours; if (calcMinuts < 10) calcMinuts = '0' + calcMinuts; if (calcSeconds < 10) calcSeconds = '0' + calcSeconds; var calcTime = calcHours + ':' + calcMinuts + ':' + calcSeconds; window.status = jsServerTimeString + calcTime; jsClockDisplay = setTimeout('pmcClock()', 1000); } // end of the function 'pmcClock()' /** * Removes the server time from the status bar * * @access public */ function pmcStopClock() { clearTimeout(jsClockDisplay); window.status = ''; } // end of the function 'pmcStopClock()' /** * Calculates the gap between the server and the the local time * * @param string the current server date * @return integer the signed gap * * @access public */ function pmcCalcGap(servDate) { var serverDate = new Date(servDate); var localDate = new Date(); return localDate - serverDate; } // end of the function 'pmcCalcGap()' --- NEW FILE --- // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | Modifies the color picker at the 'input' frame according to the value of | // | the color to be used for messages. | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: set_msg_color.lib.js,v 1.1 2001/04/03 20:15:39 loic1 Exp $ // // Handles the color picker. // var jsImgColor1 = new Image(4,20); jsImgColor1.src = jsChatPath + 'images/unsel_color.gif'; var jsImgColor2 = new Image(4,20); jsImgColor2.src = jsChatPath + 'images/sel_color.gif'; var jsSelectedColor = null; /** * Modifies the color picker * * @param string hex value of the selected color * @param string rank of the color inside the color picker * * @access public */ function pmcChangeColor(colorVal, colorRank) { if (jsSelectedColor != colorRank) { var inputDoc = window.frames['input'].window.document; if (typeof(document.all) != 'undefined') { var obj1 = inputDoc.all[jsSelectedColor]; var obj2 = inputDoc.all[colorRank]; } else if (typeof(document.images) != 'undefined') { var obj1 = inputDoc.images[jsSelectedColor]; var obj2 = inputDoc.images[colorRank]; } else return; if (jsSelectedColor != null) { obj1.src = jsImgColor1.src; } jsSelectedColor = colorRank; inputDoc.forms['inputForm'].elements['color'].value = colorVal; obj2.src = jsImgColor2.src; } inputDoc.forms['inputForm'].elements['message'].focus(); } // end of the function 'pmcChangeColor()' |