HZ_Reminder - Version 0.1.0

Version Notes

Reminder Extension

Download this release

Release Info

Developer Mohammad Harun-Or-Rashid
Extension HZ_Reminder
Version 0.1.0
Comparing to
See all releases


Version 0.1.0

Files changed (55) hide show
  1. app/code/community/HZ/Reminder/Block/Adminhtml/Mail.php +12 -0
  2. app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit.php +22 -0
  3. app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit/Form.php +19 -0
  4. app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit/Tab/Form.php +43 -0
  5. app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit/Tabs.php +23 -0
  6. app/code/community/HZ/Reminder/Block/Adminhtml/Reminder.php +14 -0
  7. app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit.php +46 -0
  8. app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit/Form.php +19 -0
  9. app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit/Tab/Form.php +87 -0
  10. app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit/Tabs.php +23 -0
  11. app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Grid.php +119 -0
  12. app/code/community/HZ/Reminder/Block/Adminhtml/Report.php +13 -0
  13. app/code/community/HZ/Reminder/Block/Adminhtml/Report/Grid.php +77 -0
  14. app/code/community/HZ/Reminder/Block/Reminder.php +16 -0
  15. app/code/community/HZ/Reminder/Helper/Data.php +5 -0
  16. app/code/community/HZ/Reminder/Model/Mysql4/Reminder.php +10 -0
  17. app/code/community/HZ/Reminder/Model/Mysql4/Reminder/Collection.php +9 -0
  18. app/code/community/HZ/Reminder/Model/Mysql4/Report.php +10 -0
  19. app/code/community/HZ/Reminder/Model/Mysql4/Report/Collection.php +9 -0
  20. app/code/community/HZ/Reminder/Model/Observer.php +113 -0
  21. app/code/community/HZ/Reminder/Model/Reminder.php +29 -0
  22. app/code/community/HZ/Reminder/Model/Report.php +10 -0
  23. app/code/community/HZ/Reminder/Model/Status.php +15 -0
  24. app/code/community/HZ/Reminder/Model/Wysiwyg/Config.php +34 -0
  25. app/code/community/HZ/Reminder/controllers/Adminhtml/MailController.php +153 -0
  26. app/code/community/HZ/Reminder/controllers/Adminhtml/ReminderController.php +211 -0
  27. app/code/community/HZ/Reminder/controllers/Adminhtml/ReportController.php +21 -0
  28. app/code/community/HZ/Reminder/controllers/IndexController.php +183 -0
  29. app/code/community/HZ/Reminder/etc/adminhtml.xml +52 -0
  30. app/code/community/HZ/Reminder/etc/config.xml +145 -0
  31. app/code/community/HZ/Reminder/etc/system.xml +77 -0
  32. app/code/community/HZ/Reminder/sql/reminder_setup/mysql4-install-0.1.0.php +40 -0
  33. app/design/adminhtml/default/default/layout/reminder.xml +18 -0
  34. app/design/frontend/base/default/layout/reminder.xml +44 -0
  35. app/design/frontend/base/default/template/reminder/ajax.phtml +122 -0
  36. app/design/frontend/base/default/template/reminder/reminder.phtml +90 -0
  37. app/etc/modules/HZ_Reminder.xml +9 -0
  38. app/locale/en_US/template/email/reminder/subscriber_reminder.html +9 -0
  39. package.xml +18 -0
  40. skin/frontend/base/default/css/reminder/jquery.fancybox.css +274 -0
  41. skin/frontend/base/default/images/reminder/blank.gif +0 -0
  42. skin/frontend/base/default/images/reminder/fancybox_loading.gif +0 -0
  43. skin/frontend/base/default/images/reminder/fancybox_loading@2x.gif +0 -0
  44. skin/frontend/base/default/images/reminder/fancybox_overlay.png +0 -0
  45. skin/frontend/base/default/images/reminder/fancybox_sprite.png +0 -0
  46. skin/frontend/base/default/images/reminder/fancybox_sprite@2x.png +0 -0
  47. skin/frontend/base/default/js/reminder/helpers/fancybox_buttons.png +0 -0
  48. skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-buttons.css +97 -0
  49. skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-buttons.js +122 -0
  50. skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-media.js +199 -0
  51. skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-thumbs.css +55 -0
  52. skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-thumbs.js +162 -0
  53. skin/frontend/base/default/js/reminder/jquery.fancybox.js +2020 -0
  54. skin/frontend/base/default/js/reminder/jquery.fancybox.pack.js +46 -0
  55. skin/frontend/base/default/js/reminder/reminder.js +22 -0
