Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

little progress

  • Loading branch information...
commit 1527a50621465930bb800766f575553035b5e457 1 parent a8b20fc
@kristianmandrup authored
Showing with 969 additions and 225 deletions.
  1. +18 −0 www/Content.js
  2. +30 −0 www/Flags.js
  3. +8 −4 www/Guardfile
  4. +42 −0 www/Home.js
  5. +10 −0 www/Location.js
  6. +11 −0 www/Logo.js
  7. +20 −0 www/NavBar.js
  8. +39 −0 www/Navigation.js
  9. +19 −0 www/Page.js
  10. +14 −0 www/Radius.js
  11. +21 −0 www/TopBar.js
  12. +36 −39 www/app.js
  13. +9 −1 www/app.json
  14. +42 −0 www/app/controller/Home.js
  15. +20 −7 www/app/view/home/Flags.js
  16. +4 −3 www/app/view/home/Logo.js
  17. +25 −3 www/app/view/home/Navigation.js
  18. +7 −1 www/app/view/home/Page.js
  19. +2 −23 www/app/view/search/Content.js
  20. +7 −14 www/app/view/search/NavBar.js
  21. +15 −13 www/app/view/search/Page.js
  22. +9 −2 www/app/view/search/TopBar.js
  23. +1 −1  www/app/view/search/criteria/Location.js
  24. +6 −3 www/app/view/search/criteria/Radius.js
  25. +166 −0 www/lib/plugins/SliderFieldInput.js
  26. +138 −0 www/lib/plugins/SliderFieldText.js
  27. +1 −1  www/resources/css/app.css
  28. BIN  www/resources/images/DanishFlag.png
  29. BIN  www/resources/images/EnglishFlag.png
  30. BIN  www/resources/images/FriendlyRent.png
  31. BIN  www/resources/images/FriendlyRent_big.png
  32. 0  www/resources/images/{friendly_rent_trans_48.png → FriendlyRent_icon.png}
  33. 0  www/resources/images/{FriendlyRentTrans.png → FriendlyRent_small.png}
  34. BIN  www/resources/images/button_icons/search_white.png
  35. BIN  www/resources/images/login.png
  36. +53 −17 www/resources/sass/app.scss
  37. BIN  www/sdk/resources/themes/images/default/pictos/search_white.png
  38. +8 −5 www/src/app.coffee
  39. +28 −0 www/src/app/controller/Home.coffee
  40. +20 −9 www/src/app/view/home/Flags.coffee
  41. +7 −6 www/src/app/view/home/Logo.coffee
  42. +28 −5 www/src/app/view/home/Navigation.coffee
  43. +12 −1 www/src/app/view/home/Page.coffee
  44. +5 −30 www/src/app/view/search/Content.coffee
  45. +5 −15 www/src/app/view/search/NavBar.coffee
  46. +18 −12 www/src/app/view/search/Page.coffee
  47. +11 −3 www/src/app/view/search/TopBar.coffee
  48. +1 −1  www/src/app/view/search/criteria/Location.coffee
  49. +6 −6 www/src/app/view/search/criteria/Radius.coffee
  50. +47 −0 www/src/app/view/search/sandbox.txt
