aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes
diff options
context:
space:
mode:
authorThomas LEBEAU <thomas.lebeau@g-nova.fr>2014-03-08 13:47:15 +0100
committerThomas LEBEAU <thomas.lebeau@g-nova.fr>2014-03-08 13:47:15 +0100
commit4744cb0e1df8ee7c1cd10c9fbd67caec73051024 (patch)
tree0f67fff421a82bbfe4cc7cdc09fb54a61ce9ee53 /themes
parentb3f7b7d200dfb56334dd68135750739c3c55b05a (diff)
downloadwallabag-4744cb0e1df8ee7c1cd10c9fbd67caec73051024.tar.gz
wallabag-4744cb0e1df8ee7c1cd10c9fbd67caec73051024.tar.zst
wallabag-4744cb0e1df8ee7c1cd10c9fbd67caec73051024.zip
bagit link + overlay save link + listmode
Diffstat (limited to 'themes')
-rw-r--r--themes/baggy/_menu.twig2
-rwxr-xr-xthemes/baggy/_pocheit-form.twig8
-rwxr-xr-xthemes/baggy/css/main.css48
-rwxr-xr-xthemes/baggy/home.twig2
-rwxr-xr-xthemes/baggy/js/init.js71
5 files changed, 107 insertions, 24 deletions
diff --git a/themes/baggy/_menu.twig b/themes/baggy/_menu.twig
index e9cd9d4a..7dd799f9 100644
--- a/themes/baggy/_menu.twig
+++ b/themes/baggy/_menu.twig
@@ -4,7 +4,7 @@
4 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> 4 <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
5 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> 5 <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
6 <li><a href="./?view=tags" {% if view == 'tags' %}class="current"{% endif %}>{% trans "tags" %}</a></li> 6 <li><a href="./?view=tags" {% if view == 'tags' %}class="current"{% endif %}>{% trans "tags" %}</a></li>
7 <li><a href="javascript: void(null);" id="pocheit">{% trans "save a link" %}</a></li> 7 <li><a href="javascript: void(null);" id="bagit">{% trans "save a link" %}</a></li>
8 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> 8 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
9 <li><a class="icon icon-power" href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> 9 <li><a class="icon icon-power" href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
10 </ul> 10 </ul>
diff --git a/themes/baggy/_pocheit-form.twig b/themes/baggy/_pocheit-form.twig
new file mode 100755
index 00000000..3c4a4d6e
--- /dev/null
+++ b/themes/baggy/_pocheit-form.twig
@@ -0,0 +1,8 @@
1<div id="bagit-form" class="messages info">
2
3 <form method="get" action="index.php">
4 <h2>{% trans "Save a link" %}</h2>
5 <input required placeholder="example.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
6 <input type="submit" value="{% trans "save link!" %}" />
7 </form>
8</div>
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css
index fe77a967..586501b0 100755
--- a/themes/baggy/css/main.css
+++ b/themes/baggy/css/main.css
@@ -173,7 +173,7 @@ h2:after {
173#links { 173#links {
174 position: fixed; 174 position: fixed;
175 top: 0; 175 top: 0;
176 width: 9em; 176 width: 10em;
177 left: 0; 177 left: 0;
178 text-align: right; 178 text-align: right;
179 background: #333; 179 background: #333;
@@ -184,7 +184,7 @@ h2:after {
184} 184}
185 185
186#main { 186#main {
187 margin-left: 12em; 187 margin-left: 13em;
188 position: relative; 188 position: relative;
189 z-index: 10; 189 z-index: 10;
190 padding-right: 5%; 190 padding-right: 5%;
@@ -228,7 +228,7 @@ h2:after {
228 #links li:last-child { 228 #links li:last-child {
229 position: fixed; 229 position: fixed;
230 bottom: 1em; 230 bottom: 1em;
231 width: 9em; 231 width: 10em;
232 } 232 }
233 233
234 #links li:last-child a:before { 234 #links li:last-child a:before {
@@ -322,6 +322,15 @@ footer a {
322 letter-spacing:-5px; 322 letter-spacing:-5px;
323} 323}
324 324
325.listmode .entrie {
326 width: 100%!important;
327 margin-left: 0!important;
328}
329
330.listmode .entrie p {
331 display: none;
332}
333
325.list-entries + .results { 334.list-entries + .results {
326 margin-bottom: 2em; 335 margin-bottom: 2em;
327} 336}
@@ -343,10 +352,10 @@ footer a {
343 letter-spacing:normal; 352 letter-spacing:normal;
344 box-shadow: 0 3px 7px rgba(0,0,0,0.3); 353 box-shadow: 0 3px 7px rgba(0,0,0,0.3);
345 display: inline-block; 354 display: inline-block;
346 width: 32%; 355 width: 32%!important;
347 margin-bottom: 1.5em; 356 margin-bottom: 1.5em;
348 vertical-align: top; 357 vertical-align: top;
349 margin-left: 1.5%; 358 margin-left: 1.5%!important;
350 position: relative; 359 position: relative;
351 overflow: hidden; 360 overflow: hidden;
352 padding: 1.5em 1.5em 3em 1.5em; 361 padding: 1.5em 1.5em 3em 1.5em;
@@ -481,7 +490,7 @@ footer a {
481 } 490 }
482 491
483.entrie:nth-child(3n+1) { 492.entrie:nth-child(3n+1) {
484 margin-left: 0; 493 margin-left: 0!important;
485} 494}
486 495
487.results { 496.results {
@@ -525,6 +534,33 @@ footer a {
525 display: none; 534 display: none;
526} 535}
527 536
537#bagit-form {
538 background: rgba(0,0,0,0.8);
539 position: fixed;
540 top: 0;
541 left: 10em;
542 z-index: 20;
543 height: 100%;
544 width: 100%;
545 margin: 0;
546 padding: 2em;
547 display: none;
548}
549
550#bagit-form form {
551 background: #FFF;
552 position: absolute;
553 top: 50%;
554 left: 50%;
555 z-index: 20;
556 border: 10px solid #000;
557 width: 600px;
558 height: 300px;
559 margin: -150px 0 0 -300px;
560 padding: 2em;
561}
562
563
528/* ========================================================================== 564/* ==========================================================================
529 3 = Pictos 565 3 = Pictos
530 ========================================================================== */ 566 ========================================================================== */
diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig
index 7bc0472d..e34897fa 100755
--- a/themes/baggy/home.twig
+++ b/themes/baggy/home.twig
@@ -30,7 +30,7 @@
30 </div> 30 </div>
31 {% endif %} 31 {% endif %}
32 {% endblock %} 32 {% endblock %}
33 <div class="list-entries"> 33 <div id="list-entries" class="list-entries">
34 {% for entry in entries %} 34 {% for entry in entries %}
35 <div id="entry-{{ entry.id|e }}" class="entrie"{% if listmode %} style="width:100%; margin-left:0;"{% endif %}> 35 <div id="entry-{{ entry.id|e }}" class="entrie"{% if listmode %} style="width:100%; margin-left:0;"{% endif %}>
36 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> 36 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
diff --git a/themes/baggy/js/init.js b/themes/baggy/js/init.js
index 4a843548..99bffd09 100755
--- a/themes/baggy/js/init.js
+++ b/themes/baggy/js/init.js
@@ -1,36 +1,75 @@
1$(document).ready(function() { 1$.fn.ready(function() {
2
3 var $listmode = $('#listmode'),
4 $listentries = $("#list-entries"),
5 $bagit = $('#bagit'),
6 $bagitForm = $('#bagit-form');
7
8 /* ==========================================================================
9 Menu
10 ========================================================================== */
2 11
3 $("#menu").click(function(){ 12 $("#menu").click(function(){
4 $("#links").toggle(); 13 $("#links").toggle();
5 }); 14 });
6 15
16 /* ==========================================================================
17 List mode or Table Mode
18 ========================================================================== */
7 19
8 $("#listmode").click(function(){ 20 $listmode.click(function(){
9 if ( $.cookie("listmode") == 1 ) { 21 if ( $.cookie("listmode") == 1 ) {
10 $(".entrie").css("width", ""); 22 // Cookie
11 $(".entrie").css("margin-left", "");
12
13 $.removeCookie("listmode"); 23 $.removeCookie("listmode");
14 $("#listmode").removeClass("tablemode"); 24
15 $("#listmode").addClass("listmode"); 25 $listentries.removeClass("listmode");
26 $listmode.removeClass("tablemode");
27 $listmode.addClass("listmode");
16 } 28 }
17 else { 29 else {
30 // Cookie
18 $.cookie("listmode", 1, {expires: 365}); 31 $.cookie("listmode", 1, {expires: 365});
19 32
20 $(".entrie").css("width", "100%"); 33 $listentries.addClass("listmode");
21 $(".entrie").css("margin-left", "0"); 34 $listmode.removeClass("listmode");
22 $("#listmode").removeClass("listmode"); 35 $listmode.addClass("tablemode");
23 $("#listmode").addClass("tablemode");
24 } 36 }
25 37
26 }); 38 });
27 39
40 /* ==========================================================================
41 Cookie listmode
42 ========================================================================== */
43
28 if ( $.cookie("listmode") == 1 ) { 44 if ( $.cookie("listmode") == 1 ) {
29 $(".entrie").css("width", "100%"); 45 $listentries.addClass("listmode");
30 $(".entrie").css("margin-left", "0"); 46 $listmode.removeClass("listmode");
31 $("#listmode").removeClass("listmode"); 47 $listmode.addClass("tablemode");
32 $("#listmode").addClass("tablemode");
33 } 48 }
34 49
50 /* ==========================================================================
51 bag it link
52 ========================================================================== */
53
54 $bagit.click(function(){
55 $bagitForm.toggle();
56 });
57
58 /* ==========================================================================
59 Keyboard gestion
60 ========================================================================== */
61
62 $(window).keydown(function(e){
63 switch (e.keyCode) {
64 // s letter
65 case 83:
66 $bagitForm.toggle();
67 break;
68 case 27:
69 $bagitForm.hide();
70 break;
71 }
72 })
73
35 74
36}); 75}); \ No newline at end of file