[pLog-svn] r5791 - plog/trunk/templates/admin

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Aug 5 03:37:49 EDT 2007


Author: oscar
Date: 2007-08-05 03:37:49 -0400 (Sun, 05 Aug 2007)
New Revision: 5791

Modified:
   plog/trunk/templates/admin/resources.template
Log:
Integrated the experimental ImageLoader library from YUI, which is pretty cool: it will only load images once they are within the viewport, meaning that if users do not ever reach the bottom of the page, a bunch of images will not be loaded (and sites will save some bandwidth)


Modified: plog/trunk/templates/admin/resources.template
===================================================================
--- plog/trunk/templates/admin/resources.template	2007-08-05 07:36:42 UTC (rev 5790)
+++ plog/trunk/templates/admin/resources.template	2007-08-05 07:37:49 UTC (rev 5791)
@@ -1,5 +1,6 @@
 {include file="$admintemplatepath/header.template"}
 {include file="$admintemplatepath/navigation.template" showOpt=resources title=$locale->tr("resources")}
+{js src="js/yui/imageloader/imageloader-experimental-debug.js"}
 {js src="js/ui/pages/global.js"}
 {js src="js/ui/pages/resources.js"}
 {js src="js/ui/pages/newresourcealbum.js"}
@@ -95,7 +96,7 @@
 	<div class="pictureFrame">	
 	 <div class="picture">
    	  <a href="?op=resourceInfo&amp;resourceId={$resource->getId()}">
-    	<img alt="{$resource->getDescription()}" src="{$url->resourcePreviewLink($resource)}" />
+    	<img alt="{$resource->getDescription()}" id="resource_img_{$resource->getId()}" />
       </a>
      </div>
     </div>
@@ -171,5 +172,16 @@
   </div> 
 </div>
 </form>
+<script type="text/javascript">
+var foldGroup = new YAHOO.util.ImageLoader.group(window, 'scroll');
+{foreach from=$resources item=resource}
+	{if $resource->hasPreview()}
+		foldGroup.registerSrcImage( 'resource_img_{$resource->getId()}', '{$url->resourcePreviewLink($resource)}');	
+	{/if}
+{/foreach}
+foldGroup.foldConditional = true;
+foldGroup.name = 'fold_group';
+foldGroup.addTrigger(window, 'resize');
+</script>
 {include file="$admintemplatepath/footernavigation.template"}
-{include file="$admintemplatepath/footer.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file



More information about the pLog-svn mailing list