Example #1
0
 function loadSettingsLocalStorage() {
   try {
     var tmpSettings = JSON.parse(localStorage.getItem('tagSpacesSettings'));
     //Cordova try to load saved setting in app storage
     if (isCordova) {
       var appStorageSettings = JSON.parse(TSCORE.IO.loadSettings());
       var appStorageTagGroups = JSON.parse(TSCORE.IO.loadSettingsTags());
       if (appStorageSettings) {
         tmpSettings = appStorageSettings;
       }
       if (appStorageTagGroups) {
         tmpSettings.tagGroups = appStorageTagGroups.tagGroups;
       }
     }
     //console.log("Settings: "+JSON.stringify(tmpSettings));        
     if (tmpSettings !== null) {
       exports.Settings = tmpSettings;
     } else {
       // If no settings found in the local storage,
       // the application runs for the first time.
       firstRun = true;
     }
     console.log('Loaded settings from local storage: '); //+ JSON.stringify(exports.Settings));
   } catch (ex) {
     console.log('Loading settings from local storage failed due exception: ' + ex);
   }
 }