diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-05-29 18:54:06 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-05-29 18:54:06 +0200 |
commit | a9f5e572dde4f986a498d2fbe92a38a1b22f9595 (patch) | |
tree | 80b5bfc9836ae92cc4929a4d72ae0b2730e568bc /themes/default | |
parent | 96834a47b09985e1c82b82857fc108f20e8b8f2b (diff) | |
parent | 8038b38802769031e050c753fc0a388a2276629e (diff) | |
download | wallabag-a9f5e572dde4f986a498d2fbe92a38a1b22f9595.tar.gz wallabag-a9f5e572dde4f986a498d2fbe92a38a1b22f9595.tar.zst wallabag-a9f5e572dde4f986a498d2fbe92a38a1b22f9595.zip |
Merge pull request #712 from wallabag/dev1.7.0
1.7, call me "Premium version"
Diffstat (limited to 'themes/default')
-rwxr-xr-x[-rw-r--r--] | themes/default/_search-form.twig | 14 | ||||
-rwxr-xr-x | themes/default/config.twig | 37 | ||||
-rwxr-xr-x[-rw-r--r--] | themes/default/css/style-default.css | 4 | ||||
-rwxr-xr-x | themes/default/css/style.css | 34 | ||||
-rwxr-xr-x | themes/default/home.twig | 9 | ||||
-rwxr-xr-x | themes/default/img/default/print.png | bin | 0 -> 321 bytes | |||
-rwxr-xr-x | themes/default/js/saveLink.js | 2 | ||||
-rwxr-xr-x | themes/default/view.twig | 65 |
8 files changed, 144 insertions, 21 deletions
diff --git a/themes/default/_search-form.twig b/themes/default/_search-form.twig index 74f420d0..33bea20d 100644..100755 --- a/themes/default/_search-form.twig +++ b/themes/default/_search-form.twig | |||
@@ -7,17 +7,3 @@ | |||
7 | </p> | 7 | </p> |
8 | </form> | 8 | </form> |
9 | </div> | 9 | </div> |
10 | <script type="text/javascript"> | ||
11 | $(document).ready(function() { | ||
12 | |||
13 | $("#search-form").hide(); | ||
14 | |||
15 | $("#search").click(function(){ | ||
16 | $("#search-form").toggle(); | ||
17 | $("#search").toggleClass("current"); | ||
18 | $("#search-arrow").toggleClass("arrow-down"); | ||
19 | }); | ||
20 | |||
21 | |||
22 | }); | ||
23 | </script> \ No newline at end of file | ||
diff --git a/themes/default/config.twig b/themes/default/config.twig index bb39dea2..160f6046 100755 --- a/themes/default/config.twig +++ b/themes/default/config.twig | |||
@@ -126,4 +126,41 @@ | |||
126 | 126 | ||
127 | <h2>{% trans "Cache" %}</h2> | 127 | <h2>{% trans "Cache" %}</h2> |
128 | <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p> | 128 | <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p> |
129 | |||
130 | <h2>{% trans "Fancy an E-Book ?" %}</h2> | ||
131 | <p>{% trans "Click on <a href=\"./?epub&method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %} | ||
132 | <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p> | ||
133 | |||
134 | <h2>{% trans 'Add user' %}</h2> | ||
135 | <p>{% trans 'Add a new user :' %}</p> | ||
136 | <form method="post" action="?newuser"> | ||
137 | <fieldset class="w500p"> | ||
138 | <div class="row"> | ||
139 | <label class="col w150p" for="newusername">{% trans 'Login for new user' %}</label> | ||
140 | <input class="col" type="text" id="newusername" name="newusername" placeholder="{% trans 'Login' %}"> | ||
141 | </div> | ||
142 | <div class="row"> | ||
143 | <label class="col w150p" for="password4newuser">{% trans "Password for new user" %}</label> | ||
144 | <input class="col" type="password" id="password4newuser" name="password4newuser" placeholder="{% trans "Password" %}"> | ||
145 | </div> | ||
146 | <div class="row mts txtcenter"> | ||
147 | <button type="submit">{% trans "Send" %}</button> | ||
148 | </div> | ||
149 | </fieldset> | ||
150 | </form> | ||
151 | |||
152 | <h2>{% trans "Delete account" %}</h2> | ||
153 | {% if not only_user %}<form method="post" action="?deluser"> | ||
154 | <p>{% trans "You can delete your account by entering your password and validating." %}<br /><b>{% trans "Be careful, data will be erased forever (that is a very long time)." %}</b></p> | ||
155 | <fieldset class="w500p"> | ||
156 | <div class="row"> | ||
157 | <label class="col w150p" for="password4deletinguser">{% trans "Type here your password" %}</label> | ||
158 | <input class="col" type="password" id="password4deletinguser" name="password4deletinguser" placeholder="{% trans "Password" %}"> | ||
159 | </div> | ||
160 | <div class="row mts txtcenter"> | ||
161 | <button type="submit">{% trans "Send" %}</button> | ||
162 | </div> | ||
163 | </form> | ||
164 | {% else %}<p>{% trans "You are the only user, you cannot delete your own account." %}<br /> | ||
165 | {% trans "To completely remove wallabag, delete the wallabag folder on your web server." %}</p>{% endif %} | ||
129 | {% endblock %} | 166 | {% endblock %} |
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 | ||
53 | a.bad-display span { | 53 | a.bad-display span { |
54 | background-image: url('../img/default/bad-display.png'); | 54 | background-image: url('../img/default/bad-display.png'); |
55 | } | ||
56 | |||
57 | a.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..e58ef81a 100755 --- a/themes/default/css/style.css +++ b/themes/default/css/style.css | |||
@@ -331,7 +331,8 @@ a.email span, | |||
331 | a.delete span, | 331 | a.delete span, |
332 | a.link span, | 332 | a.link span, |
333 | a.bad-display span, | 333 | a.bad-display span, |
334 | a.reading-time span { | 334 | a.reading-time span, |
335 | a.print span { | ||
335 | background-repeat: no-repeat; | 336 | background-repeat: no-repeat; |
336 | } | 337 | } |
337 | 338 | ||
@@ -383,8 +384,8 @@ a#bagit-form-close { | |||
383 | background-color: #000; | 384 | background-color: #000; |
384 | color: #fff; | 385 | color: #fff; |
385 | padding: 0 4px 1px 3px; | 386 | padding: 0 4px 1px 3px; |
386 | font-weight: bold; | 387 | font-weight: bold; |
387 | font-size: 0.7em; | 388 | font-size: 0.7em; |
388 | border-radius: 4px; | 389 | border-radius: 4px; |
389 | } | 390 | } |
390 | .add-to-wallabag-link-after:hover, .add-to-wallabag-link-after:active { | 391 | .add-to-wallabag-link-after:hover, .add-to-wallabag-link-after:active { |
@@ -393,6 +394,23 @@ a#bagit-form-close { | |||
393 | .add-to-wallabag-link-after:visited { | 394 | .add-to-wallabag-link-after:visited { |
394 | color: #999; | 395 | color: #999; |
395 | } | 396 | } |
397 | a.add-to-wallabag-link-after { | ||
398 | visibility: hidden; | ||
399 | position: absolute; | ||
400 | opacity: 0; | ||
401 | transition-duration: 2s; | ||
402 | transition-timing-function: ease-out; | ||
403 | } | ||
404 | #article article a:hover + a.add-to-wallabag-link-after, a.add-to-wallabag-link-after:hover { | ||
405 | opacity: 1; | ||
406 | visibility: visible; | ||
407 | transition-duration: .3s; | ||
408 | transition-timing-function: ease-in; | ||
409 | } | ||
410 | a.add-to-wallabag-link-after:after { | ||
411 | content: "w"; | ||
412 | } | ||
413 | |||
396 | 414 | ||
397 | #add-link-result { | 415 | #add-link-result { |
398 | display: inline; | 416 | display: inline; |
@@ -402,3 +420,13 @@ a#bagit-form-close { | |||
402 | .opacity03 { | 420 | .opacity03 { |
403 | /*opacity: 0.3;*/ | 421 | /*opacity: 0.3;*/ |
404 | } | 422 | } |
423 | |||
424 | #readLeftPercent { | ||
425 | display: inline-block; | ||
426 | /* Show textual content */ | ||
427 | overflow: visible; | ||
428 | text-align: left; | ||
429 | text-indent: 0; | ||
430 | color: black; | ||
431 | width: 50px; | ||
432 | } \ No newline at end of file | ||
diff --git a/themes/default/home.twig b/themes/default/home.twig index d6cb98e8..e6c781f5 100755 --- a/themes/default/home.twig +++ b/themes/default/home.twig | |||
@@ -55,7 +55,14 @@ | |||
55 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | 55 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> |
56 | </div> | 56 | </div> |
57 | {% endfor %} | 57 | {% endfor %} |
58 | {% endif %} | 58 | |
59 | {{ block('pager') }} | 59 | {{ block('pager') }} |
60 | |||
60 | {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "mark all the entries as read" %}" href="./?action=archive_all">{% trans "mark all the entries as read" %}</a>{% endif %}{% endif %} | 61 | {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "mark all the entries as read" %}" href="./?action=archive_all">{% trans "mark all the entries as read" %}</a>{% endif %}{% endif %} |
62 | |||
63 | {% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&method=tag&tag={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a> | ||
64 | {% elseif search_term is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&method=search&search={{ search_term }}">{% trans "Download the articles from this search in an epub" %}</a> | ||
65 | {% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&method=category&category={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %} | ||
66 | |||
67 | {% endif %} | ||
61 | {% endblock %} | 68 | {% endblock %} |
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/js/saveLink.js b/themes/default/js/saveLink.js index bee453c0..6dbce97e 100755 --- a/themes/default/js/saveLink.js +++ b/themes/default/js/saveLink.js | |||
@@ -88,7 +88,7 @@ $.fn.ready(function() { | |||
88 | ========================================================================== */ | 88 | ========================================================================== */ |
89 | 89 | ||
90 | $("article a[href^='http']").after(function() { | 90 | $("article a[href^='http']").after(function() { |
91 | return " <a href=\"" + $(this).attr('href') + "\" class=\"add-to-wallabag-link-after\" alt=\"add to wallabag\" title=\"add to wallabag\">w</a> "; | 91 | return " <a href=\"" + $(this).attr('href') + "\" class=\"add-to-wallabag-link-after\" alt=\"add to wallabag\" title=\"add to wallabag\"></a> "; |
92 | }); | 92 | }); |
93 | 93 | ||
94 | $(".add-to-wallabag-link-after").click(function(event){ | 94 | $(".add-to-wallabag-link-after").click(function(event){ |
diff --git a/themes/default/view.twig b/themes/default/view.twig index cc491c77..b7d48c00 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig | |||
@@ -7,14 +7,17 @@ | |||
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&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&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&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> | 12 | <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&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 }}&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 }}&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 }}&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 }}&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 %} | ||
18 | <li><a href="./?epub&method=id&id={{ entry.id|e }}" title="Generate epub file">EPUB</a></li> | ||
17 | <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> | 19 | <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> |
20 | {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %} | ||
18 | </ul> | 21 | </ul> |
19 | </div> | 22 | </div> |
20 | <div id="article"> | 23 | <div id="article"> |
@@ -34,6 +37,60 @@ | |||
34 | <script src="{{ poche_url }}themes/{{theme}}/js/restoreScroll.js"></script> | 37 | <script src="{{ poche_url }}themes/{{theme}}/js/restoreScroll.js"></script> |
35 | <script type="text/javascript"> | 38 | <script type="text/javascript"> |
36 | $(document).ready(function() { | 39 | $(document).ready(function() { |
40 | |||
41 | // toggle read property of current article | ||
42 | $('#markAsRead').click(function(){ | ||
43 | $("body").css("cursor", "wait"); | ||
44 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | ||
45 | function( data ) { | ||
46 | if ( data == '1' ) { | ||
47 | if ( $('#markAsRead').hasClass("archive-off") ) { | ||
48 | $('#markAsRead').removeClass("archive-off"); | ||
49 | $('#markAsRead').addClass("archive"); | ||
50 | } | ||
51 | else { | ||
52 | $('#markAsRead').removeClass("archive"); | ||
53 | $('#markAsRead').addClass("archive-off"); | ||
54 | } | ||
55 | } | ||
56 | else { | ||
57 | alert('Error! Pls check if you are logged in.'); | ||
58 | } | ||
59 | }); | ||
60 | $("body").css("cursor", "auto"); | ||
61 | }); | ||
62 | |||
63 | // toggle favorite property of current article | ||
64 | $('#setFav').click(function(){ | ||
65 | $("body").css("cursor", "wait"); | ||
66 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | ||
67 | function( data ) { | ||
68 | if ( data == '1' ) { | ||
69 | if ( $('#setFav').hasClass("fav-off") ) { | ||
70 | $('#setFav').removeClass("fav-off"); | ||
71 | $('#setFav').addClass("fav"); | ||
72 | } | ||
73 | else { | ||
74 | $('#setFav').removeClass("fav"); | ||
75 | $('#setFav').addClass("fav-off"); | ||
76 | } | ||
77 | } | ||
78 | else { | ||
79 | alert('Error! Pls check if you are logged in.'); | ||
80 | } | ||
81 | }); | ||
82 | $("body").css("cursor", "auto"); | ||
83 | }); | ||
84 | |||
85 | // set percent of read on startup | ||
86 | if ( $(document).height() <= $(window).innerHeight() ) { | ||
87 | pp = 100; | ||
88 | } | ||
89 | else { | ||
90 | pp = 0; | ||
91 | } | ||
92 | $('#readLeftPercent').text( pp + '%' ); | ||
93 | |||
37 | 94 | ||
38 | $(window).scroll(function(e){ | 95 | $(window).scroll(function(e){ |
39 | var scrollTop = $(window).scrollTop(); | 96 | var scrollTop = $(window).scrollTop(); |
@@ -41,6 +98,10 @@ | |||
41 | var scrollPercent = (scrollTop) / (docHeight); | 98 | var scrollPercent = (scrollTop) / (docHeight); |
42 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | 99 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; |
43 | savePercent({{ entry.id|e }}, scrollPercentRounded); | 100 | savePercent({{ entry.id|e }}, scrollPercentRounded); |
101 | |||
102 | // change percent of read on scroll | ||
103 | pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() )); | ||
104 | $('#readLeftPercent').text( pp + '%' ); | ||
44 | }); | 105 | }); |
45 | 106 | ||
46 | retrievePercent({{ entry.id|e }}); | 107 | retrievePercent({{ entry.id|e }}); |