Strategery_InfiniteScroll2 - Version 2.1.2

Version Notes

Automatic load next page of current product list.
Support for Magento 1.3 up to 1.7

Download this release

Release Info

Developer Magento Core Team
Extension Strategery_InfiniteScroll2
Version 2.1.2
Comparing to
See all releases


Code changes from version 2.1.1 to 2.1.2

app/code/community/Strategery/Infinitescroll2/Model/Catalog/Observer.php CHANGED
@@ -21,29 +21,32 @@ class Strategery_Infinitescroll2_Model_Catalog_Observer
21
 
22
  public function modifyCollection($observer)
23
  {
 
24
  $this->hardReset();
 
25
  $helper = Mage::helper('infinitescroll2');
26
- if(Mage::registry('current_category') && $helper->isMemoryActive())
 
 
 
 
27
  {
28
  // info:
29
- $event = $observer->getEvent();
30
- $collection = $event->getCollection();
31
  $pageId = Mage::registry('current_category')->getId();
32
  $pageByParam = $helper->getNextPageNumber();
33
- $lastPageNumber = $collection->getLastPageNumber();
 
 
 
34
  // actions:
35
  if(!$helper->isScrollCall())
36
  {
37
  if(!Mage::getSingleton('checkout/session')->getData('recursiveCollection'))
38
  {
39
- $pageLoaded = $helper->loadMemory($pageId);
40
  if($pageLoaded>1)
41
  {
42
  Mage::getSingleton('checkout/session')->setData('recursiveCollection',true);
43
  Mage::getSingleton('checkout/session')->setData('pageLoaded',$pageLoaded);
44
- // default page size save:
45
- $defaultPageSize = $collection->getPageSize();
46
- Mage::getSingleton('checkout/session')->setData('defautlPageSize',$defaultPageSize);
47
  // replace page size:
48
  $tmpPageSize = $defaultPageSize*$pageLoaded;
49
  $collection->setPageSize($tmpPageSize);
@@ -58,11 +61,18 @@ class Strategery_Infinitescroll2_Model_Catalog_Observer
58
  else
59
  {
60
  $nextPage = Mage::getSingleton('checkout/session')->getData('nextPage');
 
 
 
 
61
  if($nextPage>1 && $nextPage<=$lastPageNumber)
62
  {
63
  $pageByParam=$nextPage;
64
  }
65
- $helper->saveMemory($pageByParam,$pageId);
 
 
 
66
  $collection->setCurPage($pageByParam);
67
  Mage::getSingleton('checkout/session')->setData('pageLoaded',$pageByParam);
68
  }
@@ -72,13 +82,15 @@ class Strategery_Infinitescroll2_Model_Catalog_Observer
72
 
73
  public function restoreCollection($observer)
74
  {
 
75
  $helper = Mage::helper('infinitescroll2');
76
- if(Mage::registry('current_category') && $helper->isMemoryActive())
 
 
 
 
77
  {
78
  // info:
79
- $helper = Mage::helper('infinitescroll2');
80
- $event = $observer->getEvent();
81
- $collection = $event->getCollection();
82
  $pageLoaded = Mage::getSingleton('checkout/session')->getData('pageLoaded');
83
  $nextPageSaved = Mage::getSingleton('checkout/session')->getData('nextPage');
84
  $tmpNext = false;
21
 
22
  public function modifyCollection($observer)
23
  {
24
+ // reset:
25
  $this->hardReset();
26
+ // helper:
27
  $helper = Mage::helper('infinitescroll2');
28
+ // observer data:
29
+ $event = $observer->getEvent();
30
+ $collection = $event->getCollection();
31
+ $lastPageNumber = $collection->getLastPageNumber();
32
+ if(Mage::registry('current_category') && $helper->isMemoryActive() && $lastPageNumber>1)
33
  {
34
  // info:
 
 
35
  $pageId = Mage::registry('current_category')->getId();
36
  $pageByParam = $helper->getNextPageNumber();
37
+ $pageLoaded = $helper->loadMemory($pageId);
38
+ // default page size save:
39
+ $defaultPageSize = $collection->getPageSize();
40
+ Mage::getSingleton('checkout/session')->setData('defautlPageSize',$defaultPageSize);
41
  // actions:
42
  if(!$helper->isScrollCall())
43
  {
44
  if(!Mage::getSingleton('checkout/session')->getData('recursiveCollection'))
45
  {
 
46
  if($pageLoaded>1)
47
  {
48
  Mage::getSingleton('checkout/session')->setData('recursiveCollection',true);
49
  Mage::getSingleton('checkout/session')->setData('pageLoaded',$pageLoaded);
 
 
 
50
  // replace page size:
51
  $tmpPageSize = $defaultPageSize*$pageLoaded;
52
  $collection->setPageSize($tmpPageSize);
61
  else
62
  {
63
  $nextPage = Mage::getSingleton('checkout/session')->getData('nextPage');
64
+ if($pageLoaded>$nextPage)
65
+ {
66
+ $nextPage = $pageLoaded+1;
67
+ }
68
  if($nextPage>1 && $nextPage<=$lastPageNumber)
69
  {
70
  $pageByParam=$nextPage;
71
  }
72
+ if($nextPage<=$lastPageNumber)
73
+ {
74
+ $helper->saveMemory($pageByParam,$pageId);
75
+ }
76
  $collection->setCurPage($pageByParam);
77
  Mage::getSingleton('checkout/session')->setData('pageLoaded',$pageByParam);
78
  }
82
 
83
  public function restoreCollection($observer)
84
  {
85
+ // helper:
86
  $helper = Mage::helper('infinitescroll2');
87
+ // observer data:
88
+ $event = $observer->getEvent();
89
+ $collection = $event->getCollection();
90
+ $lastPageNumber = $collection->getLastPageNumber();
91
+ if(Mage::registry('current_category') && $helper->isMemoryActive() && $lastPageNumber>1)
92
  {
93
  // info:
 
 
 
94
  $pageLoaded = Mage::getSingleton('checkout/session')->getData('pageLoaded');
95
  $nextPageSaved = Mage::getSingleton('checkout/session')->getData('nextPage');
96
  $tmpNext = false;
app/code/community/Strategery/Infinitescroll2/etc/config.xml CHANGED
@@ -25,7 +25,7 @@
25
  <config>
26
  <modules>
27
  <Strategery_Infinitescroll2>
28
- <version>2.1.1</version>
29
  </Strategery_Infinitescroll2>
30
  </modules>
31
  <global>
25
  <config>
26
  <modules>
27
  <Strategery_Infinitescroll2>
28
+ <version>2.1.2</version>
29
  </Strategery_Infinitescroll2>
30
  </modules>
31
  <global>
app/design/frontend/base/default/layout/strategery-infinitescroll2.xml DELETED
@@ -1,158 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * InfiniteScroll - Magento Integration
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0),
9
- * available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- *
12
- * @category Strategery
13
- * @package Strategery_Infinitescroll2
14
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
15
- * @copyright Copyright (c) 2011 Strategery Inc. (http://usestrategery.com)
16
- *
17
- * @author Gabriel Somoza (me@gabrielsomoza.com)
18
- * @link http://gabrielsomoza.com/
19
- *
20
- * Update 2.0.0
21
- * @author Damian A. Pastorini (admin@dwdesigner.com)
22
- * @link http://www.dwdesigner.com/
23
- */
24
- -->
25
- <layout version="0.1.0">
26
- <infinitescroll2_js_index>
27
- <reference name="root">
28
- <action method="setTemplate" ifconfig="infinitescroll2/general/enabled">
29
- <template>strategery/infinitescroll2/js.phtml</template>
30
- </action>
31
- </reference>
32
- </infinitescroll2_js_index>
33
-
34
- <catalog_category_default>
35
- <reference name="head">
36
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
37
- <type>js</type>
38
- <name>jquery/jquery.latest.min.js</name>
39
- </action>
40
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
41
- <type>js</type>
42
- <name>jquery/infinitescroll2/https.js</name>
43
- </action>
44
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
45
- <type>js</type>
46
- <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
47
- </action>
48
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
49
- <type>js</type>
50
- <name>jquery/infinitescroll2/behaviors/infinitescroll-magento.js</name>
51
- </action>
52
- </reference>
53
- <reference name="before_body_end">
54
- <block type="core/text" name="infinitescroll2_config">
55
- <action method="setText">
56
- <text><![CDATA[<script type="text/javascript" src="/infinitescroll2/js"></script>]]></text>
57
- </action>
58
- </block>
59
- </reference>
60
- <reference name="product_list_toolbar">
61
- <action method="setTemplate" ifconfig="infinitescroll2/design/hide_toolbar">
62
- <template>strategery/infinitescroll2/toolbar.phtml</template>
63
- </action>
64
- </reference>
65
- </catalog_category_default>
66
-
67
- <catalog_category_layered>
68
- <reference name="head">
69
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
70
- <type>js</type>
71
- <name>jquery/jquery.latest.min.js</name>
72
- </action>
73
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
74
- <type>js</type>
75
- <name>jquery/infinitescroll2/https.js</name>
76
- </action>
77
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
78
- <type>js</type>
79
- <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
80
- </action>
81
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
82
- <type>js</type>
83
- <name>jquery/infinitescroll2/behaviors/infinitescroll-magento.js</name>
84
- </action>
85
- </reference>
86
- <reference name="before_body_end">
87
- <block type="core/text" name="infinitescroll2_config">
88
- <action method="setText">
89
- <text><![CDATA[<script type="text/javascript" src="/infinitescroll2/js"></script>]]></text>
90
- </action>
91
- </block>
92
- </reference>
93
- <reference name="product_list_toolbar">
94
- <action method="setTemplate" ifconfig="infinitescroll2/design/hide_toolbar">
95
- <template>strategery/infinitescroll2/toolbar.phtml</template>
96
- </action>
97
- </reference>
98
- </catalog_category_layered>
99
-
100
- <catalogsearch_result_index>
101
- <reference name="head">
102
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
103
- <type>js</type>
104
- <name>jquery/jquery.latest.min.js</name>
105
- </action>
106
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
107
- <type>js</type>
108
- <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
109
- </action>
110
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
111
- <type>js</type>
112
- <name>jquery/infinitescroll2/behaviors/infinitescroll-magento.js</name>
113
- </action>
114
- </reference>
115
- <reference name="before_body_end">
116
- <block type="core/text" name="infinitescroll2_config">
117
- <action method="setText">
118
- <text><![CDATA[<script type="text/javascript" src="/infinitescroll2/js"></script>]]></text>
119
- </action>
120
- </block>
121
- </reference>
122
- <reference name="product_list_toolbar">
123
- <action method="setTemplate" ifconfig="infinitescroll2/design/hide_toolbar">
124
- <template>strategery/infinitescroll2/toolbar.phtml</template>
125
- </action>
126
- </reference>
127
- </catalogsearch_result_index>
128
-
129
- <catalogsearch_advanced_index>
130
- <reference name="head">
131
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
132
- <type>js</type>
133
- <name>jquery/jquery.latest.min.js</name>
134
- </action>
135
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
136
- <type>js</type>
137
- <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
138
- </action>
139
- <action method="addItem" ifconfig="infinitescroll2/general/enabled">
140
- <type>js</type>
141
- <name>jquery/infinitescroll2/behaviors/infinitescroll-magento.js</name>
142
- </action>
143
- </reference>
144
- <reference name="before_body_end">
145
- <block type="core/text" name="infinitescroll2_config">
146
- <action method="setText">
147
- <text><![CDATA[<script type="text/javascript" src="/infinitescroll2/js"></script>]]></text>
148
- </action>
149
- </block>
150
- </reference>
151
- <reference name="product_list_toolbar">
152
- <action method="setTemplate" ifconfig="infinitescroll2/design/hide_toolbar">
153
- <template>strategery/infinitescroll2/toolbar.phtml</template>
154
- </action>
155
- </reference>
156
- </catalogsearch_advanced_index>
157
-
158
- </layout>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/strategery/infinitescroll2/js.phtml DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- /**
3
- * InfiniteScroll - Magento Integration
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0),
8
- * available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/afl-3.0.php
10
- *
11
- * @category Strategery
12
- * @package Strategery_Infinitescroll2
13
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
14
- * @copyright Copyright (c) 2011 Strategery Inc. (http://usestrategery.com)
15
- *
16
- * @author Gabriel Somoza (me@gabrielsomoza.com)
17
- * @link http://gabrielsomoza.com/
18
- */
19
- $helper = $this->helper('infinitescroll2');
20
- ?>
21
- jQuery(document).ready(function ($) {
22
- $('<?php echo $helper->getConfigData('selectors/content') ?>').infinitescroll({
23
- <?php echo $helper->getJsConfig(); ?>
24
- });
25
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/strategery/infinitescroll2/toolbar.phtml DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /**
3
- * InfiniteScroll - Magento Integration
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0),
8
- * available through the world-wide-web at this URL:
9
- * http://opensource.org/licenses/afl-3.0.php
10
- *
11
- * @category Strategery
12
- * @package Strategery_Infinitescroll2
13
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
14
- * @copyright Copyright (c) 2011 Strategery Inc. (http://usestrategery.com)
15
- *
16
- * @author Gabriel Somoza (me@gabrielsomoza.com)
17
- * @link http://gabrielsomoza.com/
18
- *
19
- * Update 2.0.0
20
- * @author Damian A. Pastorini (admin@dwdesigner.com)
21
- * @link http://www.dwdesigner.com/
22
- */
23
- ?>
24
- <?php if(Mage::getVersion()>1.3): ?>
25
- <?php if($this->getCollection()->getSize()): ?>
26
- <div class="toolbar" style="display:none;">
27
- <?php echo $this->getPagerHtml() ?>
28
- </div>
29
- <?php endif ?>
30
- <?php else: ?>
31
- <?php if($this->getCollection()->getSize() && $this->getLastPageNum()>1): ?>
32
- <table class="pager" cellspacing="0" style="display:none;">
33
- <tr>
34
- <td class="pages">
35
- <strong><?php echo $this->__('Page:') ?></strong>
36
- <ol>
37
- <?php if (!$this->isFirstPage()): ?>
38
- <li><a href="<?php echo $this->getPreviousPageUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="<?php echo $this->__('Previous') ?>" /></a></li>
39
- <?php endif ?>
40
- <?php foreach ($this->getPages() as $_page): ?>
41
- <?php if ($this->isPageCurrent($_page)): ?>
42
- <li><span class="on"><?php echo $_page ?></span></li>
43
- <?php else: ?>
44
- <li><a href="<?php echo $this->getPageUrl($_page) ?>"><?php echo $_page ?></a></li>
45
- <?php endif ?>
46
- <?php endforeach;; ?>
47
- <?php if (!$this->isLastPage()): ?>
48
- <li><a href="<?php echo $this->getNextPageUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="<?php echo $this->__('Next') ?>" /></a></li>
49
- <?php endif ?>
50
- </ol>
51
- </td>
52
- </tr>
53
- </table>
54
- <?php endif ?>
55
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/layout/strategery-infinitescroll2.xml CHANGED
@@ -37,10 +37,12 @@
37
  <type>js</type>
38
  <name>jquery/jquery.latest.min.js</name>
39
  </action>
 
40
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
41
  <type>js</type>
42
  <name>jquery/infinitescroll2/https.js</name>
43
  </action>
 
44
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
45
  <type>js</type>
46
  <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
@@ -70,10 +72,12 @@
70
  <type>js</type>
71
  <name>jquery/jquery.latest.min.js</name>
72
  </action>
 
73
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
74
  <type>js</type>
75
  <name>jquery/infinitescroll2/https.js</name>
76
  </action>
 
77
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
78
  <type>js</type>
79
  <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
37
  <type>js</type>
38
  <name>jquery/jquery.latest.min.js</name>
39
  </action>
40
+ <!--
41
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
42
  <type>js</type>
43
  <name>jquery/infinitescroll2/https.js</name>
44
  </action>
45
+ -->
46
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
47
  <type>js</type>
48
  <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
72
  <type>js</type>
73
  <name>jquery/jquery.latest.min.js</name>
74
  </action>
75
+ <!--
76
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
77
  <type>js</type>
78
  <name>jquery/infinitescroll2/https.js</name>
79
  </action>
80
+ -->
81
  <action method="addItem" ifconfig="infinitescroll2/general/enabled">
82
  <type>js</type>
83
  <name>jquery/infinitescroll2/jquery.infinitescroll.js</name>
js/jquery/infinitescroll2/behaviors/infinitescroll-magento.js CHANGED
@@ -74,7 +74,110 @@
74
  this.options.wasDoneLastTime=true;
75
  }
76
  callback.call($(opts.contentSelector)[0], data);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  });
79
  });
80
  })(jQuery);
74
  this.options.wasDoneLastTime=true;
75
  }
76
  callback.call($(opts.contentSelector)[0], data);
77
+ },
78
+ // Retrieve next set of content items
79
+ retrieve: function infscr_retrieve(pageNum) {
80
+
81
+ var instance = this,
82
+ opts = instance.options,
83
+ path = opts.path,
84
+ box, frag, desturl, method, condition,
85
+ pageNum = pageNum || null,
86
+ getPage = (!!pageNum) ? pageNum : opts.state.currPage;
87
+ beginAjax = function infscr_ajax(opts) {
88
+
89
+ // increment the URL bit. e.g. /page/3/
90
+ opts.state.currPage++;
91
+
92
+ instance._debug('heading into ajax', path);
93
+
94
+ // if we're dealing with a table we can't use DIVs
95
+ box = $(opts.contentSelector).is('table') ? $('<tbody/>') : $('<div/>');
96
+
97
+ desturl = path.join(opts.state.currPage);
98
+
99
+ desturl += '&scrollCall=1';
100
+
101
+ method = (opts.dataType == 'html' || opts.dataType == 'json' ) ? opts.dataType : 'html+callback';
102
+ if (opts.appendCallback && opts.dataType == 'html') method += '+callback'
103
+
104
+ switch (method) {
105
+
106
+ case 'html+callback':
107
+
108
+ instance._debug('Using HTML via .load() method');
109
+ box.load(desturl + ' ' + opts.itemSelector, null, function infscr_ajax_callback(responseText) {
110
+ instance._loadcallback(box, responseText);
111
+ });
112
+
113
+ break;
114
+
115
+ case 'html':
116
+ instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
117
+ $.ajax({
118
+ // params
119
+ url: desturl,
120
+ dataType: opts.dataType,
121
+ complete: function infscr_ajax_callback(jqXHR, textStatus) {
122
+ condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
123
+ (condition) ? instance._loadcallback(box, jqXHR.responseText) : instance._error('end');
124
+ }
125
+ });
126
+
127
+ break;
128
+ case 'json':
129
+ instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
130
+ $.ajax({
131
+ dataType: 'json',
132
+ type: 'GET',
133
+ url: desturl,
134
+ success: function(data, textStatus, jqXHR) {
135
+ condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
136
+ if(opts.appendCallback) {
137
+ // if appendCallback is true, you must defined template in options.
138
+ // note that data passed into _loadcallback is already an html (after processed in opts.template(data)).
139
+ if(opts.template != undefined) {
140
+ var theData = opts.template(data);
141
+ box.append(theData);
142
+ (condition) ? instance._loadcallback(box, theData) : instance._error('end');
143
+ } else {
144
+ instance._debug("template must be defined.");
145
+ instance._error('end');
146
+ }
147
+ } else {
148
+ // if appendCallback is false, we will pass in the JSON object. you should handle it yourself in your callback.
149
+ (condition) ? instance._loadcallback(box, data) : instance._error('end');
150
+ }
151
+ },
152
+ error: function(jqXHR, textStatus, errorThrown) {
153
+ instance._debug("JSON ajax request failed.");
154
+ instance._error('end');
155
+ }
156
+ });
157
+
158
+ break;
159
+ }
160
+ };
161
+
162
+ // if behavior is defined and this function is extended, call that instead of default
163
+ if (!!opts.behavior && this['retrieve_'+opts.behavior] !== undefined) {
164
+ this['retrieve_'+opts.behavior].call(this,pageNum);
165
+ return;
166
  }
167
+
168
+
169
+ // for manual triggers, if destroyed, get out of here
170
+ if (opts.state.isDestroyed) {
171
+ this._debug('Instance is destroyed');
172
+ return false;
173
+ };
174
+
175
+ // we dont want to fire the ajax multiple times
176
+ opts.state.isDuringAjax = true;
177
+
178
+ opts.loading.start.call($(opts.contentSelector)[0],opts);
179
+
180
+ }
181
  });
182
  });
183
  })(jQuery);
js/jquery/infinitescroll2/jquery.infinitescroll.js CHANGED
@@ -1,706 +1,747 @@
1
- /*
2
- --------------------------------
3
- Infinite Scroll
4
- --------------------------------
5
- + https://github.com/paulirish/infinite-scroll
6
- + version 2.0b2.111027
7
- + Copyright 2011 Paul Irish & Luke Shumard
8
- + Licensed under the MIT license
9
-
10
- + Documentation: http://infinite-scroll.com/
11
-
12
- */
13
-
14
- (function (window, $, undefined) {
15
-
16
- $.infinitescroll = function infscr(options, callback, element) {
17
-
18
- this.element = $(element);
19
- this._create(options, callback);
20
-
21
- };
22
-
23
- $.infinitescroll.defaults = {
24
- loading: {
25
- finished: undefined,
26
- finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
27
- img: "http://www.infinite-scroll.com/loading.gif",
28
- msg: null,
29
- msgText: "<em>Loading the next set of posts...</em>",
30
- selector: null,
31
- speed: 'fast',
32
- start: undefined
33
- },
34
- state: {
35
- isDuringAjax: false,
36
- isInvalidPage: false,
37
- isDestroyed: false,
38
- isDone: false, // For when it goes all the way through the archive.
39
- isPaused: false,
40
- currPage: 1
41
- },
42
- callback: undefined,
43
- debug: false,
44
- behavior: undefined,
45
- binder: $(window), // used to cache the selector
46
- nextSelector: "div.navigation a:first",
47
- navSelector: "div.navigation",
48
- contentSelector: null, // rename to pageFragment
49
- extraScrollPx: 150,
50
- itemSelector: "div.post",
51
- animate: false,
52
- pathParse: undefined,
53
- dataType: 'html',
54
- appendCallback: true,
55
- bufferPx: 40,
56
- errorCallback: function () { },
57
- infid: 0, //Instance ID
58
- pixelsFromNavToBottom: undefined,
59
- path: undefined
60
- };
61
-
62
-
63
- $.infinitescroll.prototype = {
64
-
65
- /*
66
- ----------------------------
67
- Private methods
68
- ----------------------------
69
- */
70
-
71
- // Bind or unbind from scroll
72
- _binding: function infscr_binding(binding) {
73
-
74
- var instance = this,
75
- opts = instance.options;
76
-
77
- opts.v = '2.0b2.111027';
78
-
79
- // if behavior is defined and this function is extended, call that instead of default
80
- if (!!opts.behavior && this['_binding_'+opts.behavior] !== undefined) {
81
- this['_binding_'+opts.behavior].call(this);
82
- return;
83
- }
84
-
85
- if (binding !== 'bind' && binding !== 'unbind') {
86
- this._debug('Binding value ' + binding + ' not valid')
87
- return false;
88
- }
89
-
90
- if (binding == 'unbind') {
91
-
92
- (this.options.binder).unbind('smartscroll.infscr.' + instance.options.infid);
93
-
94
- } else {
95
-
96
- (this.options.binder)[binding]('smartscroll.infscr.' + instance.options.infid, function () {
97
- instance.scroll();
98
- });
99
-
100
- };
101
-
102
- this._debug('Binding', binding);
103
-
104
- },
105
-
106
- // Fundamental aspects of the plugin are initialized
107
- _create: function infscr_create(options, callback) {
108
-
109
- // If selectors from options aren't valid, return false
110
- if (!this._validate(options)) { return false; }
111
- // Define options and shorthand
112
- var opts = this.options = $.extend(true, {}, $.infinitescroll.defaults, options),
113
- // get the relative URL - everything past the domain name.
114
- relurl = /(.*?\/\/).*?(\/.*)/,
115
- path = $(opts.nextSelector).attr('href');
116
-
117
- // contentSelector is 'page fragment' option for .load() / .ajax() calls
118
- opts.contentSelector = opts.contentSelector || this.element;
119
-
120
- // loading.selector - if we want to place the load message in a specific selector, defaulted to the contentSelector
121
- opts.loading.selector = opts.loading.selector || opts.contentSelector;
122
-
123
- // if there's not path, return
124
- if (!path) { this._debug('Navigation selector not found'); return; }
125
-
126
- // Set the path to be a relative URL from root.
127
- opts.path = this._determinepath(path);
128
-
129
- // Define loading.msg
130
- opts.loading.msg = $('<div id="infscr-loading"><img alt="Loading..." src="' + opts.loading.img + '" /><div>' + opts.loading.msgText + '</div></div>');
131
-
132
- // Preload loading.img
133
- (new Image()).src = opts.loading.img;
134
-
135
- // distance from nav links to bottom
136
- // computed as: height of the document + top offset of container - top offset of nav link
137
- opts.pixelsFromNavToBottom = $(document).height() - $(opts.navSelector).offset().top;
138
-
139
- // determine loading.start actions
140
- opts.loading.start = opts.loading.start || function() {
141
-
142
- $(opts.navSelector).hide();
143
- opts.loading.msg
144
- .appendTo(opts.loading.selector)
145
- .show(opts.loading.speed, function () {
146
- beginAjax(opts);
147
- });
148
- };
149
-
150
- // determine loading.finished actions
151
- opts.loading.finished = opts.loading.finished || function() {
152
- opts.loading.msg.fadeOut('normal');
153
- };
154
-
155
- // callback loading
156
- opts.callback = function(instance,data) {
157
- if (!!opts.behavior && instance['_callback_'+opts.behavior] !== undefined) {
158
- instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0], data);
159
- }
160
- if (callback) {
161
- callback.call($(opts.contentSelector)[0], data, opts);
162
- }
163
- };
164
-
165
- this._setup();
166
-
167
- },
168
-
169
- // Console log wrapper
170
- _debug: function infscr_debug() {
171
-
172
- if (this.options && this.options.debug) {
173
- return window.console && console.log.call(console, arguments);
174
- }
175
-
176
- },
177
-
178
- // find the number to increment in the path.
179
- _determinepath: function infscr_determinepath(path) {
180
-
181
- var opts = this.options;
182
-
183
- // if behavior is defined and this function is extended, call that instead of default
184
- if (!!opts.behavior && this['_determinepath_'+opts.behavior] !== undefined) {
185
- this['_determinepath_'+opts.behavior].call(this,path);
186
- return;
187
- }
188
-
189
- if (!!opts.pathParse) {
190
-
191
- this._debug('pathParse manual');
192
- return opts.pathParse();
193
-
194
- } else if (path.match(/^(.*?)\b2\b(.*?$)/)) {
195
- path = path.match(/^(.*?)\b2\b(.*?$)/).slice(1);
196
-
197
- // if there is any 2 in the url at all.
198
- } else if (path.match(/^(.*?)2(.*?$)/)) {
199
-
200
- // page= is used in django:
201
- // http://www.infinite-scroll.com/changelog/comment-page-1/#comment-127
202
- if (path.match(/^(.*?page=)2(\/.*|$)/)) {
203
- path = path.match(/^(.*?page=)2(\/.*|$)/).slice(1);
204
- return path;
205
- }
206
-
207
- path = path.match(/^(.*?)2(.*?$)/).slice(1);
208
-
209
- } else {
210
-
211
- // page= is used in drupal too but second page is page=1 not page=2:
212
- // thx Jerod Fritz, vladikoff
213
- if (path.match(/^(.*?page=)1(\/.*|$)/)) {
214
- path = path.match(/^(.*?page=)1(\/.*|$)/).slice(1);
215
- return path;
216
- } else {
217
- this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');
218
- // Get rid of isInvalidPage to allow permalink to state
219
- opts.state.isInvalidPage = true; //prevent it from running on this page.
220
- }
221
- }
222
- this._debug('determinePath', path);
223
- return path;
224
-
225
- },
226
-
227
- // Custom error
228
- _error: function infscr_error(xhr) {
229
-
230
- var opts = this.options;
231
-
232
- // if behavior is defined and this function is extended, call that instead of default
233
- if (!!opts.behavior && this['_error_'+opts.behavior] !== undefined) {
234
- this['_error_'+opts.behavior].call(this,xhr);
235
- return;
236
- }
237
-
238
- if (xhr !== 'destroy' && xhr !== 'end') {
239
- xhr = 'unknown';
240
- }
241
-
242
- this._debug('Error', xhr);
243
-
244
- if (xhr == 'end') {
245
- this._showdonemsg();
246
- }
247
-
248
- opts.state.isDone = true;
249
- opts.state.currPage = 1; // if you need to go back to this instance
250
- opts.state.isPaused = false;
251
- this._binding('unbind');
252
-
253
- },
254
-
255
- // Load Callback
256
- _loadcallback: function infscr_loadcallback(box, data) {
257
-
258
- var opts = this.options,
259
- callback = this.options.callback, // GLOBAL OBJECT FOR CALLBACK
260
- result = (opts.state.isDone) ? 'done' : (!opts.appendCallback) ? 'no-append' : 'append',
261
- frag;
262
-
263
- // if behavior is defined and this function is extended, call that instead of default
264
- if (!!opts.behavior && this['_loadcallback_'+opts.behavior] !== undefined) {
265
- this['_loadcallback_'+opts.behavior].call(this,box,data);
266
- return;
267
- }
268
-
269
- switch (result) {
270
-
271
- case 'done':
272
-
273
- this._showdonemsg();
274
- return false;
275
-
276
- break;
277
-
278
- case 'no-append':
279
-
280
- if (opts.dataType == 'html') {
281
- data = '<div>' + data + '</div>';
282
- data = $(data).find(opts.itemSelector);
283
- };
284
-
285
- break;
286
-
287
- case 'append':
288
-
289
- var children = box.children();
290
-
291
- // if it didn't return anything
292
- if (children.length == 0) {
293
- return this._error('end');
294
- }
295
-
296
-
297
- // use a documentFragment because it works when content is going into a table or UL
298
- frag = document.createDocumentFragment();
299
- while (box[0].firstChild) {
300
- frag.appendChild(box[0].firstChild);
301
- }
302
-
303
- this._debug('contentSelector', $(opts.contentSelector)[0])
304
- $(opts.contentSelector)[0].appendChild(frag);
305
- // previously, we would pass in the new DOM element as context for the callback
306
- // however we're now using a documentfragment, which doesnt havent parents or children,
307
- // so the context is the contentContainer guy, and we pass in an array
308
- // of the elements collected as the first argument.
309
-
310
- data = children.get();
311
-
312
-
313
- break;
314
-
315
- }
316
-
317
- // loadingEnd function
318
- opts.loading.finished.call($(opts.contentSelector)[0],opts)
319
-
320
-
321
- // smooth scroll to ease in the new content
322
- if (opts.animate) {
323
- var scrollTo = $(window).scrollTop() + $('#infscr-loading').height() + opts.extraScrollPx + 'px';
324
- $('html,body').animate({ scrollTop: scrollTo }, 800, function () { opts.state.isDuringAjax = false; });
325
- }
326
-
327
- if (!opts.animate) opts.state.isDuringAjax = false; // once the call is done, we can allow it again.
328
-
329
- callback(this,data);
330
-
331
- },
332
-
333
- _nearbottom: function infscr_nearbottom() {
334
-
335
- var opts = this.options,
336
- pixelsFromWindowBottomToBottom = 0 + $(document).height() - (opts.binder.scrollTop()) - $(window).height();
337
-
338
- // if behavior is defined and this function is extended, call that instead of default
339
- if (!!opts.behavior && this['_nearbottom_'+opts.behavior] !== undefined) {
340
- this['_nearbottom_'+opts.behavior].call(this);
341
- return;
342
- }
343
-
344
- this._debug('math:', pixelsFromWindowBottomToBottom, opts.pixelsFromNavToBottom);
345
-
346
- // if distance remaining in the scroll (including buffer) is less than the orignal nav to bottom....
347
- return (pixelsFromWindowBottomToBottom - opts.bufferPx < opts.pixelsFromNavToBottom);
348
-
349
- },
350
-
351
- // Pause / temporarily disable plugin from firing
352
- _pausing: function infscr_pausing(pause) {
353
-
354
- var opts = this.options;
355
-
356
- // if behavior is defined and this function is extended, call that instead of default
357
- if (!!opts.behavior && this['_pausing_'+opts.behavior] !== undefined) {
358
- this['_pausing_'+opts.behavior].call(this,pause);
359
- return;
360
- }
361
-
362
- // If pause is not 'pause' or 'resume', toggle it's value
363
- if (pause !== 'pause' && pause !== 'resume' && pause !== null) {
364
- this._debug('Invalid argument. Toggling pause value instead');
365
- };
366
-
367
- pause = (pause && (pause == 'pause' || pause == 'resume')) ? pause : 'toggle';
368
-
369
- switch (pause) {
370
- case 'pause':
371
- opts.state.isPaused = true;
372
- break;
373
-
374
- case 'resume':
375
- opts.state.isPaused = false;
376
- break;
377
-
378
- case 'toggle':
379
- opts.state.isPaused = !opts.state.isPaused;
380
- break;
381
- }
382
-
383
- this._debug('Paused', opts.state.isPaused);
384
- return false;
385
-
386
- },
387
-
388
- // Behavior is determined
389
- // If the behavior option is undefined, it will set to default and bind to scroll
390
- _setup: function infscr_setup() {
391
-
392
- var opts = this.options;
393
-
394
- // if behavior is defined and this function is extended, call that instead of default
395
- if (!!opts.behavior && this['_setup_'+opts.behavior] !== undefined) {
396
- this['_setup_'+opts.behavior].call(this);
397
- return;
398
- }
399
-
400
- this._binding('bind');
401
-
402
- return false;
403
-
404
- },
405
-
406
- // Show done message
407
- _showdonemsg: function infscr_showdonemsg() {
408
-
409
- var opts = this.options;
410
-
411
- // if behavior is defined and this function is extended, call that instead of default
412
- if (!!opts.behavior && this['_showdonemsg_'+opts.behavior] !== undefined) {
413
- this['_showdonemsg_'+opts.behavior].call(this);
414
- return;
415
- }
416
-
417
- opts.loading.msg
418
- .find('img')
419
- .hide()
420
- .parent()
421
- .find('div').html(opts.loading.finishedMsg).animate({ opacity: 1 }, 2000, function () {
422
- $(this).parent().fadeOut('normal');
423
- });
424
-
425
- // user provided callback when done
426
- opts.errorCallback.call($(opts.contentSelector)[0],'done');
427
-
428
- },
429
-
430
- // grab each selector option and see if any fail
431
- _validate: function infscr_validate(opts) {
432
-
433
- for (var key in opts) {
434
- if (key.indexOf && key.indexOf('Selector') > -1 && $(opts[key]).length === 0) {
435
- this._debug('Your ' + key + ' found no elements.');
436
- return false;
437
- }
438
- return true;
439
- }
440
-
441
- },
442
-
443
- /*
444
- ----------------------------
445
- Public methods
446
- ----------------------------
447
- */
448
-
449
- // Bind to scroll
450
- bind: function infscr_bind() {
451
- this._binding('bind');
452
- },
453
-
454
- // Destroy current instance of plugin
455
- destroy: function infscr_destroy() {
456
-
457
- this.options.state.isDestroyed = true;
458
- return this._error('destroy');
459
-
460
- },
461
-
462
- // Set pause value to false
463
- pause: function infscr_pause() {
464
- this._pausing('pause');
465
- },
466
-
467
- // Set pause value to false
468
- resume: function infscr_resume() {
469
- this._pausing('resume');
470
- },
471
-
472
- // Retrieve next set of content items
473
- retrieve: function infscr_retrieve(pageNum) {
474
-
475
- var instance = this,
476
- opts = instance.options,
477
- path = opts.path,
478
- box, frag, desturl, method, condition,
479
- pageNum = pageNum || null,
480
- getPage = (!!pageNum) ? pageNum : opts.state.currPage;
481
- beginAjax = function infscr_ajax(opts) {
482
-
483
- // increment the URL bit. e.g. /page/3/
484
- opts.state.currPage++;
485
-
486
- instance._debug('heading into ajax', path);
487
-
488
- // if we're dealing with a table we can't use DIVs
489
- box = $(opts.contentSelector).is('table') ? $('<tbody/>') : $('<div/>');
490
-
491
- desturl = path.join(opts.state.currPage);
492
-
493
- desturl += '&scrollCall=1';
494
-
495
- method = (opts.dataType == 'html' || opts.dataType == 'json') ? opts.dataType : 'html+callback';
496
- if (opts.appendCallback && opts.dataType == 'html') method += '+callback'
497
-
498
- switch (method) {
499
-
500
- case 'html+callback':
501
-
502
- instance._debug('Using HTML via .load() method');
503
- box.load(desturl + ' ' + opts.itemSelector, null, function infscr_ajax_callback(responseText) {
504
- instance._loadcallback(box, responseText);
505
- });
506
-
507
- break;
508
-
509
- case 'html':
510
- case 'json':
511
-
512
- instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
513
- $.ajax({
514
- // params
515
- url: desturl,
516
- dataType: opts.dataType,
517
- complete: function infscr_ajax_callback(jqXHR, textStatus) {
518
- condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
519
- (condition) ? instance._loadcallback(box, jqXHR.responseText) : instance._error('end');
520
- }
521
- });
522
-
523
- break;
524
- }
525
- };
526
-
527
- // if behavior is defined and this function is extended, call that instead of default
528
- if (!!opts.behavior && this['retrieve_'+opts.behavior] !== undefined) {
529
- this['retrieve_'+opts.behavior].call(this,pageNum);
530
- return;
531
- }
532
-
533
-
534
- // for manual triggers, if destroyed, get out of here
535
- if (opts.state.isDestroyed) {
536
- this._debug('Instance is destroyed');
537
- return false;
538
- };
539
-
540
- // we dont want to fire the ajax multiple times
541
- opts.state.isDuringAjax = true;
542
-
543
- opts.loading.start.call($(opts.contentSelector)[0],opts);
544
-
545
- },
546
-
547
- // Check to see next page is needed
548
- scroll: function infscr_scroll() {
549
-
550
- var opts = this.options,
551
- state = opts.state;
552
-
553
- // if behavior is defined and this function is extended, call that instead of default
554
- if (!!opts.behavior && this['scroll_'+opts.behavior] !== undefined) {
555
- this['scroll_'+opts.behavior].call(this);
556
- return;
557
- }
558
-
559
- if (state.isDuringAjax || state.isInvalidPage || state.isDone || state.isDestroyed || state.isPaused) return;
560
-
561
- if (!this._nearbottom()) return;
562
-
563
- this.retrieve();
564
-
565
- },
566
-
567
- // Toggle pause value
568
- toggle: function infscr_toggle() {
569
- this._pausing();
570
- },
571
-
572
- // Unbind from scroll
573
- unbind: function infscr_unbind() {
574
- this._binding('unbind');
575
- },
576
-
577
- // update options
578
- update: function infscr_options(key) {
579
- if ($.isPlainObject(key)) {
580
- this.options = $.extend(true,this.options,key);
581
- }
582
- }
583
-
584
- }
585
-
586
-
587
- /*
588
- ----------------------------
589
- Infinite Scroll function
590
- ----------------------------
591
-
592
- Borrowed logic from the following...
593
-
594
- jQuery UI
595
- - https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
596
-
597
- jCarousel
598
- - https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js
599
-
600
- Masonry
601
- - https://github.com/desandro/masonry/blob/master/jquery.masonry.js
602
-
603
- */
604
-
605
- $.fn.infinitescroll = function infscr_init(options, callback) {
606
-
607
-
608
- var thisCall = typeof options;
609
-
610
- switch (thisCall) {
611
-
612
- // method
613
- case 'string':
614
-
615
- var args = Array.prototype.slice.call(arguments, 1);
616
-
617
- this.each(function () {
618
-
619
- var instance = $.data(this, 'infinitescroll');
620
-
621
- if (!instance) {
622
- // not setup yet
623
- // return $.error('Method ' + options + ' cannot be called until Infinite Scroll is setup');
624
- return false;
625
- }
626
- if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
627
- // return $.error('No such method ' + options + ' for Infinite Scroll');
628
- return false;
629
- }
630
-
631
- // no errors!
632
- instance[options].apply(instance, args);
633
-
634
- });
635
-
636
- break;
637
-
638
- // creation
639
- case 'object':
640
-
641
- this.each(function () {
642
-
643
- var instance = $.data(this, 'infinitescroll');
644
-
645
- if (instance) {
646
-
647
- // update options of current instance
648
- instance.update(options);
649
-
650
- } else {
651
-
652
- // initialize new instance
653
- $.data(this, 'infinitescroll', new $.infinitescroll(options, callback, this));
654
-
655
- }
656
-
657
- });
658
-
659
- break;
660
-
661
- }
662
-
663
- return this;
664
-
665
- };
666
-
667
-
668
-
669
- /*
670
- * smartscroll: debounced scroll event for jQuery *
671
- * https://github.com/lukeshumard/smartscroll
672
- * Based on smartresize by @louis_remi: https://github.com/lrbabe/jquery.smartresize.js *
673
- * Copyright 2011 Louis-Remi & Luke Shumard * Licensed under the MIT license. *
674
- */
675
-
676
- var event = $.event,
677
- scrollTimeout;
678
-
679
- event.special.smartscroll = {
680
- setup: function () {
681
- $(this).bind("scroll", event.special.smartscroll.handler);
682
- },
683
- teardown: function () {
684
- $(this).unbind("scroll", event.special.smartscroll.handler);
685
- },
686
- handler: function (event, execAsap) {
687
- // Save the context
688
- var context = this,
689
- args = arguments;
690
-
691
- // set correct event type
692
- event.type = "smartscroll";
693
-
694
- if (scrollTimeout) { clearTimeout(scrollTimeout); }
695
- scrollTimeout = setTimeout(function () {
696
- $.event.handle.apply(context, args);
697
- }, execAsap === "execAsap" ? 0 : 100);
698
- }
699
- };
700
-
701
- $.fn.smartscroll = function (fn) {
702
- return fn ? this.bind("smartscroll", fn) : this.trigger("smartscroll", ["execAsap"]);
703
- };
704
-
705
-
706
- })(window, jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ --------------------------------
3
+ Infinite Scroll
4
+ --------------------------------
5
+ + https://github.com/paulirish/infinite-scroll
6
+ + version 2.0b2.120519
7
+ + Copyright 2011/12 Paul Irish & Luke Shumard
8
+ + Licensed under the MIT license
9
+
10
+ + Documentation: http://infinite-scroll.com/
11
+
12
+ */
13
+
14
+ (function (window, $, undefined) {
15
+
16
+ $.infinitescroll = function infscr(options, callback, element) {
17
+
18
+ this.element = $(element);
19
+
20
+ // Flag the object in the event of a failed creation
21
+ if (!this._create(options, callback)) {
22
+ this.failed = true;
23
+ }
24
+
25
+ };
26
+
27
+ $.infinitescroll.defaults = {
28
+ loading: {
29
+ finished: undefined,
30
+ finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
31
+ img: "http://www.infinite-scroll.com/loading.gif",
32
+ msg: null,
33
+ msgText: "<em>Loading the next set of posts...</em>",
34
+ selector: null,
35
+ speed: 'fast',
36
+ start: undefined
37
+ },
38
+ state: {
39
+ isDuringAjax: false,
40
+ isInvalidPage: false,
41
+ isDestroyed: false,
42
+ isDone: false, // For when it goes all the way through the archive.
43
+ isPaused: false,
44
+ currPage: 1
45
+ },
46
+ callback: undefined,
47
+ debug: false,
48
+ behavior: undefined,
49
+ binder: $(window), // used to cache the selector
50
+ nextSelector: "div.navigation a:first",
51
+ navSelector: "div.navigation",
52
+ contentSelector: null, // rename to pageFragment
53
+ extraScrollPx: 150,
54
+ itemSelector: "div.post",
55
+ animate: false,
56
+ pathParse: undefined,
57
+ dataType: 'html',
58
+ appendCallback: true,
59
+ bufferPx: 40,
60
+ errorCallback: function () { },
61
+ infid: 0, //Instance ID
62
+ pixelsFromNavToBottom: undefined,
63
+ path: undefined
64
+ };
65
+
66
+
67
+ $.infinitescroll.prototype = {
68
+
69
+ /*
70
+ ----------------------------
71
+ Private methods
72
+ ----------------------------
73
+ */
74
+
75
+ // Bind or unbind from scroll
76
+ _binding: function infscr_binding(binding) {
77
+
78
+ var instance = this,
79
+ opts = instance.options;
80
+
81
+ opts.v = '2.0b2.111027';
82
+
83
+ // if behavior is defined and this function is extended, call that instead of default
84
+ if (!!opts.behavior && this['_binding_'+opts.behavior] !== undefined) {
85
+ this['_binding_'+opts.behavior].call(this);
86
+ return;
87
+ }
88
+
89
+ if (binding !== 'bind' && binding !== 'unbind') {
90
+ this._debug('Binding value ' + binding + ' not valid')
91
+ return false;
92
+ }
93
+
94
+ if (binding == 'unbind') {
95
+
96
+ (this.options.binder).unbind('smartscroll.infscr.' + instance.options.infid);
97
+
98
+ } else {
99
+
100
+ (this.options.binder)[binding]('smartscroll.infscr.' + instance.options.infid, function () {
101
+ instance.scroll();
102
+ });
103
+
104
+ };
105
+
106
+ this._debug('Binding', binding);
107
+
108
+ },
109
+
110
+ // Fundamental aspects of the plugin are initialized
111
+ _create: function infscr_create(options, callback) {
112
+
113
+ // Add custom options to defaults
114
+ var opts = $.extend(true, {}, $.infinitescroll.defaults, options);
115
+
116
+ // Validate selectors
117
+ if (!this._validate(options)) { return false; }
118
+ this.options = opts;
119
+
120
+ // Validate page fragment path
121
+ var path = $(opts.nextSelector).attr('href');
122
+ if (!path) {
123
+ this._debug('Navigation selector not found');
124
+ return false;
125
+ }
126
+
127
+ // Set the path to be a relative URL from root.
128
+ opts.path = this._determinepath(path);
129
+
130
+ // contentSelector is 'page fragment' option for .load() / .ajax() calls
131
+ opts.contentSelector = opts.contentSelector || this.element;
132
+
133
+ // loading.selector - if we want to place the load message in a specific selector, defaulted to the contentSelector
134
+ opts.loading.selector = opts.loading.selector || opts.contentSelector;
135
+
136
+ // Define loading.msg
137
+ opts.loading.msg = $('<div id="infscr-loading"><img alt="Loading..." src="' + opts.loading.img + '" /><div>' + opts.loading.msgText + '</div></div>');
138
+
139
+ // Preload loading.img
140
+ (new Image()).src = opts.loading.img;
141
+
142
+ // distance from nav links to bottom
143
+ // computed as: height of the document + top offset of container - top offset of nav link
144
+ opts.pixelsFromNavToBottom = $(document).height() - $(opts.navSelector).offset().top;
145
+
146
+ // determine loading.start actions
147
+ opts.loading.start = opts.loading.start || function() {
148
+
149
+ $(opts.navSelector).hide();
150
+ opts.loading.msg
151
+ .appendTo(opts.loading.selector)
152
+ .show(opts.loading.speed, function () {
153
+ beginAjax(opts);
154
+ });
155
+ };
156
+
157
+ // determine loading.finished actions
158
+ opts.loading.finished = opts.loading.finished || function() {
159
+ opts.loading.msg.fadeOut('normal');
160
+ };
161
+
162
+ // callback loading
163
+ opts.callback = function(instance,data) {
164
+ if (!!opts.behavior && instance['_callback_'+opts.behavior] !== undefined) {
165
+ instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0], data);
166
+ }
167
+ if (callback) {
168
+ callback.call($(opts.contentSelector)[0], data, opts);
169
+ }
170
+ };
171
+
172
+ this._setup();
173
+
174
+ // Return true to indicate successful creation
175
+ return true;
176
+ },
177
+
178
+ // Console log wrapper
179
+ _debug: function infscr_debug() {
180
+
181
+ if (this.options && this.options.debug) {
182
+ return window.console && console.log.call(console, arguments);
183
+ }
184
+
185
+ },
186
+
187
+ // find the number to increment in the path.
188
+ _determinepath: function infscr_determinepath(path) {
189
+
190
+ var opts = this.options;
191
+
192
+ // if behavior is defined and this function is extended, call that instead of default
193
+ if (!!opts.behavior && this['_determinepath_'+opts.behavior] !== undefined) {
194
+ this['_determinepath_'+opts.behavior].call(this,path);
195
+ return;
196
+ }
197
+
198
+ if (!!opts.pathParse) {
199
+
200
+ this._debug('pathParse manual');
201
+ return opts.pathParse(path, this.options.state.currPage+1);
202
+
203
+ } else if (path.match(/^(.*?)\b2\b(.*?$)/)) {
204
+ path = path.match(/^(.*?)\b2\b(.*?$)/).slice(1);
205
+
206
+ // if there is any 2 in the url at all.
207
+ } else if (path.match(/^(.*?)2(.*?$)/)) {
208
+
209
+ // page= is used in django:
210
+ // http://www.infinite-scroll.com/changelog/comment-page-1/#comment-127
211
+ if (path.match(/^(.*?page=)2(\/.*|$)/)) {
212
+ path = path.match(/^(.*?page=)2(\/.*|$)/).slice(1);
213
+ return path;
214
+ }
215
+
216
+ path = path.match(/^(.*?)2(.*?$)/).slice(1);
217
+
218
+ } else {
219
+
220
+ // page= is used in drupal too but second page is page=1 not page=2:
221
+ // thx Jerod Fritz, vladikoff
222
+ if (path.match(/^(.*?page=)1(\/.*|$)/)) {
223
+ path = path.match(/^(.*?page=)1(\/.*|$)/).slice(1);
224
+ return path;
225
+ } else {
226
+ this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');
227
+ // Get rid of isInvalidPage to allow permalink to state
228
+ opts.state.isInvalidPage = true; //prevent it from running on this page.
229
+ }
230
+ }
231
+ this._debug('determinePath', path);
232
+ return path;
233
+
234
+ },
235
+
236
+ // Custom error
237
+ _error: function infscr_error(xhr) {
238
+
239
+ var opts = this.options;
240
+
241
+ // if behavior is defined and this function is extended, call that instead of default
242
+ if (!!opts.behavior && this['_error_'+opts.behavior] !== undefined) {
243
+ this['_error_'+opts.behavior].call(this,xhr);
244
+ return;
245
+ }
246
+
247
+ if (xhr !== 'destroy' && xhr !== 'end') {
248
+ xhr = 'unknown';
249
+ }
250
+
251
+ this._debug('Error', xhr);
252
+
253
+ if (xhr == 'end') {
254
+ this._showdonemsg();
255
+ }
256
+
257
+ opts.state.isDone = true;
258
+ opts.state.currPage = 1; // if you need to go back to this instance
259
+ opts.state.isPaused = false;
260
+ this._binding('unbind');
261
+
262
+ },
263
+
264
+ // Load Callback
265
+ _loadcallback: function infscr_loadcallback(box, data) {
266
+
267
+ var opts = this.options,
268
+ callback = this.options.callback, // GLOBAL OBJECT FOR CALLBACK
269
+ result = (opts.state.isDone) ? 'done' : (!opts.appendCallback) ? 'no-append' : 'append',
270
+ frag;
271
+
272
+ // if behavior is defined and this function is extended, call that instead of default
273
+ if (!!opts.behavior && this['_loadcallback_'+opts.behavior] !== undefined) {
274
+ this['_loadcallback_'+opts.behavior].call(this,box,data);
275
+ return;
276
+ }
277
+
278
+ switch (result) {
279
+
280
+ case 'done':
281
+
282
+ this._showdonemsg();
283
+ return false;
284
+
285
+ break;
286
+
287
+ case 'no-append':
288
+
289
+ if (opts.dataType == 'html') {
290
+ data = '<div>' + data + '</div>';
291
+ data = $(data).find(opts.itemSelector);
292
+ }
293
+
294
+ break;
295
+
296
+ case 'append':
297
+
298
+ var children = box.children();
299
+
300
+ // if it didn't return anything
301
+ if (children.length == 0) {
302
+ return this._error('end');
303
+ }
304
+
305
+
306
+ // use a documentFragment because it works when content is going into a table or UL
307
+ frag = document.createDocumentFragment();
308
+ while (box[0].firstChild) {
309
+ frag.appendChild(box[0].firstChild);
310
+ }
311
+
312
+ this._debug('contentSelector', $(opts.contentSelector)[0])
313
+ $(opts.contentSelector)[0].appendChild(frag);
314
+ // previously, we would pass in the new DOM element as context for the callback
315
+ // however we're now using a documentfragment, which doesnt havent parents or children,
316
+ // so the context is the contentContainer guy, and we pass in an array
317
+ // of the elements collected as the first argument.
318
+
319
+ data = children.get();
320
+
321
+
322
+ break;
323
+
324
+ }
325
+
326
+ // loadingEnd function
327
+ opts.loading.finished.call($(opts.contentSelector)[0],opts)
328
+
329
+
330
+ // smooth scroll to ease in the new content
331
+ if (opts.animate) {
332
+ var scrollTo = $(window).scrollTop() + $('#infscr-loading').height() + opts.extraScrollPx + 'px';
333
+ $('html,body').animate({ scrollTop: scrollTo }, 800, function () { opts.state.isDuringAjax = false; });
334
+ }
335
+
336
+ if (!opts.animate) opts.state.isDuringAjax = false; // once the call is done, we can allow it again.
337
+
338
+ callback(this,data);
339
+
340
+ },
341
+
342
+ _nearbottom: function infscr_nearbottom() {
343
+
344
+ var opts = this.options,
345
+ pixelsFromWindowBottomToBottom = 0 + $(document).height() - (opts.binder.scrollTop()) - $(window).height();
346
+
347
+ // if behavior is defined and this function is extended, call that instead of default
348
+ if (!!opts.behavior && this['_nearbottom_'+opts.behavior] !== undefined) {
349
+ return this['_nearbottom_'+opts.behavior].call(this);
350
+ }
351
+
352
+ this._debug('math:', pixelsFromWindowBottomToBottom, opts.pixelsFromNavToBottom);
353
+
354
+ // if distance remaining in the scroll (including buffer) is less than the orignal nav to bottom....
355
+ return (pixelsFromWindowBottomToBottom - opts.bufferPx < opts.pixelsFromNavToBottom);
356
+
357
+ },
358
+
359
+ // Pause / temporarily disable plugin from firing
360
+ _pausing: function infscr_pausing(pause) {
361
+
362
+ var opts = this.options;
363
+
364
+ // if behavior is defined and this function is extended, call that instead of default
365
+ if (!!opts.behavior && this['_pausing_'+opts.behavior] !== undefined) {
366
+ this['_pausing_'+opts.behavior].call(this,pause);
367
+ return;
368
+ }
369
+
370
+ // If pause is not 'pause' or 'resume', toggle it's value
371
+ if (pause !== 'pause' && pause !== 'resume' && pause !== null) {
372
+ this._debug('Invalid argument. Toggling pause value instead');
373
+ };
374
+
375
+ pause = (pause && (pause == 'pause' || pause == 'resume')) ? pause : 'toggle';
376
+
377
+ switch (pause) {
378
+ case 'pause':
379
+ opts.state.isPaused = true;
380
+ break;
381
+
382
+ case 'resume':
383
+ opts.state.isPaused = false;
384
+ break;
385
+
386
+ case 'toggle':
387
+ opts.state.isPaused = !opts.state.isPaused;
388
+ break;
389
+ }
390
+
391
+ this._debug('Paused', opts.state.isPaused);
392
+ return false;
393
+
394
+ },
395
+
396
+ // Behavior is determined
397
+ // If the behavior option is undefined, it will set to default and bind to scroll
398
+ _setup: function infscr_setup() {
399
+
400
+ var opts = this.options;
401
+
402
+ // if behavior is defined and this function is extended, call that instead of default
403
+ if (!!opts.behavior && this['_setup_'+opts.behavior] !== undefined) {
404
+ this['_setup_'+opts.behavior].call(this);
405
+ return;
406
+ }
407
+
408
+ this._binding('bind');
409
+
410
+ return false;
411
+
412
+ },
413
+
414
+ // Show done message
415
+ _showdonemsg: function infscr_showdonemsg() {
416
+
417
+ var opts = this.options;
418
+
419
+ // if behavior is defined and this function is extended, call that instead of default
420
+ if (!!opts.behavior && this['_showdonemsg_'+opts.behavior] !== undefined) {
421
+ this['_showdonemsg_'+opts.behavior].call(this);
422
+ return;
423
+ }
424
+
425
+ opts.loading.msg
426
+ .find('img')
427
+ .hide()
428
+ .parent()
429
+ .find('div').html(opts.loading.finishedMsg).animate({ opacity: 1 }, 2000, function () {
430
+ $(this).parent().fadeOut('normal');
431
+ });
432
+
433
+ // user provided callback when done
434
+ opts.errorCallback.call($(opts.contentSelector)[0],'done');
435
+
436
+ },
437
+
438
+ // grab each selector option and see if any fail
439
+ _validate: function infscr_validate(opts) {
440
+
441
+ for (var key in opts) {
442
+ if (key.indexOf && key.indexOf('Selector') > -1 && $(opts[key]).length === 0) {
443
+ this._debug('Your ' + key + ' found no elements.');
444
+ return false;
445
+ }
446
+ }
447
+
448
+ return true;
449
+
450
+ },
451
+
452
+ /*
453
+ ----------------------------
454
+ Public methods
455
+ ----------------------------
456
+ */
457
+
458
+ // Bind to scroll
459
+ bind: function infscr_bind() {
460
+ this._binding('bind');
461
+ },
462
+
463
+ // Destroy current instance of plugin
464
+ destroy: function infscr_destroy() {
465
+
466
+ this.options.state.isDestroyed = true;
467
+ return this._error('destroy');
468
+
469
+ },
470
+
471
+ // Set pause value to false
472
+ pause: function infscr_pause() {
473
+ this._pausing('pause');
474
+ },
475
+
476
+ // Set pause value to false
477
+ resume: function infscr_resume() {
478
+ this._pausing('resume');
479
+ },
480
+
481
+ // Retrieve next set of content items
482
+ retrieve: function infscr_retrieve(pageNum) {
483
+
484
+ var instance = this,
485
+ opts = instance.options,
486
+ path = opts.path,
487
+ box, frag, desturl, method, condition,
488
+ pageNum = pageNum || null,
489
+ getPage = (!!pageNum) ? pageNum : opts.state.currPage;
490
+ beginAjax = function infscr_ajax(opts) {
491
+
492
+ // increment the URL bit. e.g. /page/3/
493
+ opts.state.currPage++;
494
+
495
+ instance._debug('heading into ajax', path);
496
+
497
+ // if we're dealing with a table we can't use DIVs
498
+ box = $(opts.contentSelector).is('table') ? $('<tbody/>') : $('<div/>');
499
+
500
+ desturl = path.join(opts.state.currPage);
501
+
502
+ method = (opts.dataType == 'html' || opts.dataType == 'json' ) ? opts.dataType : 'html+callback';
503
+ if (opts.appendCallback && opts.dataType == 'html') method += '+callback'
504
+
505
+ switch (method) {
506
+
507
+ case 'html+callback':
508
+
509
+ instance._debug('Using HTML via .load() method');
510
+ box.load(desturl + ' ' + opts.itemSelector, null, function infscr_ajax_callback(responseText) {
511
+ instance._loadcallback(box, responseText);
512
+ });
513
+
514
+ break;
515
+
516
+ case 'html':
517
+ instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
518
+ $.ajax({
519
+ // params
520
+ url: desturl,
521
+ dataType: opts.dataType,
522
+ complete: function infscr_ajax_callback(jqXHR, textStatus) {
523
+ condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
524
+ (condition) ? instance._loadcallback(box, jqXHR.responseText) : instance._error('end');
525
+ }
526
+ });
527
+
528
+ break;
529
+ case 'json':
530
+ instance._debug('Using ' + (method.toUpperCase()) + ' via $.ajax() method');
531
+ $.ajax({
532
+ dataType: 'json',
533
+ type: 'GET',
534
+ url: desturl,
535
+ success: function(data, textStatus, jqXHR) {
536
+ condition = (typeof (jqXHR.isResolved) !== 'undefined') ? (jqXHR.isResolved()) : (textStatus === "success" || textStatus === "notmodified");
537
+ if(opts.appendCallback) {
538
+ // if appendCallback is true, you must defined template in options.
539
+ // note that data passed into _loadcallback is already an html (after processed in opts.template(data)).
540
+ if(opts.template != undefined) {
541
+ var theData = opts.template(data);
542
+ box.append(theData);
543
+ (condition) ? instance._loadcallback(box, theData) : instance._error('end');
544
+ } else {
545
+ instance._debug("template must be defined.");
546
+ instance._error('end');
547
+ }
548
+ } else {
549
+ // if appendCallback is false, we will pass in the JSON object. you should handle it yourself in your callback.
550
+ (condition) ? instance._loadcallback(box, data) : instance._error('end');
551
+ }
552
+ },
553
+ error: function(jqXHR, textStatus, errorThrown) {
554
+ instance._debug("JSON ajax request failed.");
555
+ instance._error('end');
556
+ }
557
+ });
558
+
559
+ break;
560
+ }
561
+ };
562
+
563
+ // if behavior is defined and this function is extended, call that instead of default
564
+ if (!!opts.behavior && this['retrieve_'+opts.behavior] !== undefined) {
565
+ this['retrieve_'+opts.behavior].call(this,pageNum);
566
+ return;
567
+ }
568
+
569
+
570
+ // for manual triggers, if destroyed, get out of here
571
+ if (opts.state.isDestroyed) {
572
+ this._debug('Instance is destroyed');
573
+ return false;
574
+ };
575
+
576
+ // we dont want to fire the ajax multiple times
577
+ opts.state.isDuringAjax = true;
578
+
579
+ opts.loading.start.call($(opts.contentSelector)[0],opts);
580
+
581
+ },
582
+
583
+ // Check to see next page is needed
584
+ scroll: function infscr_scroll() {
585
+
586
+ var opts = this.options,
587
+ state = opts.state;
588
+
589
+ // if behavior is defined and this function is extended, call that instead of default
590
+ if (!!opts.behavior && this['scroll_'+opts.behavior] !== undefined) {
591
+ this['scroll_'+opts.behavior].call(this);
592
+ return;
593
+ }
594
+
595
+ if (state.isDuringAjax || state.isInvalidPage || state.isDone || state.isDestroyed || state.isPaused) return;
596
+
597
+ if (!this._nearbottom()) return;
598
+
599
+ this.retrieve();
600
+
601
+ },
602
+
603
+ // Toggle pause value
604
+ toggle: function infscr_toggle() {
605
+ this._pausing();
606
+ },
607
+
608
+ // Unbind from scroll
609
+ unbind: function infscr_unbind() {
610
+ this._binding('unbind');
611
+ },
612
+
613
+ // update options
614
+ update: function infscr_options(key) {
615
+ if ($.isPlainObject(key)) {
616
+ this.options = $.extend(true,this.options,key);
617
+ }
618
+ }
619
+
620
+ }
621
+
622
+
623
+ /*
624
+ ----------------------------
625
+ Infinite Scroll function
626
+ ----------------------------
627
+
628
+ Borrowed logic from the following...
629
+
630
+ jQuery UI
631
+ - https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
632
+
633
+ jCarousel
634
+ - https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js
635
+
636
+ Masonry
637
+ - https://github.com/desandro/masonry/blob/master/jquery.masonry.js
638
+
639
+ */
640
+
641
+ $.fn.infinitescroll = function infscr_init(options, callback) {
642
+
643
+
644
+ var thisCall = typeof options;
645
+
646
+ switch (thisCall) {
647
+
648
+ // method
649
+ case 'string':
650
+
651
+ var args = Array.prototype.slice.call(arguments, 1);
652
+
653
+ this.each(function () {
654
+
655
+ var instance = $.data(this, 'infinitescroll');
656
+
657
+ if (!instance) {
658
+ // not setup yet
659
+ // return $.error('Method ' + options + ' cannot be called until Infinite Scroll is setup');
660
+ return false;
661
+ }
662
+ if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
663
+ // return $.error('No such method ' + options + ' for Infinite Scroll');
664
+ return false;
665
+ }
666
+
667
+ // no errors!
668
+ instance[options].apply(instance, args);
669
+
670
+ });
671
+
672
+ break;
673
+
674
+ // creation
675
+ case 'object':
676
+
677
+ this.each(function () {
678
+
679
+ var instance = $.data(this, 'infinitescroll');
680
+
681
+ if (instance) {
682
+
683
+ // update options of current instance
684
+ instance.update(options);
685
+
686
+ } else {
687
+
688
+ // initialize new instance
689
+ instance = new $.infinitescroll(options, callback, this);
690
+
691
+ // don't attach if instantiation failed
692
+ if (!instance.failed) {
693
+ $.data(this, 'infinitescroll', instance);
694
+ }
695
+
696
+ }
697
+
698
+ });
699
+
700
+ break;
701
+
702
+ }
703
+
704
+ return this;
705
+
706
+ };
707
+
708
+
709
+
710
+ /*
711
+ * smartscroll: debounced scroll event for jQuery *
712
+ * https://github.com/lukeshumard/smartscroll
713
+ * Based on smartresize by @louis_remi: https://github.com/lrbabe/jquery.smartresize.js *
714
+ * Copyright 2011 Louis-Remi & Luke Shumard * Licensed under the MIT license. *
715
+ */
716
+
717
+ var event = $.event,
718
+ scrollTimeout;
719
+
720
+ event.special.smartscroll = {
721
+ setup: function () {
722
+ $(this).bind("scroll", event.special.smartscroll.handler);
723
+ },
724
+ teardown: function () {
725
+ $(this).unbind("scroll", event.special.smartscroll.handler);
726
+ },
727
+ handler: function (event, execAsap) {
728
+ // Save the context
729
+ var context = this,
730
+ args = arguments;
731
+
732
+ // set correct event type
733
+ event.type = "smartscroll";
734
+
735
+ if (scrollTimeout) { clearTimeout(scrollTimeout); }
736
+ scrollTimeout = setTimeout(function () {
737
+ $.event.handle.apply(context, args);
738
+ }, execAsap === "execAsap" ? 0 : 100);
739
+ }
740
+ };
741
+
742
+ $.fn.smartscroll = function (fn) {
743
+ return fn ? this.bind("smartscroll", fn) : this.trigger("smartscroll", ["execAsap"]);
744
+ };
745
+
746
+
747
+ })(window, jQuery);
js/jquery/infinitescroll2/jquery.infinitescroll.min.js CHANGED
@@ -1,47 +1,31 @@
1
- /*
2
- --------------------------------
3
- Infinite Scroll
4
- --------------------------------
5
- + https://github.com/paulirish/infinitescroll
6
- + version 2.0b2.110713
7
- + Copyright 2011 Paul Irish & Luke Shumard
8
- + Licensed under the MIT license
9
-
10
- + Documentation: http://infinite-scroll.com/
11
-
12
- */
13
-
14
- (function(window,$,undefined){$.infinitescroll=function infscr(options,callback,element){this.element=$(element);this._create(options,callback);};$.infinitescroll.defaults={loading:{finished:undefined,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"http://www.infinite-scroll.com/loading.gif",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:'fast',start:undefined},state:{isDuringAjax:false,isInvalidPage:false,isDestroyed:false,isDone:false,isPaused:false,currPage:1},callback:undefined,debug:false,behavior:undefined,binder:$(window),nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,pathParse:undefined,dataType:'html',appendCallback:true,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:undefined,path:undefined};$.infinitescroll.prototype={_binding:function infscr_binding(binding){var instance=this,opts=instance.options;if(!!opts.behavior&&this['_binding_'+opts.behavior]!==undefined){this['_binding_'+opts.behavior].call(this);return;}
15
- if(binding!=='bind'&&binding!=='unbind'){this._debug('Binding value '+binding+' not valid')
16
- return false;}
17
- if(binding=='unbind'){(this.options.binder).unbind('smartscroll.infscr.'+instance.options.infid);}else{(this.options.binder)[binding]('smartscroll.infscr.'+instance.options.infid,function(){instance.scroll();});};this._debug('Binding',binding);},_create:function infscr_create(options,callback){if(!this._validate(options)){return false;}
18
- var opts=this.options=$.extend(true,{},$.infinitescroll.defaults,options),relurl=/(.*?\/\/).*?(\/.*)/,path=$(opts.nextSelector).attr('href');opts.contentSelector=opts.contentSelector||this.element;opts.loading.selector=opts.loading.selector||opts.contentSelector;if(!path){this._debug('Navigation selector not found');return;}
19
- opts.path=this._determinepath(path);opts.loading.msg=$('<div id="infscr-loading"><img alt="Loading..." src="'+opts.loading.img+'" /><div>'+opts.loading.msgText+'</div></div>');(new Image()).src=opts.loading.img;opts.pixelsFromNavToBottom=$(document).height()-$(opts.navSelector).offset().top;opts.loading.start=opts.loading.start||function(){$(opts.navSelector).hide();opts.loading.msg.appendTo(opts.loading.selector).show(opts.loading.speed,function(){beginAjax(opts);});};opts.loading.finished=opts.loading.finished||function(){opts.loading.msg.fadeOut('normal');};opts.callback=function(instance,data){if(!!opts.behavior&&instance['_callback_'+opts.behavior]!==undefined){instance['_callback_'+opts.behavior].call($(opts.contentSelector)[0],data);}
20
- if(callback){callback.call($(opts.contentSelector)[0],data);}};this._setup();},_debug:function infscr_debug(){if(this.options.debug){return window.console&&console.log.call(console,arguments);}},_determinepath:function infscr_determinepath(path){var opts=this.options;if(!!opts.behavior&&this['_determinepath_'+opts.behavior]!==undefined){this['_determinepath_'+opts.behavior].call(this,path);return;}
21
- if(!!opts.pathParse){this._debug('pathParse manual');return opts.pathParse;}else if(path.match(/^(.*?)\b2\b(.*?$)/)){path=path.match(/^(.*?)\b2\b(.*?$)/).slice(1);}else if(path.match(/^(.*?)2(.*?$)/)){if(path.match(/^(.*?page=)2(\/.*|$)/)){path=path.match(/^(.*?page=)2(\/.*|$)/).slice(1);return path;}
22
- path=path.match(/^(.*?)2(.*?$)/).slice(1);}else{if(path.match(/^(.*?page=)1(\/.*|$)/)){path=path.match(/^(.*?page=)1(\/.*|$)/).slice(1);return path;}else{this._debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.');opts.state.isInvalidPage=true;}}
23
- this._debug('determinePath',path);return path;},_error:function infscr_error(xhr){var opts=this.options;if(!!opts.behavior&&this['_error_'+opts.behavior]!==undefined){this['_error_'+opts.behavior].call(this,xhr);return;}
24
- if(xhr!=='destroy'&&xhr!=='end'){xhr='unknown';}
25
- this._debug('Error',xhr);if(xhr=='end'){this._showdonemsg();}
26
- opts.state.isDone=true;opts.state.currPage=1;opts.state.isPaused=false;this._binding('unbind');},_loadcallback:function infscr_loadcallback(box,data){var opts=this.options,callback=this.options.callback,result=(opts.state.isDone)?'done':(!opts.appendCallback)?'no-append':'append',frag;if(!!opts.behavior&&this['_loadcallback_'+opts.behavior]!==undefined){this['_loadcallback_'+opts.behavior].call(this,box,data);return;}
27
- switch(result){case'done':this._showdonemsg();return false;break;case'no-append':if(opts.dataType=='html'){data='<div>'+data+'</div>';data=$(data).find(opts.itemSelector);};break;case'append':var children=box.children();if(children.length==0){return this._error('end');}
28
- frag=document.createDocumentFragment();while(box[0].firstChild){frag.appendChild(box[0].firstChild);}
29
- this._debug('contentSelector',$(opts.contentSelector)[0])
30
- $(opts.contentSelector)[0].appendChild(frag);data=children.get();break;}
31
- opts.loading.finished.call($(opts.contentSelector)[0],opts)
32
- if(opts.animate){var scrollTo=$(window).scrollTop()+$('#infscr-loading').height()+opts.extraScrollPx+'px';$('html,body').animate({scrollTop:scrollTo},800,function(){opts.state.isDuringAjax=false;});}
33
- if(!opts.animate)opts.state.isDuringAjax=false;callback(this,data);},_nearbottom:function infscr_nearbottom(){var opts=this.options,pixelsFromWindowBottomToBottom=0+$(document).height()-(opts.binder.scrollTop())-$(window).height();if(!!opts.behavior&&this['_nearbottom_'+opts.behavior]!==undefined){this['_nearbottom_'+opts.behavior].call(this);return;}
34
- this._debug('math:',pixelsFromWindowBottomToBottom,opts.pixelsFromNavToBottom);return(pixelsFromWindowBottomToBottom-opts.bufferPx<opts.pixelsFromNavToBottom);},_pausing:function infscr_pausing(pause){var opts=this.options;if(!!opts.behavior&&this['_pausing_'+opts.behavior]!==undefined){this['_pausing_'+opts.behavior].call(this,pause);return;}
35
- if(pause!=='pause'&&pause!=='resume'&&pause!==null){this._debug('Invalid argument. Toggling pause value instead');};pause=(pause&&(pause=='pause'||pause=='resume'))?pause:'toggle';switch(pause){case'pause':opts.state.isPaused=true;break;case'resume':opts.state.isPaused=false;break;case'toggle':opts.state.isPaused=!opts.state.isPaused;break;}
36
- this._debug('Paused',opts.state.isPaused);return false;},_setup:function infscr_setup(){var opts=this.options;if(!!opts.behavior&&this['_setup_'+opts.behavior]!==undefined){this['_setup_'+opts.behavior].call(this);return;}
37
- this._binding('bind');return false;},_showdonemsg:function infscr_showdonemsg(){var opts=this.options;if(!!opts.behavior&&this['_showdonemsg_'+opts.behavior]!==undefined){this['_showdonemsg_'+opts.behavior].call(this);return;}
38
- opts.loading.msg.find('img').hide().parent().find('div').html(opts.loading.finishedMsg).animate({opacity:1},2000,function(){$(this).parent().fadeOut('normal');});opts.errorCallback.call($(opts.contentSelector)[0],'done');},_validate:function infscr_validate(opts){for(var key in opts){if(key.indexOf&&key.indexOf('Selector')>-1&&$(opts[key]).length===0){this._debug('Your '+key+' found no elements.');return false;}
39
- return true;}},bind:function infscr_bind(){this._binding('bind');},destroy:function infscr_destroy(){this.options.state.isDestroyed=true;return this._error('destroy');},pause:function infscr_pause(){this._pausing('pause');},resume:function infscr_resume(){this._pausing('resume');},retrieve:function infscr_retrieve(pageNum){var instance=this,opts=instance.options,path=opts.path,box,frag,desturl,method,condition,pageNum=pageNum||null,getPage=(!!pageNum)?pageNum:opts.state.currPage;beginAjax=function infscr_ajax(opts){opts.state.currPage++;instance._debug('heading into ajax',path);box=$(opts.contentSelector).is('table')?$('<tbody/>'):$('<div/>');desturl=path.join(opts.state.currPage);method=(opts.dataType=='html'||opts.dataType=='json')?opts.dataType:'html+callback';if(opts.appendCallback&&opts.dataType=='html')method+='+callback'
40
- switch(method){case'html+callback':instance._debug('Using HTML via .load() method');box.load(desturl+' '+opts.itemSelector,null,function infscr_ajax_callback(responseText){instance._loadcallback(box,responseText);});break;case'html':case'json':instance._debug('Using '+(method.toUpperCase())+' via $.ajax() method');$.ajax({url:desturl,dataType:opts.dataType,complete:function infscr_ajax_callback(jqXHR,textStatus){condition=(typeof(jqXHR.isResolved)!=='undefined')?(jqXHR.isResolved()):(textStatus==="success"||textStatus==="notmodified");(condition)?instance._loadcallback(box,jqXHR.responseText):instance._error('end');}});break;}};if(!!opts.behavior&&this['retrieve_'+opts.behavior]!==undefined){this['retrieve_'+opts.behavior].call(this,pageNum);return;}
41
- if(opts.state.isDestroyed){this._debug('Instance is destroyed');return false;};opts.state.isDuringAjax=true;opts.loading.start.call($(opts.contentSelector)[0],opts);},scroll:function infscr_scroll(){var opts=this.options,state=opts.state;if(!!opts.behavior&&this['scroll_'+opts.behavior]!==undefined){this['scroll_'+opts.behavior].call(this);return;}
42
- if(state.isDuringAjax||state.isInvalidPage||state.isDone||state.isDestroyed||state.isPaused)return;if(!this._nearbottom())return;this.retrieve();},toggle:function infscr_toggle(){this._pausing();},unbind:function infscr_unbind(){this._binding('unbind');},update:function infscr_options(key){if($.isPlainObject(key)){this.options=$.extend(true,this.options,key);}}}
43
- $.fn.infinitescroll=function infscr_init(options,callback){var thisCall=typeof options;switch(thisCall){case'string':var args=Array.prototype.slice.call(arguments,1);this.each(function(){var instance=$.data(this,'infinitescroll');if(!instance){return false;}
44
- if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return false;}
45
- instance[options].apply(instance,args);});break;case'object':this.each(function(){var instance=$.data(this,'infinitescroll');if(instance){instance.update(options);}else{$.data(this,'infinitescroll',new $.infinitescroll(options,callback,this));}});break;}
46
- return this;};var event=$.event,scrollTimeout;event.special.smartscroll={setup:function(){$(this).bind("scroll",event.special.smartscroll.handler);},teardown:function(){$(this).unbind("scroll",event.special.smartscroll.handler);},handler:function(event,execAsap){var context=this,args=arguments;event.type="smartscroll";if(scrollTimeout){clearTimeout(scrollTimeout);}
47
- scrollTimeout=setTimeout(function(){$.event.handle.apply(context,args);},execAsap==="execAsap"?0:100);}};$.fn.smartscroll=function(fn){return fn?this.bind("smartscroll",fn):this.trigger("smartscroll",["execAsap"]);};})(window,jQuery);
1
+ /*
2
+ --------------------------------
3
+ Infinite Scroll
4
+ --------------------------------
5
+ + https://github.com/paulirish/infinite-scroll
6
+ + version 2.0b2.120519
7
+ + Copyright 2011/12 Paul Irish & Luke Shumard
8
+ + Licensed under the MIT license
9
+
10
+ + Documentation: http://infinite-scroll.com/
11
+
12
+ */
13
+
14
+ (function(h,d,e){d.infinitescroll=function(a,c,b){this.element=d(b);this._create(a,c)||(this.failed=!0)};d.infinitescroll.defaults={loading:{finished:e,finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",img:"http://www.infinite-scroll.com/loading.gif",msg:null,msgText:"<em>Loading the next set of posts...</em>",selector:null,speed:"fast",start:e},state:{isDuringAjax:!1,isInvalidPage:!1,isDestroyed:!1,isDone:!1,isPaused:!1,currPage:1},callback:e,debug:!1,behavior:e,binder:d(h),
15
+ nextSelector:"div.navigation a:first",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:!1,pathParse:e,dataType:"html",appendCallback:!0,bufferPx:40,errorCallback:function(){},infid:0,pixelsFromNavToBottom:e,path:e};d.infinitescroll.prototype={_binding:function(a){var c=this,b=c.options;b.v="2.0b2.111027";if(b.behavior&&this["_binding_"+b.behavior]!==e)this["_binding_"+b.behavior].call(this);else{if("bind"!==a&&"unbind"!==a)return this._debug("Binding value "+
16
+ a+" not valid"),!1;if("unbind"==a)this.options.binder.unbind("smartscroll.infscr."+c.options.infid);else this.options.binder[a]("smartscroll.infscr."+c.options.infid,function(){c.scroll()});this._debug("Binding",a)}},_create:function(a,c){var b=d.extend(!0,{},d.infinitescroll.defaults,a);if(!this._validate(a))return!1;this.options=b;var g=d(b.nextSelector).attr("href");if(!g)return this._debug("Navigation selector not found"),!1;b.path=this._determinepath(g);b.contentSelector=b.contentSelector||this.element;
17
+ b.loading.selector=b.loading.selector||b.contentSelector;b.loading.msg=d('<div id="infscr-loading"><img alt="Loading..." src="'+b.loading.img+'" /><div>'+b.loading.msgText+"</div></div>");(new Image).src=b.loading.img;b.pixelsFromNavToBottom=d(document).height()-d(b.navSelector).offset().top;b.loading.start=b.loading.start||function(){d(b.navSelector).hide();b.loading.msg.appendTo(b.loading.selector).show(b.loading.speed,function(){beginAjax(b)})};b.loading.finished=b.loading.finished||function(){b.loading.msg.fadeOut("normal")};
18
+ b.callback=function(a,g){b.behavior&&a["_callback_"+b.behavior]!==e&&a["_callback_"+b.behavior].call(d(b.contentSelector)[0],g);c&&c.call(d(b.contentSelector)[0],g,b)};this._setup();return!0},_debug:function(){if(this.options&&this.options.debug)return h.console&&console.log.call(console,arguments)},_determinepath:function(a){var c=this.options;if(c.behavior&&this["_determinepath_"+c.behavior]!==e)this["_determinepath_"+c.behavior].call(this,a);else{if(c.pathParse)return this._debug("pathParse manual"),
19
+ c.pathParse(a,this.options.state.currPage+1);if(a.match(/^(.*?)\b2\b(.*?$)/))a=a.match(/^(.*?)\b2\b(.*?$)/).slice(1);else if(a.match(/^(.*?)2(.*?$)/)){if(a.match(/^(.*?page=)2(\/.*|$)/))return a=a.match(/^(.*?page=)2(\/.*|$)/).slice(1);a=a.match(/^(.*?)2(.*?$)/).slice(1)}else{if(a.match(/^(.*?page=)1(\/.*|$)/))return a=a.match(/^(.*?page=)1(\/.*|$)/).slice(1);this._debug("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");
20
+ c.state.isInvalidPage=!0}this._debug("determinePath",a);return a}},_error:function(a){var c=this.options;c.behavior&&this["_error_"+c.behavior]!==e?this["_error_"+c.behavior].call(this,a):("destroy"!==a&&"end"!==a&&(a="unknown"),this._debug("Error",a),"end"==a&&this._showdonemsg(),c.state.isDone=!0,c.state.currPage=1,c.state.isPaused=!1,this._binding("unbind"))},_loadcallback:function(a,c){var b=this.options,g=this.options.callback,f=b.state.isDone?"done":!b.appendCallback?"no-append":"append";if(b.behavior&&
21
+ this["_loadcallback_"+b.behavior]!==e)this["_loadcallback_"+b.behavior].call(this,a,c);else{switch(f){case "done":return this._showdonemsg(),!1;case "no-append":"html"==b.dataType&&(c=d("<div>"+c+"</div>").find(b.itemSelector));break;case "append":var i=a.children();if(0==i.length)return this._error("end");for(f=document.createDocumentFragment();a[0].firstChild;)f.appendChild(a[0].firstChild);this._debug("contentSelector",d(b.contentSelector)[0]);d(b.contentSelector)[0].appendChild(f);c=i.get()}b.loading.finished.call(d(b.contentSelector)[0],
22
+ b);b.animate&&(f=d(h).scrollTop()+d("#infscr-loading").height()+b.extraScrollPx+"px",d("html,body").animate({scrollTop:f},800,function(){b.state.isDuringAjax=!1}));b.animate||(b.state.isDuringAjax=!1);g(this,c)}},_nearbottom:function(){var a=this.options,c=0+d(document).height()-a.binder.scrollTop()-d(h).height();if(a.behavior&&this["_nearbottom_"+a.behavior]!==e)return this["_nearbottom_"+a.behavior].call(this);this._debug("math:",c,a.pixelsFromNavToBottom);return c-a.bufferPx<a.pixelsFromNavToBottom},
23
+ _pausing:function(a){var c=this.options;if(c.behavior&&this["_pausing_"+c.behavior]!==e)this["_pausing_"+c.behavior].call(this,a);else{"pause"!==a&&("resume"!==a&&null!==a)&&this._debug("Invalid argument. Toggling pause value instead");switch(a&&("pause"==a||"resume"==a)?a:"toggle"){case "pause":c.state.isPaused=!0;break;case "resume":c.state.isPaused=!1;break;case "toggle":c.state.isPaused=!c.state.isPaused}this._debug("Paused",c.state.isPaused);return!1}},_setup:function(){var a=this.options;if(a.behavior&&
24
+ this["_setup_"+a.behavior]!==e)this["_setup_"+a.behavior].call(this);else return this._binding("bind"),!1},_showdonemsg:function(){var a=this.options;a.behavior&&this["_showdonemsg_"+a.behavior]!==e?this["_showdonemsg_"+a.behavior].call(this):(a.loading.msg.find("img").hide().parent().find("div").html(a.loading.finishedMsg).animate({opacity:1},2E3,function(){d(this).parent().fadeOut("normal")}),a.errorCallback.call(d(a.contentSelector)[0],"done"))},_validate:function(a){for(var c in a)if(c.indexOf&&
25
+ -1<c.indexOf("Selector")&&0===d(a[c]).length)return this._debug("Your "+c+" found no elements."),!1;return!0},bind:function(){this._binding("bind")},destroy:function(){this.options.state.isDestroyed=!0;return this._error("destroy")},pause:function(){this._pausing("pause")},resume:function(){this._pausing("resume")},retrieve:function(a){var c=this,b=c.options,g=b.path,f,i,j,h,a=a||null;beginAjax=function(a){a.state.currPage++;c._debug("heading into ajax",g);f=d(a.contentSelector).is("table")?d("<tbody/>"):
26
+ d("<div/>");i=g.join(a.state.currPage);j="html"==a.dataType||"json"==a.dataType?a.dataType:"html+callback";a.appendCallback&&"html"==a.dataType&&(j+="+callback");switch(j){case "html+callback":c._debug("Using HTML via .load() method");f.load(i+" "+a.itemSelector,null,function(a){c._loadcallback(f,a)});break;case "html":c._debug("Using "+j.toUpperCase()+" via $.ajax() method");d.ajax({url:i,dataType:a.dataType,complete:function(a,b){(h="undefined"!==typeof a.isResolved?a.isResolved():"success"===b||
27
+ "notmodified"===b)?c._loadcallback(f,a.responseText):c._error("end")}});break;case "json":c._debug("Using "+j.toUpperCase()+" via $.ajax() method"),d.ajax({dataType:"json",type:"GET",url:i,success:function(b,d,g){h="undefined"!==typeof g.isResolved?g.isResolved():"success"===d||"notmodified"===d;a.appendCallback?a.template!=e?(b=a.template(b),f.append(b),h?c._loadcallback(f,b):c._error("end")):(c._debug("template must be defined."),c._error("end")):h?c._loadcallback(f,b):c._error("end")},error:function(){c._debug("JSON ajax request failed.");
28
+ c._error("end")}})}};if(b.behavior&&this["retrieve_"+b.behavior]!==e)this["retrieve_"+b.behavior].call(this,a);else{if(b.state.isDestroyed)return this._debug("Instance is destroyed"),!1;b.state.isDuringAjax=!0;b.loading.start.call(d(b.contentSelector)[0],b)}},scroll:function(){var a=this.options,c=a.state;a.behavior&&this["scroll_"+a.behavior]!==e?this["scroll_"+a.behavior].call(this):!c.isDuringAjax&&!c.isInvalidPage&&!c.isDone&&!c.isDestroyed&&!c.isPaused&&this._nearbottom()&&this.retrieve()},toggle:function(){this._pausing()},
29
+ unbind:function(){this._binding("unbind")},update:function(a){d.isPlainObject(a)&&(this.options=d.extend(!0,this.options,a))}};d.fn.infinitescroll=function(a,c){switch(typeof a){case "string":var b=Array.prototype.slice.call(arguments,1);this.each(function(){var c=d.data(this,"infinitescroll");if(!c||!d.isFunction(c[a])||"_"===a.charAt(0))return!1;c[a].apply(c,b)});break;case "object":this.each(function(){var b=d.data(this,"infinitescroll");b?b.update(a):(b=new d.infinitescroll(a,c,this),b.failed||
30
+ d.data(this,"infinitescroll",b))})}return this};var k=d.event,l;k.special.smartscroll={setup:function(){d(this).bind("scroll",k.special.smartscroll.handler)},teardown:function(){d(this).unbind("scroll",k.special.smartscroll.handler)},handler:function(a,c){var b=this,e=arguments;a.type="smartscroll";l&&clearTimeout(l);l=setTimeout(function(){d.event.handle.apply(b,e)},"execAsap"===c?0:100)}};d.fn.smartscroll=function(a){return a?this.bind("smartscroll",a):this.trigger("smartscroll",["execAsap"])}})(window,
31
+ jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Strategery_InfiniteScroll2</name>
4
- <version>2.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
7
  <channel>community</channel>
@@ -22,9 +22,9 @@ System / Configuration / Catalog / Infinite Scroll.</description>
22
  <notes>Automatic load next page of current product list.&#xD;
23
  Support for Magento 1.3 up to 1.7</notes>
24
  <authors><author><name>Damian Alberto Pastorini</name><user>auto-converted</user><email>damian.pastorini@usestrategery.com</email></author></authors>
25
- <date>2012-07-16</date>
26
- <time>11:28:17</time>
27
- <contents><target name="mageetc"><dir name="modules"><file name="Strategery_Infinitescroll2.xml" hash="8724cb82b6d47b9996610029e302e5d4"/></dir></target><target name="magecommunity"><dir name="Strategery"><dir name="Infinitescroll2"><dir name="Helper"><file name="Data.php" hash="5690979b341d6877b80192ffebfb2a0b"/></dir><dir name="Model"><dir name="Catalog"><file name="Observer.php" hash="fcc920e038096a630ad4f784f63bab1d"/></dir></dir><dir name="controllers"><file name="JsController.php" hash="3d97abe7a35b69bb70e6bb3ab1414f47"/></dir><dir name="etc"><file name="config.xml" hash="8d4db2acf34c38ecd212d060813219e6"/><file name="system.xml" hash="96e002433cdd53e932ef84fd016e607f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="strategery-infinitescroll2.xml" hash="03bd0db6aec27c180dc88d5a4aa08942"/></dir><dir name="template"><dir name="strategery"><dir name="infinitescroll2"><file name="js.phtml" hash="e45eb017f11a203291c8c1a66eb7f606"/><file name="toolbar.phtml" hash="d16882d540e2c23501f84a64e33c67e2"/></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="strategery-infinitescroll2.xml" hash="03bd0db6aec27c180dc88d5a4aa08942"/></dir><dir name="template"><dir name="strategery"><dir name="infinitescroll2"><file name="js.phtml" hash="e45eb017f11a203291c8c1a66eb7f606"/><file name="toolbar.phtml" hash="d16882d540e2c23501f84a64e33c67e2"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="jquery"><dir name="infinitescroll2"><dir name="behaviors"><file name="infinitescroll-magento.js" hash="de9f632d8480e67a36f884aa79d08949"/></dir><file name="https.js" hash="be476c35fecb93b0a88625d8bc8a128b"/><file name="jquery.infinitescroll.js" hash="50dd89bf91ee4a0eb886826cf8bbf319"/><file name="jquery.infinitescroll.min.js" hash="7cb38aca89caf614b2c3894f01d19727"/></dir><file name="jquery.latest.min.js" hash="7ffe78e450bedfa8878241c3abc5edba"/></dir></dir></target></contents>
28
  <compatible/>
29
  <dependencies/>
30
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Strategery_InfiniteScroll2</name>
4
+ <version>2.1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/afl-3.0.php">Academic Free License (AFL 3.0)</license>
7
  <channel>community</channel>
22
  <notes>Automatic load next page of current product list.&#xD;
23
  Support for Magento 1.3 up to 1.7</notes>
24
  <authors><author><name>Damian Alberto Pastorini</name><user>auto-converted</user><email>damian.pastorini@usestrategery.com</email></author></authors>
25
+ <date>2012-07-27</date>
26
+ <time>14:17:55</time>
27
+ <contents><target name="mageetc"><dir name="modules"><file name="Strategery_Infinitescroll2.xml" hash="8724cb82b6d47b9996610029e302e5d4"/></dir></target><target name="magecommunity"><dir name="Strategery"><dir name="Infinitescroll2"><dir name="Helper"><file name="Data.php" hash="5690979b341d6877b80192ffebfb2a0b"/></dir><dir name="Model"><dir name="Catalog"><file name="Observer.php" hash="706b95a5db767f6d2c8a3c002804edeb"/></dir></dir><dir name="controllers"><file name="JsController.php" hash="3d97abe7a35b69bb70e6bb3ab1414f47"/></dir><dir name="etc"><file name="config.xml" hash="5b1b9aa315e33a4b4a1980c26a233b62"/><file name="system.xml" hash="96e002433cdd53e932ef84fd016e607f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="strategery-infinitescroll2.xml" hash=""/></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="strategery-infinitescroll2.xml" hash="af08113f68cc80131079c098fd6610ab"/></dir><dir name="template"><dir name="strategery"><dir name="infinitescroll2"><file name="js.phtml" hash="e45eb017f11a203291c8c1a66eb7f606"/><file name="toolbar.phtml" hash="d16882d540e2c23501f84a64e33c67e2"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="jquery"><dir name="infinitescroll2"><dir name="behaviors"><file name="infinitescroll-magento.js" hash="88a5a092c68911819302952e2128fe34"/></dir><file name="https.js" hash="be476c35fecb93b0a88625d8bc8a128b"/><file name="jquery.infinitescroll.js" hash="862b580a996c3f7a9daa1fcc1fae808d"/><file name="jquery.infinitescroll.min.js" hash="24131ba057a50077af7a97dfa1fcde30"/></dir><file name="jquery.latest.min.js" hash="7ffe78e450bedfa8878241c3abc5edba"/></dir></dir></target></contents>
28
  <compatible/>
29
  <dependencies/>
30
  </package>