Skip to content

Commit

Permalink
Getting application ready for jsx transition. See #35
Browse files Browse the repository at this point in the history
  • Loading branch information
MKHenson committed Jul 31, 2016
1 parent 72a58ba commit ae054bd
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 91 deletions.
129 changes: 51 additions & 78 deletions lib/definitions/generated/hatchery-editor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3631,57 +3631,6 @@ declare module Animate {
items: Array<JQuery>;
}
}
declare module Animate {
/**
* The main GUI component of the application.
*/
class Application extends Component {
private static _singleton;
static bodyComponent: Component;
private _focusObj;
private _resizeProxy;
private _downProxy;
private _dockerlefttop;
private _dockerleftbottom;
private _dockerrighttop;
private _dockerrightbottom;
private _canvasContext;
constructor(domElement?: string);
/**
* Deals with the focus changes
* @param {object} e The jQuery event object
*/
onMouseDown(e: any): void;
/**
* Sets a component to be focused.
* @param {Component} comp The component to focus on.
*/
setFocus(comp: Component): void;
/**
* Updates the dimensions of the application
* @param {object} val The jQuery event object
*/
onWindowResized(val: any): void;
/**
* This will cleanup the component.
*/
dispose(): void;
/**
* This is called when a project is unloaded and we need to reset the GUI.
*/
projectReset(): void;
/**
* Gets the singleton instance
*/
static getInstance(domElement?: string): Application;
focusObj: Component;
canvasContext: CanvasContext;
dockerLeftTop: Docker;
dockerLeftBottom: Docker;
dockerRightTop: Docker;
dockerRightBottom: Docker;
}
}
declare module Animate {
type LinkMap = {
[shallowId: number]: {
Expand Down Expand Up @@ -6610,33 +6559,6 @@ declare module Animate {
* @param {boolean} True if there is an error
*/
newProject(name: string, description: string, plugins: Array<Engine.IPlugin>): void;
loginError(err: Error): void;
loginSuccess(data: UsersInterface.IResponse): void;
/**
* Attempts to log the user in
* @param {string} user The username
* @param {string} password The user password
* @param {boolean} remember Should the user cookie be saved
*/
login(user: string, password: string, remember: boolean): void;
/**
* Attempts to register a new user
* @param {string} user The username of the user.
* @param {string} password The password of the user.
* @param {string} email The email of the user.
* @param {string} captcha The captcha of the login screen
*/
register(user: string, password: string, email: string, captcha: string): void;
/**
* Attempts to resend the activation code
* @param {string} user The username or email of the user to resend the activation
*/
resendActivation(user: string): void;
/**
* Attempts to reset the users password
* @param {string} user The username or email of the user to resend the activation
*/
resetPassword(user: string): void;
/**
* Attempts to resend the activation code
*/
Expand All @@ -6653,6 +6575,57 @@ declare module Animate {
static get: Splash;
}
}
declare module Animate {
/**
* The main GUI component of the application.
*/
class Application extends Component {
private static _singleton;
static bodyComponent: Component;
private _focusObj;
private _resizeProxy;
private _downProxy;
private _dockerlefttop;
private _dockerleftbottom;
private _dockerrighttop;
private _dockerrightbottom;
private _canvasContext;
constructor(domElement?: string);
/**
* Deals with the focus changes
* @param {object} e The jQuery event object
*/
onMouseDown(e: any): void;
/**
* Sets a component to be focused.
* @param {Component} comp The component to focus on.
*/
setFocus(comp: Component): void;
/**
* Updates the dimensions of the application
* @param {object} val The jQuery event object
*/
onWindowResized(val: any): void;
/**
* This will cleanup the component.
*/
dispose(): void;
/**
* This is called when a project is unloaded and we need to reset the GUI.
*/
projectReset(): void;
/**
* Gets the singleton instance
*/
static getInstance(domElement?: string): Application;
focusObj: Component;
canvasContext: CanvasContext;
dockerLeftTop: Docker;
dockerLeftBottom: Docker;
dockerRightTop: Docker;
dockerRightBottom: Docker;
}
}
declare var _cache: string;
declare var __plugins: {
[name: string]: Array<Engine.IPlugin>;
Expand Down
7 changes: 6 additions & 1 deletion lib/gui/application.ts → lib/gui/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ module Animate
//Hook the resize event
jQuery( window ).on( 'resize', this._resizeProxy );
jQuery( document ).on( 'mousedown', this._downProxy );

var splash = ReactDOM.render( <Animate.Splash />, this.element[0] ) as Animate.Splash;

// Show Splash screen
splash.show();
}

/**
Expand All @@ -88,7 +93,7 @@ module Animate
onMouseDown( e ) : void
{
var elem : JQuery = jQuery( e.target );
var comp: Component = <Component>elem.data( "component" );
var comp: Component = elem.data( "component" ) as Component;

while ( !comp && elem.length != 0 )
{
Expand Down
10 changes: 0 additions & 10 deletions lib/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,6 @@ function onPluginsLoaded(plugins: Array<Engine.IPlugin>)

// Create the application element
var app = new Animate.Application("#application");

app.element.detach();

// // Initialize the splash instance
// var splash = Animate.Splash.init(app);

var splash = ReactDOM.render( <Animate.Splash />, jQuery("body")[0]) as Animate.Splash;

// Show Splash screen
splash.show();
}

/**
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"lib/gui/list.ts",
"lib/gui/combo-box.ts",
"lib/gui/menu-list.ts",
"lib/gui/application.ts",
"lib/gui/user-preferences.ts",
"lib/gui/plugin-browser.ts",
"lib/gui/project-loader.ts",
Expand Down Expand Up @@ -152,7 +151,7 @@
"lib/gui/login-widget/register-form.tsx",
"lib/gui/login-widget/login-widget.tsx",
"lib/gui/splash/splash.tsx",
"lib/gui/application.ts",
"lib/gui/application.tsx",
"lib/main.tsx"
]
}

0 comments on commit ae054bd

Please sign in to comment.