Skip to content

Commit

Permalink
Closes mcongrove#82.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcongrove committed Jan 14, 2013
1 parent 4747b12 commit 459a1db
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 39 deletions.
34 changes: 13 additions & 21 deletions app/controllers/donate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,24 @@ var APP = require("core");

var CONFIG = arguments[0];

$.init = function() {
APP.log("debug", "donate.init | " + JSON.stringify(CONFIG));

$.NavigationBar.Wrapper.backgroundColor = APP.Settings.colors.primary || "#000";
$.NavigationBar.right.visible = true;
$.NavigationBar.rightImage.image = "/images/settings.png";

$.content.url = "/data/" + CONFIG.file;
};
APP.log("debug", "donate | " + JSON.stringify(CONFIG));

$.heading.text = CONFIG.heading;
$.heading.color = APP.Settings.colors.primary || "#666";
$.text.text = CONFIG.text;
$.button.backgroundColor = APP.Settings.colors.primary || "#FFF";
$.button.color = APP.Settings.colors.text || "#FFF";

$.NavigationBar.Wrapper.backgroundColor = APP.Settings.colors.primary || "#000";
$.NavigationBar.right.visible = true;
$.NavigationBar.rightImage.image = "/images/settings.png";

// Event listeners
$.NavigationBar.right.addEventListener("click", function(_event) {
APP.openSettings();
});

Ti.App.addEventListener("APP:openLink", function(_event) {
$.button.addEventListener("click", function(_event) {
APP.log("debug", "donate @openLink");

Ti.Platform.openURL(_event.url);
});

Ti.App.addEventListener("APP:openTab", function(_event) {
APP.log("debug", "donate @openTab");

APP.handleNavigation(_event.index);
});

// Kick off the init
$.init();
});
18 changes: 10 additions & 8 deletions app/lib/data/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,22 @@
"image": "photo",
"cache": 1440
},
{
"title": "Donate",
"heading": "Donate to ChariTi",
"text": "ChariTi is a framework built to allow charities to quickly and easily create mobile apps.\n\nWe don't want your money, we just want your code.",
"url": "https://github.com/mcongrove/ChariTi",
"type": "donate",
"image": "donate1"
}
],
"nontabs": [
{
"title": "Twitter",
"username": "appcelerator",
"type": "twitter",
"image": "twitter2",
"cache": 10
}
],
"nontabs": [
{
"title": "Donate",
"file": "donate.html",
"type": "donate",
"image": "donate1"
},
{
"title": "Facebook",
Expand Down
43 changes: 41 additions & 2 deletions app/styles/donate.tss
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
"#content": {
top: "46dp",
backgroundColor: "#000"
}
backgroundColor: "#EEE",
layout: "vertical",
showVerticalScrollIndicator: true
},
"#heading": {
top: "15dp",
left: "15dp",
right: "15dp",
height: Ti.UI.SIZE,
font: {
fontSize: "18dp",
fontWeight: "bold"
},
color: "#666"
},
"#text": {
top: "10dp",
left: "15dp",
right: "15dp",
bottom: "15dp",
height: Ti.UI.SIZE,
font: {
fontSize: "14dp",
fontWeight: "normal"
},
color: "#666"
},
"#button": {
top: "10dp",
left: "15dp",
right: "15dp",
bottom: "15dp",
height: "34dp",
font: {
fontSize: "14dp",
fontWeight: "bold"
},
color: "#666",
borderRadius: "5dp",
textAlign: "center"
}
8 changes: 7 additions & 1 deletion app/views/donate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<View id="Wrapper">
<Require type="widget" src="com.chariti.navigationBar" id="NavigationBar" image="logo.png" />

<WebView id="content" />
<ScrollView id="content">
<Label id="heading" />

<Label id="text" />

<Label id="button" text="Click to Donate" />
</ScrollView>
</View>
</Alloy>
6 changes: 3 additions & 3 deletions manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#appname:ChariTi
#publisher:Matthew Congrove
#url:http://mattcongrove.com
#url:http://chariti.mobi
#image:appicon.png
#appid:com.appcelerator.chariti
#desc:An open-source Titanium project that allows charities to quickly build mobile applications.
#appid:com.chariti.mobile
#desc:ChariTi is a framework built to allow charities to quickly and easily create mobile applications.
#type:ipad
#guid:66774a0a-ba43-45f5-9686-f2de98701f32
8 changes: 4 additions & 4 deletions tiapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<target device="blackberry">false</target>
</deployment-targets>
<sdk-version>3.0.0.GA</sdk-version>
<id>com.appcelerator.chariti</id>
<id>com.chariti.mobile</id>
<name>ChariTi</name>
<version>1.0</version>
<publisher>Matthew Congrove</publisher>
<url>http://mattcongrove.com</url>
<description>An open-source Titanium project that allows charities to quickly build mobile applications.</description>
<copyright>2012 by Matthew Congrove</copyright>
<url>http://chariti.mobi</url>
<description>ChariTi is a framework built to allow charities to quickly and easily create mobile applications.</description>
<copyright>2013 by Matthew Congrove</copyright>
<icon>appicon.png</icon>
<persistent-wifi>false</persistent-wifi>
<prerendered-icon>true</prerendered-icon>
Expand Down

0 comments on commit 459a1db

Please sign in to comment.