aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes/default
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2014-04-22 20:18:46 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2014-04-22 20:18:46 +0200
commitd70dd7ac698a1f9e90c97fa7eb7b113bf84304fc (patch)
tree69c330e97e3de60dd6884ded76766426a598f30e /themes/default
parentdfff18f81b04e4f66890c37dc2a7bc0537fd0b1b (diff)
parent43c7b978c31bcbf9e8e5202ecbb7b6fccba6a7fa (diff)
downloadwallabag-d70dd7ac698a1f9e90c97fa7eb7b113bf84304fc.tar.gz
wallabag-d70dd7ac698a1f9e90c97fa7eb7b113bf84304fc.tar.zst
wallabag-d70dd7ac698a1f9e90c97fa7eb7b113bf84304fc.zip
Merge pull request #653 from mariroz/dev
print view fixed in baggy; print link added; read percent added in default theme; archive and favorite re-factored to be ajax action in article view
Diffstat (limited to 'themes/default')
-rwxr-xr-x[-rw-r--r--]themes/default/css/style-default.css4
-rwxr-xr-xthemes/default/css/style.css13
-rwxr-xr-xthemes/default/img/default/print.pngbin0 -> 321 bytes
-rwxr-xr-xthemes/default/view.twig64
4 files changed, 78 insertions, 3 deletions
diff --git a/themes/default/css/style-default.css b/themes/default/css/style-default.css
index 9dc7c0b0..889a9f5c 100644..100755
--- a/themes/default/css/style-default.css
+++ b/themes/default/css/style-default.css
@@ -52,4 +52,8 @@ a.link span {
52 52
53a.bad-display span { 53a.bad-display span {
54 background-image: url('../img/default/bad-display.png'); 54 background-image: url('../img/default/bad-display.png');
55}
56
57a.print span {
58 background-image: url('../img/default/print.png');
55} \ No newline at end of file 59} \ No newline at end of file
diff --git a/themes/default/css/style.css b/themes/default/css/style.css
index e536ac6b..11a8ea1c 100755
--- a/themes/default/css/style.css
+++ b/themes/default/css/style.css
@@ -331,7 +331,8 @@ a.email span,
331a.delete span, 331a.delete span,
332a.link span, 332a.link span,
333a.bad-display span, 333a.bad-display span,
334a.reading-time span { 334a.reading-time span,
335a.print span {
335 background-repeat: no-repeat; 336 background-repeat: no-repeat;
336} 337}
337 338
@@ -402,3 +403,13 @@ a#bagit-form-close {
402.opacity03 { 403.opacity03 {
403 /*opacity: 0.3;*/ 404 /*opacity: 0.3;*/
404} 405}
406
407#readLeftPercent {
408 display: inline-block;
409 /* Show textual content */
410 overflow: visible;
411 text-align: left;
412 text-indent: 0;
413 color: black;
414 width: 50px;
415} \ No newline at end of file
diff --git a/themes/default/img/default/print.png b/themes/default/img/default/print.png
new file mode 100755
index 00000000..83d6445b
--- /dev/null
+++ b/themes/default/img/default/print.png
Binary files differ
diff --git a/themes/default/view.twig b/themes/default/view.twig
index cc491c77..983cc1cd 100755
--- a/themes/default/view.twig
+++ b/themes/default/view.twig
@@ -7,14 +7,16 @@
7 <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li> 7 <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li>
8 <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li> 8 <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li>
9 <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> 9 <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>
10 <li><a title="{% trans "Mark as read" %}" class="tool {% 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> 10 <li><a title="{% trans "Mark as read" %}" class="tool {% 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>
11 <li><a title="{% trans "Favorite" %}" class="tool {% 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> 11 <li><a title="{% trans "Favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans "Toggle favorite" %}</span></a></li>
12 <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> 12 <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li>
13 {% 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" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %} 13 {% 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" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %}
14 {% 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" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %} 14 {% 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" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %}
15 {% 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 %} 15 {% 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('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool 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 %} 16 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool 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('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %}
17 <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"><span>{% trans "Does this article appear wrong?" %}</span></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"><span>{% trans "Does this article appear wrong?" %}</span></a></li>
19 {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %}
18 </ul> 20 </ul>
19 </div> 21 </div>
20 <div id="article"> 22 <div id="article">
@@ -34,6 +36,60 @@
34 <script src="{{ poche_url }}themes/{{theme}}/js/restoreScroll.js"></script> 36 <script src="{{ poche_url }}themes/{{theme}}/js/restoreScroll.js"></script>
35 <script type="text/javascript"> 37 <script type="text/javascript">
36 $(document).ready(function() { 38 $(document).ready(function() {
39
40 // toggle read property of current article
41 $('#markAsRead').click(function(){
42 $("body").css("cursor", "wait");
43 $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done(
44 function( data ) {
45 if ( data == '1' ) {
46 if ( $('#markAsRead').hasClass("archive-off") ) {
47 $('#markAsRead').removeClass("archive-off");
48 $('#markAsRead').addClass("archive");
49 }
50 else {
51 $('#markAsRead').removeClass("archive");
52 $('#markAsRead').addClass("archive-off");
53 }
54 }
55 else {
56 alert('Error! Pls check if you are logged in.');
57 }
58 });
59 $("body").css("cursor", "auto");
60 });
61
62 // toggle favorite property of current article
63 $('#setFav').click(function(){
64 $("body").css("cursor", "wait");
65 $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done(
66 function( data ) {
67 if ( data == '1' ) {
68 if ( $('#setFav').hasClass("fav-off") ) {
69 $('#setFav').removeClass("fav-off");
70 $('#setFav').addClass("fav");
71 }
72 else {
73 $('#setFav').removeClass("fav");
74 $('#setFav').addClass("fav-off");
75 }
76 }
77 else {
78 alert('Error! Pls check if you are logged in.');
79 }
80 });
81 $("body").css("cursor", "auto");
82 });
83
84 // set percent of read on startup
85 if ( $(document).height() <= $(window).innerHeight() ) {
86 pp = 100;
87 }
88 else {
89 pp = 0;
90 }
91 $('#readLeftPercent').text( pp + '%' );
92
37 93
38 $(window).scroll(function(e){ 94 $(window).scroll(function(e){
39 var scrollTop = $(window).scrollTop(); 95 var scrollTop = $(window).scrollTop();
@@ -41,6 +97,10 @@
41 var scrollPercent = (scrollTop) / (docHeight); 97 var scrollPercent = (scrollTop) / (docHeight);
42 var scrollPercentRounded = Math.round(scrollPercent*100)/100; 98 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
43 savePercent({{ entry.id|e }}, scrollPercentRounded); 99 savePercent({{ entry.id|e }}, scrollPercentRounded);
100
101 // change percent of read on scroll
102 pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() ));
103 $('#readLeftPercent').text( pp + '%' );
44 }); 104 });
45 105
46 retrievePercent({{ entry.id|e }}); 106 retrievePercent({{ entry.id|e }});