diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-02-01 12:22:35 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-02-01 12:22:35 +0100 |
commit | fae15c9f84394f905e5237a1afc10364aeb42dd0 (patch) | |
tree | 1715cb08f5b754f320c32c2612775fbe811b2d92 | |
parent | 3831c1525ccc512e27309f2cd531f0beff8dc430 (diff) | |
parent | 89637c2a1dcc114b17a8f7eef493b51315e1a6ac (diff) | |
download | wallabag-fae15c9f84394f905e5237a1afc10364aeb42dd0.tar.gz wallabag-fae15c9f84394f905e5237a1afc10364aeb42dd0.tar.zst wallabag-fae15c9f84394f905e5237a1afc10364aeb42dd0.zip |
Merge pull request #968 from wallabag/reloadarticle
added reload function
-rwxr-xr-x | inc/poche/Poche.class.php | 17 | ||||
-rwxr-xr-x | inc/poche/config.inc.default.php | 1 | ||||
-rwxr-xr-x | themes/baggy/css/main.css | 5 | ||||
-rwxr-xr-x | themes/baggy/view.twig | 1 | ||||
-rwxr-xr-x | themes/default/css/style-default.css | 3 | ||||
-rw-r--r-- | themes/default/img/default/reload.png | bin | 0 -> 343 bytes | |||
-rwxr-xr-x | themes/default/view.twig | 1 |
7 files changed, 25 insertions, 3 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5b8e235f..f9928145 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -337,10 +337,23 @@ class Poche | |||
337 | $this->messages->add('s', _('The tag has been successfully deleted')); | 337 | $this->messages->add('s', _('The tag has been successfully deleted')); |
338 | Tools::redirect(); | 338 | Tools::redirect(); |
339 | break; | 339 | break; |
340 | |||
341 | case 'reload_article' : | ||
342 | Tools::logm('reload article'); | ||
343 | $id = $_GET['id']; | ||
344 | $entry = $this->store->retrieveOneById($id, $this->user->getId()); | ||
345 | Tools::logm('reload url ' . $entry['url']); | ||
346 | $url = new Url(base64_encode($entry['url'])); | ||
347 | $this->action('add', $url); | ||
348 | break; | ||
349 | |||
340 | /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */ | 350 | /* For some unknown reason I can't get displayView() to work here (it redirects to home view afterwards). So here's a dirty fix which redirects directly to URL */ |
341 | case 'random': | 351 | case 'random': |
342 | $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); | 352 | $id = 0; |
343 | $id = rand(1,$count); | 353 | while ($this->store->retrieveOneById($id,$this->user->getId()) == null) { |
354 | $count = $this->store->getEntriesByViewCount($view, $this->user->getId()); | ||
355 | $id = rand(1,$count); | ||
356 | } | ||
344 | Tools::logm('get a random article'); | 357 | Tools::logm('get a random article'); |
345 | Tools::redirect('?view=view&id=' . $id); | 358 | Tools::redirect('?view=view&id=' . $id); |
346 | //$this->displayView('view', $id); | 359 | //$this->displayView('view', $id); |
diff --git a/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php index a159e713..aaaf12a6 100755 --- a/inc/poche/config.inc.default.php +++ b/inc/poche/config.inc.default.php | |||
@@ -62,6 +62,7 @@ | |||
62 | @define ('SHOW_PRINTLINK', '1'); | 62 | @define ('SHOW_PRINTLINK', '1'); |
63 | // display or not percent of read in article view. Affects only default theme. | 63 | // display or not percent of read in article view. Affects only default theme. |
64 | @define ('SHOW_READPERCENT', '1'); | 64 | @define ('SHOW_READPERCENT', '1'); |
65 | @define ('RELOAD_ARTICLE', TRUE); | ||
65 | @define ('ABS_PATH', 'assets/'); | 66 | @define ('ABS_PATH', 'assets/'); |
66 | 67 | ||
67 | @define ('DEFAULT_THEME', 'baggy'); | 68 | @define ('DEFAULT_THEME', 'baggy'); |
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 9356deda..90d546fc 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css | |||
@@ -737,7 +737,10 @@ a.add-to-wallabag-link-after:after { | |||
737 | content: "\e80d"; | 737 | content: "\e80d"; |
738 | } | 738 | } |
739 | .icon-random:before { | 739 | .icon-random:before { |
740 | content: "\e915"; | 740 | content: "\e915"; |
741 | } | ||
742 | .icon-reload:before { | ||
743 | content: "\ea2e"; | ||
741 | } | 744 | } |
742 | 745 | ||
743 | 746 | ||
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig index 1afd9df6..0a8380de 100755 --- a/themes/baggy/view.twig +++ b/themes/baggy/view.twig | |||
@@ -19,6 +19,7 @@ | |||
19 | {% 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 %} | 19 | {% 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 %} |
20 | {% if constant('CARROT') == 1 %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans "carrot" %}"><span>Carrot</span></a></li>{% endif %} | 20 | {% if constant('CARROT') == 1 %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans "carrot" %}"><span>Carrot</span></a></li>{% endif %} |
21 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} | 21 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} |
22 | {% if constant('RELOAD_ARTICLE') == 1 %}<li><a class="tool reload icon icon-reload" href="./?action=reload_article&id={{ entry.id|e }}" title="{% trans "Reload article" %}"><span>{% trans "Reload article" %}</span></a></li>{% endif %} | ||
22 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} | 23 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} |
23 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | 24 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} |
24 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | 25 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} |
diff --git a/themes/default/css/style-default.css b/themes/default/css/style-default.css index 4406d48f..666c4a28 100755 --- a/themes/default/css/style-default.css +++ b/themes/default/css/style-default.css | |||
@@ -67,3 +67,6 @@ a.bad-display span { | |||
67 | a.print span { | 67 | a.print span { |
68 | background-image: url('../img/default/print.png'); | 68 | background-image: url('../img/default/print.png'); |
69 | } | 69 | } |
70 | a.reload span { | ||
71 | background-image: url('../img/default/reload.png'); | ||
72 | } | ||
diff --git a/themes/default/img/default/reload.png b/themes/default/img/default/reload.png new file mode 100644 index 00000000..4c0528e7 --- /dev/null +++ b/themes/default/img/default/reload.png | |||
Binary files differ | |||
diff --git a/themes/default/view.twig b/themes/default/view.twig index 8f3a26c3..be8bf99e 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig | |||
@@ -18,6 +18,7 @@ | |||
18 | {% 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 %} | 18 | {% 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 %} |
19 | {% if constant('CARROT') == 1 %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon" target="_blank" title="{% trans "carrot" %}"><span>{% trans "carrot" %}</span></a></li>{% endif %} | 19 | {% if constant('CARROT') == 1 %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon" target="_blank" title="{% trans "carrot" %}"><span>{% trans "carrot" %}</span></a></li>{% endif %} |
20 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} | 20 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} |
21 | {% if constant('RELOAD_ARTICLE') == 1 %}<li><a class="tool reload" href="./?action=reload_article&id={{ entry.id|e }}" title="{% trans "Reload article" %}"><span>{% trans "Reload article" %}</span></a></li>{% endif %}} | ||
21 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} | 22 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} |
22 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | 23 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} |
23 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | 24 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} |