Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/213509

Change subject: Added hatnote processing.
......................................................................

Added hatnote processing.

Change-Id: I02385b97b84a799536547227260d7ca36aa8b8ff
---
M routes/mobileapp-lite.js
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/09/213509/1

diff --git a/routes/mobileapp-lite.js b/routes/mobileapp-lite.js
index 57a99a0..23fe961 100644
--- a/routes/mobileapp-lite.js
+++ b/routes/mobileapp-lite.js
@@ -87,7 +87,6 @@
     var doc = domino.createDocument(section.text);
     rmSelectorAll(doc, 'div.noprint');
     rmSelectorAll(doc, 'div.infobox');
-    rmSelectorAll(doc, 'div.hatnote');
     rmSelectorAll(doc, 'div.metadata');
     rmSelectorAll(doc, 'table'); // TODO: later we may want to transform some 
of the tables into a JSON structure
 
@@ -97,6 +96,14 @@
     var itemIndex = 0;
     var thumbnails, tid, thumb;
 
+    var hatnotes = doc.querySelectorAll("div.hatnote") || [];
+    for (var hid = 0; hid < hatnotes.length; hid++) {
+        section.items[itemIndex] = {};
+        section.items[itemIndex].type = "hatnote";
+        section.items[itemIndex].text = hatnotes[hid].innerHTML;
+        itemIndex++;
+    }
+
     var ps = doc.querySelectorAll("p") || [];
     for (var pid = 0; pid < ps.length; pid++) {
         var p = ps[pid];

-- 
To view, visit https://gerrit.wikimedia.org/r/213509
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02385b97b84a799536547227260d7ca36aa8b8ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Dbrant <dbr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to