summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-12-11 14:30:18 -0600
committerJules Laplace <jules@okfoc.us>2015-12-11 14:30:18 -0600
commit32c8b0fa79e6aa818360341f58b6f327299caf59 (patch)
tree4d53a581790941b5863354c0d903b5583f87a673 /StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
parent6751e1424bb46a3d6a035e695bcd61475e40a13f (diff)
deeplinking working. 0.4.0
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
index 4bf05430..c399a2a9 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/PageView.js
@@ -1,6 +1,7 @@
var PageView = ScrollableView.extend({
events: {
+ "touchstart a": "follow_link"
},
initialize: function(opt){
@@ -19,6 +20,19 @@ var PageView = ScrollableView.extend({
populate: function(data){
this.$content.html(data.body.replace(/\n/g, "<br>"))
+ this.$content.find("a").each(function(){
+ var href = $(this).attr("href") // .substr(1, "fuck".length-2)
+ if (href.indexOf("“")) {
+ href = href.substr(1, href.length-2)
+ $(this).attr("href", href)
+ }
+ $(this).attr("target", "_system")
+ })
+ },
+
+ follow_link: function(e){
+ var href = $(e.currentTarget).attr("href")
+ window.open(row.link, '_system')
},
}) \ No newline at end of file