Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed calendar view to loadMOnth and only Session call

  • Loading branch information...
commit 45a00c721596aba56621380f67d5e44b5662c956 1 parent c74fed0
@n8fr8 n8fr8 authored
View
35 Resources/views/newsroom.js
@@ -11,12 +11,6 @@ backgroundColor:"#ffffff"
});
var newsItems = [];
-// click listener - when image is clicked
-newsTable.addEventListener('click',function(e)
-{
-
-
-});
win.add(newsTable);
@@ -39,7 +33,6 @@ function parseNewsroomResponse (responseText)
var data = JSON.parse('{"data":' + responseText + '}').data;
- Ti.API.info(responseText);
for (i = 0; i < data["#data"].length; i++)
{
@@ -47,6 +40,7 @@ function parseNewsroomResponse (responseText)
newsItems[i] = new Object();
newsItems[i].title = item.title;
newsItems[i].body = item.body;
+ newsItems[i].link = "http://nysenate.gov/" + item.path;
@@ -90,7 +84,13 @@ function parseNewsroomResponse (responseText)
newsTable.appendRow(row);
}
-
+ newsTable.addEventListener('click',function(e)
+ {
+
+ if (e.row.url)
+ showNYSenateContent(e.row.pageTitle,e.row.url,Ti.UI.currentWindow.detailView);
+
+ });
}
@@ -102,6 +102,9 @@ function addRow (newsItem)
var row = Ti.UI.createTableViewRow({height:rowHeight});
+ row.url = newsItem.link;
+ row.pageTitle = newsItem.title;
+
var labelTitle = Ti.UI.createLabel({
text:newsItem.title,
left:60,
@@ -112,17 +115,6 @@ function addRow (newsItem)
});
row.add(labelTitle);
- /*
- if (newsItem.body.length > 0)
- {
- var labelSummary = Ti.UI.createLabel({
- text:processHtml(newsItem.body).substring(0,50),
- left:60,
- top:35,
- font:{fontSize:14}
- });
- row.add(labelSummary);
- }*/
if (newsItem.thumbnail)
{
@@ -142,6 +134,11 @@ function addRow (newsItem)
});
row.add(img);
}
+ else
+ {
+ labelTitle.left = 3;
+
+ }
row.hasDetail = true;
return row;
View
12 Resources/views/senators.js
@@ -41,8 +41,7 @@ senatorView = Titanium.UI.createTableView({
senatorName:senatorItems[e.index].senator.name,
senatorImage:senatorItems[e.index].senator.imageUrlLarge,
senatorKey:senatorItems[e.index].senator.name,
- senatorDistrict:senatorItems[e.index].senator.district,
- backgroundImage:'../img/bg/wood.jpg'
+ senatorDistrict:senatorItems[e.index].senator.district
});
@@ -189,11 +188,12 @@ function parseSenatorResponse (responseText)
senatorItems[i].senator.imageUrl = "../img/senators/" + senatorItems[i].senator.key + "-" + escape(senatorItems[i].senator.imageFileName);
}
- var file = Titanium.Filesystem.getFile(senatorItems[i].senator.imageUrl);
+
+ //var file = Titanium.Filesystem.getFile(senatorItems[i].senator.imageUrl);
- if(!file.exists()) {
- senatorItems[i].senator.imageUrl = imageUrl
- }
+ //if(!file.exists()) {
+ // senatorItems[i].senator.imageUrl = imageUrl
+ //}
senatorItems[i].senator.imageUrlLarge = imageUrl;
View
14 Resources/views/today.js
@@ -4,7 +4,11 @@ var win = Titanium.UI.currentWindow;
var dToday = new Date();
-var calBase = "http://www.nysenate.gov/calendar/ical/YEAR-MONTH";
+var calBase = "http://www.nysenate.gov/calendar/"
+
+var calType = "session";
+
+var calTag = "/YEAR-MONTH/ical";
var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
@@ -218,7 +222,7 @@ function loadMonthTable (year, month)
setMonthTitle(month);
- var iCalUrl = calBase;
+ var iCalUrl = calBase + calType + calTag;
iCalUrl = iCalUrl.replace('YEAR',year);
iCalUrl = iCalUrl.replace('MONTH',month);
@@ -551,8 +555,6 @@ tableview.addEventListener('click',function(e)
}
-win.addEventListener('focus', function ()
-{
- loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
-});
+
+loadMonthTable(dToday.getFullYear(), (dToday.getMonth()+1+monthOffset));
Please sign in to comment.
Something went wrong with that request. Please try again.