Resources/js/d/main.js
changeset 0 80c32ef237c6
child 1 b3419d05eabb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/js/d/main.js	Mon Sep 02 02:22:21 2013 -0700
@@ -0,0 +1,43 @@
+
+$( window ).ready( function() {
+	if ( D.getBoolPref('fullscreen') ) D.window.main.setFullscreen( true );
+
+	// If we're in development mode, just display the main window,
+	// the inpector, and stop here.
+	//
+	if ( D.getBoolPref('devmode') ) {
+		D.window.main.showInspector( true );
+		return;
+	}
+
+	// "Regular" behavior.  Hide the main window, show splash.
+	//
+	if ( ! D.getBoolPref('hidesplash') ) {
+		D.window.main.hide();
+		D.window.splash = D.window.main.createWindow( 'app://window/splash.html' );
+		D.window.splash.setTopMost( true );
+		D.window.splash.open();
+	}
+
+	var server_uri = D.getPref( 'server_uri' );
+	if ( server_uri ) D.checkServer( server_uri );
+
+
+	// Show the main window after a few moments.
+	//
+	D.delay(function() {
+		if ( ! D.getBoolPref('hidesplash') ) {
+			D.window.main.show();
+			D.window.splash.close();
+		}
+
+		// Throw up the prefs window if this is the first time.
+		//
+		if ( D.firstrun ) {
+			D.window.prefs = D.window.main.createWindow( 'app://window/prefs.html#server' );
+			D.window.prefs.open();
+			D.notify( 'Initial setup', 'Please point me to a Thingfish server!' );
+		}
+	}, 3000 );
+});
+