diff options
-rwxr-xr-x | inc/poche/Poche.class.php | 2 | ||||
-rw-r--r-- | themes/_global/js/jquery.mobile.events.touch.min.js | 3 | ||||
-rw-r--r-- | themes/_global/js/keyboard.js | 27 | ||||
-rwxr-xr-x | themes/baggy/_head.twig | 2 | ||||
-rwxr-xr-x | themes/baggy/css/main.css | 28 | ||||
-rwxr-xr-x | themes/baggy/view.twig | 22 | ||||
-rwxr-xr-x | themes/default/_head.twig | 2 | ||||
-rwxr-xr-x | themes/default/view.twig | 16 |
8 files changed, 96 insertions, 6 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 18e1d051..c6c91c4a 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -315,7 +315,7 @@ class Poche | |||
315 | } | 315 | } |
316 | break; | 316 | break; |
317 | case 'archive_and_next' : | 317 | case 'archive_and_next' : |
318 | $nextid = $this->store->getNextArticle($id, $this->user->getId()); | 318 | $nextid = $this->store->getPreviousArticle($id, $this->user->getId()); |
319 | $this->store->archiveById($id, $this->user->getId()); | 319 | $this->store->archiveById($id, $this->user->getId()); |
320 | Tools::logm('archive link #' . $id); | 320 | Tools::logm('archive link #' . $id); |
321 | Tools::redirect('?view=view&id=' . $nextid); | 321 | Tools::redirect('?view=view&id=' . $nextid); |
diff --git a/themes/_global/js/jquery.mobile.events.touch.min.js b/themes/_global/js/jquery.mobile.events.touch.min.js new file mode 100644 index 00000000..058c3453 --- /dev/null +++ b/themes/_global/js/jquery.mobile.events.touch.min.js | |||
@@ -0,0 +1,3 @@ | |||
1 | /*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */ | ||
2 | |||
3 | (function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)}); \ No newline at end of file | ||
diff --git a/themes/_global/js/keyboard.js b/themes/_global/js/keyboard.js new file mode 100644 index 00000000..ec20d3f2 --- /dev/null +++ b/themes/_global/js/keyboard.js | |||
@@ -0,0 +1,27 @@ | |||
1 | function navigateKeyboard(leftURL, rightURL) { | ||
2 | window.addEventListener("keypress", function (event) { | ||
3 | var key = event.which || event.keyCode; // event.keyCode is used for IE8 and earlier versions | ||
4 | switch (key) { | ||
5 | case 37: | ||
6 | goLeft(leftURL); | ||
7 | break; | ||
8 | |||
9 | case 39: | ||
10 | goRight(rightURL); | ||
11 | break; | ||
12 | } | ||
13 | |||
14 | }, false); | ||
15 | } | ||
16 | |||
17 | function goLeft(leftURL) { | ||
18 | if (leftURL != "?view=view&id=") { | ||
19 | window.location = window.location.origin + window.location.pathname + leftURL; | ||
20 | } | ||
21 | } | ||
22 | |||
23 | function goRight(rightURL) { | ||
24 | if (rightURL != "?view=view&id=") { | ||
25 | window.location = window.location.origin + window.location.pathname + rightURL; | ||
26 | } | ||
27 | } \ No newline at end of file | ||
diff --git a/themes/baggy/_head.twig b/themes/baggy/_head.twig index d252130c..b9f1e5d9 100755 --- a/themes/baggy/_head.twig +++ b/themes/baggy/_head.twig | |||
@@ -31,9 +31,11 @@ | |||
31 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/print.css" media="print"> | 31 | <link rel="stylesheet" href="{{ poche_url }}themes/{{theme}}/css/print.css" media="print"> |
32 | 32 | ||
33 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> | 33 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> |
34 | <script src="{{ poche_url }}themes/_global/js/jquery.mobile.events.touch.min.js"></script> | ||
34 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> | 35 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> |
35 | <script src="{{ poche_url }}themes/{{theme}}/js/jquery.cookie.js"></script> | 36 | <script src="{{ poche_url }}themes/{{theme}}/js/jquery.cookie.js"></script> |
36 | <script src="{{ poche_url }}themes/{{theme}}/js/init.js"></script> | 37 | <script src="{{ poche_url }}themes/{{theme}}/js/init.js"></script> |
37 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> | 38 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> |
38 | <script src="{{ poche_url }}themes/_global/js/popupForm.js"></script> | 39 | <script src="{{ poche_url }}themes/_global/js/popupForm.js"></script> |
40 | <script src="{{ poche_url }}themes/_global/js/keyboard.js"></script> | ||
39 | <script src="{{ poche_url }}themes/{{theme}}/js/closeMessage.js"></script> | 41 | <script src="{{ poche_url }}themes/{{theme}}/js/closeMessage.js"></script> |
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 1b221021..5319fd68 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css | |||
@@ -873,6 +873,20 @@ blockquote { | |||
873 | font-size: 1.5em; | 873 | font-size: 1.5em; |
874 | } | 874 | } |
875 | 875 | ||
876 | .leftPosF { | ||
877 | position: fixed; | ||
878 | right: 24%; | ||
879 | bottom: 2em; | ||
880 | font-size: 1.5em; | ||
881 | } | ||
882 | |||
883 | .rightPosF { | ||
884 | position: fixed; | ||
885 | right: 16%; | ||
886 | bottom: 2em; | ||
887 | font-size: 1.5em; | ||
888 | } | ||
889 | |||
876 | #article_toolbar { | 890 | #article_toolbar { |
877 | margin-bottom: 1em; | 891 | margin-bottom: 1em; |
878 | } | 892 | } |
@@ -970,6 +984,12 @@ pre code { | |||
970 | .topPosF { | 984 | .topPosF { |
971 | right: 2.5em; | 985 | right: 2.5em; |
972 | } | 986 | } |
987 | .leftPosF { | ||
988 | right: 4.5em; | ||
989 | } | ||
990 | .rightPosF { | ||
991 | right: 0.5em; | ||
992 | } | ||
973 | } | 993 | } |
974 | 994 | ||
975 | @media screen and (max-width: 700px) { | 995 | @media screen and (max-width: 700px) { |
@@ -1063,6 +1083,14 @@ pre code { | |||
1063 | display: none; | 1083 | display: none; |
1064 | } | 1084 | } |
1065 | 1085 | ||
1086 | #article_toolbar .leftPosF { | ||
1087 | display: none; | ||
1088 | } | ||
1089 | |||
1090 | #article_toolbar .rightPosF { | ||
1091 | display: none; | ||
1092 | } | ||
1093 | |||
1066 | #article { | 1094 | #article { |
1067 | width: 100%; | 1095 | width: 100%; |
1068 | } | 1096 | } |
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig index ae02ce48..a57d1771 100755 --- a/themes/baggy/view.twig +++ b/themes/baggy/view.twig | |||
@@ -5,13 +5,14 @@ | |||
5 | {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %} | 5 | {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %} |
6 | {% block content %} | 6 | {% block content %} |
7 | {% include '_highlight.twig' %} | 7 | {% include '_highlight.twig' %} |
8 | {% block toolbar %} | ||
8 | <div id="article_toolbar"> | 9 | <div id="article_toolbar"> |
9 | <ul class="links"> | 10 | <ul class="links"> |
10 | <li class="topPosF"><a href="#top" title="{% trans "Back to top" %}" class="tool top icon icon-arrow-up-thick"><span>{% trans "Back to top" %}</span></a></li> | 11 | <li class="topPosF"><a href="#top" title="{% trans "Back to top" %}" class="tool top icon icon-arrow-up-thick"><span>{% trans "Back to top" %}</span></a></li> |
11 | {% if navigate.previous %}<li><a href="./?view=view&id={{ navigate.previousid|e }}" class="tool icon icon-previous"><span>{% trans "Previous Article" %}</span></a></li>{% endif %} | 12 | {% if navigate.next %}<li class="leftPosF"><a href="./?view=view&id={{ navigate.nextid|e }}" class="top tool icon icon-previous"><span>{% trans "Next Article" %}</span></a></li>{% endif %} |
12 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | getDomain }}</span></a></li> | 13 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | getDomain }}</span></a></li> |
13 | <li><a title="{% trans "Mark as read" %}" class="tool icon icon-check {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="javascript: void(null);" id="markAsRead"><span>{% trans "Toggle mark as read" %}</span></a></li> | 14 | <li><a title="{% trans "Mark as read" %}" class="tool icon icon-check {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="javascript: void(null);" id="markAsRead"><span>{% trans "Toggle mark as read" %}</span></a></li> |
14 | {% if navigate.next %}<li><a title="{% trans "Mark as read and go to next article" %}" class="tool icon archiveandnext-icon" href="./?action=archive_and_next&id={{ entry.id|e }}" id="markAsReadAndNext"><span>{% trans "Toggle mark as read and go to next article" %}</span></a></li>{% endif %} | 15 | {% if navigate.previous %}<li><a title="{% trans "Mark as read and go to next article" %}" class="tool icon icon-archiveandnext" href="./?action=archive_and_next&id={{ entry.id|e }}" id="markAsReadAndNext"><span>{% trans "Toggle mark as read and go to next article" %}</span></a></li>{% endif %} |
15 | <li><a title="{% trans "Favorite" %}" class="tool icon icon-star {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans "Toggle favorite" %}</span></a></li> | 16 | <li><a title="{% trans "Favorite" %}" class="tool icon icon-star {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans "Toggle favorite" %}</span></a></li> |
16 | <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> | 17 | <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> |
17 | {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %} | 18 | {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %} |
@@ -27,9 +28,11 @@ | |||
27 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | 28 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} |
28 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | 29 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} |
29 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display icon icon-delete"><span>{% trans "Does this article appear wrong?" %}</span></a></li> | 30 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display icon icon-delete"><span>{% trans "Does this article appear wrong?" %}</span></a></li> |
30 | {% if navigate.next %}<li><a href="./?view=view&id={{ navigate.nextid|e }}" class="tool icon icon-next"><span>{% trans "Next Article" %}</span></a></li>{% endif %} | 31 | {% if navigate.previous %}<li class="rightPosF"><a href="./?view=view&id={{ navigate.previousid|e }}" class="tool icon icon-next"><span>{% trans "Previous Article" %}</span></a></li>{% endif %} |
31 | </ul> | 32 | </ul> |
32 | </div> | 33 | </div> |
34 | {% endblock %} | ||
35 | |||
33 | <div id="article"> | 36 | <div id="article"> |
34 | <header class="mbm"> | 37 | <header class="mbm"> |
35 | <h1>{{ entry.title|raw }}</h1> | 38 | <h1>{{ entry.title|raw }}</h1> |
@@ -41,6 +44,7 @@ | |||
41 | {{ content | raw }} | 44 | {{ content | raw }} |
42 | </article> | 45 | </article> |
43 | </div> | 46 | </div> |
47 | {{ block('toolbar') }} | ||
44 | <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> | 48 | <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> |
45 | <script type="text/javascript"> | 49 | <script type="text/javascript"> |
46 | $(document).ready(function() { | 50 | $(document).ready(function() { |
@@ -103,5 +107,17 @@ | |||
103 | retrievePercent({{ entry.id|e }}); | 107 | retrievePercent({{ entry.id|e }}); |
104 | }); | 108 | }); |
105 | }); | 109 | }); |
110 | |||
111 | // Use left and right arrow to navigate on with keyboard | ||
112 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); | ||
113 | |||
114 | // swipe to right or left on mobile to navigate | ||
115 | $('article').on("swiperight", function(){ | ||
116 | goLeft('?view=view&id={{ navigate.nextid|e }}'); | ||
117 | }); | ||
118 | $('article').on("swipeleft", function(){ | ||
119 | goRight('?view=view&id={{ navigate.previousid|e }}'); | ||
120 | }); | ||
121 | |||
106 | </script> | 122 | </script> |
107 | {% endblock %} | 123 | {% endblock %} |
diff --git a/themes/default/_head.twig b/themes/default/_head.twig index 91a555cb..ce1bbdcc 100755 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig | |||
@@ -30,7 +30,9 @@ | |||
30 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/messages.css" media="all"> | 30 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/messages.css" media="all"> |
31 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/print.css" media="print"> | 31 | <link rel="stylesheet" href="{{ poche_url }}themes/default/css/print.css" media="print"> |
32 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> | 32 | <script src="{{ poche_url }}themes/_global/js/jquery-2.1.3.min.js"></script> |
33 | <script src="{{ poche_url }}themes/_global/js/jquery.mobile.events.touch.min.js"></script> | ||
33 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> | 34 | <script src="{{ poche_url }}themes/_global/js/autoClose.js"></script> |
34 | <script src="{{ poche_url }}themes/default/js/closeMessage.js"></script> | 35 | <script src="{{ poche_url }}themes/default/js/closeMessage.js"></script> |
35 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> | 36 | <script src="{{ poche_url }}themes/_global/js/saveLink.js"></script> |
37 | <script src="{{ poche_url }}themes/_global/js/keyboard.js"></script> | ||
36 | <script src="{{ poche_url }}themes/_global/js/popupForm.js"></script> | 38 | <script src="{{ poche_url }}themes/_global/js/popupForm.js"></script> |
diff --git a/themes/default/view.twig b/themes/default/view.twig index 0d4ec174..57d25965 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig | |||
@@ -5,7 +5,7 @@ | |||
5 | {% include '_pocheit-form.twig' %} | 5 | {% include '_pocheit-form.twig' %} |
6 | <div id="article_toolbar"> | 6 | <div id="article_toolbar"> |
7 | <ul> | 7 | <ul> |
8 | {% if navigate.previous %}<li><a href="./?view=view&id={{ navigate.previousid|e }}" class="tool previous"><span>{% trans "Previous Article" %}</span></a></li>{% endif %} | 8 | {% if navigate.next %}<li><a href="./?view=view&id={{ navigate.nextid|e }}" class="tool previous"><span>{% trans "Next Article" %}</span></a></li>{% endif %} |
9 | <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li> | 9 | <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li> |
10 | <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li> | 10 | <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li> |
11 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link"><span>{{ entry.url | e | getDomain }}</span></a></li> | 11 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link"><span>{{ entry.url | e | getDomain }}</span></a></li> |
@@ -27,7 +27,7 @@ | |||
27 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | 27 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} |
28 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display"><span>{% trans "Does this article appear wrong?" %}</span></a></li> | 28 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display"><span>{% trans "Does this article appear wrong?" %}</span></a></li> |
29 | {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %} | 29 | {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %} |
30 | {% if navigate.next %}<li><a href="./?view=view&id={{ navigate.nextid|e }}" class="tool next"><span>{% trans "Next Article" %}</span></a></li>{% endif %} | 30 | {% if navigate.previous %}<li><a href="./?view=view&id={{ navigate.previousid|e }}" class="tool next"><span>{% trans "Previous Article" %}</span></a></li>{% endif %} |
31 | </ul> | 31 | </ul> |
32 | </div> | 32 | </div> |
33 | <div id="article"> | 33 | <div id="article"> |
@@ -125,5 +125,17 @@ | |||
125 | $('#article_toolbar .tool.top').parent().hide(); | 125 | $('#article_toolbar .tool.top').parent().hide(); |
126 | } | 126 | } |
127 | }); | 127 | }); |
128 | |||
129 | // Use left and right arrow to navigate on with keyboard | ||
130 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); | ||
131 | |||
132 | // swipe to right or left on mobile to navigate | ||
133 | $('article').on("swiperight", function(){ | ||
134 | goLeft('?view=view&id={{ navigate.nextid|e }}'); | ||
135 | }); | ||
136 | $('article').on("swipeleft", function(){ | ||
137 | goRight('?view=view&id={{ navigate.previousid|e }}'); | ||
138 | }); | ||
139 | |||
128 | </script> | 140 | </script> |
129 | {% endblock %} | 141 | {% endblock %} |