Changeset 2325 for sandbox/jabberit_messenger/trophy/js/loadIM.js
- Timestamp:
- 03/22/10 17:08:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/jabberit_messenger/trophy/js/loadIM.js
r2320 r2325 1 1 (function() 2 2 { 3 var path = "/jmessenger/"; 4 var _xtools = null; 5 var zIndex = 9001; 3 var path = "/jmessenger/"; 4 var _showhidden = null; 5 var _xtools = null; 6 var zIndex = 9001; 6 7 7 8 function configEvents(pObj, pEvent, pHandler) … … 134 135 } 135 136 136 function TrophyIMStatusDiv()137 {138 var statusDiv = '<div id="trophyimstatus">' +139 '<span>Status::::</span>' +140 '<span id="trophyimstatuslist">Select box</span>' +141 '<br/>' +142 '<form>' +143 '<input type="button" value="disconnect" onclick="TrophyIM.logout()"/>' +144 '</form>' +145 '<input type="button" value="DND" onclick="TrophyIM.setTest(\'dnd\')">'+146 '<input type="button" value="AWAY" onclick="TrophyIM.setTest(\'away\')">'+147 '<input type="button" value="XA" onclick="TrophyIM.setTest(\'xa\')">'+148 '<input type="button" value="INVISIBLE" onclick="TrophyIM.setTest(\'invisible\')">'+149 '<input type="button" value="UNAVAILABLE" onclick="TrophyIM.setTest(\'unavailable\')">'+150 '<input type="button" value="AVAILABLE" onclick="TrophyIM.setTest(\'available\')">'+151 '</div>';152 153 return statusDiv;154 155 }156 157 137 function HTMLSnippets( pType ) 158 138 { … … 174 154 175 155 this.rosterItem = TrophyIMRosterItem; 176 177 this.statusDiv = TrophyIMStatusDiv; 156 178 157 } ); 179 158 } 180 181 159 182 160 function getZindex() … … 196 174 function loadScripts(pFiles) 197 175 { 198 // Load JavaScript176 // Load JavaScript 199 177 var loadJavaScript = function(pJs) 200 178 { … … 206 184 }; 207 185 208 // Load CSS186 // Load CSS 209 187 var loadStyleSheet = function(pCss) 210 188 { … … 232 210 if( arguments.length > 0 ) 233 211 { 234 alert('Valor : ' + arguments[0]); 212 var element = arguments[0]; 213 214 if( _showhidden == null ) 215 _showhidden = new ShowHidden(300); 216 217 var _status = [ 218 ['Afastado', 'away', '<img src="images/away.gif" />'], 219 ['Disponível', 'available', '<img src="images/available.gif" />'], 220 ['Livre p/ Conversa', 'chat', '<img src="images/chat.gif" />'], 221 ['Não Disponível', 'xa', '<img src="images/xa.gif" />'], 222 ['Ocupado', 'dnd', '<img src="images/dnd.gif" />'], 223 ]; 224 225 var _itens = ""; 226 227 for( var i in _status ) 228 { 229 _itens += '<span style="cursor:pointer;" onclick="TrophyIM.setPresence(\''+_status[i][1]+'\'); loadIM.setStatusJabber(\''+_status[i][0]+'\',\''+_status[i][1]+'\');">'; 230 _itens += _status[i][2]+ "<span style='margin:3px;'>" + _status[i][0] + "</span></span><br/>"; 231 } 232 233 var _statusItens = document.createElement("div"); 234 _statusItens.setAttribute("style", "margin: 62px 0px 0px 76px;"); 235 _statusItens.className = "x-menu"; 236 _statusItens.style.zIndex = '99999'; 237 _statusItens.innerHTML = _itens; 238 239 _showhidden.action('onmouseover', 'onmouseout', _statusItens); 240 241 element.parentNode.onmouseout = function(){ _showhidden.hiddenObject(false); }; 242 element.parentNode.onmouseover = function(){ _showhidden.hiddenObject(true); }; 243 element.parentNode.appendChild(_statusItens); 235 244 } 245 } 246 247 function setStatusJabber() 248 { 249 if( arguments.length > 0 ) 250 { 251 var _text = arguments[0]; 252 var _img = arguments[1]; 253 254 document.getElementById('statusJabberImg').setAttribute("style", "background-image: url('images/"+_img+".gif'); margin-left: 13px;width:15px; height:15px;"); 255 document.getElementById('statusJabberText').innerHTML = _text; 256 } 236 257 } 237 258 … … 250 271 'js/show_hidden.js', 251 272 'css/trophyim.css', 252 //'css/window_azul.css'273 'css/window_azul.css' 253 274 //'css/window_cataratas.css' 254 275 //'css/window_celepar.css' … … 257 278 //'css/window_escritorio.css' 258 279 //'css/window_metropole.css' 259 'css/window_rochas.css'280 //'css/window_rochas.css' 260 281 ]; 261 282 262 283 loadScripts(files); 263 }264 284 285 } 265 286 266 287 loadIM.prototype.configEvents = configEvents; … … 268 289 loadIM.prototype.parse = parse; 269 290 loadIM.prototype.setPresence = setPresence; 291 loadIM.prototype.setStatusJabber = setStatusJabber; 270 292 271 293 loadIM.prototype.HTMLSnippets = new HTMLSnippets;
Note: See TracChangeset
for help on using the changeset viewer.