diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-02-27 15:20:01 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-02-27 15:20:01 +0100 |
commit | 61e79d934495ee24bb824e4c26b534ef9cd7fec3 (patch) | |
tree | 66f57690221a5ba3077d06d8553b8f1074b12171 /themes/baggy | |
parent | a8464c97197c1ea9c4b3c35d7cec6a5398b7a522 (diff) | |
parent | 36a733af8dee1de5a0f81f1efe70e96a435b6a17 (diff) | |
download | wallabag-61e79d934495ee24bb824e4c26b534ef9cd7fec3.tar.gz wallabag-61e79d934495ee24bb824e4c26b534ef9cd7fec3.tar.zst wallabag-61e79d934495ee24bb824e4c26b534ef9cd7fec3.zip |
Merge pull request #510 from mariroz/dev
some baggy theme fixes and enhancement: issue #479
Diffstat (limited to 'themes/baggy')
-rwxr-xr-x | themes/baggy/_display-mode.twig | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | themes/baggy/_head.twig | 1 | ||||
-rwxr-xr-x | themes/baggy/css/main.css | 67 | ||||
-rwxr-xr-x[-rw-r--r--] | themes/baggy/home.twig | 4 | ||||
-rwxr-xr-x | themes/baggy/img/baggy/blank.png | bin | 0 -> 141 bytes | |||
-rw-r--r-- | themes/baggy/img/baggy/down.png | bin | 0 -> 216 bytes | |||
-rwxr-xr-x | themes/baggy/img/baggy/list.png | bin | 0 -> 201 bytes | |||
-rwxr-xr-x | themes/baggy/img/baggy/table.png | bin | 0 -> 229 bytes | |||
-rw-r--r-- | themes/baggy/img/baggy/top.png | bin | 0 -> 212 bytes | |||
-rwxr-xr-x | themes/baggy/js/init.js | 44 | ||||
-rwxr-xr-x | themes/baggy/js/jquery.cookie.js | 117 |
11 files changed, 226 insertions, 12 deletions
diff --git a/themes/baggy/_display-mode.twig b/themes/baggy/_display-mode.twig new file mode 100755 index 00000000..31f76581 --- /dev/null +++ b/themes/baggy/_display-mode.twig | |||
@@ -0,0 +1,5 @@ | |||
1 | <div id="display-mode"> | ||
2 | <a href="javascript: void(null);" id="listmode" class="listmode"> | ||
3 | <img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/blank.png" alt="{% trans "toggle view mode" %}" title="{% trans "toggle view mode" %}" width="16" height="16"> | ||
4 | </a> | ||
5 | </div> | ||
diff --git a/themes/baggy/_head.twig b/themes/baggy/_head.twig index 206d5aae..1ea59abf 100644..100755 --- a/themes/baggy/_head.twig +++ b/themes/baggy/_head.twig | |||
@@ -8,5 +8,6 @@ | |||
8 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{theme}}/css/messages.css" media="all"> | 8 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{theme}}/css/messages.css" media="all"> |
9 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{theme}}/css/print.css" media="print"> | 9 | <link rel="stylesheet" href="{{ poche_url }}/themes/{{theme}}/css/print.css" media="print"> |
10 | <script src="{{ poche_url }}/themes/{{theme}}/js/jquery-2.0.3.min.js"></script> | 10 | <script src="{{ poche_url }}/themes/{{theme}}/js/jquery-2.0.3.min.js"></script> |
11 | <script src="{{ poche_url }}/themes/{{theme}}/js/jquery.cookie.js"></script> | ||
11 | <script src="{{ poche_url }}/themes/{{theme}}/js/init.js"></script> | 12 | <script src="{{ poche_url }}/themes/{{theme}}/js/init.js"></script> |
12 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/closeMessage.js"></script> | 13 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/closeMessage.js"></script> |
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 9a65dbee..fe77a967 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css | |||
@@ -177,7 +177,7 @@ h2:after { | |||
177 | left: 0; | 177 | left: 0; |
178 | text-align: right; | 178 | text-align: right; |
179 | background: #333; | 179 | background: #333; |
180 | padding-top: 9em; | 180 | padding-top: 9.5em; |
181 | height: 100%; | 181 | height: 100%; |
182 | box-shadow:inset -4px 0 20px rgba(0,0,0,0.6); | 182 | box-shadow:inset -4px 0 20px rgba(0,0,0,0.6); |
183 | z-index: 10; | 183 | z-index: 10; |
@@ -188,6 +188,7 @@ h2:after { | |||
188 | position: relative; | 188 | position: relative; |
189 | z-index: 10; | 189 | z-index: 10; |
190 | padding-right: 5%; | 190 | padding-right: 5%; |
191 | padding-bottom: 1em; | ||
191 | } | 192 | } |
192 | 193 | ||
193 | #links a { | 194 | #links a { |
@@ -237,6 +238,61 @@ h2:after { | |||
237 | } | 238 | } |
238 | 239 | ||
239 | 240 | ||
241 | #sort { | ||
242 | padding: 0; | ||
243 | list-style-type: none; | ||
244 | opacity: 0.5; | ||
245 | display: inline-block; | ||
246 | } | ||
247 | |||
248 | #sort li { | ||
249 | display: inline; | ||
250 | font-size: 0.9em; | ||
251 | } | ||
252 | |||
253 | #sort li + li { | ||
254 | margin-left: 10px; | ||
255 | } | ||
256 | |||
257 | #sort a { | ||
258 | padding: 2px 2px 0; | ||
259 | vertical-align: middle; | ||
260 | } | ||
261 | |||
262 | #sort img { | ||
263 | vertical-align: baseline; | ||
264 | } | ||
265 | #sort img:hover { | ||
266 | cursor: pointer; | ||
267 | } | ||
268 | |||
269 | #display-mode { | ||
270 | float: right; | ||
271 | vertical-align: middle; | ||
272 | margin-top: 10px; | ||
273 | margin-bottom: 10px; | ||
274 | opacity: 0.5; | ||
275 | } | ||
276 | #listmode { | ||
277 | width: 16px; | ||
278 | display: inline-block; | ||
279 | text-decoration: none; | ||
280 | } | ||
281 | #listmode a:hover { | ||
282 | opacity: 1; | ||
283 | } | ||
284 | .tablemode { | ||
285 | background-image: url("../img/baggy/table.png"); | ||
286 | background-repeat: no-repeat; | ||
287 | background-position: bottom; | ||
288 | } | ||
289 | .listmode { | ||
290 | background-image: url("../img/baggy/list.png"); | ||
291 | background-repeat: no-repeat; | ||
292 | background-position: bottom; | ||
293 | } | ||
294 | |||
295 | |||
240 | /* ========================================================================== | 296 | /* ========================================================================== |
241 | 2 = Layout | 297 | 2 = Layout |
242 | ========================================================================== */ | 298 | ========================================================================== */ |
@@ -248,7 +304,7 @@ h2:after { | |||
248 | 304 | ||
249 | footer { | 305 | footer { |
250 | text-align: right; | 306 | text-align: right; |
251 | position: fixed; | 307 | position: relative; |
252 | bottom: 0; | 308 | bottom: 0; |
253 | right: 5em; | 309 | right: 5em; |
254 | color: #999; | 310 | color: #999; |
@@ -732,6 +788,9 @@ blockquote { | |||
732 | width: 100%; | 788 | width: 100%; |
733 | margin-left: 0; | 789 | margin-left: 0; |
734 | } | 790 | } |
791 | #display-mode { | ||
792 | display: none; | ||
793 | } | ||
735 | } | 794 | } |
736 | 795 | ||
737 | @media screen and (max-width: 500px) { | 796 | @media screen and (max-width: 500px) { |
@@ -821,4 +880,8 @@ blockquote { | |||
821 | #article_toolbar a { | 880 | #article_toolbar a { |
822 | padding: 0.3em 0.4em 0.2em; | 881 | padding: 0.3em 0.4em 0.2em; |
823 | } | 882 | } |
883 | |||
884 | #display-mode { | ||
885 | display: none; | ||
886 | } | ||
824 | } | 887 | } |
diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig index 4f9db063..5262c05b 100644..100755 --- a/themes/baggy/home.twig +++ b/themes/baggy/home.twig | |||
@@ -18,6 +18,10 @@ | |||
18 | {% if entries is empty %} | 18 | {% if entries is empty %} |
19 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> | 19 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> |
20 | {% else %} | 20 | {% else %} |
21 | <div> | ||
22 | {% include '_display-mode.twig' %} | ||
23 | {% include '_sorting.twig' %} | ||
24 | </div> | ||
21 | {% block pager %} | 25 | {% block pager %} |
22 | {% if nb_results > 1 %} | 26 | {% if nb_results > 1 %} |
23 | <div class="results"> | 27 | <div class="results"> |
diff --git a/themes/baggy/img/baggy/blank.png b/themes/baggy/img/baggy/blank.png new file mode 100755 index 00000000..63e09844 --- /dev/null +++ b/themes/baggy/img/baggy/blank.png | |||
Binary files differ | |||
diff --git a/themes/baggy/img/baggy/down.png b/themes/baggy/img/baggy/down.png new file mode 100644 index 00000000..b9d536a7 --- /dev/null +++ b/themes/baggy/img/baggy/down.png | |||
Binary files differ | |||
diff --git a/themes/baggy/img/baggy/list.png b/themes/baggy/img/baggy/list.png new file mode 100755 index 00000000..bd5aff5a --- /dev/null +++ b/themes/baggy/img/baggy/list.png | |||
Binary files differ | |||
diff --git a/themes/baggy/img/baggy/table.png b/themes/baggy/img/baggy/table.png new file mode 100755 index 00000000..859c4cd8 --- /dev/null +++ b/themes/baggy/img/baggy/table.png | |||
Binary files differ | |||
diff --git a/themes/baggy/img/baggy/top.png b/themes/baggy/img/baggy/top.png new file mode 100644 index 00000000..954a8c0a --- /dev/null +++ b/themes/baggy/img/baggy/top.png | |||
Binary files differ | |||
diff --git a/themes/baggy/js/init.js b/themes/baggy/js/init.js index c1d3c0ec..4a843548 100755 --- a/themes/baggy/js/init.js +++ b/themes/baggy/js/init.js | |||
@@ -1,12 +1,36 @@ | |||
1 | document.addEventListener('DOMContentLoaded', function() { | 1 | $(document).ready(function() { |
2 | var menu = document.getElementById('menu'); | 2 | |
3 | 3 | $("#menu").click(function(){ | |
4 | menu.addEventListener('click', function(){ | 4 | $("#links").toggle(); |
5 | if(this.nextElementSibling.style.display === "block") { | 5 | }); |
6 | this.nextElementSibling.style.display = "none"; | 6 | |
7 | }else { | 7 | |
8 | this.nextElementSibling.style.display = "block"; | 8 | $("#listmode").click(function(){ |
9 | if ( $.cookie("listmode") == 1 ) { | ||
10 | $(".entrie").css("width", ""); | ||
11 | $(".entrie").css("margin-left", ""); | ||
12 | |||
13 | $.removeCookie("listmode"); | ||
14 | $("#listmode").removeClass("tablemode"); | ||
15 | $("#listmode").addClass("listmode"); | ||
9 | } | 16 | } |
10 | 17 | else { | |
18 | $.cookie("listmode", 1, {expires: 365}); | ||
19 | |||
20 | $(".entrie").css("width", "100%"); | ||
21 | $(".entrie").css("margin-left", "0"); | ||
22 | $("#listmode").removeClass("listmode"); | ||
23 | $("#listmode").addClass("tablemode"); | ||
24 | } | ||
25 | |||
11 | }); | 26 | }); |
12 | }); \ No newline at end of file | 27 | |
28 | if ( $.cookie("listmode") == 1 ) { | ||
29 | $(".entrie").css("width", "100%"); | ||
30 | $(".entrie").css("margin-left", "0"); | ||
31 | $("#listmode").removeClass("listmode"); | ||
32 | $("#listmode").addClass("tablemode"); | ||
33 | } | ||
34 | |||
35 | |||
36 | }); | ||
diff --git a/themes/baggy/js/jquery.cookie.js b/themes/baggy/js/jquery.cookie.js new file mode 100755 index 00000000..92719000 --- /dev/null +++ b/themes/baggy/js/jquery.cookie.js | |||
@@ -0,0 +1,117 @@ | |||
1 | /*! | ||
2 | * jQuery Cookie Plugin v1.4.0 | ||
3 | * https://github.com/carhartl/jquery-cookie | ||
4 | * | ||
5 | * Copyright 2013 Klaus Hartl | ||
6 | * Released under the MIT license | ||
7 | */ | ||
8 | (function (factory) { | ||
9 | if (typeof define === 'function' && define.amd) { | ||
10 | // AMD. Register as anonymous module. | ||
11 | define(['jquery'], factory); | ||
12 | } else { | ||
13 | // Browser globals. | ||
14 | factory(jQuery); | ||
15 | } | ||
16 | }(function ($) { | ||
17 | |||
18 | var pluses = /\+/g; | ||
19 | |||
20 | function encode(s) { | ||
21 | return config.raw ? s : encodeURIComponent(s); | ||
22 | } | ||
23 | |||
24 | function decode(s) { | ||
25 | return config.raw ? s : decodeURIComponent(s); | ||
26 | } | ||
27 | |||
28 | function stringifyCookieValue(value) { | ||
29 | return encode(config.json ? JSON.stringify(value) : String(value)); | ||
30 | } | ||
31 | |||
32 | function parseCookieValue(s) { | ||
33 | if (s.indexOf('"') === 0) { | ||
34 | // This is a quoted cookie as according to RFC2068, unescape... | ||
35 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); | ||
36 | } | ||
37 | |||
38 | try { | ||
39 | // Replace server-side written pluses with spaces. | ||
40 | // If we can't decode the cookie, ignore it, it's unusable. | ||
41 | s = decodeURIComponent(s.replace(pluses, ' ')); | ||
42 | } catch(e) { | ||
43 | return; | ||
44 | } | ||
45 | |||
46 | try { | ||
47 | // If we can't parse the cookie, ignore it, it's unusable. | ||
48 | return config.json ? JSON.parse(s) : s; | ||
49 | } catch(e) {} | ||
50 | } | ||
51 | |||
52 | function read(s, converter) { | ||
53 | var value = config.raw ? s : parseCookieValue(s); | ||
54 | return $.isFunction(converter) ? converter(value) : value; | ||
55 | } | ||
56 | |||
57 | var config = $.cookie = function (key, value, options) { | ||
58 | |||
59 | // Write | ||
60 | if (value !== undefined && !$.isFunction(value)) { | ||
61 | options = $.extend({}, config.defaults, options); | ||
62 | |||
63 | if (typeof options.expires === 'number') { | ||
64 | var days = options.expires, t = options.expires = new Date(); | ||
65 | t.setDate(t.getDate() + days); | ||
66 | } | ||
67 | |||
68 | return (document.cookie = [ | ||
69 | encode(key), '=', stringifyCookieValue(value), | ||
70 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE | ||
71 | options.path ? '; path=' + options.path : '', | ||
72 | options.domain ? '; domain=' + options.domain : '', | ||
73 | options.secure ? '; secure' : '' | ||
74 | ].join('')); | ||
75 | } | ||
76 | |||
77 | // Read | ||
78 | |||
79 | var result = key ? undefined : {}; | ||
80 | |||
81 | // To prevent the for loop in the first place assign an empty array | ||
82 | // in case there are no cookies at all. Also prevents odd result when | ||
83 | // calling $.cookie(). | ||
84 | var cookies = document.cookie ? document.cookie.split('; ') : []; | ||
85 | |||
86 | for (var i = 0, l = cookies.length; i < l; i++) { | ||
87 | var parts = cookies[i].split('='); | ||
88 | var name = decode(parts.shift()); | ||
89 | var cookie = parts.join('='); | ||
90 | |||
91 | if (key && key === name) { | ||
92 | // If second argument (value) is a function it's a converter... | ||
93 | result = read(cookie, value); | ||
94 | break; | ||
95 | } | ||
96 | |||
97 | // Prevent storing a cookie that we couldn't decode. | ||
98 | if (!key && (cookie = read(cookie)) !== undefined) { | ||
99 | result[name] = cookie; | ||
100 | } | ||
101 | } | ||
102 | |||
103 | return result; | ||
104 | }; | ||
105 | |||
106 | config.defaults = {}; | ||
107 | |||
108 | $.removeCookie = function (key, options) { | ||
109 | if ($.cookie(key) !== undefined) { | ||
110 | // Must not alter options, thus extending a fresh object... | ||
111 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); | ||
112 | return true; | ||
113 | } | ||
114 | return false; | ||
115 | }; | ||
116 | |||
117 | })); | ||