summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-08-20 17:39:03 -0700
committerP. F. Chimento <philip.chimento@gmail.com>2013-08-20 17:39:03 -0700
commit973b40e1962fa462bc3d477ca2c6ef10588c8d24 (patch)
tree27d81c31bc7a9d9af3e8d389bf3982e527bbbba0
parent17f450b7e26eaf555512d58493aec9fc8b25cee3 (diff)
parent74d89d9288affda7eb4e09fbe8f53f19cb7ed8a9 (diff)
Merge pull request #268 from endlessm/issues/267
#267 Wikiwebview now uses new API calls
-rw-r--r--wikipedia/WikipediaWebView.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/wikipedia/WikipediaWebView.js b/wikipedia/WikipediaWebView.js
index 05b64c3..761156b 100644
--- a/wikipedia/WikipediaWebView.js
+++ b/wikipedia/WikipediaWebView.js
@@ -5,7 +5,8 @@ const WebKit = imports.gi.WebKit2;
const Utils = imports.wikipedia.utils;
const hostName = "http://127.0.0.1:3000/"
-const getPageURI = "getDomainSpecificArticle?title=";
+const getPageByTitleURI = "getArticleByTitle?title=";
+const getPageByQueryURI = "getTopArticleByQuery?query=";
// Interpret image:// URIs as wikipedia images
WebKit.WebContext.get_default().register_uri_scheme('image', function(request) {
@@ -43,11 +44,15 @@ const WikipediaWebView = new Lang.Class({
let parts = uri.split("/");
let suffix = parts[parts.length - 1];
let title = decodeURI(suffix.replace("_", " ", 'g'));
- this.load_uri(hostName + getPageURI + title);
+ this.loadArticleByTitle(title);
},
loadArticleByTitle: function(title) {
- this.load_uri(hostName + getPageURI + title);
+ this.load_uri(hostName + getPageByTitleURI + title);
+ },
+
+ loadArticleBySearchQuery: function(query) {
+ this.load_uri(hostName + getPageByQueryURI + query);
},
_getArticleImagesPath: function() {