aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-15 11:02:58 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-15 11:02:58 +0200
commit0ff751b443604ccb8cd0eb69050f59298c98a492 (patch)
treec0a66c2a75d8a3c619f0b35c1504a98b13167dc4 /app/views
parentfb5e5594bea149ca730bc6424dc547dab3347747 (diff)
Lazyload facultatif (issue #75 ok)
Diffstat (limited to 'app/views')
-rw-r--r--app/views/configure/display.phtml14
-rw-r--r--app/views/index/index.phtml8
-rw-r--r--app/views/javascript/main.phtml3
3 files changed, 23 insertions, 2 deletions
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml
index be67896dc..ea4fecd34 100644
--- a/app/views/configure/display.phtml
+++ b/app/views/configure/display.phtml
@@ -68,6 +68,20 @@
</div>
<div class="form-group">
+ <label class="group-name"><?php echo Translate::t ('img_with_lazyload'); ?></label>
+ <div class="group-controls">
+ <label class="radio" for="lazyload_yes">
+ <input type="radio" name="lazyload" id="lazyload_yes" value="yes"<?php echo $this->conf->lazyload () == 'yes' ? ' checked="checked"' : ''; ?> />
+ <?php echo Translate::t ('yes'); ?><noscript> - <b><?php echo Translate::t ('javascript_should_be_activated'); ?></b></noscript>
+ </label>
+ <label class="radio" for="lazyload_no">
+ <input type="radio" name="lazyload" id="lazyload_no" value="no"<?php echo $this->conf->lazyload () == 'no' ? ' checked="checked"' : ''; ?> />
+ <?php echo Translate::t ('no'); ?>
+ </label>
+ </div>
+ </div>
+
+ <div class="form-group">
<label class="group-name"><?php echo Translate::t ('display_articles_unfolded'); ?></label>
<div class="group-controls">
<label class="radio" for="radio_yes">
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 7037b2405..1a07cdb46 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -66,7 +66,13 @@ if ($output == 'rss') {
<h1 class="title"><?php echo $item->title (); ?></h1>
<?php $author = $item->author (); ?>
<?php echo $author != '' ? '<div class="author">' . Translate::t ('by_author', $author) . '</div>' : ''; ?>
- <?php echo lazyimg($item->content ()); ?>
+ <?php
+ if($this->conf->lazyload() == 'yes') {
+ echo lazyimg($item->content ());
+ } else {
+ echo $item->content();
+ }
+ ?>
</div>
<ul class="horizontal-list bottom">
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml
index 443f62c31..9596b1647 100644
--- a/app/views/javascript/main.phtml
+++ b/app/views/javascript/main.phtml
@@ -125,8 +125,9 @@ function init_posts () {
<?php } ?>
init_img ();
- // TODO rendre optionnel
+ <?php if($this->conf->lazyload() == 'yes') { ?>
$(".flux .content img").lazyload();
+ <?php } ?>
if (hide_posts) {
$(".flux:not(.active) .flux_content").hide ();