source: trunk/instant_messenger/js/im_init.js @ 20

Revision 20, 3.3 KB checked in by niltonneto, 17 years ago (diff)

Inclusão do módulo Mensageiro Instantâneo no CVS.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1// Instant Messenger
2// im_init.js
3
4   function _init_jabber()
5   {
6      try
7      {
8         if ( window.IM )
9         {
10            setTimeout('IM.atalho()', 6000);
11            setTimeout('IM.load_im(true)', 6200);
12         }
13         else
14            setTimeout('_init_jabber()', 2000);
15      }
16      catch(e)
17      {
18            setTimeout('_init_jabber()', 2000);
19      }
20   }
21
22   var _date = new Date();                                                                   
23   var _time = '?' + _date.getTime();                                                         
24   var js_path = im_path + "js/";                                                                       
25   var css_path = im_path + "templates/default/";                                                                     
26   // conn = new cConnector();
27
28   function init_jabber()
29   {
30      //alert('inicio - im_path: ' + im_path);
31
32      /* CSS's */
33      new_css = new Array();
34      new_css[0] = css_path + 'css.css' + _time;
35      new_css[1] = css_path + 'messenger.css';
36      /* JS's
37       *
38       * escritos pelo arquivo index2.php para que
39       * seja sobrescrito o cache apenas quando há
40       * alteração no conteúdo dos scripts
41       *
42       */
43
44      for ( i = 0; i < new_css.length; i++ ) IM_loadCss(new_css[i]);
45      for ( i = 0; i < new_js.length; i++ ) setTimeout('IM_loadScript(\'' + (new_js[i] + _time) + '\')', (650 * (i+1)));
46
47      _init_jabber();
48   }
49
50   function add_head(pElement)                                                               
51   {                                                                                         
52      _head = document.getElementsByTagName('head').item(0);                                 
53      _head.appendChild(pElement);                                                           
54   }                                                                                         
55                                                                                               
56   function IM_loadCss(pName)                                                                   
57   {                                                                                         
58      _css = document.createElement('link');                                                   
59      _css.setAttribute('rel', 'stylesheet');                                                   
60      //_css.setAttribute('type', 'text/css'):                                                 
61      _css.setAttribute('href', pName + _time);                                                 
62      add_head(_css);                                                                           
63   }                                                                                         
64                                                                                               
65   function load_script(pName)                                                               
66   {                                                                                         
67      _script = document.createElement('script');
68      _script.setAttribute('src', pName);
69      _script.setAttribute('type', 'text/javascript');
70      add_head(_script);/**/
71   }                                                                                         
72//im_win.load();
73setTimeout('init_jabber()', 5000)
Note: See TracBrowser for help on using the repository browser.