aboutsummaryrefslogtreecommitdiffhomepage
path: root/themes/baggy
diff options
context:
space:
mode:
Diffstat (limited to 'themes/baggy')
-rwxr-xr-xthemes/baggy/_head.twig1
-rw-r--r--themes/baggy/_menu.twig5
-rwxr-xr-xthemes/baggy/_pocheit-form.twig10
-rw-r--r--themes/baggy/config.twig48
-rwxr-xr-xthemes/baggy/css/main.css104
-rwxr-xr-x[-rw-r--r--]themes/baggy/edit-tags.twig8
-rwxr-xr-xthemes/baggy/home.twig4
-rwxr-xr-xthemes/baggy/js/init.js120
-rwxr-xr-x[-rw-r--r--]themes/baggy/tags.twig2
-rw-r--r--themes/baggy/view.twig21
10 files changed, 283 insertions, 40 deletions
diff --git a/themes/baggy/_head.twig b/themes/baggy/_head.twig
index 1ea59abf..144bcaa6 100755
--- a/themes/baggy/_head.twig
+++ b/themes/baggy/_head.twig
@@ -8,6 +8,7 @@
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/{{ constant('DEFAULT_THEME') }}/js/autoClose.js"></script>
11 <script src="{{ poche_url }}/themes/{{theme}}/js/jquery.cookie.js"></script> 12 <script src="{{ poche_url }}/themes/{{theme}}/js/jquery.cookie.js"></script>
12 <script src="{{ poche_url }}/themes/{{theme}}/js/init.js"></script> 13 <script src="{{ poche_url }}/themes/{{theme}}/js/init.js"></script>
13 <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/closeMessage.js"></script> 14 <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/closeMessage.js"></script>
diff --git a/themes/baggy/_menu.twig b/themes/baggy/_menu.twig
index e9cd9d4a..5226728b 100644
--- a/themes/baggy/_menu.twig
+++ b/themes/baggy/_menu.twig
@@ -4,9 +4,10 @@
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 style="position: relative;"><a href="javascript: void(null);" id="bagit">{% trans "save a link" %}</a>
8 {% include '_pocheit-form.twig' %}
9 </li>
8 <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> 10 <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> 11 <li><a class="icon icon-power" href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
10 </ul> 12 </ul>
11 13
12 {% include '_pocheit-form.twig' %}
diff --git a/themes/baggy/_pocheit-form.twig b/themes/baggy/_pocheit-form.twig
new file mode 100755
index 00000000..505ec368
--- /dev/null
+++ b/themes/baggy/_pocheit-form.twig
@@ -0,0 +1,10 @@
1<div id="bagit-form" class="messages info">
2 <form method="get" action="index.php" target="_blank" id="bagit-form-form">
3 <h2><a href="javascript: void(null);" id="bagit-form-close">X</a>
4 {% trans "Save a link" %}</h2>
5 <input type="hidden" name="autoclose" value="1" />
6 <input required placeholder="example.com/article" class="addurl" id="plainurl" name="plainurl" type="url" />
7 <input type="submit" value="{% trans "save link!" %}" />
8 <div id="add-link-result"></div>
9 </form>
10</div>
diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig
index b37ac115..a13af0c8 100644
--- a/themes/baggy/config.twig
+++ b/themes/baggy/config.twig
@@ -8,10 +8,11 @@
8 <h2>{% trans "Saving articles" %}</h2> 8 <h2>{% trans "Saving articles" %}</h2>
9 <p>{% trans "There are several ways to save an article:" %} (<a href="http://doc.wallabag.org/" title="{% trans "read the documentation" %}">?</a>)</p> 9 <p>{% trans "There are several ways to save an article:" %} (<a href="http://doc.wallabag.org/" title="{% trans "read the documentation" %}">?</a>)</p>
10 <ul> 10 <ul>
11 <li>Firefox: <a href="https://addons.mozilla.org/firefox/addon/poche/" title="download the firefox extension">{% trans "download the extension" %}</a></li> 11 <li>Firefox: <a href="https://addons.mozilla.org/firefox/addon/wallabag/" title="download the firefox extension">{% trans "download the extension" %}</a></li>
12 <li>Chrome: <a href="http://doc.wallabag.org/doku.php?id=users:chrome_extension" title="download the chrome extension">{% trans "download the extension" %}</a></li> 12 <li>Chrome: <a href="http://doc.wallabag.org/doku.php?id=users:chrome_extension" title="download the chrome extension">{% trans "download the extension" %}</a></li>
13 <li>Android: <a href="https://f-droid.org/repository/browse/?fdid=fr.gaulupeau.apps.Poche" title="download the application">{% trans "via F-Droid" %}</a> {% trans " or " %} <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" title="download the application">{% trans "via Google Play" %}</a></li> 13 <li>Android: <a href="https://f-droid.org/app/fr.gaulupeau.apps.InThePoche" title="download the application">{% trans "via F-Droid" %}</a> {% trans " or " %} <a href="https://play.google.com/store/apps/details?id=fr.gaulupeau.apps.InThePoche" title="download the application">{% trans "via Google Play" %}</a></li>
14 <li>Windows Phone: <a href="https://www.windowsphone.com/en-us/store/app/poche/334de2f0-51b5-4826-8549-a3d805a37e83" title="download the window phone application">{% trans "download the application" %}</a></li> 14 <li>iOS: <a href="https://itunes.apple.com/app/wallabag/id828331015?mt=8" title="download the iOS application">{% trans "download the application" %}</a></li>
15 <li>Windows Phone: <a href="http://www.windowsphone.com/en-us/store/app/wallabag/ff890514-348c-4d0b-9b43-153fff3f7450" title="download the window phone application">{% trans "download the application" %}</a></li>
15 <li> 16 <li>
16 <form method="get" action="index.php"> 17 <form method="get" action="index.php">
17 <label class="addurl" for="config_plainurl">{% trans "By filling this field" %}:</label> 18 <label class="addurl" for="config_plainurl">{% trans "By filling this field" %}:</label>
@@ -25,9 +26,10 @@
25 <h2>{% trans "Upgrading wallabag" %}</h2> 26 <h2>{% trans "Upgrading wallabag" %}</h2>
26 <ul> 27 <ul>
27 <li>{% trans "Installed version" %} : <strong>{{ constant('POCHE') }}</strong></li> 28 <li>{% trans "Installed version" %} : <strong>{{ constant('POCHE') }}</strong></li>
28 <li>{% trans "Latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent stable version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %}</li> 29 <li>{% trans "Latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent stable version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %} ({% trans "Last check:" %} {{ check_time_prod }})</li>
29 {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "Latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent development version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %}</li>{% endif %} 30 {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "Latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent development version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %} ({% trans "Last check:" %} {{ check_time_dev }}){% endif %}</li>
30 </ul> 31 </ul>
32 <p>{% trans "You can clear cache to check the latest release." %}</p>
31 33
32 <h2>{% trans "Feeds" %}</h2> 34 <h2>{% trans "Feeds" %}</h2>
33 {% if token == '' %} 35 {% if token == '' %}
@@ -42,7 +44,7 @@
42 <p>{% trans "Your user id:" %} <strong>{{user_id}}</strong></p> 44 <p>{% trans "Your user id:" %} <strong>{{user_id}}</strong></p>
43 <p>{% trans "You can regenerate your token: <a href='?feed&amp;action=generate'>generate!</a>." %}</p> 45 <p>{% trans "You can regenerate your token: <a href='?feed&amp;action=generate'>generate!</a>." %}</p>
44 {% endif %} 46 {% endif %}
45 47
46 <h2>{% trans "Change your theme" %}</h2> 48 <h2>{% trans "Change your theme" %}</h2>
47 <form method="post" action="?updatetheme" name="changethemeform"> 49 <form method="post" action="?updatetheme" name="changethemeform">
48 <fieldset class="w500p inline"> 50 <fieldset class="w500p inline">
@@ -103,15 +105,37 @@
103 {% endif %} 105 {% endif %}
104 106
105 <h2>{% trans "Import" %}</h2> 107 <h2>{% trans "Import" %}</h2>
106 <p>{% trans "Please execute the import script locally as it can take a very long time." %}</p> 108 <p>{% trans "Importing from other services can be quite long, and webservers default configuration often prevents long scripts execution time, so it must be done in multiple parts." %}</p>
107 <p>{% trans "More info in the official documentation:" %} <a href="http://doc.wallabag.org/doku.php?id=users:migrate">wallabag.org</a></p> 109 <p>1. {% trans "First, select the export file on your computer and upload it." %}</p>
110 <form method="post" action="?uploadfile" name="uploadfile" enctype="multipart/form-data">
111 <fieldset class="w500p">
112 <div class="row">
113 <label class="col w150p" for="file">{% trans "File:" %}</label>
114 <input class="col" type="file" id="file" name="file" tabindex="4">
115 </div>
116 <div class="row mts txtcenter">
117 <button class="bouton" type="submit" tabindex="4">{% trans "Upload" %}</button>
118 </div>
119 </fieldset>
120 <input type="hidden" name="MAX_FILE_SIZE" value="1048576">
121 <input type="hidden" name="returnurl" value="{{ referer }}">
122 </form>
123 <p>2. {% trans "Then, click on the right link below." %}</p>
108 <ul> 124 <ul>
109 <li><a href="./?import&amp;from=pocket">{% trans "Import from Pocket" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('POCKET_FILE')) }}</li> 125 <li><a href="./?import&amp;from=pocket">{% trans "Import from Pocket" %}</a> {{ '(after uploaded %s file)'|trans|format(constant('POCKET_FILE')) }}</li>
110 <li><a href="./?import&amp;from=readability">{% trans "Import from Readability" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('READABILITY_FILE')) }}</li> 126 <li><a href="./?import&amp;from=readability">{% trans "Import from Readability" %}</a> {{ '(after uploaded %s file)'|trans|format(constant('READABILITY_FILE')) }}</li>
111 <li><a href="./?import&amp;from=instapaper">{% trans "Import from Instapaper" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('INSTAPAPER_FILE')) }}</li> 127 <li><a href="./?import&amp;from=instapaper">{% trans "Import from Instapaper" %}</a> {{ '(after uploaded %s file)'|trans|format(constant('INSTAPAPER_FILE')) }}</li>
112 <li><a href="./?import&amp;from=poche">{% trans "Import from wallabag" %}</a> {{ '(you must have a %s file on your server)'|trans|format(constant('POCHE_FILE')) }}</li> 128 <li><a href="./?import&amp;from=poche">{% trans "Import from wallabag" %}</a> {{ '(after uploaded %s file)'|trans|format(constant('POCHE_FILE')) }}</li>
113 </ul> 129 </ul>
114 130
131 {% if token == '' %}
132 <p>{% trans "3. Your feed token is currently empty and must first be generated to fetch content. Click <a href='?feed&amp;action=generate'>here to generate it</a>." %}</p>
133 {% else %}
134 <p>3. {% trans "Finally, you have to fetch content for imported items." %} <a href="cron.php?limit=10&amp;user-id={{ user_id }}&amp;token={{token}}" target="_blank">{% trans "Click here" %}</a> {% trans "to fetch content for 10 articles" %}.</p>
135 <p>{% trans "If you have console access to your server, you can also create a cron task:" %}</p>
136 <pre><code>0 */4 * * * cd /path/to/wallabag && php cron.php --limit=10 --user-id={{user_id}} --token={{token}} >/dev/null 2>&1</code></pre>
137 {% endif %}
138
115 <h2>{% trans "Export your wallabag data" %}</h2> 139 <h2>{% trans "Export your wallabag data" %}</h2>
116 {% if constant('STORAGE') == 'sqlite' %} 140 {% if constant('STORAGE') == 'sqlite' %}
117 <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %} 141 <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css
index fe77a967..61e0b47e 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 {
@@ -526,6 +535,84 @@ footer a {
526} 535}
527 536
528/* ========================================================================== 537/* ==========================================================================
538 2.1 = "save a link" popup div related styles
539 ========================================================================== */
540
541#bagit-form {
542 background: rgba(0,0,0,0.5);
543 position: absolute;
544 top: 0;
545 left: 10em;
546 z-index: 20;
547 height: 100%;
548 width: 100%;
549 margin: 0;
550 margin-top: -30%;
551 padding: 2em;
552 display: none;
553 border-left: 1px #EEE solid;
554}
555
556#bagit-form form {
557 background: #FFF;
558 position: absolute;
559 top: 0;
560 left: 0;
561 z-index: 20;
562 border: 10px solid #000;
563 width: 400px;
564 height: 200px;
565 /* margin: -150px 0 0 -300px; */
566 padding: 2em;
567}
568
569a#bagit-form-close {
570 background: #000;
571 color: #FFF;
572 padding: 0.2em 0.5em;
573 text-decoration: none;
574 display: inline-block;
575 float: right;
576 font-size: 0.6em;
577}
578a#bagit-form-close:hover {
579 background: #999;
580 color: #000;
581}
582
583.active-current {
584 background-color: #999;
585}
586
587.active-current:after {
588 content: "";
589 width: 0;
590 height: 0;
591 position: absolute;
592 border-style: solid;
593 border-width: 10px;
594 border-color: transparent #EEE transparent transparent;
595 right: 0;
596 top: 50%;
597 margin-top: -10px;
598}
599
600.opacity03 {
601 opacity: 0.3;
602}
603
604.add-to-wallabag-link-after {
605 background-color: #000;
606 color: #fff;
607 padding: 0 3px 2px 3px;
608}
609
610#add-link-result {
611 font-weight: bold;
612 margin-top: 10px;
613}
614
615/* ==========================================================================
529 3 = Pictos 616 3 = Pictos
530 ========================================================================== */ 617 ========================================================================== */
531 618
@@ -659,6 +746,7 @@ footer a {
659#article { 746#article {
660 width: 70%; 747 width: 70%;
661 margin-bottom: 3em; 748 margin-bottom: 3em;
749 text-align: justify;
662} 750}
663 751
664#article .tags { 752#article .tags {
@@ -884,4 +972,8 @@ blockquote {
884 #display-mode { 972 #display-mode {
885 display: none; 973 display: none;
886 } 974 }
975
976 #bagit-form {
977 left: 0;
978 }
887} 979}
diff --git a/themes/baggy/edit-tags.twig b/themes/baggy/edit-tags.twig
index 9e9012ee..65ac996a 100644..100755
--- a/themes/baggy/edit-tags.twig
+++ b/themes/baggy/edit-tags.twig
@@ -4,6 +4,11 @@
4{% include '_menu.twig' %} 4{% include '_menu.twig' %}
5{% endblock %} 5{% endblock %}
6{% block content %} 6{% block content %}
7
8<script src="{{ poche_url }}/themes/default/js/jquery-ui-1.10.4.custom.min.js"></script>
9<script src="{{ poche_url }}/themes/default/js/autoCompleteTags.js"></script>
10<link rel="stylesheet" href="{{ poche_url }}/themes/default/css/jquery-ui-1.10.4.custom.min.css" media="all">
11
7<div id="article"> 12<div id="article">
8 <h2>{{ entry.title|raw }}</21> 13 <h2>{{ entry.title|raw }}</21>
9</div> 14</div>
@@ -17,7 +22,8 @@
17 <input type="hidden" name="entry_id" value="{{ entry_id }}" /> 22 <input type="hidden" name="entry_id" value="{{ entry_id }}" />
18 <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" /> 23 <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" />
19 <input type="submit" value="Tag" /> 24 <input type="submit" value="Tag" />
20 <p>{% trans "You can enter multiple tags, separated by commas." %}</p> 25 <p>{% trans "Start typing for auto complete." %}<br>
26 {% trans "You can enter multiple tags, separated by commas." %}</p>
21</form> 27</form>
22<a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> 28<a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a>
23{% endblock %} 29{% endblock %}
diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig
index 5262c05b..e34897fa 100755
--- a/themes/baggy/home.twig
+++ b/themes/baggy/home.twig
@@ -30,9 +30,9 @@
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"> 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>
37 {% if entry.content| getReadingTime > 0 %} 37 {% if entry.content| getReadingTime > 0 %}
38 <div class="estimatedTime"><a target="_blank" title="{% trans "estimated reading time:" %} {{ entry.content| getReadingTime }} min" class="tool reading-time"><span>{% trans "estimated reading time :" %} {{ entry.content| getReadingTime }} min</span></div> 38 <div class="estimatedTime"><a target="_blank" title="{% trans "estimated reading time:" %} {{ entry.content| getReadingTime }} min" class="tool reading-time"><span>{% trans "estimated reading time :" %} {{ entry.content| getReadingTime }} min</span></div>
diff --git a/themes/baggy/js/init.js b/themes/baggy/js/init.js
index 4a843548..da644fbe 100755
--- a/themes/baggy/js/init.js
+++ b/themes/baggy/js/init.js
@@ -1,36 +1,126 @@
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 $bagitFormForm = $('#bagit-form-form');
8
9 /* ==========================================================================
10 Menu
11 ========================================================================== */
2 12
3 $("#menu").click(function(){ 13 $("#menu").click(function(){
4 $("#links").toggle(); 14 $("#links").toggle();
5 }); 15 });
6 16
17 /* ==========================================================================
18 List mode or Table Mode
19 ========================================================================== */
7 20
8 $("#listmode").click(function(){ 21 $listmode.click(function(){
9 if ( $.cookie("listmode") == 1 ) { 22 if ( $.cookie("listmode") == 1 ) {
10 $(".entrie").css("width", ""); 23 // Cookie
11 $(".entrie").css("margin-left", "");
12
13 $.removeCookie("listmode"); 24 $.removeCookie("listmode");
14 $("#listmode").removeClass("tablemode"); 25
15 $("#listmode").addClass("listmode"); 26 $listentries.removeClass("listmode");
27 $listmode.removeClass("tablemode");
28 $listmode.addClass("listmode");
16 } 29 }
17 else { 30 else {
31 // Cookie
18 $.cookie("listmode", 1, {expires: 365}); 32 $.cookie("listmode", 1, {expires: 365});
19 33
20 $(".entrie").css("width", "100%"); 34 $listentries.addClass("listmode");
21 $(".entrie").css("margin-left", "0"); 35 $listmode.removeClass("listmode");
22 $("#listmode").removeClass("listmode"); 36 $listmode.addClass("tablemode");
23 $("#listmode").addClass("tablemode");
24 } 37 }
25 38
26 }); 39 });
27 40
41 /* ==========================================================================
42 Cookie listmode
43 ========================================================================== */
44
28 if ( $.cookie("listmode") == 1 ) { 45 if ( $.cookie("listmode") == 1 ) {
29 $(".entrie").css("width", "100%"); 46 $listentries.addClass("listmode");
30 $(".entrie").css("margin-left", "0"); 47 $listmode.removeClass("listmode");
31 $("#listmode").removeClass("listmode"); 48 $listmode.addClass("tablemode");
32 $("#listmode").addClass("tablemode");
33 } 49 }
34 50
51 /* ==========================================================================
52 bag it link and close button
53 ========================================================================== */
54
55 function toggleSaveLinkForm(url) {
56 $bagit.toggleClass("active-current");
57 $bagitForm.toggle();
58 $('#content').toggleClass("opacity03");
59 if (url !== 'undefined' && url) {
60 $('#plainurl').val(url);
61 }
62 $('#plainurl').focus();
63 }
64
65 $bagit.click(function(){
66 toggleSaveLinkForm();
67 });
68
69 $("#bagit-form-close").click(function(){
70 toggleSaveLinkForm();
71 });
72
73
74 //send "bag it link" form request via ajax
75 $bagitFormForm.submit( function(event) {
76 $bagitFormForm.css("cursor", "wait");
77 $("#add-link-result").empty();
78
79 $.ajax({
80 type: $bagitFormForm.attr('method'),
81 url: $bagitFormForm.attr('action'),
82 data: $bagitFormForm.serialize(),
83 success: function(data) {
84 $('#add-link-result').html("Done!");
85 $('#plainurl').val('');
86 $('#plainurl').blur('');
87 $bagitFormForm.css("cursor", "auto");
88 //setTimeout( function() { toggleSaveLinkForm(); }, 1000); //close form after 1000 delay
89 },
90 error: function(data) {
91 $('#add-link-result').html("Failed!");
92 $bagitFormForm.css("cursor", "auto");
93 }
94 });
95
96 event.preventDefault();
97 });
98
99 /* ==========================================================================
100 Keyboard gestion
101 ========================================================================== */
102
103 $(window).keydown(function(e){
104 if ( ( e.target.tagName.toLowerCase() !== 'input' && e.keyCode == 83 ) || e.keyCode == 27 ) {
105 toggleSaveLinkForm();
106 return false;
107 }
108 });
109
110 /* ==========================================================================
111 Process all links inside an article
112 ========================================================================== */
113
114 $("article a[href^='http']").after(function() {
115 return " <a href=\"" + $(this).attr('href') + "\" class=\"add-to-wallabag-link-after\" alt=\"add to wallabag\" title=\"add to wallabag\">w</a> ";
116 });
117
118 $(".add-to-wallabag-link-after").click(function(event){
119 toggleSaveLinkForm($(this).attr('href'));
120 event.preventDefault();
121 });
122
123
124
35 125
36}); 126});
diff --git a/themes/baggy/tags.twig b/themes/baggy/tags.twig
index 9df44bb7..9bb93a45 100644..100755
--- a/themes/baggy/tags.twig
+++ b/themes/baggy/tags.twig
@@ -6,7 +6,7 @@
6{% block content %} 6{% block content %}
7<h2>{% trans "Tags" %}</h2> 7<h2>{% trans "Tags" %}</h2>
8<ul class="list-tags"> 8<ul class="list-tags">
9{% for tag in tags %}<li>{% if token != '' %}<a class="icon icon-rss" href="?feed&amp;type=tag&amp;user_id={{ user_id }}&amp;tag_id={{ tag.id }}&amp;token={{ token }}" target="_blank"><span>rss</span></a>{% endif %} <a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> 9{% for tag in tags %}<li>{% if token != '' %}<a class="icon icon-rss" href="?feed&amp;type=tag&amp;user_id={{ user_id }}&amp;tag_id={{ tag.id }}&amp;token={{ token }}" target="_blank"><span>rss</span></a>{% endif %} <a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> ({{ tag.entriescount }})
10</li> 10</li>
11{% endfor %} 11{% endfor %}
12</ul> 12</ul>
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig
index 4751c4cb..092be04e 100644
--- a/themes/baggy/view.twig
+++ b/themes/baggy/view.twig
@@ -14,7 +14,7 @@
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 <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> 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>
19 </ul> 19 </ul>
20 </div> 20 </div>
@@ -29,4 +29,23 @@
29 {{ content | raw }} 29 {{ content | raw }}
30 </article> 30 </article>
31 </div> 31 </div>
32 <script src="{{ poche_url }}/themes/{{theme}}/js/restoreScroll.js"></script>
33 <script type="text/javascript">
34 $(document).ready(function() {
35
36 $(window).scroll(function(e){
37 var scrollTop = $(window).scrollTop();
38 var docHeight = $(document).height();
39 var scrollPercent = (scrollTop) / (docHeight);
40 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
41 savePercent({{ entry.id|e }}, scrollPercentRounded);
42 });
43
44 retrievePercent({{ entry.id|e }});
45
46 $(window).resize(function(){
47 retrievePercent({{ entry.id|e }});
48 });
49 });
50 </script>
32{% endblock %} 51{% endblock %}