Changeset 1982


Ignore:
Timestamp:
02/04/10 16:42:53 (14 years ago)
Author:
eduardoalex
Message:

Ticket #888 - Atualizando a lista de contato apenas se o usuario possui o expresso offline instalado

Location:
trunk/expressoMail1_2/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/local_messages.js

    r1969 r1982  
    77                this.localServer = null; 
    88                this.store = null; 
    9                 this.fileSubmitter = null; 
    109        } 
    1110 
     
    118117                else return false; 
    119118        } 
    120         local_messages.prototype.init_local_messages = function(){ 
     119 
     120        local_messages.prototype.create_objects = function() { 
    121121                if(this.dbGears == null) 
    122122                        this.dbGears = google.gears.factory.create('beta.database'); 
    123                 if(this.localServer==null) 
     123                if(this.localServer == null) 
    124124                        this.localServer = google.gears.factory.create('beta.localserver'); 
    125                 if(this.store==null) 
    126                         this.store = this.localServer.createStore('test-store');                         
     125                if(this.store == null) 
     126                        this.store = this.localServer.createStore('test-store'); 
     127        } 
     128 
     129        local_messages.prototype.init_local_messages = function(){ //starts only database operations 
     130                 
     131                if(this.dbGears==null || this.localServer==null || this.store == null) 
     132                        this.create_objects(); 
    127133                 
    128134                var db_in_other_use = true; 
     
    139145                        } 
    140146                } 
    141                  
    142                 /*var db_is_opened = true; 
    143                 while (db_is_opened) { 
    144                         try { 
    145                                 this.dbGears.open('database-test'); 
    146                                 db_is_opened = true; 
    147                         }  
    148                         catch (ex) { 
    149                                 db_is_opened=false; 
    150                         } 
    151                 }*/ 
    152                  
     147                         
    153148//              this.dbGears.open('database-test'); 
    154149                this.dbGears.execute('create table if not exists folder (folder text,uid_usuario int,unique(folder,uid_usuario))'); 
     
    15951590        var expresso_local_messages; 
    15961591        expresso_local_messages = new local_messages(); 
     1592        expresso_local_messages.create_objects(); 
  • trunk/expressoMail1_2/js/main.js

    r1969 r1982  
    1111        var save_contacts = function(data){ 
    1212                contacts = data; 
    13                 expresso_local_messages.capt_url('controller.php?action=$this.db_functions.get_dropdown_contacts_to_cache'); 
     13                if (preferences.use_local_messages == 1 && window.google && google.gears)  
     14                        if (expresso_local_messages.is_offline_installed())  
     15                                expresso_local_messages.capt_url('controller.php?action=$this.db_functions.get_dropdown_contacts_to_cache'); 
     16 
    1417        } 
    1518        var save_preferences = function(data){ 
     
    5457        // Fim da inserção da applet 
    5558 
     59                cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); //Save contacts needs preferences. 
    5660                cExecute ("$this.imap_functions.get_folders_list&onload=true", update_menu); 
     61                 
    5762        } 
    5863        var handler_automatic_trash_cleanness = function(data){ 
     
    6873        cyrus_delimiter = Element('cyrus_delimiter').value; 
    6974 
    70         cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); 
    7175        cExecute ("$this.functions.get_preferences", save_preferences); 
    7276        setTimeout('auto_refresh()', time_refresh); 
Note: See TracChangeset for help on using the changeset viewer.