Permalink
Browse files

filters visual refresh, jslint cleanup (ie7), typekit font fix

  • Loading branch information...
1 parent 1ebea80 commit 8cbdff57646a5f32c7f893c69f7c5ac349be3eee Skylar Woodward committed Jun 29, 2010
View
@@ -6,9 +6,12 @@
# Add initial buildfile information here
config :all, :required => :sproutcore, :title => 'Kiva en Français'
-#disable minify for now... causing bugs?
+# Disable minify, if necessary (sometimes this causes bugs)
#config :all, :minify => false
+# Configure lanugages to build
+config :all, :languages => [:fr, :en]
+
# Set up some proxies for dev/debug mode
proxy '/proxy', :to => 'kivadevcamp.org'
proxy '/v1', :to => 'api.kivaws.org'
@@ -8,11 +8,10 @@ Klb.filtersController = SC.TreeController.create(SC.CollectionViewDelegate,{
collectionViewShouldSelectIndexes: function(view, indexes, extend) {
var contentItem = view.get('content').objectAt(indexes.firstObject());
- if(contentItem && contentItem.get('isSelectable')) {
+ if(contentItem && contentItem.get('isEnabled')) {
return indexes;
}
return null;
- },
-
+ }
});
@@ -58,13 +58,17 @@ Klb.mainController = SC.ObjectController.create({
sectionLabel = 'about';
} else if(currentSection === Klb.getPath('prehomePage.mainView')) {
sectionLabel = 'prehome';
- } else if(currentSection === Klb.getPath('registerPage.mainView')) {
+ } else if(currentSection === Klb.getPath('registerPage.mainView') || currentSection === 'Klb.registerPage.mainView') {
sectionLabel = 'register';
- } else if(currentSection === Klb.getPath('demoPage.mainView')) {
+ } else if(currentSection === Klb.getPath('demoPage.mainView') || currentSection === 'Klb.demoPage.mainView') {
sectionLabel = 'demo';
}
_gaq.push(['_trackEvent', 'navigation', sectionLabel]);
}
+
+ // reset content section scrollers for any section change (more elegant way to do this?)
+ Klb.getPath('aboutPage.mainView').set('verticalScrollOffset',0);
+ Klb.getPath('prehomePage.mainView').set('verticalScrollOffset',0);
}.observes('currentSection'),
getCookie: function(name) {
@@ -127,12 +127,28 @@ Klb.searchController = SC.ObjectController.create({
treeItemIsExpanded: YES,
title: "Root",
- isSelectable: YES,
+ isEnabled: YES,
value: null,
treeItemChildren: function() {
var idx, ret = [];
+ ret.push(Klb.searchController.browseFilters.create());
+ ret.push(Klb.searchController.sampleFilters.create());
+
+ return ret;
+ }.property().cacheable()
+
+ }),
+ browseFilters: SC.Object.extend({
+
+ treeItemIsExpanded: YES,
+ title: "_Explore".loc(),
+ isEnabled: NO,
+
+ treeItemChildren: function() {
+ var idx, ret = [];
+
// ret.push(Klb.searchController.currentFilters.create({
// title: '_Getting Started'.loc(),
// value: 'start',
@@ -143,20 +159,17 @@ Klb.searchController = SC.ObjectController.create({
title: '_Browse All Loans'.loc(),
value: Klb.Search.create(),
treeItemIsExpanded:NO,
- treeItemChildren: null,
+ treeItemChildren: null
}));
- ret.push(Klb.searchController.sampleFilters.create());
return ret;
}.property().cacheable()
-
}),
sampleFilters: SC.Object.extend({
treeItemIsExpanded: YES,
title: "_Sample Filters".loc(),
isEnabled: NO,
- isSelectable: NO,
treeItemChildren: function() {
var idx, ret = [];
@@ -168,23 +181,23 @@ Klb.searchController = SC.ObjectController.create({
sectors:[{'name':'_Agriculture'.loc(),'value':'Agriculture','isSelected':false}]
}),
treeItemIsExpanded:NO,
- treeItemChildren: null,
+ treeItemChildren: null
}));
ret.push(Klb.searchController.currentFilters.create({
title: '_Francophone Countries'.loc(),
value: Klb.Search.create({
countries:['BJ','BI','CM','HT','LB','ML','CD','CG','RW','SN','TG','TD','CI']
}),
treeItemIsExpanded:NO,
- treeItemChildren: null,
+ treeItemChildren: null
}));
ret.push(Klb.searchController.currentFilters.create({
title: '_Expiring Soon'.loc(),
value: Klb.Search.create({
'sortOrder':'postedDate ASC'
}),
treeItemIsExpanded:NO,
- treeItemChildren: null,
+ treeItemChildren: null
}));
return ret;
@@ -224,7 +237,7 @@ Klb.searchController = SC.ObjectController.create({
// set up the left nav w/ filter options
Klb.filtersController.set('content', Klb.searchController.currentFilters.create());
// select the 'browse all loans' option by default
- Klb.filtersController.selectObject(Klb.filtersController.get('arrangedObjects').objectAt(0));
+ Klb.filtersController.selectObject(Klb.filtersController.get('arrangedObjects').objectAt(1));
// set a default search object (to avoid issues w/ null for now)
this.set('currentSearch',Klb.Search.create());
@@ -237,7 +250,7 @@ Klb.searchController = SC.ObjectController.create({
},
selectSidebarItem: function(collectionView) {
- var newSearch = collectionView.get('selection').firstObject().get('value');
+ var newSearch = collectionView.get('selection').firstObject().get('value').copy();
this.set('currentSearch',newSearch);
this.notifyPropertyChange('query');
this.notifyPropertyChange('formattedSectors');
@@ -254,7 +267,7 @@ Klb.searchController = SC.ObjectController.create({
Klb.makeFirstResponder(Klb.READY_LIST);
}
}.observes('*availablePartners.length'), // something not quite right w/ this
-
+
updateLocalBindingsForNewCurrentSearch: function() {
var cSearch = this.get('currentSearch');
@@ -282,6 +295,7 @@ Klb.searchController = SC.ObjectController.create({
this.get('currentSearch').set('countries', countries);
Klb.getPath('pickerPanes.countryPicker.mainPane').remove();
+ Klb.filtersController.set('selection',SC.SelectionSet.EMPTY);
this.notifyPropertyChange('query');
this.notifyPropertyChange('formattedCountries');
@@ -295,8 +309,9 @@ Klb.searchController = SC.ObjectController.create({
var options = context.getPath('parentView.scrollView.contentView.selection');
this.get('currentSearch').set('sectors', options);
Klb.getPath('pickerPanes.sectorPicker.mainPane').remove();
+ Klb.filtersController.set('selection',SC.SelectionSet.EMPTY);
- console.log("PICKED SECTOR COUNT: " + this.get('selectedSectors').get('length'));
+// console.log("PICKED SECTOR COUNT: " + this.get('selectedSectors').get('length'));
this.notifyPropertyChange('query');
this.notifyPropertyChange('formattedSectors');
},
View
@@ -12,9 +12,9 @@
@extends SC.Application
*/
-sc_require('utils/ga_loader');
sc_require('utils/typekit');
try{Typekit.load();}catch(e){ console.log("TYPEKIT failed to load.");}
+sc_require('utils/ga_loader');
Klb = SC.Application.create(
/** @scope Klb.prototype */ {
@@ -42,6 +42,7 @@ SC.stringsFor('English', {
"_List":"List",
/// Sidebar
+ '_Explore':'Explore',
'_Getting Started':'Getting Started',
'_Browse All Loans':'Browse All Loans',
'_Sample Filters':'Sample Filters',
@@ -61,7 +62,7 @@ SC.stringsFor('English', {
"_Borrowers": "Borrowers Per Loan",
"_Partner_Rating": "Minimum Partner Rating",
"_Groups": "Groups",
- "_Individuals": "Individus",
+ "_Individuals": "Individuals",
"_Reset": "Reset",
"_Save": "Save",
"_All": "All",
@@ -41,15 +41,16 @@ SC.stringsFor('Français', {
"_List":"Liste",
/// Sidebar
+ '_Explore':'Explorer',
'_Getting Started':'Commencer',
'_Browse All Loans':'Tous les prêts',
'_Sample Filters':'Exemples de filtres',
'_African Farmers':'Fermiers africains',
'_Francophone Countries':'Pays Francophones',
- '_Expiring Soon':'Expiration bientôt',
+ '_Expiring Soon':'Expiration proche',
"_Filter Options":"Recherche Avancée",
- "_Search": "Recherche (arriver bientôt)",
+ "_Search": "Recherche (très prochainement)",
"_Countries": "Pays",
"_Sectors": "Secteurs",
"_Gender": "Sexe",
View
@@ -12,8 +12,7 @@
@extends SC.Record
@version 0.1
*/
-Klb.Search = SC.Object.extend(
-/** @scope Klb.Search.prototype */ {
+Klb.Search = SC.Object.extend(SC.Copyable, {
id: '_none',
male: true,
@@ -22,8 +21,20 @@ Klb.Search = SC.Object.extend(
queryString: '',
countries: [],
sectors: [],
- sortOrder: 'postedDate DESC'
+ sortOrder: 'postedDate DESC',
+ copy: function() {
+ return this.constructor.create({
+ id: this.get('id'),
+ male: this.get('male'),
+ female: this.get('female'),
+ groups: this.get('groups'),
+ queryString: this.get('queryString'),
+ countries: this.get('countries').slice(),
+ sectors: this.get('sectors').slice(),
+ sortOrder: this.get('sortOrder')
+ });
+ }
/*
id:SC.Record.attr(Integer),
name:SC.Record.attr(String),
Oops, something went wrong.

0 comments on commit 8cbdff5

Please sign in to comment.