summaryrefslogtreecommitdiff
path: root/wikipedia
diff options
context:
space:
mode:
authorFernando Farfan <fernando@endlessm.com>2013-08-02 12:51:23 -0700
committerRory MacQueen <rorymacqueen@gmail.com>2013-08-02 15:33:10 -0700
commitce09024cfdd88d5b4377f119b6b982d28bf60947 (patch)
treea1619d4d0740b13449dd6c04f0879360f70ea385 /wikipedia
parent41e91b9dce5718465d4152ce94cde41d01892641 (diff)
Added support for category thumbnail images.
Each category can have a thumbnail image now, which is displayed in the CategorySelectorView. Added initial thumbnail images to the data directory. [endlessm/eos-sdk#186]
Diffstat (limited to 'wikipedia')
-rw-r--r--wikipedia/data/category_images/thumb_arts.jpgbin0 -> 58494 bytes
-rw-r--r--wikipedia/data/category_images/thumb_cities.jpgbin0 -> 35074 bytes
-rw-r--r--wikipedia/data/category_images/thumb_culinary.jpgbin0 -> 54826 bytes
-rw-r--r--wikipedia/data/category_images/thumb_events.jpgbin0 -> 96126 bytes
-rw-r--r--wikipedia/data/category_images/thumb_history.jpgbin0 -> 64600 bytes
-rw-r--r--wikipedia/data/category_images/thumb_music.jpgbin0 -> 48442 bytes
-rw-r--r--wikipedia/data/category_images/thumb_nature.jpgbin0 -> 45070 bytes
-rw-r--r--wikipedia/data/category_images/thumb_sports.jpgbin0 -> 111179 bytes
-rw-r--r--wikipedia/data/endless_brazil.gresource.xml10
-rw-r--r--wikipedia/data/pt-br-brazil-app.json2
-rw-r--r--wikipedia/src/models/category_model.js5
-rw-r--r--wikipedia/src/presenters/domain_wiki_presenter.js7
-rw-r--r--wikipedia/src/views/category_selector_view.js2
13 files changed, 21 insertions, 5 deletions
diff --git a/wikipedia/data/category_images/thumb_arts.jpg b/wikipedia/data/category_images/thumb_arts.jpg
new file mode 100644
index 0000000..23000b1
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_arts.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_cities.jpg b/wikipedia/data/category_images/thumb_cities.jpg
new file mode 100644
index 0000000..b163c1b
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_cities.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_culinary.jpg b/wikipedia/data/category_images/thumb_culinary.jpg
new file mode 100644
index 0000000..50efbe9
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_culinary.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_events.jpg b/wikipedia/data/category_images/thumb_events.jpg
new file mode 100644
index 0000000..f177f82
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_events.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_history.jpg b/wikipedia/data/category_images/thumb_history.jpg
new file mode 100644
index 0000000..2ec5bd5
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_history.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_music.jpg b/wikipedia/data/category_images/thumb_music.jpg
new file mode 100644
index 0000000..6458fab
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_music.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_nature.jpg b/wikipedia/data/category_images/thumb_nature.jpg
new file mode 100644
index 0000000..e289f29
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_nature.jpg
Binary files differ
diff --git a/wikipedia/data/category_images/thumb_sports.jpg b/wikipedia/data/category_images/thumb_sports.jpg
new file mode 100644
index 0000000..fdcdd3c
--- /dev/null
+++ b/wikipedia/data/category_images/thumb_sports.jpg
Binary files differ
diff --git a/wikipedia/data/endless_brazil.gresource.xml b/wikipedia/data/endless_brazil.gresource.xml
index a3b1137..84f5c9b 100644
--- a/wikipedia/data/endless_brazil.gresource.xml
+++ b/wikipedia/data/endless_brazil.gresource.xml
@@ -2,8 +2,16 @@
<gresources>
<gresource prefix="/com/endlessm/brazil">
<file compressed="true">pt-br-brazil-app.json</file>
- <file compressed="true">brazil_categories.json</file>
+ <!-- file compressed="true">brazil_categories.json</file -->
<file compressed="true">css/endless_brazil.css</file>
+ <file>category_images/thumb_arts.jpg</file>
+ <file>category_images/thumb_cities.jpg</file>
+ <file>category_images/thumb_culinary.jpg</file>
+ <file>category_images/thumb_events.jpg</file>
+ <file>category_images/thumb_history.jpg</file>
+ <file>category_images/thumb_music.jpg</file>
+ <file>category_images/thumb_nature.jpg</file>
+ <file>category_images/thumb_sports.jpg</file>
<file>category_images/cuisine.jpg</file>
<file>category_images/history.jpg</file>
<file>category_images/bg_brazil_sports.jpg</file>
diff --git a/wikipedia/data/pt-br-brazil-app.json b/wikipedia/data/pt-br-brazil-app.json
index 8808872..f01e870 100644
--- a/wikipedia/data/pt-br-brazil-app.json
+++ b/wikipedia/data/pt-br-brazil-app.json
@@ -7,6 +7,7 @@
"category_name":"Sports",
"content_text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet rutrum lectus, quis tincidunt eros venenatis nec. Cras porta aliquam arcu fermentum imperdiet. Praesent ut facilisis quam, at interdum elit. Morbi commodo tellus ut varius ultricies. Nam sodales sapien non scelerisque bibendum. Ut ultrices metus sed mauris lacinia pharetra. In magna lorem, hendrerit quis blandit a, congue sit amet arcu. Mauris vulputate hendrerit justo, ut luctus lectus. Praesent placerat dapibus hendrerit. Pellentesque neque nunc, egestas vel faucibus vitae, accumsan in nisi. Aenean at commodo mauris. Mauris congue facilisis iaculis. Aenean at dapibus quam. Maecenas sit amet pharetra ligula. Vestibulum mollis condimentum mollis. Nulla facilisi. Suspendisse vel consequat nisl. Proin et pretium lectus. Mauris tempor luctus venenatis. Vestibulum diam metus, hendrerit et blandit quis, iaculis quis mi. Integer cursus fringilla eros, id eleifend nisl malesuada laoreet. Fusce vitae lacus eget arcu sodales porta non eu augue. Sed vel eleifend tellus. Pellentesque vel velit augue. Mauris sagittis dictum sem, sit amet pharetra sem cursus eget. Nam enim diam, tempus id cursus eu, varius in velit. Aliquam ut feugiat lorem. Proin egestas laoreet rutrum.",
"image_uri":"resource:///com/endlessm/brazil/category_images/bg_brazil_sports.jpg",
+ "image_thumbnail_uri":"resource:///com/endlessm/brazil/category_images/thumb_sports.jpg",
"articles":
[
{
@@ -62,6 +63,7 @@
"category_name":"History",
"content_text":"Brazil has a long and interesting history.",
"image_uri":"resource:///com/endlessm/brazil/category_images/history.jpg",
+ "image_thumbnail_uri":"resource:///com/endlessm/brazil/category_images/thumb_history.jpg",
"articles":
[
{
diff --git a/wikipedia/src/models/category_model.js b/wikipedia/src/models/category_model.js
index d5d0a43..4682cac 100644
--- a/wikipedia/src/models/category_model.js
+++ b/wikipedia/src/models/category_model.js
@@ -17,7 +17,10 @@ const CategoryModel = new Lang.Class({
""),
'image_uri': GObject.ParamSpec.string('image_uri', 'Category Image URI', 'Path to image for this category in the GResource',
GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT,
- "")
+ ""),
+ 'image_thumbnail_uri': GObject.ParamSpec.string('image_thumbnail_uri', 'Category Thumbnail Image URI', 'Path to thumbnail image for this category in the GResource',
+ GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT,
+ ""),
},
_init: function(params) {
diff --git a/wikipedia/src/presenters/domain_wiki_presenter.js b/wikipedia/src/presenters/domain_wiki_presenter.js
index 43beaa5..ab4cab0 100644
--- a/wikipedia/src/presenters/domain_wiki_presenter.js
+++ b/wikipedia/src/presenters/domain_wiki_presenter.js
@@ -68,8 +68,11 @@ const DomainWikiPresenter = new Lang.Class({
},
initCategory: function(category){
- let image_uri = category['image_file'];
- let params = {description:category['content_text'], image_uri:image_uri, title:category['category_name']};
+ let image_uri = category['image_uri'];
+ let image_thumbnail_uri = category['image_thumbnail_uri'];
+
+ let params = {description:category['content_text'], image_uri:image_uri,
+ image_thumbnail_uri:image_thumbnail_uri, title:category['category_name']};
return new CategoryModel.CategoryModel(params);
},
diff --git a/wikipedia/src/views/category_selector_view.js b/wikipedia/src/views/category_selector_view.js
index fa34aa1..5432a3e 100644
--- a/wikipedia/src/views/category_selector_view.js
+++ b/wikipedia/src/views/category_selector_view.js
@@ -29,7 +29,7 @@ const CategorySelectorView = new Lang.Class({
categories.forEach(function(category, index, obj) {
let button = new CategoryButton.CategoryButton({
category_title: category.title,
- image_uri: category.image_uri
+ image_uri: category.image_thumbnail_uri
});
button.index = index;
button.connect('clicked', Lang.bind(this, this._onButtonClicked));