summaryrefslogtreecommitdiff
path: root/wikipedia/models/category_model.js
diff options
context:
space:
mode:
Diffstat (limited to 'wikipedia/models/category_model.js')
-rw-r--r--wikipedia/models/category_model.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/wikipedia/models/category_model.js b/wikipedia/models/category_model.js
new file mode 100644
index 0000000..ea9bfb6
--- /dev/null
+++ b/wikipedia/models/category_model.js
@@ -0,0 +1,37 @@
+const Endless = imports.gi.Endless;
+const GObject = imports.gi.GObject;
+const Lang = imports.lang;
+
+// Local libraries
+const ArticleModel = imports.models.article_model;
+
+const CategoryModel = new Lang.Class({
+ Name: "CategoryModel",
+ Extends: GObject.Object,
+ Properties: {
+ 'description': GObject.ParamSpec.string('description', 'Category Description', 'This is the text that the user reads on the category page.',
+ GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT,
+ ""),
+ 'title': GObject.ParamSpec.string('title', 'Category Name', 'This is the name that is displayed on the front page and as the title on the category page.',
+ GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT,
+ ""),
+ '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) {
+ this.parent(params);
+ },
+
+ addArticles: function(articles) {
+ this._articles = articles;
+ },
+
+ getArticles: function() {
+ return this._articles;
+ }
+}); \ No newline at end of file