NanoRep_Widgets_1_1_0 - Version 2.1.0

Version Notes

Contact us integration

Download this release

Release Info

Developer NanoRep
Extension NanoRep_Widgets_1_1_0
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.8 to 2.1.0

Files changed (22) hide show
  1. app/code/local/NanoRep/Widgets/Block/Adminhtml/System/Config/Form/Fields.php +25 -0
  2. app/code/local/NanoRep/Widgets/Block/Contactus.php +41 -0
  3. app/code/local/NanoRep/Widgets/Block/Forgotpassword.php +15 -0
  4. app/code/local/NanoRep/Widgets/Block/Login.php +4 -0
  5. app/code/local/NanoRep/Widgets/Helper/Data.php +28 -7
  6. app/code/local/NanoRep/Widgets/Model/Observer.php +1 -1
  7. app/code/local/NanoRep/Widgets/controllers/AccountController.php +72 -0
  8. app/code/local/NanoRep/Widgets/etc/config.xml +7 -1
  9. app/code/local/NanoRep/Widgets/etc/system.xml +46 -1
  10. app/design/adminhtml/default/default/template/nanorepwidgets/system/config/form/fields.phtml +206 -0
  11. app/design/frontend/default/default/layout/nanorepwidgets.xml +16 -0
  12. app/design/frontend/default/default/template/nanorepwidgets/contact_us.phtml +225 -0
  13. app/design/frontend/default/default/template/nanorepwidgets/forgotpassword.phtml +55 -0
  14. app/design/frontend/default/default/template/nanorepwidgets/login.phtml +5 -0
  15. app/design/frontend/rwd/default/layout/nanorepwidgets.xml +16 -0
  16. app/design/frontend/rwd/default/template/nanorepwidgets/contact_us.phtml +225 -0
  17. app/design/frontend/rwd/default/template/nanorepwidgets/forgotpassword.phtml +55 -0
  18. app/design/frontend/rwd/default/template/nanorepwidgets/login.phtml +5 -0
  19. package.xml +5 -5
  20. skin/frontend/default/default/nanorepwidgets/contactus.css +183 -0
  21. skin/frontend/default/default/nanorepwidgets/images/mp_sprites.gif +0 -0
  22. skin/frontend/default/default/nanorepwidgets/jsonp.js +143 -0
app/code/local/NanoRep/Widgets/Block/Adminhtml/System/Config/Form/Fields.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NanoRep Widgets Extension
4
+ *
5
+ * @package NanoRep_Widgets
6
+ * @company Omniscience Co.
7
+ * @website http://www.omniscience.co.il
8
+ * @author Dan Aharon-Shalom
9
+ */
10
+
11
+ class NanoRep_Widgets_Block_Adminhtml_System_Config_Form_Fields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
12
+ {
13
+
14
+ public function __construct()
15
+ {
16
+ $this->addColumn('css', array(
17
+ 'label' => Mage::helper('nanorepwidgets')->__('field CSS'),
18
+ 'style' => 'width:120px',
19
+ ));
20
+ $this->_addAfter = false;
21
+ $this->_addButtonLabel = Mage::helper('nanorepwidgets')->__('Add field');
22
+ parent::__construct();
23
+ }
24
+
25
+ }
app/code/local/NanoRep/Widgets/Block/Contactus.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NanoRep Widgets Extension
4
+ *
5
+ * @package NanoRep_Widgets
6
+ * @company nanoRep.
7
+ * @website http://www.nanorep.com
8
+ * @author Dan Aharon-Shalom
9
+ */
10
+
11
+ class NanoRep_Widgets_Block_Contactus extends Mage_Core_Block_Template
12
+ {
13
+
14
+ public function getFieldsCssCommaSeperated(){
15
+ $_warpWithQoutes = function($var){
16
+ return '"' . $var .'"';
17
+ };
18
+
19
+ $a = unserialize(Mage::getStoreConfig('nanorepwidgets/contact_us_widget/fields_css'));
20
+ $a = array_map($_warpWithQoutes, $a["_1424883221899_899"]);
21
+
22
+ $string = implode(', ', $a);
23
+ return $string;
24
+ }
25
+
26
+ public function getApiServerUrl($script){
27
+ $server = Mage::helper('nanorepwidgets')->getServer()
28
+ . '/~' . Mage::getStoreConfig("nanorepwidgets/account_settings/account_name") .
29
+ '/api/widget/jsonp/v1/'. $script;
30
+
31
+ return $server;
32
+ }
33
+
34
+ public function getKb(){
35
+ return Mage::getStoreConfig('nanorepwidgets/contact_us_widget/kb');
36
+ }
37
+
38
+ public function getTitle(){
39
+ return Mage::getStoreConfig('nanorepwidgets/contact_us_widget/title');
40
+ }
41
+ }
app/code/local/NanoRep/Widgets/Block/Forgotpassword.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NanoRep Widgets Extension
4
+ *
5
+ * @package NanoRep_Widgets
6
+ * @company nanoRep.
7
+ * @website http://www.nanorep.com
8
+ * @author Dan Aharon-Shalom
9
+ */
10
+
11
+
12
+ class NanoRep_Widgets_Block_Forgotpassword extends Mage_Customer_Block_Account_Forgotpassword
13
+ {
14
+
15
+ }
app/code/local/NanoRep/Widgets/Block/Login.php CHANGED
@@ -19,4 +19,8 @@ class NanoRep_Widgets_Block_Login extends Mage_Customer_Block_Form_Login
19
  {
20
  return Mage::getUrl('nanorepwidgets/account/loginPost');
21
  }
 
 
 
 
22
  }
19
  {
20
  return Mage::getUrl('nanorepwidgets/account/loginPost');
21
  }
22
+
23
+ public function getForgotPasswordUrl(){
24
+ return Mage::getUrl('nanorepwidgets/account/forgotPassword');
25
+ }
26
  }
app/code/local/NanoRep/Widgets/Helper/Data.php CHANGED
@@ -11,19 +11,40 @@
11
 
12
  class NanoRep_Widgets_Helper_Data extends Mage_Core_Helper_Abstract
