aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authorSeb Sauvage <sebsauvage@sebsauvage.net>2012-02-01 23:07:32 +0100
committerEmilien Klein <emilien@klein.st>2012-02-01 23:07:32 +0100
commita22e60cc0abb0547af8d792dec15f59bf77b5630 (patch)
tree826845d8d5d46d6a4d1096c57c2bddd07ae40071 /inc
parent96bc4efe9ea9ed513d1ec06e0823847d5eebe82f (diff)
downloadShaarli-a22e60cc0abb0547af8d792dec15f59bf77b5630.tar.gz
Shaarli-a22e60cc0abb0547af8d792dec15f59bf77b5630.tar.zst
Shaarli-a22e60cc0abb0547af8d792dec15f59bf77b5630.zip
Version 0.0.37 beta
- Added: Basic CSS for mobiles, which makes Shaarli much more usable on mobile devices. - Added: Picture wall no more instantly kills your browser. Now it uses lazy image loading [0]: The picture are loaded only as you scroll the page. This will reduce browser memory usage (especially on mobile devices) and will reduce server load. If you have javascript disabled, the page will still work as before (all images loaded at once). - Added: RSS feed for the “Daily” page. 1 RSS entry per day, with all links of that day. RSS feed provides the last 7 days (only non-empty days are returned). - Added: In link list, added an icon to see only private links. Click to toggle (only private / all). [0] http://www.appelsiini.net/projects/lazyload
Diffstat (limited to 'inc')
-rw-r--r--inc/jquery.lazyload.min.js15
-rw-r--r--inc/shaarli.css49
2 files changed, 64 insertions, 0 deletions
diff --git a/inc/jquery.lazyload.min.js b/inc/jquery.lazyload.min.js
new file mode 100644
index 00000000..2364d8d9
--- /dev/null
+++ b/inc/jquery.lazyload.min.js
@@ -0,0 +1,15 @@
1/*
2 * Lazy Load - jQuery plugin for lazy loading images
3 *
4 * Copyright (c) 2007-2012 Mika Tuupola
5 *
6 * Licensed under the MIT license:
7 * http://www.opensource.org/licenses/mit-license.php
8 *
9 * Project home:
10 * http://www.appelsiini.net/projects/lazyload
11 *
12 * Version: 1.7.0
13 *
14 */
15(function(a,b){$window=a(b),a.fn.lazyload=function(c){var d={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null};c&&(undefined!==c.failurelimit&&(c.failure_limit=c.failurelimit,delete c.failurelimit),undefined!==c.effectspeed&&(c.effect_speed=c.effectspeed,delete c.effectspeed),a.extend(d,c));var e=this;return 0==d.event.indexOf("scroll")&&a(d.container).bind(d.event,function(b){var c=0;e.each(function(){$this=a(this);if(d.skip_invisible&&!$this.is(":visible"))return;if(!a.abovethetop(this,d)&&!a.leftofbegin(this,d))if(!a.belowthefold(this,d)&&!a.rightoffold(this,d))$this.trigger("appear");else if(++c>d.failure_limit)return!1})}),this.each(function(){var b=this,c=a(b);b.loaded=!1,c.one("appear",function(){if(!this.loaded){if(d.appear){var f=e.length;d.appear.call(b,f,d)}a("<img />").bind("load",function(){c.hide().attr("src",c.data(d.data_attribute))[d.effect](d.effect_speed),b.loaded=!0;var f=a.grep(e,function(a){return!a.loaded});e=a(f);if(d.load){var g=e.length;d.load.call(b,g,d)}}).attr("src",c.data(d.data_attribute))}}),0!=d.event.indexOf("scroll")&&c.bind(d.event,function(a){b.loaded||c.trigger("appear")})}),$window.bind("resize",function(b){a(d.container).trigger(d.event)}),a(d.container).trigger(d.event),this},a.belowthefold=function(c,d){if(d.container===undefined||d.container===b)var e=$window.height()+$window.scrollTop();else var e=a(d.container).offset().top+a(d.container).height();return e<=a(c).offset().top-d.threshold},a.rightoffold=function(c,d){if(d.container===undefined||d.container===b)var e=$window.width()+$window.scrollLeft();else var e=a(d.container).offset().left+a(d.container).width();return e<=a(c).offset().left-d.threshold},a.abovethetop=function(c,d){if(d.container===undefined||d.container===b)var e=$window.scrollTop();else var e=a(d.container).offset().top;return e>=a(c).offset().top+d.threshold+a(c).height()},a.leftofbegin=function(c,d){if(d.container===undefined||d.container===b)var e=$window.scrollLeft();else var e=a(d.container).offset().left;return e>=a(c).offset().left+d.threshold+a(c).width()},a.inviewport=function(b,c){return!a.rightofscreen(b,c)&&!a.leftofscreen(b,c)&&!a.belowthefold(b,c)&&!a.abovethetop(b,c)},a.extend(a.expr[":"],{"below-the-fold":function(c){return a.belowthefold(c,{threshold:0,container:b})},"above-the-top":function(c){return!a.belowthefold(c,{threshold:0,container:b})},"right-of-screen":function(c){return a.rightoffold(c,{threshold:0,container:b})},"left-of-screen":function(c){return!a.rightoffold(c,{threshold:0,container:b})},"in-viewport":function(c){return!a.inviewport(c,{threshold:0,container:b})},"above-the-fold":function(c){return!a.belowthefold(c,{threshold:0,container:b})},"right-of-fold":function(c){return a.rightoffold(c,{threshold:0,container:b})},"left-of-fold":function(c){return!a.rightoffold(c,{threshold:0,container:b})}})})(jQuery,window)
diff --git a/inc/shaarli.css b/inc/shaarli.css
index a949666e..5b4b88b6 100644
--- a/inc/shaarli.css
+++ b/inc/shaarli.css
@@ -184,6 +184,12 @@ cursor:pointer;
184.paging a:visited { color:#ccc; } 184.paging a:visited { color:#ccc; }
185.paging a:hover { color:#FFFFC9; } 185.paging a:hover { color:#FFFFC9; }
186.paging a:active { color:#fff; } 186.paging a:active { color:#fff; }
187#paging_privatelinks { float:left; }
188#paging_linksperpage { float:right; padding-right:5px; }
189#paging_current { display:inline; color:#fff; padding:0 20 0 20; }
190#paging_older { margin-right:15px; }
191#paging_newer { margin-left:15px; }
192
187#headerform { color:#ffffff; padding:5px 5px 5px 5px; clear: both;} 193#headerform { color:#ffffff; padding:5px 5px 5px 5px; clear: both;}
188#toolsdiv { color:#ffffff; padding:5px 5px 5px 5px; clear:left; } 194#toolsdiv { color:#ffffff; padding:5px 5px 5px 5px; clear:left; }
189#uploaddiv { color:#ffffff; padding:5px 5px 5px 5px; clear:left; } 195#uploaddiv { color:#ffffff; padding:5px 5px 5px 5px; clear:left; }
@@ -325,6 +331,11 @@ div.daily
325 position:relative; 331 position:relative;
326 border-bottom: 2px solid black; 332 border-bottom: 2px solid black;
327} 333}
334
335#daily_col1 { float:left;position:relative; width:33%; padding-left:1%; }
336#daily_col2 { float:left;position:relative; width:33%; }
337#daily_col3 { float:left;position:relative; width:33%;}
338
328div.dailyAbout 339div.dailyAbout
329{ 340{
330 float:left; 341 float:left;
@@ -383,6 +394,11 @@ div.dailyEntryDescription
383 clear:both; 394 clear:both;
384} 395}
385 396
397/* For lazy images loading in picture wall.
398 using http://www.appelsiini.net/projects/lazyload
399 */
400.lazyimage { display:none; }
401
386@media print { 402@media print {
387html {border:none;background:#fff!important;color:#000!important;} 403html {border:none;background:#fff!important;color:#000!important;}
388body {font-size:12pt;width:auto!important;margin:auto!important;} 404body {font-size:12pt;width:auto!important;margin:auto!important;}
@@ -397,3 +413,36 @@ a {color:#000!important;text-decoration:none!important;}
397.linktag { border: 1px solid black; font-style:italic; font-size:8pt;} 413.linktag { border: 1px solid black; font-style:italic; font-size:8pt;}
398 414
399} 415}
416
417
418@media handheld, only screen and (max-width: 480px), only screen and (max-device-width: 854px)
419{
420/* A few fixes for mobile devices (far from perfect). */
421.nomobile { display:none; }
422#logo { display:none; }
423#pageheader a
424{
425 padding:5px;
426 border-radius: 5px 5px 5px 5px;
427 margin:3px;
428}
429.searchform,.tagfilter { display:block !important; margin:0px !important; padding:0px !important; width:100% !important; }
430.searchform input,.tagfilter input { margin:0px !important; padding:0px !important; display:inline !important; }
431.tagfilter input.bigbutton,.searchform input.bigbutton,.addform input.bigbutton{ width:30%; font-size:smaller;}
432#searchform_value { width:70% !important; }
433#tagfilter_value { width:70% !important; }
434div.qrcode { position:relative; float:left; top:-10px; left:0px; }
435#paging_privatelinks { float;none; }
436#paging_linksperpage { float:none; margin-bottom:10px; font-size:smaller;}
437#paging_older,#paging_newer,#paging_linksperpage a { border: 1px solid black; padding:3px 5px 3px 5px; background-color:#666; color:#fff; border-radius: 5px 5px 5px 5px;}
438.thumbnail { float:none; height:auto; margin: 0px; text-align:center;}
439#cloudtag { padding:0px; }
440div.dailyAbout { float:none; position:relative; width:100%; clear:both; padding:0px; top:0px; left:0px; }
441#daily_col1,#daily_col2,#daily_col3 { float:none; width:100%; padding:0px;}
442div.dailyTitle { font-size: 18pt; margin-top:5px; padding:0px;}
443div.dailyDate { font-size: 11pt;padding:0px; display:block; }
444div.dailyEntryTitle { font-size:16pt; font-weight:bold;}
445div.dailyEntryDescription { font-size:10pt; }
446
447}
448