-
Notifications
You must be signed in to change notification settings - Fork 10
Software architecture design: classes
This document is a draft
Returns UI instance
Returns UI instance
Type View instance
All UIForm objects inherits this prototype
Create a new app.
Return App instance
Type array
Return DataBind object
// Detect it is running in a browser
app.context.browser
// Detect it is running in on Cordova/PhoneGap
app.context.cordova
app.context.phonegap
// detect device vendor
app.context.device.vendor
// define a method callback run on back button event
app.context.device.onBackButton(function() {
app.go("index");
});
// define a method callback run on home button event
app.context.device.onHomeButton(function() {
app.go("home");
});
// define a method callback run on menu button event
app.context.device.onHomeButton(function() {
app.footer.show();
});
// get viewport's height
app.context.viewport.height
// get viewport's width
app.context.viewport.width
// get viewport's width
app.context.device.onRotate(function() {
console.log(app.contect.device.orientation)
});
Return object
Return object
Returns View instance
Returns View instance
// Define a method callback run after add a new view
app.addView({
id: "index",
success: function(self) {
console.log(self.title);
}
});
Returns Boolean
Returns undefined
// Go to another view
$("#myLink").onTapEnd(function() {
app.go("myView");
});
// Go to another view with parameters
$("#myLink").onTapEnd(function() {
app.go("store", {
storeid: 20
});
});
Returns array
Returns Router instance
Type object
// Set a setting (debug mode) value for the App instance
app.settings.debug = true;
// Get a setting (debug mode) value for the App instance
if (app.settings.debug === true) {
console.log("Debug mode.");
};
Return string
if (app.getVersion() === "1.0.0") {
console.log("This is version 1.0.0")
};
Define a version number for the App instance Return string
app.setVersion("2");
Define a view's title Returns undefined
Returns string title
Returns undefined
define a method callback run after load
app.getView("index").onLoad(function() {
console.log("index view is load").
});
Returns undefined
define a method callback run before load
Returns undefined
define a method callback unload
Returns undefined
define a method callback run before unload
Returns undefined
Returns UIView instance
All UI objects inherits this prototype
Return boolean
Return boolean
All UIView objects inherits this prototype
Returns View instance
Get panel's horizontal scroll position
Returns int
Get panel's vertical scroll position
Returns int
Get panel's height
Returns int
Get panel's width
Returns int
Returns ViewPanel instance
Returns ViewPanel instance
Returns ViewPanel instance
Returns string
Define panel's transition
Returns ViewPanel instance
// app.getView("index").ui.setTransition("slide-left");
Type HTMLElement instance
// Get view's HTML
var html = app.getView("index").el.innerHTML;
Type string
// Load view's JavaScript from the view
var script = app.getView("index").script;
Type string
// Load view's CSS from the view
var css = app.getView("index").css;
Returns object
Returns object
Returns object
Returns object
Returns UILoading instance
Returns UIModal instance
Returns UIModal instance
Returns UIMap instance
Returns UIMap instance
Returns object
Returns string
Returns UIFormDraw instance
Returns object
Returns object
All UIForm objects inherits this prototype
Returns object
Returns UIForm instance
return DataModel instance
return DataModel instance
return Boolean
return DataModel instance
return DataModel instance
return array
return array
return int
return DataBind instance
return Boolean
return Route instance
// Define a regular expressio for route the URL to a view
app.router.create({
url: "product/(.*)",
view: "product"
});
return Route instance
return Route instance
// Load a view from an URL
var categoryView = app.router.getViewByUrl("/category");
Returns object
Returns object
Returns string
Returns Geo instance
Returns Geo instance