Ejemplo n.º 1
0
  /**
   * Initalizes the application
   * @memberof TSCORE
   * @method initApp
   */
  function initApp() {
    console.log('Init application');
    tsSettings.loadSettingsLocalStorage();
    checkLocalStorageEnabled();
    // In firefox, by empty local storage trying to load the settings from mozilla preferences
    if (tsSettings.Settings === undefined && isFirefox) {
      window.setTimeout(tsIOApi.loadSettings, 1000);
      // executes initUI and updateSettingMozillaPreferences by success
      console.log('Loading setting with from mozilla pref executed with delay...');
    }
    // If still nothing found, loading the default setting from the application's javascript
    // This is usually the case by a new installation
    if (tsSettings.Settings === undefined) {
      tsSettings.Settings = tsSettings.DefaultSettings;
    }
    tsSettings.upgradeSettings();
    // Init UI components
    tsCoreUI.initUI();
    tsTagsUI.initUI();
    tsTagsUI.generateTagGroups();
    tsDirectoriesUI.initUI();
    tsDirectoriesUI.initLocations();
    tsFileOpener.initUI();
    tsPersManager.initPerspectives().then(function(result) {
      console.log("initPerspectives: " + result);
    }).catch(function(err) {
      alert("initPerspectives: " + err);
    });

    hideLoadingAnimation();

    $(document).ready(function() {
      reLayout();

      var language = tsSettings.getInterfaceLangauge();
      // "de-DE"
      var langURLParam = getParameterByName('locale');
      if (langURLParam.length > 1) {
        language = langURLParam;
      }
      switchInterfaceLanguage(language);
      initKeyBindings();
      tsIOApi.checkAccessFileURLAllowed ? tsIOApi.checkAccessFileURLAllowed() : true;
      // Show welcome dialog of first start
      if (tsSettings.isFirstRun()) {
        tsCoreUI.showWelcomeDialog();
      }
      // Show welcome dialog by no locations
      if (tsSettings.Settings.tagspacesList.length < 1) {
        tsCoreUI.startGettingStartedTour();
      }
      if (isNode || isChrome || isElectron || isWeb) {
        // Handle command line argument in node-webkit
        tsIOApi.handleStartParameters(); // Handle minimizing to the tray in node-webkit
      }
      console.log('Docoument ready finished. Layout initialized');
      checkForNewVersion();
    });
  }
Ejemplo n.º 2
0
	function initApp() {
	    console.log("Init application");
		
	    tsSettings.loadSettingsLocalStorage();
	    
        checkLocalStorageEnabled();	    
	    
	    // In firefox, by empty local storage trying to load the settings from mozilla preferences
	    if(tsSettings.Settings == undefined && isFirefox) {
	        window.setTimeout(tsIOApi.loadSettings, 1000); // executes initUI and updateSettingMozillaPreferences by success
	        console.log("Loading setting with from mozilla pref execured with delay...");
	    } 
	
	    // If still nothing found, loading the default setting from the application's javascript
	    // This is usually the case by a new installation
	    if(tsSettings.Settings == undefined) {
	        tsSettings.Settings = tsSettings.DefaultSettings;
	    }    
	  
	  	tsSettings.upgradeSettings();
        
        // Init UI components
        tsCoreUI.initUI();  
        tsTagsUI.initUI();      
        tsTagsUI.generateTagGroups();
        tsDirectoriesUI.initUI();
        tsDirectoriesUI.initLocations();
        tsFileOpener.initUI();
		tsPersManager.initPerspectives();                 
	    
	    hideLoadingAnimation();

	    $(document).ready(function() {
	        initLayout();
	        initI18N();
	        initKeyBindings();
		    $( "#loading" ).hide();  
	    
		    // Show start hint by no last location
		    var lastLocation = tsSettings.getLastOpenedLocation();
		    if(lastLocation == undefined || lastLocation.length < 1 ) {
                tsCoreUI.showWelcomeDialog();         
            }	
		    
		    // Show start hint by no locations
            /*if(tsSettings.Settings.tagspacesList.length < 1 ) {
                $( "#createNewLocation" ).tooltip( "show" );
                $( "#locationName" ).prop('disabled', true);
                $( "#selectLocation" ).prop('disabled', true);     
                tsCoreUI.showWelcomeDialog();         
            }*/	    
	    
	        console.log("Layout initialized");
	    }); 
	    
        checkForNewVersion();
	}	
Ejemplo n.º 3
0
    function initApp() {
        console.log("Init application");

        tsSettings.loadSettingsLocalStorage();

        checkLocalStorageEnabled();

        // In firefox, by empty local storage trying to load the settings from mozilla preferences
        if(tsSettings.Settings === undefined && isFirefox) {
            window.setTimeout(tsIOApi.loadSettings, 1000); // executes initUI and updateSettingMozillaPreferences by success
            console.log("Loading setting with from mozilla pref execured with delay...");
        }

        // If still nothing found, loading the default setting from the application's javascript
        // This is usually the case by a new installation
        if(tsSettings.Settings === undefined) {
            tsSettings.Settings = tsSettings.DefaultSettings;
        }

        tsSettings.upgradeSettings();
        
        // Init UI components
        tsCoreUI.initUI();  
        tsTagsUI.initUI();      
        tsTagsUI.generateTagGroups();
        tsDirectoriesUI.initUI();
        tsDirectoriesUI.initLocations();
        tsFileOpener.initUI();
        tsPersManager.initPerspectives();

        hideLoadingAnimation();

        $(document).ready(function() {
            initLayout();
            switchInterfaceLanguage(tsSettings.getInterfaceLangauge()); // "de-DE"
            initKeyBindings();
            $( "#loading" ).hide();

            // Show welcome dialog of first start
            if(tsSettings.isFirstRun()) {
                tsCoreUI.showWelcomeDialog();
            }

            // Show welcome dialog by no locations
            if(tsSettings.Settings.tagspacesList.length < 1 ) {
                $( "#createNewLocation" ).tooltip( "show" );
                $( "#locationName" ).prop('disabled', true);
                $( "#selectLocation" ).prop('disabled', true);     
                tsCoreUI.showWelcomeDialog();
            }

            // Handle command line argument in node-webkit
            if(isNode) {
                tsIOApi.handleStartParameters();
            }

            console.log("Layout initialized");
        });

        checkForNewVersion();
    }