aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes/baggy/view.twig
diff options
context:
space:
mode:
Diffstat (limited to 'themes/baggy/view.twig')
-rwxr-xr-x[-rw-r--r--]themes/baggy/view.twig71
1 files changed, 68 insertions, 3 deletions
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig
index 4751c4cb..af97407d 100644..100755
--- a/themes/baggy/view.twig
+++ b/themes/baggy/view.twig
@@ -8,13 +8,15 @@
8 <ul class="links"> 8 <ul class="links">
9 <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> 9 <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>
10 <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> 10 <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>
11 <li><a title="{% trans "Mark as read" %}" class="tool icon icon-check {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans "Toggle mark as read" %}</span></a></li> 11 <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>
12 <li><a title="{% trans "Favorite" %}" class="tool icon icon-star {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "Toggle favorite" %}</span></a></li> 12 <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>
13 <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> 13 <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li>
14 {% 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 %} 14 {% 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 %}
15 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %} 15 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %}
16 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} 16 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
17 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span> ({{ flattr.numflattrs }})</a></li>{% endif %}{% endif %} 17 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span> ({{ flattr.numflattrs }})</a></li>{% endif %}{% endif %}
18 {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %}
19 <li><a href="./?epub&amp;method=id&amp;id={{ entry.id|e }}" title="Generate epub file">EPUB</a></li>
18 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;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> 20 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;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>
19 </ul> 21 </ul>
20 </div> 22 </div>
@@ -29,4 +31,67 @@
29 {{ content | raw }} 31 {{ content | raw }}
30 </article> 32 </article>
31 </div> 33 </div>
34 <script src="{{ poche_url }}themes/{{theme}}/js/restoreScroll.js"></script>
35 <script type="text/javascript">
36 $(document).ready(function() {
37
38 // toggle read property of current article
39 $('#markAsRead').click(function(){
40 $("body").css("cursor", "wait");
41 $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done(
42 function( data ) {
43 if ( data == '1' ) {
44 if ( $('#markAsRead').hasClass("archive-off") ) {
45 $('#markAsRead').removeClass("archive-off");
46 $('#markAsRead').addClass("archive");
47 }
48 else {
49 $('#markAsRead').removeClass("archive");
50 $('#markAsRead').addClass("archive-off");
51 }
52 }
53 else {
54 alert('Error! Pls check if you are logged in.');
55 }
56 });
57 $("body").css("cursor", "auto");
58 });
59
60 // toggle favorite property of current article
61 $('#setFav').click(function(){
62 $("body").css("cursor", "wait");
63 $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done(
64 function( data ) {
65 if ( data == '1' ) {
66 if ( $('#setFav').hasClass("fav-off") ) {
67 $('#setFav').removeClass("fav-off");
68 $('#setFav').addClass("fav");
69 }
70 else {
71 $('#setFav').removeClass("fav");
72 $('#setFav').addClass("fav-off");
73 }
74 }
75 else {
76 alert('Error! Pls check if you are logged in.');
77 }
78 });
79 $("body").css("cursor", "auto");
80 });
81
82 $(window).scroll(function(e){
83 var scrollTop = $(window).scrollTop();
84 var docHeight = $(document).height();
85 var scrollPercent = (scrollTop) / (docHeight);
86 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
87 savePercent({{ entry.id|e }}, scrollPercentRounded);
88 });
89
90 retrievePercent({{ entry.id|e }});
91
92 $(window).resize(function(){
93 retrievePercent({{ entry.id|e }});
94 });
95 });
96 </script>
32{% endblock %} 97{% endblock %}