13
  {
 
14
  public function getAccountName(){
15
  return Mage::getStoreConfig("nanorepwidgets/account_settings/account_name");
16
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  public function isFloatWidgetActiveForCurrentPage(){
19
- if(Mage::getStoreConfigFlag("nanorepwidgets/float_widget/active_pages")){
20
- $module = Mage::app()->getRequest()->getModuleName();
21
- $controller = Mage::app()->getRequest()->getControllerName();
22
- return($module == 'catalog' && $controller == 'product');
 
 
 
 
 
23
  }
24
- else{
25
- return true;
26
- }
27
 
28
  }
29
 
11
 
12
  class NanoRep_Widgets_Helper_Data extends Mage_Core_Helper_Abstract
13
  {
14
+ const NANOREP_SERVER = "my.nanorep.com";
15
  public function getAccountName(){
16
  return Mage::getStoreConfig("nanorepwidgets/account_settings/account_name");
17
  }
18
+
19
+ public function isContactUsWidgetActive(){
20
+ if(Mage::getStoreConfigFlag("nanorepwidgets/contact_us_widget/active")){
21
+ return true;
22
+ }
23
+ return false;
24
+ }
25
+
26
+ public function getServer(){
27
+ $server = "http://";
28
+ $isSecure = Mage::app()->getStore()->isCurrentlySecure();
29
+ if($isSecure){
30
+ $server = "https://";
31
+ }
32
+ $server .= self::NANOREP_SERVER;
33
+ return $server;
34
+ }
35
 
36
  public function isFloatWidgetActiveForCurrentPage(){
37
+ if(Mage::getStoreConfigFlag("nanorepwidgets/float_widget/active")){
38
+ if(Mage::getStoreConfigFlag("nanorepwidgets/float_widget/active_pages")){
39
+ $module = Mage::app()->getRequest()->getModuleName();
40
+ $controller = Mage::app()->getRequest()->getControllerName();
41
+ return($module == 'catalog' && $controller == 'product');
42
+ }
43
+ else{
44
+ return true;
45
+ }
46
  }
47
+ return false;
 
 
48
 
49
  }
50
 
app/code/local/NanoRep/Widgets/Model/Observer.php CHANGED
@@ -11,7 +11,7 @@
11
  class NanoRep_Widgets_Model_Observer
12
  {
13
  private $session;
14
-
15
  public function __construct(){
16
  $this->_session = Mage::helper('nanorepwidgets')->getSession();
17
  }
11
  class NanoRep_Widgets_Model_Observer
12
  {
13
  private $session;
14
+
15
  public function __construct(){
16
  $this->_session = Mage::helper('nanorepwidgets')->getSession();
17
  }
app/code/local/NanoRep/Widgets/controllers/AccountController.php CHANGED
@@ -25,6 +25,18 @@ class NanoRep_Widgets_AccountController extends Mage_Core_Controller_Front_Actio
25
  {
26
  return Mage::getSingleton('customer/session');
27
  }
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  public function indexAction()
30
  {
@@ -178,5 +190,65 @@ class NanoRep_Widgets_AccountController extends Mage_Core_Controller_Front_Actio
178
  $this->_initLayoutMessages('catalog/session');
179
  $this->renderLayout();
180
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
  }
25
  {
26
  return Mage::getSingleton('customer/session');
27
  }
28
+
29
+ /**
30
+ * Get model by path
31
+ *
32
+ * @param string $path
33
+ * @param array|null $arguments
34
+ * @return false|Mage_Core_Model_Abstract
35
+ */
36
+ public function _getModel($path, $arguments = array())
37
+ {
38
+ return Mage::getModel($path, $arguments);
39
+ }
40
 
41
  public function indexAction()
42
  {
190
  $this->_initLayoutMessages('catalog/session');
191
  $this->renderLayout();
192
  }
193
+
194
+
195
+ /**
196
+ * Forgot customer password page
197
+ */
198
+ public function forgotPasswordAction()
199
+ {
200
+ $this->loadLayout();
201
+
202
+ $this->getLayout()->getBlock('forgotPassword')->setEmailValue(
203
+ $this->_getSession()->getForgottenEmail()
204
+ );
205
+ $this->_getSession()->unsForgottenEmail();
206
+
207
+ $this->_initLayoutMessages('customer/session');
208
+ $this->renderLayout();
209
+ }
210
+
211
+ /**
212
+ * Forgot customer password action
213
+ */
214
+ public function forgotPasswordPostAction()
215
+ {
216
+ $email = (string) $this->getRequest()->getPost('email');
217
+ if ($email) {
218
+ if (!Zend_Validate::is($email, 'EmailAddress')) {
219
+ $this->_getSession()->setForgottenEmail($email);
220
+ $this->_getSession()->addError($this->__('Invalid email address.'));
221
+ $this->_redirect('nanorepwidgets/account/forgotpassword');
222
+ return;
223
+ }
224
+
225
+ /** @var $customer Mage_Customer_Model_Customer */
226
+ $customer = $this->_getModel('customer/customer')
227
+ ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
228
+ ->loadByEmail($email);
229
+
230
+ if ($customer->getId()) {
231
+ try {
232
+ $newResetPasswordLinkToken = $this->_getHelper('customer')->generateResetPasswordLinkToken();
233
+ $customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
234
+ $customer->sendPasswordResetConfirmationEmail();
235
+ } catch (Exception $exception) {
236
+ $this->_getSession()->addError($exception->getMessage());
237
+ $this->_redirect('nanorepwidgets/account/forgotpassword');
238
+ return;
239
+ }
240
+ }
241
+ $this->_getSession()
242
+ ->addSuccess( $this->_getHelper('customer')
243
+ ->__('If there is an account associated with %s you will receive an email with a link to reset your password.',
244
+ $this->_getHelper('customer')->escapeHtml($email)));
245
+ $this->_redirect('nanorepwidgets/account/login');
246
+ return;
247
+ } else {
248
+ $this->_getSession()->addError($this->__('Please enter your email.'));
249
+ $this->_redirect('nanorepwidgets/account/forgotpassword');
250
+ return;
251
+ }
252
+ }
253
 
254
  }
app/code/local/NanoRep/Widgets/etc/config.xml CHANGED
@@ -12,7 +12,7 @@
12
  <config>
13
  <modules>
14
  <NanoRep_Widgets>
15
- <version>2.0.8</version>
16
  </NanoRep_Widgets>
17
  </modules>
18
  <global>
@@ -124,6 +124,12 @@
124
  <upsells_products>1</upsells_products>
125
  <crosssells_products>1</crosssells_products>
126
  </account_settings>
 
 
 
 
 
 
127
  <float_widget>
128
  <active>0</active>
129
  <active_pages>0</active_pages>
12
  <config>
13
  <modules>
14
  <NanoRep_Widgets>
15
+ <version>2.1.0</version>
16
  </NanoRep_Widgets>
17
  </modules>
18
  <global>
124
  <upsells_products>1</upsells_products>
125
  <crosssells_products>1</crosssells_products>
126
  </account_settings>
127
+ <contact_us_widget>
128
+ <active>1</active>
129
+ <title>Featured Questions</title>
130
+ <kb>English</kb>
131
+ <fields_css>a:1:{s:18:"_1424883221899_899";a:1:{s:3:"css";s:8:"#comment";}}</fields_css>
132
+ </contact_us_widget>
133
  <float_widget>
134
  <active>0</active>
135
  <active_pages>0</active_pages>
app/code/local/NanoRep/Widgets/etc/system.xml CHANGED
@@ -127,10 +127,55 @@
127
  </debug>
128
  </fields>
129
  </account_settings>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  <float_widget translate="label">
131
  <label>Floating Widget</label>
132
  <frontend_type>text</frontend_type>
133
- <sort_order>0</sort_order>
134
  <show_in_default>1</show_in_default>
135
  <show_in_website>1</show_in_website>
136
  <show_in_store>1</show_in_store>
127
  </debug>
128
  </fields>
129
  </account_settings>
130
+ <contact_us_widget translate="label">
131
+ <label>Contact Us Widget</label>
132
+ <frontend_type>text</frontend_type>
133
+ <sort_order>1</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ <fields>
138
+ <active translate="label">
139
+ <label>Enabled</label>
140
+ <frontend_type>select</frontend_type>
141
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
142
+ <sort_order>1</sort_order>
143
+ <show_in_default>1</show_in_default>
144
+ <show_in_website>1</show_in_website>
145
+ <show_in_store>1</show_in_store>
146
+ </active>
147
+ <title translate="label">
148
+ <label>Title</label>
149
+ <frontend_type>text</frontend_type>
150
+ <sort_order>5</sort_order>
151
+ <show_in_default>1</show_in_default>
152
+ <show_in_website>1</show_in_website>
153
+ <show_in_store>1</show_in_store>
154
+ </title>
155
+ <kb translate="label">
156
+ <label>Knowledge Base</label>
157
+ <frontend_type>text</frontend_type>
158
+ <sort_order>10</sort_order>
159
+ <show_in_default>1</show_in_default>
160
+ <show_in_website>1</show_in_website>
161
+ <show_in_store>1</show_in_store>
162
+ <comment>The knowledge base to export from. note: knowledge-base name is case-sensitive</comment>
163
+ </kb>
164
+ <fields_css translate="comment">
165
+ <label>Fields</label>
166
+ <frontend_model>nanorepwidgets/adminhtml_system_config_form_fields</frontend_model>
167
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
168
+ <sort_order>60</sort_order>
169
+ <show_in_default>1</show_in_default>
170
+ <show_in_website>1</show_in_website>
171
+ <show_in_store>1</show_in_store>
172
+ </fields_css>
173
+ </fields>
174
+ </contact_us_widget>
175
  <float_widget translate="label">
176
  <label>Floating Widget</label>
177
  <frontend_type>text</frontend_type>
178
+ <sort_order>2</sort_order>
179
  <show_in_default>1</show_in_default>
180
  <show_in_website>1</show_in_website>
181
  <show_in_store>1</show_in_store>
app/design/adminhtml/default/default/template/nanorepwidgets/system/config/form/fields.phtml ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package default_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+
28
+ <?php
29
+ $_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
30
+
31
+ $_colspan = 2;
32
+ if (!$this->_addAfter) {
33
+ $_colspan -= 1;
34
+ }
35
+ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
36
+ $rows = $this->getArrayRows();
37
+ ?>
38
+
39
+ <?php if(!empty($rows)):?>
40
+
41
+ <div class="grid" id="grid<?php echo $_htmlId ?>">
42
+ <table cellpadding="0" cellspacing="0" class="border">
43
+ <tbody>
44
+
45
+ <tr class="headings" id="headings<?php echo $_htmlId ?>">
46
+ <?php foreach ($this->_columns as $columnName => $column):?>
47
+ <th><?php echo $column['label'] ?></th>
48
+ <?php endforeach;?>
49
+ <th <?php echo $_colspan?>></th>
50
+ </tr>
51
+
52
+
53
+ <tr id="addRow<?php echo $_htmlId ?>">
54
+ <td colspan="<?php echo count($this->_columns) ?>"></td>
55
+ <td <?php echo $_colspan?>>-->
56
+
57
+
58
+ <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>">
59
+ <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span>
60
+ </button>
61
+
62
+
63
+ </td>
64
+ </tr>
65
+
66
+
67
+ </tbody>
68
+ </table>
69
+ <input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
70
+ </div>
71
+ <?php else: ?>
72
+ <p class="error">Error with API, Please Check the Mci Linet Log for more details</p>
73
+ <?php endif; ?>
74
+ <div id="empty<?php echo $_htmlId ?>">
75
+ <button style="" onclick="" class="scalable" type="button" id="emptyRefreshBtn<?php echo $_htmlId ?>">
76
+ <span><span><span><?php echo $this->helper('mcilinet')->__('Refresh');?></span></span></span>
77
+ </button>
78
+ </div>
79
+
80
+
81
+ <script type="text/javascript">
82
+ //<![CDATA[
83
+ // create row creator
84
+ var arrayRow<?php echo $_htmlId ?> = {
85
+ // define row prototypeJS template
86
+ template : new Template(
87
+ '<tr id="#{_id}">'
88
+ <?php foreach ($this->_columns as $columnName => $column):?>
89
+ +'<td>'
90
+ +'<?php echo $this->_renderCellTemplate($columnName)?>'
91
+ +'<\/td>'
92
+ <?php endforeach;?>
93
+ +'<\/tr>'
94
+ ),
95
+
96
+ rowsCount : 0,
97
+
98
+ add : function(templateData, insertAfterId)
99
+ {
100
+ // generate default template data
101
+ if ('' == templateData) {
102
+ var d = new Date();
103
+ var templateData = {
104
+ <?php foreach ($this->_columns as $columnName => $column):?>
105
+ <?php echo $columnName ?> : '',
106
+ <?php endforeach;?>
107
+ _id : '_' + d.getTime() + '_' + d.getMilliseconds()
108
+ };
109
+ }
110
+
111
+ // insert before last row
112
+ if ('' == insertAfterId) {
113
+ Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
114
+ }
115
+ // insert after specified row
116
+ else {
117
+ Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
118
+ }
119
+
120
+ // sets the selected option
121
+ if($$('#' + templateData._id + ' td select option[value = "' + templateData.magento_method + '"]').length == 1){
122
+ $$('#' + templateData._id + ' td select option[value = "' + templateData.magento_method + '"]')[0].setAttribute("selected", "selected");
123
+ }
124
+
125
+ if($$('#' + templateData._id + ' td select option[value = "' + templateData.online + '"]').length == 1){
126
+ $$('#' + templateData._id + ' td select option[value = "' + templateData.online + '"]')[0].setAttribute("selected", "selected");
127
+ }
128
+
129
+ <?php if ($this->_addAfter):?>
130
+ // Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
131
+ <?php endif;?>
132
+
133
+ this.rowsCount += 1;
134
+ },
135
+
136
+ del : function(rowId)
137
+ {
138
+ $(rowId).remove();
139
+ this.rowsCount -= 1;
140
+ },
141
+
142
+ // showButtonOnly : function()
143
+ // {
144
+ // $('grid<?php echo $_htmlId ?>').hide();
145
+ // $('empty<?php echo $_htmlId ?>').show();
146
+ // }
147
+ }
148
+
149
+ // bind add action to "Add" button in last row
150
+ // Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', ''));
151
+
152
+ // add existing rows
153
+ <?php
154
+ $_addAfterId = "headings{$_htmlId}";
155
+ foreach ($this->getArrayRows() as $_rowId => $_row) {
156
+ echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}');\n";
157
+ $_addAfterId = $_rowId;
158
+ }
159
+ ?>
160
+
161
+ // initialize standalone button
162
+ // $('empty<?php echo $_htmlId ?>').hide();
163
+ Event.observe('emptyRefreshBtn<?php echo $_htmlId ?>', 'click', function () {
164
+ new Ajax.Request("<?php echo $this->helper('adminhtml')->getUrl('mcilinet/adminhtml_ajax/getLinetPaymentMethods'); ?>", {
165
+ method : 'post',
166
+ onSuccess: function(transport){
167
+ try {
168
+ $$("#grid<?php echo $_htmlId;?> tr").each(function(el){
169
+ if(el.id.indexOf('headings') < 0){
170
+ arrayRow<?php echo $_htmlId;?>.del(el.id);
171
+ }
172
+ });
173
+ response = eval('(' + transport.responseText + ')');
174
+ var insertAfterId = "headings<?php echo $_htmlId; ?>";
175
+ for(var i in response){
176
+ arrayRow<?php echo $_htmlId; ?>.add(response[i], insertAfterId);
177
+ insertAfterId = response[i]._id;
178
+ }
179
+ } catch (e) {
180
+ response = {};
181
+ return;
182
+ }
183
+ },
184
+ onFailure : function(transport) {
185
+ if($('empty<?php echo $_htmlId ?>').down('span.error') != undefined){
186
+ $('empty<?php echo $_htmlId ?>').down('span.error').remove();
187
+ }
188
+ Element.insert($('emptyRefreshBtn<?php echo $_htmlId ?>'), {after: '<span class="error right"><?php echo $this->helper('mcilinet')->__('Unable to get Linet Methods') ?></span>'});
189
+ }
190
+ });
191
+ // $('grid<?php echo $_htmlId ?>').show();
192
+ // $('empty<?php echo $_htmlId ?>').hide();
193
+ // arrayRow<?php echo $_htmlId ?>.add('', '');
194
+ });
195
+
196
+ // if no rows, hide grid and show button only
197
+ <?php //if (!$this->getArrayRows()):?>
198
+ // arrayRow<?php echo $_htmlId ?>.showButtonOnly();
199
+ <?php //endif;?>
200
+
201
+ // toggle the grid, if element is disabled (depending on scope)
202
+ <?php if ($this->getElement()->getDisabled()):?>
203
+ toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
204
+ <?php endif;?>
205
+ //]]>
206
+ </script>
app/design/frontend/default/default/layout/nanorepwidgets.xml CHANGED
@@ -55,6 +55,13 @@
55
  </reference>
56
  </nanorepwidgets_account_login>
57
 
 
 
 
 
 
 
 
58
  <nanorepwidgets_order_list>
59
  <update handle="page_empty" />
60
  <remove name="nanorep_header_script" />
@@ -65,6 +72,15 @@
65
  </reference>
66
  </nanorepwidgets_order_list>
67
 
 
 
 
 
 
 
 
 
 
68
  <!-- Custom page layout handles -->
69
  <nanorepwidgets_page_empty translate="label">
70
  <label>All Empty Layout Pages</label>
55
  </reference>
56
  </nanorepwidgets_account_login>
57
 
58
+ <nanorepwidgets_account_forgotpassword>
59
+ <update handle="nanorepwidgets_page_empty" />
60
+ <reference name="content">
61
+ <block type="nanorepwidgets/forgotpassword" name="forgotPassword" template="nanorepwidgets/forgotpassword.phtml" />
62
+ </reference>
63
+ </nanorepwidgets_account_forgotpassword>
64
+
65
  <nanorepwidgets_order_list>
66
  <update handle="page_empty" />
67
  <remove name="nanorep_header_script" />
72
  </reference>
73
  </nanorepwidgets_order_list>
74
 
75
+ <contacts_index_index>
76
+ <reference name="head">
77
+ <action method="addItem"><type>skin_css</type><file>nanorepwidgets/contactus.css</file></action>
78
+ </reference>
79
+ <reference name="before_body_end">
80
+ <block type="nanorepwidgets/contactus" ifconfig="nanorepwidgets/contact_us_widget/active" name="nanorep_contact_us_widget" as="nanorep.contact_us.widget" template="nanorepwidgets/contact_us.phtml" />
81
+ </reference>
82
+ </contacts_index_index>
83
+
84
  <!-- Custom page layout handles -->
85
  <nanorepwidgets_page_empty translate="label">
86
  <label>All Empty Layout Pages</label>
app/design/frontend/default/default/template/nanorepwidgets/contact_us.phtml ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NanoRep Widgets Extension
4
+ *
5
+ * @package NanoRep_Widgets
6
+ * @company Omniscience Co.
7
+ * @website http://www.omniscience.co.il
8
+ * @author Dan Aharon-Shalom
9
+ */
10
+ ?>
11
+ <?php if(Mage::helper("nanorepwidgets")->isContactUsWidgetActive()): ?>
12
+ <?php $fileds = $this->getFieldsCssCommaSeperated();?>
13
+ <?php if($fileds != ""): ?>
14
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('nanorepwidgets/jsonp.js') ?>"></script>
15
+ <script type="text/javascript">
16
+ var _nanoRepContactusSessionId = '';
17
+
18
+ function getNanoRepContactUsSessionId(query, e){
19
+ var getSessionIdUrl = "<?php echo $this->getApiServerUrl('hello.js'); ?>";
20
+ new Ajax.JSONRequest(getSessionIdUrl, {
21
+ callbackParamName: "cb",
22
+ parameters: {
23
+ url : window.location.href,
24
+ kb : "<?php echo $this->getKb(); ?>",
25
+ sid : "0"
26
+ },
27
+ onCreate: function(response) {
28
+ // console.log("1: create", response, response.responseJSON);
29
+ },
30
+ onSuccess: function(response) {
31
+ var data = response.responseJSON;
32
+ _nanoRepContactusSessionId = data['sessionId'];
33
+ setTimeout(function() {
34
+ _nanoRepContactusSessionId = ''
35
+ }, data['timeout'] * 1000);
36
+ // console.log("Nanorep Session Opened: " + _nanoRepContactusSessionId);
37
+ queryNanoRepContactUs(query, _nanoRepContactusSessionId, e);
38
+ // console.log("1: success", response, response.responseJSON);
39
+ },
40
+ onFailure: function(response) {
41
+ // console.log("1: fail", response, response.responseJSON);
42
+ },
43
+ onComplete: function(response) {
44
+ // console.log("1: complete", response, response.responseJSON);
45
+ }
46
+ });
47
+ }
48
+
49
+ function queryNanoRepContactUs(query, sid, e){
50
+ var nanoRepQueryApiUrl = "<?php echo $this->getApiServerUrl("q.js")?>"
51
+
52
+ if(sid == ''){
53
+ getNanoRepContactUsSessionId();
54
+ }
55
+ new Ajax.JSONRequest(nanoRepQueryApiUrl, {
56
+ callbackParamName: "cb",
57
+ parameters: {
58
+ auto : "false",
59
+ text : query,
60
+ sameQ : "false",
61
+ suggestion : "false",
62
+ kb : "<?php echo $this->getKb(); ?>",
63
+ "sid" : sid
64
+ },
65
+ onCreate: function(response) {
66
+ // console.log("1: create", response, response.responseJSON);
67
+ },
68
+ onSuccess: function(response) {
69
+ var data = response.responseJSON;
70
+ // console.log(e);
71
+ // console.log(data);
72
+ nanoRepContactUsAnswers.title = "<?php echo $this->getTitle(); ?>";
73
+ if(data.answers.length > 0){
74
+ for(a = 0; a < data.answers.length; a++){
75
+ if(data.answers[a].context != undefined){
76
+ data.answers.splice(a, 1);
77
+ }
78
+ }
79
+ if(data.answers.length > 0){
80
+ nanoRepContactUsAnswers.show(e, data.answers);
81
+ }
82
+ else{
83
+ $('answers-popup-text').innerHTML = '';
84
+ nanoRepContactUsAnswers.hide();
85
+
86
+ }
87
+
88
+ }
89
+ else{
90
+ $('answers-popup-text').innerHTML = '';
91
+ nanoRepContactUsAnswers.hide();
92
+ }
93
+ // console.log("1: success", response, response.responseJSON);
94
+ },
95
+ onFailure: function(response) {
96
+ // console.log("1: fail", response, response.responseJSON);
97
+ },
98
+ onComplete: function(response) {
99
+ // console.log("1: complete", response, response.responseJSON);
100
+ }
101
+ });
102
+ }
103
+
104
+ var fields_css = [<?php echo $fileds ?>];
105
+ if(fields_css.length > 0){
106
+ for(var i = 0; i < fields_css.length; i++){
107
+ $$(fields_css[i])[0].observe('keyup', function(e){
108
+ var query = e.target.value;
109
+ if(query != ""){
110
+ if(_nanoRepContactusSessionId == ''){
111
+ getNanoRepContactUsSessionId(query, e);
112
+ }
113
+ else{
114
+ queryNanoRepContactUs(query, _nanoRepContactusSessionId, e);
115
+ }
116
+ }
117
+ });
118
+ }
119
+ }
120
+ </script>
121
+
122
+ <div id="answers-popup" class="answers-popup" style="display:none">
123
+ <a href="#" class="answers-popup-close" id="answers-popup-close">×</a>
124
+ <div class="answers-popup-heading"><h3 id="answers-popup-heading"></h3></div>
125
+ <div class="answers-popup-content" id="answers-popup-content">
126
+ <div class="answers-popup-text" id="answers-popup-text"></div>
127
+ </div>
128
+ </div>
129
+
130
+ <script type="text/javascript">
131
+ nanoRepContactUsAnswers = {
132
+
133
+ active: false,
134
+
135
+ show: function(event, answers) {
136
+ var helpBox = $('answers-popup'),
137
+ bodyNode = $$('body')[0];
138
+ isIE6 = typeof document.body.style.maxHeight === "undefined";
139
+ if (!helpBox) {
140
+ return;
141
+ }
142
+
143
+ //Move help box to be right in body tag
144
+ var bodyNode = $$('body')[0];
145
+ if (helpBox.parentNode != bodyNode) {
146
+ helpBox.remove();
147
+ bodyNode.insert(helpBox);
148
+ }
149
+ if (!this.active /*this != nanoRepContactUsAnswers*/ /*&& this.active != this.link*/) {
150
+ helpBox.style.display = 'none';
151
+ if (!helpBox.offsetPosition) {
152
+ helpBox.offsetPosition = {left:0, top: 0};
153
+ }
154
+
155
+ helpBox.removeClassName('answers-popup-right');
156
+ helpBox.removeClassName('answers-popup-left');
157
+ helpBox.style.left = Element.cumulativeOffset(event.target).left + Element.getWidth(event.target) + 20 + 'px';
158
+ helpBox.style.top = Element.cumulativeOffset(event.target).top - Element.getHeight(helpBox) + 'px';
159
+
160
+ //Title
161
+ var answersTitle = $('answers-popup-heading');
162
+ if (typeof this.title != 'undefined') {
163
+ Element.update(answersTitle, this.title);
164
+ $(answersTitle).show();
165
+ } else {
166
+ $(answersTitle).hide();
167
+ }
168
+
169
+ //Horizontal line
170
+ var answerText = $('answers-popup-text'),
171
+ answerContent = $('answers-popup-content');
172
+
173
+ answerText.innerHTML = '';
174
+ for(a = 0; a < answers.length; a++){
175
+ if(answers[a].summary.indexOf('{{orders_string}}') > 0){
176
+ answers[a].summary = answers[a].summary.replace('{{orders_string}}', _nRepData["customParams"]['orders_string']);
177
+ }
178
+ var item = '<div class="nanorepItem"><div class="nanorepItemTitle"><h5>' + answers[a].title + '</h5></div><div class="nanorepItemDescription">' + answers[a].summary + '</div></div>';
179
+ answerText.insert(item);
180
+ }
181
+
182
+ $$('.nanorepItemTitle').each(function(el){
183
+ el.observe('click', function(e) {
184
+ this.up('.nanorepItem').toggleClassName('isOpen');
185
+ });
186
+ });
187
+
188
+ $(helpBox).show();
189
+ this.active = true;
190
+ var closeButton = $('answers-popup-close');
191
+ if (closeButton) {
192
+ $(closeButton).stopObserving('click');
193
+ Event.observe(closeButton, 'click', nanoRepContactUsAnswers.hide.bind(this));
194
+ this.active = false;
195
+ }
196
+ } else {
197
+ $(helpBox).hide();
198
+ this.active = false;
199
+ }
200
+
201
+ Event.stop(event);
202
+ },
203
+
204
+ hide: function(){
205
+ var helpBox = $('answers-popup');
206
+ if (helpBox) {
207
+ var isIE6 = typeof document.body.style.maxHeight === "undefined";
208
+ $(helpBox).hide();
209
+ if (isIE6) {
210
+ nanoRepContactUsAnswers.showSelects();
211
+ }
212
+ this.active = false;
213
+ }
214
+ },
215
+ };
216
+
217
+ Event.observe(window, 'resize', function(event) {
218
+ if (nanoRepContactUsAnswers.active) {
219
+ nanoRepContactUsAnswers.showHelp(event);
220
+ }
221
+ });
222
+
223
+ </script>
224
+ <?php endif; ?>
225
+ <?php endif; ?>
app/design/frontend/default/default/template/nanorepwidgets/forgotpassword.phtml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <style>
28
+ .nanorep-forgot-password-form{ width: 300px; }
29
+ </style>
30
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
31
+ <form class="nanorep-forgot-password-form" action="<?php echo $this->getUrl('nanorepwidgets/account/forgotpasswordpost') ?>" method="post" id="form-validate">
32
+ <div class="fieldset">
33
+ <h2 class="legend"><?php echo $this->__('Retrieve your password here') ?></h2>
34
+ <p><?php echo $this->__('Please enter your email address below. You will receive a link to reset your password.') ?></p>
35
+ <ul class="form-list">
36
+ <li>
37
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
38
+ <div class="input-box">
39
+ <input type="text" name="email" alt="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" />
40
+ </div>
41
+ </li>
42
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
43
+ </ul>
44
+ </div>
45
+ <div class="buttons-set">
46
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
47
+ <p class="back-link"><a href="<?php echo $this->getUrl('nanorepwidgets/account/login'); ?>"><small>&laquo; </small><?php echo $this->__('Back to Login') ?></a></p>
48
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
49
+ </div>
50
+ </form>
51
+ <script type="text/javascript">
52
+ //<![CDATA[
53
+ var dataForm = new VarienForm('form-validate', true);
54
+ //]]>
55
+ </script>
app/design/frontend/default/default/template/nanorepwidgets/login.phtml CHANGED
@@ -31,6 +31,10 @@
31
  * @see Mage_Customer_Block_Form_Login
32
  */
33
  ?>
 
 
 
 
34
  <div class="block block-login">
35
  <div class="block-title">
36
  <strong><span><?php echo $this->__('Login') ?></span></strong>
@@ -41,6 +45,7 @@
41
  <label for="mini-login"><?php echo $this->__('Email:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" />
42
  <label for="mini-password"><?php echo $this->__('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" />
43
  <div class="actions">
 
44
  <button type="submit" class="button"><span><span><?php echo $this->__('Login') ?></span></span></button>
45
  </div>
46
  </div>
31
  * @see Mage_Customer_Block_Form_Login
32
  */
33
  ?>
34
+ <style>
35
+ body.nanorepwidgets-account-login .block-content{ width: 300px; }
36
+ </style>
37
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
38
  <div class="block block-login">
39
  <div class="block-title">
40
  <strong><span><?php echo $this->__('Login') ?></span></strong>
45
  <label for="mini-login"><?php echo $this->__('Email:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" />
46
  <label for="mini-password"><?php echo $this->__('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" />
47
  <div class="actions">
48
+ <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
49
  <button type="submit" class="button"><span><span><?php echo $this->__('Login') ?></span></span></button>
50
  </div>
51
  </div>
app/design/frontend/rwd/default/layout/nanorepwidgets.xml CHANGED
@@ -55,6 +55,13 @@
55
  </reference>
56
  </nanorepwidgets_account_login>
57
 
 
 
 
 
 
 
 
58
  <nanorepwidgets_order_list>
59
  <update handle="page_empty" />
60
  <remove name="nanorep_header_script" />
@@ -65,6 +72,15 @@
65
  </reference>
66
  </nanorepwidgets_order_list>
67
 
 
 
 
 
 
 
 
 
 
68
  <!-- Custom page layout handles -->
69
  <nanorepwidgets_page_empty translate="label">
70
  <label>All Empty Layout Pages</label>
55
  </reference>
56
  </nanorepwidgets_account_login>
57
 
58
+ <nanorepwidgets_account_forgotpassword>
59
+ <update handle="nanorepwidgets_page_empty" />
60
+ <reference name="content">
61
+ <block type="nanorepwidgets/forgotpassword" name="forgotPassword" template="nanorepwidgets/forgotpassword.phtml" />
62
+ </reference>
63
+ </nanorepwidgets_account_forgotpassword>
64
+
65
  <nanorepwidgets_order_list>
66
  <update handle="page_empty" />
67
  <remove name="nanorep_header_script" />
72
  </reference>
73
  </nanorepwidgets_order_list>
74
 
75
+ <contacts_index_index>
76
+ <reference name="head">
77
+ <action method="addItem"><type>skin_css</type><file>nanorepwidgets/contactus.css</file></action>
78
+ </reference>
79
+ <reference name="before_body_end">
80
+ <block type="nanorepwidgets/contactus" ifconfig="nanorepwidgets/contact_us_widget/active" name="nanorep_contact_us_widget" as="nanorep.contact_us.widget" template="nanorepwidgets/contact_us.phtml" />
81
+ </reference>
82
+ </contacts_index_index>
83
+
84
  <!-- Custom page layout handles -->
85
  <nanorepwidgets_page_empty translate="label">
86
  <label>All Empty Layout Pages</label>
app/design/frontend/rwd/default/template/nanorepwidgets/contact_us.phtml ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NanoRep Widgets Extension
4
+ *
5
+ * @package NanoRep_Widgets
6
+ * @company Omniscience Co.
7
+ * @website http://www.omniscience.co.il
8
+ * @author Dan Aharon-Shalom
9
+ */
10
+ ?>
11
+ <?php if(Mage::helper("nanorepwidgets")->isContactUsWidgetActive()): ?>
12
+ <?php $fileds = $this->getFieldsCssCommaSeperated();?>
13
+ <?php if($fileds != ""): ?>
14
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('nanorepwidgets/jsonp.js') ?>"></script>
15
+ <script type="text/javascript">
16
+ var _nanoRepContactusSessionId = '';
17
+
18
+ function getNanoRepContactUsSessionId(query, e){
19
+ var getSessionIdUrl = "<?php echo $this->getApiServerUrl('hello.js'); ?>";
20
+ new Ajax.JSONRequest(getSessionIdUrl, {
21
+ callbackParamName: "cb",
22
+ parameters: {
23
+ url : window.location.href,
24
+ kb : "<?php echo $this->getKb(); ?>",
25
+ sid : "0"
26
+ },
27
+ onCreate: function(response) {
28
+ // console.log("1: create", response, response.responseJSON);
29
+ },
30
+ onSuccess: function(response) {
31
+ var data = response.responseJSON;
32
+ _nanoRepContactusSessionId = data['sessionId'];
33
+ setTimeout(function() {
34
+ _nanoRepContactusSessionId = ''
35
+ }, data['timeout'] * 1000);
36
+ // console.log("Nanorep Session Opened: " + _nanoRepContactusSessionId);
37
+ queryNanoRepContactUs(query, _nanoRepContactusSessionId, e);
38
+ // console.log("1: success", response, response.responseJSON);
39
+ },
40
+ onFailure: function(response) {
41
+ // console.log("1: fail", response, response.responseJSON);
42
+ },
43
+ onComplete: function(response) {
44
+ // console.log("1: complete", response, response.responseJSON);
45
+ }
46
+ });
47
+ }
48
+
49
+ function queryNanoRepContactUs(query, sid, e){
50
+ var nanoRepQueryApiUrl = "<?php echo $this->getApiServerUrl("q.js")?>"
51
+
52
+ if(sid == ''){
53
+ getNanoRepContactUsSessionId();
54
+ }
55
+ new Ajax.JSONRequest(nanoRepQueryApiUrl, {
56
+ callbackParamName: "cb",
57
+ parameters: {
58
+ auto : "false",
59
+ text : query,
60
+ sameQ : "false",
61
+ suggestion : "false",
62
+ kb : "<?php echo $this->getKb(); ?>",
63
+ "sid" : sid
64
+ },
65
+ onCreate: function(response) {
66
+ // console.log("1: create", response, response.responseJSON);
67
+ },
68
+ onSuccess: function(response) {
69
+ var data = response.responseJSON;
70
+ // console.log(e);
71
+ // console.log(data);
72
+ nanoRepContactUsAnswers.title = "<?php echo $this->getTitle(); ?>";
73
+ if(data.answers.length > 0){
74
+ for(a = 0; a < data.answers.length; a++){
75
+ if(data.answers[a].context != undefined){
76
+ data.answers.splice(a, 1);
77
+ }
78
+ }
79
+ if(data.answers.length > 0){
80
+ nanoRepContactUsAnswers.show(e, data.answers);
81
+ }
82
+ else{
83
+ $('answers-popup-text').innerHTML = '';
84
+ nanoRepContactUsAnswers.hide();
85
+
86
+ }
87
+
88
+ }
89
+ else{
90
+ $('answers-popup-text').innerHTML = '';
91
+ nanoRepContactUsAnswers.hide();
92
+ }
93
+ // console.log("1: success", response, response.responseJSON);
94
+ },
95
+ onFailure: function(response) {
96
+ // console.log("1: fail", response, response.responseJSON);
97
+ },
98
+ onComplete: function(response) {
99
+ // console.log("1: complete", response, response.responseJSON);
100
+ }
101
+ });
102
+ }
103
+
104
+ var fields_css = [<?php echo $fileds ?>];
105
+ if(fields_css.length > 0){
106
+ for(var i = 0; i < fields_css.length; i++){
107
+ $$(fields_css[i])[0].observe('keyup', function(e){
108
+ var query = e.target.value;
109
+ if(query != ""){
110
+ if(_nanoRepContactusSessionId == ''){
111
+ getNanoRepContactUsSessionId(query, e);
112
+ }
113
+ else{
114
+ queryNanoRepContactUs(query, _nanoRepContactusSessionId, e);
115
+ }
116
+ }
117
+ });
118
+ }
119
+ }
120
+ </script>
121
+
122
+ <div id="answers-popup" class="answers-popup" style="display:none">
123
+ <a href="#" class="answers-popup-close" id="answers-popup-close">×</a>
124
+ <div class="answers-popup-heading"><h3 id="answers-popup-heading"></h3></div>
125
+ <div class="answers-popup-content" id="answers-popup-content">
126
+ <div class="answers-popup-text" id="answers-popup-text"></div>
127
+ </div>
128
+ </div>
129
+
130
+ <script type="text/javascript">
131
+ nanoRepContactUsAnswers = {
132
+
133
+ active: false,
134
+
135
+ show: function(event, answers) {
136
+ var helpBox = $('answers-popup'),
137
+ bodyNode = $$('body')[0];
138
+ isIE6 = typeof document.body.style.maxHeight === "undefined";
139
+ if (!helpBox) {
140
+ return;
141
+ }
142
+
143
+ //Move help box to be right in body tag
144
+ var bodyNode = $$('body')[0];
145
+ if (helpBox.parentNode != bodyNode) {
146
+ helpBox.remove();
147
+ bodyNode.insert(helpBox);
148
+ }
149
+ if (!this.active /*this != nanoRepContactUsAnswers*/ /*&& this.active != this.link*/) {
150
+ helpBox.style.display = 'none';
151
+ if (!helpBox.offsetPosition) {
152
+ helpBox.offsetPosition = {left:0, top: 0};
153
+ }
154
+
155
+ helpBox.removeClassName('answers-popup-right');
156
+ helpBox.removeClassName('answers-popup-left');
157
+ helpBox.style.left = Element.cumulativeOffset(event.target).left + Element.getWidth(event.target) + 20 + 'px';
158
+ helpBox.style.top = Element.cumulativeOffset(event.target).top - Element.getHeight(helpBox) + 'px';
159
+
160
+ //Title
161
+ var answersTitle = $('answers-popup-heading');
162
+ if (typeof this.title != 'undefined') {
163
+ Element.update(answersTitle, this.title);
164
+ $(answersTitle).show();
165
+ } else {
166
+ $(answersTitle).hide();
167
+ }
168
+
169
+ //Horizontal line
170
+ var answerText = $('answers-popup-text'),
171
+ answerContent = $('answers-popup-content');
172
+
173
+ answerText.innerHTML = '';
174
+ for(a = 0; a < answers.length; a++){
175
+ if(answers[a].summary.indexOf('{{orders_string}}') > 0){
176
+ answers[a].summary = answers[a].summary.replace('{{orders_string}}', _nRepData["customParams"]['orders_string']);
177
+ }
178
+ var item = '<div class="nanorepItem"><div class="nanorepItemTitle"><h5>' + answers[a].title + '</h5></div><div class="nanorepItemDescription">' + answers[a].summary + '</div></div>';
179
+ answerText.insert(item);
180
+ }
181
+
182
+ $$('.nanorepItemTitle').each(function(el){
183
+ el.observe('click', function(e) {
184
+ this.up('.nanorepItem').toggleClassName('isOpen');
185
+ });
186
+ });
187
+
188
+ $(helpBox).show();
189
+ this.active = true;
190
+ var closeButton = $('answers-popup-close');
191
+ if (closeButton) {
192
+ $(closeButton).stopObserving('click');
193
+ Event.observe(closeButton, 'click', nanoRepContactUsAnswers.hide.bind(this));
194
+ this.active = false;
195
+ }
196
+ } else {
197
+ $(helpBox).hide();
198
+ this.active = false;
199
+ }
200
+
201
+ Event.stop(event);
202
+ },
203
+
204
+ hide: function(){
205
+ var helpBox = $('answers-popup');
206
+ if (helpBox) {
207
+ var isIE6 = typeof document.body.style.maxHeight === "undefined";
208
+ $(helpBox).hide();
209
+ if (isIE6) {
210
+ nanoRepContactUsAnswers.showSelects();
211
+ }
212
+ this.active = false;
213
+ }
214
+ },
215
+ };
216
+
217
+ Event.observe(window, 'resize', function(event) {
218
+ if (nanoRepContactUsAnswers.active) {
219
+ nanoRepContactUsAnswers.showHelp(event);
220
+ }
221
+ });
222
+
223
+ </script>
224
+ <?php endif; ?>
225
+ <?php endif; ?>
app/design/frontend/rwd/default/template/nanorepwidgets/forgotpassword.phtml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <style>
28
+ .nanorep-forgot-password-form{ width: 300px; }
29
+ </style>
30
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
31
+ <form class="nanorep-forgot-password-form" action="<?php echo $this->getUrl('nanorepwidgets/account/forgotpasswordpost') ?>" method="post" id="form-validate">
32
+ <div class="fieldset">
33
+ <h2 class="legend"><?php echo $this->__('Retrieve your password here') ?></h2>
34
+ <p><?php echo $this->__('Please enter your email address below. You will receive a link to reset your password.') ?></p>
35
+ <ul class="form-list">
36
+ <li>
37
+ <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
38
+ <div class="input-box">
39
+ <input type="text" name="email" alt="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" />
40
+ </div>
41
+ </li>
42
+ <?php echo $this->getChildHtml('form.additional.info'); ?>
43
+ </ul>
44
+ </div>
45
+ <div class="buttons-set">
46
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
47
+ <p class="back-link"><a href="<?php echo $this->getUrl('nanorepwidgets/account/login'); ?>"><small>&laquo; </small><?php echo $this->__('Back to Login') ?></a></p>
48
+ <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
49
+ </div>
50
+ </form>
51
+ <script type="text/javascript">
52
+ //<![CDATA[
53
+ var dataForm = new VarienForm('form-validate', true);
54
+ //]]>
55
+ </script>
app/design/frontend/rwd/default/template/nanorepwidgets/login.phtml CHANGED
@@ -31,6 +31,10 @@
31
  * @see Mage_Customer_Block_Form_Login
32
  */
33
  ?>
 
 
 
 
34
  <div class="block block-login">
35
  <div class="block-title">
36
  <strong><span><?php echo $this->__('Login') ?></span></strong>
@@ -41,6 +45,7 @@
41
  <label for="mini-login"><?php echo $this->__('Email:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" />
42
  <label for="mini-password"><?php echo $this->__('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" />
43
  <div class="actions">
 
44
  <button type="submit" class="button"><span><span><?php echo $this->__('Login') ?></span></span></button>
45
  </div>
46
  </div>
31
  * @see Mage_Customer_Block_Form_Login
32
  */
33
  ?>
34
+ <style>
35
+ body.nanorepwidgets-account-login .block-content{ width: 300px; }
36
+ </style>
37
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
38
  <div class="block block-login">
39
  <div class="block-title">
40
  <strong><span><?php echo $this->__('Login') ?></span></strong>
45
  <label for="mini-login"><?php echo $this->__('Email:') ?></label><input type="text" name="login[username]" id="mini-login" class="input-text" />
46
  <label for="mini-password"><?php echo $this->__('Password:') ?></label><input type="password" name="login[password]" id="mini-password" class="input-text" />
47
  <div class="actions">
48
+ <a href="<?php echo $this->getForgotPasswordUrl() ?>" class="f-left"><?php echo $this->__('Forgot Your Password?') ?></a>
49
  <button type="submit" class="button"><span><span><?php echo $this->__('Login') ?></span></span></button>
50
  </div>
51
  </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NanoRep_Widgets_1_1_0</name>
4
- <version>2.0.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GPL v3.0</license>
7
  <channel>community</channel>
@@ -45,11 +45,11 @@ Agents get a 360&#xD;
45
  degree view of customers&#x2019; activity before&#xD;
46
  working on cases.&#xD;
47
  </description>
48
- <notes>login form update</notes>
49
  <authors><author><name>NanoRep</name><user>avivnanore</user><email>aviv@nanorep.com</email></author></authors>
50
- <date>2015-01-21</date>
51
- <time>11:10:45</time>
52
- <contents><target name="magelocal"><dir name="NanoRep"><dir name="Widgets"><dir name="Block"><dir name="Adminhtml"><dir name="Answer"><dir name="Grid"><file name="Export.php" hash="98bed6330628da0056b9281cd0044ab1"/></dir><file name="Grid.php" hash="bda00ac3e4e1d85327eac227949e7bb5"/></dir><file name="Answer.php" hash="2c1b7c5dfdd1485b6c3cd8eb2c134bcd"/><file name="Mynanorep.php" hash="a7aea34f919bc75ca9a2d374a115b3fa"/><dir name="Order"><dir name="Grid"><file name="Export.php" hash="13bc156b3331c9b2dacde70e8483a909"/></dir><file name="Grid.php" hash="a78d4a0d35b0f1575763af33bb7c03e4"/></dir><file name="Order.php" hash="39ebfd2fe23db490046ae8e324901b72"/><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Answer"><dir name="Body"><file name="Pretty.php" hash="0a7d01f7ff96b9bace44256e82ab047e"/></dir><file name="Body.php" hash="89f497faa6a03cac040834804439a8d2"/><dir name="Title"><file name="Pretty.php" hash="b47a584daaed1c1e55545877b097f75b"/></dir><file name="Title.php" hash="115ee0a85937406fa07e8d439f1e3dbb"/></dir><dir name="Questions"><file name="Pretty.php" hash="3ffd9f82f2c5c2696eed0f35f7109b9e"/></dir><file name="Questions.php" hash="1a979d2272acde87c1e907aa29816c6c"/><dir name="Results"><file name="Pretty.php" hash="f0c8ba45e792f4cfee6ce4a22a3898fa"/></dir><file name="Results.php" hash="d08aa0325398bc23b335df26ca48c53c"/></dir></dir></dir></dir></dir><file name="Customerhistoryjson.php" hash="2e6a8dc4c0e5c49639ff088ac3910009"/><file name="Embed.php" hash="c228d0d8d1dce3a975147434ef8f38ea"/><file name="Events.php" hash="5f5f965d626c8b73c072db1fca506d4c"/><file name="Float.php" hash="e51c028ad72498a96dcd1b38ae2f18f7"/><file name="Header.php" hash="88fbe58d72982d15434f4b0d1462942e"/><file name="Login.php" hash="26301dd7a70c4d73937d0e33d027942d"/><file name="Success.php" hash="9383181f50edf203c457872412de7a0c"/></dir><dir name="Helper"><file name="Data.php" hash="9c87dbc1138c4017678203141050eecc"/></dir><dir name="Model"><file name="Answer.php" hash="3931d7299a746e0ac90a6cae4a154982"/><file name="History.php" hash="0ffa4f8d5366abc1f7702e101cc5a90f"/><file name="Observer.php" hash="dec7cbc2f825f40ec18737b6bead79aa"/><file name="Query.php" hash="c4eaf10c4bae492d782b552550570215"/><file name="Request.php" hash="aa581b40cd716654a1f71cc0fe202fcc"/><dir name="Resource"><dir name="Answer"><file name="Collection.php" hash="febae104bf1dd741119b8cf6f168b21d"/></dir><file name="Answer.php" hash="0f79604579c93d4315b62cc23d595a53"/><dir name="Query"><file name="Collection.php" hash="ab7cd2f853a4f21d216ee24748a9b1c8"/></dir><file name="Query.php" hash="ccc5ae9e2e2f144c37fef2245033911c"/><file name="Setup.php" hash="812ef9ae3c38fe84eda2c702890faac5"/></dir><file name="Session.php" hash="63b7e34c1782e8e376936e7f196b0353"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="ConversionTracking.php" hash="fd8154dd85c21be1f8e4270f21e42358"/></dir><dir name="Source"><file name="Attribute.php" hash="03529194354c0557a881305a69158fa5"/><file name="FloatWidgetActivePages.php" hash="e1f7f28f4e3e13ba13e4293eed61a943"/><file name="OrdersStatusActivePages.php" hash="f098536503386289102acfcc19d016a6"/><file name="ProductIdAttribute.php" hash="03c69b051e8ba54e47f87b6f1495c19e"/></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="a0500edbd0a13d11a8e5827a30fa5b20"/><dir name="Adminhtml"><file name="AnswerController.php" hash="c78297d83f113e8e01cc6b39158bdc66"/><file name="MynanorepController.php" hash="b411ddc154ef98ca3f568daab73fd003"/><file name="OrderController.php" hash="b5484dde49a2ebbcc8b0933bcad4c0bb"/></dir><file name="IndexController.php" hash="a88b39a8ee27925df32be3c57f95cbf6"/><file name="OrderController.php" hash="45be95b16ff3bbf928c0e8234a4a3fb2"/><file name="QueryController.php" hash="58145cd9ff89c0bc7ff078c0d11b4d83"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6b796ffd37d982a516efac2d8870c4dc"/><file name="config.xml" hash="dc594ad8acc82ae77170ff80b2775f7d"/><file name="system.xml" hash="8cad9f521d66e0361e756c57be7e6c11"/></dir><dir name="sql"><dir name="nanorepwidgets_setup"><file name="install-2.0.0.php" hash="df808cb581bb4e2cf8a03687c2969d1b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NanoRep_Widgets.xml" hash="4fbaad20e02fa3ed2147ba15864c3cab"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="nanorepwidgets.xml" hash="e96041a1ed3c926dee56f25a8052754d"/></dir><dir name="template"><dir name="nanorepwidgets"><file name="cdc.phtml" hash="587dab4d48df5773746b7ddff0a0165b"/><file name="embed.phtml" hash="690b5ab9ed1d024a27220732a28652f5"/><file name="empty_page.phtml" hash="bc909c2029bf6035c74b4c2c8c8c4873"/><file name="events.phtml" hash="32c2e2b9f798104fb47db6a1a104783c"/><file name="float.phtml" hash="3a082b0822f143b8e8f7dc1da4137d1c"/><file name="header.phtml" hash="aee72cc5a4e551326c5c8c5931234f0f"/><file name="login.phtml" hash="a6943c8ed639fc690a5b1e3b19681562"/><dir name="order"><file name="list.phtml" hash="83009ccc06d76eacea13c96caaf77c44"/></dir><file name="success.phtml" hash="9db1192b7c1190c07b983431f400d6b2"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="nanorepwidgets.xml" hash="e96041a1ed3c926dee56f25a8052754d"/></dir><dir name="template"><dir name="nanorepwidgets"><file name="cdc.phtml" hash="587dab4d48df5773746b7ddff0a0165b"/><file name="embed.phtml" hash="690b5ab9ed1d024a27220732a28652f5"/><file name="empty_page.phtml" hash="bc909c2029bf6035c74b4c2c8c8c4873"/><file name="events.phtml" hash="32c2e2b9f798104fb47db6a1a104783c"/><file name="float.phtml" hash="3a082b0822f143b8e8f7dc1da4137d1c"/><file name="header.phtml" hash="aee72cc5a4e551326c5c8c5931234f0f"/><file name="login.phtml" hash="a6943c8ed639fc690a5b1e3b19681562"/><dir name="order"><file name="list.phtml" hash="83009ccc06d76eacea13c96caaf77c44"/></dir><file name="success.phtml" hash="9db1192b7c1190c07b983431f400d6b2"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir><dir name="default"><dir name="default"><dir name="template"><dir name="nanorepwidgets"><file name="mynanorep.phtml" hash="ecdbcbdfbe5c4e4ed18aaf74492b5adb"/></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="nanorepwidgets.xml" hash="341cf527d4c3eb6c452f5398d2ed7588"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="nanorepwidgets"><file name="head.css" hash="1779a092e2c2a771a0725e1cdd682a46"/><file name="head.js" hash="8bafa94d8432b42e2e6e7f6af91db39e"/></dir></dir></dir></dir></target></contents>
53
  <compatible/>
54
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
55
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NanoRep_Widgets_1_1_0</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GPL v3.0</license>
7
  <channel>community</channel>
45
  degree view of customers&#x2019; activity before&#xD;
46
  working on cases.&#xD;
47
  </description>
48
+ <notes>Contact us integration</notes>
49
  <authors><author><name>NanoRep</name><user>avivnanore</user><email>aviv@nanorep.com</email></author></authors>
50
+ <date>2015-03-01</date>
51
+ <time>17:31:04</time>
52
+ <contents><target name="magelocal"><dir name="NanoRep"><dir name="Widgets"><dir name="Block"><dir name="Adminhtml"><dir name="Answer"><dir name="Grid"><file name="Export.php" hash="98bed6330628da0056b9281cd0044ab1"/></dir><file name="Grid.php" hash="bda00ac3e4e1d85327eac227949e7bb5"/></dir><file name="Answer.php" hash="2c1b7c5dfdd1485b6c3cd8eb2c134bcd"/><file name="Mynanorep.php" hash="a7aea34f919bc75ca9a2d374a115b3fa"/><dir name="Order"><dir name="Grid"><file name="Export.php" hash="13bc156b3331c9b2dacde70e8483a909"/></dir><file name="Grid.php" hash="a78d4a0d35b0f1575763af33bb7c03e4"/></dir><file name="Order.php" hash="39ebfd2fe23db490046ae8e324901b72"/><dir name="System"><dir name="Config"><dir name="Form"><file name="Fields.php" hash="76cdde1a24c8348189384b278aa7480a"/></dir></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Answer"><dir name="Body"><file name="Pretty.php" hash="0a7d01f7ff96b9bace44256e82ab047e"/></dir><file name="Body.php" hash="89f497faa6a03cac040834804439a8d2"/><dir name="Title"><file name="Pretty.php" hash="b47a584daaed1c1e55545877b097f75b"/></dir><file name="Title.php" hash="115ee0a85937406fa07e8d439f1e3dbb"/></dir><dir name="Questions"><file name="Pretty.php" hash="3ffd9f82f2c5c2696eed0f35f7109b9e"/></dir><file name="Questions.php" hash="1a979d2272acde87c1e907aa29816c6c"/><dir name="Results"><file name="Pretty.php" hash="f0c8ba45e792f4cfee6ce4a22a3898fa"/></dir><file name="Results.php" hash="d08aa0325398bc23b335df26ca48c53c"/></dir></dir></dir></dir></dir><file name="Contactus.php" hash="ffd26e05d47bf36603ae6ed236a51c5e"/><file name="Customerhistoryjson.php" hash="2e6a8dc4c0e5c49639ff088ac3910009"/><file name="Embed.php" hash="c228d0d8d1dce3a975147434ef8f38ea"/><file name="Events.php" hash="5f5f965d626c8b73c072db1fca506d4c"/><file name="Float.php" hash="e51c028ad72498a96dcd1b38ae2f18f7"/><file name="Forgotpassword.php" hash="8493dab6da5c3bfcc2fee3f38bf7f1ad"/><file name="Header.php" hash="88fbe58d72982d15434f4b0d1462942e"/><file name="Login.php" hash="8bde6fc8b241e277ff4ce8b4c85b246c"/><file name="Success.php" hash="9383181f50edf203c457872412de7a0c"/></dir><dir name="Helper"><file name="Data.php" hash="7943a0d04ad961a97e0e177a2c0b44ac"/></dir><dir name="Model"><file name="Answer.php" hash="3931d7299a746e0ac90a6cae4a154982"/><file name="History.php" hash="0ffa4f8d5366abc1f7702e101cc5a90f"/><file name="Observer.php" hash="93b8b6b08dec94f56c4b122687df7f14"/><file name="Query.php" hash="c4eaf10c4bae492d782b552550570215"/><file name="Request.php" hash="aa581b40cd716654a1f71cc0fe202fcc"/><dir name="Resource"><dir name="Answer"><file name="Collection.php" hash="febae104bf1dd741119b8cf6f168b21d"/></dir><file name="Answer.php" hash="0f79604579c93d4315b62cc23d595a53"/><dir name="Query"><file name="Collection.php" hash="ab7cd2f853a4f21d216ee24748a9b1c8"/></dir><file name="Query.php" hash="ccc5ae9e2e2f144c37fef2245033911c"/><file name="Setup.php" hash="812ef9ae3c38fe84eda2c702890faac5"/></dir><file name="Session.php" hash="63b7e34c1782e8e376936e7f196b0353"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="ConversionTracking.php" hash="fd8154dd85c21be1f8e4270f21e42358"/></dir><dir name="Source"><file name="Attribute.php" hash="03529194354c0557a881305a69158fa5"/><file name="FloatWidgetActivePages.php" hash="e1f7f28f4e3e13ba13e4293eed61a943"/><file name="OrdersStatusActivePages.php" hash="f098536503386289102acfcc19d016a6"/><file name="ProductIdAttribute.php" hash="03c69b051e8ba54e47f87b6f1495c19e"/></dir></dir></dir></dir><dir name="controllers"><file name="AccountController.php" hash="77275920ac024972dc8686a7ecd30d06"/><dir name="Adminhtml"><file name="AnswerController.php" hash="c78297d83f113e8e01cc6b39158bdc66"/><file name="MynanorepController.php" hash="b411ddc154ef98ca3f568daab73fd003"/><file name="OrderController.php" hash="b5484dde49a2ebbcc8b0933bcad4c0bb"/></dir><file name="IndexController.php" hash="a88b39a8ee27925df32be3c57f95cbf6"/><file name="OrderController.php" hash="45be95b16ff3bbf928c0e8234a4a3fb2"/><file name="QueryController.php" hash="58145cd9ff89c0bc7ff078c0d11b4d83"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6b796ffd37d982a516efac2d8870c4dc"/><file name="config.xml" hash="7197f62dae32a0dba18fb4b30e6b6569"/><file name="system.xml" hash="71e4c16ef29b47b7ce53963fbf52f41b"/></dir><dir name="sql"><dir name="nanorepwidgets_setup"><file name="install-2.0.0.php" hash="df808cb581bb4e2cf8a03687c2969d1b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NanoRep_Widgets.xml" hash="4fbaad20e02fa3ed2147ba15864c3cab"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="nanorepwidgets.xml" hash="5f391879e7c7bd0c5c81e649f9b5442a"/></dir><dir name="template"><dir name="nanorepwidgets"><file name="cdc.phtml" hash="587dab4d48df5773746b7ddff0a0165b"/><file name="contact_us.phtml" hash="6c05072487ec1d4766f2671fc5eb977a"/><file name="embed.phtml" hash="690b5ab9ed1d024a27220732a28652f5"/><file name="empty_page.phtml" hash="bc909c2029bf6035c74b4c2c8c8c4873"/><file name="events.phtml" hash="32c2e2b9f798104fb47db6a1a104783c"/><file name="float.phtml" hash="3a082b0822f143b8e8f7dc1da4137d1c"/><file name="forgotpassword.phtml" hash="8bcc9f68d8a7559930284d60d6a1b461"/><file name="header.phtml" hash="aee72cc5a4e551326c5c8c5931234f0f"/><file name="login.phtml" hash="47d8d9ba7a473f879e46523258ed8576"/><dir name="order"><file name="list.phtml" hash="83009ccc06d76eacea13c96caaf77c44"/></dir><file name="success.phtml" hash="9db1192b7c1190c07b983431f400d6b2"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="layout"><file name="nanorepwidgets.xml" hash="5f391879e7c7bd0c5c81e649f9b5442a"/></dir><dir name="template"><dir name="nanorepwidgets"><file name="cdc.phtml" hash="587dab4d48df5773746b7ddff0a0165b"/><file name="contact_us.phtml" hash="6c05072487ec1d4766f2671fc5eb977a"/><file name="embed.phtml" hash="690b5ab9ed1d024a27220732a28652f5"/><file name="empty_page.phtml" hash="bc909c2029bf6035c74b4c2c8c8c4873"/><file name="events.phtml" hash="32c2e2b9f798104fb47db6a1a104783c"/><file name="float.phtml" hash="3a082b0822f143b8e8f7dc1da4137d1c"/><file name="forgotpassword.phtml" hash="8bcc9f68d8a7559930284d60d6a1b461"/><file name="header.phtml" hash="aee72cc5a4e551326c5c8c5931234f0f"/><file name="login.phtml" hash="47d8d9ba7a473f879e46523258ed8576"/><dir name="order"><file name="list.phtml" hash="83009ccc06d76eacea13c96caaf77c44"/></dir><file name="success.phtml" hash="9db1192b7c1190c07b983431f400d6b2"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir><dir name="default"><dir name="default"><dir name="template"><dir name="nanorepwidgets"><file name="mynanorep.phtml" hash="ecdbcbdfbe5c4e4ed18aaf74492b5adb"/><dir name="system"><dir name="config"><dir name="form"><file name="fields.phtml" hash="8ee604593b10281c6bc73aca463d5529"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="nanorepwidgets.xml" hash="341cf527d4c3eb6c452f5398d2ed7588"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="nanorepwidgets"><file name="contactus.css" hash="c019e42775bad8285f0001ba5f16398f"/><file name="head.css" hash="1779a092e2c2a771a0725e1cdd682a46"/><file name="head.js" hash="8bafa94d8432b42e2e6e7f6af91db39e"/><dir name="images"><file name="mp_sprites.gif" hash="3f1cf238d90dd2bf737f98d04bdcde69"/></dir><file name="jsonp.js" hash="c324f25e1c9f4a434db78ee2e669553b"/></dir></dir></dir></dir></target></contents>
53
  <compatible/>
54
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
55
  </package>
skin/frontend/default/default/nanorepwidgets/contactus.css ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .answers-popup {
2
+ background: #FFFFFF;
3
+ border: 5px solid #cccccc;
4
+ margin: 12px 0 0;
5
+ position: absolute;
6
+ text-align: left;
7
+ width: 450px;
8
+ z-index: 100;
9
+ }
10
+ @media only screen and (min-width: 771px) {
11
+ .answers-popup.answers-popup-right {
12
+ left: 10px !important;
13
+ }
14
+ .answers-popup.answers-popup-left {
15
+ left: auto !important;
16
+ right: 10px !important;
17
+ }
18
+ }
19
+ @media only screen and (max-width: 770px) {
20
+ .answers-popup {
21
+ width: 100%;
22
+ left: 0px !important;
23
+ }
24
+ }
25
+ .answers-popup .answers-popup-heading {
26
+ padding: 8px 10px;
27
+ margin-right: 40px;
28
+ width: auto;
29
+ }
30
+ .answers-popup .answers-popup-heading h3 {
31
+ font-size: 14px;
32
+ margin: 0;
33
+ overflow: hidden;
34
+ white-space: nowrap;
35
+ word-wrap: break-word;
36
+ text-align: left;
37
+ text-overflow: ellipsis;
38
+ }
39
+ @media only screen and (max-width: 479px) {
40
+ .answers-popup .answers-popup-heading h3 {
41
+ text-align: center;
42
+ }
43
+ }
44
+ .answers-popup .answers-popup-close {
45
+ display: block;
46
+ position: absolute;
47
+ top: 0px;
48
+ right: 0px;
49
+ height: 36px;
50
+ width: 36px;
51
+ font-size: 20px;
52
+ line-height: 32px;
53
+ text-align: center;
54
+ }
55
+ .answers-popup .answers-popup-content {
56
+ border-top: 1px solid #ededed;
57
+ padding: 10px;
58
+ margin: 0 10px;
59
+ overflow: hidden;
60
+ text-align: left;
61
+ }
62
+ @media only screen and (max-width: 479px) {
63
+ .answers-popup .answers-popup-content {
64
+ text-align: center;
65
+ }
66
+ }
67
+ .answers-popup .answers-popup-checkout {
68
+ padding: 10px 0;
69
+ }
70
+ .answers-popup .answers-popup-checkout form:after {
71
+ content: '';
72
+ display: table;
73
+ clear: both;
74
+ }
75
+ .answers-popup .answers-popup-checkout span {
76
+ display: block;
77
+ }
78
+ .answers-popup .answers-popup-checkout .button {
79
+ float: left;
80
+ margin: 0 2px;
81
+ clear: left;
82
+ }
83
+ .answers-popup .answers-popup-checkout .additional-addtocart-box {
84
+ float: left;
85
+ min-width: 210px;
86
+ }
87
+ .answers-popup .answers-popup-checkout .additional-addtocart-box li {
88
+ list-style-type: none;
89
+ }
90
+ .answers-popup .answers-popup-checkout .paypal-logo {
91
+ width: auto;
92
+ }
93
+ .answers-popup .answers-popup-checkout .paypal-logo a {
94
+ display: inline-block;
95
+ float: left;
96
+ clear: left;
97
+ }
98
+ .answers-popup .answers-popup-checkout .paypal-logo .paypal-or {
99
+ float: left;
100
+ text-align: center;
101
+ padding: 5px 15px;
102
+ clear: left;
103
+ }
104
+ .answers-popup .answers-popup-checkout .paypal-logo:after {
105
+ content: '';
106
+ display: table;
107
+ clear: both;
108
+ }
109
+ .answers-popup .answers-popup-checkout .paypal-logo .bml_button a {
110
+ clear: left;
111
+ }
112
+ @media only screen and (max-width: 479px) {
113
+ .answers-popup .answers-popup-checkout {
114
+ text-align: center;
115
+ }
116
+ .answers-popup .answers-popup-checkout .button,
117
+ .answers-popup .answers-popup-checkout .additional-addtocart-box,
118
+ .answers-popup .answers-popup-checkout .paypal-logo a,
119
+ .answers-popup .answers-popup-checkout .paypal-logo .paypal-or {
120
+ float: none;
121
+ }
122
+ .answers-popup .answers-popup-checkout .additional-addtocart-box {
123
+ min-width: 0px;
124
+ }
125
+ .answers-popup .answers-popup-checkout .paypal-logo .paypal-or {
126
+ margin: 0px;
127
+ margin-bottom: 10px;
128
+ }
129
+ }
130
+ .answers-popup .answers-popup-checkout:after {
131
+ content: '';
132
+ display: table;
133
+ clear: both;
134
+ }
135
+ .answers-popup .answers-popup-price {
136
+ padding: 10px 0;
137
+ }
138
+ .answers-popup .answers-popup-price .price-box,
139
+ .answers-popup .answers-popup-price .price-box .special-price {
140
+ display: inline-block;
141
+ margin: 0;
142
+ padding: 0;
143
+ }
144
+ @media only screen and (max-width: 479px) {
145
+ .answers-popup .answers-popup-price {
146
+ text-align: center;
147
+ padding-top: 0px;
148
+ }
149
+ }
150
+ .answers-popup .answers-popup-text {
151
+ padding: 10px 0;
152
+ margin: 0 10px;
153
+ word-wrap: break-word;
154
+ }
155
+ .answers-popup .answers-popup-text,
156
+ .answers-popup .answers-popup-only-text {
157
+ font-size: 12px;
158
+ /*
159
+ border-top: 1px solid #ededed;
160
+ */
161
+ }
162
+
163
+ .answers-popup .answers-popup-text h1 {
164
+ display: block;
165
+ font-size: 1em;
166
+ -webkit-margin-before: 0.67em;
167
+ -webkit-margin-after: 0.67em;
168
+ -webkit-margin-start: 0px;
169
+ -webkit-margin-end: 0px;
170
+ font-weight: bold;
171
+ }
172
+
173
+ .nanorepItem { font-size:12px; }
174
+ .nanorepItem:last-child { margin-bottom:0;}
175
+ .nanorepItem .nanorepItemTitle { font-weight:normal; font-size:14px; padding:0px 0px 5px 13px; color:#007DBF; cursor:pointer; background:url(./images/mp_sprites.gif) no-repeat 0px 5px;}
176
+ .nanorepItem .nanorepItemTitle:hover { color:#05A9FF;}
177
+ .nanorepItem.isOpen .nanorepItemTitle { color:#05A9FF; background-position:0px -300px;}
178
+ .nanorepItem .nanorepItemDescription { display:none; line-height:120%; padding:0px 0px 8px 13px;}
179
+ .nanorepItem.isOpen .nanorepItemDescription { display:block;}
180
+ .nanorepItem .nanorepItemDescription p{ padding-bottom:5px; margin:0;}
181
+ .nanorepItem .nanorepItemDescription a { color:#007DBF;}
182
+ .nanorepItem .nanorepItemDescription a:hover { color:#05A9FF;}
183
+ .nanorepItem .nanorepItemDescription iframe { border:solid 1px #6F675E;}
skin/frontend/default/default/nanorepwidgets/images/mp_sprites.gif ADDED
Binary file
skin/frontend/default/default/nanorepwidgets/jsonp.js ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* JSON-P implementation for Prototype.js somewhat by Dan Dean (http://www.dandean.com)
2
+ *
3
+ * *HEAVILY* based on Tobie Langel's version: http://gist.github.com/145466.
4
+ * Might as well just call this an iteration.
5
+ *
6
+ * This version introduces:
7
+ * - Support for predefined callbacks (Necessary for OAuth signed requests, by @rboyce)
8
+ * - Partial integration with Ajax.Responders (Thanks to @sr3d for the kick in this direction)
9
+ * - Compatibility with Prototype 1.7 (Thanks to @soung3 for the bug report)
10
+ * - Will not break if page lacks a <head> element
11
+ *
12
+ * See examples in README for usage
13
+ *
14
+ * VERSION 1.1.2
15
+ *
16
+ * new Ajax.JSONRequest(url, options);
17
+ * - url (String): JSON-P endpoint url.
18
+ * - options (Object): Configuration options for the request.
19
+ */
20
+ Ajax.JSONRequest = Class.create(Ajax.Base, (function() {
21
+ var id = 0, head = document.getElementsByTagName('head')[0] || document.body;
22
+ return {
23
+ initialize: function($super, url, options) {
24
+ $super(options);
25
+ this.options.url = url;
26
+ this.options.callbackParamName = this.options.callbackParamName || 'callback';
27
+ this.options.timeout = this.options.timeout || 10; // Default timeout: 10 seconds
28
+ this.options.invokeImmediately = (!Object.isUndefined(this.options.invokeImmediately)) ? this.options.invokeImmediately : true ;
29
+
30
+ if (!Object.isUndefined(this.options.parameters) && Object.isString(this.options.parameters)) {
31
+ this.options.parameters = this.options.parameters.toQueryParams();
32
+ }
33
+
34
+ if (this.options.invokeImmediately) {
35
+ this.request();
36
+ }
37
+ },
38
+
39
+ /**
40
+ * Ajax.JSONRequest#_cleanup() -> undefined
41
+ * Cleans up after the request
42
+ **/
43
+ _cleanup: function() {
44
+ if (this.timeout) {
45
+ clearTimeout(this.timeout);
46
+ this.timeout = null;
47
+ }
48
+ if (this.transport && Object.isElement(this.transport)) {
49
+ this.transport.remove();
50
+ this.transport = null;
51
+ }
52
+ },
53
+
54
+ /**
55
+ * Ajax.JSONRequest#request() -> undefined
56
+ * Invokes the JSON-P request lifecycle
57
+ **/
58
+ request: function() {
59
+
60
+ // Define local vars
61
+ var response = new Ajax.JSONResponse(this);
62
+ var key = this.options.callbackParamName,
63
+ name = '_prototypeJSONPCallback_' + (id++),
64
+ complete = function() {
65
+ if (Object.isFunction(this.options.onComplete)) {
66
+ this.options.onComplete.call(this, response);
67
+ }
68
+ Ajax.Responders.dispatch('onComplete', this, response);
69
+ }.bind(this);
70
+
71
+ // If the callback parameter is already defined, use that
72
+ if (this.options.parameters[key] !== undefined) {
73
+ name = this.options.parameters[key];
74
+ }
75
+ // Otherwise, add callback as a parameter
76
+ else {
77
+ this.options.parameters[key] = name;
78
+ }
79
+
80
+ // Build request URL
81
+ this.options.parameters[key] = name;
82
+ var url = this.options.url + ((this.options.url.include('?') ? '&' : '?') + Object.toQueryString(this.options.parameters));
83
+
84
+ // Define callback function
85
+ window[name] = function(json) {
86
+ this._cleanup(); // Garbage collection
87
+ window[name] = undefined;
88
+
89
+ response.status = 200;
90
+ response.statusText = "OK";
91
+ response.setResponseContent(json);
92
+
93
+ if (Object.isFunction(this.options.onSuccess)) {
94
+ this.options.onSuccess.call(this, response);
95
+ }
96
+ Ajax.Responders.dispatch('onSuccess', this, response);
97
+
98
+ complete();
99
+
100
+ }.bind(this);
101
+
102
+ this.transport = new Element('script', { type: 'text/javascript', src: url });
103
+
104
+ if (Object.isFunction(this.options.onCreate)) {
105
+ this.options.onCreate.call(this, response);
106
+ }
107
+ Ajax.Responders.dispatch('onCreate', this);
108
+
109
+ head.appendChild(this.transport);
110
+
111
+ this.timeout = setTimeout(function() {
112
+ this._cleanup();
113
+ window[name] = Prototype.emptyFunction;
114
+ if (Object.isFunction(this.options.onFailure)) {
115
+ response.status = 504;
116
+ response.statusText = "Gateway Timeout";
117
+ this.options.onFailure.call(this, response);
118
+ }
119
+ complete();
120
+ }.bind(this), this.options.timeout * 1000);
121
+ },
122
+ toString: function() { return "[object Ajax.JSONRequest]"; }
123
+ };
124
+ })());
125
+
126
+ Ajax.JSONResponse = Class.create({
127
+ initialize: function(request) {
128
+ this.request = request;
129
+ },
130
+ request: undefined,
131
+ status: 0,
132
+ statusText: '',
133
+ responseJSON: undefined,
134
+ responseText: undefined,
135
+ setResponseContent: function(json) {
136
+ this.responseJSON = json;
137
+ this.responseText = Object.toJSON(json);
138
+ },
139
+ getTransport: function() {
140
+ if (this.request) return this.request.transport;
141
+ },
142
+ toString: function() { return "[object Ajax.JSONResponse]"; }
143
+ });