Alice_Popup - Version 1.0.0

Version Notes

This is our first newsletter extension for magento1.x and we will be glad to provide this extension for magento2.0

Download this release

Release Info

Developer Alice Infoweb Pvt ltd.
Extension Alice_Popup
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Alice/Popup/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Alice_Popup_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+ ?>
app/code/local/Alice/Popup/controllers/IndexController.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Alice_Popup_IndexController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+ $this->loadLayout();
8
+ $this->renderLayout();
9
+ }
10
+ }
11
+ ?>
app/code/local/Alice/Popup/etc/config.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Alice_Popup>
6
+ <version>0.1.0</version>
7
+ </Alice_Popup>
8
+ </modules>
9
+ <global>
10
+ <helpers>
11
+ <alice>
12
+ <class>Alice_Popup_Helper</class>
13
+ </alice>
14
+ </helpers>
15
+ </global>
16
+ <frontend>
17
+ <routers>
18
+ <alice>
19
+ <use>standard</use>
20
+ <args>
21
+ <module>Alice_Popup</module>
22
+ <frontName>alice</frontName>
23
+ </args>
24
+ </alice>
25
+ </routers>
26
+ <layout>
27
+ <updates>
28
+ <alice>
29
+ <file>alice_popup.xml</file>
30
+ </alice>
31
+ </updates>
32
+ </layout>
33
+ </frontend>
34
+ <adminhtml>
35
+ <acl>
36
+ <resources>
37
+ <all>
38
+ <title>Allow Everything</title>
39
+ </all>
40
+ <admin>
41
+ <children>
42
+ <system>
43
+ <children>
44
+ <config>
45
+ <children>
46
+ <alice>
47
+ <title>Alice - All</title>
48
+ </alice>
49
+ </children>
50
+ </config>
51
+ </children>
52
+ </system>
53
+ </children>
54
+ </admin>
55
+ </resources>
56
+ </acl>
57
+ </adminhtml>
58
+ </config>
app/code/local/Alice/Popup/etc/system.xml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <alice translate="label" module="alice">
5
+ <label>Alice Popup</label>
6
+ <sort_order>100</sort_order>
7
+ </alice>
8
+ </tabs>
9
+ <sections>
10
+ <alice translate="label" module="alice">
11
+ <label>Popup Settings</label>
12
+ <tab>alice</tab>
13
+ <sort_order>1000</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+
18
+ <groups>
19
+ <alice_group translate="label" module="alice">
20
+ <label>Popup Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>1000</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+
27
+ <fields>
28
+ <alice_popup_enable translate="label">
29
+ <label>Enable</label>
30
+ <frontend_type>select</frontend_type>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <source_model>adminhtml/system_config_source_yesno</source_model>
36
+ </alice_popup_enable>
37
+ <alice_popup_title translate="label">
38
+ <label> Title</label>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>2</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </alice_popup_title>
45
+ <alice_popup_cookie_lifetime translate="label">
46
+ <label> Cookie Lifetime (In days)</label>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>4</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ </alice_popup_cookie_lifetime>
53
+ <alice_popup_popup_load_time translate="label">
54
+ <label> Popup Load Time (In Secs)</label>
55
+ <frontend_type>text</frontend_type>
56
+ <sort_order>5</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </alice_popup_popup_load_time>
61
+ <alice_popup_popup_text translate="label">
62
+ <label> Popup Text</label>
63
+ <frontend_type>textarea</frontend_type>
64
+ <sort_order>3</sort_order>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>1</show_in_store>
68
+ </alice_popup_popup_text>
69
+
70
+ <alice_popup_button_bkg_color translate="label">
71
+ <label> Button Background Color </label>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>20</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </alice_popup_button_bkg_color>
78
+ <alice_popup_button_hover_color translate="label">
79
+ <label> Button Hover Color</label>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>20</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ </alice_popup_button_hover_color>
86
+ <alice_popup_button_text_color translate="label">
87
+ <label>Button Text Color </label>
88
+ <frontend_type>text</frontend_type>
89
+ <sort_order>20</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </alice_popup_button_text_color>
94
+
95
+ <logo translate="label comment">
96
+ <label>Background Image</label>
97
+ <comment>Allowed file types: jpeg, gif, png.</comment>
98
+ <frontend_type>image</frontend_type>
99
+ <backend_model>adminhtml/system_config_backend_image</backend_model>
100
+ <upload_dir config="system/filesystem/media" scope_info="1">theme</upload_dir>
101
+ <base_url type="media" scope_info="1">theme</base_url>
102
+ <sort_order>1</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>1</show_in_store>
106
+ </logo>
107
+
108
+ </fields>
109
+ </alice_group>
110
+ </groups>
111
+ </alice>
112
+ </sections>
113
+ </config>
app/design/frontend/rwd/default/layout/alice_popup.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <layout version="0.1.0">
2
+ <default>
3
+ <reference name="before_body_end">
4
+ <block type="core/template" name="popup" template="alice/popup.phtml"/>
5
+ </reference>
6
+ </default>
7
+ </layout>
app/design/frontend/rwd/default/template/alice/popup.phtml ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head>
3
+ <style>
4
+ #element_to_pop_up {
5
+ background-color:#fff;
6
+ /*border-radius:15px;*/
7
+ color:#000;
8
+ display:none;
9
+ padding:20px;
10
+ min-width:400px;
11
+ min-height: 180px;
12
+ width:470px;
13
+ }
14
+ .b-close{
15
+ cursor:pointer;
16
+ position:absolute;
17
+ right:10px;
18
+ top:5px;
19
+ }
20
+ #email {
21
+ float: left;
22
+ width: 74%;
23
+ }
24
+
25
+ #email > input {
26
+ color: #5d5d5d;
27
+ width: 100%;
28
+ font-weight:700;
29
+ }
30
+ #newsletter_subscribe > div {
31
+ padding-bottom: 10px;
32
+ padding-top: 10px;
33
+ width: 80%;
34
+ }
35
+ #subscribe {
36
+ float: left;
37
+ width: 25% !important;
38
+ padding-top: 6px !important;
39
+ }
40
+
41
+ #popup_submit {
42
+ display: block;
43
+ font-size: 12px;
44
+ line-height: 34px;
45
+ margin: -8px 0 0;
46
+ padding-bottom: 0;
47
+ text-align: center;
48
+ width: 100%;
49
+ margin-left: 4px !important;
50
+ }
51
+ #popup_title {
52
+ font: 20px/34px "CenturyGothicRegular",Century Gothic,Verdana,sans-serif;
53
+ background: rgba(0, 0, 0, 0) url("<?php echo $this->getSkinUrl('images/popup_box_block1.png'); ?>") no-repeat scroll right top;
54
+ text-align: left;
55
+ width: 350px;
56
+ color: #696969;
57
+ float: left;
58
+ text-decoration: none;
59
+ height: 85px;
60
+ overflow: hidden;
61
+ width: 440px;
62
+
63
+ }
64
+
65
+ .popup_box_lines {
66
+ background: transparent url("<?php echo $this->getSkinUrl('images/popup_box_lines.png'); ?>") no-repeat scroll 0 0;
67
+ clear: both;
68
+ display: block;
69
+ height: 1px;
70
+ margin: 5px 0;
71
+ width: 100%;
72
+ padding-bottom: 5px;
73
+ }
74
+
75
+ #popup_text {
76
+ font: 11px/1.55 Tahoma,Helvetica,sans-serif;
77
+ color: #696969;
78
+ float: left;
79
+ text-decoration: none;
80
+ padding-bottom: 5px;
81
+
82
+ }
83
+
84
+ </style>
85
+ <script src="<?php echo $this->getSkinUrl('js/jquery.bpopup.min.js'); ?>"></script>
86
+ <script src="<?php echo $this->getSkinUrl('js/cookie.js'); ?>"></script>
87
+ </head>
88
+ <body>
89
+ <?php
90
+ $enable = Mage::getStoreConfig('alice/alice_group/alice_popup_enable');
91
+ $title = Mage::getStoreConfig('alice/alice_group/alice_popup_title');
92
+ $popUpText = Mage::getStoreConfig('alice/alice_group/alice_popup_popup_text');
93
+ $noOfDays = Mage::getStoreConfig('alice/alice_group/alice_popup_cookie_lifetime');
94
+ $popupLoadTime = Mage::getStoreConfig('alice/alice_group/alice_popup_popup_load_time');
95
+ $backgroundImage = Mage::getStoreConfig('alice/alice_group/logo');
96
+ $buttonBkgColor = Mage::getStoreConfig('alice/alice_group/alice_popup_button_bkg_color');
97
+ $buttonHoverColor = Mage::getStoreConfig('alice/alice_group/alice_popup_button_hover_color');
98
+ $buttonTextColor = Mage::getStoreConfig('alice/alice_group/alice_popup_button_text_color');
99
+ if($enable == '1'):
100
+ ?>
101
+ <div id="element_to_pop_up">
102
+ <a class="b-close">x<a/>
103
+
104
+ <div id="popup_title">
105
+ <?php $Title = ($title != null) ? $title : '50% Sale on Category Products';?>
106
+ <?php echo '<b>'.$Title.'</b><br>'; ?><!--dynamic title of popup-->
107
+ </div>
108
+ <div class="popup_box_lines"></div>
109
+ <div id="popup_text">
110
+ <?php $Text = ($popUpText != null) ? $popUpText : 'Would you like to be one of the first to receive exclusive information about the latest collections, offers and events from this online shop? Then just subscribe to our free newsletter now and get a voucher to the value of 5 € for your next purchase in our Online-Shop. ';?>
111
+ <?php echo $Text; ?><!--dynamic content of popup-->
112
+ </div>
113
+ <div class="popup_box_lines"></div>
114
+ <form id="newsletter_subscribe">
115
+ <div id="email">
116
+ <input type="text" name="Email" value="Email">
117
+ </div>
118
+ <div id="subscribe">
119
+ <!--<input type="submit" name="submit" value="Subscribe">-->
120
+ <a id="popup_submit" href="javascript:void(0)">Subscribe</a>
121
+ </div>
122
+ </form>
123
+ </div>
124
+ <script>
125
+ jQuery(function() {
126
+
127
+ if (jQuery.cookie('newsletter') != '1') { // Check for cookie
128
+ //$.cookie('mail', '1', { expires: 7, path: '/' });
129
+ var popupLoadTime = "<?php echo $popupLoadTime ?>";
130
+ setTimeout(function() {
131
+ jQuery('#element_to_pop_up').bPopup();
132
+ }, popupLoadTime);
133
+
134
+
135
+ };
136
+
137
+ jQuery('.b-close').click(function(){
138
+ var noOfDays = "<?php echo $noOfDays ?>";
139
+
140
+ parent.jQuery("#element_to_pop_up").bPopup().close();
141
+
142
+ jQuery.cookie('newsletter', '1', { expires: noOfDays, path: '/' });
143
+
144
+ });
145
+ });
146
+ </script>
147
+ <?php if($backgroundImage):?>
148
+ <style>
149
+ #element_to_pop_up {
150
+ background: url(<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);?>theme/<?php echo $backgroundImage; ?>) no-repeat;
151
+ }
152
+ </style>
153
+ <?php endif; ?>
154
+ <?php endif; ?>
155
+ <?php
156
+ $bCkHoverColor = ($buttonHoverColor != null) ? $buttonHoverColor : '#aaa';
157
+ $bCkTextColor = ($buttonTextColor != null) ? $buttonTextColor : '#fff';
158
+ $bCkBkgColor = ($buttonBkgColor != null) ? $buttonBkgColor : '#000';
159
+ ?>
160
+ <script>
161
+ jQuery(document).ready(function(){
162
+ var hovercolor = "<?php echo $bCkHoverColor ?>";
163
+ var bgcolor = "<?php echo $bCkBkgColor ?>";
164
+ var textcolor = "<?php echo $bCkTextColor ?>";
165
+
166
+ jQuery("#popup_submit").mouseenter(function(){
167
+ jQuery("#popup_submit").css("background-color", hovercolor);
168
+ });
169
+
170
+ jQuery("#popup_submit").mouseout(function(){
171
+ jQuery("#popup_submit").css("background-color", bgcolor);
172
+ });
173
+
174
+ jQuery("#popup_submit").css("color", textcolor);
175
+ jQuery("#popup_submit").css("background-color", bgcolor);
176
+
177
+
178
+ });
179
+ </script>
180
+ </body>
181
+ </html>
app/etc/modules/Alice_Popup.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <!--?xml version="1.0"?-->
2
+ <config>
3
+ <modules>
4
+ <Alice_Popup>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Alice_Popup>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Alice_Popup</name>
4
+ <version>1.0.0</version>
5
+ <stability>beta</stability>
6
+ <license uri="https://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension helps you to increase sales and customers for your site. </summary>
10
+ <description>Functionalities of Alice Popup Extension :&#xD;
11
+ &#xD;
12
+ 1. Enable/Disable Popup Extension.&#xD;
13
+ &#xD;
14
+ 2. Manages Popup Title from Admin.&#xD;
15
+ &#xD;
16
+ 3. Manages Background Image of Popup.&#xD;
17
+ &#xD;
18
+ 4. Manages Popup Text from Admin.&#xD;
19
+ &#xD;
20
+ 5. Manages Cookie Lifetime of Popup.&#xD;
21
+ &#xD;
22
+ 6. Manages Popup Load Time.&#xD;
23
+ &#xD;
24
+ 7. Manages Button Colors from Admin</description>
25
+ <notes>This is our first newsletter extension for magento1.x and we will be glad to provide this extension for magento2.0</notes>
26
+ <authors><author><name>Alice Infoweb Pvt ltd.</name><user>MAG000074275</user><email>avi@webmagentocommerce.com</email></author></authors>
27
+ <date>2016-04-12</date>
28
+ <time>06:46:54</time>
29
+ <contents><target name="magelocal"><dir name="Alice"><dir name="Popup"><dir name="Helper"><file name="Data.php" hash="f121646298baec3bde5f1c44979980d3"/></dir><dir name="controllers"><file name="IndexController.php" hash="6e9c39d3352866da1408b52c853237f6"/></dir><dir name="etc"><file name="config.xml" hash="02e2f7d7f683d6fbcb20a03d7de47c82"/><file name="system.xml" hash="5b38223e0c6503e870d3580b74373a80"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Alice_Popup.xml" hash="26d9dc4463b0f84d264fb3aa002b4d1f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="rwd"><dir name="default"><dir name="layout"><file name="alice_popup.xml" hash="98ee39eb43d74f45ec8a80a1be02922a"/></dir><dir name="template"><dir name="alice"><file name="popup.phtml" hash="9ebdc254f1cf4fe74905f56134696280"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="rwd"><dir name="default"><dir name="images"><file name="popup_box_block1.png" hash="05baf7a905b6feefc25ffbfb517b285e"/><file name="popup_box_lines.png" hash="a74efb43c267534b40e29c9674b91423"/></dir><dir name="js"><file name="cookie.js" hash="b2860c25a4c8a407faeab4708229518a"/><file name="jquery.bpopup.min.js" hash="204ec5bd1f07bb6eb37b0da75badfc16"/></dir></dir></dir></dir></target></contents>
30
+ <compatible/>
31
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
32
+ </package>
skin/frontend/rwd/default/images/popup_box_block1.png ADDED
Binary file
skin/frontend/rwd/default/images/popup_box_lines.png ADDED
Binary file
skin/frontend/rwd/default/js/cookie.js ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Cookie plugin
3
+ *
4
+ * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
5
+ * Dual licensed under the MIT and GPL licenses:
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ * http://www.gnu.org/licenses/gpl.html
8
+ *
9
+ */
10
+
11
+ jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
12
+
13
+
14
+ // http://instafeedjs.com/
15
+ (function(){var e,t;e=function(){function e(e){var t,n;this.options={target:"instafeed",get:"popular",resolution:"thumbnail",sortBy:"most-recent",links:!0,limit:15,mock:!1};if(typeof e=="object")for(t in e)n=e[t],this.options[t]=n;this.unique=this._genKey()}return e.prototype.run=function(){var t,n,r;if(typeof this.options.clientId!="string"&&typeof this.options.accessToken!="string")throw new Error("Missing clientId or accessToken.");if(typeof this.options.accessToken!="string"&&typeof this.options.clientId!="string")throw new Error("Missing clientId or accessToken.");return this.options.before!=null&&typeof this.options.before=="function"&&this.options.before.call(this),typeof document!="undefined"&&document!==null&&(r=document.createElement("script"),r.id="instafeed-fetcher",r.src=this._buildUrl(),t=document.getElementsByTagName("head"),t[0].appendChild(r),n="instafeedCache"+this.unique,window[n]=new e(this.options),window[n].unique=this.unique),!0},e.prototype.parse=function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v;if(typeof e!="object"){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"Invalid JSON data"),!1;throw new Error("Invalid JSON response")}if(e.meta.code!==200){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,e.meta.error_message),!1;throw new Error("Error from Instagram: "+e.meta.error_message)}if(e.data.length===0){if(this.options.error!=null&&typeof this.options.error=="function")return this.options.error.call(this,"No images were returned from Instagram"),!1;throw new Error("No images were returned from Instagram")}this.options.success!=null&&typeof this.options.success=="function"&&this.options.success.call(this,e);if(this.options.sortBy!=="most-recent"){this.options.sortBy==="random"?c=["","random"]:c=this.options.sortBy.split("-"),l=c[0]==="least"?!0:!1;switch(c[1]){case"random":e.data.sort(function(){return.5-Math.random()});break;case"recent":e.data=this._sortBy(e.data,"created_time",l);break;case"liked":e.data=this._sortBy(e.data,"likes.count",l);break;case"commented":e.data=this._sortBy(e.data,"comments.count",l);break;default:throw new Error("Invalid option for sortBy: '"+this.options.sortBy+"'.")}}if(typeof document!="undefined"&&document!==null&&this.options.mock===!1){document.getElementById(this.options.target).innerHTML="",u=e.data,u.length>this.options.limit&&(u=u.slice(0,this.options.limit+1||9e9));if(this.options.template!=null&&typeof this.options.template=="string"){i="",o="";for(h=0,d=u.length;h<d;h++)s=u[h],o=this._makeTemplate(this.options.template,{model:s,id:s.id,link:s.link,image:s.images[this.options.resolution].url,caption:this._getObjectProperty(s,"caption.text"),likes:s.likes.count,comments:s.comments.count,location:this._getObjectProperty(s,"location.name")}),i+=o;document.getElementById(this.options.target).innerHTML=i}else{n=document.createDocumentFragment();for(p=0,v=u.length;p<v;p++)s=u[p],a=document.createElement("img"),a.src=s.images[this.options.resolution].url,this.options.links===!0?(t=document.createElement("a"),t.href=s.link,t.appendChild(a),n.appendChild(t)):n.appendChild(a);document.getElementById(this.options.target).appendChild(n)}r=document.getElementsByTagName("head")[0],r.removeChild(document.getElementById("instafeed-fetcher")),f="instafeedCache"+this.unique,delete window[f]}return this.options.after!=null&&typeof this.options.after=="function"&&this.options.after.call(this),!0},e.prototype._buildUrl=function(){var e,t,n;e="https://api.instagram.com/v1";switch(this.options.get){case"popular":t="media/popular";break;case"tagged":if(typeof this.options.tagName!="string")throw new Error("No tag name specified. Use the 'tagName' option.");t="tags/"+this.options.tagName+"/media/recent";break;case"location":if(typeof this.options.locationId!="number")throw new Error("No location specified. Use the 'locationId' option.");t="locations/"+this.options.locationId+"/media/recent";break;case"user":if(typeof this.options.userId!="number")throw new Error("No user specified. Use the 'userId' option.");if(typeof this.options.accessToken!="string")throw new Error("No access token. Use the 'accessToken' option.");t="users/"+this.options.userId+"/media/recent";break;default:throw new Error("Invalid option for get: '"+this.options.get+"'.")}return n=""+e+"/"+t,this.options.accessToken!=null?n+="?access_token="+this.options.accessToken:n+="?client_id="+this.options.clientId,n+="&count="+this.options.limit,n+="&callback=instafeedCache"+this.unique+".parse",n},e.prototype._genKey=function(){var e;return e=function(){return((1+Math.random())*65536|0).toString(16).substring(1)},""+e()+e()+e()+e()},e.prototype._makeTemplate=function(e,t){var n,r,i,s,o;r=/(?:\{{2})([\w\[\]\.]+)(?:\}{2})/,n=e;while(r.test(n))i=n.match(r)[1],s=(o=this._getObjectProperty(t,i))!=null?o:"",n=n.replace(r,""+s);return n},e.prototype._getObjectProperty=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,".$1"),r=t.split(".");while(r.length){n=r.shift();if(!(e!=null&&n in e))return null;e=e[n]}return e},e.prototype._sortBy=function(e,t,n){var r;return r=function(e,r){var i,s;return i=this._getObjectProperty(e,t),s=this._getObjectProperty(r,t),n?i>s?1:-1:i<s?1:-1},e.sort(r.bind(this)),e},e}(),t=typeof exports!="undefined"&&exports!==null?exports:window,t.Instafeed=e}).call(this);
16
+
17
+
18
+ (function() {
19
+ var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame ||
20
+ function(callback) {
21
+ window.setTimeout(callback, 1000 / 60);
22
+ };
23
+ window.requestAnimationFrame = requestAnimationFrame;
24
+ })();
25
+
26
+
27
+ var flakes = [],
28
+ canvas = document.getElementById("canvas"),
29
+ ctx = canvas.getContext("2d"),
30
+ flakeCount = 400,
31
+ mX = -100,
32
+ mY = -100
33
+
34
+ canvas.width = window.innerWidth-25;
35
+ canvas.height = window.innerHeight-470;
36
+
37
+ function snow() {
38
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
39
+
40
+ for (var i = 0; i < flakeCount; i++) {
41
+ var flake = flakes[i],
42
+ x = mX,
43
+ y = mY,
44
+ minDist = 150,
45
+ x2 = flake.x,
46
+ y2 = flake.y;
47
+
48
+ var dist = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y)),
49
+ dx = x2 - x,
50
+ dy = y2 - y;
51
+
52
+ if (dist < minDist) {
53
+ var force = minDist / (dist * dist),
54
+ xcomp = (x - x2) / dist,
55
+ ycomp = (y - y2) / dist,
56
+ deltaV = force / 2;
57
+
58
+ flake.velX -= deltaV * xcomp;
59
+ flake.velY -= deltaV * ycomp;
60
+
61
+ } else {
62
+ flake.velX *= .98;
63
+ if (flake.velY <= flake.speed) {
64
+ flake.velY = flake.speed
65
+ }
66
+ flake.velX += Math.cos(flake.step += .05) * flake.stepSize;
67
+ }
68
+
69
+ ctx.fillStyle = "rgba(255,255,255," + flake.opacity + ")";
70
+ flake.y += flake.velY;
71
+ flake.x += flake.velX;
72
+
73
+ if (flake.y >= canvas.height || flake.y <= 0) {
74
+ reset(flake);
75
+ }
76
+
77
+
78
+ if (flake.x >= canvas.width || flake.x <= 0) {
79
+ reset(flake);
80
+ }
81
+
82
+ ctx.beginPath();
83
+ ctx.arc(flake.x, flake.y, flake.size, 0, Math.PI * 2);
84
+ ctx.fill();
85
+ }
86
+ requestAnimationFrame(snow);
87
+ };
88
+
89
+ function reset(flake) {
90
+ flake.x = Math.floor(Math.random() * canvas.width);
91
+ flake.y = 0;
92
+ flake.size = (Math.random() * 3) + 2;
93
+ flake.speed = (Math.random() * 1) + 0.5;
94
+ flake.velY = flake.speed;
95
+ flake.velX = 0;
96
+ flake.opacity = (Math.random() * 0.5) + 0.3;
97
+ }
98
+
99
+ function init() {
100
+ for (var i = 0; i < flakeCount; i++) {
101
+ var x = Math.floor(Math.random() * canvas.width),
102
+ y = Math.floor(Math.random() * canvas.height),
103
+ size = (Math.random() * 3) + 2,
104
+ speed = (Math.random() * 1) + 0.5,
105
+ opacity = (Math.random() * 0.5) + 0.3;
106
+
107
+ flakes.push({
108
+ speed: speed,
109
+ velY: speed,
110
+ velX: 0,
111
+ x: x,
112
+ y: y,
113
+ size: size,
114
+ stepSize: (Math.random()) / 30,
115
+ step: 0,
116
+ opacity: opacity
117
+ });
118
+ }
119
+
120
+ snow();
121
+ };
122
+
123
+ canvas.addEventListener("mousemove", function(e) {
124
+ mX = e.clientX,
125
+ mY = e.clientY
126
+ });
127
+
128
+ window.addEventListener("resize",function(){
129
+ canvas.width = window.innerWidth;
130
+ canvas.height = window.innerHeight;
131
+ })
132
+
133
+ init();
skin/frontend/rwd/default/js/jquery.bpopup.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*================================================================================
2
+ * @name: bPopup - if you can't get it up, use bPopup
3
+ * @author: (c)Bjoern Klinggaard (twitter@bklinggaard)
4
+ * @demo: http://dinbror.dk/bpopup
5
+ * @version: 0.11.0.min
6
+ ================================================================================*/
7
+ (function(c){c.fn.bPopup=function(A,E){function L(){a.contentContainer=c(a.contentContainer||b);switch(a.content){case "iframe":var d=c('<iframe class="b-iframe" '+a.iframeAttr+"></iframe>");d.appendTo(a.contentContainer);t=b.outerHeight(!0);u=b.outerWidth(!0);B();d.attr("src",a.loadUrl);l(a.loadCallback);break;case "image":B();c("<img />").load(function(){l(a.loadCallback);F(c(this))}).attr("src",a.loadUrl).hide().appendTo(a.contentContainer);break;default:B(),c('<div class="b-ajax-wrapper"></div>').load(a.loadUrl,a.loadData,function(d,b,e){l(a.loadCallback,b);F(c(this))}).hide().appendTo(a.contentContainer)}}function B(){a.modal&&c('<div class="b-modal '+e+'"></div>').css({backgroundColor:a.modalColor,position:"fixed",top:0,right:0,bottom:0,left:0,opacity:0,zIndex:a.zIndex+v}).appendTo(a.appendTo).fadeTo(a.speed,a.opacity);C();b.data("bPopup",a).data("id",e).css({left:"slideIn"==a.transition||"slideBack"==a.transition?"slideBack"==a.transition?f.scrollLeft()+w:-1*(x+u):m(!(!a.follow[0]&&n||g)),position:a.positionStyle||"absolute",top:"slideDown"==a.transition||"slideUp"==a.transition?"slideUp"==a.transition?f.scrollTop()+y:z+-1*t:p(!(!a.follow[1]&&q||g)),"z-index":a.zIndex+v+1}).each(function(){a.appending&&c(this).appendTo(a.appendTo)});G(!0)}function r(){a.modal&&c(".b-modal."+b.data("id")).fadeTo(a.speed,0,function(){c(this).remove()});a.scrollBar||c("html").css("overflow","auto");c(".b-modal."+e).unbind("click");f.unbind("keydown."+e);k.unbind("."+e).data("bPopup",0<k.data("bPopup")-1?k.data("bPopup")-1:null);b.undelegate(".bClose, ."+a.closeClass,"click."+e,r).data("bPopup",null);clearTimeout(H);G();return!1}function I(d){y=k.height();w=k.width();h=D();if(h.x||h.y)clearTimeout(J),J=setTimeout(function(){C();d=d||a.followSpeed;var e={};h.x&&(e.left=a.follow[0]?m(!0):"auto");h.y&&(e.top=a.follow[1]?p(!0):"auto");b.dequeue().each(function(){g?c(this).css({left:x,top:z}):c(this).animate(e,d,a.followEasing)})},50)}function F(d){var c=d.width(),e=d.height(),f={};a.contentContainer.css({height:e,width:c});e>=b.height()&&(f.height=b.height());c>=b.width()&&(f.width=b.width());t=b.outerHeight(!0);u=b.outerWidth(!0);C();a.contentContainer.css({height:"auto",width:"auto"});f.left=m(!(!a.follow[0]&&n||g));f.top=p(!(!a.follow[1]&&q||g));b.animate(f,250,function(){d.show();h=D()})}function M(){k.data("bPopup",v);b.delegate(".bClose, ."+a.closeClass,"click."+e,r);a.modalClose&&c(".b-modal."+e).css("cursor","pointer").bind("click",r);N||!a.follow[0]&&!a.follow[1]||k.bind("scroll."+e,function(){if(h.x||h.y){var d={};h.x&&(d.left=a.follow[0]?m(!g):"auto");h.y&&(d.top=a.follow[1]?p(!g):"auto");b.dequeue().animate(d,a.followSpeed,a.followEasing)}}).bind("resize."+e,function(){I()});a.escClose&&f.bind("keydown."+e,function(a){27==a.which&&r()})}function G(d){function c(e){b.css({display:"block",opacity:1}).animate(e,a.speed,a.easing,function(){K(d)})}switch(d?a.transition:a.transitionClose||a.transition){case "slideIn":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()-(u||b.outerWidth(!0))-200});break;case "slideBack":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()+w+200});break;case "slideDown":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()-(t||b.outerHeight(!0))-200});break;case "slideUp":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()+y+200});break;default:b.stop().fadeTo(a.speed,d?1:0,function(){K(d)})}}function K(d){d?(M(),l(E),a.autoClose&&(H=setTimeout(r,a.autoClose))):(b.hide(),l(a.onClose),a.loadUrl&&(a.contentContainer.empty(),b.css({height:"auto",width:"auto"})))}function m(a){return a?x+f.scrollLeft():x}function p(a){return a?z+f.scrollTop():z}function l(a,e){c.isFunction(a)&&a.call(b,e)}function C(){z=q?a.position[1]:Math.max(0,(y-b.outerHeight(!0))/2-a.amsl);x=n?a.position[0]:(w-b.outerWidth(!0))/2;h=D()}function D(){return{x:w>b.outerWidth(!0),y:y>b.outerHeight(!0)}}c.isFunction(A)&&(E=A,A=null);var a=c.extend({},c.fn.bPopup.defaults,A);a.scrollBar||c("html").css("overflow","hidden");var b=this,f=c(document),k=c(window),y=k.height(),w=k.width(),N=/OS 6(_\d)+/i.test(navigator.userAgent),v=0,e,h,q,n,g,z,x,t,u,J,H;b.close=function(){r()};b.reposition=function(a){I(a)};return b.each(function(){c(this).data("bPopup")||(l(a.onOpen),v=(k.data("bPopup")||0)+1,e="__b-popup"+v+"__",q="auto"!==a.position[1],n="auto"!==a.position[0],g="fixed"===a.positionStyle,t=b.outerHeight(!0),u=b.outerWidth(!0),a.loadUrl?L():B())})};c.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",autoClose:!1,closeClass:"b-close",content:"ajax",contentContainer:!1,easing:"swing",escClose:!0,follow:[!0,!0],followEasing:"swing",followSpeed:500,iframeAttr:'scrolling="no" frameborder="0"',loadCallback:!1,loadData:!1,loadUrl:!1,modal:!0,modalClose:!0,modalColor:"#000",onClose:!1,onOpen:!1,opacity:.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:9997}})(jQuery);