├── .gitignore
├── README.md
├── com.appcelerator.browser
├── controllers
│ └── widget.js
├── styles
│ └── widget.tss
├── views
│ └── widget.xml
└── widget.json
├── com.appcelerator.grid
├── controllers
│ └── widget.js
├── styles
│ └── widget.tss
├── views
│ └── widget.xml
└── widget.json
├── com.appcelerator.login
├── assets
│ └── images
│ │ ├── facebook-btn-loading.png
│ │ ├── facebook-btn.png
│ │ ├── header.png
│ │ ├── header@2x.png
│ │ ├── help-btn.png
│ │ └── help-btn@2x.png
├── controllers
│ └── widget.js
├── styles
│ └── widget.tss
├── views
│ └── widget.xml
└── widget.json
├── com.appcelerator.timeline
├── controllers
│ ├── timeLineRow.js
│ ├── timeLineSection.js
│ └── widget.js
├── lib
│ └── config.json
├── styles
│ ├── timeLineRow.tss
│ ├── timeLineSection.tss
│ └── widget.tss
├── views
│ ├── timeLineRow.xml
│ ├── timeLineSection.xml
│ └── widget.xml
└── widget.json
├── com.appcelerator.ui.listview
├── assets
│ └── images
│ │ ├── commentbtn.png
│ │ ├── likebtn.png
│ │ └── likebtnOn.png
├── controllers
│ ├── productList.js
│ ├── statusList.js
│ └── widget.js
├── styles
│ ├── productList.tss
│ ├── statusList.tss
│ └── widget.tss
├── views
│ ├── productList.xml
│ ├── statusList.xml
│ └── widget.xml
└── widget.json
├── com.leorbrenman.tigauge
├── README
├── controllers
│ └── widget.js
├── styles
│ └── widget.tss
├── views
│ └── widget.xml
└── widget.json
├── com.leorbrenman.tismallbarchart
├── README
├── controllers
│ ├── axisLabel.js
│ └── widget.js
├── styles
│ ├── axisLabel.tss
│ └── widget.tss
├── views
│ ├── axisLabel.xml
│ └── widget.xml
└── widget.json
├── com.leorbrenman.tistackbar
├── README
├── controllers
│ ├── legendItem.js
│ └── widget.js
├── styles
│ ├── legendItem.tss
│ └── widget.tss
├── views
│ ├── legendItem.xml
│ └── widget.xml
└── widget.json
└── screenshots
├── barchart.png
├── com.leorbrenman.tistackbar.png
├── gauge.png
└── login.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build folder and log file
2 | build/
3 | build.log
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | widgets
2 | =======
3 |
4 | Widget library leveraged by the Appcelerator SE Team for demonstration purposes
5 |
--------------------------------------------------------------------------------
/com.appcelerator.browser/controllers/widget.js:
--------------------------------------------------------------------------------
1 | var _args = arguments[0] || {};
2 |
3 | var COLOR_DISABLED = "#CCC";
4 | var COLOR_ENABLED = "#999";
5 |
6 | var MIN_NAVBAR_HEIGHT = 40;
7 | var NAVBAR_OFFSET = (OS_IOS && parseInt(Ti.Platform.version.split(".")[0], 10) >=7) ? 20 : 0;
8 |
9 | $.header.height = MIN_NAVBAR_HEIGHT+NAVBAR_OFFSET;
10 |
11 | /**
12 | * Callback function place holders
13 | */
14 | var onCloseCallback = _args.onClose || null;
15 | var onLoadCallback = _args.onload || null;
16 | var onErrorCallback = _args.onerror || null;
17 | var onBeforeLoadCallback = _args.onbeforeload || null;
18 |
19 | /**
20 | * Expose Browser navigation functions
21 | */
22 | exports.goBack = $.webView.goBack;
23 | exports.goForward = $.webView.goForward;
24 | exports.canGoBack = $.webView.canGoBack;
25 | exports.canGoForward = $.webView.canGoForward;
26 |
27 |
28 | exports.setHtml = function setHTML(_html){
29 | $.webView.html = _html;
30 | };
31 | exports.getHTML = function getHTML(){
32 | return $.webView.html;
33 | };
34 |
35 | exports.setURL = function setURL(_url){
36 | $.webView.url = _url;
37 | };
38 |
39 | exports.getURL = function getURL(){
40 | return $.webView.url;
41 | };
42 |
43 | /**
44 | * Sets onClose event callback
45 | */
46 | exports.onClose = function(f){
47 | onCloseCallback = f;
48 | };
49 |
50 | /**
51 | * Sets onError event callback
52 | */
53 | exports.onError = function(f){
54 | onErrorCallback = f;
55 | };
56 |
57 | /**
58 | * Sets onLoad event callback
59 | */
60 | exports.onLoad = function(f){
61 | onLoad = f;
62 | };
63 |
64 | /**
65 | * Sets onBeforeLoadCallback event callback
66 | */
67 | exports.onBeforeLoadCallback = function(f){
68 | onBeforeLoadCallback = f;
69 | };
70 |
71 | /**
72 | * Click event on Back Button
73 | */
74 | $.backBtn.addEventListener('click', function(e){
75 | $.webView.goBack();
76 | });
77 |
78 | $.forwardBtn.addEventListener('click', function(e){
79 | $.webView.goForward();
80 | });
81 |
82 | $.closeBtn.addEventListener('click', function(e){
83 | Ti.API.debug('ON CLOSE');
84 |
85 | $.webView.stopLoading();
86 |
87 | onCloseCallback && onCloseCallback(e);
88 | });
89 |
90 | /**
91 | * Browser Event Listener - load
92 | * Fired when browser has completed laoding the webpage
93 | */
94 | $.webView.addEventListener('load', function(e){
95 | Ti.API.debug('ON LOAD');
96 | /**
97 | * Update navigation UI
98 | */
99 | $.webView.canGoBack() && $.backBtn.setColor(COLOR_ENABLED) || $.backBtn.setColor(COLOR_DISABLED);
100 | $.webView.canGoForward() && $.forwardBtn.setColor(COLOR_ENABLED) || $.forwardBtn.setColor(COLOR_DISABLED);
101 |
102 | /**
103 | * Set the Title of the Website
104 | */
105 | $.title.text = $.webView.evalJS('document.title');
106 |
107 | onLoadCallback && (typeof(onLoadCallback) === "function") && onLoadCallback(e);
108 | });
109 |
110 | /**
111 | * Browser Event Listener - Error
112 | * Fired when there is an error loading the page
113 | */
114 | $.webView.addEventListener('error', function(e){
115 | Ti.API.debug('ON ERROR');
116 | onErrorCallback && (typeof(onErrorCallback) === "function") && onErrorCallback(e);
117 | });
118 |
119 | /**
120 | * Browser Event Listener - beforeload
121 | * Fired right before the browser starts to load a new url.
122 | * Can cancel the browser activity at this point
123 | */
124 | $.webView.addEventListener('beforeload', function(e){
125 | Ti.API.debug('ON BEFORELOAD');
126 | /**
127 | * Enable the Stop Button
128 | */
129 | onBeforeLoadCallback && (typeof(onBeforeLoadCallback) === "function") && onBeforeLoadCallback(e);
130 | });
--------------------------------------------------------------------------------
/com.appcelerator.browser/styles/widget.tss:
--------------------------------------------------------------------------------
1 | "Label":{
2 | color: "#ccc",
3 | font: {
4 | fontFamily: "Arial",
5 | fontSize: 24
6 | },
7 | left: 5
8 | },
9 | "#wrapper":{
10 | layout:"vertical"
11 | },
12 |
13 | "#header":{
14 | backgroundColor: "#ececec",
15 | height: 50
16 | },
17 |
18 | "#browserNavigation":{
19 | left: 5,
20 | bottom: 5,
21 | height: Ti.UI.SIZE,
22 | width: 100,
23 | layout:"horizontal"
24 | },
25 |
26 | "#title":{
27 | left: 75,
28 | right: 75,
29 | bottom: 10,
30 | height: 20,
31 | borderRadius: 5,
32 | backgroundColor: "#ccc",
33 | color: "#999",
34 | font:{
35 | fontSize: 10,
36 | fontFamily: "Arial"
37 | },
38 | textAlign:"center"
39 | }
40 |
41 | "#closeBtn":{
42 | right: 5,
43 | bottom:5,
44 | height: Ti.UI.SIZE,
45 | color: "#999"
46 | },
47 |
48 | "#backBtn[platform=android]":{
49 | font:{
50 | fontSize:18
51 | },
52 | bottom: 3
53 | },
54 |
55 | "#forwardBtn[platform=android]":{
56 | font:{
57 | fontSize:18
58 | },
59 | bottom: 3
60 | },
61 |
62 | "#webView":{
63 | willHandleTouches:false
64 | }
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/com.appcelerator.browser/views/widget.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/com.appcelerator.browser/widget.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "com.appcelerator.browser",
3 | "name": "com.appcelerator.browser",
4 | "description" : "Lightweight modal browser for use in any Appcelerator application",
5 | "author": "Bert Grantges",
6 | "version": "1.0",
7 | "copyright":"Copyright (c) 2014",
8 | "license":"Public Domain",
9 | "min-alloy-version": "1.0",
10 | "min-titanium-version":"2.1",
11 | "tags":"",
12 | "platforms":"android,blackberry,ios,mobileweb,tizen"
13 | }
--------------------------------------------------------------------------------
/com.appcelerator.grid/controllers/widget.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @class Widgets.grid
3 | *
4 | * The **Grid** widget provides a cross-platform grid of views that automatically lay themselves out in the view similar to the iOS native Dashboard control.
5 | *
6 | * ## Manifest
7 | * * Version: 1.0 (stable)
8 | * * Supported Platforms: iOS, Android, Mobile Web
9 | *
10 | * ## Adding the Grid Widget to Your Alloy Project
11 | *
12 | * In your application's config.json file you will want to include the following line in your dependencies:
13 | *
14 | * "dependencies": {
15 | * "com.appcelerator.grid":"1.0"
16 | * }
17 | *
18 | * ### Creating a Local Copy
19 | * To create a copy local to your application so that you can further modify it, then you will need to:
20 | *
21 | * 1. Create a widgets directory in your app directory if it does not already exist.
22 | * 2. Copy the com.appcelerator.grid folder into your `app/widgets` directory.
23 | *
24 | * ## Create a Grid in the View
25 | *
26 | * You can add a Grid to a view by *requiring* the Grid widget.
27 | *
28 | *
29 | *
30 | * Assign it an ID that you can use in your controller, for example, `id="grid"`.
31 | * You can now access the Grid using `$.grid` in your controller.
32 | *
33 | * ## Initializing the Grid in the Controller
34 | *
35 | * The grid does not have any items in it until you initialize it in your controller.
36 | * Before you open your window, you will want to call the grid with the `init` method. For example:
37 | *
38 | * $.grid.init({
39 | * items: [
40 | * { id : '1', click: function (e) { alert("clicked!"); }, crossClick: function (e) { alert("cross clicked!"); }, backgroundImage : '/images/photo.png'},
41 | * { id : '2'},
42 | * { id : '3', click: function (e) { alert("clicked!"); }},
43 | * { id : '4', click: function (e) { alert("clicked!"); }, crossClick: function (e) { alert("cross clicked!"); }},
44 | * { id : '5', click: function (e) { alert("clicked!"); }, crossClick: function (e) { alert("cross clicked!"); }, backgroundImage : '/images/photo.png'},
45 | * { id : '6', click: function (e) { alert("clicked!"); }, crossClick: function (e) { alert("cross clicked!"); }, backgroundColor : 'gray'},
46 | * ],
47 | * itemWidth: Alloy.isTablet ? 200: 100,
48 | * itemHeight: Alloy.isTablet ? 200 : 100,
49 | * backgroundColor: red,
50 | * backgroundSelectedColor: brightred
51 | * });
52 | *
53 | * ## Relaying out the Grid
54 | * If you ever have a need to relayout the Grid for a reason other than orientation (which is automatically supported), you can call the `relayout` method directly.
55 | *
56 | * $.grid.relayout();
57 | *
58 | * The grid will calculate a new gutter between the items and animate the items into place one at a time.
59 | * **Note**: If you use autoLayout="true" (default) then a Ti.Gesture event handler will be used to relayout
60 | * the widget based on orientation changes. To avoid any potential memory leaks associated with using these
61 | * global event handlers, you must call the **destroy()** function on the widget when you are done using it.
62 | * This will free all memory resources associated with the widget. If you have autoLayout="false", then you are
63 | * not required to call **destroy()** when you are done with the widget.
64 | */
65 |
66 | var TEXTSIZE = 10;
67 |
68 | var defaults = {
69 | itemWidth : 50,
70 | itemHeight : 75,
71 | assetDir : '/images/' // Subdirectory to find the item assets.
72 | };
73 | /**
74 | * @method init
75 | * Initializes the item grid.
76 | * @param {Boolean} [autoLayout=true] If true, the widget will automatically adjust the layout for orientation events, which requires you to execute destroy() when you are done. if false, the widget does not adjust its layout automatically, and you are not required to call destroy() when finished using it.
77 | * @param {Array.