Changeset 1982
- Timestamp:
- 02/04/10 16:42:53 (14 years ago)
- Location:
- trunk/expressoMail1_2/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/local_messages.js
r1969 r1982 7 7 this.localServer = null; 8 8 this.store = null; 9 this.fileSubmitter = null;10 9 } 11 10 … … 118 117 else return false; 119 118 } 120 local_messages.prototype.init_local_messages = function(){ 119 120 local_messages.prototype.create_objects = function() { 121 121 if(this.dbGears == null) 122 122 this.dbGears = google.gears.factory.create('beta.database'); 123 if(this.localServer ==null)123 if(this.localServer == null) 124 124 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(); 127 133 128 134 var db_in_other_use = true; … … 139 145 } 140 146 } 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 153 148 // this.dbGears.open('database-test'); 154 149 this.dbGears.execute('create table if not exists folder (folder text,uid_usuario int,unique(folder,uid_usuario))'); … … 1595 1590 var expresso_local_messages; 1596 1591 expresso_local_messages = new local_messages(); 1592 expresso_local_messages.create_objects(); -
trunk/expressoMail1_2/js/main.js
r1969 r1982 11 11 var save_contacts = function(data){ 12 12 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 14 17 } 15 18 var save_preferences = function(data){ … … 54 57 // Fim da inserção da applet 55 58 59 cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); //Save contacts needs preferences. 56 60 cExecute ("$this.imap_functions.get_folders_list&onload=true", update_menu); 61 57 62 } 58 63 var handler_automatic_trash_cleanness = function(data){ … … 68 73 cyrus_delimiter = Element('cyrus_delimiter').value; 69 74 70 cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts);71 75 cExecute ("$this.functions.get_preferences", save_preferences); 72 76 setTimeout('auto_refresh()', time_refresh);
Note: See TracChangeset
for help on using the changeset viewer.