app/code/community/HZ/Reminder/Block/Adminhtml/Mail.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Block_Adminhtml_Mail extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_mail';
7
+ $this->_blockGroup = 'reminder';
8
+ $this->_headerText = Mage::helper('reminder')->__('Reminder Mail Form');
9
+ $this->_addButtonLabel = Mage::helper('reminder')->__('Add New Reminder');
10
+ parent::__construct();
11
+ }
12
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Mail_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'reminder';
11
+ $this->_controller = 'adminhtml_mail';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Send mail'));
14
+ $this->_removeButton('delete');
15
+ $this->_removeButton('back');
16
+ }
17
+
18
+ public function getHeaderText()
19
+ {
20
+ return Mage::helper('reminder')->__('Send Reminder Mail');
21
+ }
22
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Mail_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/sendMail', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit/Tab/Form.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Mail_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ protected function _prepareForm()
7
+ {
8
+ $form = new Varien_Data_Form();
9
+ $this->setForm($form);
10
+ $fieldset = $form->addFieldset('mail_form', array('legend'=>Mage::helper('reminder')->__('Reminder Mail Form')));
11
+
12
+ $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
13
+
14
+ $fieldset->addField('reminder_date_start', 'date', array(
15
+ 'name' => 'reminder_date_start',
16
+ 'label' => Mage::helper('reminder')->__('Reminder Data Start'),
17
+ 'title' => Mage::helper('reminder')->__('Reminder Data Start'),
18
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
19
+ 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT,
20
+ 'format' => $dateFormatIso,
21
+ 'required' => true
22
+ ));
23
+
24
+ $fieldset->addField('reminder_date_end', 'date', array(
25
+ 'name' => 'reminder_date_end',
26
+ 'label' => Mage::helper('reminder')->__('Reminder Data End'),
27
+ 'title' => Mage::helper('reminder')->__('Reminder Data End'),
28
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
29
+ 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT,
30
+ 'format' => $dateFormatIso,
31
+ 'required' => true
32
+ ));
33
+
34
+ if ( Mage::getSingleton('adminhtml/session')->getReminderData() )
35
+ {
36
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getReminderData());
37
+ Mage::getSingleton('adminhtml/session')->setReminderData(null);
38
+ } elseif ( Mage::registry('reminder_data') ) {
39
+ $form->setValues(Mage::registry('reminder_data')->getData());
40
+ }
41
+ return parent::_prepareForm();
42
+ }
43
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Mail/Edit/Tabs.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Mail_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('reminder_mail_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('reminder')->__('Reminder Mail Form'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('reminder')->__('Reminder Mail Form'),
18
+ 'title' => Mage::helper('reminder')->__('Reminder Mail Form'),
19
+ 'content' => $this->getLayout()->createBlock('reminder/adminhtml_mail_edit_tab_form')->toHtml(),
20
+ ));
21
+ return parent::_beforeToHtml();
22
+ }
23
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Reminder.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Block_Adminhtml_Reminder extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_reminder';
7
+ $this->_blockGroup = 'reminder';
8
+ $this->_headerText = Mage::helper('reminder')->__('Reminder Subscribers');
9
+ $this->_addButtonLabel = Mage::helper('reminder')->__('Add New Reminder');
10
+ parent::__construct();
11
+
12
+ $this->_removeButton('add');
13
+ }
14
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Reminder_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+
9
+ $this->_objectId = 'id';
10
+ $this->_blockGroup = 'reminder';
11
+ $this->_controller = 'adminhtml_reminder';
12
+
13
+ $this->_updateButton('save', 'label', Mage::helper('reminder')->__('Save Reminder'));
14
+ $this->_updateButton('delete', 'label', Mage::helper('reminder')->__('Delete Reminder'));
15
+
16
+ $this->_addButton('saveandcontinue', array(
17
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
+ 'onclick' => 'saveAndContinueEdit()',
19
+ 'class' => 'save',
20
+ ), -100);
21
+
22
+ $this->_formScripts[] = "
23
+ function toggleEditor() {
24
+ if (tinyMCE.getInstanceById('reminder_content') == null) {
25
+ tinyMCE.execCommand('mceAddControl', false, 'reminder_content');
26
+ } else {
27
+ tinyMCE.execCommand('mceRemoveControl', false, 'reminder_content');
28
+ }
29
+ }
30
+
31
+ function saveAndContinueEdit(){
32
+ editForm.submit($('edit_form').action+'back/edit/');
33
+ }
34
+ ";
35
+ }
36
+
37
+ public function getHeaderText()
38
+ {
39
+ if( Mage::registry('reminder_data') && Mage::registry('reminder_data')->getId() ) {
40
+ return Mage::helper('reminder')->__("Edit Reminder '%s'", $this->htmlEscape(Mage::registry('reminder_data')->getTitle()));
41
+ }
42
+ else {
43
+ return Mage::helper('reminder')->__('Add Reminder');
44
+ }
45
+ }
46
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit/Form.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Reminder_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'edit_form',
9
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
+ 'method' => 'post',
11
+ 'enctype' => 'multipart/form-data'
12
+ )
13
+ );
14
+
15
+ $form->setUseContainer(true);
16
+ $this->setForm($form);
17
+ return parent::_prepareForm();
18
+ }
19
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit/Tab/Form.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Reminder_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+
6
+ protected function _prepareForm()
7
+ {
8
+ $form = new Varien_Data_Form();
9
+ $this->setForm($form);
10
+ $fieldset = $form->addFieldset('reminder_form', array('legend'=>Mage::helper('reminder')->__('Reminder information')));
11
+
12
+ $fieldset->addField('title', 'text', array(
13
+ 'label' => Mage::helper('reminder')->__('Name'),
14
+ 'class' => 'required-entry',
15
+ 'required' => true,
16
+ 'name' => 'title',
17
+ ));
18
+
19
+ $fieldset->addField('email', 'text', array(
20
+ 'label' => Mage::helper('reminder')->__('Email'),
21
+ 'class' => 'required-entry',
22
+ 'required' => true,
23
+ 'name' => 'email',
24
+ ));
25
+
26
+ $fieldset->addField('product', 'text', array(
27
+ 'label' => Mage::helper('reminder')->__('Product'),
28
+ 'class' => 'required-entry',
29
+ 'required' => true,
30
+ 'name' => 'product',
31
+ ));
32
+
33
+ $fieldset->addField('product_url', 'text', array(
34
+ 'label' => Mage::helper('reminder')->__('Product URL'),
35
+ 'required' => false,
36
+ 'name' => 'product_url',
37
+ ));
38
+
39
+
40
+ $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
41
+
42
+ $fieldset->addField('register_date', 'date', array(
43
+ 'name' => 'register_date',
44
+ 'label' => Mage::helper('reminder')->__('Register Data'),
45
+ 'title' => Mage::helper('reminder')->__('Register Data'),
46
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
47
+ 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT,
48
+ 'format' => $dateFormatIso,
49
+ 'required' => true
50
+ ));
51
+
52
+ $fieldset->addField('reminder_date', 'date', array(
53
+ 'name' => 'reminder_date',
54
+ 'label' => Mage::helper('reminder')->__('Reminder Data'),
55
+ 'title' => Mage::helper('reminder')->__('Reminder Data'),
56
+ 'image' => $this->getSkinUrl('images/grid-cal.gif'),
57
+ 'input_format' => Varien_Date::DATE_INTERNAL_FORMAT,
58
+ 'format' => $dateFormatIso,
59
+ 'required' => true
60
+ ));
61
+
62
+ $fieldset->addField('status', 'select', array(
63
+ 'label' => Mage::helper('reminder')->__('Status'),
64
+ 'name' => 'status',
65
+ 'values' => array(
66
+ array(
67
+ 'value' => 1,
68
+ 'label' => Mage::helper('reminder')->__('Subscribed'),
69
+ ),
70
+
71
+ array(
72
+ 'value' => 2,
73
+ 'label' => Mage::helper('reminder')->__('Unsubscribed'),
74
+ ),
75
+ ),
76
+ ));
77
+
78
+ if ( Mage::getSingleton('adminhtml/session')->getReminderData() )
79
+ {
80
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getReminderData());
81
+ Mage::getSingleton('adminhtml/session')->setReminderData(null);
82
+ } elseif ( Mage::registry('reminder_data') ) {
83
+ $form->setValues(Mage::registry('reminder_data')->getData());
84
+ }
85
+ return parent::_prepareForm();
86
+ }
87
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Edit/Tabs.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Reminder_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ parent::__construct();
9
+ $this->setId('reminder_tabs');
10
+ $this->setDestElementId('edit_form');
11
+ $this->setTitle(Mage::helper('reminder')->__('Reminder Information'));
12
+ }
13
+
14
+ protected function _beforeToHtml()
15
+ {
16
+ $this->addTab('form_section', array(
17
+ 'label' => Mage::helper('reminder')->__('Reminder Information'),
18
+ 'title' => Mage::helper('reminder')->__('Reminder Information'),
19
+ 'content' => $this->getLayout()->createBlock('reminder/adminhtml_reminder_edit_tab_form')->toHtml(),
20
+ ));
21
+ return parent::_beforeToHtml();
22
+ }
23
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Reminder/Grid.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Reminder_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('reminderGrid');
9
+ $this->setUseAjax(true);
10
+ $this->setDefaultSort('id');
11
+ $this->setDefaultDir('ASC');
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel('reminder/reminder')->getCollection();
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+
22
+ protected function _prepareColumns()
23
+ {
24
+ $this->addColumn('id', array(
25
+ 'header' => Mage::helper('reminder')->__('ID'),
26
+ 'align' =>'right',
27
+ 'width' => '50px',
28
+ 'index' => 'id',
29
+ ));
30
+
31
+ $this->addColumn('title', array(
32
+ 'header' => Mage::helper('reminder')->__('Name'),
33
+ 'align' =>'left',
34
+ 'index' => 'title',
35
+ ));
36
+
37
+ $this->addColumn('email', array(
38
+ 'header' => Mage::helper('reminder')->__('Email'),
39
+ 'align' =>'left',
40
+ 'index' => 'email',
41
+ ));
42
+
43
+ $this->addColumn('product_name', array(
44
+ 'header' => Mage::helper('reminder')->__('Product Name'),
45
+ 'align' =>'left',
46
+ 'index' => 'product_name',
47
+ ));
48
+
49
+ $this->addColumn('reminder_date', array(
50
+ 'header' => Mage::helper('reminder')->__('Reminder Data'),
51
+ 'align' =>'left',
52
+ 'index' => 'reminder_date',
53
+ 'format' => 'd-M-Y',
54
+ 'gmtoffset' => false,
55
+ 'type'=>'date'
56
+ ));
57
+
58
+ $this->addColumn('register_date',
59
+ array(
60
+ 'header'=>Mage::helper('reminder')->__('Register Data'),
61
+ 'index'=>'register_date',
62
+ 'format' => 'd-M-Y',
63
+ 'gmtoffset' => false,
64
+ 'type'=>'date'
65
+ ));
66
+
67
+ $this->addColumn('ip', array(
68
+ 'header' => Mage::helper('reminder')->__('IP'),
69
+ 'align' =>'left',
70
+ 'width' => '100px',
71
+ 'index' => 'ip',
72
+ ));
73
+
74
+ $this->addColumn('status', array(
75
+ 'header' => Mage::helper('reminder')->__('Status'),
76
+ 'align' => 'left',
77
+ 'width' => '80px',
78
+ 'index' => 'status',
79
+ 'type' => 'options',
80
+ 'options' => array(
81
+ 1 => 'Subscribed',
82
+ 2 => 'Unsubscribed',
83
+ ),
84
+ ));
85
+
86
+ return parent::_prepareColumns();
87
+ }
88
+
89
+ protected function _prepareMassaction()
90
+ {
91
+ $this->setMassactionIdField('id');
92
+ $this->getMassactionBlock()->setFormFieldName('reminder');
93
+
94
+ $this->getMassactionBlock()->addItem('delete', array(
95
+ 'label' => Mage::helper('reminder')->__('Delete'),
96
+ 'url' => $this->getUrl('*/*/massDelete'),
97
+ 'confirm' => Mage::helper('reminder')->__('Are you sure?')
98
+ ));
99
+
100
+ $statuses = Mage::getSingleton('reminder/status')->getOptionArray();
101
+
102
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
103
+ $this->getMassactionBlock()->addItem('status', array(
104
+ 'label'=> Mage::helper('reminder')->__('Change status'),
105
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
106
+ 'additional' => array(
107
+ 'visibility' => array(
108
+ 'name' => 'status',
109
+ 'type' => 'select',
110
+ 'class' => 'required-entry',
111
+ 'label' => Mage::helper('reminder')->__('Status'),
112
+ 'values' => $statuses
113
+ )
114
+ )
115
+ ));
116
+ return $this;
117
+ }
118
+
119
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Report.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Block_Adminhtml_Report extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_report';
7
+ $this->_blockGroup = 'reminder';
8
+ $this->_headerText = Mage::helper('reminder')->__('Reminder Report');
9
+ parent::__construct();
10
+
11
+ $this->_removeButton('add');
12
+ }
13
+ }
app/code/community/HZ/Reminder/Block/Adminhtml/Report/Grid.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Block_Adminhtml_Report_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('reminderReportGrid');
9
+ $this->setUseAjax(true);
10
+ $this->setDefaultSort('id');
11
+ $this->setDefaultDir('ASC');
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getModel('reminder/report')->getCollection();
18
+ $collection->getSelect()->group(array("report_date"));
19
+
20
+ $this->setCollection($collection);
21
+ return parent::_prepareCollection();
22
+ }
23
+
24
+ protected function _prepareColumns()
25
+ {
26
+
27
+ $this->addColumn('report_date',
28
+ array(
29
+ 'header'=>Mage::helper('reminder')->__('Data'),
30
+ 'index'=>'report_date',
31
+ 'gmtoffset' => false,
32
+ 'type'=>'date',
33
+ 'format' => 'd-M-Y',
34
+ ));
35
+
36
+ $this->addColumn('total_send_mail', array(
37
+ 'filter' => false,
38
+ 'sortable' => false,
39
+ 'header' => Mage::helper('reminder')->__('# Send Mail'),
40
+ 'align' =>'center',
41
+ 'width' => '100px',
42
+ 'frame_callback' => array($this, 'callback_total_send_mail')
43
+ ));
44
+
45
+ $this->addColumn('total_subscriber', array(
46
+ 'filter' => false,
47
+ 'sortable' => false,
48
+ 'header' => Mage::helper('reminder')->__('# Subscribers'),
49
+ 'align' =>'center',
50
+ 'width' => '100px',
51
+ 'frame_callback' => array($this, 'callback_total_subscriber')
52
+ ));
53
+
54
+ return parent::_prepareColumns();
55
+ }
56
+
57
+ public function callback_total_send_mail($value, $row, $column, $isExport)
58
+ {
59
+ $report_date = $row->getReportDate();
60
+ $collection = Mage::getModel('reminder/report')->getCollection();
61
+ $collection->getSelect()->where("report_date='".$report_date."'")->group(array("report_date"));
62
+
63
+ $send_total = $collection->getSize();
64
+ return $send_total;
65
+ }
66
+
67
+ public function callback_total_subscriber($value, $row, $column, $isExport)
68
+ {
69
+ $report_date = $row->getReportDate();
70
+ $collection = Mage::getModel('reminder/reminder')->getCollection();
71
+ $collection->getSelect()->where("reminder_date='".$report_date."'")->group(array("reminder_date"));
72
+
73
+ $send_total = $collection->getSize();
74
+ return $send_total;
75
+ }
76
+
77
+ }
app/code/community/HZ/Reminder/Block/Reminder.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Block_Reminder extends Mage_Core_Block_Template
3
+ {
4
+ public function getReminder()
5
+ {
6
+ if (!$this->hasData('reminder')) {
7
+ $this->setData('reminder', Mage::registry('reminder'));
8
+ }
9
+ return $this->getData('reminder');
10
+ }
11
+
12
+ public function getFormAction()
13
+ {
14
+ return $this->getUrl('*/*/post');
15
+ }
16
+ }
app/code/community/HZ/Reminder/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/HZ/Reminder/Model/Mysql4/Reminder.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Mysql4_Reminder extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the reminder_id refers to the key field in your database table.
8
+ $this->_init('reminder/reminder', 'id');
9
+ }
10
+ }
app/code/community/HZ/Reminder/Model/Mysql4/Reminder/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Mysql4_Reminder_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('reminder/reminder');
8
+ }
9
+ }
app/code/community/HZ/Reminder/Model/Mysql4/Report.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Mysql4_Report extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the reminder_id refers to the key field in your database table.
8
+ $this->_init('reminder/report', 'id');
9
+ }
10
+ }
app/code/community/HZ/Reminder/Model/Mysql4/Report/Collection.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Mysql4_Report_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('reminder/report');
8
+ }
9
+ }
app/code/community/HZ/Reminder/Model/Observer.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Model_Observer
3
+ {
4
+ const XML_PATH_REMINDER_EMAIL_RECIPIENT = 'reminder/email/sender_name';
5
+ const XML_PATH_REMINDER_EMAIL_SENDER = 'reminder/email/sender_email';
6
+ const XML_PATH_REMINDER_EMAIL_SUBJECT = 'reminder/email/subject';
7
+ const XML_PATH_REMINDER_EMAIL_TEMPLATE = 'reminder/email/subscriber_template';
8
+ const XML_PATH_REMINDER_EMAIL_REMINDER_DATE = 'reminder/email/remainder_date';
9
+
10
+ public function scheduledSendEmailReminder(){
11
+
12
+ $translate = Mage::getSingleton('core/translate');
13
+ /* @var $translate Mage_Core_Model_Translate */
14
+ $translate->setTranslateInline(false);
15
+ try {
16
+ //START: Subscriber
17
+ $storeId = Mage::app()->getStore()->getId();
18
+ $report_date = date('Y-m-d');
19
+ $report_date_and_time = date('Y-m-d H:i:s');
20
+
21
+ $emailTemplate = Mage::getModel('core/email_template');
22
+
23
+ $emailTemplate->setDesignConfig(array(
24
+ 'area' => 'frontend',
25
+ 'store' => $storeId
26
+ ));
27
+
28
+ $sender = array(
29
+ 'name' => Mage::helper('core')->escapeHtml(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_RECIPIENT)),
30
+ 'email' => Mage::helper('core')->escapeHtml(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_SENDER))
31
+ );
32
+
33
+ $mailSubject = Mage::helper('core')->escapeHtml(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_SUBJECT));
34
+
35
+ //START: Subscriber
36
+ $collection = Mage::getModel('reminder/reminder')->getCollection();
37
+
38
+ //Filter Date Range
39
+ $reminderDate = trim(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_REMINDER_DATE));
40
+ $reminderDateArray = explode(",", $reminderDate);
41
+
42
+ $current_date = date('Y-m-d');
43
+ $where = array();
44
+ $where[] = "reminder_date='".$current_date."'";
45
+ foreach ($reminderDateArray as $date) {
46
+ $next_date = date('Y-m-d', strtotime($date . ' days', strtotime($current_date)));
47
+ $where[] = "reminder_date='".$next_date."'";
48
+ }
49
+
50
+ $whereCondition = implode(" OR ", $where);
51
+
52
+ $collection->getSelect()->where($whereCondition);
53
+
54
+ $collection->load();
55
+
56
+ foreach($collection->getItems() as $item) {
57
+ $subscriber_id = $item->getId();
58
+ $subscriber_name = $item->getTitle();
59
+ $subscriber_email = $item->getEmail();
60
+ $product_name = $item->getProductName();
61
+ $product_url = $item->getProductUrl();
62
+ $link = $item->getProductUrl();
63
+ $reminder_date = $item->getReminderDate();
64
+
65
+ $timestamp = strtotime($reminder_date);
66
+ $date = date("l, j F Y", $timestamp);
67
+
68
+ $emailTemplateVariables = array();
69
+ $emailTemplateVariables['subject'] = $mailSubject;
70
+ $emailTemplateVariables['subscriberName'] = $subscriber_name;
71
+ $emailTemplateVariables['productName'] = $product_name;
72
+ $emailTemplateVariables['reminderDate'] = $date;
73
+ $emailTemplateVariables['productURL'] = $product_url;
74
+
75
+ $emailTemplate->sendTransactional(
76
+ Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_TEMPLATE),
77
+ $sender,
78
+ $subscriber_email,
79
+ $subscriber_name,
80
+ $emailTemplateVariables
81
+ );
82
+
83
+ //START: Save Report
84
+ $model = Mage::getModel('reminder/report');
85
+ $model->setSubscriberId($subscriber_id);
86
+ $model->setTitle($subscriber_name);
87
+ $model->setEmail($subscriber_email);
88
+ $model->setRemindDate($reminder_date);
89
+ $model->setReportDate($report_date);
90
+ $model->setReportDateAndTime($report_date_and_time);
91
+ $model->setProcessRun('cron');
92
+ //END: Save Report
93
+
94
+ if ($emailTemplate->getSentSuccess()) {
95
+ $model->setSendEmailStatus('yes');
96
+ $model->save();
97
+ }
98
+ else{
99
+ $model->setSendEmailStatus('no');
100
+ $model->save();
101
+ }
102
+ }
103
+ //END: Subscriber
104
+
105
+ $translate->setTranslateInline(true);
106
+ }
107
+ catch (Exception $e) {
108
+ $translate->setTranslateInline(true);
109
+ }
110
+
111
+ }
112
+
113
+ }
app/code/community/HZ/Reminder/Model/Reminder.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Reminder extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('reminder/reminder');
9
+ }
10
+
11
+ public function getNewFileName($destFile)
12
+ {
13
+ $fileInfo = pathinfo($destFile);
14
+ if (file_exists($destFile)) {
15
+ $index = 1;
16
+ $baseName = $fileInfo['filename'] . '.' . $fileInfo['extension'];
17
+ while( file_exists($fileInfo['dirname'] . DIRECTORY_SEPARATOR . $baseName) ) {
18
+ $baseName = $fileInfo['filename']. '_' . $index . '.' . $fileInfo['extension'];
19
+ $index ++;
20
+ }
21
+ $destFileName = $baseName;
22
+ } else {
23
+ return $fileInfo['basename'];
24
+ }
25
+
26
+ return $destFileName;
27
+ }
28
+
29
+ }
app/code/community/HZ/Reminder/Model/Report.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Report extends Mage_Core_Model_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('reminder/report');
9
+ }
10
+ }
app/code/community/HZ/Reminder/Model/Status.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Model_Status extends Varien_Object
4
+ {
5
+ const STATUS_ENABLED = 1;
6
+ const STATUS_DISABLED = 2;
7
+
8
+ static public function getOptionArray()
9
+ {
10
+ return array(
11
+ self::STATUS_ENABLED => Mage::helper('reminder')->__('Subscribed'),
12
+ self::STATUS_DISABLED => Mage::helper('reminder')->__('Unsubscribed')
13
+ );
14
+ }
15
+ }
app/code/community/HZ/Reminder/Model/Wysiwyg/Config.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Model_Wysiwyg_Config extends Mage_Cms_Model_Wysiwyg_Config
3
+ {
4
+ public function getConfig($data = array())
5
+ {
6
+ $config = new Varien_Object();
7
+
8
+ $config->setData(array(
9
+ 'enabled' => $this->isEnabled(),
10
+ 'hidden' => $this->isHidden(),
11
+ 'use_container' => false,
12
+ 'add_variables' => false,
13
+ 'add_widgets' => false,
14
+ 'no_display' => false,
15
+ 'translator' => Mage::helper('cms'),
16
+ 'files_browser_window_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg_images/index'),
17
+ 'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'),
18
+ 'files_browser_window_height' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height'),
19
+ 'encode_directives' => true,
20
+ 'directives_url' => Mage::getSingleton('adminhtml/url')->getUrl('adminhtml/cms_wysiwyg/directive'),
21
+ 'popup_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css',
22
+ 'content_css' => Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css',
23
+ 'width' => '100%',
24
+ 'plugins' => array()
25
+ ));
26
+
27
+ $config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
28
+
29
+ if (is_array($data)) {
30
+ $config->addData($data);
31
+ }
32
+ return $config;
33
+ }
34
+ }
app/code/community/HZ/Reminder/controllers/Adminhtml/MailController.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_Adminhtml_MailController extends Mage_Adminhtml_Controller_action
3
+ {
4
+
5
+ const XML_PATH_REMINDER_EMAIL_RECIPIENT = 'reminder/email/sender_name';
6
+ const XML_PATH_REMINDER_EMAIL_SENDER = 'reminder/email/sender_email';
7
+ const XML_PATH_REMINDER_EMAIL_SUBJECT = 'reminder/email/subject';
8
+ const XML_PATH_REMINDER_EMAIL_TEMPLATE = 'reminder/email/subscriber_template';
9
+ const XML_PATH_REMINDER_EMAIL_REMINDER_DATE = 'reminder/email/remainder_date';
10
+
11
+ public function indexAction() {
12
+
13
+ $this->_title($this->__("Reminder"));
14
+ $this->_title($this->__("Reminder Mail Form"));
15
+
16
+ Mage::register('reminder_data', '');
17
+
18
+ $this->loadLayout();
19
+
20
+ $this->_setActiveMenu('reminder/items');
21
+
22
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Reminder Mail Form"), Mage::helper("adminhtml")->__("Reminder Mail Form"));
23
+
24
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
25
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
26
+
27
+ $this->_addContent($this->getLayout()->createBlock('reminder/adminhtml_mail_edit'))
28
+ ->_addLeft($this->getLayout()->createBlock('reminder/adminhtml_mail_edit_tabs'));
29
+
30
+ $this->renderLayout();
31
+
32
+ }
33
+
34
+ public function sendMailAction(){
35
+ if (!$this->_validateFormKey()) {
36
+ return $this->_redirect('*/*/');
37
+ }
38
+
39
+ $post = $this->getRequest()->getPost();
40
+ if ( $post ) {
41
+ $translate = Mage::getSingleton('core/translate');
42
+ /* @var $translate Mage_Core_Model_Translate */
43
+ $translate->setTranslateInline(false);
44
+ try {
45
+ $error = false;
46
+
47
+ if (!Zend_Validate::is(trim($post['reminder_date_start']) , 'NotEmpty')) {
48
+ $error = true;
49
+ }
50
+
51
+ if (!Zend_Validate::is(trim($post['reminder_date_end']) , 'NotEmpty')) {
52
+ $error = true;
53
+ }
54
+
55
+ if ($error) {
56
+ throw new Exception();
57
+ }
58
+
59
+ $storeId = Mage::app()->getStore()->getId();
60
+ $report_date = date('Y-m-d');
61
+ $report_date_and_time = date('Y-m-d H:i:s');
62
+
63
+ $emailTemplate = Mage::getModel('core/email_template');
64
+
65
+ $emailTemplate->setDesignConfig(array(
66
+ 'area' => 'frontend',
67
+ 'store' => $storeId
68
+ ));
69
+
70
+ $sender = array(
71
+ 'name' => $this->_getHelper()->escapeHtml(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_RECIPIENT)),
72
+ 'email' => $this->_getHelper()->escapeHtml(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_SENDER))
73
+ );
74
+
75
+ $mailSubject = $this->_getHelper()->escapeHtml(Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_SUBJECT));
76
+
77
+ //START: Subscriber
78
+ $collection = Mage::getModel('reminder/reminder')->getCollection();
79
+
80
+ //Filter Date Range
81
+ $reminder_date_start = trim($post['reminder_date_start']);
82
+ $reminder_date_end = trim($post['reminder_date_end']);
83
+ $collection->addFieldToFilter('reminder_date', array(
84
+ 'from' => $reminder_date_start,
85
+ 'to' => $reminder_date_end,
86
+ 'date' => true, // specifies conversion of comparison values
87
+ ));
88
+
89
+ $collection->load();
90
+
91
+ foreach($collection->getItems() as $item) {
92
+ $subscriber_id = $item->getId();
93
+ $subscriber_name = $item->getTitle();
94
+ $subscriber_email = $item->getEmail();
95
+ $product_name = $item->getProductName();
96
+ $product_url = $item->getProductUrl();
97
+ $link = $item->getProductUrl();
98
+ $reminder_date = $item->getReminderDate();
99
+
100
+ $timestamp = strtotime($reminder_date);
101
+ $date = date("l, j F Y", $timestamp);
102
+
103
+ $emailTemplateVariables = array();
104
+ $emailTemplateVariables['subject'] = $mailSubject;
105
+ $emailTemplateVariables['subscriberName'] = $subscriber_name;
106
+ $emailTemplateVariables['productName'] = $product_name;
107
+ $emailTemplateVariables['reminderDate'] = $date;
108
+ $emailTemplateVariables['productURL'] = $product_url;
109
+
110
+ $emailTemplate->sendTransactional(
111
+ Mage::getStoreConfig(self::XML_PATH_REMINDER_EMAIL_TEMPLATE),
112
+ $sender,
113
+ $subscriber_email,
114
+ $subscriber_name,
115
+ $emailTemplateVariables
116
+ );
117
+
118
+ //START: Save Report
119
+ $model = Mage::getModel('reminder/report');
120
+ $model->setSubscriberId($subscriber_id);
121
+ $model->setTitle($subscriber_name);
122
+ $model->setEmail($subscriber_email);
123
+ $model->setRemindDate($reminder_date);
124
+ $model->setReportDate($report_date);
125
+ $model->setReportDateAndTime($report_date_and_time);
126
+ $model->setProcessRun('admin');
127
+ //END: Save Report
128
+
129
+ if ($emailTemplate->getSentSuccess()) {
130
+ $model->setSendEmailStatus('yes');
131
+ $model->save();
132
+ }
133
+ else{
134
+ $model->setSendEmailStatus('no');
135
+ $model->save();
136
+ }
137
+ }
138
+ //END: Subscriber
139
+
140
+ $translate->setTranslateInline(true);
141
+ Mage::getSingleton('core/session')->addSuccess(Mage::helper('reminder')->__('Reminder mail has been send successfully.'));
142
+ }
143
+ catch (Exception $e) {
144
+ $translate->setTranslateInline(true);
145
+ Mage::getSingleton('core/session')->addError(Mage::helper('reminder')->__('Unable to send reminder mail. Please, try again later.'));
146
+ }
147
+
148
+ $this->_redirectReferer();
149
+
150
+ }
151
+
152
+ }
153
+ }
app/code/community/HZ/Reminder/controllers/Adminhtml/ReminderController.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Adminhtml_ReminderController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('reminder/items')
9
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Manage Reminder'), Mage::helper('adminhtml')->__('Manage Reminder'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+
16
+ $this->_title($this->__("Reminder"));
17
+ $this->_title($this->__("Manager Reminder"));
18
+
19
+ $this->_initAction()
20
+ ->renderLayout();
21
+ }
22
+
23
+ public function editAction() {
24
+
25
+ $this->_title($this->__("Reminder"));
26
+ $this->_title($this->__("Reminder"));
27
+ $this->_title($this->__("Edit Item"));
28
+
29
+ $id = $this->getRequest()->getParam('id');
30
+ $model = Mage::getModel('reminder/reminder')->load($id);
31
+
32
+ if ($model->getId() || $id == 0) {
33
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
34
+ if (!empty($data)) {
35
+ $model->setData($data);
36
+ }
37
+
38
+ Mage::register('reminder_data', $model);
39
+
40
+ $this->loadLayout();
41
+ $this->_setActiveMenu('reminder/items');
42
+
43
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Reminder Manager"), Mage::helper("adminhtml")->__("Reminder Manager"));
44
+ $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Reminder Description"), Mage::helper("adminhtml")->__("Reminder Description"));
45
+
46
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
47
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
48
+
49
+ $this->_addContent($this->getLayout()->createBlock('reminder/adminhtml_reminder_edit'))
50
+ ->_addLeft($this->getLayout()->createBlock('reminder/adminhtml_reminder_edit_tabs'));
51
+
52
+ $this->renderLayout();
53
+ } else {
54
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('reminder')->__('Item does not exist'));
55
+ $this->_redirect('*/*/');
56
+ }
57
+ }
58
+
59
+ public function newAction() {
60
+ $this->_forward('edit');
61
+ }
62
+
63
+ public function gridAction()
64
+ {
65
+ $this->loadLayout();
66
+ $this->getResponse()->setBody($this->getLayout()->createBlock('reminder/adminhtml_reminder_grid')->toHtml());
67
+ }
68
+
69
+ public function saveAction() {
70
+ $model = Mage::getModel('reminder/reminder');
71
+ if ($data = $this->getRequest()->getPost()) {
72
+ try {
73
+
74
+ $model = Mage::getModel('reminder/reminder');
75
+ $model->setData($data)
76
+ ->setId($this->getRequest()->getParam('id'));
77
+
78
+ if ($model->getCreatedAt == NULL || $model->getUpdatedAt() == NULL) {
79
+ $model->setCreatedAt(now())
80
+ ->setUpdatedAt(now());
81
+
82
+ //IP Address
83
+ $ip = Mage::helper('core/http')->getRemoteAddr();
84
+ $model->setIp($ip);
85
+ }
86
+ else {
87
+ $model->setUpdatedAt(now());
88
+ }
89
+
90
+ $model->save();
91
+
92
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('reminder')->__('Reminder was successfully saved'));
93
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
94
+
95
+ if ($this->getRequest()->getParam('back')) {
96
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
97
+ return;
98
+ }
99
+
100
+ $this->_redirect('*/*/');
101
+ return;
102
+
103
+ }
104
+ catch (Exception $e) {
105
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
106
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
107
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
108
+ return;
109
+ }
110
+ }
111
+
112
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('reminder')->__('Unable to find Reminder to save'));
113
+ $this->_redirect('*/*/');
114
+ }
115
+
116
+ public function deleteAction() {
117
+ if( $this->getRequest()->getParam('id') > 0 ) {
118
+ try {
119
+ $model = Mage::getModel('reminder/reminder');
120
+ $model->setId($this->getRequest()->getParam('id'))->delete();
121
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
122
+ $this->_redirect('*/*/');
123
+ } catch (Exception $e) {
124
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
125
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
126
+ }
127
+ }
128
+ $this->_redirect('*/*/');
129
+ }
130
+
131
+ public function massDeleteAction() {
132
+ $reminderIds = $this->getRequest()->getParam('reminder');
133
+ if(!is_array($reminderIds)) {
134
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
135
+ }
136
+ else {
137
+ try {
138
+ foreach ($reminderIds as $reminderId) {
139
+ $reminder = Mage::getModel('reminder/reminder')->load($reminderId);
140
+ $reminder->delete();
141
+ }
142
+ Mage::getSingleton('adminhtml/session')->addSuccess(
143
+ Mage::helper('adminhtml')->__(
144
+ 'Total of %d record(s) were successfully deleted', count($reminderIds)
145
+ )
146
+ );
147
+ } catch (Exception $e) {
148
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
149
+ }
150
+ }
151
+ $this->_redirect('*/*/index');
152
+ }
153
+
154
+ public function massStatusAction()
155
+ {
156
+ $reminderIds = $this->getRequest()->getParam('reminder');
157
+ if(!is_array($reminderIds)) {
158
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
159
+ } else {
160
+ try {
161
+ foreach ($reminderIds as $reminderId) {
162
+ $reminder = Mage::getSingleton('reminder/reminder')
163
+ ->load($reminderId)
164
+ ->setStatus($this->getRequest()->getParam('status'))
165
+ ->setIsMassupdate(true)
166
+ ->save();
167
+ }
168
+ $this->_getSession()->addSuccess(
169
+ $this->__('Total of %d record(s) were successfully updated', count($reminderIds))
170
+ );
171
+ } catch (Exception $e) {
172
+ $this->_getSession()->addError($e->getMessage());
173
+ }
174
+ }
175
+ $this->_redirect('*/*/index');
176
+ }
177
+
178
+ public function exportCsvAction()
179
+ {
180
+ $fileName = 'reminder.csv';
181
+ $content = $this->getLayout()->createBlock('reminder/adminhtml_reminder_grid')
182
+ ->getCsv();
183
+
184
+ $this->_sendUploadResponse($fileName, $content);
185
+ }
186
+
187
+ public function exportXmlAction()
188
+ {
189
+ $fileName = 'reminder.xml';
190
+ $content = $this->getLayout()->createBlock('reminder/adminhtml_reminder_grid')
191
+ ->getXml();
192
+
193
+ $this->_sendUploadResponse($fileName, $content);
194
+ }
195
+
196
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
197
+ {
198
+ $response = $this->getResponse();
199
+ $response->setHeader('HTTP/1.1 200 OK','');
200
+ $response->setHeader('Pragma', 'public', true);
201
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
202
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
203
+ $response->setHeader('Last-Modified', date('r'));
204
+ $response->setHeader('Accept-Ranges', 'bytes');
205
+ $response->setHeader('Content-Length', strlen($content));
206
+ $response->setHeader('Content-type', $contentType);
207
+ $response->setBody($content);
208
+ $response->sendResponse();
209
+ die;
210
+ }
211
+ }
app/code/community/HZ/Reminder/controllers/Adminhtml/ReportController.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class HZ_Reminder_Adminhtml_ReportController extends Mage_Adminhtml_Controller_action
4
+ {
5
+ protected function _initAction() {
6
+ $this->loadLayout()
7
+ ->_setActiveMenu('reminder/items')
8
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Reminder Report'), Mage::helper('adminhtml')->__('Reminder Report'));
9
+
10
+ return $this;
11
+ }
12
+
13
+ public function indexAction() {
14
+ $this->_title($this->__("Reminder"));
15
+ $this->_title($this->__("Reminder Report"));
16
+
17
+ $this->_initAction()
18
+ ->renderLayout();
19
+ }
20
+
21
+ }
app/code/community/HZ/Reminder/controllers/IndexController.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class HZ_Reminder_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+
8
+ $this->getLayout()->getBlock('head')->setTitle($this->__('Reminder'));
9
+
10
+ $breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
11
+ $breadcrumbs->addCrumb("home", array(
12
+ "label" => $this->__("Home Page"),
13
+ "title" => $this->__("Home Page"),
14
+ "link" => Mage::getBaseUrl()
15
+ ));
16
+ $breadcrumbs->addCrumb("reminder", array(
17
+ "label" => $this->__("Reminder"),
18
+ "title" => $this->__("Reminder")
19
+ ));
20
+
21
+
22
+ $this->_initLayoutMessages('customer/session');
23
+ $this->renderLayout();
24
+ }
25
+
26
+ public function ajaxAction()
27
+ {
28
+ $this->loadLayout();
29
+
30
+ $productSku = $_GET['sku'];
31
+
32
+ $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $productSku);
33
+ $product_name = Mage::helper('core')->escapeHtml($product->getName());
34
+ $product_url = $product->getProductUrl();
35
+
36
+ Mage::register('product_sku', $productSku);
37
+ Mage::register('product_name', $product_name);
38
+ Mage::register('product_url', $product_url);
39
+
40
+ $this->_initLayoutMessages('customer/session');
41
+ $this->renderLayout();
42
+ }
43
+
44
+ public function postAction()
45
+ {
46
+ $post = $this->getRequest()->getPost();
47
+ if ($post) {
48
+ try {
49
+
50
+ $error = false;
51
+
52
+ if (!Zend_Validate::is(trim($post['title']) , 'NotEmpty')) {
53
+ $error = true;
54
+ }
55
+ if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
56
+ $error = true;
57
+ }
58
+ if (!Zend_Validate::is(trim($post['product_name']) , 'NotEmpty')) {
59
+ $error = true;
60
+ }
61
+ if (!Zend_Validate::is(trim($post['reminder_day']) , 'NotEmpty')) {
62
+ $error = true;
63
+ }
64
+ if (!Zend_Validate::is(trim($post['reminder_month']) , 'NotEmpty')) {
65
+ $error = true;
66
+ }
67
+ if (!Zend_Validate::is(trim($post['reminder_year']) , 'NotEmpty')) {
68
+ $error = true;
69
+ }
70
+
71
+ if ($error) {
72
+ throw new Exception();
73
+ }
74
+
75
+ //Save Data
76
+ $model = Mage::getModel('reminder/reminder');
77
+ $model->setData($post);
78
+
79
+
80
+ //Reminder Date
81
+ $reminder_date = $post['reminder_year'] . '-' . $post['reminder_month'] . '-' . $post['reminder_day'];
82
+ $model->setReminderDate($reminder_date);
83
+
84
+ //IP Address
85
+ $ip = Mage::helper('core/http')->getRemoteAddr();
86
+ $model->setIp($ip);
87
+
88
+ //register date
89
+ $model->setRegisterDate(now());
90
+
91
+ //created date
92
+ $model->setCreatedAt(now())
93
+ ->setUpdatedAt(now());
94
+
95
+ $model->save();
96
+
97
+ Mage::getSingleton('customer/session')->addSuccess(Mage::helper('reminder')->__('Your reminder was submitted successfully.'));
98
+ $this->_redirect('*/*/');
99
+ return;
100
+ }
101
+ catch (Exception $e) {
102
+ Mage::getSingleton('customer/session')->addError(Mage::helper('reminder')->__('Unable to submit your request. Please, try again later.'));
103
+ $this->_redirect('*/*/');
104
+ return;
105
+ }
106
+
107
+ }
108
+ else {
109
+ $this->_redirect('*/*/');
110
+ }
111
+ }
112
+
113
+ public function ajaxPostAction()
114
+ {
115
+ $post = $this->getRequest()->getPost();
116
+
117
+ if ($post) {
118
+ try {
119
+ $error = false;
120
+
121
+ if (!Zend_Validate::is(trim($post['title']) , 'NotEmpty')) {
122
+ $error = true;
123
+ }
124
+ if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
125
+ $error = true;
126
+ }
127
+ if (!Zend_Validate::is(trim($post['product_sku']) , 'NotEmpty')) {
128
+ $error = true;
129
+ }
130
+ if (!Zend_Validate::is(trim($post['product_name']) , 'NotEmpty')) {
131
+ $error = true;
132
+ }
133
+ if (!Zend_Validate::is(trim($post['reminder_day']) , 'NotEmpty')) {
134
+ $error = true;
135
+ }
136
+ if (!Zend_Validate::is(trim($post['reminder_month']) , 'NotEmpty')) {
137
+ $error = true;
138
+ }
139
+ if (!Zend_Validate::is(trim($post['reminder_year']) , 'NotEmpty')) {
140
+ $error = true;
141
+ }
142
+
143
+ if ($error) {
144
+ throw new Exception();
145
+ }
146
+
147
+ //Save Data
148
+ $model = Mage::getModel('reminder/reminder');
149
+ $model->setData($post);
150
+
151
+ //Reminder Date
152
+ $reminder_date = $post['reminder_year'] . '-' . $post['reminder_month'] . '-' . $post['reminder_day'];
153
+ $model->setReminderDate($reminder_date);
154
+
155
+ //IP Address
156
+ $ip = Mage::helper('core/http')->getRemoteAddr();
157
+ $model->setIp($ip);
158
+
159
+ //register date
160
+ $model->setRegisterDate(now());
161
+
162
+ //created date
163
+ $model->setCreatedAt(now())
164
+ ->setUpdatedAt(now());
165
+
166
+ $model->save();
167
+
168
+ echo '1';
169
+ exit();
170
+ }
171
+ catch (Exception $e) {
172
+ echo '0';
173
+ exit();
174
+ }
175
+
176
+ }
177
+ else {
178
+ echo '0';
179
+ exit();
180
+ }
181
+ }
182
+
183
+ }
app/code/community/HZ/Reminder/etc/adminhtml.xml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <menu>
3
+ <reminder module="reminder">
4
+ <title>Reminder</title>
5
+ <sort_order>71</sort_order>
6
+ <children>
7
+ <subscriber module="reminder">
8
+ <title>Reminder Subscribers</title>
9
+ <sort_order>0</sort_order>
10
+ <action>reminder/adminhtml_reminder</action>
11
+ </subscriber>
12
+ <mail module="reminder">
13
+ <title>Send Reminder</title>
14
+ <sort_order>1</sort_order>
15
+ <action>reminder/adminhtml_mail</action>
16
+ </mail>
17
+ <report module="reminder">
18
+ <title>Reminder Report</title>
19
+ <sort_order>2</sort_order>
20
+ <action>reminder/adminhtml_report</action>
21
+ </report>
22
+ </children>
23
+ </reminder>
24
+ </menu>
25
+ <acl>
26
+ <resources>
27
+ <all>
28
+ <title>Allow Everything</title>
29
+ </all>
30
+ <admin>
31
+ <children>
32
+ <HZ_Reminder>
33
+ <title>Reminder Module</title>
34
+ <sort_order>10</sort_order>
35
+ </HZ_Reminder>
36
+ <system>
37
+ <children>
38
+ <config>
39
+ <children>
40
+ <reminder translate="title" module="reminder">
41
+ <title>Reminder</title>
42
+ <sort_order>800</sort_order>
43
+ </reminder>
44
+ </children>
45
+ </config>
46
+ </children>
47
+ </system>
48
+ </children>
49
+ </admin>
50
+ </resources>
51
+ </acl>
52
+ </config>
app/code/community/HZ/Reminder/etc/config.xml ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <HZ_Reminder>
5
+ <version>0.1.0</version>
6
+ </HZ_Reminder>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <reminder>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>HZ_Reminder</module>
14
+ <frontName>reminder</frontName>
15
+ </args>
16
+ </reminder>
17
+ </routers>
18
+ <translate>
19
+ <modules>
20
+ <HZ_Reminder>
21
+ <files>
22
+ <default>HZ_Reminder.csv</default>
23
+ </files>
24
+ </HZ_Reminder>
25
+ </modules>
26
+ </translate>
27
+ <layout>
28
+ <updates>
29
+ <reminder>
30
+ <file>reminder.xml</file>
31
+ </reminder>
32
+ </updates>
33
+ </layout>
34
+ </frontend>
35
+ <global>
36
+ <models>
37
+ <reminder>
38
+ <class>HZ_Reminder_Model</class>
39
+ <resourceModel>reminder_mysql4</resourceModel>
40
+ </reminder>
41
+ <reminder_mysql4>
42
+ <class>HZ_Reminder_Model_Mysql4</class>
43
+ <entities>
44
+ <reminder>
45
+ <table>reminder_subscriber</table>
46
+ </reminder>
47
+ <report>
48
+ <table>reminder_report</table>
49
+ </report>
50
+ </entities>
51
+ </reminder_mysql4>
52
+ </models>
53
+ <resources>
54
+ <reminder_setup>
55
+ <setup>
56
+ <module>HZ_Reminder</module>
57
+ </setup>
58
+ <connection>
59
+ <use>core_setup</use>
60
+ </connection>
61
+ </reminder_setup>
62
+ <reminder_write>
63
+ <connection>
64
+ <use>core_write</use>
65
+ </connection>
66
+ </reminder_write>
67
+ <reminder_read>
68
+ <connection>
69
+ <use>core_read</use>
70
+ </connection>
71
+ </reminder_read>
72
+ </resources>
73
+ <blocks>
74
+ <reminder>
75
+ <class>HZ_Reminder_Block</class>
76
+ </reminder>
77
+ </blocks>
78
+ <helpers>
79
+ <reminder>
80
+ <class>HZ_Reminder_Helper</class>
81
+ </reminder>
82
+ </helpers>
83
+ <template>
84
+ <email>
85
+ <reminder_email_subscriber_template translate="label" module="reminder">
86
+ <label>Reminder Subscriber</label>
87
+ <file>reminder/subscriber_reminder.html</file>
88
+ <type>html</type>
89
+ </reminder_email_subscriber_template>
90
+ </email>
91
+ </template>
92
+ </global>
93
+ <admin>
94
+ <routers>
95
+ <reminder>
96
+ <use>admin</use>
97
+ <args>
98
+ <module>HZ_Reminder</module>
99
+ <frontName>reminder</frontName>
100
+ </args>
101
+ </reminder>
102
+ </routers>
103
+ </admin>
104
+ <adminhtml>
105
+ <translate>
106
+ <modules>
107
+ <reminder_adminhtml>
108
+ <files>
109
+ <reminder>HZ_Reminder.csv</reminder>
110
+ </files>
111
+ </reminder_adminhtml>
112
+ </modules>
113
+ </translate>
114
+ <layout>
115
+ <updates>
116
+ <reminder>
117
+ <file>reminder.xml</file>
118
+ </reminder>
119
+ </updates>
120
+ </layout>
121
+ </adminhtml>
122
+ <default>
123
+ <reminder>
124
+ <email>
125
+ <sender_name>Example Name</sender_name>
126
+ <sender_email>reminder@example.com</sender_email>
127
+ <subject>Example Subject</subject>
128
+ <template_subscriber>reminder_email_subscriber_template</template_subscriber>
129
+ <remainder_date>5,7,10</remainder_date>
130
+ </email>
131
+ </reminder>
132
+ </default>
133
+ <crontab>
134
+ <jobs>
135
+ <reminder_send_subscriber>
136
+ <schedule>
137
+ <cron_expr>0 0 * * *</cron_expr>
138
+ </schedule>
139
+ <run>
140
+ <model>reminder/observer::scheduledSendEmailReminder</model>
141
+ </run>
142
+ </reminder_send_subscriber>
143
+ </jobs>
144
+ </crontab>
145
+ </config>
app/code/community/HZ/Reminder/etc/system.xml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <tabs>
3
+ <innovarso translate="label">
4
+ <label>Remainder</label>
5
+ <sort_order>100</sort_order>
6
+ </innovarso>
7
+ </tabs>
8
+ <sections>
9
+ <reminder translate="label">
10
+ <label>Remainder Settings</label>
11
+ <tab>innovarso</tab>
12
+ <frontend_type></frontend_type>
13
+ <sort_order>100</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
+ <groups>
18
+ <email>
19
+ <label>Email Options</label>
20
+ <sort_order>10</sort_order>
21
+ <show_in_default>1</show_in_default>
22
+ <show_in_website>1</show_in_website>
23
+ <show_in_store>1</show_in_store>
24
+ <fields>
25
+ <sender_name translate="label">
26
+ <label>Sender Name</label>
27
+ <frontend_type>text</frontend_type>
28
+ <sort_order>1</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <validate>required-entry</validate>
33
+ </sender_name>
34
+ <sender_email translate="label">
35
+ <label>Sender Email</label>
36
+ <frontend_type>text</frontend_type>
37
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
38
+ <validate>validate-email</validate>
39
+ <sort_order>10</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ <validate>required-entry</validate>
44
+ </sender_email>
45
+ <subject translate="label">
46
+ <label>Subject</label>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>20</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
+ <validate>required-entry</validate>
53
+ </subject>
54
+ <subscriber_template translate="label">
55
+ <label>Subscriber Email Template</label>
56
+ <frontend_type>select</frontend_type>
57
+ <source_model>adminhtml/system_config_source_email_template</source_model>
58
+ <sort_order>30</sort_order>
59
+ <show_in_default>1</show_in_default>
60
+ <show_in_website>1</show_in_website>
61
+ <show_in_store>1</show_in_store>
62
+ </subscriber_template>
63
+ <remainder_date translate="label">
64
+ <label>Set Remainder Date</label>
65
+ <frontend_type>text</frontend_type>
66
+ <sort_order>40</sort_order>
67
+ <show_in_default>1</show_in_default>
68
+ <show_in_website>1</show_in_website>
69
+ <show_in_store>1</show_in_store>
70
+ <validate>required-entry</validate>
71
+ </remainder_date>
72
+ </fields>
73
+ </email>
74
+ </groups>
75
+ </reminder>
76
+ </sections>
77
+ </config>
app/code/community/HZ/Reminder/sql/reminder_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+ $installer->run("
7
+ -- DROP TABLE IF EXISTS {$this->getTable('reminder_subscriber')};
8
+ CREATE TABLE {$this->getTable('reminder_subscriber')} (
9
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
10
+ `title` varchar(255) NOT NULL DEFAULT '',
11
+ `email` varchar(255) NOT NULL DEFAULT '',
12
+ `product_sku` varchar(255) NOT NULL DEFAULT '',
13
+ `product_name` varchar(255) NOT NULL DEFAULT '',
14
+ `product_url` varchar(255) NOT NULL DEFAULT '',
15
+ `register_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
16
+ `reminder_date` date NOT NULL DEFAULT '0000-00-00',
17
+ `ip` varchar(255) NOT NULL DEFAULT '',
18
+ `sort_order` int(10) unsigned NOT NULL DEFAULT '0',
19
+ `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
20
+ `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
21
+ `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
22
+ PRIMARY KEY (`id`)
23
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
24
+
25
+ -- DROP TABLE IF EXISTS {$this->getTable('reminder_report')};
26
+ CREATE TABLE {$this->getTable('reminder_report')} (
27
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
28
+ `subscriber_id` int(11) DEFAULT NULL,
29
+ `title` varchar(255) NOT NULL DEFAULT '',
30
+ `email` varchar(255) NOT NULL DEFAULT '',
31
+ `remind_date` date NOT NULL,
32
+ `report_date` date NOT NULL,
33
+ `report_date_and_time` datetime NOT NULL,
34
+ `send_email_status` enum('yes','no') DEFAULT 'yes',
35
+ `process_run` enum('admin','cron') DEFAULT 'cron',
36
+ PRIMARY KEY (`id`)
37
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
38
+ ");
39
+
40
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/reminder.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <reminder_adminhtml_reminder_edit>
4
+ <update handle="editor"/>
5
+ </reminder_adminhtml_reminder_edit>
6
+ <reminder_adminhtml_reminder_index>
7
+ <update handle="editor"/>
8
+ <reference name="content">
9
+ <block type="reminder/adminhtml_reminder" name="reminder" />
10
+ </reference>
11
+ </reminder_adminhtml_reminder_index>
12
+ <reminder_adminhtml_report_index>
13
+ <update handle="editor"/>
14
+ <reference name="content">
15
+ <block type="reminder/adminhtml_report" name="report" />
16
+ </reference>
17
+ </reminder_adminhtml_report_index>
18
+ </layout>
app/design/frontend/base/default/layout/reminder.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <reminder_index_index>
4
+ <reference name="root">
5
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
6
+ </reference>
7
+ <reference name="head">
8
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action>
9
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
10
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
11
+ <block type="core/html_calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"></block>
12
+ </reference>
13
+ <reference name="content">
14
+ <block type="reminder/reminder" name="reminder" template="reminder/reminder.phtml" />
15
+ </reference>
16
+ </reminder_index_index>
17
+ <reminder_index_ajax>
18
+ <reference name="root">
19
+ <action method="setTemplate"><template>page/empty.phtml</template></action>
20
+ </reference>
21
+ <reference name="head">
22
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action>
23
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
24
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
25
+
26
+ <action method="addItem"><type>skin_css</type><name>css/reminder/jquery.fancybox.css</name><params></params></action>
27
+ <action method="addItem"><type>skin_js</type><name>js/reminder/jquery.fancybox.pack.js</name></action>
28
+ <action method="addItem"><type>skin_js</type><name>js/reminder/reminder.js</name></action>
29
+
30
+ <block type="core/html_calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"></block>
31
+ </reference>
32
+ <reference name="content">
33
+ <block type="reminder/reminder" name="reminder" template="reminder/ajax.phtml" />
34
+ </reference>
35
+ </reminder_index_ajax>
36
+
37
+ <catalog_product_view>
38
+ <reference name="head">
39
+ <action method="addItem"><type>skin_css</type><name>css/reminder/jquery.fancybox.css</name><params></params></action>
40
+ <action method="addItem"><type>skin_js</type><name>js/reminder/jquery.fancybox.pack.js</name></action>
41
+ <action method="addItem"><type>skin_js</type><name>js/reminder/reminder.js</name></action>
42
+ </reference>
43
+ </catalog_product_view>
44
+ </layout>
app/design/frontend/base/default/template/reminder/ajax.phtml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">
2
+ //Ajax Form Submit
3
+ jQuery("#remainderAjaxForm").submit(function(event){
4
+ event.preventDefault();
5
+
6
+ var parent_this = jQuery(this);
7
+
8
+ var individual_form_data = jQuery(this).serialize();
9
+ var form_action = jQuery(this).attr('action');
10
+
11
+ jQuery.ajax( {
12
+ type : "POST",
13
+ url : form_action,
14
+ data : individual_form_data,
15
+ success : function(msg) {
16
+ if(Number(msg) == 1){
17
+ var successHtml = '<p>Your reminder was submitted successfully.</p>';
18
+ jQuery("#reminder-ajax-form-body").html(successHtml);
19
+ }
20
+ else{
21
+ var errorHtml = '<p>Unable to submit your request. Please, try again later.</p>';
22
+ jQuery("#reminder-ajax-form-body").html(errorHtml);
23
+ }
24
+ }
25
+ });
26
+
27
+ });
28
+ </script>
29
+ <style type="text/css">
30
+ #advice-validate-select-reminder_day {
31
+ display: none;
32
+ }
33
+ #advice-validate-select-reminder_month {
34
+ display: none;
35
+ }
36
+ </style>
37
+ <div id="reminder-ajax-form-container" style="padding: 20px 20px 20px 20px">
38
+ <div class="page-title">
39
+ <h1><?php echo Mage::helper('reminder')->__('Remainder') ?></h1>
40
+ </div>
41
+ <div id="reminder-ajax-form-body">
42
+ <form action="<?php echo $this->getUrl('reminder/index/ajaxPost/') ?>" id="remainderAjaxForm" method="post">
43
+ <div class="fieldset">
44
+ <ul class="form-list">
45
+ <li class="wide">
46
+ <label for="name" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Name') ?></label>
47
+ <div class="input-box">
48
+ <input name="title" id="title" title="<?php echo Mage::helper('reminder')->__('Name') ?>" class="input-text required-entry" type="text" />
49
+ </div>
50
+ </li>
51
+ <li class="wide">
52
+ <label for="email" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Email') ?></label>
53
+ <div class="input-box">
54
+ <input name="email" id="email" title="<?php echo Mage::helper('reminder')->__('Email') ?>" class="input-text required-entry validate-email" type="text" />
55
+ </div>
56
+ </li>
57
+ <li class="wide">
58
+ <label for="product_name" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Product Name') ?></label>
59
+ <div class="input-box">
60
+ <input name="product_name" id="product_name" title="<?php echo Mage::helper('reminder')->__('Product Name') ?>" value="<?php echo Mage::registry('product_name'); ?>" class="input-text required-entry" type="text" />
61
+ </div>
62
+ </li>
63
+
64
+ <li class="wide">
65
+ <label for="reminder_date" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Remainder Date') ?></label>
66
+ <div class="input-box">
67
+ <select name="reminder_day" id="reminder_day" class="validate-select" style="width:100px !important;">
68
+ <option value=''>Day</option>
69
+ <?php
70
+ for($i = 1; $i <= 31; $i++)
71
+ {
72
+ $day = sprintf("%02d", $i);
73
+ echo "<option value='".$day."'>".$day."</option>";
74
+ }
75
+ ?>
76
+ </select>
77
+
78
+ <select name="reminder_month" class="validate-select" id="reminder_month" style="width:120px !important;">
79
+ <option value=''>Month</option>
80
+ <option value="01">January</option>
81
+ <option value="02">February</option>
82
+ <option value="03">March</option>
83
+ <option value="04">April</option>
84
+ <option value="05">May</option>
85
+ <option value="06">June</option>
86
+ <option value="07">July</option>
87
+ <option value="08">August</option>
88
+ <option value="09">September</option>
89
+ <option value="10">October</option>
90
+ <option value="11">November</option>
91
+ <option value="12">December</option>
92
+ </select>
93
+
94
+ <select name="reminder_year" class="validate-select" id="reminder_year" style="width:100px !important;">
95
+ <option value=''>Year</option>
96
+ <?php
97
+ for($j = date('Y'); $j <= date('Y') + 10; $j++)
98
+ {
99
+ echo "<option value='".$j."'>".$j."</option>";
100
+ }
101
+ ?>
102
+ </select>
103
+ </div>
104
+ </li>
105
+ </ul>
106
+ </div>
107
+ <div class="buttons-set">
108
+ <input type="hidden" name="product_sku" value="<?php echo Mage::registry('product_sku'); ?>"/>
109
+ <input type="hidden" name="product_url" value="<?php echo Mage::registry('product_url'); ?>"/>
110
+ <p class="required"><?php echo Mage::helper('reminder')->__('* Required Fields') ?></p>
111
+ <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
112
+ <button type="submit" title="<?php echo Mage::helper('reminder')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('reminder')->__('Submit') ?></span></span></button>
113
+ </div>
114
+ </form>
115
+ <script type="text/javascript">
116
+ //<![CDATA[
117
+ var remainderForm = new VarienForm('remainderAjaxForm', true);
118
+ //]]>
119
+ </script>
120
+ </div>
121
+ </div>
122
+
app/design/frontend/base/default/template/reminder/reminder.phtml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+ #advice-validate-select-reminder_day {
3
+ display: none;
4
+ }
5
+ #advice-validate-select-reminder_month {
6
+ display: none;
7
+ }
8
+ </style>
9
+ <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
10
+ <div class="page-title">
11
+ <h1><?php echo Mage::helper('reminder')->__('Remainder') ?></h1>
12
+ </div>
13
+ <form action="<?php echo $this->getFormAction(); ?>" id="remainderForm" method="post">
14
+ <div class="fieldset">
15
+ <h2 class="legend"><?php echo Mage::helper('reminder')->__('Remainder Information') ?></h2>
16
+ <ul class="form-list">
17
+ <li class="wide">
18
+ <label for="name" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Name') ?></label>
19
+ <div class="input-box">
20
+ <input name="title" id="title" title="<?php echo Mage::helper('reminder')->__('Name') ?>" class="input-text required-entry" type="text" />
21
+ </div>
22
+ </li>
23
+ <li class="wide">
24
+ <label for="email" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Email') ?></label>
25
+ <div class="input-box">
26
+ <input name="email" id="email" title="<?php echo Mage::helper('reminder')->__('Email') ?>" class="input-text required-entry validate-email" type="text" />
27
+ </div>
28
+ </li>
29
+ <li class="wide">
30
+ <label for="product_name" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Product Name') ?></label>
31
+ <div class="input-box">
32
+ <input name="product_name" id="product_name" title="<?php echo Mage::helper('reminder')->__('Product Name') ?>" class="input-text required-entry" type="text" />
33
+ </div>
34
+ </li>
35
+
36
+ <li class="wide">
37
+ <label for="reminder_date" class="required"><em>*</em><?php echo Mage::helper('reminder')->__('Remainder Date') ?></label>
38
+ <div class="input-box">
39
+ <select name="reminder_day" id="reminder_day" class="validate-select" style="width:100px !important;">
40
+ <option value=''>Day</option>
41
+ <?php
42
+ for($i = 1; $i <= 31; $i++)
43
+ {
44
+ $day = sprintf("%02d", $i);
45
+ echo "<option value='".$day."'>".$day."</option>";
46
+ }
47
+ ?>
48
+ </select>
49
+
50
+ <select name="reminder_month" class="validate-select" id="reminder_month" style="width:120px !important;">
51
+ <option value=''>Month</option>
52
+ <option value="01">January</option>
53
+ <option value="02">February</option>
54
+ <option value="03">March</option>
55
+ <option value="04">April</option>
56
+ <option value="05">May</option>
57
+ <option value="06">June</option>
58
+ <option value="07">July</option>
59
+ <option value="08">August</option>
60
+ <option value="09">September</option>
61
+ <option value="10">October</option>
62
+ <option value="11">November</option>
63
+ <option value="12">December</option>
64
+ </select>
65
+
66
+ <select name="reminder_year" class="validate-select" id="reminder_year" style="width:100px !important;">
67
+ <option value=''>Year</option>
68
+ <?php
69
+ for($j = date('Y'); $j <= date('Y') + 10; $j++)
70
+ {
71
+ echo "<option value='".$j."'>".$j."</option>";
72
+ }
73
+ ?>
74
+ </select>
75
+ </div>
76
+ </li>
77
+ </ul>
78
+ </div>
79
+ <div class="buttons-set">
80
+ <p class="required"><?php echo Mage::helper('reminder')->__('* Required Fields') ?></p>
81
+ <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
82
+ <button type="submit" title="<?php echo Mage::helper('reminder')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('reminder')->__('Submit') ?></span></span></button>
83
+ </div>
84
+ </form>
85
+ <script type="text/javascript">
86
+ //<![CDATA[
87
+ var remainderForm = new VarienForm('remainderForm', true);
88
+ //]]>
89
+ </script>
90
+
app/etc/modules/HZ_Reminder.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <HZ_Reminder>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </HZ_Reminder>
8
+ </modules>
9
+ </config>
app/locale/en_US/template/email/reminder/subscriber_reminder.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <!--@subject {{var subject}} @-->
2
+
3
+ lieber {{var subscriberName}},<br /><br />
4
+
5
+ wir wollen dich an die kündigung deines {{var productName}} erinnern.<br />
6
+ Du hast noch {{var reminderDate}} tage bis zum ende der kündigungsfrist.<br />
7
+ Kündige hier {{var productURL}}.<br /><br />
8
+
9
+ viele grüße dein abo-killer team
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>HZ_Reminder</name>
4
+ <version>0.1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Reminder Extension</summary>
10
+ <description>Reminder Extension</description>
11
+ <notes>Reminder Extension</notes>
12
+ <authors><author><name>Mohammad Harun-Or-Rashid</name><user>harun</user><email>harun.zend@gmail.com</email></author></authors>
13
+ <date>2014-12-21</date>
14
+ <time>18:16:11</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="HZ_Reminder.xml" hash="e6ba1bec8516936d27471b17913e20d8"/></dir></target><target name="magecommunity"><dir name="HZ"><dir name="Reminder"><dir name="Block"><dir name="Adminhtml"><dir name="Mail"><dir name="Edit"><file name="Form.php" hash="1a6ef9927ecc08a1f9020c9324bdaa18"/><dir name="Tab"><file name="Form.php" hash="1d64d9452a35de8c04842865782d34a8"/></dir><file name="Tabs.php" hash="4a9eba4ed0994bff639d5be39040ad93"/></dir><file name="Edit.php" hash="f58b646595c7f91d2e9c00f168d545d5"/></dir><file name="Mail.php" hash="ef0d1c08cd82ee6748292234f5dfe567"/><dir name="Reminder"><dir name="Edit"><file name="Form.php" hash="a3a168c57b3c32b4dc42cd2f8555a1b8"/><dir name="Tab"><file name="Form.php" hash="0aa73826f7aa219141bdbb640cf7e72b"/></dir><file name="Tabs.php" hash="caf56214674adda0b6d48aa2e27f64ec"/></dir><file name="Edit.php" hash="bec021b2ee4590136dd56f2819ccd23d"/><file name="Grid.php" hash="cc251eccd5bd4e59f52148f19aee8f03"/></dir><file name="Reminder.php" hash="9fbb72f0f2d8ec94b6419d8d679ec3dd"/><dir name="Report"><file name="Grid.php" hash="f87ab9d3372f25bc9339d4f8901ce0ac"/></dir><file name="Report.php" hash="5eb2264f3a62cf3d1c42dffd2b4639d8"/></dir><file name="Reminder.php" hash="1bc4e0dea447f82e372ffc0ecd770669"/></dir><dir name="Helper"><file name="Data.php" hash="a4a2c97cf298a27e0d293cb0d12d34ca"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Reminder"><file name="Collection.php" hash="93c8092489b1006a58719f3625906c8b"/></dir><file name="Reminder.php" hash="3802c33b73705001578dfe1dafc2f798"/><dir name="Report"><file name="Collection.php" hash="b8c0face2dce67fa50cf2f6d58712333"/></dir><file name="Report.php" hash="b3075ad3bb19718cf80f49cc2e57af97"/></dir><file name="Observer.php" hash="b07e847d1e31dd758f2162439b01b2ed"/><file name="Reminder.php" hash="ab45da14507b6c2c1e1ceecb47575cf6"/><file name="Report.php" hash="d6aafab74dec1395c0cb7a731fe45d97"/><file name="Status.php" hash="bf55517fbdacd03d9dbc3d9fcef38c0c"/><dir name="Wysiwyg"><file name="Config.php" hash="25d2903641c31677c4aa3bc76f9caa0c"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MailController.php" hash="f6511546d84e830cd6a7d9ea8e04fd3a"/><file name="ReminderController.php" hash="925cd0fd5cd8dbb72a615f52696352ac"/><file name="ReportController.php" hash="89e6cc4b50f600da99fd57130e2336a4"/></dir><file name="IndexController.php" hash="fed54d26fea911bc79ea3b70416720d9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="59911ece9bcb0e29c32e04447582b5ac"/><file name="config.xml" hash="f0695aab513c6414f2b323cdd63c0950"/><file name="system.xml" hash="6b12c2779e8d3c23982ed750ba4b44ec"/></dir><dir name="sql"><dir name="reminder_setup"><file name="mysql4-install-0.1.0.php" hash="d6edff77c55a037b7419bab06851cdbe"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="reminder.xml" hash="ff4ef010b6748b8f09645461415e4d7f"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="reminder.xml" hash="a027e0ec08394326893e9ae5c64b341b"/></dir><dir name="template"><dir name="reminder"><file name="ajax.phtml" hash="e844b4c94b791ee507acb3ac50f21106"/><file name="reminder.phtml" hash="0d09cee9d9fbdd115ee054c6e3a21035"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Innovarso_Reminder.csv" hash=""/><dir name="template"><dir name="email"><dir name="reminder"><file name="subscriber_reminder.html" hash="f4ed47e06407ee3d8343d63f4aaf0999"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="reminder"><file name="jquery.fancybox.css" hash="dc5afe0d5302c0ce6b8728ac8cda6ad5"/></dir></dir><dir name="images"><dir name="reminder"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancybox_loading.gif" hash="328cc0f6c78211485058d460e80f4fa8"/><file name="fancybox_loading@2x.gif" hash="f92938639fa894a0e8ded1c3368abe98"/><file name="fancybox_overlay.png" hash="77aeaa52715b898b73c74d68c630330e"/><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="fancybox_sprite@2x.png" hash="ed9970ce22242421e66ff150aa97fe5f"/></dir></dir><dir name="js"><dir name="reminder"><dir name="helpers"><file name="fancybox_buttons.png" hash="b448080f8615e664b7788c7003803b59"/><file name="jquery.fancybox-buttons.css" hash="cac75538c2e3ddfadef839feaca8e356"/><file name="jquery.fancybox-buttons.js" hash="f53c246661fb995a3f12e67fa38e0fa0"/><file name="jquery.fancybox-media.js" hash="c017067f48d97ec4a077ccdf056e6a2e"/><file name="jquery.fancybox-thumbs.css" hash="52ddd84a9f42c1d4cd86d518a7f7e8bc"/><file name="jquery.fancybox-thumbs.js" hash="cf1fc1df534eede4cb460c5cbd71aba6"/></dir><file name="jquery.fancybox.js" hash="921e9cb04ad6e2559869ec845c5be39b"/><file name="jquery.fancybox.pack.js" hash="cc9e759f24ba773aeef8a131889d3728"/><file name="reminder.js" hash="ea929aa7d6e177544a1d680f745b624e"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/frontend/base/default/css/reminder/jquery.fancybox.css ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ .fancybox-wrap,
3
+ .fancybox-skin,
4
+ .fancybox-outer,
5
+ .fancybox-inner,
6
+ .fancybox-image,
7
+ .fancybox-wrap iframe,
8
+ .fancybox-wrap object,
9
+ .fancybox-nav,
10
+ .fancybox-nav span,
11
+ .fancybox-tmp
12
+ {
13
+ padding: 0;
14
+ margin: 0;
15
+ border: 0;
16
+ outline: none;
17
+ vertical-align: top;
18
+ }
19
+
20
+ .fancybox-wrap {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ z-index: 8020;
25
+ }
26
+
27
+ .fancybox-skin {
28
+ position: relative;
29
+ background: #f9f9f9;
30
+ color: #444;
31
+ text-shadow: none;
32
+ -webkit-border-radius: 4px;
33
+ -moz-border-radius: 4px;
34
+ border-radius: 4px;
35
+ }
36
+
37
+ .fancybox-opened {
38
+ z-index: 8030;
39
+ }
40
+
41
+ .fancybox-opened .fancybox-skin {
42
+ -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
43
+ -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
44
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
45
+ }
46
+
47
+ .fancybox-outer, .fancybox-inner {
48
+ position: relative;
49
+ }
50
+
51
+ .fancybox-inner {
52
+ overflow: hidden;
53
+ }
54
+
55
+ .fancybox-type-iframe .fancybox-inner {
56
+ -webkit-overflow-scrolling: touch;
57
+ }
58
+
59
+ .fancybox-error {
60
+ color: #444;
61
+ font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
62
+ margin: 0;
63
+ padding: 15px;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .fancybox-image, .fancybox-iframe {
68
+ display: block;
69
+ width: 100%;
70
+ height: 100%;
71
+ }
72
+
73
+ .fancybox-image {
74
+ max-width: 100%;
75
+ max-height: 100%;
76
+ }
77
+
78
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
79
+ background-image: url('../../images/reminder/fancybox_sprite.png');
80
+ }
81
+
82
+ #fancybox-loading {
83
+ position: fixed;
84
+ top: 50%;
85
+ left: 50%;
86
+ margin-top: -22px;
87
+ margin-left: -22px;
88
+ background-position: 0 -108px;
89
+ opacity: 0.8;
90
+ cursor: pointer;
91
+ z-index: 8060;
92
+ }
93
+
94
+ #fancybox-loading div {
95
+ width: 44px;
96
+ height: 44px;
97
+ background: url('../../images/reminder/fancybox_loading.gif') center center no-repeat;
98
+ }
99
+
100
+ .fancybox-close {
101
+ position: absolute;
102
+ top: -18px;
103
+ right: -18px;
104
+ width: 36px;
105
+ height: 36px;
106
+ cursor: pointer;
107
+ z-index: 8040;
108
+ }
109
+
110
+ .fancybox-nav {
111
+ position: absolute;
112
+ top: 0;
113
+ width: 40%;
114
+ height: 100%;
115
+ cursor: pointer;
116
+ text-decoration: none;
117
+ background: transparent url('../../images/reminder/blank.gif'); /* helps IE */
118
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
119
+ z-index: 8040;
120
+ }
121
+
122
+ .fancybox-prev {
123
+ left: 0;
124
+ }
125
+
126
+ .fancybox-next {
127
+ right: 0;
128
+ }
129
+
130
+ .fancybox-nav span {
131
+ position: absolute;
132
+ top: 50%;
133
+ width: 36px;
134
+ height: 34px;
135
+ margin-top: -18px;
136
+ cursor: pointer;
137
+ z-index: 8040;
138
+ visibility: hidden;
139
+ }
140
+
141
+ .fancybox-prev span {
142
+ left: 10px;
143
+ background-position: 0 -36px;
144
+ }
145
+
146
+ .fancybox-next span {
147
+ right: 10px;
148
+ background-position: 0 -72px;
149
+ }
150
+
151
+ .fancybox-nav:hover span {
152
+ visibility: visible;
153
+ }
154
+
155
+ .fancybox-tmp {
156
+ position: absolute;
157
+ top: -99999px;
158
+ left: -99999px;
159
+ visibility: hidden;
160
+ max-width: 99999px;
161
+ max-height: 99999px;
162
+ overflow: visible !important;
163
+ }
164
+
165
+ /* Overlay helper */
166
+
167
+ .fancybox-lock {
168
+ overflow: hidden !important;
169
+ width: auto;
170
+ }
171
+
172
+ .fancybox-lock body {
173
+ overflow: hidden !important;
174
+ }
175
+
176
+ .fancybox-lock-test {
177
+ overflow-y: hidden !important;
178
+ }
179
+
180
+ .fancybox-overlay {
181
+ position: absolute;
182
+ top: 0;
183
+ left: 0;
184
+ overflow: hidden;
185
+ display: none;
186
+ z-index: 8010;
187
+ background: url('../../images/reminder/fancybox_overlay.png');
188
+ }
189
+
190
+ .fancybox-overlay-fixed {
191
+ position: fixed;
192
+ bottom: 0;
193
+ right: 0;
194
+ }
195
+
196
+ .fancybox-lock .fancybox-overlay {
197
+ overflow: auto;
198
+ overflow-y: scroll;
199
+ }
200
+
201
+ /* Title helper */
202
+
203
+ .fancybox-title {
204
+ visibility: hidden;
205
+ font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
206
+ position: relative;
207
+ text-shadow: none;
208
+ z-index: 8050;
209
+ }
210
+
211
+ .fancybox-opened .fancybox-title {
212
+ visibility: visible;
213
+ }
214
+
215
+ .fancybox-title-float-wrap {
216
+ position: absolute;
217
+ bottom: 0;
218
+ right: 50%;
219
+ margin-bottom: -35px;
220
+ z-index: 8050;
221
+ text-align: center;
222
+ }
223
+
224
+ .fancybox-title-float-wrap .child {
225
+ display: inline-block;
226
+ margin-right: -100%;
227
+ padding: 2px 20px;
228
+ background: transparent; /* Fallback for web browsers that doesn't support RGBa */
229
+ background: rgba(0, 0, 0, 0.8);
230
+ -webkit-border-radius: 15px;
231
+ -moz-border-radius: 15px;
232
+ border-radius: 15px;
233
+ text-shadow: 0 1px 2px #222;
234
+ color: #FFF;
235
+ font-weight: bold;
236
+ line-height: 24px;
237
+ white-space: nowrap;
238
+ }
239
+
240
+ .fancybox-title-outside-wrap {
241
+ position: relative;
242
+ margin-top: 10px;
243
+ color: #fff;
244
+ }
245
+
246
+ .fancybox-title-inside-wrap {
247
+ padding-top: 10px;
248
+ }
249
+
250
+ .fancybox-title-over-wrap {
251
+ position: absolute;
252
+ bottom: 0;
253
+ left: 0;
254
+ color: #fff;
255
+ padding: 10px;
256
+ background: #000;
257
+ background: rgba(0, 0, 0, .8);
258
+ }
259
+
260
+ /*Retina graphics!*/
261
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
262
+ only screen and (min--moz-device-pixel-ratio: 1.5),
263
+ only screen and (min-device-pixel-ratio: 1.5){
264
+
265
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
266
+ background-image: url('../../images/reminder/fancybox_sprite@2x.png');
267
+ background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
268
+ }
269
+
270
+ #fancybox-loading div {
271
+ background-image: url('../../images/reminder/fancybox_loading@2x.gif');
272
+ background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
273
+ }
274
+ }
skin/frontend/base/default/images/reminder/blank.gif ADDED
Binary file
skin/frontend/base/default/images/reminder/fancybox_loading.gif ADDED
Binary file
skin/frontend/base/default/images/reminder/fancybox_loading@2x.gif ADDED
Binary file
skin/frontend/base/default/images/reminder/fancybox_overlay.png ADDED
Binary file
skin/frontend/base/default/images/reminder/fancybox_sprite.png ADDED
Binary file
skin/frontend/base/default/images/reminder/fancybox_sprite@2x.png ADDED
Binary file
skin/frontend/base/default/js/reminder/helpers/fancybox_buttons.png ADDED
Binary file
skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-buttons.css ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-buttons {
2
+ position: fixed;
3
+ left: 0;
4
+ width: 100%;
5
+ z-index: 8050;
6
+ }
7
+
8
+ #fancybox-buttons.top {
9
+ top: 10px;
10
+ }
11
+
12
+ #fancybox-buttons.bottom {
13
+ bottom: 10px;
14
+ }
15
+
16
+ #fancybox-buttons ul {
17
+ display: block;
18
+ width: 166px;
19
+ height: 30px;
20
+ margin: 0 auto;
21
+ padding: 0;
22
+ list-style: none;
23
+ border: 1px solid #111;
24
+ border-radius: 3px;
25
+ -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
26
+ -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
27
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
28
+ background: rgb(50,50,50);
29
+ background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%);
30
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51)));
31
+ background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
32
+ background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
33
+ background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
34
+ background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
35
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
36
+ }
37
+
38
+ #fancybox-buttons ul li {
39
+ float: left;
40
+ margin: 0;
41
+ padding: 0;
42
+ }
43
+
44
+ #fancybox-buttons a {
45
+ display: block;
46
+ width: 30px;
47
+ height: 30px;
48
+ text-indent: -9999px;
49
+ background-color: transparent;
50
+ background-image: url('fancybox_buttons.png');
51
+ background-repeat: no-repeat;
52
+ outline: none;
53
+ opacity: 0.8;
54
+ }
55
+
56
+ #fancybox-buttons a:hover {
57
+ opacity: 1;
58
+ }
59
+
60
+ #fancybox-buttons a.btnPrev {
61
+ background-position: 5px 0;
62
+ }
63
+
64
+ #fancybox-buttons a.btnNext {
65
+ background-position: -33px 0;
66
+ border-right: 1px solid #3e3e3e;
67
+ }
68
+
69
+ #fancybox-buttons a.btnPlay {
70
+ background-position: 0 -30px;
71
+ }
72
+
73
+ #fancybox-buttons a.btnPlayOn {
74
+ background-position: -30px -30px;
75
+ }
76
+
77
+ #fancybox-buttons a.btnToggle {
78
+ background-position: 3px -60px;
79
+ border-left: 1px solid #111;
80
+ border-right: 1px solid #3e3e3e;
81
+ width: 35px
82
+ }
83
+
84
+ #fancybox-buttons a.btnToggleOn {
85
+ background-position: -27px -60px;
86
+ }
87
+
88
+ #fancybox-buttons a.btnClose {
89
+ border-left: 1px solid #111;
90
+ width: 35px;
91
+ background-position: -56px 0px;
92
+ }
93
+
94
+ #fancybox-buttons a.btnDisabled {
95
+ opacity : 0.4;
96
+ cursor: default;
97
+ }
skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-buttons.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Buttons helper for fancyBox
3
+ * version: 1.0.5 (Mon, 15 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * buttons: {
10
+ * position : 'top'
11
+ * }
12
+ * }
13
+ * });
14
+ *
15
+ */
16
+ (function ($) {
17
+ //Shortcut for fancyBox object
18
+ var F = $.fancybox;
19
+
20
+ //Add helper object
21
+ F.helpers.buttons = {
22
+ defaults : {
23
+ skipSingle : false, // disables if gallery contains single image
24
+ position : 'top', // 'top' or 'bottom'
25
+ tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
26
+ },
27
+
28
+ list : null,
29
+ buttons: null,
30
+
31
+ beforeLoad: function (opts, obj) {
32
+ //Remove self if gallery do not have at least two items
33
+
34
+ if (opts.skipSingle && obj.group.length < 2) {
35
+ obj.helpers.buttons = false;
36
+ obj.closeBtn = true;
37
+
38
+ return;
39
+ }
40
+
41
+ //Increase top margin to give space for buttons
42
+ obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
43
+ },
44
+
45
+ onPlayStart: function () {
46
+ if (this.buttons) {
47
+ this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
48
+ }
49
+ },
50
+
51
+ onPlayEnd: function () {
52
+ if (this.buttons) {
53
+ this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
54
+ }
55
+ },
56
+
57
+ afterShow: function (opts, obj) {
58
+ var buttons = this.buttons;
59
+
60
+ if (!buttons) {
61
+ this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
62
+
63
+ buttons = {
64
+ prev : this.list.find('.btnPrev').click( F.prev ),
65
+ next : this.list.find('.btnNext').click( F.next ),
66
+ play : this.list.find('.btnPlay').click( F.play ),
67
+ toggle : this.list.find('.btnToggle').click( F.toggle ),
68
+ close : this.list.find('.btnClose').click( F.close )
69
+ }
70
+ }
71
+
72
+ //Prev
73
+ if (obj.index > 0 || obj.loop) {
74
+ buttons.prev.removeClass('btnDisabled');
75
+ } else {
76
+ buttons.prev.addClass('btnDisabled');
77
+ }
78
+
79
+ //Next / Play
80
+ if (obj.loop || obj.index < obj.group.length - 1) {
81
+ buttons.next.removeClass('btnDisabled');
82
+ buttons.play.removeClass('btnDisabled');
83
+
84
+ } else {
85
+ buttons.next.addClass('btnDisabled');
86
+ buttons.play.addClass('btnDisabled');
87
+ }
88
+
89
+ this.buttons = buttons;
90
+
91
+ this.onUpdate(opts, obj);
92
+ },
93
+
94
+ onUpdate: function (opts, obj) {
95
+ var toggle;
96
+
97
+ if (!this.buttons) {
98
+ return;
99
+ }
100
+
101
+ toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
102
+
103
+ //Size toggle button
104
+ if (obj.canShrink) {
105
+ toggle.addClass('btnToggleOn');
106
+
107
+ } else if (!obj.canExpand) {
108
+ toggle.addClass('btnDisabled');
109
+ }
110
+ },
111
+
112
+ beforeClose: function () {
113
+ if (this.list) {
114
+ this.list.remove();
115
+ }
116
+
117
+ this.list = null;
118
+ this.buttons = null;
119
+ }
120
+ };
121
+
122
+ }(jQuery));
skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-media.js ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Media helper for fancyBox
3
+ * version: 1.0.6 (Fri, 14 Jun 2013)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * media: true
10
+ * }
11
+ * });
12
+ *
13
+ * Set custom URL parameters:
14
+ * $(".fancybox").fancybox({
15
+ * helpers : {
16
+ * media: {
17
+ * youtube : {
18
+ * params : {
19
+ * autoplay : 0
20
+ * }
21
+ * }
22
+ * }
23
+ * }
24
+ * });
25
+ *
26
+ * Or:
27
+ * $(".fancybox").fancybox({,
28
+ * helpers : {
29
+ * media: true
30
+ * },
31
+ * youtube : {
32
+ * autoplay: 0
33
+ * }
34
+ * });
35
+ *
36
+ * Supports:
37
+ *
38
+ * Youtube
39
+ * http://www.youtube.com/watch?v=opj24KnzrWo
40
+ * http://www.youtube.com/embed/opj24KnzrWo
41
+ * http://youtu.be/opj24KnzrWo
42
+ * http://www.youtube-nocookie.com/embed/opj24KnzrWo
43
+ * Vimeo
44
+ * http://vimeo.com/40648169
45
+ * http://vimeo.com/channels/staffpicks/38843628
46
+ * http://vimeo.com/groups/surrealism/videos/36516384
47
+ * http://player.vimeo.com/video/45074303
48
+ * Metacafe
49
+ * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
50
+ * http://www.metacafe.com/watch/7635964/
51
+ * Dailymotion
52
+ * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
53
+ * Twitvid
54
+ * http://twitvid.com/QY7MD
55
+ * Twitpic
56
+ * http://twitpic.com/7p93st
57
+ * Instagram
58
+ * http://instagr.am/p/IejkuUGxQn/
59
+ * http://instagram.com/p/IejkuUGxQn/
60
+ * Google maps
61
+ * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
62
+ * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
63
+ * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
64
+ */
65
+ (function ($) {
66
+ "use strict";
67
+
68
+ //Shortcut for fancyBox object
69
+ var F = $.fancybox,
70
+ format = function( url, rez, params ) {
71
+ params = params || '';
72
+
73
+ if ( $.type( params ) === "object" ) {
74
+ params = $.param(params, true);
75
+ }
76
+
77
+ $.each(rez, function(key, value) {
78
+ url = url.replace( '$' + key, value || '' );
79
+ });
80
+
81
+ if (params.length) {
82
+ url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
83
+ }
84
+
85
+ return url;
86
+ };
87
+
88
+ //Add helper object
89
+ F.helpers.media = {
90
+ defaults : {
91
+ youtube : {
92
+ matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
93
+ params : {
94
+ autoplay : 1,
95
+ autohide : 1,
96
+ fs : 1,
97
+ rel : 0,
98
+ hd : 1,
99
+ wmode : 'opaque',
100
+ enablejsapi : 1
101
+ },
102
+ type : 'iframe',
103
+ url : '//www.youtube.com/embed/$3'
104
+ },
105
+ vimeo : {
106
+ matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
107
+ params : {
108
+ autoplay : 1,
109
+ hd : 1,
110
+ show_title : 1,
111
+ show_byline : 1,
112
+ show_portrait : 0,
113
+ fullscreen : 1
114
+ },
115
+ type : 'iframe',
116
+ url : '//player.vimeo.com/video/$1'
117
+ },
118
+ metacafe : {
119
+ matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
120
+ params : {
121
+ autoPlay : 'yes'
122
+ },
123
+ type : 'swf',
124
+ url : function( rez, params, obj ) {
125
+ obj.swf.flashVars = 'playerVars=' + $.param( params, true );
126
+
127
+ return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
128
+ }
129
+ },
130
+ dailymotion : {
131
+ matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
132
+ params : {
133
+ additionalInfos : 0,
134
+ autoStart : 1
135
+ },
136
+ type : 'swf',
137
+ url : '//www.dailymotion.com/swf/video/$1'
138
+ },
139
+ twitvid : {
140
+ matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
141
+ params : {
142
+ autoplay : 0
143
+ },
144
+ type : 'iframe',
145
+ url : '//www.twitvid.com/embed.php?guid=$1'
146
+ },
147
+ twitpic : {
148
+ matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
149
+ type : 'image',
150
+ url : '//twitpic.com/show/full/$1/'
151
+ },
152
+ instagram : {
153
+ matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
154
+ type : 'image',
155
+ url : '//$1/p/$2/media/?size=l'
156
+ },
157
+ google_maps : {
158
+ matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
159
+ type : 'iframe',
160
+ url : function( rez ) {
161
+ return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
162
+ }
163
+ }
164
+ },
165
+
166
+ beforeLoad : function(opts, obj) {
167
+ var url = obj.href || '',
168
+ type = false,
169
+ what,
170
+ item,
171
+ rez,
172
+ params;
173
+
174
+ for (what in opts) {
175
+ if (opts.hasOwnProperty(what)) {
176
+ item = opts[ what ];
177
+ rez = url.match( item.matcher );
178
+
179
+ if (rez) {
180
+ type = item.type;
181
+ params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
182
+
183
+ url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
184
+
185
+ break;
186
+ }
187
+ }
188
+ }
189
+
190
+ if (type) {
191
+ obj.href = url;
192
+ obj.type = type;
193
+
194
+ obj.autoHeight = false;
195
+ }
196
+ }
197
+ };
198
+
199
+ }(jQuery));
skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-thumbs.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-thumbs {
2
+ position: fixed;
3
+ left: 0;
4
+ width: 100%;
5
+ overflow: hidden;
6
+ z-index: 8050;
7
+ }
8
+
9
+ #fancybox-thumbs.bottom {
10
+ bottom: 2px;
11
+ }
12
+
13
+ #fancybox-thumbs.top {
14
+ top: 2px;
15
+ }
16
+
17
+ #fancybox-thumbs ul {
18
+ position: relative;
19
+ list-style: none;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+
24
+ #fancybox-thumbs ul li {
25
+ float: left;
26
+ padding: 1px;
27
+ opacity: 0.5;
28
+ }
29
+
30
+ #fancybox-thumbs ul li.active {
31
+ opacity: 0.75;
32
+ padding: 0;
33
+ border: 1px solid #fff;
34
+ }
35
+
36
+ #fancybox-thumbs ul li:hover {
37
+ opacity: 1;
38
+ }
39
+
40
+ #fancybox-thumbs ul li a {
41
+ display: block;
42
+ position: relative;
43
+ overflow: hidden;
44
+ border: 1px solid #222;
45
+ background: #111;
46
+ outline: none;
47
+ }
48
+
49
+ #fancybox-thumbs ul li img {
50
+ display: block;
51
+ position: relative;
52
+ border: 0;
53
+ padding: 0;
54
+ max-width: none;
55
+ }
skin/frontend/base/default/js/reminder/helpers/jquery.fancybox-thumbs.js ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Thumbnail helper for fancyBox
3
+ * version: 1.0.7 (Mon, 01 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * thumbs: {
10
+ * width : 50,
11
+ * height : 50
12
+ * }
13
+ * }
14
+ * });
15
+ *
16
+ */
17
+ (function ($) {
18
+ //Shortcut for fancyBox object
19
+ var F = $.fancybox;
20
+
21
+ //Add helper object
22
+ F.helpers.thumbs = {
23
+ defaults : {
24
+ width : 50, // thumbnail width
25
+ height : 50, // thumbnail height
26
+ position : 'bottom', // 'top' or 'bottom'
27
+ source : function ( item ) { // function to obtain the URL of the thumbnail image
28
+ var href;
29
+
30
+ if (item.element) {
31
+ href = $(item.element).find('img').attr('src');
32
+ }
33
+
34
+ if (!href && item.type === 'image' && item.href) {
35
+ href = item.href;
36
+ }
37
+
38
+ return href;
39
+ }
40
+ },
41
+
42
+ wrap : null,
43
+ list : null,
44
+ width : 0,
45
+
46
+ init: function (opts, obj) {
47
+ var that = this,
48
+ list,
49
+ thumbWidth = opts.width,
50
+ thumbHeight = opts.height,
51
+ thumbSource = opts.source;
52
+
53
+ //Build list structure
54
+ list = '';
55
+
56
+ for (var n = 0; n < obj.group.length; n++) {
57
+ list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
58
+ }
59
+
60
+ this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
61
+ this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
62
+
63
+ //Load each thumbnail
64
+ $.each(obj.group, function (i) {
65
+ var href = thumbSource( obj.group[ i ] );
66
+
67
+ if (!href) {
68
+ return;
69
+ }
70
+
71
+ $("<img />").load(function () {
72
+ var width = this.width,
73
+ height = this.height,
74
+ widthRatio, heightRatio, parent;
75
+
76
+ if (!that.list || !width || !height) {
77
+ return;
78
+ }
79
+
80
+ //Calculate thumbnail width/height and center it
81
+ widthRatio = width / thumbWidth;
82
+ heightRatio = height / thumbHeight;
83
+
84
+ parent = that.list.children().eq(i).find('a');
85
+
86
+ if (widthRatio >= 1 && heightRatio >= 1) {
87
+ if (widthRatio > heightRatio) {
88
+ width = Math.floor(width / heightRatio);
89
+ height = thumbHeight;
90
+
91
+ } else {
92
+ width = thumbWidth;
93
+ height = Math.floor(height / widthRatio);
94
+ }
95
+ }
96
+
97
+ $(this).css({
98
+ width : width,
99
+ height : height,
100
+ top : Math.floor(thumbHeight / 2 - height / 2),
101
+ left : Math.floor(thumbWidth / 2 - width / 2)
102
+ });
103
+
104
+ parent.width(thumbWidth).height(thumbHeight);
105
+
106
+ $(this).hide().appendTo(parent).fadeIn(300);
107
+
108
+ }).attr('src', href);
109
+ });
110
+
111
+ //Set initial width
112
+ this.width = this.list.children().eq(0).outerWidth(true);
113
+
114
+ this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
115
+ },
116
+
117
+ beforeLoad: function (opts, obj) {
118
+ //Remove self if gallery do not have at least two items
119
+ if (obj.group.length < 2) {
120
+ obj.helpers.thumbs = false;
121
+
122
+ return;
123
+ }
124
+
125
+ //Increase bottom margin to give space for thumbs
126
+ obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
127
+ },
128
+
129
+ afterShow: function (opts, obj) {
130
+ //Check if exists and create or update list
131
+ if (this.list) {
132
+ this.onUpdate(opts, obj);
133
+
134
+ } else {
135
+ this.init(opts, obj);
136
+ }
137
+
138
+ //Set active element
139
+ this.list.children().removeClass('active').eq(obj.index).addClass('active');
140
+ },
141
+
142
+ //Center list
143
+ onUpdate: function (opts, obj) {
144
+ if (this.list) {
145
+ this.list.stop(true).animate({
146
+ 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
147
+ }, 150);
148
+ }
149
+ },
150
+
151
+ beforeClose: function () {
152
+ if (this.wrap) {
153
+ this.wrap.remove();
154
+ }
155
+
156
+ this.wrap = null;
157
+ this.list = null;
158
+ this.width = 0;
159
+ }
160
+ }
161
+
162
+ }(jQuery));
skin/frontend/base/default/js/reminder/jquery.fancybox.js ADDED
@@ -0,0 +1,2020 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * fancyBox - jQuery Plugin
3
+ * version: 2.1.5 (Fri, 14 Jun 2013)
4
+ * @requires jQuery v1.6 or later
5
+ *
6
+ * Examples at http://fancyapps.com/fancybox/
7
+ * License: www.fancyapps.com/fancybox/#license
8
+ *
9
+ * Copyright 2012 Janis Skarnelis - janis@fancyapps.com
10
+ *
11
+ */
12
+
13
+ (function (window, document, $, undefined) {
14
+ "use strict";
15
+
16
+ var H = $("html"),
17
+ W = $(window),
18
+ D = $(document),
19
+ F = $.fancybox = function () {
20
+ F.open.apply( this, arguments );
21
+ },
22
+ IE = navigator.userAgent.match(/msie/i),
23
+ didUpdate = null,
24
+ isTouch = document.createTouch !== undefined,
25
+
26
+ isQuery = function(obj) {
27
+ return obj && obj.hasOwnProperty && obj instanceof $;
28
+ },
29
+ isString = function(str) {
30
+ return str && $.type(str) === "string";
31
+ },
32
+ isPercentage = function(str) {
33
+ return isString(str) && str.indexOf('%') > 0;
34
+ },
35
+ isScrollable = function(el) {
36
+ return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
37
+ },
38
+ getScalar = function(orig, dim) {
39
+ var value = parseInt(orig, 10) || 0;
40
+
41
+ if (dim && isPercentage(orig)) {
42
+ value = F.getViewport()[ dim ] / 100 * value;
43
+ }
44
+
45
+ return Math.ceil(value);
46
+ },
47
+ getValue = function(value, dim) {
48
+ return getScalar(value, dim) + 'px';
49
+ };
50
+
51
+ $.extend(F, {
52
+ // The current version of fancyBox
53
+ version: '2.1.5',
54
+
55
+ defaults: {
56
+ padding : 15,
57
+ margin : 20,
58
+
59
+ width : 800,
60
+ height : 600,
61
+ minWidth : 100,
62
+ minHeight : 100,
63
+ maxWidth : 9999,
64
+ maxHeight : 9999,
65
+ pixelRatio: 1, // Set to 2 for retina display support
66
+
67
+ autoSize : true,
68
+ autoHeight : false,
69
+ autoWidth : false,
70
+
71
+ autoResize : true,
72
+ autoCenter : !isTouch,
73
+ fitToView : true,
74
+ aspectRatio : false,
75
+ topRatio : 0.5,
76
+ leftRatio : 0.5,
77
+
78
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
79
+ wrapCSS : '',
80
+
81
+ arrows : true,
82
+ closeBtn : true,
83
+ closeClick : false,
84
+ nextClick : false,
85
+ mouseWheel : true,
86
+ autoPlay : false,
87
+ playSpeed : 3000,
88
+ preload : 3,
89
+ modal : false,
90
+ loop : true,
91
+
92
+ ajax : {
93
+ dataType : 'html',
94
+ headers : { 'X-fancyBox': true }
95
+ },
96
+ iframe : {
97
+ scrolling : 'auto',
98
+ preload : true
99
+ },
100
+ swf : {
101
+ wmode: 'transparent',
102
+ allowfullscreen : 'true',
103
+ allowscriptaccess : 'always'
104
+ },
105
+
106
+ keys : {
107
+ next : {
108
+ 13 : 'left', // enter
109
+ 34 : 'up', // page down
110
+ 39 : 'left', // right arrow
111
+ 40 : 'up' // down arrow
112
+ },
113
+ prev : {
114
+ 8 : 'right', // backspace
115
+ 33 : 'down', // page up
116
+ 37 : 'right', // left arrow
117
+ 38 : 'down' // up arrow
118
+ },
119
+ close : [27], // escape key
120
+ play : [32], // space - start/stop slideshow
121
+ toggle : [70] // letter "f" - toggle fullscreen
122
+ },
123
+
124
+ direction : {
125
+ next : 'left',
126
+ prev : 'right'
127
+ },
128
+
129
+ scrollOutside : true,
130
+
131
+ // Override some properties
132
+ index : 0,
133
+ type : null,
134
+ href : null,
135
+ content : null,
136
+ title : null,
137
+
138
+ // HTML templates
139
+ tpl: {
140
+ wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
141
+ image : '<img class="fancybox-image" src="{href}" alt="" />',
142
+ iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
143
+ error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
144
+ closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
145
+ next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
146
+ prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
147
+ },
148
+
149
+ // Properties for each animation type
150
+ // Opening fancyBox
151
+ openEffect : 'fade', // 'elastic', 'fade' or 'none'
152
+ openSpeed : 250,
153
+ openEasing : 'swing',
154
+ openOpacity : true,
155
+ openMethod : 'zoomIn',
156
+
157
+ // Closing fancyBox
158
+ closeEffect : 'fade', // 'elastic', 'fade' or 'none'
159
+ closeSpeed : 250,
160
+ closeEasing : 'swing',
161
+ closeOpacity : true,
162
+ closeMethod : 'zoomOut',
163
+
164
+ // Changing next gallery item
165
+ nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
166
+ nextSpeed : 250,
167
+ nextEasing : 'swing',
168
+ nextMethod : 'changeIn',
169
+
170
+ // Changing previous gallery item
171
+ prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
172
+ prevSpeed : 250,
173
+ prevEasing : 'swing',
174
+ prevMethod : 'changeOut',
175
+
176
+ // Enable default helpers
177
+ helpers : {
178
+ overlay : true,
179
+ title : true
180
+ },
181
+
182
+ // Callbacks
183
+ onCancel : $.noop, // If canceling
184
+ beforeLoad : $.noop, // Before loading
185
+ afterLoad : $.noop, // After loading
186
+ beforeShow : $.noop, // Before changing in current item
187
+ afterShow : $.noop, // After opening
188
+ beforeChange : $.noop, // Before changing gallery item
189
+ beforeClose : $.noop, // Before closing
190
+ afterClose : $.noop // After closing
191
+ },
192
+
193
+ //Current state
194
+ group : {}, // Selected group
195
+ opts : {}, // Group options
196
+ previous : null, // Previous element
197
+ coming : null, // Element being loaded
198
+ current : null, // Currently loaded element
199
+ isActive : false, // Is activated
200
+ isOpen : false, // Is currently open
201
+ isOpened : false, // Have been fully opened at least once
202
+
203
+ wrap : null,
204
+ skin : null,
205
+ outer : null,
206
+ inner : null,
207
+
208
+ player : {
209
+ timer : null,
210
+ isActive : false
211
+ },
212
+
213
+ // Loaders
214
+ ajaxLoad : null,
215
+ imgPreload : null,
216
+
217
+ // Some collections
218
+ transitions : {},
219
+ helpers : {},
220
+
221
+ /*
222
+ * Static methods
223
+ */
224
+
225
+ open: function (group, opts) {
226
+ if (!group) {
227
+ return;
228
+ }
229
+
230
+ if (!$.isPlainObject(opts)) {
231
+ opts = {};
232
+ }
233
+
234
+ // Close if already active
235
+ if (false === F.close(true)) {
236
+ return;
237
+ }
238
+
239
+ // Normalize group
240
+ if (!$.isArray(group)) {
241
+ group = isQuery(group) ? $(group).get() : [group];
242
+ }
243
+
244
+ // Recheck if the type of each element is `object` and set content type (image, ajax, etc)
245
+ $.each(group, function(i, element) {
246
+ var obj = {},
247
+ href,
248
+ title,
249
+ content,
250
+ type,
251
+ rez,
252
+ hrefParts,
253
+ selector;
254
+
255
+ if ($.type(element) === "object") {
256
+ // Check if is DOM element
257
+ if (element.nodeType) {
258
+ element = $(element);
259
+ }
260
+
261
+ if (isQuery(element)) {
262
+ obj = {
263
+ href : element.data('fancybox-href') || element.attr('href'),
264
+ title : element.data('fancybox-title') || element.attr('title'),
265
+ isDom : true,
266
+ element : element
267
+ };
268
+
269
+ if ($.metadata) {
270
+ $.extend(true, obj, element.metadata());
271
+ }
272
+
273
+ } else {
274
+ obj = element;
275
+ }
276
+ }
277
+
278
+ href = opts.href || obj.href || (isString(element) ? element : null);
279
+ title = opts.title !== undefined ? opts.title : obj.title || '';
280
+
281
+ content = opts.content || obj.content;
282
+ type = content ? 'html' : (opts.type || obj.type);
283
+
284
+ if (!type && obj.isDom) {
285
+ type = element.data('fancybox-type');
286
+
287
+ if (!type) {
288
+ rez = element.prop('class').match(/fancybox\.(\w+)/);
289
+ type = rez ? rez[1] : null;
290
+ }
291
+ }
292
+
293
+ if (isString(href)) {
294
+ // Try to guess the content type
295
+ if (!type) {
296
+ if (F.isImage(href)) {
297
+ type = 'image';
298
+
299
+ } else if (F.isSWF(href)) {
300
+ type = 'swf';
301
+
302
+ } else if (href.charAt(0) === '#') {
303
+ type = 'inline';
304
+
305
+ } else if (isString(element)) {
306
+ type = 'html';
307
+ content = element;
308
+ }
309
+ }
310
+
311
+ // Split url into two pieces with source url and content selector, e.g,
312
+ // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
313
+ if (type === 'ajax') {
314
+ hrefParts = href.split(/\s+/, 2);
315
+ href = hrefParts.shift();
316
+ selector = hrefParts.shift();
317
+ }
318
+ }
319
+
320
+ if (!content) {
321
+ if (type === 'inline') {
322
+ if (href) {
323
+ content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
324
+
325
+ } else if (obj.isDom) {
326
+ content = element;
327
+ }
328
+
329
+ } else if (type === 'html') {
330
+ content = href;
331
+
332
+ } else if (!type && !href && obj.isDom) {
333
+ type = 'inline';
334
+ content = element;
335
+ }
336
+ }
337
+
338
+ $.extend(obj, {
339
+ href : href,
340
+ type : type,
341
+ content : content,
342
+ title : title,
343
+ selector : selector
344
+ });
345
+
346
+ group[ i ] = obj;
347
+ });
348
+
349
+ // Extend the defaults
350
+ F.opts = $.extend(true, {}, F.defaults, opts);
351
+
352
+ // All options are merged recursive except keys
353
+ if (opts.keys !== undefined) {
354
+ F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
355
+ }
356
+
357
+ F.group = group;
358
+
359
+ return F._start(F.opts.index);
360
+ },
361
+
362
+ // Cancel image loading or abort ajax request
363
+ cancel: function () {
364
+ var coming = F.coming;
365
+
366
+ if (!coming || false === F.trigger('onCancel')) {
367
+ return;
368
+ }
369
+
370
+ F.hideLoading();
371
+
372
+ if (F.ajaxLoad) {
373
+ F.ajaxLoad.abort();
374
+ }
375
+
376
+ F.ajaxLoad = null;
377
+
378
+ if (F.imgPreload) {
379
+ F.imgPreload.onload = F.imgPreload.onerror = null;
380
+ }
381
+
382
+ if (coming.wrap) {
383
+ coming.wrap.stop(true, true).trigger('onReset').remove();
384
+ }
385
+
386
+ F.coming = null;
387
+
388
+ // If the first item has been canceled, then clear everything
389
+ if (!F.current) {
390
+ F._afterZoomOut( coming );
391
+ }
392
+ },
393
+
394
+ // Start closing animation if is open; remove immediately if opening/closing
395
+ close: function (event) {
396
+ F.cancel();
397
+
398
+ if (false === F.trigger('beforeClose')) {
399
+ return;
400
+ }
401
+
402
+ F.unbindEvents();
403
+
404
+ if (!F.isActive) {
405
+ return;
406
+ }
407
+
408
+ if (!F.isOpen || event === true) {
409
+ $('.fancybox-wrap').stop(true).trigger('onReset').remove();
410
+
411
+ F._afterZoomOut();
412
+
413
+ } else {
414
+ F.isOpen = F.isOpened = false;
415
+ F.isClosing = true;
416
+
417
+ $('.fancybox-item, .fancybox-nav').remove();
418
+
419
+ F.wrap.stop(true, true).removeClass('fancybox-opened');
420
+
421
+ F.transitions[ F.current.closeMethod ]();
422
+ }
423
+ },
424
+
425
+ // Manage slideshow:
426
+ // $.fancybox.play(); - toggle slideshow
427
+ // $.fancybox.play( true ); - start
428
+ // $.fancybox.play( false ); - stop
429
+ play: function ( action ) {
430
+ var clear = function () {
431
+ clearTimeout(F.player.timer);
432
+ },
433
+ set = function () {
434
+ clear();
435
+
436
+ if (F.current && F.player.isActive) {
437
+ F.player.timer = setTimeout(F.next, F.current.playSpeed);
438
+ }
439
+ },
440
+ stop = function () {
441
+ clear();
442
+
443
+ D.unbind('.player');
444
+
445
+ F.player.isActive = false;
446
+
447
+ F.trigger('onPlayEnd');
448
+ },
449
+ start = function () {
450
+ if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
451
+ F.player.isActive = true;
452
+
453
+ D.bind({
454
+ 'onCancel.player beforeClose.player' : stop,
455
+ 'onUpdate.player' : set,
456
+ 'beforeLoad.player' : clear
457
+ });
458
+
459
+ set();
460
+
461
+ F.trigger('onPlayStart');
462
+ }
463
+ };
464
+
465
+ if (action === true || (!F.player.isActive && action !== false)) {
466
+ start();
467
+ } else {
468
+ stop();
469
+ }
470
+ },
471
+
472
+ // Navigate to next gallery item
473
+ next: function ( direction ) {
474
+ var current = F.current;
475
+
476
+ if (current) {
477
+ if (!isString(direction)) {
478
+ direction = current.direction.next;
479
+ }
480
+
481
+ F.jumpto(current.index + 1, direction, 'next');
482
+ }
483
+ },
484
+
485
+ // Navigate to previous gallery item
486
+ prev: function ( direction ) {
487
+ var current = F.current;
488
+
489
+ if (current) {
490
+ if (!isString(direction)) {
491
+ direction = current.direction.prev;
492
+ }
493
+
494
+ F.jumpto(current.index - 1, direction, 'prev');
495
+ }
496
+ },
497
+
498
+ // Navigate to gallery item by index
499
+ jumpto: function ( index, direction, router ) {
500
+ var current = F.current;
501
+
502
+ if (!current) {
503
+ return;
504
+ }
505
+
506
+ index = getScalar(index);
507
+
508
+ F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
509
+ F.router = router || 'jumpto';
510
+
511
+ if (current.loop) {
512
+ if (index < 0) {
513
+ index = current.group.length + (index % current.group.length);
514
+ }
515
+
516
+ index = index % current.group.length;
517
+ }
518
+
519
+ if (current.group[ index ] !== undefined) {
520
+ F.cancel();
521
+
522
+ F._start(index);
523
+ }
524
+ },
525
+
526
+ // Center inside viewport and toggle position type to fixed or absolute if needed
527
+ reposition: function (e, onlyAbsolute) {
528
+ var current = F.current,
529
+ wrap = current ? current.wrap : null,
530
+ pos;
531
+
532
+ if (wrap) {
533
+ pos = F._getPosition(onlyAbsolute);
534
+
535
+ if (e && e.type === 'scroll') {
536
+ delete pos.position;
537
+
538
+ wrap.stop(true, true).animate(pos, 200);
539
+
540
+ } else {
541
+ wrap.css(pos);
542
+
543
+ current.pos = $.extend({}, current.dim, pos);
544
+ }
545
+ }
546
+ },
547
+
548
+ update: function (e) {
549
+ var type = (e && e.type),
550
+ anyway = !type || type === 'orientationchange';
551
+
552
+ if (anyway) {
553
+ clearTimeout(didUpdate);
554
+
555
+ didUpdate = null;
556
+ }
557
+
558
+ if (!F.isOpen || didUpdate) {
559
+ return;
560
+ }
561
+
562
+ didUpdate = setTimeout(function() {
563
+ var current = F.current;
564
+
565
+ if (!current || F.isClosing) {
566
+ return;
567
+ }
568
+
569
+ F.wrap.removeClass('fancybox-tmp');
570
+
571
+ if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
572
+ F._setDimension();
573
+ }
574
+
575
+ if (!(type === 'scroll' && current.canShrink)) {
576
+ F.reposition(e);
577
+ }
578
+
579
+ F.trigger('onUpdate');
580
+
581
+ didUpdate = null;
582
+
583
+ }, (anyway && !isTouch ? 0 : 300));
584
+ },
585
+
586
+ // Shrink content to fit inside viewport or restore if resized
587
+ toggle: function ( action ) {
588
+ if (F.isOpen) {
589
+ F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
590
+
591
+ // Help browser to restore document dimensions
592
+ if (isTouch) {
593
+ F.wrap.removeAttr('style').addClass('fancybox-tmp');
594
+
595
+ F.trigger('onUpdate');
596
+ }
597
+
598
+ F.update();
599
+ }
600
+ },
601
+
602
+ hideLoading: function () {
603
+ D.unbind('.loading');
604
+
605
+ $('#fancybox-loading').remove();
606
+ },
607
+
608
+ showLoading: function () {
609
+ var el, viewport;
610
+
611
+ F.hideLoading();
612
+
613
+ el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
614
+
615
+ // If user will press the escape-button, the request will be canceled
616
+ D.bind('keydown.loading', function(e) {
617
+ if ((e.which || e.keyCode) === 27) {
618
+ e.preventDefault();
619
+
620
+ F.cancel();
621
+ }
622
+ });
623
+
624
+ if (!F.defaults.fixed) {
625
+ viewport = F.getViewport();
626
+
627
+ el.css({
628
+ position : 'absolute',
629
+ top : (viewport.h * 0.5) + viewport.y,
630
+ left : (viewport.w * 0.5) + viewport.x
631
+ });
632
+ }
633
+ },
634
+
635
+ getViewport: function () {
636
+ var locked = (F.current && F.current.locked) || false,
637
+ rez = {
638
+ x: W.scrollLeft(),
639
+ y: W.scrollTop()
640
+ };
641
+
642
+ if (locked) {
643
+ rez.w = locked[0].clientWidth;
644
+ rez.h = locked[0].clientHeight;
645
+
646
+ } else {
647
+ // See http://bugs.jquery.com/ticket/6724
648
+ rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
649
+ rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
650
+ }
651
+
652
+ return rez;
653
+ },
654
+
655
+ // Unbind the keyboard / clicking actions
656
+ unbindEvents: function () {
657
+ if (F.wrap && isQuery(F.wrap)) {
658
+ F.wrap.unbind('.fb');
659
+ }
660
+
661
+ D.unbind('.fb');
662
+ W.unbind('.fb');
663
+ },
664
+
665
+ bindEvents: function () {
666
+ var current = F.current,
667
+ keys;
668
+
669
+ if (!current) {
670
+ return;
671
+ }
672
+
673
+ // Changing document height on iOS devices triggers a 'resize' event,
674
+ // that can change document height... repeating infinitely
675
+ W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
676
+
677
+ keys = current.keys;
678
+
679
+ if (keys) {
680
+ D.bind('keydown.fb', function (e) {
681
+ var code = e.which || e.keyCode,
682
+ target = e.target || e.srcElement;
683
+
684
+ // Skip esc key if loading, because showLoading will cancel preloading
685
+ if (code === 27 && F.coming) {
686
+ return false;
687
+ }
688
+
689
+ // Ignore key combinations and key events within form elements
690
+ if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
691
+ $.each(keys, function(i, val) {
692
+ if (current.group.length > 1 && val[ code ] !== undefined) {
693
+ F[ i ]( val[ code ] );
694
+
695
+ e.preventDefault();
696
+ return false;
697
+ }
698
+
699
+ if ($.inArray(code, val) > -1) {
700
+ F[ i ] ();
701
+
702
+ e.preventDefault();
703
+ return false;
704
+ }
705
+ });
706
+ }
707
+ });
708
+ }
709
+
710
+ if ($.fn.mousewheel && current.mouseWheel) {
711
+ F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
712
+ var target = e.target || null,
713
+ parent = $(target),
714
+ canScroll = false;
715
+
716
+ while (parent.length) {
717
+ if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
718
+ break;
719
+ }
720
+
721
+ canScroll = isScrollable( parent[0] );
722
+ parent = $(parent).parent();
723
+ }
724
+
725
+ if (delta !== 0 && !canScroll) {
726
+ if (F.group.length > 1 && !current.canShrink) {
727
+ if (deltaY > 0 || deltaX > 0) {
728
+ F.prev( deltaY > 0 ? 'down' : 'left' );
729
+
730
+ } else if (deltaY < 0 || deltaX < 0) {
731
+ F.next( deltaY < 0 ? 'up' : 'right' );
732
+ }
733
+
734
+ e.preventDefault();
735
+ }
736
+ }
737
+ });
738
+ }
739
+ },
740
+
741
+ trigger: function (event, o) {
742
+ var ret, obj = o || F.coming || F.current;
743
+
744
+ if (!obj) {
745
+ return;
746
+ }
747
+
748
+ if ($.isFunction( obj[event] )) {
749
+ ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
750
+ }
751
+
752
+ if (ret === false) {
753
+ return false;
754
+ }
755
+
756
+ if (obj.helpers) {
757
+ $.each(obj.helpers, function (helper, opts) {
758
+ if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
759
+ F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
760
+ }
761
+ });
762
+ }
763
+
764
+ D.trigger(event);
765
+ },
766
+
767
+ isImage: function (str) {
768
+ return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
769
+ },
770
+
771
+ isSWF: function (str) {
772
+ return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
773
+ },
774
+
775
+ _start: function (index) {
776
+ var coming = {},
777
+ obj,
778
+ href,
779
+ type,
780
+ margin,
781
+ padding;
782
+
783
+ index = getScalar( index );
784
+ obj = F.group[ index ] || null;
785
+
786
+ if (!obj) {
787
+ return false;
788
+ }
789
+
790
+ coming = $.extend(true, {}, F.opts, obj);
791
+
792
+ // Convert margin and padding properties to array - top, right, bottom, left
793
+ margin = coming.margin;
794
+ padding = coming.padding;
795
+
796
+ if ($.type(margin) === 'number') {
797
+ coming.margin = [margin, margin, margin, margin];
798
+ }
799
+
800
+ if ($.type(padding) === 'number') {
801
+ coming.padding = [padding, padding, padding, padding];
802
+ }
803
+
804
+ // 'modal' propery is just a shortcut
805
+ if (coming.modal) {
806
+ $.extend(true, coming, {
807
+ closeBtn : false,
808
+ closeClick : false,
809
+ nextClick : false,
810
+ arrows : false,
811
+ mouseWheel : false,
812
+ keys : null,
813
+ helpers: {
814
+ overlay : {
815
+ closeClick : false
816
+ }
817
+ }
818
+ });
819
+ }
820
+
821
+ // 'autoSize' property is a shortcut, too
822
+ if (coming.autoSize) {
823
+ coming.autoWidth = coming.autoHeight = true;
824
+ }
825
+
826
+ if (coming.width === 'auto') {
827
+ coming.autoWidth = true;
828
+ }
829
+
830
+ if (coming.height === 'auto') {
831
+ coming.autoHeight = true;
832
+ }
833
+
834
+ /*
835
+ * Add reference to the group, so it`s possible to access from callbacks, example:
836
+ * afterLoad : function() {
837
+ * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
838
+ * }
839
+ */
840
+
841
+ coming.group = F.group;
842
+ coming.index = index;
843
+
844
+ // Give a chance for callback or helpers to update coming item (type, title, etc)
845
+ F.coming = coming;
846
+
847
+ if (false === F.trigger('beforeLoad')) {
848
+ F.coming = null;
849
+
850
+ return;
851
+ }
852
+
853
+ type = coming.type;
854
+ href = coming.href;
855
+
856
+ if (!type) {
857
+ F.coming = null;
858
+
859
+ //If we can not determine content type then drop silently or display next/prev item if looping through gallery
860
+ if (F.current && F.router && F.router !== 'jumpto') {
861
+ F.current.index = index;
862
+
863
+ return F[ F.router ]( F.direction );
864
+ }
865
+
866
+ return false;
867
+ }
868
+
869
+ F.isActive = true;
870
+
871
+ if (type === 'image' || type === 'swf') {
872
+ coming.autoHeight = coming.autoWidth = false;
873
+ coming.scrolling = 'visible';
874
+ }
875
+
876
+ if (type === 'image') {
877
+ coming.aspectRatio = true;
878
+ }
879
+
880
+ if (type === 'iframe' && isTouch) {
881
+ coming.scrolling = 'scroll';
882
+ }
883
+
884
+ // Build the neccessary markup
885
+ coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
886
+
887
+ $.extend(coming, {
888
+ skin : $('.fancybox-skin', coming.wrap),
889
+ outer : $('.fancybox-outer', coming.wrap),
890
+ inner : $('.fancybox-inner', coming.wrap)
891
+ });
892
+
893
+ $.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
894
+ coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
895
+ });
896
+
897
+ F.trigger('onReady');
898
+
899
+ // Check before try to load; 'inline' and 'html' types need content, others - href
900
+ if (type === 'inline' || type === 'html') {
901
+ if (!coming.content || !coming.content.length) {
902
+ return F._error( 'content' );
903
+ }
904
+
905
+ } else if (!href) {
906
+ return F._error( 'href' );
907
+ }
908
+
909
+ if (type === 'image') {
910
+ F._loadImage();
911
+
912
+ } else if (type === 'ajax') {
913
+ F._loadAjax();
914
+
915
+ } else if (type === 'iframe') {
916
+ F._loadIframe();
917
+
918
+ } else {
919
+ F._afterLoad();
920
+ }
921
+ },
922
+
923
+ _error: function ( type ) {
924
+ $.extend(F.coming, {
925
+ type : 'html',
926
+ autoWidth : true,
927
+ autoHeight : true,
928
+ minWidth : 0,
929
+ minHeight : 0,
930
+ scrolling : 'no',
931
+ hasError : type,
932
+ content : F.coming.tpl.error
933
+ });
934
+
935
+ F._afterLoad();
936
+ },
937
+
938
+ _loadImage: function () {
939
+ // Reset preload image so it is later possible to check "complete" property
940
+ var img = F.imgPreload = new Image();
941
+
942
+ img.onload = function () {
943
+ this.onload = this.onerror = null;
944
+
945
+ F.coming.width = this.width / F.opts.pixelRatio;
946
+ F.coming.height = this.height / F.opts.pixelRatio;
947
+
948
+ F._afterLoad();
949
+ };
950
+
951
+ img.onerror = function () {
952
+ this.onload = this.onerror = null;
953
+
954
+ F._error( 'image' );
955
+ };
956
+
957
+ img.src = F.coming.href;
958
+
959
+ if (img.complete !== true) {
960
+ F.showLoading();
961
+ }
962
+ },
963
+
964
+ _loadAjax: function () {
965
+ var coming = F.coming;
966
+
967
+ F.showLoading();
968
+
969
+ F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
970
+ url: coming.href,
971
+ error: function (jqXHR, textStatus) {
972
+ if (F.coming && textStatus !== 'abort') {
973
+ F._error( 'ajax', jqXHR );
974
+
975
+ } else {
976
+ F.hideLoading();
977
+ }
978
+ },
979
+ success: function (data, textStatus) {
980
+ if (textStatus === 'success') {
981
+ coming.content = data;
982
+
983
+ F._afterLoad();
984
+ }
985
+ }
986
+ }));
987
+ },
988
+
989
+ _loadIframe: function() {
990
+ var coming = F.coming,
991
+ iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
992
+ .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
993
+ .attr('src', coming.href);
994
+
995
+ // This helps IE
996
+ $(coming.wrap).bind('onReset', function () {
997
+ try {
998
+ $(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
999
+ } catch (e) {}
1000
+ });
1001
+
1002
+ if (coming.iframe.preload) {
1003
+ F.showLoading();
1004
+
1005
+ iframe.one('load', function() {
1006
+ $(this).data('ready', 1);
1007
+
1008
+ // iOS will lose scrolling if we resize
1009
+ if (!isTouch) {
1010
+ $(this).bind('load.fb', F.update);
1011
+ }
1012
+
1013
+ // Without this trick:
1014
+ // - iframe won't scroll on iOS devices
1015
+ // - IE7 sometimes displays empty iframe
1016
+ $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
1017
+
1018
+ F._afterLoad();
1019
+ });
1020
+ }
1021
+
1022
+ coming.content = iframe.appendTo( coming.inner );
1023
+
1024
+ if (!coming.iframe.preload) {
1025
+ F._afterLoad();
1026
+ }
1027
+ },
1028
+
1029
+ _preloadImages: function() {
1030
+ var group = F.group,
1031
+ current = F.current,
1032
+ len = group.length,
1033
+ cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
1034
+ item,
1035
+ i;
1036
+
1037
+ for (i = 1; i <= cnt; i += 1) {
1038
+ item = group[ (current.index + i ) % len ];
1039
+
1040
+ if (item.type === 'image' && item.href) {
1041
+ new Image().src = item.href;
1042
+ }
1043
+ }
1044
+ },
1045
+
1046
+ _afterLoad: function () {
1047
+ var coming = F.coming,
1048
+ previous = F.current,
1049
+ placeholder = 'fancybox-placeholder',
1050
+ current,
1051
+ content,
1052
+ type,
1053
+ scrolling,
1054
+ href,
1055
+ embed;
1056
+
1057
+ F.hideLoading();
1058
+
1059
+ if (!coming || F.isActive === false) {
1060
+ return;
1061
+ }
1062
+
1063
+ if (false === F.trigger('afterLoad', coming, previous)) {
1064
+ coming.wrap.stop(true).trigger('onReset').remove();
1065
+
1066
+ F.coming = null;
1067
+
1068
+ return;
1069
+ }
1070
+
1071
+ if (previous) {
1072
+ F.trigger('beforeChange', previous);
1073
+
1074
+ previous.wrap.stop(true).removeClass('fancybox-opened')
1075
+ .find('.fancybox-item, .fancybox-nav')
1076
+ .remove();
1077
+ }
1078
+
1079
+ F.unbindEvents();
1080
+
1081
+ current = coming;
1082
+ content = coming.content;
1083
+ type = coming.type;
1084
+ scrolling = coming.scrolling;
1085
+
1086
+ $.extend(F, {
1087
+ wrap : current.wrap,
1088
+ skin : current.skin,
1089
+ outer : current.outer,
1090
+ inner : current.inner,
1091
+ current : current,
1092
+ previous : previous
1093
+ });
1094
+
1095
+ href = current.href;
1096
+
1097
+ switch (type) {
1098
+ case 'inline':
1099
+ case 'ajax':
1100
+ case 'html':
1101
+ if (current.selector) {
1102
+ content = $('<div>').html(content).find(current.selector);
1103
+
1104
+ } else if (isQuery(content)) {
1105
+ if (!content.data(placeholder)) {
1106
+ content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
1107
+ }
1108
+
1109
+ content = content.show().detach();
1110
+
1111
+ current.wrap.bind('onReset', function () {
1112
+ if ($(this).find(content).length) {
1113
+ content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
1114
+ }
1115
+ });
1116
+ }
1117
+ break;
1118
+
1119
+ case 'image':
1120
+ content = current.tpl.image.replace('{href}', href);
1121
+ break;
1122
+
1123
+ case 'swf':
1124
+ content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
1125
+ embed = '';
1126
+
1127
+ $.each(current.swf, function(name, val) {
1128
+ content += '<param name="' + name + '" value="' + val + '"></param>';
1129
+ embed += ' ' + name + '="' + val + '"';
1130
+ });
1131
+
1132
+ content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
1133
+ break;
1134
+ }
1135
+
1136
+ if (!(isQuery(content) && content.parent().is(current.inner))) {
1137
+ current.inner.append( content );
1138
+ }
1139
+
1140
+ // Give a chance for helpers or callbacks to update elements
1141
+ F.trigger('beforeShow');
1142
+
1143
+ // Set scrolling before calculating dimensions
1144
+ current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
1145
+
1146
+ // Set initial dimensions and start position
1147
+ F._setDimension();
1148
+
1149
+ F.reposition();
1150
+
1151
+ F.isOpen = false;
1152
+ F.coming = null;
1153
+
1154
+ F.bindEvents();
1155
+
1156
+ if (!F.isOpened) {
1157
+ $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
1158
+
1159
+ } else if (previous.prevMethod) {
1160
+ F.transitions[ previous.prevMethod ]();
1161
+ }
1162
+
1163
+ F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
1164
+
1165
+ F._preloadImages();
1166
+ },
1167
+
1168
+ _setDimension: function () {
1169
+ var viewport = F.getViewport(),
1170
+ steps = 0,
1171
+ canShrink = false,
1172
+ canExpand = false,
1173
+ wrap = F.wrap,
1174
+ skin = F.skin,
1175
+ inner = F.inner,
1176
+ current = F.current,
1177
+ width = current.width,
1178
+ height = current.height,
1179
+ minWidth = current.minWidth,
1180
+ minHeight = current.minHeight,
1181
+ maxWidth = current.maxWidth,
1182
+ maxHeight = current.maxHeight,
1183
+ scrolling = current.scrolling,
1184
+ scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
1185
+ margin = current.margin,
1186
+ wMargin = getScalar(margin[1] + margin[3]),
1187
+ hMargin = getScalar(margin[0] + margin[2]),
1188
+ wPadding,
1189
+ hPadding,
1190
+ wSpace,
1191
+ hSpace,
1192
+ origWidth,
1193
+ origHeight,
1194
+ origMaxWidth,
1195
+ origMaxHeight,
1196
+ ratio,
1197
+ width_,
1198
+ height_,
1199
+ maxWidth_,
1200
+ maxHeight_,
1201
+ iframe,
1202
+ body;
1203
+
1204
+ // Reset dimensions so we could re-check actual size
1205
+ wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
1206
+
1207
+ wPadding = getScalar(skin.outerWidth(true) - skin.width());
1208
+ hPadding = getScalar(skin.outerHeight(true) - skin.height());
1209
+
1210
+ // Any space between content and viewport (margin, padding, border, title)
1211
+ wSpace = wMargin + wPadding;
1212
+ hSpace = hMargin + hPadding;
1213
+
1214
+ origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
1215
+ origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
1216
+
1217
+ if (current.type === 'iframe') {
1218
+ iframe = current.content;
1219
+
1220
+ if (current.autoHeight && iframe.data('ready') === 1) {
1221
+ try {
1222
+ if (iframe[0].contentWindow.document.location) {
1223
+ inner.width( origWidth ).height(9999);
1224
+
1225
+ body = iframe.contents().find('body');
1226
+
1227
+ if (scrollOut) {
1228
+ body.css('overflow-x', 'hidden');
1229
+ }
1230
+
1231
+ origHeight = body.outerHeight(true);
1232
+ }
1233
+
1234
+ } catch (e) {}
1235
+ }
1236
+
1237
+ } else if (current.autoWidth || current.autoHeight) {
1238
+ inner.addClass( 'fancybox-tmp' );
1239
+
1240
+ // Set width or height in case we need to calculate only one dimension
1241
+ if (!current.autoWidth) {
1242
+ inner.width( origWidth );
1243
+ }
1244
+
1245
+ if (!current.autoHeight) {
1246
+ inner.height( origHeight );
1247
+ }
1248
+
1249
+ if (current.autoWidth) {
1250
+ origWidth = inner.width();
1251
+ }
1252
+
1253
+ if (current.autoHeight) {
1254
+ origHeight = inner.height();
1255
+ }
1256
+
1257
+ inner.removeClass( 'fancybox-tmp' );
1258
+ }
1259
+
1260
+ width = getScalar( origWidth );
1261
+ height = getScalar( origHeight );
1262
+
1263
+ ratio = origWidth / origHeight;
1264
+
1265
+ // Calculations for the content
1266
+ minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
1267
+ maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
1268
+
1269
+ minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
1270
+ maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
1271
+
1272
+ // These will be used to determine if wrap can fit in the viewport
1273
+ origMaxWidth = maxWidth;
1274
+ origMaxHeight = maxHeight;
1275
+
1276
+ if (current.fitToView) {
1277
+ maxWidth = Math.min(viewport.w - wSpace, maxWidth);
1278
+ maxHeight = Math.min(viewport.h - hSpace, maxHeight);
1279
+ }
1280
+
1281
+ maxWidth_ = viewport.w - wMargin;
1282
+ maxHeight_ = viewport.h - hMargin;
1283
+
1284
+ if (current.aspectRatio) {
1285
+ if (width > maxWidth) {
1286
+ width = maxWidth;
1287
+ height = getScalar(width / ratio);
1288
+ }
1289
+
1290
+ if (height > maxHeight) {
1291
+ height = maxHeight;
1292
+ width = getScalar(height * ratio);
1293
+ }
1294
+
1295
+ if (width < minWidth) {
1296
+ width = minWidth;
1297
+ height = getScalar(width / ratio);
1298
+ }
1299
+
1300
+ if (height < minHeight) {
1301
+ height = minHeight;
1302
+ width = getScalar(height * ratio);
1303
+ }
1304
+
1305
+ } else {
1306
+ width = Math.max(minWidth, Math.min(width, maxWidth));
1307
+
1308
+ if (current.autoHeight && current.type !== 'iframe') {
1309
+ inner.width( width );
1310
+
1311
+ height = inner.height();
1312
+ }
1313
+
1314
+ height = Math.max(minHeight, Math.min(height, maxHeight));
1315
+ }
1316
+
1317
+ // Try to fit inside viewport (including the title)
1318
+ if (current.fitToView) {
1319
+ inner.width( width ).height( height );
1320
+
1321
+ wrap.width( width + wPadding );
1322
+
1323
+ // Real wrap dimensions
1324
+ width_ = wrap.width();
1325
+ height_ = wrap.height();
1326
+
1327
+ if (current.aspectRatio) {
1328
+ while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
1329
+ if (steps++ > 19) {
1330
+ break;
1331
+ }
1332
+
1333
+ height = Math.max(minHeight, Math.min(maxHeight, height - 10));
1334
+ width = getScalar(height * ratio);
1335
+
1336
+ if (width < minWidth) {
1337
+ width = minWidth;
1338
+ height = getScalar(width / ratio);
1339
+ }
1340
+
1341
+ if (width > maxWidth) {
1342
+ width = maxWidth;
1343
+ height = getScalar(width / ratio);
1344
+ }
1345
+
1346
+ inner.width( width ).height( height );
1347
+
1348
+ wrap.width( width + wPadding );
1349
+
1350
+ width_ = wrap.width();
1351
+ height_ = wrap.height();
1352
+ }
1353
+
1354
+ } else {
1355
+ width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
1356
+ height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
1357
+ }
1358
+ }
1359
+
1360
+ if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
1361
+ width += scrollOut;
1362
+ }
1363
+
1364
+ inner.width( width ).height( height );
1365
+
1366
+ wrap.width( width + wPadding );
1367
+
1368
+ width_ = wrap.width();
1369
+ height_ = wrap.height();
1370
+
1371
+ canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
1372
+ canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
1373
+
1374
+ $.extend(current, {
1375
+ dim : {
1376
+ width : getValue( width_ ),
1377
+ height : getValue( height_ )
1378
+ },
1379
+ origWidth : origWidth,
1380
+ origHeight : origHeight,
1381
+ canShrink : canShrink,
1382
+ canExpand : canExpand,
1383
+ wPadding : wPadding,
1384
+ hPadding : hPadding,
1385
+ wrapSpace : height_ - skin.outerHeight(true),
1386
+ skinSpace : skin.height() - height
1387
+ });
1388
+
1389
+ if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
1390
+ inner.height('auto');
1391
+ }
1392
+ },
1393
+
1394
+ _getPosition: function (onlyAbsolute) {
1395
+ var current = F.current,
1396
+ viewport = F.getViewport(),
1397
+ margin = current.margin,
1398
+ width = F.wrap.width() + margin[1] + margin[3],
1399
+ height = F.wrap.height() + margin[0] + margin[2],
1400
+ rez = {
1401
+ position: 'absolute',
1402
+ top : margin[0],
1403
+ left : margin[3]
1404
+ };
1405
+
1406
+ if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
1407
+ rez.position = 'fixed';
1408
+
1409
+ } else if (!current.locked) {
1410
+ rez.top += viewport.y;
1411
+ rez.left += viewport.x;
1412
+ }
1413
+
1414
+ rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
1415
+ rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
1416
+
1417
+ return rez;
1418
+ },
1419
+
1420
+ _afterZoomIn: function () {
1421
+ var current = F.current;
1422
+
1423
+ if (!current) {
1424
+ return;
1425
+ }
1426
+
1427
+ F.isOpen = F.isOpened = true;
1428
+
1429
+ F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
1430
+
1431
+ F.update();
1432
+
1433
+ // Assign a click event
1434
+ if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
1435
+ F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
1436
+ if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
1437
+ e.preventDefault();
1438
+
1439
+ F[ current.closeClick ? 'close' : 'next' ]();
1440
+ }
1441
+ });
1442
+ }
1443
+
1444
+ // Create a close button
1445
+ if (current.closeBtn) {
1446
+ $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
1447
+ e.preventDefault();
1448
+
1449
+ F.close();
1450
+ });
1451
+ }
1452
+
1453
+ // Create navigation arrows
1454
+ if (current.arrows && F.group.length > 1) {
1455
+ if (current.loop || current.index > 0) {
1456
+ $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
1457
+ }
1458
+
1459
+ if (current.loop || current.index < F.group.length - 1) {
1460
+ $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
1461
+ }
1462
+ }
1463
+
1464
+ F.trigger('afterShow');
1465
+
1466
+ // Stop the slideshow if this is the last item
1467
+ if (!current.loop && current.index === current.group.length - 1) {
1468
+ F.play( false );
1469
+
1470
+ } else if (F.opts.autoPlay && !F.player.isActive) {
1471
+ F.opts.autoPlay = false;
1472
+
1473
+ F.play();
1474
+ }
1475
+ },
1476
+
1477
+ _afterZoomOut: function ( obj ) {
1478
+ obj = obj || F.current;
1479
+
1480
+ $('.fancybox-wrap').trigger('onReset').remove();
1481
+
1482
+ $.extend(F, {
1483
+ group : {},
1484
+ opts : {},
1485
+ router : false,
1486
+ current : null,
1487
+ isActive : false,
1488
+ isOpened : false,
1489
+ isOpen : false,
1490
+ isClosing : false,
1491
+ wrap : null,
1492
+ skin : null,
1493
+ outer : null,
1494
+ inner : null
1495
+ });
1496
+
1497
+ F.trigger('afterClose', obj);
1498
+ }
1499
+ });
1500
+
1501
+ /*
1502
+ * Default transitions
1503
+ */
1504
+
1505
+ F.transitions = {
1506
+ getOrigPosition: function () {
1507
+ var current = F.current,
1508
+ element = current.element,
1509
+ orig = current.orig,
1510
+ pos = {},
1511
+ width = 50,
1512
+ height = 50,
1513
+ hPadding = current.hPadding,
1514
+ wPadding = current.wPadding,
1515
+ viewport = F.getViewport();
1516
+
1517
+ if (!orig && current.isDom && element.is(':visible')) {
1518
+ orig = element.find('img:first');
1519
+
1520
+ if (!orig.length) {
1521
+ orig = element;
1522
+ }
1523
+ }
1524
+
1525
+ if (isQuery(orig)) {
1526
+ pos = orig.offset();
1527
+
1528
+ if (orig.is('img')) {
1529
+ width = orig.outerWidth();
1530
+ height = orig.outerHeight();
1531
+ }
1532
+
1533
+ } else {
1534
+ pos.top = viewport.y + (viewport.h - height) * current.topRatio;
1535
+ pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
1536
+ }
1537
+
1538
+ if (F.wrap.css('position') === 'fixed' || current.locked) {
1539
+ pos.top -= viewport.y;
1540
+ pos.left -= viewport.x;
1541
+ }
1542
+
1543
+ pos = {
1544
+ top : getValue(pos.top - hPadding * current.topRatio),
1545
+ left : getValue(pos.left - wPadding * current.leftRatio),
1546
+ width : getValue(width + wPadding),
1547
+ height : getValue(height + hPadding)
1548
+ };
1549
+
1550
+ return pos;
1551
+ },
1552
+
1553
+ step: function (now, fx) {
1554
+ var ratio,
1555
+ padding,
1556
+ value,
1557
+ prop = fx.prop,
1558
+ current = F.current,
1559
+ wrapSpace = current.wrapSpace,
1560
+ skinSpace = current.skinSpace;
1561
+
1562
+ if (prop === 'width' || prop === 'height') {
1563
+ ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
1564
+
1565
+ if (F.isClosing) {
1566
+ ratio = 1 - ratio;
1567
+ }
1568
+
1569
+ padding = prop === 'width' ? current.wPadding : current.hPadding;
1570
+ value = now - padding;
1571
+
1572
+ F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
1573
+ F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
1574
+ }
1575
+ },
1576
+
1577
+ zoomIn: function () {
1578
+ var current = F.current,
1579
+ startPos = current.pos,
1580
+ effect = current.openEffect,
1581
+ elastic = effect === 'elastic',
1582
+ endPos = $.extend({opacity : 1}, startPos);
1583
+
1584
+ // Remove "position" property that breaks older IE
1585
+ delete endPos.position;
1586
+
1587
+ if (elastic) {
1588
+ startPos = this.getOrigPosition();
1589
+
1590
+ if (current.openOpacity) {
1591
+ startPos.opacity = 0.1;
1592
+ }
1593
+
1594
+ } else if (effect === 'fade') {
1595
+ startPos.opacity = 0.1;
1596
+ }
1597
+
1598
+ F.wrap.css(startPos).animate(endPos, {
1599
+ duration : effect === 'none' ? 0 : current.openSpeed,
1600
+ easing : current.openEasing,
1601
+ step : elastic ? this.step : null,
1602
+ complete : F._afterZoomIn
1603
+ });
1604
+ },
1605
+
1606
+ zoomOut: function () {
1607
+ var current = F.current,
1608
+ effect = current.closeEffect,
1609
+ elastic = effect === 'elastic',
1610
+ endPos = {opacity : 0.1};
1611
+
1612
+ if (elastic) {
1613
+ endPos = this.getOrigPosition();
1614
+
1615
+ if (current.closeOpacity) {
1616
+ endPos.opacity = 0.1;
1617
+ }
1618
+ }
1619
+
1620
+ F.wrap.animate(endPos, {
1621
+ duration : effect === 'none' ? 0 : current.closeSpeed,
1622
+ easing : current.closeEasing,
1623
+ step : elastic ? this.step : null,
1624
+ complete : F._afterZoomOut
1625
+ });
1626
+ },
1627
+
1628
+ changeIn: function () {
1629
+ var current = F.current,
1630
+ effect = current.nextEffect,
1631
+ startPos = current.pos,
1632
+ endPos = { opacity : 1 },
1633
+ direction = F.direction,
1634
+ distance = 200,
1635
+ field;
1636
+
1637
+ startPos.opacity = 0.1;
1638
+
1639
+ if (effect === 'elastic') {
1640
+ field = direction === 'down' || direction === 'up' ? 'top' : 'left';
1641
+
1642
+ if (direction === 'down' || direction === 'right') {
1643
+ startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
1644
+ endPos[ field ] = '+=' + distance + 'px';
1645
+
1646
+ } else {
1647
+ startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
1648
+ endPos[ field ] = '-=' + distance + 'px';
1649
+ }
1650
+ }
1651
+
1652
+ // Workaround for http://bugs.jquery.com/ticket/12273
1653
+ if (effect === 'none') {
1654
+ F._afterZoomIn();
1655
+
1656
+ } else {
1657
+ F.wrap.css(startPos).animate(endPos, {
1658
+ duration : current.nextSpeed,
1659
+ easing : current.nextEasing,
1660
+ complete : F._afterZoomIn
1661
+ });
1662
+ }
1663
+ },
1664
+
1665
+ changeOut: function () {
1666
+ var previous = F.previous,
1667
+ effect = previous.prevEffect,
1668
+ endPos = { opacity : 0.1 },
1669
+ direction = F.direction,
1670
+ distance = 200;
1671
+
1672
+ if (effect === 'elastic') {
1673
+ endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
1674
+ }
1675
+
1676
+ previous.wrap.animate(endPos, {
1677
+ duration : effect === 'none' ? 0 : previous.prevSpeed,
1678
+ easing : previous.prevEasing,
1679
+ complete : function () {
1680
+ $(this).trigger('onReset').remove();
1681
+ }
1682
+ });
1683
+ }
1684
+ };
1685
+
1686
+ /*
1687
+ * Overlay helper
1688
+ */
1689
+
1690
+ F.helpers.overlay = {
1691
+ defaults : {
1692
+ closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
1693
+ speedOut : 200, // duration of fadeOut animation
1694
+ showEarly : true, // indicates if should be opened immediately or wait until the content is ready
1695
+ css : {}, // custom CSS properties
1696
+ locked : !isTouch, // if true, the content will be locked into overlay
1697
+ fixed : true // if false, the overlay CSS position property will not be set to "fixed"
1698
+ },
1699
+
1700
+ overlay : null, // current handle
1701
+ fixed : false, // indicates if the overlay has position "fixed"
1702
+ el : $('html'), // element that contains "the lock"
1703
+
1704
+ // Public methods
1705
+ create : function(opts) {
1706
+ opts = $.extend({}, this.defaults, opts);
1707
+
1708
+ if (this.overlay) {
1709
+ this.close();
1710
+ }
1711
+
1712
+ this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
1713
+ this.fixed = false;
1714
+
1715
+ if (opts.fixed && F.defaults.fixed) {
1716
+ this.overlay.addClass('fancybox-overlay-fixed');
1717
+
1718
+ this.fixed = true;
1719
+ }
1720
+ },
1721
+
1722
+ open : function(opts) {
1723
+ var that = this;
1724
+
1725
+ opts = $.extend({}, this.defaults, opts);
1726
+
1727
+ if (this.overlay) {
1728
+ this.overlay.unbind('.overlay').width('auto').height('auto');
1729
+
1730
+ } else {
1731
+ this.create(opts);
1732
+ }
1733
+
1734
+ if (!this.fixed) {
1735
+ W.bind('resize.overlay', $.proxy( this.update, this) );
1736
+
1737
+ this.update();
1738
+ }
1739
+
1740
+ if (opts.closeClick) {
1741
+ this.overlay.bind('click.overlay', function(e) {
1742
+ if ($(e.target).hasClass('fancybox-overlay')) {
1743
+ if (F.isActive) {
1744
+ F.close();
1745
+ } else {
1746
+ that.close();
1747
+ }
1748
+
1749
+ return false;
1750
+ }
1751
+ });
1752
+ }
1753
+
1754
+ this.overlay.css( opts.css ).show();
1755
+ },
1756
+
1757
+ close : function() {
1758
+ var scrollV, scrollH;
1759
+
1760
+ W.unbind('resize.overlay');
1761
+
1762
+ if (this.el.hasClass('fancybox-lock')) {
1763
+ $('.fancybox-margin').removeClass('fancybox-margin');
1764
+
1765
+ scrollV = W.scrollTop();
1766
+ scrollH = W.scrollLeft();
1767
+
1768
+ this.el.removeClass('fancybox-lock');
1769
+
1770
+ W.scrollTop( scrollV ).scrollLeft( scrollH );
1771
+ }
1772
+
1773
+ $('.fancybox-overlay').remove().hide();
1774
+
1775
+ $.extend(this, {
1776
+ overlay : null,
1777
+ fixed : false
1778
+ });
1779
+ },
1780
+
1781
+ // Private, callbacks
1782
+
1783
+ update : function () {
1784
+ var width = '100%', offsetWidth;
1785
+
1786
+ // Reset width/height so it will not mess
1787
+ this.overlay.width(width).height('100%');
1788
+
1789
+ // jQuery does not return reliable result for IE
1790
+ if (IE) {
1791
+ offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
1792
+
1793
+ if (D.width() > offsetWidth) {
1794
+ width = D.width();
1795
+ }
1796
+
1797
+ } else if (D.width() > W.width()) {
1798
+ width = D.width();
1799
+ }
1800
+
1801
+ this.overlay.width(width).height(D.height());
1802
+ },
1803
+
1804
+ // This is where we can manipulate DOM, because later it would cause iframes to reload
1805
+ onReady : function (opts, obj) {
1806
+ var overlay = this.overlay;
1807
+
1808
+ $('.fancybox-overlay').stop(true, true);
1809
+
1810
+ if (!overlay) {
1811
+ this.create(opts);
1812
+ }
1813
+
1814
+ if (opts.locked && this.fixed && obj.fixed) {
1815
+ if (!overlay) {
1816
+ this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
1817
+ }
1818
+
1819
+ obj.locked = this.overlay.append( obj.wrap );
1820
+ obj.fixed = false;
1821
+ }
1822
+
1823
+ if (opts.showEarly === true) {
1824
+ this.beforeShow.apply(this, arguments);
1825
+ }
1826
+ },
1827
+
1828
+ beforeShow : function(opts, obj) {
1829
+ var scrollV, scrollH;
1830
+
1831
+ if (obj.locked) {
1832
+ if (this.margin !== false) {
1833
+ $('*').filter(function(){
1834
+ return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
1835
+ }).addClass('fancybox-margin');
1836
+
1837
+ this.el.addClass('fancybox-margin');
1838
+ }
1839
+
1840
+ scrollV = W.scrollTop();
1841
+ scrollH = W.scrollLeft();
1842
+
1843
+ this.el.addClass('fancybox-lock');
1844
+
1845
+ W.scrollTop( scrollV ).scrollLeft( scrollH );
1846
+ }
1847
+
1848
+ this.open(opts);
1849
+ },
1850
+
1851
+ onUpdate : function() {
1852
+ if (!this.fixed) {
1853
+ this.update();
1854
+ }
1855
+ },
1856
+
1857
+ afterClose: function (opts) {
1858
+ // Remove overlay if exists and fancyBox is not opening
1859
+ // (e.g., it is not being open using afterClose callback)
1860
+ //if (this.overlay && !F.isActive) {
1861
+ if (this.overlay && !F.coming) {
1862
+ this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
1863
+ }
1864
+ }
1865
+ };
1866
+
1867
+ /*
1868
+ * Title helper
1869
+ */
1870
+
1871
+ F.helpers.title = {
1872
+ defaults : {
1873
+ type : 'float', // 'float', 'inside', 'outside' or 'over',
1874
+ position : 'bottom' // 'top' or 'bottom'
1875
+ },
1876
+
1877
+ beforeShow: function (opts) {
1878
+ var current = F.current,
1879
+ text = current.title,
1880
+ type = opts.type,
1881
+ title,
1882
+ target;
1883
+
1884
+ if ($.isFunction(text)) {
1885
+ text = text.call(current.element, current);
1886
+ }
1887
+
1888
+ if (!isString(text) || $.trim(text) === '') {
1889
+ return;
1890
+ }
1891
+
1892
+ title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
1893
+
1894
+ switch (type) {
1895
+ case 'inside':
1896
+ target = F.skin;
1897
+ break;
1898
+
1899
+ case 'outside':
1900
+ target = F.wrap;
1901
+ break;
1902
+
1903
+ case 'over':
1904
+ target = F.inner;
1905
+ break;
1906
+
1907
+ default: // 'float'
1908
+ target = F.skin;
1909
+
1910
+ title.appendTo('body');
1911
+
1912
+ if (IE) {
1913
+ title.width( title.width() );
1914
+ }
1915
+
1916
+ title.wrapInner('<span class="child"></span>');
1917
+
1918
+ //Increase bottom margin so this title will also fit into viewport
1919
+ F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
1920
+ break;
1921
+ }
1922
+
1923
+ title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
1924
+ }
1925
+ };
1926
+
1927
+ // jQuery plugin initialization
1928
+ $.fn.fancybox = function (options) {
1929
+ var index,
1930
+ that = $(this),
1931
+ selector = this.selector || '',
1932
+ run = function(e) {
1933
+ var what = $(this).blur(), idx = index, relType, relVal;
1934
+
1935
+ if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
1936
+ relType = options.groupAttr || 'data-fancybox-group';
1937
+ relVal = what.attr(relType);
1938
+
1939
+ if (!relVal) {
1940
+ relType = 'rel';
1941
+ relVal = what.get(0)[ relType ];
1942
+ }
1943
+
1944
+ if (relVal && relVal !== '' && relVal !== 'nofollow') {
1945
+ what = selector.length ? $(selector) : that;
1946
+ what = what.filter('[' + relType + '="' + relVal + '"]');
1947
+ idx = what.index(this);
1948
+ }
1949
+
1950
+ options.index = idx;
1951
+
1952
+ // Stop an event from bubbling if everything is fine
1953
+ if (F.open(what, options) !== false) {
1954
+ e.preventDefault();
1955
+ }
1956
+ }
1957
+ };
1958
+
1959
+ options = options || {};
1960
+ index = options.index || 0;
1961
+
1962
+ if (!selector || options.live === false) {
1963
+ that.unbind('click.fb-start').bind('click.fb-start', run);
1964
+
1965
+ } else {
1966
+ D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
1967
+ }
1968
+
1969
+ this.filter('[data-fancybox-start=1]').trigger('click');
1970
+
1971
+ return this;
1972
+ };
1973
+
1974
+ // Tests that need a body at doc ready
1975
+ D.ready(function() {
1976
+ var w1, w2;
1977
+
1978
+ if ( $.scrollbarWidth === undefined ) {
1979
+ // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
1980
+ $.scrollbarWidth = function() {
1981
+ var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
1982
+ child = parent.children(),
1983
+ width = child.innerWidth() - child.height( 99 ).innerWidth();
1984
+
1985
+ parent.remove();
1986
+
1987
+ return width;
1988
+ };
1989
+ }
1990
+
1991
+ if ( $.support.fixedPosition === undefined ) {
1992
+ $.support.fixedPosition = (function() {
1993
+ var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
1994
+ fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
1995
+
1996
+ elem.remove();
1997
+
1998
+ return fixed;
1999
+ }());
2000
+ }
2001
+
2002
+ $.extend(F.defaults, {
2003
+ scrollbarWidth : $.scrollbarWidth(),
2004
+ fixed : $.support.fixedPosition,
2005
+ parent : $('body')
2006
+ });
2007
+
2008
+ //Get real width of page scroll-bar
2009
+ w1 = $(window).width();
2010
+
2011
+ H.addClass('fancybox-lock-test');
2012
+
2013
+ w2 = $(window).width();
2014
+
2015
+ H.removeClass('fancybox-lock-test');
2016
+
2017
+ $("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
2018
+ });
2019
+
2020
+ }(window, document, jQuery));
skin/frontend/base/default/js/reminder/jquery.fancybox.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
3
+ width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
4
+ keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
5
+ (I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
6
+ openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
7
+ isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
8
+ c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
9
+ k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
10
+ b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
11
+ setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
12
+ d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
13
+ a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
14
+ b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
15
+ y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
16
+ if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
17
+ (h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
18
+ {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
19
+ mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
20
+ !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
21
+ "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
22
+ this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
23
+ f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
24
+ e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
25
+ outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
26
+ g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
27
+ "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
28
+ h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
29
+ h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
30
+ "iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
31
+ y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
32
+ !a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
33
+ b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
34
+ a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
35
+ (c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
36
+ f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
37
+ {duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
38
+ b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
39
+ f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
40
+ b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
41
+ p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
42
+ f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
43
+ b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
44
+ e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
45
+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
46
+ d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
skin/frontend/base/default/js/reminder/reminder.js ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function() {
2
+
3
+ jQuery('.reminder-form-load-ajax').click(function(event){
4
+ event.preventDefault();
5
+
6
+ jQuery.fancybox.showLoading();
7
+
8
+ var load_ajax_url = jQuery(this).prop('href');
9
+ jQuery.ajax( {
10
+ type : "GET",
11
+ url:load_ajax_url,
12
+ success : function(msg) {
13
+ jQuery.fancybox({
14
+ 'content' : msg
15
+ });
16
+ }
17
+ });
18
+
19
+ });
20
+
21
+ });
22
+