View
18 www/Content.js
@@ -0,0 +1,18 @@
+
+Ext.define('FriendlyRent.view.search.Content', {
+ extend: 'Ext.Panel',
+ alias: 'widget.search_content',
+ requires: ['FriendlyRent.view.search.criteria.Location', 'FriendlyRent.view.search.criteria.Radius'],
+ config: {
+ layout: 'vbox',
+ items: [
+ {
+ xtype: 'search_criteria_location',
+ name: 'location'
+ }, {
+ xtype: 'search_criteria_radius',
+ name: 'radius'
+ }
+ ]
+ }
+});
View
30 www/Flags.js
@@ -0,0 +1,30 @@
+
+Ext.define('FriendlyRent.view.home.Flags', {
+ extend: 'Ext.Panel',
+ alias: 'widget.home_flags',
+ config: {
+ layout: {
+ type: 'hbox',
+ pack: 'center',
+ align: 'middle'
+ },
+ items: [
+ {
+ xtype: 'image',
+ src: 'resources/images/EnglishFlag.png',
+ id: 'english_flag',
+ height: 32,
+ width: 32
+ }, {
+ xtype: 'spacer',
+ width: 12
+ }, {
+ xtype: 'image',
+ id: 'danish_flag',
+ src: 'resources/images/DanishFlag.png',
+ height: 32,
+ width: 32
+ }
+ ]
+ }
+});
View
12 www/Guardfile
@@ -5,6 +5,11 @@ guard 'coffeescript', :output => 'app', :bare => true do
watch %r{^src/app/(.+\.coffee)$}
end
+# app
+guard 'coffeescript', :output => '.', :bare => true do
+ watch %r{^src/.+\.coffee$}
+end
+
# lib
guard 'coffeescript', :output => 'lib', :bare => true do
watch %r{^src/lib/(.+\.coffee)$}
@@ -19,10 +24,9 @@ guard 'coffeescript', :output => 'test', :bare => true do
watch %r{^test/coffee/config\.coffee$}
end
-
-config = File.expand_path "../resources/sass/config.rb", __FILE__
-path = File.expand_path "../..", config
+config = File.expand_path "resources/sass/config.rb", __FILE__
+path = File.dirname(__FILE__) # File.expand_path "../..", config
guard 'compass', :project_path => path, :configuration_file => config do
- watch %r{resources/.+\.scss}
+ watch %r{^resources/(.+\.scss)$}
end
View
42 www/Home.js
@@ -0,0 +1,42 @@
+
+Ext.define('FriendlyRent.controller.Home', {
+ extend: 'Ext.app.Controller',
+ config: {
+ refs: {
+ searchButton: 'button[action=search]',
+ newPropertyButton: 'button[action=newProperty]',
+ danishButton: '#danish_flag',
+ englishButton: '#english_flag'
+ },
+ control: {
+ searchButton: {
+ tap: 'onTapSearch'
+ },
+ newPropertyButton: {
+ tap: 'onTapNewProperty'
+ },
+ danishButton: {
+ tap: 'onSelectDanishLang'
+ },
+ englishButton: {
+ tap: 'onSelectEnglishLang'
+ }
+ }
+ },
+ onTapSearch: function() {
+ var search_page;
+ console.log('Go to Search');
+ search_page = Ext.create('FriendlyRent.view.search.Page');
+ Ext.Viewport.removeAt(0);
+ return Ext.Viewport.add(search_page);
+ },
+ onTapNewProperty: function() {
+ return console.log('Go to New Property');
+ },
+ onSelectDanishLang: function() {
+ return console.log('Select Danish lang');
+ },
+ onSelectEnglishLang: function() {
+ return console.log('Select English lang');
+ }
+});
View
10 www/Location.js
@@ -0,0 +1,10 @@
+
+Ext.define('FriendlyRent.view.search.criteria.Location', {
+ extend: 'Ext.field.Search',
+ alias: 'widget.search_criteria_location',
+ config: {
+ name: 'location',
+ label: 'Location',
+ required: true
+ }
+});
View
11 www/Logo.js
@@ -0,0 +1,11 @@
+
+Ext.define('FriendlyRent.view.home.Logo', {
+ extend: 'Ext.Img',
+ alias: 'widget.home_logo',
+ requires: 'Ext.Img',
+ config: {
+ src: 'resources/images/FriendlyRent_big.png',
+ height: 240,
+ width: 240
+ }
+});
View
20 www/NavBar.js
@@ -0,0 +1,20 @@
+
+Ext.define('FriendlyRent.view.search.NavBar', {
+ extend: 'FriendlyRent.NavBar',
+ alias: 'widget.search_navbar',
+ config: {
+ items: [
+ {
+ html: 'menu'
+ }, {
+ text: 'search',
+ iconCls: 'search',
+ iconMask: true
+ }, {
+ text: 'property',
+ iconCls: 'home',
+ iconMask: true
+ }
+ ]
+ }
+});
View
39 www/Navigation.js
@@ -0,0 +1,39 @@
+
+Ext.define('FriendlyRent.view.home.Navigation', {
+ extend: 'Ext.Panel',
+ alias: 'widget.home_navigation',
+ config: {
+ layout: {
+ type: 'vbox',
+ align: 'center'
+ },
+ items: [
+ {
+ xtype: 'home_logo'
+ }, {
+ xtype: 'spacer',
+ height: 20
+ }, {
+ xtype: 'button',
+ ui: 'orange',
+ iconCls: 'search',
+ itemId: 'searchBtn',
+ id: 'searchBtn',
+ action: 'search',
+ iconMask: true,
+ text: 'Search home',
+ cls: 'main-button'
+ }, {
+ xtype: 'button',
+ ui: 'purple',
+ iconCls: 'home',
+ itemId: 'newBtn',
+ id: 'newBtn',
+ action: 'newProperty',
+ iconMask: true,
+ text: 'New property',
+ cls: 'main-button black'
+ }
+ ]
+ }
+});
View
19 www/Page.js
@@ -0,0 +1,19 @@
+
+Ext.define('FriendlyRent.view.search.Page', {
+ extend: 'Ext.Panel',
+ alias: 'widget.search_page',
+ requires: ['FriendlyRent.view.search.TopBar', 'FriendlyRent.view.search.Content', 'FriendlyRent.view.search.NavBar'],
+ config: {
+ items: [
+ {
+ xtype: 'search_topbar',
+ cls: 'nav-bar'
+ }, {
+ xtype: 'search_content'
+ }, {
+ xtype: 'search_navbar',
+ cls: 'nav-bar'
+ }
+ ]
+ }
+});
View
14 www/Radius.js
@@ -0,0 +1,14 @@
+
+Ext.define('FriendlyRent.view.search.criteria.Radius', {
+ extend: 'Ext.field.SliderInput',
+ alias: 'widget.search_criteria_radius'
+});
+
+({
+ config: {
+ value: 5,
+ minValue: 1,
+ maxValue: 50,
+ label: 'Radius'
+ }
+});
View
21 www/TopBar.js
@@ -0,0 +1,21 @@
+
+Ext.define('FriendlyRent.view.search.TopBar', {
+ extend: 'FriendlyRent.NavBar',
+ alias: 'widget.search_topbar',
+ config: {
+ docked: 'top',
+ items: [
+ {
+ xtype: 'spacer'
+ }, {
+ iconCls: 'list',
+ iconMask: true,
+ text: 'list'
+ }, {
+ iconCls: 'globe2',
+ iconMask: true,
+ text: 'map'
+ }
+ ]
+ }
+});
View
75 www/app.js
@@ -1,40 +1,37 @@
-//(function() {
- Ext.application({
- name: 'FriendlyRent',
- requires: ["Ext.MessageBox"],
- models: [],
- stores: [],
- controllers: [],
- views: ["registration.landlord.why_us.Page"],
- icon: {
- '57': 'resources/icons/Icon.png',
- '72': 'resources/icons/Icon~ipad.png',
- '114': 'resources/icons/Icon@2x.png',
- '144': 'resources/icons/Icon~ipad@2x.png'
- },
- isIconPrecomposed: true,
- startupImage: {
- '320x460': 'resources/startup/320x460.jpg',
- '640x920': 'resources/startup/640x920.png',
- '768x1004': 'resources/startup/768x1004.png',
- '748x1024': 'resources/startup/748x1024.png',
- '1536x2008': 'resources/startup/1536x2008.png',
- '1496x2048': 'resources/startup/1496x2048.png'
- },
- launch: function() {
- var page;
- console.log("launch");
- page = Ext.create("FriendlyRent.view.registration.landlord.why_us.Page");
- return Ext.Viewport.add(page);
- },
- onUpdated: function() {
- return Ext.Msg.confirm("Application Update", "This application has just successfully been updated to the latest version. Reload now?", function(buttonId) {
- if (buttonId === 'yes') {
- return window.location.reload();
- }
- });
- }
- });
-
-//}).call(this);
+Ext.application({
+ name: 'FriendlyRent',
+ requires: ["Ext.MessageBox"],
+ models: [],
+ stores: [],
+ controllers: ["FriendlyRent.controller.Home"],
+ views: ["FriendlyRent.view.home.Page", "FriendlyRent.view.search.Page"],
+ icon: {
+ '57': 'resources/icons/Icon.png',
+ '72': 'resources/icons/Icon~ipad.png',
+ '114': 'resources/icons/Icon@2x.png',
+ '144': 'resources/icons/Icon~ipad@2x.png'
+ },
+ isIconPrecomposed: true,
+ startupImage: {
+ '320x460': 'resources/startup/320x460.jpg',
+ '640x920': 'resources/startup/640x920.png',
+ '768x1004': 'resources/startup/768x1004.png',
+ '748x1024': 'resources/startup/748x1024.png',
+ '1536x2008': 'resources/startup/1536x2008.png',
+ '1496x2048': 'resources/startup/1496x2048.png'
+ },
+ launch: function() {
+ var home_page;
+ console.log('launch');
+ home_page = Ext.create('FriendlyRent.view.home.Page');
+ return Ext.Viewport.add(home_page);
+ },
+ onUpdated: function() {
+ return Ext.Msg.confirm("Application Update", "This application has just successfully been updated to the latest version. Reload now?", function(buttonId) {
+ if (buttonId === 'yes') {
+ return window.location.reload();
+ }
+ });
+ }
+});
View
10 www/app.json
@@ -48,7 +48,15 @@
{
"path": "lib/plugins/NavBar.js"
},
-
+ {
+ "path": "lib/plugins/TopBar.js"
+ },
+ {
+ "path": "lib/plugins/SliderFieldInput.js"
+ },
+ {
+ "path": "lib/plugins/SliderFieldText.js"
+ },
// {
// "path": "lib/deftjs/deft.js" // or deft-debug.js
// },
View
42 www/app/controller/Home.js
@@ -0,0 +1,42 @@
+
+Ext.define('FriendlyRent.controller.Home', {
+ extend: 'Ext.app.Controller',
+ config: {
+ refs: {
+ searchButton: 'button[action=search]',
+ newPropertyButton: 'button[action=newProperty]',
+ danishButton: '#danish_flag',
+ englishButton: '#english_flag'
+ },
+ control: {
+ searchButton: {
+ tap: 'onTapSearch'
+ },
+ newPropertyButton: {
+ tap: 'onTapNewProperty'
+ },
+ danishButton: {
+ tap: 'onSelectDanishLang'
+ },
+ englishButton: {
+ tap: 'onSelectEnglishLang'
+ }
+ }
+ },
+ onTapSearch: function() {
+ var search_page;
+ console.log('Go to Search');
+ search_page = Ext.create('FriendlyRent.view.search.Page');
+ Ext.Viewport.removeAt(0);
+ return Ext.Viewport.add(search_page);
+ },
+ onTapNewProperty: function() {
+ return console.log('Go to New Property');
+ },
+ onSelectDanishLang: function() {
+ return console.log('Select Danish lang');
+ },
+ onSelectEnglishLang: function() {
+ return console.log('Select English lang');
+ }
+});
View
27 www/app/view/home/Flags.js
@@ -1,16 +1,29 @@
-Ext.define('FriendlyRent.view.home.Navigation', {
+Ext.define('FriendlyRent.view.home.Flags', {
extend: 'Ext.Panel',
- alias: 'widget.home_navigation',
+ alias: 'widget.home_flags',
config: {
- layout: 'hbox',
+ layout: {
+ type: 'hbox',
+ pack: 'center',
+ align: 'middle'
+ },
items: [
{
- xtype: 'button',
- text: 'Danish'
+ xtype: 'image',
+ src: 'resources/images/EnglishFlag.png',
+ id: 'english_flag',
+ height: 32,
+ width: 32
}, {
- xtype: 'button',
- text: 'English'
+ xtype: 'spacer',
+ width: 12
+ }, {
+ xtype: 'image',
+ id: 'danish_flag',
+ src: 'resources/images/DanishFlag.png',
+ height: 32,
+ width: 32
}
]
}
View
7 www/app/view/home/Logo.js
@@ -2,9 +2,10 @@
Ext.define('FriendlyRent.view.home.Logo', {
extend: 'Ext.Img',
alias: 'widget.home_logo',
+ requires: 'Ext.Img',
config: {
- src: 'http://www.sencha.com/assets/images/sencha-avatar-64x64.png',
- height: 64,
- width: 64
+ src: 'resources/images/FriendlyRent_big.png',
+ height: 240,
+ width: 240
}
});
View
28 www/app/view/home/Navigation.js
@@ -3,14 +3,36 @@ Ext.define('FriendlyRent.view.home.Navigation', {
extend: 'Ext.Panel',
alias: 'widget.home_navigation',
config: {
- layout: 'vbox',
+ layout: {
+ type: 'vbox',
+ align: 'center'
+ },
items: [
{
+ xtype: 'home_logo'
+ }, {
+ xtype: 'spacer',
+ height: 20
+ }, {
xtype: 'button',
- text: 'Search'
+ ui: 'orange',
+ iconCls: 'search',
+ itemId: 'searchBtn',
+ id: 'searchBtn',
+ action: 'search',
+ iconMask: true,
+ text: 'Search home',
+ cls: 'main-button'
}, {
xtype: 'button',
- text: 'New property'
+ ui: 'purple',
+ iconCls: 'home',
+ itemId: 'newBtn',
+ id: 'newBtn',
+ action: 'newProperty',
+ iconMask: true,
+ text: 'New property',
+ cls: 'main-button black'
}
]
}
View
8 www/app/view/home/Page.js
@@ -2,14 +2,20 @@
Ext.define('FriendlyRent.view.home.Page', {
extend: 'Ext.Panel',
alias: 'widget.home_page',
+ requires: ['FriendlyRent.view.home.Logo', 'FriendlyRent.view.home.Navigation', 'FriendlyRent.view.home.Flags'],
config: {
layout: 'vbox',
+ style: 'background-color: #c8a0f0',
items: [
{
- xtype: 'home_logo'
+ html: '<img src="resources/images/login.png"/>',
+ style: 'text-align:right; padding: 4px'
}, {
xtype: 'home_navigation'
}, {
+ xtype: 'spacer',
+ height: 20
+ }, {
xtype: 'home_flags'
}
]
View
25 www/app/view/search/Content.js
@@ -1,7 +1,8 @@
Ext.define('FriendlyRent.view.search.Content', {
extend: 'Ext.Panel',
- alias: 'widget.search.content',
+ alias: 'widget.search_content',
+ requires: ['FriendlyRent.view.search.criteria.Location', 'FriendlyRent.view.search.criteria.Radius'],
config: {
layout: 'vbox',
items: [
@@ -11,28 +12,6 @@ Ext.define('FriendlyRent.view.search.Content', {
}, {
xtype: 'search_criteria_radius',
name: 'radius'
- }, {
- xtype: 'search_criteria_property_type',
- name: 'property_type'
- }, {
- xtype: 'search_criteria_furnishment',
- name: 'furnishment'
- }, {
- xtype: 'search_criteria_size',
- name: 'size'
- }, {
- xtype: 'search_criteria_rental_cost',
- name: 'cost'
- }, {
- xtype: 'search_criteria_rental_period',
- name: 'period'
- }, {
- xtype: 'search_criteria_rules',
- name: 'rules'
- }, {
- xtype: 'button',
- name: 'create_agent',
- label: I18n.t('agent.create')
}
]
}
View
21 www/app/view/search/NavBar.js
@@ -5,22 +5,15 @@ Ext.define('FriendlyRent.view.search.NavBar', {
config: {
items: [
{
- text: I18n.t('search.menu')
+ html: 'menu'
}, {
- text: I18n.t('search'),
- iconCls: 'search'
+ text: 'search',
+ iconCls: 'search',
+ iconMask: true
}, {
- text: I18n.t('property'),
- iconCls: 'home'
- }, {
- text: I18n.t('favorites'),
- iconCls: 'favorites'
- }, {
- text: I18n.t('agents'),
- iconCls: 'user'
- }, {
- text: I18n.t('history'),
- iconCls: 'search'
+ text: 'property',
+ iconCls: 'home',
+ iconMask: true
}
]
}
View
28 www/app/view/search/Page.js
@@ -1,17 +1,19 @@
-Ext.define('FriendlyRent.view.properties.list.Page', {
+Ext.define('FriendlyRent.view.search.Page', {
extend: 'Ext.Panel',
- alias: 'widget.properties.list.Page',
+ alias: 'widget.search_page',
+ requires: ['FriendlyRent.view.search.TopBar', 'FriendlyRent.view.search.Content', 'FriendlyRent.view.search.NavBar'],
config: {
- layout: 'vbox'
- },
- items: [
- {
- xtype: 'search_topbar'
- }, {
- xtype: 'search_content'
- }, {
- xtype: 'search_navbar'
- }
- ]
+ items: [
+ {
+ xtype: 'search_topbar',
+ cls: 'nav-bar'
+ }, {
+ xtype: 'search_content'
+ }, {
+ xtype: 'search_navbar',
+ cls: 'nav-bar'
+ }
+ ]
+ }
});
View
11 www/app/view/search/TopBar.js
@@ -3,11 +3,18 @@ Ext.define('FriendlyRent.view.search.TopBar', {
extend: 'FriendlyRent.NavBar',
alias: 'widget.search_topbar',
config: {
+ docked: 'top',
items: [
{
- text: I18n.t('list')
+ xtype: 'spacer'
}, {
- text: I18n.t('map')
+ iconCls: 'list',
+ iconMask: true,
+ text: 'list'
+ }, {
+ iconCls: 'globe2',
+ iconMask: true,
+ text: 'map'
}
]
}
View
2  www/app/view/search/criteria/Location.js
@@ -1,7 +1,7 @@
Ext.define('FriendlyRent.view.search.criteria.Location', {
extend: 'Ext.field.Search',
- alias: 'widget.search.criteria.location',
+ alias: 'widget.search_criteria_location',
config: {
name: 'location',
label: 'Location',
View
9 www/app/view/search/criteria/Radius.js
@@ -1,10 +1,13 @@
-Ext.define("FriendlyRent.view.search.criteria.Radius", {
+Ext.define('FriendlyRent.view.search.criteria.Radius', {
extend: 'Ext.field.SliderInput',
- alias: "widget.search.criteria.radius",
+ alias: 'widget.search_criteria_radius'
+});
+
+({
config: {
- minValue: 1,
value: 5,
+ minValue: 1,
maxValue: 50,
label: 'Radius'
}
View
166 www/lib/plugins/SliderFieldInput.js
@@ -0,0 +1,166 @@
+// https://github.com/kristianmandrup/Sencha-Touch-2-SliderExtended
+// http://www.geektantra.com/2012/04/sencha-touch-2-slider-field-extended-component/
+// http://www.devguy.org/2011/05/sencha-touch-slider-with-tooltip.html
+// http://www.codeproject.com/Articles/245717/Create-a-Plugin-to-Sencha-Touch-Ext-form-Slider-Cl
+
+Ext.define('Ext.field.SliderInput', {
+ extend : 'Ext.field.Field',
+ xtype : 'slider.input',
+ requires: [
+ 'Ext.slider.Slider'
+ ],
+ alternateClassName: 'Ext.form.SliderInput',
+
+ config: {
+ cls: Ext.baseCSSPrefix + 'slider-field-input',
+ tabIndex: -1,
+ helperPosition: 'right',
+ valueMapper: function(value) {
+ var valueMap = this.valueMap;
+ if (valueMap) {
+ console.log('mapped value', value);
+ return valueMap[value];
+ } else {
+ console.log('value', value);
+ return value;
+ }
+ }
+ },
+
+ proxyConfig: {
+ value: 0,
+ minValue: 0,
+ maxValue: 100,
+ increment: 1
+ },
+
+ constructor: function(config) {
+ config = config || {};
+
+ if (config.hasOwnProperty('values')) {
+ config.value = config.values;
+ }
+
+ if (config.hasOwnProperty('valueMap')) {
+ if (config.autoValues == true) {
+ config.value = config.defaultValue || 0;
+ config.minValue = 0;
+ config.maxValue = config.valueMap.size -1;
+ config.increment = 1;
+ }
+ }
+
+ this.callParent([config]);
+ },
+
+ initialize: function() {
+ this.callParent();
+
+ this.getComponent().on({
+ scope: this,
+ change: 'onSliderChange',
+ dragstart: 'onSliderDragStart',
+ drag: 'onSliderDrag',
+ dragend: 'onSliderDragEnd'
+ });
+ },
+
+ getElementConfig: function() {
+ var self = this;
+ var originalConfig = self.callParent();
+
+ originalConfig.children[1].children = [{
+ reference: 'helper',
+ tag: 'div',
+ cls: Ext.baseCSSPrefix + 'slider-helper',
+ children: [
+ {
+ reference: 'helperInput',
+ tag: 'input',
+ type: 'number',
+ cls: Ext.baseCSSPrefix + 'slider-helper-input'
+ }
+ ]
+ }];
+
+ return originalConfig;
+ },
+
+ setHelperValue: function(value) {
+ var valueMapper = this.config.valueMapper;
+ var value = valueMapper ? valueMapper(value) : value;
+ this.helperInput.dom.value = value;
+ },
+
+ // @private
+ applyComponent: function(config) {
+ var self = this;
+ self.helper.setStyle('float', self.config.helperPosition);
+ var changeValue = function(e) {
+ var keycode = e.which || window.event.keyCode;
+ if( [8, 9, 13, 37, 38, 39, 40, 46].indexOf(Number(keycode)) !== -1 ) return true;
+ var helperInputValue = Number(self.helperInput.getValue());
+ if(helperInputValue < self.config.minValue || isNaN(helperInputValue))
+ helperInputValue = self.config.minValue;
+ else if(helperInputValue > self.config.maxValue)
+ helperInputValue = self.config.maxValue;
+ this.value = helperInputValue;
+ self.setValue(helperInputValue);
+ };
+ self.helperInput.dom.onkeydown = function(e) {
+ var keycode = e.which || window.event.keyCode;
+ if( [8, 9, 13, 37, 38, 39, 40, 46, 190].indexOf(Number(keycode)) !== -1 ) return true;
+ if( keycode > 57 || keycode < 48 ) return false;
+ };
+ self.helperInput.dom.onchange = changeValue;
+ self.helperInput.dom.onclick = changeValue;
+ self.helperInput.dom.onkeyup = changeValue;
+ self.setHelperValue(self.config.value);
+ return Ext.factory(config, Ext.slider.Slider);
+ },
+
+ onSliderChange: function(me, thumb, newValue, oldValue) {
+ this.setHelperValue(newValue);
+ this.fireEvent('change', this, thumb, newValue, oldValue);
+ },
+
+ onSliderDragStart: function(me, thumb, newValue, oldValue) {
+ this.fireEvent('dragstart', this, thumb, newValue, oldValue);
+ },
+
+ onSliderDrag: function(me, thumb, newValue, oldValue) {
+ this.setHelperValue(newValue);
+ this.fireEvent('drag', this, thumb, newValue, oldValue);
+ },
+
+ onSliderDragEnd: function(me, thumb, newValue, oldValue) {
+ this.fireEvent('dragend', this, thumb, newValue, oldValue);
+ },
+
+ /**
+ * Convience method. Calls {@link #setValue}
+ */
+ setValues: function(value) {
+ this.setValue(value);
+ },
+
+ /**
+ * Convience method. Calls {@link #getValue}
+ */
+ getValues: function() {
+ return this.getValue();
+ },
+
+ reset: function() {
+ var config = this.config,
+ initialValue = (this.config.hasOwnProperty('values')) ? config.values : config.value;
+
+ this.setValue(initialValue);
+ },
+
+ doSetDisabled: function(disabled) {
+ this.callParent(arguments);
+
+ this.getComponent().setDisabled(disabled);
+ }
+});
View
138 www/lib/plugins/SliderFieldText.js
@@ -0,0 +1,138 @@
+Ext.define('Ext.field.SliderText', {
+ extend : 'Ext.field.Field',
+ xtype : 'slider.text',
+ requires: [
+ 'Ext.slider.Slider'
+ ],
+ alternateClassName: 'Ext.form.SliderText',
+
+ config: {
+ cls: Ext.baseCSSPrefix + 'slider-field-text',
+ tabIndex: -1,
+ helperPosition: 'right',
+ valueMapper: function(value) {
+ if (self.config.valueMap) {
+ self.config.valueMap[value];
+ } else {
+ value;
+ }
+ }
+ },
+
+ proxyConfig: {
+ value: 0,
+ minValue: 0,
+ maxValue: 100,
+ increment: 1
+ },
+
+ constructor: function(config) {
+ config = config || {};
+
+ if (config.hasOwnProperty('values')) {
+ config.value = config.values;
+ }
+
+ if (config.hasOwnProperty('valueMap')) {
+ if (config.autoValues == true) {
+ config.value = config.defaultValue || 0;
+ config.minValue = 0;
+ config.maxValue = config.valueMap.size -1;
+ config.increment = 1;
+ }
+ }
+
+ this.callParent([config]);
+ },
+
+ initialize: function() {
+ this.callParent();
+
+ this.getComponent().on({
+ scope: this,
+ change: 'onSliderChange',
+ dragstart: 'onSliderDragStart',
+ drag: 'onSliderDrag',
+ dragend: 'onSliderDragEnd'
+ });
+ },
+
+ getElementConfig: function() {
+ var self = this;
+ var originalConfig = self.callParent();
+
+ originalConfig.children[1].children = [{
+ reference: 'helper',
+ tag: 'div',
+ cls: Ext.baseCSSPrefix + 'slider-helper',
+ children: [
+ {
+ reference: 'helperInput',
+ tag: 'div',
+ cls: Ext.baseCSSPrefix + 'slider-helper-input'
+ }
+ ]
+ }];
+
+ return originalConfig;
+ },
+
+ setHelperValue: function(value) {
+ var valueMapper = self.config.valueMapper;
+ var value = valueMapper ? valueMapper(value) : value;
+ this.helperInput.dom.text = value;
+ },
+
+ // @private
+ applyComponent: function(config) {
+ var self = this;
+ self.helper.setStyle('float', self.config.helperPosition);
+ self.setHelperValue(self.config.value);
+ return Ext.factory(config, Ext.slider.Slider);
+ },
+
+ onSliderChange: function(me, thumb, newValue, oldValue) {
+ this.setHelperValue(newValue);
+ this.fireEvent('change', this, thumb, newValue, oldValue);
+ },
+
+ onSliderDragStart: function(me, thumb, newValue, oldValue) {
+ this.fireEvent('dragstart', this, thumb, newValue, oldValue);
+ },
+
+ onSliderDrag: function(me, thumb, newValue, oldValue) {
+ this.setHelperValue(newValue);
+ this.fireEvent('drag', this, thumb, newValue, oldValue);
+ },
+
+ onSliderDragEnd: function(me, thumb, newValue, oldValue) {
+ this.fireEvent('dragend', this, thumb, newValue, oldValue);
+ },
+
+ /**
+ * Convience method. Calls {@link #setValue}
+ */
+ setValues: function(value) {
+ this.setValue(value);
+ },
+
+ /**
+ * Convience method. Calls {@link #getValue}
+ */
+ getValues: function() {
+ return this.getValue();
+ },
+
+ reset: function() {
+ var config = this.config,
+ initialValue = (this.config.hasOwnProperty('values')) ? config.values : config.value;
+
+ this.setValue(initialValue);
+ },
+
+ doSetDisabled: function(disabled) {
+ this.callParent(arguments);
+
+ this.getComponent().setDisabled(disabled);
+ }
+});
View
2  www/resources/css/app.css
1 addition, 1 deletion not shown
View
BIN  www/resources/images/DanishFlag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  www/resources/images/EnglishFlag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  www/resources/images/FriendlyRent.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  www/resources/images/FriendlyRent_big.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  www/resources/images/friendly_rent_trans_48.png → www/resources/images/FriendlyRent_icon.png
File renamed without changes
View
0  www/resources/images/FriendlyRentTrans.png → www/resources/images/FriendlyRent_small.png
File renamed without changes
View
BIN  www/resources/images/button_icons/search_white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  www/resources/images/login.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
70 www/resources/sass/app.scss
@@ -1,5 +1,10 @@
+// $base-color: #ff6200;
+$base-gradien: 'glossy';
+
@import 'sencha-touch/default/all';
+// $include_default_icons: false;
+
// You may remove any of the following modules that you
// do not use in order to create a smaller css file.
@include sencha-panel;
@@ -16,28 +21,59 @@
@include sencha-form;
@include sencha-msgbox;
-// Your custom code goes here...
+// @include sencha-toolbar-ui('charcoal', #333);
+// @include sencha-toolbar-ui('gray', #222, 'bevel', #d40e3f);
+
+// Your custom code goes here..
+
+// How-to-make-toolbar-buttons-appear-like-the-tab-bar-icons
+// using-TabPanel-button-icons-in-a-Toolbar
+
+// http://techtalktone.wordpress.com/2012/02/28/use-custom-button-icons-in-sencha-touch/
-// http://www.sencha.com/forum/showthread.php?126911-How-to-make-toolbar-buttons-appear-like-the-tab-bar-icons
+@include sencha-button-ui('orange', #ff6200, 'glossy');
+@include sencha-button-ui('purple', #8e40c7, 'glossy');
-// http://www.sencha.com/forum/showthread.php?126183-using-TabPanel-button-icons-in-a-Toolbar
+@mixin custom-iconmask($name) {
+ .x-tab img.#{$name}, .x-button img.x-icon-mask.#{$name} {
+ -webkit-mask-image: inline-image('button_icons/' + $name + '.png');
+ }
+}
+
+// @include custom-iconmask('search_white');
+
+.main-button {
+ margin-bottom: 10px;
+ width: 280px;
+
+ .x-button-label {
+ margin-right: 30px;
+ }
+}
+
+.main-button.black {
+ span.x-button-label {
+ color: black !important;
+ }
+}
.nav-bar .x-button {
display: -webkit-box;
display: box;
-webkit-box-orient: vertical;
box-orient: vertical;
-}
-.nav-bar .x-button img {
- position:relative;
- top:-3px;
-}
-.nav-bar .x-button span {
- padding-top:3px;
- font-size: 9px !important;
- text-rendering: optimizeLegibility;
- -webkit-font-smoothing: antialiased;
- text-shadow: #000 0 -1px 1px;
+
+ img {
+ position:relative;
+ top:-3px;
+ }
+ span {
+ padding-top:3px;
+ font-size: 9px !important;
+ text-rendering: optimizeLegibility;
+ -webkit-font-smoothing: antialiased;
+ text-shadow: #000 0 -1px 1px;
+ }
}
.vertical-text {
@@ -100,7 +136,7 @@
@include pictos-iconmask('favorites_circle');
@include pictos-iconmask('flag');
@include pictos-iconmask('globe_black');
-@include pictos-iconmask('globe1');
+@include pictos-iconmask('globe2');
@include pictos-iconmask('help');
@include pictos-iconmask('home2');
@include pictos-iconmask('inbox2');
@@ -120,11 +156,11 @@
@include pictos-iconmask('replytoall');
@include pictos-iconmask('rss');
@include pictos-iconmask('settings3');
+@include pictos-iconmask('search_black');
@include pictos-iconmask('share');
@include pictos-iconmask('shop1');
@include pictos-iconmask('sync');
@include pictos-iconmask('twitter2');
@include pictos-iconmask('user_add');
@include pictos-iconmask('user_fave');
-@include pictos-iconmask('video');
-// @include pictos-iconmask('wifi');
+@include pictos-iconmask('video');
View
BIN  www/sdk/resources/themes/images/default/pictos/search_white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
13 www/src/app.coffee
@@ -6,10 +6,13 @@ Ext.application
models: []
stores: []
- controllers: []
+ controllers: [
+ "FriendlyRent.controller.Home"
+ ]
views: [
- "registration.landlord.why_us.Page"
+ "FriendlyRent.view.home.Page"
+ "FriendlyRent.view.search.Page"
]
icon:
@@ -28,9 +31,9 @@ Ext.application
'1496x2048': 'resources/startup/1496x2048.png'
launch: ->
- console.log "launch"
- page = Ext.create "FriendlyRent.view.registration.landlord.why_us.Page"
- Ext.Viewport.add page
+ console.log 'launch'
+ home_page = Ext.create 'FriendlyRent.view.home.Page'
+ Ext.Viewport.add home_page
onUpdated: ->
Ext.Msg.confirm(
View
28 www/src/app/controller/Home.coffee
@@ -0,0 +1,28 @@
+Ext.define 'FriendlyRent.controller.Home'
+ extend: 'Ext.app.Controller'
+ config:
+ refs:
+ searchButton: 'button[action=search]'
+ newPropertyButton: 'button[action=newProperty]'
+ danishButton: '#danish_flag'
+ englishButton: '#english_flag'
+ control:
+ searchButton:
+ tap: 'onTapSearch'
+ newPropertyButton:
+ tap: 'onTapNewProperty'
+ danishButton:
+ tap: 'onSelectDanishLang'
+ englishButton:
+ tap: 'onSelectEnglishLang'
+ onTapSearch: ->
+ console.log 'Go to Search'
+ search_page = Ext.create 'FriendlyRent.view.search.Page'
+ Ext.Viewport.removeAt(0)
+ Ext.Viewport.add search_page
+ onTapNewProperty: ->
+ console.log 'Go to New Property'
+ onSelectDanishLang: ->
+ console.log 'Select Danish lang'
+ onSelectEnglishLang: ->
+ console.log 'Select English lang'
View
29 www/src/app/view/home/Flags.coffee
@@ -1,17 +1,28 @@
-Ext.define 'FriendlyRent.view.home.Navigation'
+Ext.define 'FriendlyRent.view.home.Flags'
extend: 'Ext.Panel'
- alias: 'widget.home_navigation'
+ alias: 'widget.home_flags'
config:
- layout: 'hbox'
+ layout:
+ type: 'hbox'
+ pack: 'center'
+ align: 'middle'
items: [
{
- xtype: 'button'
- text: 'Danish'
- # iconCls: 'danish'
+ xtype: 'image'
+ src: 'resources/images/EnglishFlag.png'
+ id: 'english_flag'
+ height: 32
+ width: 32
}
{
- xtype: 'button'
- text: 'English'
- # iconCls: 'english'
+ xtype: 'spacer'
+ width: 12
+ }
+ {
+ xtype: 'image'
+ id: 'danish_flag'
+ src: 'resources/images/DanishFlag.png'
+ height: 32
+ width: 32
}
]
View
13 www/src/app/view/home/Logo.coffee
@@ -1,7 +1,8 @@
Ext.define 'FriendlyRent.view.home.Logo'
- extend: 'Ext.Img'
- alias: 'widget.home_logo'
- config:
- src: 'http://www.sencha.com/assets/images/sencha-avatar-64x64.png',
- height: 64
- width: 64
+ extend: 'Ext.Img'
+ alias: 'widget.home_logo'
+ requires: 'Ext.Img'
+ config:
+ src: 'resources/images/FriendlyRent_big.png'
+ height: 240
+ width: 240
View
33 www/src/app/view/home/Navigation.coffee
@@ -2,14 +2,37 @@ Ext.define 'FriendlyRent.view.home.Navigation'
extend: 'Ext.Panel'
alias: 'widget.home_navigation'
config:
- layout: 'vbox'
+ layout:
+ type: 'vbox'
+ align: 'center'
items: [
{
- xtype: 'button'
- text: 'Search'
+ xtype: 'home_logo'
+ }
+ {
+ xtype: 'spacer'
+ height: 20
+ }
+ {
+ xtype: 'button'
+ ui: 'orange'
+ iconCls: 'search'
+ itemId: 'searchBtn'
+ id: 'searchBtn'
+ action: 'search'
+ iconMask: true
+ text: 'Search home'
+ cls: 'main-button'
}
{
- xtype: 'button'
- text: 'New property'
+ xtype: 'button'
+ ui: 'purple'
+ iconCls: 'home'
+ itemId: 'newBtn'
+ id: 'newBtn'
+ action: 'newProperty'
+ iconMask: true
+ text: 'New property'
+ cls: 'main-button black'
}
]
View
13 www/src/app/view/home/Page.coffee
@@ -1,16 +1,27 @@
Ext.define 'FriendlyRent.view.home.Page'
extend: 'Ext.Panel'
alias: 'widget.home_page'
+ requires: [
+ 'FriendlyRent.view.home.Logo'
+ 'FriendlyRent.view.home.Navigation'
+ 'FriendlyRent.view.home.Flags'
+ ]
config:
layout: 'vbox'
+ style: 'background-color: #c8a0f0'
items: [
{
- xtype: 'home_logo'
+ html: '<img src="resources/images/login.png"/>'
+ style: 'text-align:right; padding: 4px'
}
{
xtype: 'home_navigation'
}
{
+ xtype: 'spacer'
+ height: 20
+ }
+ {
xtype: 'home_flags'
}
]
View
35 www/src/app/view/search/Content.coffee
@@ -1,6 +1,10 @@
Ext.define 'FriendlyRent.view.search.Content'
extend: 'Ext.Panel'
- alias: 'widget.search.content'
+ alias: 'widget.search_content'
+ requires: [
+ 'FriendlyRent.view.search.criteria.Location'
+ 'FriendlyRent.view.search.criteria.Radius'
+ ]
config:
layout: 'vbox'
items: [
@@ -11,34 +15,5 @@ Ext.define 'FriendlyRent.view.search.Content'
{
xtype: 'search_criteria_radius'
name: 'radius'
- },
- {
- xtype: 'search_criteria_property_type'
- name: 'property_type'
- }
- {
- xtype: 'search_criteria_furnishment'
- name: 'furnishment'
- }
- {
- xtype: 'search_criteria_size'
- name: 'size'
- }
- {
- xtype: 'search_criteria_rental_cost'
- name: 'cost'
- }
- {
- xtype: 'search_criteria_rental_period'
- name: 'period'
- }
- {
- xtype: 'search_criteria_rules'
- name: 'rules'
- }
- {
- xtype: 'button'
- name: 'create_agent'
- label: I18n.t('agent.create')
}
]
View
20 www/src/app/view/search/NavBar.coffee
@@ -4,27 +4,17 @@ Ext.define 'FriendlyRent.view.search.NavBar'
config:
items: [
{
- text: I18n.t('search.menu')
+ html: 'menu' # I18n.t('search.menu')
}
{
- text: I18n.t('search')
+ text: 'search' # I18n.t('search')
iconCls: 'search'
+ iconMask: true
}
{
- text: I18n.t('property')
+ text: 'property' # I18n.t('property')
iconCls: 'home'
- }
- {
- text: I18n.t('favorites')
- iconCls: 'favorites'
- }
- {
- text: I18n.t('agents')
- iconCls: 'user'
- }
- {
- text: I18n.t('history')
- iconCls: 'search'
+ iconMask: true
}
]
View
30 www/src/app/view/search/Page.coffee
@@ -1,16 +1,22 @@
-Ext.define 'FriendlyRent.view.properties.list.Page'
+Ext.define 'FriendlyRent.view.search.Page'
extend: 'Ext.Panel'
- alias: 'widget.properties.list.Page'
+ alias: 'widget.search_page'
+ requires: [
+ 'FriendlyRent.view.search.TopBar'
+ 'FriendlyRent.view.search.Content'
+ 'FriendlyRent.view.search.NavBar'
+ ]
config:
- layout: 'vbox'
- items: [
- {
+ items: [
+ {
xtype: 'search_topbar'
- }
- {
- xtype: 'search_content'
- }
- {
+ cls: 'nav-bar'
+ }
+ {
+ xtype: 'search_content'
+ }
+ {
xtype: 'search_navbar'
- }
- ]
+ cls: 'nav-bar'
+ }
+ ]
View
14 www/src/app/view/search/TopBar.coffee
@@ -2,11 +2,19 @@ Ext.define 'FriendlyRent.view.search.TopBar'
extend: 'FriendlyRent.NavBar'
alias: 'widget.search_topbar'
config:
+ docked: 'top'
items: [
{
- text: I18n.t('list')
+ xtype: 'spacer'
}
- {
- text: I18n.t('map')
+ {
+ iconCls: 'list'
+ iconMask: true
+ text: 'list' # text: I18n.t('list')
+ }
+ {
+ iconCls: 'globe2'
+ iconMask: true
+ text: 'map' # text: I18n.t('map')
}
]
View
2  www/src/app/view/search/criteria/Location.coffee
@@ -1,6 +1,6 @@
Ext.define 'FriendlyRent.view.search.criteria.Location'
extend: 'Ext.field.Search'
- alias: 'widget.search.criteria.location'
+ alias: 'widget.search_criteria_location'
config:
name: 'location'
label: 'Location'
View
12 www/src/app/view/search/criteria/Radius.coffee
@@ -1,8 +1,8 @@
Ext.define 'FriendlyRent.view.search.criteria.Radius'
- extend: 'Ext.field.SliderInput'
+ extend: 'Ext.field.SliderInput'
alias: 'widget.search_criteria_radius'
- config:
- value: 5
- minValue: 1
- maxValue: 50
- label: 'Radius'
+ config:
+ value: 5
+ minValue: 1
+ maxValue: 50
+ label: 'Radius'
View
47 www/src/app/view/search/sandbox.txt
@@ -0,0 +1,47 @@
+ {
+ text: I18n.t('favorites')
+ iconCls: 'favorites'
+ iconMask: true
+ }
+ {
+ text: I18n.t('agents')
+ iconCls: 'user'
+ iconMask: true
+ }
+ {
+ text: I18n.t('history')
+ iconCls: 'search'
+ iconMask: true
+ }
+
+
+
+ {
+ xtype: 'search_criteria_property_type'
+ name: 'property_type'
+ }
+ {
+ xtype: 'search_criteria_furnishment'
+ name: 'furnishment'
+ }
+ {
+ xtype: 'search_criteria_size'
+ name: 'size'
+ }
+ {
+ xtype: 'search_criteria_rental_cost'
+ name: 'cost'
+ }
+ {
+ xtype: 'search_criteria_rental_period'
+ name: 'period'
+ }
+ {
+ xtype: 'search_criteria_rules'
+ name: 'rules'
+ }
+ {
+ xtype: 'button'
+ name: 'create_agent'
+ label: I18n.t('agent.create')
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.