Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Johnston committed Nov 6, 2014
2 parents 9e3768b + 873ed4b commit a07ad3c
Show file tree
Hide file tree
Showing 101 changed files with 37,352 additions and 11,034 deletions.
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,17 @@ $RECYCLE.BIN/
# Mac desktop service store files
.DS_Store

# TypeScript compiled files
# TypeScript
*.js
*.js.map

/framework/testing/coverage
/framework/testing/node_modules
/framework/testing/reporter
/framework/testing/typings
/framework/framework/*
coverage
node_modules
reporter
typings/
.tscache
dist

!gruntfile.js
!*.less
!*.ts
/framework/node_modules
12 changes: 6 additions & 6 deletions framework/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

<title>PlatypusJS SPA Testing</title>

<!-- CSS -->
<link href="../framework/css/platypus.css" rel="stylesheet" />

<!-- ts-bundle-start -->
<!-- Global References -->
<script src="../framework/references/references.js"></script>
Expand Down Expand Up @@ -59,9 +56,9 @@
<script src="../framework/storage/sessionstorage.js"></script>

<!-- Expressions -->
<script src="../framework/expressions/operators/operators.js"></script>
<script src="../framework/expressions/tokenizer/tokenizer.js"></script>
<script src="../framework/expressions/parser/parser.js"></script>
<script src="../framework/expressions/operators/operators.js"></script>

<!-- Observable -->
<script src="../framework/observable/contextmanager/contextmanager.js"></script>
Expand All @@ -75,7 +72,7 @@

<!-- Control Classes -->
<script src="../framework/control/control.js"></script>
<script src="../framework/controls/attributecontrol/attributecontrol.js"></script>
<script src="../framework/attributecontrol/attributecontrol.js"></script>
<script src="../framework/ui/templatecontrol/templatecontrol.js"></script>
<script src="../framework/ui/bindablepropertycontrol/bindablepropertycontrol.js"></script>
<script src="../framework/ui/viewcontrol/baseviewcontrol.js"></script>
Expand Down Expand Up @@ -109,6 +106,7 @@
<script src="../framework/ui/animations/cssanimation.js"></script>
<script src="../framework/ui/animations/jsAnimation.js"></script>
<script src="../framework/ui/animations/simpleanimation/simpleanimation.js"></script>
<script src="../framework/ui/animations/simpletransition/simpletransition.js"></script>

<!-- Controls -->
<script src="../framework/controls/name/namecontrol.js"></script>
Expand All @@ -131,13 +129,15 @@
<script src="../framework/ui/controls/if/if.js"></script>
<script src="../framework/ui/controls/anchor/anchor.js"></script>

<!-- App -->
<script src="../framework/app/app.js"></script>
<!-- ts-bundle-end -->

<!-- Test App -->
<link href="viewcontrols/main/main.viewcontrol.css" rel="stylesheet" />
<script src="viewcontrols/main/main.viewcontrol.js"></script>
</head>
<body>
<plat-routeport></plat-routeport>
<plat-viewport plat-options="{ defaultView: 'viewcontrol'}"></plat-viewport>
</body>
</html>
11 changes: 11 additions & 0 deletions framework/app/viewcontrols/main/main.viewcontrol.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@
<br />
<br />
<button plat-tap="foo">pseudo</button>

<input type="text" plat-bind="keydown" plat-keypress="{ key: '!', method: 'keyDown' }" />

<button plat-tap="navigate">Navigate</button>
<button plat-tap="goBack">Back</button>

<div>
Count = {{count}}
</div>

<!--<plat-viewport plat-options="{ defaultView: 'viewcontrol'}"></plat-viewport>-->
61 changes: 53 additions & 8 deletions framework/app/viewcontrols/main/main.viewcontrol.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
module app {
export class MainViewControl extends plat.ui.WebViewControl {
var count = 0;

export class MainViewControl extends plat.ui.ViewControl {
title = 'Main';
templateUrl = 'viewcontrols/main/main.viewcontrol.html';
context = {
text: <string>null,
password: <string>null
password: <string>null,
keydown: '',
count: 0
};

text: plat.controls.INamedElement<HTMLElement, void>;
password: plat.controls.INamedElement<HTMLElement, void>;

navigatedTo(route: plat.web.IRoute<any>) {
if (route.path.length === 0) {
return;
navigate() {
this.navigator.navigate(MainViewControl, {
// initialize: true
});
}

goBack() {
this.navigator.goBack({
// ViewControl: MainViewControl,
parameter: true
});
}

navigatedTo(param: any) {
console.log(this.navigator.history.length);
if (!param) {
this.context.count = ++count;
}
// if (route.path.length === 0) {
// return;
// }

this.title = route.path.replace(/\//g, ' ');
// this.title = route.path.replace(/\//g, ' ');
}

loaded() {

}

backButtonPressed(ev: plat.events.IDispatchEventInstance) {
console.log('Here: ' + this.context.count);
}

foo() {
Expand All @@ -27,7 +52,27 @@ module app {
console.log(context.password);
console.log('');
}

keyDown() {
console.log(this.context.keydown);
}
}

plat.register.viewControl('viewcontrol', (<any>MainViewControl), null, ['']);

class App extends plat.App {
//ready(ev: plat.events.ILifecycleEvent) {
// ev.cancel();

// setTimeout(() => {
// this.load();
// }, 5000);
//}

error(ev: plat.events.IErrorEvent<any>) {
console.log(ev.error);
}
}

plat.register.viewControl('viewcontrol', MainViewControl, null, ['']);
plat.register.app('app', App);
}
145 changes: 84 additions & 61 deletions framework/framework/acquire/acquire.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,116 @@
/**
* @name plat
* @kind namespace
* @access public
*
* @description
* The entry point into the platypus library.
*/
module plat {
if (!isUndefined(window) && isUndefined((<any>window).plat)) {
(<any>window).plat = plat;
}

if (!isUndefined(window) && isUndefined((<any>window).module)) {
(<any>window).module = {};
}

/**
* @name acquire
* @memberof plat
* @kind function
* @variation 0
* @access public
* @static
*
* @description
* Returns the requested injectable dependency.
*
* @param dependency The dependency Type to return.
* @param {T} The requested dependency.
* @typeparam {any} T The type of the requested dependency.
*
* @param {() => T} dependency The dependency Type to return.
*
* @returns T The requested dependency.
*/
export function acquire<T>(dependency: () => T): T;
/**
* @name acquire
* @memberof plat
* @kind function
* @variation 1
* @access public
* @static
*
* @description
* Returns the requested injectable dependency.
*
* @param dependency The dependency Type to return.
* @param {any} The requested dependency.
* @param {Function} dependency The dependency Type to return.
*
* @returns {any} The requested dependency.
*/
export function acquire(dependency: Function): any;
/**
* @name acquire
* @memberof plat
* @kind function
* @variation 2
* @access public
* @static
*
* @description
* Returns the requested injectable dependency.
*
* @param dependency An array of Types specifying the injectable dependencies.
* @return {Array<any>} The dependencies, in the order they were requested.
* @param {Function} dependency An array of Types specifying the injectable dependencies.
*
* @returns {Array<any>} The dependencies, in the order they were requested.
*/
export function acquire(dependencies: Array<Function>): Array<any>;
/**
* @name acquire
* @memberof plat
* @kind function
* @variation 3
* @access public
* @static
*
* @description
* Returns the requested injectable dependency.
*
* @param dependency The injectable dependency type to return.
* @param {any} The requested dependency.
* @param {string} dependency The injectable dependency type to return.
*
* @returns {any} The requested dependency.
*/
export function acquire(dependency: string): any;
/**
* @name acquire
* @memberof plat
* @kind function
* @variation 4
* @access public
* @static
*
* @description
* Gathers dependencies and returns them as an array in the order they were requested.
*
* @param dependencies An array of strings specifying the injectable dependencies.
* @return {Array<any>} The dependencies, in the order they were requested.
* @param {Array<string>} dependencies An array of strings specifying the injectable dependencies.
*
* @returns {Array<any>} The dependencies, in the order they were requested.
*/
export function acquire(dependencies: Array<string>): Array<any>;
/**
* @name acquire
* @memberof plat
* @kind function
* @variation 5
* @access public
* @static
*
* @description
* Gathers dependencies and returns them as an array in the order they were requested.
*
* @param dependencies An array of strings or Functions specifying the injectable dependencies.
* @return {Array<any>} The dependencies, in the order they were requested.
* @param {Array<any>} dependencies An array of strings or Functions specifying the injectable dependencies.
*
* @returns {Array<any>} The dependencies, in the order they were requested.
*/
export function acquire(dependencies: Array<any>): Array<any>;
export function acquire(dependencies: any) {
Expand All @@ -64,53 +136,4 @@ module plat {

return output;
}

/**
* Returns the requested dependency or gathers dependencies and passes them back
* as an array in the order they were specified.
*/
export interface IAcquire {
/**
* Returns the requested injectable dependency.
*
* @param dependency The dependency Type to return.
* @param {T} The requested dependency.
*/
<T>(dependency: () => T): T;
/**
* Returns the requested injectable dependency.
*
* @param dependency The dependency Type to return.
* @param {any} The requested dependency.
*/
(dependency: Function): any;
/**
* Returns the requested injectable dependency.
*
* @param dependency An array of Types specifying the injectable dependencies.
* @return {Array<any>} The dependencies, in the order they were requested.
*/
(dependencies: Array<Function>): Array<any>;
/**
* Returns the requested injectable dependency.
*
* @param dependency The injectable dependency type to return.
* @param {any} The requested dependency.
*/
(dependency: string): any;
/**
* Gathers dependencies and returns them as an array in the order they were requested.
*
* @param dependencies An array of strings specifying the injectable dependencies.
* @return {Array<any>} The dependencies, in the order they were requested.
*/
(dependencies: Array<string>): Array<any>;
/**
* Gathers dependencies and returns them as an array in the order they were requested.
*
* @param dependencies An array of strings or Functions specifying the injectable dependencies.
* @return {Array<any>} The dependencies, in the order they were requested.
*/
(dependencies: Array<any>): Array<any>;
}
}
Loading

0 comments on commit a07ad3c

Please sign in to comment.