Dolphin_ScrollUp - Version 1.0.0

Version Notes

This extension is compatible with Magento CE 1.4 to 1.7.

Download this release

Release Info

Developer ankitdolphin
Extension Dolphin_ScrollUp
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Dolphin/Scrollup/Block/Scrollup.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Dolphin_Scrollup_Block_Scrollup extends Mage_Core_Block_Template
3
+ {
4
+ protected function _prepareLayout()
5
+ {
6
+
7
+ }
8
+ }
9
+ ?>
app/code/community/Dolphin/Scrollup/Helper/Data.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Dolphin_Scrollup_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ public function getConfig($path = "design/scrollup")
5
+ {
6
+ $store = Mage::app()->getStore()->getId();
7
+ return Mage::getStoreConfig($path,$store);
8
+ }
9
+ public function isEnabled()
10
+ {
11
+ return $this->getConfig('design/scrollup/enabled');
12
+ }
13
+ }
14
+ ?>
app/code/community/Dolphin/Scrollup/Model/System/Elementtype.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Dolphin_Scrollup_Model_System_Elementtype
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array('value' => 'image', 'label'=>Mage::helper('dlscrollup')->__('Image')),
8
+ array('value' => 'pill', 'label'=>Mage::helper('dlscrollup')->__('Pill')),
9
+ array('value' => 'tab', 'label'=>Mage::helper('dlscrollup')->__('Tab')),
10
+ array('value' => 'link', 'label'=>Mage::helper('dlscrollup')->__('Link')),
11
+ );
12
+ }
13
+ }
14
+ ?>
app/code/community/Dolphin/Scrollup/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <dlscrollup translate="title" module="dlscrollup">
12
+ <title>Page Scroll Up</title>
13
+ <sort_order>0</sort_order>
14
+ </dlscrollup>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Dolphin/Scrollup/etc/config.xml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Dolphin_Scrollup>
5
+ <version>1.0.0</version>
6
+ </Dolphin_Scrollup>
7
+ </modules>
8
+ <global>
9
+ <blocks>
10
+ <dlscrollup>
11
+ <class>Dolphin_Scrollup_Block</class>
12
+ </dlscrollup>
13
+ </blocks>
14
+ <helpers>
15
+ <dlscrollup>
16
+ <class>Dolphin_Scrollup_Helper</class>
17
+ </dlscrollup>
18
+ </helpers>
19
+ <models>
20
+ <dlscrollup>
21
+ <class>Dolphin_Scrollup_Model</class>
22
+ </dlscrollup>
23
+ </models>
24
+ </global>
25
+ <frontend>
26
+ <layout>
27
+ <updates>
28
+ <dlscrollup>
29
+ <file>scrollup.xml</file>
30
+ </dlscrollup>
31
+ </updates>
32
+ </layout>
33
+ </frontend>
34
+ <default>
35
+ <design>
36
+ <scrollup>
37
+ <enabled>0</enabled>
38
+ <scrollduration>0.5</scrollduration>
39
+ <scrolloffset>0</scrolloffset>
40
+ <scrollactiveoverlay>75</scrollactiveoverlay>
41
+ <elementtype>image</elementtype>
42
+ <scrolltoptext>Top</scrolltoptext>
43
+ <scrolltopimage>default/scrollup.png</scrolltopimage>
44
+ </scrollup>
45
+ </design>
46
+ </default>
47
+ </config>
app/code/community/Dolphin/Scrollup/etc/system.xml ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <sections>
4
+ <design translate="label" module="dlscrollup">
5
+ <groups>
6
+ <scrollup translate="label">
7
+ <label>Page Scroll Up</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>700</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <enabled translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>1</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ <comment>page scroll will show on all pages.</comment>
23
+ </enabled>
24
+ <scrollduration>
25
+ <label>Page Scroll Duration</label>
26
+ <frontend_type>text</frontend_type>
27
+ <sort_order>10</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>0</show_in_store>
31
+ <comment>page scroll speed.(Integer Value)</comment>
32
+ </scrollduration>
33
+ <scrolloffset>
34
+ <label>Page Scroll Offset</label>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>20</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>0</show_in_store>
40
+ </scrolloffset>
41
+ <scrollactiveoverlay>
42
+ <label>Page Scroll Point</label>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>40</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>0</show_in_store>
48
+ <comment>from where scroll top button will show.(Integer Value)</comment>
49
+ </scrollactiveoverlay>
50
+ <elementtype>
51
+ <label>Page Scroll Anchore Type</label>
52
+ <frontend_type>select</frontend_type>
53
+ <source_model>dlscrollup/system_elementtype</source_model>
54
+ <sort_order>50</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>0</show_in_store>
58
+ <comment>Scroll Top Element Style</comment>
59
+ </elementtype>
60
+ <scrolltoptext>
61
+ <label>Scroll Anchore Text</label>
62
+ <frontend_type>text</frontend_type>
63
+ <sort_order>60</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>0</show_in_store>
67
+ <comment>Page Scroll Link Text for link type. Use as title for other elements(Image, Pill, Tab)</comment>
68
+ </scrolltoptext>
69
+ <scrolltopimage>
70
+ <label>Scroll Anchore Image</label>
71
+ <frontend_type>image</frontend_type>
72
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
73
+ <upload_dir config="system/filesystem/media" scope_info="1">dlsu</upload_dir>
74
+ <base_url type="media" scope_info="1">dlsu</base_url>
75
+ <sort_order>70</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ <comment>Use for type image only. Allowed file types: jpeg, gif, png.</comment>
80
+ </scrolltopimage>
81
+ </fields>
82
+ </scrollup>
83
+ </groups>
84
+ </design>
85
+ </sections>
86
+ </config>
app/design/frontend/default/default/layout/scrollup.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="1.0.1">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs" ifconfig="design/scrollup/enabled">
6
+ <script>dolphin/scrollup/DLSU.js</script>
7
+ </action>
8
+ <action method="addCss" ifconfig="design/scrollup/enabled">
9
+ <script>dolphin/scrollup/css/scrollup.css</script>
10
+ </action>
11
+ </reference>
12
+ <reference name="before_body_end">
13
+ <block type="core/template" name="dolphin.scrollup">
14
+ <action method="setTemplate" ifconfig="design/scrollup/enabled">
15
+ <template>dl_scrollup/init.phtml</template>
16
+ </action>
17
+ </block>
18
+ </reference>
19
+ </default>
20
+ </layout>
app/design/frontend/default/default/template/dl_scrollup/init.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $configs = Mage::helper('dlscrollup')->getConfig();?>
2
+ <script type="text/javascript">
3
+ document.observe('dom:loaded', function(){
4
+ var dlsuOb = new DLSU('dlscrollup',{duration: <?php echo $configs['scrollduration']?>,offset:<?php echo $configs['scrolloffset']?>,activeOverlay:<?php echo $configs['scrollactiveoverlay']?>});
5
+ });
6
+ </script>
7
+ <div id="dlscrollup" class="element-type-<?php echo $configs['elementtype'] ?>" style="display: none;">
8
+ <a id="testlink" href="#" title="<?php echo $configs['scrolltoptext']; ?>">
9
+ <?php
10
+ switch ($configs['elementtype']) {
11
+ case 'link':
12
+ echo $configs['scrolltoptext'];
13
+ break;
14
+ case 'image':
15
+ echo '<img src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."dlsu/".$configs['scrolltopimage'].'" alt="'.$configs['scrolltoptext'].'"/>';
16
+ break;
17
+ case 'pill':
18
+ echo '<span class="scroll-up-pill">'.$configs['scrolltoptext'].'</span>';
19
+ break;
20
+ case 'tab':
21
+ echo '<span class="scroll-up-tab">'.$configs['scrolltoptext'].'</span>';
22
+ break;
23
+ default:
24
+ echo $configs['scrolltoptext'];
25
+ }
26
+ ?>
27
+ </a>
28
+ </div>
app/etc/modules/Dolphin_Scrollup.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Dolphin_Scrollup>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Dolphin_Scrollup>
8
+ </modules>
9
+ </config>
js/dolphin/scrollup/DLSU.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ DLSU = Class.create();
2
+ DLSU.prototype = {
3
+ initialize: function(id,config){
4
+ mergeoptions = new Object(this.defaults.merge(config));
5
+ this.config = mergeoptions.toObject();
6
+ document.addEventListener('scroll', this.start.bind(this));
7
+ window.addEventListener('resize', this.start.bind(this));
8
+ window.addEventListener('load', this.start.bind(this));
9
+ this.config.anchorElem = $(id);
10
+ },
11
+ defaults: $H({
12
+ duration: 0.5,
13
+ offset: 0,
14
+ activeOverlay: 75
15
+ }),
16
+ start: function(){
17
+ scrollOffsets = document.viewport.getScrollOffsets();
18
+ scrollTop = scrollOffsets.top;
19
+ if(scrollTop >= this.config.activeOverlay){
20
+ this.toggleAnchor(true,this.config.anchorElem);
21
+ this.config.anchorElem.down("a").observe('click', function(ce){
22
+ Event.stop(ce);
23
+ Effect.ScrollTo($$('html body')[0],{duration:this.config.duration,offset:this.config.offset,transition: Effect.Transitions.linear});
24
+ }.bind(this));
25
+ }
26
+ else{
27
+ this.toggleAnchor(false,this.config.anchorElem);
28
+ }
29
+ },
30
+ toggleAnchor: function(action,elem){
31
+ if(action){
32
+ elem.show();
33
+ }
34
+ else{
35
+ elem.hide();
36
+ }
37
+ }
38
+ }
media/dlsu/default/scrollup.png ADDED
Binary file
package.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Dolphin_ScrollUp</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Dolphin Scrollup is an extension to scroll up pages from bottom to top of your store. It's fully customisable.</summary>
10
+ <description>Dolphin Scrollup is an extension to scroll up pages from bottom to top of your store. It's fully customisable from admin.&#xD;
11
+ &#xD;
12
+ Dolphin Scrollup Features&#xD;
13
+ &#xD;
14
+ 1. 100% free to use and easy to install via Magento Connect.&#xD;
15
+ 2. Requires no changes in magenta core files.&#xD;
16
+ 3. Developed using Prototype.so No Jquery Confict on your store.&#xD;
17
+ 4. Custom Set Page Scroll Speed.&#xD;
18
+ 5. Custom Set Page Scroll Offset (Offset- Set Stop Scroll from top of part).&#xD;
19
+ 6. Custom Set Page Scroll Point (Point - Visible Scroll images/text after set point).&#xD;
20
+ 7. Custom Set Page Scroll Link Type (Type : Images/Link/Pill/Tab).&#xD;
21
+ 8. Custom Set Scroll Text which display on Front.&#xD;
22
+ 9. Allows you to upload your custom image for Link type 'Image'.&#xD;
23
+ 10. Use Prototype lib instead of jQuery to avoid javascript conflicts and errors.&#xD;
24
+ 11. Containing compress javascript, css.&#xD;
25
+ </description>
26
+ <notes>This extension is compatible with Magento CE 1.4 to 1.7.</notes>
27
+ <authors><author><name>ankitdolphin</name><user>ankitdolphin</user><email>ankit@dolphinwebsolution.com</email></author></authors>
28
+ <date>2013-04-27</date>
29
+ <time>08:45:06</time>
30
+ <contents><target name="magecommunity"><dir name="Dolphin"><dir name="Scrollup"><dir name="Block"><file name="Scrollup.php" hash="302d5e697a9bd3f8e86ce0ce0971084d"/></dir><dir name="Helper"><file name="Data.php" hash="c99f97430b9b215953d102bbbda977a2"/></dir><dir name="Model"><dir name="System"><file name="Elementtype.php" hash="f88fa59b901df4436c918ac8a083474a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="7460ff66dc47f31fa7db5f4dbd19c79a"/><file name="config.xml" hash="b2a37167bd320ef5d0b7f9fea6273096"/><file name="system.xml" hash="5749f9c9216297d9eb54db3b167f1e49"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="dl_scrollup"><file name="init.phtml" hash="29e123fd87decb5e88f37c5496bc6cd3"/></dir></dir><dir name="layout"><file name="scrollup.xml" hash="9ea9717eb04b3f00f56a6da89bf7bb75"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dolphin_Scrollup.xml" hash="22da41b03c49aea0b5b43f0ef7ac74e9"/></dir></target><target name="mageweb"><dir name="."><dir name="js"><dir name="dolphin"><dir name="scrollup"><file name="DLSU.js" hash="2837db1dacf88b61e53d7a67d418e310"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="dolphin"><dir name="scrollup"><dir name="css"><file name="scrollup.css" hash="714a8f3c8a1b3f476b459d3151df3090"/></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="dlsu"><dir name="default"><file name="scrollup.png" hash="cfa0168d68e1c0c4992e0172b83c6950"/></dir></dir></target></contents>
31
+ <compatible/>
32
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
33
+ </package>
skin/frontend/default/default/dolphin/scrollup/css/scrollup.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @CHARSET "UTF-8";
2
+ #dlscrollup{
3
+ bottom: 45px;
4
+ position: fixed;
5
+ right: 30px;
6
+ }
7
+ #dlscrollup a{
8
+ text-decoration: none;
9
+ }
10
+ #dlscrollup.element-type-pill:hover a .scroll-up-pill{
11
+ background: #000;
12
+ transition: background 200ms linear 0s;
13
+ }
14
+ #dlscrollup.element-type-link a{text-decoration: underline; font-size: 14px;}
15
+ #dlscrollup.element-type-tab{
16
+ bottom: -10px;
17
+ transition: bottom 150ms linear 0s;
18
+ }
19
+ #dlscrollup.element-type-tab:hover{
20
+ bottom:0;
21
+ transition: bottom 150ms linear 0s;
22
+ }
23
+ .scroll-up-pill{
24
+ background: none repeat scroll 0 0 #555;
25
+ border-radius: 16px 16px 16px 16px;
26
+ bottom: 20px;
27
+ color: #FFF;
28
+ font-family: sans-serif;
29
+ font-size: 12px;
30
+ opacity: 0.9;
31
+ padding: 20px;
32
+ right: 20px;
33
+ text-decoration: none;
34
+ transition: background 200ms linear 0s;
35
+ }
36
+ .scroll-up-tab{
37
+ background-color: #E6E6E6;
38
+ background-image: linear-gradient(to bottom, #EBEBEB, #DEDEDE);
39
+ background-repeat: repeat-x;
40
+ box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.2);
41
+ color: #828282;
42
+ font-family: sans-serif;
43
+ font-size: 14px;
44
+ height: 50px;
45
+ line-height: 20px;
46
+ padding: 10px;
47
+ text-align: center;
48
+ text-decoration: none;
49
+ text-shadow: 0 1px 0 #FFFFFF;
50
+ width: 60px;
51
+ display: block;
52
+ }