MagehouseInfinity - Version 1.0.0

Version Notes

First Release 19 -9 -2012

Download this release

Release Info

Developer Magento Core Team
Extension MagehouseInfinity
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Magehouse/Infinity/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Magehouse_Infinity_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/Magehouse/Infinity/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <infinite_scroll translate="title" module="infinity">
12
+ <title>Infinite Scroll Section</title>
13
+ <sort_order>0</sort_order>
14
+ </infinite_scroll>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Magehouse/Infinity/etc/config.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magehouse_Infinity>
5
+ <version>0.1.0</version>
6
+ </Magehouse_Infinity>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <infinity>
11
+ <class>Magehouse_Infinity_Helper</class>
12
+ </infinity>
13
+ </helpers>
14
+ </global>
15
+ <frontend>
16
+ <layout>
17
+ <updates>
18
+ <infinity>
19
+ <file>infinitescroll.xml</file>
20
+ </infinity>
21
+ </updates>
22
+ </layout>
23
+ </frontend>
24
+ </config>
app/code/community/Magehouse/Infinity/etc/system.xml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <magehouse translate="label" module="infinity">
5
+ <label>Magehouse Extensions</label>
6
+ <sort_order>0</sort_order>
7
+ </magehouse>
8
+ </tabs>
9
+ <sections>
10
+ <infinite_scroll translate="label" module="infinity">
11
+ <label>Infinite Scroll</label>
12
+ <tab>magehouse</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>0</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <infinite_scroll_settings translate="label">
20
+ <label>Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>0</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <scroll_loader_active translate="label">
28
+ <label>Enable Infinite Scroll</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </scroll_loader_active>
36
+ <include_jquery translate="label">
37
+ <label>Include Jquery</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <sort_order>2</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </include_jquery>
45
+ <scroll_container translate="label">
46
+ <label>Products Container</label>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>3</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ </scroll_container>
53
+ <scroll_item translate="label">
54
+ <label>Single Item container</label>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>4</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </scroll_item>
61
+ <scroll_pagination translate="label">
62
+ <label>Pagination Container</label>
63
+ <frontend_type>text</frontend_type>
64
+ <sort_order>5</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>1</show_in_store>
68
+ </scroll_pagination>
69
+ <scroll_next translate="label">
70
+ <label>Element for Next Link </label>
71
+ <frontend_type>text</frontend_type>
72
+ <sort_order>6</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ </scroll_next>
77
+ <scroll_loader translate="label">
78
+ <label>Loader Image</label>
79
+ <frontend_type>text</frontend_type>
80
+ <sort_order>7</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>1</show_in_store>
84
+ </scroll_loader>
85
+ </fields>
86
+ </infinite_scroll_settings>
87
+ </groups>
88
+ </infinite_scroll>
89
+ </sections>
90
+ </config>
app/design/frontend/base/default/layout/infinitescroll.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <catalog_category_view>
4
+ <reference name="head">
5
+ <block type="core/text" name="google.cdn.jquery" >
6
+ <action method="setText" ifconfig="infinite_scroll/infinite_scroll_settings/include_jquery">
7
+ <text><![CDATA[<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script type="text/javascript">jQuery.noConflict();</script>]]> </text>
8
+ </action>
9
+ </block>
10
+ <block type="page/html_head" name="infinityJs" after="google.cdn.jquery" >
11
+ <action method="addJs" ifconfig="infinite_scroll/infinite_scroll_settings/scroll_loader_active"><script>infinite/jquery.ias.min.js</script></action>
12
+ </block>
13
+ </reference>
14
+ <reference name="before_body_end">
15
+ <block type="core/template" name="infinite_scroll" template="infinitescroll/js.phtml" />
16
+ </reference>
17
+ </catalog_category_view>
18
+ </layout>
app/design/frontend/base/default/template/infinitescroll/js.phtml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if(Mage::getStoreConfig('infinite_scroll/infinite_scroll_settings/scroll_loader_active')): ?>
2
+ <script type="text/javascript">
3
+ jQuery.ias({
4
+ container : "<?php echo Mage::getStoreConfig('infinite_scroll/infinite_scroll_settings/scroll_container'); ?>",
5
+ // Enter the selector of the element containing
6
+ // your items that you want to paginate.
7
+
8
+ item : "<?php echo Mage::getStoreConfig('infinite_scroll/infinite_scroll_settings/scroll_item'); ?>",
9
+ // Enter the selector of the element that each
10
+ // item has. Make sure the elements are inside
11
+ // the container element.
12
+
13
+ pagination : "<?php echo Mage::getStoreConfig('infinite_scroll/infinite_scroll_settings/scroll_pagination'); ?>",
14
+ // Enter the selector of the element that contains
15
+ // your regular pagination links, like next,
16
+ // previous and the page numbers. This element
17
+ // will be hidden when IAS loads.
18
+
19
+ next : "<?php echo Mage::getStoreConfig('infinite_scroll/infinite_scroll_settings/scroll_next'); ?>",
20
+ // Enter the selector of the link element that
21
+ // links to the next page. The href attribute
22
+ // of this element will be used to get the items
23
+ // from the next page.
24
+
25
+ loader : "<img src='<?php echo $this->getUrl(); ?><?php echo Mage::getStoreConfig('infinite_scroll/infinite_scroll_settings/scroll_loader'); ?>' style='margin-left:48%'/>"
26
+ // Enter the url to the loader image. This image
27
+ // will be displayed when the next page with items
28
+ // is loaded via AJAX.
29
+ });
30
+ </script>
31
+ <?php endif; ?>
app/etc/modules/Magehouse_Infinity.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magehouse_Infinity>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.1.0</version>
8
+ </Magehouse_Infinity>
9
+ </modules>
10
+ </config>
js/infinite/jquery.ias.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Infinite Ajax Scroll, a jQuery plugin
3
+ * Version v0.1.6
4
+ * http://webcreate.nl/
5
+ *
6
+ * Copyright (c) 2011-2012 Jeroen Fiege
7
+ * Licensed under the MIT License:
8
+ * http://webcreate.nl/license
9
+ */
10
+ (function(b){b.ias=function(d){var m=b.extend({},b.ias.defaults,d);var c=new b.ias.util();var j=new b.ias.paging(m.scrollContainer);var h=(m.history?new b.ias.history():false);var f=this;r();function r(){j.onChangePage(function(x,v,w){if(h){h.setPage(x,w)}m.onPageChange.call(this,x,w,v)});s();if(h&&h.havePage()){q();pageNum=h.getPage();c.forceScrollTop(function(){if(pageNum>1){l(pageNum);curTreshold=p(true);b("html,body").scrollTop(curTreshold)}else{s()}})}return f}function s(){n();m.scrollContainer.scroll(g)}function g(){if(m.scrollContainer==b.ias.defaults.scrollContainer){scrTop=m.scrollContainer.scrollTop()}else{scrTop=m.scrollContainer.offset().top}wndHeight=m.scrollContainer.height();curScrOffset=scrTop+wndHeight;if(curScrOffset>=p()){t(curScrOffset)}}function q(){m.scrollContainer.unbind("scroll",g)}function n(){b(m.pagination).hide()}function p(v){el=b(m.container).find(m.item).last();if(el.size()==0){return 0}treshold=el.offset().top+el.height();if(!v){treshold+=m.tresholdMargin}return treshold}function t(w,v){urlNextPage=b(m.next).attr("href");if(!urlNextPage){return q()}j.pushPages(w,urlNextPage);q();o();e(urlNextPage,function(y,x){result=m.onLoadItems.call(this,x);if(result!==false){b(x).hide();curLastItem=b(m.container).find(m.item).last();curLastItem.after(x);b(x).fadeIn()}b(m.pagination).replaceWith(b(m.pagination,y));k();s();m.onRenderComplete.call(this,x);if(v){v.call(this)}})}function e(w,x){var v=[];b.get(w,null,function(y){container=b(m.container,y).eq(0);if(0==container.length){container=b(y).filter(m.container).eq(0)}if(container){container.find(m.item).each(function(){v.push(this)})}if(x){x.call(this,y,v)}},"html")}function l(v){curTreshold=p(true);if(curTreshold>0){t(curTreshold,function(){q();if((j.getCurPageNum(curTreshold)+1)<v){l(v);b("html,body").animate({scrollTop:curTreshold},400,"swing")}else{b("html,body").animate({scrollTop:curTreshold},1000,"swing");s()}})}}function u(){loader=b(".ias_loader");if(loader.size()==0){loader=b("<div class='ias_loader'>"+m.loader+"</div>");loader.hide()}return loader}function o(){loader=u();if(m.customLoaderProc!==false){m.customLoaderProc(loader)}else{el=b(m.container).find(m.item).last();el.after(loader);loader.fadeIn()}}function k(){loader=u();loader.remove()}};function a(c){if(window.console&&window.console.log){window.console.log(c)}}b.ias.defaults={container:"#container",scrollContainer:b(window),item:".item",pagination:"#pagination",next:".next",loader:'<img src="images/loader.gif"/>',tresholdMargin:0,history:true,onPageChange:function(){},onLoadItems:function(){},onRenderComplete:function(){},customLoaderProc:false};b.ias.util=function(){var d=false;var f=false;var c=this;e();function e(){b(window).load(function(){d=true})}this.forceScrollTop=function(g){b("html,body").scrollTop(0);if(!f){if(!d){setTimeout(function(){c.forceScrollTop(g)},1)}else{g.call();f=true}}}};b.ias.paging=function(){var e=[[0,document.location.toString()]];var h=function(){};var d=1;j();function j(){b(window).scroll(g)}function g(){scrTop=b(window).scrollTop();wndHeight=b(window).height();curScrOffset=scrTop+wndHeight;curPageNum=c(curScrOffset);curPagebreak=f(curScrOffset);if(d!=curPageNum){h.call(this,curPageNum,curPagebreak[0],curPagebreak[1])}d=curPageNum}function c(k){for(i=(e.length-1);i>0;i--){if(k>e[i][0]){return i+1}}return 1}this.getCurPageNum=function(k){return c(k)};function f(k){for(i=(e.length-1);i>=0;i--){if(k>e[i][0]){return e[i]}}return null}this.onChangePage=function(k){h=k};this.pushPages=function(k,l){e.push([k,l])}};b.ias.history=function(){var d=false;var c=false;e();function e(){c=!!(window.history&&history.pushState&&history.replaceState);c=false}this.setPage=function(g,f){this.updateState({page:g},"",f)};this.havePage=function(){return(this.getState()!=false)};this.getPage=function(){if(this.havePage()){stateObj=this.getState();return stateObj.page}return 1};this.getState=function(){if(c){stateObj=history.state;if(stateObj&&stateObj.ias){return stateObj.ias}}else{haveState=(window.location.hash.substring(0,7)=="#/page/");if(haveState){pageNum=parseInt(window.location.hash.replace("#/page/",""));return{page:pageNum}}}return false};this.updateState=function(g,h,f){if(d){this.replaceState(g,h,f)}else{this.pushState(g,h,f)}};this.pushState=function(g,h,f){if(c){history.pushState({ias:g},h,f)}else{hash=(g.page>0?"#/page/"+g.page:"");window.location.hash=hash}d=true};this.replaceState=function(g,h,f){if(c){history.replaceState({ias:g},h,f)}else{this.pushState(g,h,f)}}}})(jQuery);
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>MagehouseInfinity</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Get infinite scrolling category pages.</summary>
10
+ <description>Get infinite scrolling category pages.</description>
11
+ <notes>First Release 19 -9 -2012</notes>
12
+ <authors><author><name>Mrugesh Mistry</name><user>auto-converted</user><email>mrugesh.rocks@gmail.com</email></author></authors>
13
+ <date>2012-09-19</date>
14
+ <time>10:39:04</time>
15
+ <contents><target name="magecommunity"><dir name="Magehouse"><dir name="Infinity"><dir name="Helper"><file name="Data.php" hash="a6c41a4bb720289eb76d906a9e5cac66"/></dir><dir name="etc"><file name="adminhtml.xml" hash="465e6ff26e98795805d6556a7bb6e77f"/><file name="config.xml" hash="8beb09b1ad30f3945a8e052da28f1733"/><file name="system.xml" hash="a08e8f76b2c949af9fa63c44828e8e41"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="infinitescroll.xml" hash="583734765416ed15c6c7689baac93bf0"/></dir><dir name="template"><dir name="infinitescroll"><file name="js.phtml" hash="e202d3273cb1d9d7d091b005d3319899"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="infinite"><file name="jquery.ias.min.js" hash="5c1fc8a0c00783b0ffddd978059c1d1f"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magehouse_Infinity.xml" hash="a2471ae1480f2935dddee2f6afdeb12f"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>