Changeset 318
- Timestamp:
- 06/17/08 14:44:24 (16 years ago)
- Location:
- trunk/instant_messenger
- Files:
-
- 6 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/instant_messenger/client.php
r305 r318 9 9 'jabber', 10 10 'images', 11 'client' 11 'cookies', 12 'client', 13 'preferences' 12 14 ); 13 15 -
trunk/instant_messenger/inc/class.Ujabber.inc.php
r311 r318 7 7 public final function __construct($pConnectionType = 'write') 8 8 { 9 /*session_start();10 11 $this->_user = $_SESSION['phpgw_info']['instant_messenger']['user'];12 //$this->_user = 'niltonneto';//$_SESSION['phpgw_info']['instant_messenger']['user'];13 //$this->_pass = 'nine59ever';//$_SESSION['phpgw_info']['instant_messenger']['passwd'];14 //$this->_pass = 'senha';//$_SESSION['phpgw_info']['instant_messenger']['passwd'];15 $this->_pass = $_SESSION['phpgw_info']['instant_messenger']['passwd'];16 $this->_server = $_SESSION['phpgw_info']['instant_messenger']['name_jabber'];17 $this->_port = '8883';//$_SESSION['phpgw_info']['instant_messenger']['port_jabber'];18 $this->_resource = $_SESSION['phpgw_info']['instant_messenger']['resource_jabber'];19 //$webjabber = 'im.pr.gov.br';//$_SESSION['phpgw_info']['instant_messenger']['webjabber'];20 $webjabber = '10.15.22.236';//$_SESSION['phpgw_info']['instant_messenger']['webjabber'];21 22 session_write_close();*/23 24 9 try 25 10 { … … 29 14 require_once dirname(__FILE__) . '/../instant_messenger.define.php'; 30 15 31 if ( !(defined(' JABBER_URL') && defined('JABBER_RESOURCE')) )16 if ( !(defined('IM_NAME_JABBER') && defined('IM_RESOURCE_JABBER')) ) 32 17 throw new Exception(__CLASS__ . '[ ERROR #2 ] : Jabber server is not cofigured'); 33 18 34 if ( !(defined(' WEBJABBER_URL') && defined('WEBJABBER_PORT')) )35 throw new Exception(__CLASS__ . '[ ERROR #3 ] : Web abber server is not cofigured');36 37 $this->_server = constant(' JABBER_URL');38 $this->_resource = constant(' JABBER_RESOURCE');39 40 $this->_port = constant(' WEBJABBER_PORT');19 if ( !(defined('IM_SERVER_WEBJABBER') && defined('IM_PORT_JABBER')) ) 20 throw new Exception(__CLASS__ . '[ ERROR #3 ] : Webjabber server is not cofigured'); 21 22 $this->_server = constant('IM_NAME_JABBER'); 23 $this->_resource = constant('IM_RESOURCE_JABBER'); 24 25 $this->_port = constant('IM_PORT_JABBER'); 41 26 42 27 session_start(); … … 48 33 49 34 $this->connected = false; 50 if ( $this->connect($access_string, $this->_pass, $pConnectionType, constant(' WEBJABBER_URL')) )35 if ( $this->connect($access_string, $this->_pass, $pConnectionType, constant('IM_SERVER_WEBJABBER')) ) 51 36 $this->connected = true; 52 37 } … … 121 106 } 122 107 108 public final function Composing($pJid) 109 { 110 $pJid = $pJid['jid']; 111 $id = 'chat' . "_" . time(); 112 $xml = "<message to='{$pJid}' type='chat' id='{$id}'><composing/></message>"; 113 $this->writeSocket($xml); 114 } 115 116 public final function Paused($pJid) 117 { 118 $pJid = $pJid['jid']; 119 $id = 'chat' . "_" . time(); 120 $xml = "<message to='{$pJid}' type='chat' id='{$id}'><paused/></message>"; 121 $this->writeSocket($xml); 122 } 123 123 124 public final function SendMessage($pSendMessage) 124 125 { … … 186 187 unset($id); 187 188 188 echo $xml;189 //echo $xml; 189 190 $this->writeSocket($xml); 190 191 $this->close(); -
trunk/instant_messenger/inc/class.ldap_im.inc.php
r305 r318 11 11 function __construct() 12 12 { 13 session_start(); 14 $this->ldap_host = $_SESSION['phpgw_info']['instant_messenger']['server_ldap_jabber']; 15 $this->ldap_context = $_SESSION['phpgw_info']['instant_messenger']['context_ldap_jabber']; 16 $this->user = $_SESSION['phpgw_info']['instant_messenger']['user_ldap_jabber']; 17 $this->password = $_SESSION['phpgw_info']['instant_messenger']['password_ldap_jabber']; 18 $this->jid = $_SESSION['phpgw_info']['instant_messenger']['user']; 19 $this->connect_ldap(false); 20 session_write_close(); 13 try 14 { 15 if ( !file_exists(dirname(__FILE__) . '/../instant_messenger.define.php') ) 16 throw new Exception(__CLASS__ . '[ ERROR #1 ] : Not found configuration file'); 17 18 require_once dirname(__FILE__) . '/../instant_messenger.define.php'; 19 20 if ( !(defined('IM_SERVER_LDAP_JABBER') && defined('IM_CONTEXT_LDAP_JABBER')) ) 21 throw new Exception(__CLASS__ . '[ ERROR #2 ] : Ldap server is not cofigured'); 22 23 if ( !defined('IM_USER_LDAP_JABBER') ) 24 throw new Exception(__CLASS__ . '[ ERROR #3 ] : Ldap server is not cofigured'); 25 26 $this->ldap_host = constant('IM_SERVER_LDAP_JABBER'); 27 $this->ldap_context = constant('IM_CONTEXT_LDAP_JABBER'); 28 $this->user = constant('IM_USER_LDAP_JABBER'); 29 30 session_start(); 31 $this->password = $_SESSION['phpgw_info']['instant_messenger']['password_ldap_jabber']; 32 $this->jid = $_SESSION['phpgw_info']['instant_messenger']['user']; 33 session_write_close(); 34 35 $this->connect_ldap(false); 36 37 } 38 catch(Exception $e) 39 { 40 echo $e->getMessage(); 41 } 21 42 } 22 43 -
trunk/instant_messenger/inc/controller.xml
r305 r318 32 32 <item ref="functions" js="functions" /> 33 33 <item ref="images" js="images" /> 34 <item ref="cookies _im" js="cookies_im" />34 <item ref="cookies" js="cookies" /> 35 35 <item ref="load" js="load" /> 36 <item ref="preferences" js="preferences" /> 37 <item ref="setup" js="setup" path="/var/www/expresso/instant_messenger/templates/default/"/> 36 38 </js> 37 39 <php path="/var/www/expresso/instant_messenger/inc" suffix=".class.php"> … … 53 55 <item ref="Ujabber" alias="updateContact" class="Ujabber" method="updateContact" prefix="class." suffix=".inc.php" /> 54 56 <item ref="Ujabber" alias="setStatus" class="Ujabber" method="setStatus" prefix="class." suffix=".inc.php" /> 57 <item ref="FileDefine" alias="getParams" class="FileDefine" method="getParams" prefix="class." suffix=".inc.php"/> 58 <item ref="composing" class="Ujabber" method="composing" prefix="class." suffix=".inc.php" /> 59 <item ref="paused" class="Ujabber" method="paused" prefix="class." suffix=".inc.php" /> 55 60 </php> 56 61 <xml></xml> -
trunk/instant_messenger/inc/im_sessions.inc.php
r305 r318 4 4 $_SESSION['phpgw_info']['instant_messenger']['user_id'] = $GLOBALS['phpgw_info']['user']['account_id']; 5 5 $_SESSION['phpgw_info']['instant_messenger']['passwd'] = $GLOBALS['phpgw_info']['user']['passwd']; 6 #$_SESSION['phpgw_info']['instant_messenger']['name_jabber'] = $GLOBALS['phpgw_info']['server']['name_jabber'];7 #$_SESSION['phpgw_info']['instant_messenger']['port_jabber'] = $GLOBALS['phpgw_info']['server']['port_jabber'];8 #$_SESSION['phpgw_info']['instant_messenger']['resource_jabber'] = $GLOBALS['phpgw_info']['server']['resource_jabber'];9 #$_SESSION['phpgw_info']['instant_messenger']['tls_jabber'] = $GLOBALS['phpgw_info']['server']['tls_jabber'];10 6 11 7 $_SESSION['phpgw_info']['instant_messenger']['server_ldap_jabber'] = $GLOBALS['phpgw_info']['server']['server_ldap_jabber']; -
trunk/instant_messenger/instant_messenger.define.php
r305 r318 1 <?php 2 define('JABBER_URL', 'im.pr.gov.br'); 3 define('JABBER_RESOURCE', 'Homologa'); 4 5 define('WEBJABBER_URL', 'im.pr.gov.br'); 6 define('WEBJABBER_PORT', '8883'); 1 <?php 2 define('IM_NAME_JABBER', 'im.pr.gov.br'); 3 define('IM_RESOURCE_JABBER', 'IM_ALE'); 4 define('IM_PORT_JABBER', '8884'); 5 define('IM_SERVER_WEBJABBER', 'im.pr.gov.br'); 6 define('IM_SERVER_LDAP_JABBER', 'ldap://ldap.eparana.parana'); 7 define('IM_CONTEXT_LDAP_JABBER', 'dc=pr,dc=gov,dc=br'); 8 define('IM_USER_LDAP_JABBER', 'uid=expresso,dc=sistemas,dc=pr,dc=gov,dc=br'); 7 9 ?> -
trunk/instant_messenger/js/client.js
r311 r318 1 1 (function() 2 2 { 3 function _config(pObj, pEvent, pHandler) 3 4 var _cookies = new IMCookies; 5 var _running = _cookies.get('IM_running'); 6 if ( !_running ) 4 7 { 5 if ( typeof pObj == 'object' ) 6 { 7 if ( pEvent.substring(0, 2) == 'on' ) 8 pEvent = pEvent.substring(2, pEvent.length); 9 10 if ( pObj.addEventListener ) 11 pObj.addEventListener(pEvent, pHandler, false); 12 else if ( pObj.attachEvent ) 13 pObj.attachEvent('on' + pEvent, pHandler); 14 } 15 } 16 17 if ( !(top.document.getElementById('instant_messenger_content')) ) 18 { 19 var _im_content = top.document.createElement('div'); 20 _im_content.setAttribute('id', 'instant_messenger_content'); 21 _im_content = top.document.body.appendChild(_im_content); 22 } 23 24 var buffer = ''; 25 var _disconnected = false; 26 27 var _conn = new IMConnector(path_im); 28 var _xtools = new XTools(path_im); 29 var _window = new Windows(_xtools, _im_content); 30 var _ldap = new InstantMessengerLDAP(_conn, _xtools, _window); 31 var _showhidden = new ShowHidden(1500); 32 var _jabber = new Jabber(_conn, _xtools, _window, _ldap, _showhidden); 33 34 // XSL preload 35 var _xsl_preload = ['window.xsl','layer.xsl','contacts.xsl', 'chat.xsl']; 36 var _xsl_preload_legth = _xsl_preload.length; 37 for ( var i = 0; i < _xsl_preload_legth; i++ ) 38 _xtools.load(_xsl_preload[i]); 39 40 var local; 41 if ( (local = top.document.getElementById('user_info')) ) 42 { 43 local.firstChild.style.marginLeft = '30px'; 44 45 var _status = top.document.createElement('div'); 46 _status.setAttribute('id', 'im_status'); 47 _status.style.height = '15px'; 48 _status.style.margin = '0 0 0 10px'; 49 _status.style.padding = '0px'; 50 _status.style.width = '15px'; 51 _status.style.background = 'no-repeat'; 52 _status.style.backgroundImage = 'url(' + im_unavailable.src + ')'; 53 _status.style.float = 'left'; 54 _status.style.position = 'absolute'; 55 56 local.insertBefore(_status, local.firstChild); 57 58 _config(_status, 'onclick', _contacts); 59 60 var _menu; 61 _menu = top.document.createElement('span'); 62 _menu.setAttribute('id','fast_menu_im'); 63 _menu.style.backgroundColor = 'b4cfe5'; 64 _menu.style.display = 'none'; 65 _menu.style.margin = '15px 0 0 -15px'; 66 _menu.style.position = 'absolute'; 67 _menu.style.zIndex = '99999'; 68 local.insertBefore(_menu, local.firstChild); 69 70 var _menu_img = top.document.createElement('div'); 71 _menu_img.style.background = 'no-repeat'; 72 _menu_img.style.backgroundImage = 'url(' + im_fast_menu.src + ')'; 73 _menu_img.style.height = '10px'; 74 _menu_img.style.margin = '0px'; 75 _menu_img.style.padding = '0px'; 76 _menu_img.style.position = 'absolute'; 77 _menu_img.style.width = '10px'; 78 _menu_img.style.float = 'left'; 79 local.insertBefore(_menu_img, local.firstChild); 80 81 _config( 82 _menu_img, 83 'onclick', 8 _cookies.set('IM_running', 'true'); 9 10 function _config(pObj, pEvent, pHandler) 11 { 12 if ( typeof pObj == 'object' ) 13 { 14 if ( pEvent.substring(0, 2) == 'on' ) 15 pEvent = pEvent.substring(2, pEvent.length); 16 17 if ( pObj.addEventListener ) 18 pObj.addEventListener(pEvent, pHandler, false); 19 else if ( pObj.attachEvent ) 20 pObj.attachEvent('on' + pEvent, pHandler); 21 } 22 } 23 24 _config(window, 'onbeforeunload', 84 25 function() 85 26 { 86 var _options = [ 87 'available', 88 'away', 89 'dnd', 90 'unavailable' 91 ]; 92 93 var _style_text = 'cursor: pointer; padding:2px 4px 2px 20px; background: no-repeat '; 94 95 var _xml = _xtools.xml('menu'); 96 var _option; 97 var _item; 98 var _action; 99 var _style; 100 101 for ( var i in _options ) 27 var _running = _cookies.get('IM_running'); 28 _cookies.clear('IM_running'); 29 } 30 ); 31 32 if ( !(top.document.getElementById('instant_messenger_content')) ) 33 { 34 var _im_content = top.document.createElement('div'); 35 _im_content.setAttribute('id', 'instant_messenger_content'); 36 _im_content = top.document.body.appendChild(_im_content); 37 } 38 39 var buffer = ''; 40 var _disconnected = false; 41 42 var _conn = new IMConnector(path_im); 43 var _xtools = new XTools(path_im); 44 var _window = new Windows(_xtools, _im_content); 45 var _ldap = new InstantMessengerLDAP(_conn, _xtools, _window); 46 var _showhidden = new ShowHidden(1500); 47 var _jabber = new Jabber(_conn, _xtools, _window, _ldap, _showhidden, _cookies); 48 49 // XSL preload 50 var _xsl_preload = [ 51 'window.xsl', 52 'layer.xsl', 53 'contacts.xsl', 54 'chat.xsl', 55 'options.xsl' 56 ]; 57 var _xsl_preload_legth = _xsl_preload.length; 58 for ( var i = 0; i < _xsl_preload_legth; i++ ) 59 _xtools.load(_xsl_preload[i]); 60 61 function _stream(data) 62 { 63 data = data.replace(/^ | $/, ''); 64 65 if ( !(data.length) ) 66 return false; 67 68 if ( data.indexOf('disconnected') != -1 || data.indexOf('</stream:stream>') != -1 ) 69 _disconnect(); 70 else 71 { 72 if ( data.lastIndexOf('>') != data.length - 1) 73 buffer += data + ' '; 74 else 102 75 { 103 _option = _xml.createElement('option'); 104 105 _item = _xml.createElement('item'); 106 _item.appendChild(_xml.createTextNode(imGetLang(_options[i]))); 107 108 _style = _xml.createElement('style'); 109 _style.appendChild(_xml.createTextNode(_style_text + 'url(' + eval('im_' + _options[i] + '.src') + ')')); 110 111 _option.appendChild(_item); 112 _option.appendChild(_style); 113 114 _xml.documentElement.appendChild(_option); 76 if ( buffer.length ) 77 { 78 data = buffer + data; 79 buffer = ''; 80 } 81 82 // with xmlns, occurs problems during parse between 83 // xml and xsl, and for that reason it was removed 84 data = data.replace(/ xmlns='.*?'/g, ''); 85 data = '<handler>' + data + '</handler>'; 86 87 var _xml = _xtools.convert(data); 88 89 if ( _xml ) 90 { 91 var _node = _xml.documentElement.firstChild; 92 93 while ( _node ) 94 { 95 if ( _node.nodeType == 1 ) 96 _jabber.action(_node); 97 //else 98 // alert('name : ' + _node.nodeName + 99 // "\n\nhas children:" + _node.hasChildNodes() + 100 // "\nvalue\n\n" + _node.nodeValue); 101 102 _node = _node.nextSibling; 103 } 104 } 115 105 } 116 117 _menu.innerHTML = _xtools.parse(_xml, 'options.xsl'); 118 _showhidden.action('onmouseover', 'onmouseout', _menu); 119 120 _item = _menu.firstChild; 121 122 for ( var i in _options ) 123 { 124 _item.childNodes[i].setAttribute('presence', _options[i]); 125 _config( 126 _item.childNodes[i], 127 'onclick', 128 function(e) 129 { 130 var el = ( e.target ) ? e.target : e.srcElement; 131 132 _status.style.backgroundImage = el.style.backgroundImage; 133 134 var _presence = el.getAttribute('presence'); 135 _jabber.setPresence(_presence); 136 137 var _win_contacts = _window.get('contact_list'); 138 if ( _win_contacts ) 139 _win_contacts.icon(eval('im_' + _presence + '.src')); 140 } 141 ); 142 } 143 } 144 ); 145 } 146 147 function _stream(data) 148 { 149 data = data.replace(/^ | $/, ''); 150 151 if ( !(data.length) ) 152 return false; 153 154 if ( data.indexOf('disconnected') != -1 || data.indexOf('</stream:stream>') != -1 ) 106 } 107 } 108 109 var _count_reconnect = 0; 110 function _request() 111 { 112 if ( !_disconnected ) 113 return _conn.go( 114 '$this.Ujabber.listen', 115 {'stream':_stream, 'request':_wait}, 116 'classCostructor=read' 117 ); 118 else 119 setTimeout(_reconnect, (++_count_reconnect * 2000)); 120 } 121 122 function _wait() 123 { 124 setTimeout(_request, 3000); 125 } 126 127 function _reconnect() 128 { 129 _disconnected = false; 130 _request(); 131 } 132 133 function _disconnect() 155 134 { 156 135 _disconnected = true; 157 //alert('disconnected'); 158 } 159 else 160 { 161 if ( data.lastIndexOf('>') != data.length - 1) 162 buffer += data + ' '; 163 else 164 { 165 if ( buffer.length ) 166 { 167 data = buffer + data; 168 buffer = ''; 169 } 170 171 // com xmlns ocorre problemas durante o parse entre 172 // xml e xsl e por esse motivo está sendo retirado 173 data = data.replace(/ xmlns='.*?'/g, ''); 174 data = '<handler>' + data + '</handler>'; 175 176 var _xml = _xtools.convert(data); 177 178 if ( _xml ) 179 { 180 var _node = _xml.documentElement.firstChild; 181 182 while ( _node ) 183 { 184 if ( _node.nodeType == 1 ) 185 _jabber.action(_node); 186 //else 187 // alert('name : ' + _node.nodeName + "\n\nhas children:" + _node.hasChildNodes() + "\nvalue\n\n" + _node.nodeValue); 188 189 _node = _node.nextSibling; 190 } 191 } 192 } 193 } 194 } 195 196 var _count_reconnect = 0; 197 function _request() 198 { 199 if ( !_disconnected ) 200 return _conn.go( 201 '$this.Ujabber.listen', 202 {'stream':_stream, 'request':_wait}, 203 'classCostructor=read' 204 ); 205 else 206 setTimeout(_reconnect, (++_count_reconnect * 2000)); 207 } 208 209 function _wait() 210 { 211 setTimeout(_request, 3000); 212 } 213 214 function _reconnect() 215 { 216 _disconnected = false; 217 _request(); 218 } 219 220 function _disconnect() 221 { 222 _disconnected = true; 223 } 224 225 function _contacts() 226 { 227 var _win = _window.get('contact_list'); 228 if ( _win ) 229 if ( _win.wm.style.display != 'none' ) 230 _win.wm.style.display = 'none'; 231 else 232 _win.wm.style.display = 'block'; 233 else 136 _conn.abort(); 137 _loading(); 138 var _status = top.document.getElementById('im_status'); 139 if ( _status ) 140 _status.style.backgroundImage = 'url(' + im_unavailable.src + ')'; 141 142 var _win_contacts = _window.get('contact_list'); 143 if ( _win_contacts ) 144 _win_contacts.icon(im_unavailable.src); 145 } 146 147 function _contacts() 148 { 234 149 if ( !_disconnected ) 235 150 _conn.go('$this.Ujabber.getContacts'); 151 } 152 153 function _loading() 154 { 155 var _win_contact = _window.get('contact_list'); 156 if ( !_win_contact ) 157 { 158 _win_contact = _window.load('contact_list'); 159 _win_contact.hidden(); 160 _win_contact.title('.::Expresso Messenger::.'); 161 _win_contact.size(170, 350); 162 _win_contact.position(30, 30, true); 163 _win_contact.icon(im_unavailable.src); 164 _win_contact.bc.style.display = 'none'; 165 } 166 167 _win_contact.loading(); 168 } 169 170 function _showContacts() 171 { 172 var _win = _window.get('contact_list'); 173 if ( _win ) 174 if ( _win.wm.style.display == 'none' ) 175 _win.wm.style.display = 'block'; 176 else 177 _win.wm.style.display = 'none'; 178 } 179 180 _loading(); 181 182 var local; 183 if ( (local = top.document.getElementById('user_info')) ) 184 { 185 local.firstChild.style.marginLeft = '30px'; 186 187 var _status = top.document.createElement('div'); 188 _status.setAttribute('id', 'im_status'); 189 _status.style.height = '15px'; 190 _status.style.margin = '0 0 0 10px'; 191 _status.style.padding = '0px'; 192 _status.style.width = '15px'; 193 _status.style.background = 'no-repeat'; 194 _status.style.backgroundImage = 'url(' + im_unavailable.src + ')'; 195 _status.style.float = 'left'; 196 _status.style.position = 'absolute'; 197 198 local.insertBefore(_status, local.firstChild); 199 200 _config(_status, 'onclick', _showContacts); 201 202 var _menu; 203 _menu = top.document.createElement('span'); 204 _menu.setAttribute('id','fast_menu_im'); 205 _menu.style.backgroundColor = 'b4cfe5'; 206 _menu.style.display = 'none'; 207 _menu.style.margin = '15px 0 0 -15px'; 208 _menu.style.position = 'absolute'; 209 _menu.style.zIndex = '99999'; 210 local.insertBefore(_menu, local.firstChild); 211 212 var _menu_img = top.document.createElement('div'); 213 _menu_img.style.background = 'no-repeat'; 214 _menu_img.style.backgroundImage = 'url(' + im_fast_menu.src + ')'; 215 _menu_img.style.height = '10px'; 216 _menu_img.style.margin = '0px'; 217 _menu_img.style.padding = '0px'; 218 _menu_img.style.position = 'absolute'; 219 _menu_img.style.width = '10px'; 220 _menu_img.style.float = 'left'; 221 local.insertBefore(_menu_img, local.firstChild); 222 223 _config( 224 _menu_img, 225 'onclick', 226 function() 227 { 228 var _options = [ 229 'available', 230 'away', 231 'dnd', 232 'unavailable' 233 ]; 234 235 var _style_text = 'cursor: pointer; padding:2px 4px 2px 20px; background: no-repeat '; 236 237 var _xml = _xtools.xml('menu'); 238 var _option; 239 var _item; 240 var _action; 241 var _style; 242 243 for ( var i in _options ) 244 { 245 _option = _xml.createElement('option'); 246 247 _item = _xml.createElement('item'); 248 _item.appendChild(_xml.createTextNode(imGetLang(_options[i]))); 249 250 _style = _xml.createElement('style'); 251 _style.appendChild(_xml.createTextNode(_style_text + 'url(' + eval('im_' + _options[i] + '.src') + ')')); 252 253 _option.appendChild(_item); 254 _option.appendChild(_style); 255 256 _xml.documentElement.appendChild(_option); 257 } 258 259 _menu.innerHTML = _xtools.parse(_xml, 'options.xsl'); 260 _showhidden.action('onmouseover', 'onmouseout', _menu); 261 262 _item = _menu.firstChild; 263 264 for ( var i in _options ) 265 { 266 _item.childNodes[i].setAttribute('presence', _options[i]); 267 _config( 268 _item.childNodes[i], 269 'onclick', 270 function(e) 271 { 272 var el = ( e.target ) ? e.target : e.srcElement; 273 var _presence = el.getAttribute('presence'); 274 _jabber.setPresence(_presence); 275 } 276 ); 277 } 278 } 279 ); 280 } 281 282 function Client() 283 { 284 _request(); 285 setTimeout(_contacts, 3000); 286 } 287 288 window.InstantMessengerClient = Client; 236 289 } 237 238 function Client()239 {240 _request();241 setTimeout('InstantMessengerContacts()', 3000);242 }243 244 window.InstantMessengerClient = Client;245 window.InstantMessengerReconnect = _reconnect;246 window.InstantMessengerDisconnect = _disconnect;247 window.InstantMessengerContacts = _contacts;248 290 } 249 291 )(); -
trunk/instant_messenger/js/connector.js
r311 r318 3 3 var _THREADS = []; 4 4 var _ie; 5 6 function _config(pObj, pEvent, pHandler) 7 { 8 if ( typeof pObj == 'object' ) 9 { 10 if ( pEvent.substring(0, 2) == 'on' ) 11 pEvent = pEvent.substring(2, pEvent.length); 12 13 if ( pObj.addEventListener ) 14 pObj.addEventListener(pEvent, pHandler, false); 15 else if ( pObj.attachEvent ) 16 pObj.attachEvent('on' + pEvent, pHandler); 17 } 18 } 5 19 6 20 // xhr = XMLHttpRequest … … 36 50 var _ID = arguments[0]; 37 51 38 if ( _ie && _THREADS[_ID]._XHR.readyState != 4 ) 39 return false; 40 41 switch ( _THREADS[_ID]._XHR.readyState ) 42 { 43 case 3 : 44 if ( _THREADS[_ID]._HANDLER.stream ) 45 { 46 var _data = _THREADS[_ID]._XHR.responseText.substr(_THREADS[_ID]._index).replace(/^ +| +$/g, ''); 47 //alert(_data); 48 _THREADS[_ID]._rtlen = _THREADS[_ID]._XHR.responseText.length; 49 50 if ( _THREADS[_ID]._index < _THREADS[_ID]._rtlen && _data.length ) 51 try 52 { 53 _THREADS[_ID]._HANDLER.stream(_data); 54 } 55 catch(_e) 56 { 57 alert("#stream\n\n" + _e + "\n\n" + _e.description); 58 } 59 60 _THREADS[_ID]._index = _THREADS[_ID]._rtlen; 61 } 62 break; 63 case 4 : 64 switch ( _THREADS[_ID]._XHR.status ) 65 { 66 case 200: 67 var _data = ( _THREADS[_ID]._MODE == 'XML' ) ? 68 _THREADS[_ID]._XHR.responseXML : 69 _THREADS[_ID]._XHR.responseText; 70 71 if ( _ie && _THREADS[_ID]._HANDLER.stream ) 72 _THREADS[_ID]._HANDLER.stream(_data); 73 74 var _request = ( _THREADS[_ID]._HANDLER.request ) ? 75 _THREADS[_ID]._HANDLER.request : false; 76 77 delete _THREADS[_ID]; 78 79 if ( _request ) 52 if ( _THREADS[_ID] ) 53 { 54 if ( _ie && _THREADS[_ID]._XHR.readyState != 4 ) 55 return false; 56 57 switch ( _THREADS[_ID]._XHR.readyState ) 58 { 59 case 3 : 60 if ( _THREADS[_ID]._HANDLER.stream ) 61 { 62 var _data = _THREADS[_ID]._XHR.responseText.substr(_THREADS[_ID]._index).replace(/^ +| +$/g, ''); 63 //alert(_data); 64 _THREADS[_ID]._rtlen = _THREADS[_ID]._XHR.responseText.length; 65 66 if ( _THREADS[_ID]._index < _THREADS[_ID]._rtlen && _data.length ) 80 67 try 81 68 { 82 _ request(_data);69 _THREADS[_ID]._HANDLER.stream(_data); 83 70 } 84 71 catch(_e) 85 72 { 86 alert("# request\n\n" + _e + "\n\n" + _e.description);73 alert("#stream\n\n" + _e + "\n\n" + _e.description); 87 74 } 88 75 89 break; // [case : status 200] 90 case 404: 91 delete _THREADS[_ID]; 92 alert('Page Not Found!'); 93 break; // [case : status 404] 94 default: 95 delete _THREADS[_ID]; 96 } 97 break; 98 default : 76 if ( _THREADS[_ID] ) 77 _THREADS[_ID]._index = _THREADS[_ID]._rtlen; 78 } 79 break; 80 case 4 : 81 try 82 { 83 switch ( _THREADS[_ID]._XHR.status ) 84 { 85 case 200: 86 var _data = ( _THREADS[_ID]._MODE == 'XML' ) ? 87 _THREADS[_ID]._XHR.responseXML : 88 _THREADS[_ID]._XHR.responseText; 89 90 if ( _ie && _THREADS[_ID]._HANDLER.stream ) 91 _THREADS[_ID]._HANDLER.stream(_data); 92 93 var _request = ( _THREADS[_ID]._HANDLER.request ) ? 94 _THREADS[_ID]._HANDLER.request : false; 95 96 delete _THREADS[_ID]; 97 98 if ( _request ) 99 try 100 { 101 _request(_data); 102 } 103 catch(_e) 104 { 105 alert("#request\n\n" + _e + "\n\n" + _e.description); 106 } 107 108 break; // [case : status 200] 109 case 404: 110 delete _THREADS[_ID]; 111 alert('Page Not Found!'); 112 break; // [case : status 404] 113 default: 114 delete _THREADS[_ID]; 115 } 116 } 117 catch(e) 118 { 119 } 120 break; 121 default : 122 } 99 123 } 100 124 } … … 236 260 } 237 261 262 function _abort() 263 { 264 for ( var _ID in _THREADS ) 265 { 266 // @TODO 267 // try/catch for unknown error of IE. 268 // Check, store and retrieve the try/catch. 269 try 270 { 271 if ( _THREADS[_ID] && _THREADS[_ID]._XHR && _THREADS[_ID]._XHR.abort ) 272 _THREADS[_ID]._XHR.abort(); 273 274 delete _THREADS[_ID]; 275 } 276 catch(e){} 277 } 278 } 279 238 280 function Connector() 239 281 { … … 246 288 247 289 Connector.prototype.go = go; 290 Connector.prototype.abort = _abort; 248 291 window.IMConnector = Connector; 249 292 250 var _unload_event = window.onbeforeunload; 251 window.onbeforeunload = function() 252 { 253 for ( var _ID in _THREADS ) 254 { 255 //if ( _THREADS[_ID]._XHR.abort ) 256 try 257 { 258 if ( _THREADS[_ID]._XHR && _THREADS[_ID]._XHR.abort ) 259 _THREADS[_ID]._XHR.abort(); 260 delete _THREADS[_ID]; 261 } 262 catch(e) 263 { 264 } 265 } 266 267 if ( typeof _unload_event == 'function' ) 268 return _unload_event(); 269 }; 293 _config(window, 'onbeforeunload', _abort); 270 294 } 271 295 )(); -
trunk/instant_messenger/js/dragdrop.js
r305 r318 129 129 e.preventDefault(); 130 130 else 131 e l.onselectstart = new Function("return false;");131 e.onselectstart = new Function("return false;"); 132 132 133 133 var el = ( e.target ) ? e.target : e.srcElement; -
trunk/instant_messenger/js/images.js
r311 r318 32 32 var im_group_close = new Image(); 33 33 im_group_close.src = path_im + 'templates/default/images/group_close.gif'; 34 35 var im_console_prefs = new Image(); 36 im_console_prefs.src = path_im + 'templates/default/images/console_prefs2.png'; 37 38 var im_composing = new Image(); 39 im_composing.src = path_im + 'templates/default/images/typing.gif'; 34 40 35 41 // Smiles -
trunk/instant_messenger/js/jabber.js
r311 r318 6 6 var _ldap; 7 7 var _menu; 8 var _cookies; 8 9 9 10 var _vcards = []; 10 11 var _info = []; 11 12 var _win_position = 30; 12 var _chats = []; 13 14 var _win_position = 0; 13 15 14 16 function _next_position() 15 17 { 18 if ( _win_position > 200 ) 19 _win_position = 0; 16 20 return (_win_position += 30); 17 21 } … … 19 23 function _chat(_pJid) 20 24 { 25 if ( !_chats[_pJid] ) 26 _chats[_pJid] = []; 27 21 28 var _win_pos = _next_position(); 22 29 var _win_chat = _window.load('chat' + _pJid); … … 76 83 ); 77 84 85 var _composing_paused = null; 78 86 function _execKeyAction(e) 79 87 { 88 if ( e.type.indexOf('keydown') != -1 ) 89 { 90 if ( (e.keyCode > 48 && e.keyCode < 112) || e.keyCode > 186 ) 91 { 92 if ( _chats[_pJid]['composing_paused'] ) 93 { 94 clearTimeout(_chats[_pJid]['composing_paused']); 95 _chats[_pJid]['composing_paused'] = null; 96 } 97 else 98 _conn.go('t.composing','jid='+_pJid); 99 100 _chats[_pJid]['composing_paused'] = setTimeout( 101 function() 102 { 103 if ( _chats[_pJid]['composing_paused'] ) 104 { 105 clearTimeout(_chats[_pJid]['composing_paused']); 106 _chats[_pJid]['composing_paused'] = null; 107 } 108 _conn.go('t.paused','jid='+_pJid); 109 }, 5000); 110 } 111 } 80 112 switch ( e.keyCode ) 81 113 { … … 84 116 { 85 117 if ( e.type.indexOf('keydown') != -1 ) 118 { 119 if ( _chats[_pJid]['composing_paused'] ) 120 { 121 clearTimeout(_chats[_pJid]['composing_paused']); 122 _chats[_pJid]['composing_paused'] = null; 123 } 124 86 125 _sendMessage( 87 126 _pJid, … … 89 128 _win_chat.wc.firstChild 90 129 ); 130 } 91 131 else 92 132 _iframe.body.innerHTML = ''; … … 97 137 case 27 : 98 138 if ( e.type.indexOf('keyup') != -1 ) 139 { 140 if ( _chats[_pJid]['composing_paused'] ) 141 { 142 clearTimeout(_chats[_pJid]['composing_paused']); 143 _chats[_pJid]['composing_paused'] = null; 144 } 99 145 _win_chat.button(_win_chat.bc); 146 } 100 147 break; 101 148 } 102 149 } 150 _config(_contentWindow.document, 'onkeyup', _execKeyAction); 103 151 _config(_contentWindow.document, 'onkeydown', _execKeyAction); 104 _config(_contentWindow.document, 'onkeyup', _execKeyAction);105 152 106 153 if ( !(_vcards[_pJid]) ) … … 128 175 function _openChat(el) 129 176 { 130 var id = el.id; 131 132 id = id.substr(id.indexOf('_') + 1); 177 var id = el.getAttribute('jid'); 133 178 134 179 if ( id.indexOf('/') > -1 ) … … 139 184 { 140 185 _win = _chat(id); 141 var _st = el.style.backgroundImage;142 _win.icon( _st.substr(4, (_st.length - 5)));186 _win.title(el.getAttribute('idname')); 187 _win.icon(eval('im_' + el.getAttribute('status') + '.src')); 143 188 } 144 189 else … … 152 197 function _readContacts(_pContacts) 153 198 { 154 var _win_contact = _window.load('contact_list'); 199 var _win_contact = _window.get('contact_list'); 200 if ( !_win_contact ) 201 { 202 _win_contact = _window.load('contact_list'); 203 _win_contact.hidden(); 155 204 _win_contact.title('.::Expresso Messenger::.'); 156 205 _win_contact.size(170, 350); 157 206 _win_contact.position(30, 30, true); 207 _win_contact.icon(im_unavailable.src); 158 208 _win_contact.bc.style.display = 'none'; 159 _win_contact.wm.style.display = 'none'; 160 _win_contact.icon(im_available.src); 209 } 161 210 162 211 var _params = { … … 176 225 if ( _contact_list ) 177 226 { 178 _ setPresence('unavailable');227 _conn.go('$this.Ujabber.setPresence', 'type=unavailable'); 179 228 _setPresence(); 180 229 _ldap.photo( … … 241 290 var el = ( e.target ) ? e.target : e.srcElement; 242 291 var jid = el.parentNode.parentNode.id.substr(4); 292 var _contact = el.parentNode.parentNode.previousSibling; 293 _contact.parentNode.removeChild(_contact.nextSibling); 294 _contact.parentNode.removeChild(_contact); 243 295 _conn.go('$this.Ujabber.removeContact','jid='+jid); 244 296 } … … 264 316 } 265 317 var _contact = _contact_list.firstChild; 318 var _show_all = _cookies.get('IM_unavailable'); 266 319 while ( _contact ) 267 320 { 268 _config(_contact, 'onmouseover', _hover); 269 _config(_contact, 'onmouseout', _hover); 270 if ( _contact.getAttribute('jid') ) 321 if ( _contact.nodeName.toLowerCase() == 'div' ) 271 322 { 272 //_config(_contact, 'onmousedown', _click); 273 _config(_contact, 'onmouseup', _click); 274 } 275 else 276 { 277 _config(_contact, 'onclick', 278 function(e) 279 { 280 var el = ( e.target ) ? e.target : e.srcElement; 281 282 if ( el.style.backgroundImage.indexOf('group_open') < 0 ) 283 el.style.backgroundImage = 'url(' + im_group_open.src + ')'; 284 else 285 el.style.backgroundImage = 'url(' + im_group_close.src + ')'; 286 287 el = el.nextSibling; 288 while ( el.getAttribute('jid') ) 323 _config(_contact, 'onmouseover', _hover); 324 _config(_contact, 'onmouseout', _hover); 325 if ( _contact.getAttribute('jid') ) 326 { 327 if ( _show_all == 'hidden' ) 328 _contact.style.display = 'none'; 329 //_config(_contact, 'onmousedown', _click); 330 _config(_contact, 'onmouseup', _click); 331 } 332 else 333 { 334 _config(_contact, 'onclick', 335 function(e) 289 336 { 290 el.style.display = ( el.style.display != 'none' ) ? 291 'none' : 'block'; 337 var el = ( e.target ) ? e.target : e.srcElement; 338 var _display = "none"; 339 var _image = im_group_close.src; 340 341 if ( el.style.backgroundImage.indexOf('group_open') < 0 ) 342 { 343 _display = "block"; 344 _image = im_group_open.src; 345 } 346 347 el.style.backgroundImage = 'url(' + _image + ')'; 348 292 349 el = el.nextSibling; 293 if ( el && el.nextSibling ) 350 while ( el.getAttribute('jid') ) 351 { 352 if ( el.style.backgroundImage.indexOf('unavailable') < 0 ) 353 el.style.display = _display; 294 354 el = el.nextSibling; 295 } 296 }); 355 if ( el && el.nextSibling ) 356 el = el.nextSibling; 357 } 358 }); 359 } 297 360 } 298 361 _contact = _contact.nextSibling; … … 306 369 var _pPresence; 307 370 if ( arguments.length == 0 ) 308 _pPresence = 'available'; 371 { 372 if ( !(_pPresence = _cookies.get('IM_presence')) ) 373 _pPresence = 'available'; 374 } 309 375 else 310 376 _pPresence = arguments[0]; 377 378 _cookies.set('IM_presence', _pPresence); 379 311 380 switch ( _pPresence ) 312 381 { … … 324 393 if ( _presence ) 325 394 { 395 var _img_status = eval('im_' + _pPresence + '.src'); 396 326 397 var _status = top.document.getElementById('im_status'); 327 398 if ( _status ) 328 _status.style.backgroundImage = 'url(' + eval('im_' + _pPresence + '.src') + ')'; 399 _status.style.backgroundImage = 'url(' + _img_status + ')'; 400 401 var _win_contacts = _window.get('contact_list'); 402 if ( _win_contacts ) 403 _win_contacts.icon(_img_status); 404 329 405 _conn.go('$this.Ujabber.setPresence', _presence); 330 406 } … … 333 409 function _vcard(_pJid) 334 410 { 411 var _win_vcard; 412 if ( !(_win_vcard = _window.get('vcard_' + _pJid)) ) 413 { 414 var _win_pos = _next_position(); 415 416 _win_vcard = _window.load('vcard_' + _pJid); 417 _win_vcard.title('.:: ' + imGetLang('Information Contacts') + ' ::.'); 418 _win_vcard.size(300); 419 _win_vcard.position(_win_pos, _win_pos); 420 421 _win_vcard.wc.style.padding = "3px"; 422 _win_vcard.bx.style.display = "none"; 423 } 424 else 425 _win_vcard.focus(); 426 335 427 if ( _vcards[_pJid] ) 336 428 { 337 429 if ( _info[_pJid] ) 338 430 delete _info[_pJid]; 339 340 var _win_vcard;341 if ( !(_win_vcard = _window.get('vcard_' + _pJid)) )342 {343 var _win_pos = _next_position();344 345 _win_vcard = _window.load('vcard_' + _pJid);346 _win_vcard.title('.:: Informações do Contato ::.');347 _win_vcard.size(300);348 _win_vcard.position(_win_pos, _win_pos);349 350 _win_vcard.wc.style.padding = "3px";351 _win_vcard.bx.style.display = "none";352 431 353 432 var _params = { … … 367 446 ) 368 447 ); 369 }370 else371 _win_vcard.focus();372 448 } 373 449 else 450 { 451 _win_vcard.loading(); 374 452 _conn.go('$this.Ujabber.getVcard', 'jid='+_pJid); 453 } 375 454 } 376 455 … … 416 495 { 417 496 if ( pIq.firstChild.getAttribute("seconds") != 0 ) 418 _ setPresence();497 _conn.go('$this.Ujabber.getContacts'); 419 498 } 420 499 … … 426 505 _from = _from.substr(0, _from.indexOf('/')); 427 506 507 var _contact_list = top.document.getElementById('contact_' + _from); 508 428 509 var _win = _window.get('chat' + _from); 429 510 511 if ( _contact_list && _pMessage.getElementsByTagName('composing').length > 0 ) 512 { 513 _contact_list.style.backgroundImage = 'url(' + im_composing.src + ')'; 514 setTimeout(function(){_contact_list.style.backgroundImage = 'url(' + eval('im_' + _contact_list.getAttribute('status') + '.src') + ')';}, 10000); 515 } 516 430 517 if ( _win && _pMessage.getElementsByTagName('composing').length > 0 ) 518 { 431 519 _win.wc.childNodes[1].lastChild.style.display = 'block'; 520 setTimeout(function(){_win.wc.childNodes[1].lastChild.style.display = 'none';}, 10000); 521 } 432 522 433 523 if ( _pMessage.getElementsByTagName('body').length > 0 ) … … 439 529 if ( _st ) 440 530 { 441 _st = _st.style.backgroundImage;442 _win.icon(_st .substr(4, (_st.length - 5)));531 _st = eval('im_' + _st.getAttribute('status') + '.src'); 532 _win.icon(_st); 443 533 } 444 534 } 445 446 var _history = _win.wc.firstChild; 535 _win.show(); 447 536 448 537 var _nickname; … … 458 547 _nickname = _from; 459 548 460 var _msg = _xtools.parse(_pMessage, 'message_new.xsl', {'nickname':_nickname}); 461 549 var _msg = _xtools.parse(_pMessage, 'message_new.xsl', {'nickname':_nickname,'time':Date().substr(16,5)}); 550 551 var _history = _win.wc.firstChild; 462 552 if ( _history.scrollHeight == (_history.scrollTop + _history.clientHeight) ) 463 553 { … … 470 560 471 561 _win.wc.childNodes[1].lastChild.style.display = 'none'; 472 } 562 if ( _contact_list ) 563 _contact_list.style.backgroundImage = 'url(' + eval('im_' + _contact_list.getAttribute('status') + '.src') + ')'; 564 } 565 566 if ( _contact_list && _pMessage.getElementsByTagName('paused').length > 0 ) 567 _contact_list.style.backgroundImage = 'url(' + eval('im_' + _contact_list.getAttribute('status') + '.src') + ')'; 473 568 474 569 if ( _win && _pMessage.getElementsByTagName('paused').length > 0 ) … … 486 581 var _mensagem_status_contact = top.document.getElementById('status_' + _from); 487 582 var _win_chat = _window.get('chat' + _from); 583 584 _img_status_contact.setAttribute('status', _presence_type); 488 585 489 586 if ( _mensagem_status_contact ) … … 503 600 if ( _win_chat ) 504 601 _win_chat.icon(eval('im_' + _presence_type + '.src')); 602 if ( _presence_type == 'unavailable' ) 603 { 604 var _show_all = _cookies.get('IM_unavailable'); 605 if ( _show_all == 'hidden' ) 606 _img_status_contact.style.display = 'none'; 607 } 608 else 609 _img_status_contact.style.display = 'block'; 505 610 break; 506 611 case 'subscribe' : … … 613 718 if ( _node.hasChildNodes() ) 614 719 { 720 _img_status_contact.style.display = 'block'; 615 721 switch ( _node.nodeName ) 616 722 { … … 695 801 _ldap = arguments[3]; 696 802 _menu = arguments[4]; 803 _cookies = arguments[5]; 697 804 } 698 805 -
trunk/instant_messenger/js/windows.js
r311 r318 56 56 'button' : _button, 57 57 'content' : _content, 58 'close' : function() 59 { 60 _button(_window.childNodes[1].childNodes[2].childNodes[0]); 61 }, 58 62 'focus' : _focus, 63 'hidden' : function() 64 { 65 _button(_window.childNodes[1].childNodes[2].childNodes[2]); 66 }, 59 67 'icon' : _icon, 68 'loading' : function() 69 { 70 var _information = top.document.createElement('span'); 71 _information.appendChild( 72 top.document.createTextNode(imGetLang('Loading')) 73 ); 74 75 var _loading = top.document.createElement('div'); 76 _loading.className = 'loading'; 77 _loading.appendChild(_information); 78 79 _content.call(this, _loading); 80 }, 60 81 'position' : _position, 82 'show' : function() 83 { 84 _window.style.display = 'block'; 85 }, 61 86 'size' : _size, 62 87 'title' : _title … … 106 131 delete _all_windows[w.id]; 107 132 break; 133 case 'minimize' : 134 w.style.display = 'none'; 135 break; 108 136 case 'maximize' : 109 137 if ( !w.getAttribute('wParams') ) 110 138 { 111 139 var _wParams = (parseFloat(w.style.width) - 13); 112 _wParams += ':' + parseFloat(w.childNodes[2].firstChild.style. height);140 _wParams += ':' + parseFloat(w.childNodes[2].firstChild.style.maxHeight); 113 141 _wParams += ':' + parseFloat(w.style.left); 114 142 _wParams += ':' + parseFloat(w.style.right); … … 122 150 w.style.height = "100%"; 123 151 w.style.width = "100%"; 152 153 var _style = w.childNodes[2].firstChild.getAttribute('style'); 154 if ( typeof _style == 'object' && _style.cssText ) 155 _style = _style.cssText; 156 157 if ( w.childNodes[2].firstChild.style.cssText ) 158 w.childNodes[2].firstChild.style.cssText = ''; 159 160 _style = _style.replace(/max-height: ?\d+;?/i, ''); 161 162 w.childNodes[2].firstChild.setAttribute('style', _style); 124 163 125 164 w.childNodes[2].firstChild.style.height = (_bwr.height - 41) + "px"; … … 182 221 } 183 222 break; 184 case 'minimize' :185 w.style.display = 'none';186 break;187 223 } 188 224 } … … 271 307 272 308 if ( typeof pHeight == 'number' && !isNaN(pHeight) ) 273 this.wc.style. height = pHeight + 'px';309 this.wc.style.maxHeight = pHeight + 'px'; 274 310 } 275 311 … … 285 321 { 286 322 var _argv = arguments; 287 this._TARGET = ( _argv[_argv.length - 1].id ) ? 288 _argv[_argv.length - 1] : document.body; 323 var _argc = _argv.length; 324 if ( (_argv[_argc - 1] != null) && (_argv[_argc - 1]).id ) 325 this._TARGET = _argv[_argc - 1]; 326 else 327 this._TARGET = top.document.body; 289 328 290 329 _xtools = arguments[0]; -
trunk/instant_messenger/setup/phpgw_pt-br.lang
r311 r318 7 7 Added information! instant_messenger pt-br Informações Adicionadas! 8 8 Authorization instant_messenger pt-br Autorização 9 available instant_messenger pt-br Conectado9 available instant_messenger pt-br Disponível 10 10 away instant_messenger pt-br Ausente 11 11 Birthday instant_messenger pt-br Aniversário … … 21 21 Delete instant_messenger pt-br Remover 22 22 Description instant_messenger pt-br Descrição 23 dnd instant_messenger pt-br Desconectado23 dnd instant_messenger pt-br Não Perturbe 24 24 deny instant_messenger pt-br Negar 25 25 Error in the message! instant_messenger pt-br Erro na mensagem! … … 30 30 instant_messenger common pt-br Mensageiro Instantâneo 31 31 instant_messenger_t instant_messenger pt-br Mensageiro Instantâneo 32 Information Contacts instant_messenger pt-br Informações do Contato 32 33 Information instant_messenger pt-br Informações Adicionais 33 34 Information User instant_messenger pt-br Informações Pessoais … … 79 80 Update instant_messenger pt-br Atualizar 80 81 Username instant_messenger pt-br Username 81 unavailable instant_messenger pt-br Não Perturbe82 unavailable instant_messenger pt-br Desconectado 82 83 Vcard instant_messenger pt-br Vcard 83 84 You desire to register in service IM? instant_messenger pt-br Você deseja registrar no serviço IM? -
trunk/instant_messenger/templates/default/config.tpl
r265 r318 1 1 <!-- BEGIN header --> 2 <script type="text/javascript" src="instant_messenger/js/connector.js"></script> 3 <script type="text/javascript" src="instant_messenger/js/xtools.js"></script> 4 <script type="text/javascript" src="instant_messenger/controller.php?act=j.setup"></script> 5 <script type="text/javascript"> 6 var PostForm = new constructScript; 7 </script> 2 8 <form method="POST" action="{action_url}"> 3 9 <table border="0" align="center"> … … 18 24 <tr bgcolor="{row_on}"> 19 25 <td>Digite o nome do Servidor Jabber:</td> 20 <td><input id="IM_name_jabber" name="newsettings[name_jabber]" value="{value_name_jabber}"></td>26 <td><input type="text" id="IM_name_jabber" name="newsettings[name_jabber]" value="{value_name_jabber}"></td> 21 27 </tr> 22 28 23 29 <tr bgcolor="{row_off}"> 24 30 <td>Digite Nome da Conexão:</td> 25 <td><input id="IM_resource_jabber" name="newsettings[resource_jabber]" value="{value_resource_jabber}"></td>31 <td><input type="text" id="IM_resource_jabber" name="newsettings[resource_jabber]" value="{value_resource_jabber}"></td> 26 32 </tr> 27 33 28 34 <tr bgcolor="{row_on}"> 29 35 <td>Digite a porta do Servidor Jabber:</td> 30 <td><input id="IM_port_jabber" name="newsettings[port_jabber]" value="{value_port_jabber}"></td>36 <td><input type="text" id="IM_port_jabber" name="newsettings[port_jabber]" value="{value_port_jabber}"></td> 31 37 </tr> 32 38 … … 41 47 <tr bgcolor="{row_on}"> 42 48 <td>Digite o Ip do Servidor WebJabber:</td> 43 <td><input id="IM_server_webjabber" name="newsettings[server_webjabber]" value="{value_server_webjabber}"></td>49 <td><input type="text" id="IM_server_webjabber" name="newsettings[server_webjabber]" value="{value_server_webjabber}"></td> 44 50 </tr> 45 51 … … 54 60 <tr bgcolor="{row_on}"> 55 61 <td>Servidor Ldap:</td> 56 <td><input id="IM_server_ldap_jabber" name="newsettings[server_ldap_jabber]" value="{value_server_ldap_jabber}"></td>62 <td><input type="text" id="IM_server_ldap_jabber" name="newsettings[server_ldap_jabber]" value="{value_server_ldap_jabber}"></td> 57 63 </tr> 58 64 59 65 <tr bgcolor="{row_off}"> 60 66 <td>Contexto:</td> 61 <td><input id="IM_context_ldap_jabber" name="newsettings[context_ldap_jabber]" value="{value_context_ldap_jabber}" size="30"></td>67 <td><input type="text" id="IM_context_ldap_jabber" name="newsettings[context_ldap_jabber]" value="{value_context_ldap_jabber}" size="30"></td> 62 68 </tr> 63 69 64 70 <tr bgcolor="{row_on}"> 65 71 <td>Usuário Ldap:</td> 66 <td><input id="IM_user_ldap_jabber" name="newsettings[user_ldap_jabber]" value="{value_user_ldap_jabber}" size="30"></td>72 <td><input type="text" id="IM_user_ldap_jabber" name="newsettings[user_ldap_jabber]" value="{value_user_ldap_jabber}" size="30"></td> 67 73 </tr> 68 74 69 75 <tr bgcolor="{row_off}"> 70 76 <td>Password:</td> 71 <td><input type="password" name="newsettings[password_ldap_jabber]" value="{value_password_ldap_jabber}"></td>77 <td><input type="password" id="IM_password_ldap_jabber" name="newsettings[password_ldap_jabber]" value="{value_password_ldap_jabber}"></td> 72 78 </tr> 73 79 <!-- END body --> … … 76 82 <tr> 77 83 <td colspan="2" align="center"> 78 <input type="submit" name="submit" value="{lang_submit}" >84 <input type="submit" name="submit" value="{lang_submit}" onclick="javascript:PostForm.sendf(document);return false;" > 79 85 <input type="submit" name="cancel" value="{lang_cancel}"> 80 86 </td> -
trunk/instant_messenger/templates/default/css/common.css
r305 r318 92 92 } 93 93 94 div.loading 95 { 96 background: #fdd url(../images/loading.gif) no-repeat 1px 1px; 97 border: 1px dashed #f00; 98 margin: 2px; 99 padding: 3px 3px 3px 20px; 100 text-align: center; 101 } 102 103 span.message_time 104 { 105 color: #aaa; 106 font: 8pt Verdana, Arial, Helvetica, sans-serif; 107 } 108 94 109 .font_menu 95 110 { -
trunk/instant_messenger/templates/default/css/window.css
r311 r318 21 21 } 22 22 23 #instant_messenger_content .icon24 {25 position:absolute !important;26 height: 15px;27 width: 15px;28 }29 30 23 #instant_messenger_content .titulo 31 24 { … … 40 33 } 41 34 35 #instant_messenger_content .titulo .icon 36 { 37 float:left; 38 height: 15px; 39 width: 15px; 40 } 41 42 42 #instant_messenger_content .titulo span 43 43 { 44 44 float:left; 45 margin-left: 17px;45 margin-left: 2px; 46 46 } 47 47 48 #instant_messenger_content .titulo div div 48 #instant_messenger_content .buttons 49 { 50 position:absolute !important; 51 right:3px !important; 52 width:50px !important; 53 } 54 55 #instant_messenger_content .titulo .buttons div 49 56 { 50 57 cursor: pointer; … … 54 61 width: 13px; 55 62 height:13px; 56 }57 58 #instant_messenger_content .buttons59 {60 position:absolute !important;61 right:3px !important;62 width:50px !important;63 63 } 64 64 -
trunk/instant_messenger/xsl/contacts.xsl
r311 r318 29 29 30 30 <xsl:template match="*" mode="contacts"> 31 <div style="background:url({$path}templates/default/images/unavailable.gif) no-repeat 15px;padding-left:30px;cursor:pointer; display:block;" id="contact_{@jid}" idgroup="{group}" idname="{@name}" jid="{@jid}">31 <div style="background:url({$path}templates/default/images/unavailable.gif) no-repeat 15px;padding-left:30px;cursor:pointer;" id="contact_{@jid}" idgroup="{group}" idname="{@name}" jid="{@jid}"> 32 32 <xsl:choose> 33 33 <xsl:when test="@name"> -
trunk/instant_messenger/xsl/layer.xsl
r305 r318 13 13 <span id="im_layer_nickname"><xsl:value-of select="$nickname" /></span><br/><br/> 14 14 <img src="../instant_messenger/templates/default/images/addBuddy1.gif" style="cursor:pointer;" title="{$lang2}" alt="{$lang2}"/> 15 <!-- 16 <img src="../instant_messenger/templates/default/images/console_prefs1.png" style="cursor:pointer;" onclick="javascript:templates.preferences('span_preferences');" title="{$lang3}" alt="{$lang3}"/> 17 --> 15 <img src="../instant_messenger/templates/default/images/console_prefs1.png" onclick="im_preferences.load()" style="cursor:pointer;" title="{$lang3}" alt="{$lang3}"/> 18 16 <span id="span_preferences"></span><br/> 19 17 </div> -
trunk/instant_messenger/xsl/message_new.xsl
r305 r318 4 4 5 5 <xsl:param name="nickname" /> 6 <xsl:param name="time" /> 6 7 7 8 <xsl:template match="message"> 9 <xsl:if test="delay"> 10 <span class="message_time"> 11 <xsl:text>mensagem enviada em </xsl:text> 12 <xsl:value-of select="substring(delay/@stamp, 9, 2)"/>/ 13 <xsl:value-of select="substring(delay/@stamp, 6, 2)"/>/ 14 <xsl:value-of select="substring(delay/@stamp, 1, 4)"/> 15 <xsl:text> as </xsl:text> 16 <xsl:value-of select="substring(delay/@stamp, 12, 2) - 3"/> 17 <xsl:value-of select="substring(delay/@stamp, 14, 3)"/> 18 <br/> 19 </span> 20 </xsl:if> 21 <span class="message_time">[<xsl:value-of select="$time"/>] </span> 8 22 <b><xsl:value-of select="$nickname"/>:</b><br/> 9 23 <xsl:value-of select="body"/> -
trunk/instant_messenger/xsl/mysettings.xsl
r260 r318 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 3 <xsl:output method="html" omit-xml-declaration="yes"/>3 <xsl:output method="html" omit-xml-declaration="yes"/> 4 4 5 <xsl:template match="settings"> 6 <div id="im_preferences" style="margin:5px"> 7 <fieldset><legend> <xsl:value-of select="lang1"/> :</legend> 8 <input id="ch_offline" type="checkbox" /> <xsl:value-of select="lang2"/> 9 </fieldset> 10 <br /> 11 <fieldset><legend> <xsl:value-of select="lang3" /> : </legend> 12 <xsl:value-of select="lang4"/><input id="time_xa_im" type="input" size="2" maxlength="2" style="margin:0px 3px" onclick="javascript:im.focus_select(this,event);" onmousedown="javascript:im.focus_select(this,event);"/><xsl:value-of select="lang5"/> 13 </fieldset> 14 <br /> 15 <fieldset> 16 <legend> <xsl:value-of select="lang6" /> :</legend> 17 <input id="rd_nm" type="radio" name="rd_aviso" /> <xsl:value-of select="lang7" /> <br /> 18 <input id="rd_ch" type="radio" name="rd_aviso" /> <xsl:value-of select="lang8" /> 19 </fieldset> 20 <br/> 21 <input type="button" value="{lang9}" onclick="javascript:im.set_preferences();"/> 22 <input type="button" value="{lang10}" onclick="javascript:im_window.window_close('my_settings_im');"/> 23 </div> 24 </xsl:template> 5 <xsl:param name="lang1" /> 6 <xsl:param name="lang2" /> 7 <xsl:param name="lang3" /> 8 <xsl:param name="lang4" /> 9 <xsl:param name="lang5" /> 10 <xsl:param name="lang6" /> 11 <xsl:param name="lang7" /> 12 <xsl:param name="lang8" /> 13 <xsl:param name="lang9" /> 14 <xsl:param name="lang10" /> 25 15 16 <xsl:template match="settings"> 17 <div id="im_preferences"> 18 <fieldset> 19 <legend> <xsl:value-of select="$lang1"/> : </legend> 20 <input id="ch_offline" type="checkbox" /> 21 <label for="ch_offline"><xsl:value-of select="$lang2"/></label> 22 </fieldset> 23 <br /> 24 <fieldset> 25 <legend> <xsl:value-of select="$lang3" /> : </legend> 26 <label for="time_xa_im"><xsl:value-of select="$lang4"/></label> 27 <input id="time_xa_im" type="input" size="2" maxlength="2" style="margin:0px 3px" onclick="im_preferences.getfocus(this, event);" onmousedown="im_preferences.getfocus(this, event);"/> 28 <label for="time_xa_im"><xsl:value-of select="$lang5"/></label> 29 </fieldset> 30 <br /> 31 <fieldset> 32 <legend> <xsl:value-of select="$lang6" /> : </legend> 33 <input id="rd_nm" type="radio" name="rd_aviso" /> <label for="rd_nm"><xsl:value-of select="$lang7" /></label> 34 <br /> 35 <input id="rd_ch" type="radio" name="rd_aviso" /> <label for="rd_ch"><xsl:value-of select="$lang8" /></label> 36 </fieldset> 37 </div> 38 <br/> 39 <input type="button" value="{$lang9}"/> 40 <input type="button" value="{$lang10}"/> 41 </xsl:template> 26 42 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.