toogas_featured_popup_free_version - Version 1.0.0

Version Notes

Free Version of the Featured Popup.

Download this release

Release Info

Developer Magento Core Team
Extension toogas_featured_popup_free_version
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (80) hide show
  1. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup.php +29 -0
  2. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit.php +59 -0
  3. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Form.php +33 -0
  4. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tab/Form.php +106 -0
  5. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tab/Formdate.php +63 -0
  6. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tab/Formpopup.php +61 -0
  7. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tabs.php +55 -0
  8. app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Grid.php +154 -0
  9. app/code/local/Toogas/Featuredpopup/Block/Featuredpopup.php +96 -0
  10. app/code/local/Toogas/Featuredpopup/Helper/Data.php +30 -0
  11. app/code/local/Toogas/Featuredpopup/Model/Featuredpopup.php +25 -0
  12. app/code/local/Toogas/Featuredpopup/Model/Mysql4/Featuredpopup.php +105 -0
  13. app/code/local/Toogas/Featuredpopup/Model/Mysql4/Featuredpopup/Collection.php +51 -0
  14. app/code/local/Toogas/Featuredpopup/controllers/Adminhtml/FeaturedpopupController.php +228 -0
  15. app/code/local/Toogas/Featuredpopup/etc/config.xml +163 -0
  16. app/code/local/Toogas/Featuredpopup/etc/system.xml +51 -0
  17. app/code/local/Toogas/Featuredpopup/readme.txt +23 -0
  18. app/code/local/Toogas/Featuredpopup/sql/featuredpopup_setup/mysql4-install-0.1.0.php +56 -0
  19. app/code/local/Toogas/Featuredpopup/toogas_license-free.txt +68 -0
  20. app/code/local/Toogas/Toogaslda/Block/Adminhtml/System/Config/Fieldset/Toogas.php +27 -0
  21. app/code/local/Toogas/Toogaslda/Helper/Data.php +23 -0
  22. app/code/local/Toogas/Toogaslda/etc/config.xml +70 -0
  23. app/code/local/Toogas/Toogaslda/etc/system.xml +47 -0
  24. app/design/adminhtml/default/default/layout/featuredpopup.xml +25 -0
  25. app/design/adminhtml/default/default/template/toogas_toogaslda/system/config/fieldset/toogas.phtml +47 -0
  26. app/design/frontend/base/default/layout/toogas_featuredpopup.xml +33 -0
  27. app/design/frontend/base/default/template/toogas_featuredpopup/featuredpopup.phtml +72 -0
  28. app/etc/modules/Toogas_Featuredpopup.xml +9 -0
  29. app/locale/en_GB/Toogas_Featuredpopup.csv +35 -0
  30. app/locale/en_GB/Toogas_Toogaslda.csv +3 -0
  31. app/locale/en_US/Toogas_Featuredpopup.csv +35 -0
  32. app/locale/en_US/Toogas_Toogaslda.csv +3 -0
  33. app/locale/es_ES/Toogas_Featuredpopup.csv +35 -0
  34. app/locale/es_ES/Toogas_Toogaslda.csv +3 -0
  35. app/locale/pt_BR/Toogas_Featuredpopup.csv +35 -0
  36. app/locale/pt_BR/Toogas_Toogaslda.csv +3 -0
  37. app/locale/pt_PT/Toogas_Featuredpopup.csv +35 -0
  38. app/locale/pt_PT/Toogas_Toogaslda.csv +3 -0
  39. js/toogas/featuredpopup/js/window.js +305 -0
  40. js/toogas/featuredpopup/js/window_orig.js +1843 -0
  41. js/toogas/slideshow/slideshow.js +45 -0
  42. js/toogas/slideshow/slideshow.js~ +45 -0
  43. package.xml +20 -0
  44. skin/adminhtml/default/default/images/toogas/Featuredpopup/featured_popup.gif +0 -0
  45. skin/adminhtml/default/default/images/toogas/toogas_logo.jpg +0 -0
  46. skin/frontend/base/default/css/Toogas/Featuredpopup/default.css +73 -0
  47. skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_left.gif +0 -0
  48. skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_mid.gif +0 -0
  49. skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_right.gif +0 -0
  50. skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_right_resize.gif +0 -0
  51. skin/frontend/base/default/css/Toogas/Featuredpopup/default/center_left.gif +0 -0
  52. skin/frontend/base/default/css/Toogas/Featuredpopup/default/center_right.gif +0 -0
  53. skin/frontend/base/default/css/Toogas/Featuredpopup/default/clear.gif +0 -0
  54. skin/frontend/base/default/css/Toogas/Featuredpopup/default/close.gif +0 -0
  55. skin/frontend/base/default/css/Toogas/Featuredpopup/default/inspect.gif +0 -0
  56. skin/frontend/base/default/css/Toogas/Featuredpopup/default/maximize.gif +0 -0
  57. skin/frontend/base/default/css/Toogas/Featuredpopup/default/minimize.gif +0 -0
  58. skin/frontend/base/default/css/Toogas/Featuredpopup/default/overlay.png +0 -0
  59. skin/frontend/base/default/css/Toogas/Featuredpopup/default/resize.gif +0 -0
  60. skin/frontend/base/default/css/Toogas/Featuredpopup/default/sizer.gif +0 -0
  61. skin/frontend/base/default/css/Toogas/Featuredpopup/default/top_left.gif +0 -0
  62. skin/frontend/base/default/css/Toogas/Featuredpopup/default/top_mid.gif +0 -0
  63. skin/frontend/base/default/css/Toogas/Featuredpopup/default/top_right.gif +0 -0
  64. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/B.png +0 -0
  65. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/BL.png +0 -0
  66. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/BR.png +0 -0
  67. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/B_Main.png +0 -0
  68. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/L.png +0 -0
  69. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/L_Main.png +0 -0
  70. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/R.png +0 -0
  71. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/R_Main.png +0 -0
  72. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/T.png +0 -0
  73. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TL.png +0 -0
  74. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TL_Main.png +0 -0
  75. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TR.png +0 -0
  76. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TR_Main.png +0 -0
  77. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/T_Main.png +0 -0
  78. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/close.gif +0 -0
  79. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/maximize.gif +0 -0
  80. skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/minimize.gif +0 -0
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup extends Mage_Adminhtml_Block_Widget_Grid_Container
18
+ {
19
+ public function __construct()
20
+ {
21
+
22
+ $this->_controller = 'adminhtml_featuredpopup';
23
+ $this->_blockGroup = 'featuredpopup';
24
+ $this->_headerText = Mage::helper('featuredpopup')
25
+ ->__('Featured Popup (Free) <a target=_blank href="http://www.toogas.com/featured-pop-up.html">Click here for the Pro Version</a>');
26
+ $this->_addButtonLabel = Mage::helper('featuredpopup')->__('Add Featured Popup');
27
+ parent::__construct();
28
+ }
29
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
18
+ {
19
+ public function __construct()
20
+ {
21
+ parent::__construct();
22
+
23
+ $this->_objectId = 'id';
24
+ $this->_blockGroup = 'featuredpopup';
25
+ $this->_controller = 'adminhtml_featuredpopup';
26
+
27
+ $this->_updateButton('save', 'label', Mage::helper('featuredpopup')->__('Save'));
28
+ $this->_updateButton('delete', 'label', Mage::helper('featuredpopup')->__('Delete'));
29
+
30
+ $this->_addButton('saveandcontinue', array(
31
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
32
+ 'onclick' => 'saveAndContinueEdit()',
33
+ 'class' => 'save',
34
+ ), -100);
35
+
36
+ $this->_formScripts[] = "
37
+ function toggleEditor() {
38
+ if (tinyMCE.getInstanceById('featuredpopup_content') == null) {
39
+ tinyMCE.execCommand('mceAddControl', false, 'featuredpopup_content');
40
+ } else {
41
+ tinyMCE.execCommand('mceRemoveControl', false, 'featuredpopup_content');
42
+ }
43
+ }
44
+
45
+ function saveAndContinueEdit(){
46
+ editForm.submit($('edit_form').action+'back/edit/');
47
+ }
48
+ ";
49
+ }
50
+
51
+ public function getHeaderText()
52
+ {
53
+ if( Mage::registry('featuredpopup_data') && Mage::registry('featuredpopup_data')->getId() ) {
54
+ return Mage::helper('featuredpopup')->__("Edit '%s'. (Free) <a target=_blank href=\"http://www.toogas.com/featured-pop-up.html\">Click here for the Pro Version</a>", $this->htmlEscape(Mage::registry('featuredpopup_data')->getPopupName()));
55
+ } else {
56
+ return Mage::helper('featuredpopup')->__('New Featured Popup (Free) <a target=_blank href="http://www.toogas.com/featured-pop-up.html">Click here for the Pro Version</a>');
57
+ }
58
+ }
59
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Form.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
18
+ {
19
+ protected function _prepareForm()
20
+ {
21
+ $form = new Varien_Data_Form(array(
22
+ 'id' => 'edit_form',
23
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
24
+ 'method' => 'post',
25
+ 'enctype' => 'multipart/form-data'
26
+ )
27
+ );
28
+
29
+ $form->setUseContainer(true);
30
+ $this->setForm($form);
31
+ return parent::_prepareForm();
32
+ }
33
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tab/Form.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
18
+ {
19
+ protected function _prepareForm()
20
+ {
21
+ $form = new Varien_Data_Form();
22
+
23
+ $model = Mage::registry('featuredpopup_data'); //importante nas abas pa saber onde grava
24
+
25
+
26
+ $fieldset = $form->addFieldset('featuredpopup_form',
27
+ array('legend'=>Mage::helper('featuredpopup')->__('Featured Popup (Free)')));
28
+
29
+ $fieldset->addField('popup_name', 'text', array(
30
+ 'label' => Mage::helper('featuredpopup')->__('Name'),
31
+ 'class' => 'required-entry',
32
+ 'required' => true,
33
+ 'name' => 'popup_name',
34
+ 'maxlength' => '30'
35
+ ));
36
+
37
+
38
+ $fieldset->addField('image_link', 'image', array(
39
+ 'label' => Mage::helper('featuredpopup')->__('Popup Image'),
40
+ 'class' => 'required-entry',
41
+ 'required' => true,
42
+ 'name' => 'image_link',
43
+ ));
44
+
45
+ $fieldset->addField('width_image', 'text', array(
46
+ 'label' => Mage::helper('featuredpopup')->__('Width Image'),
47
+ 'class' => 'required-entry validate-digits',
48
+ 'required' => true,
49
+ 'name' => 'width_image',
50
+ ));
51
+
52
+ $fieldset->addField('height_image', 'text', array(
53
+ 'label' => Mage::helper('featuredpopup')->__('Height Image'),
54
+ 'class' => 'required-entry validate-digits',
55
+ 'required' => true,
56
+ 'name' => 'height_image',
57
+ ));
58
+
59
+ $fieldset->addField('url_link', 'text', array(
60
+ 'label' => Mage::helper('featuredpopup')->__('Url'),
61
+ 'name' => 'url_link',
62
+ ));
63
+
64
+ $fieldset->addField('is_active', 'select', array(
65
+ 'label' => Mage::helper('featuredpopup')->__('Status'),
66
+ 'options' => $this->helper('featuredpopup/data')->sacaStatus(),
67
+ 'class' => 'required-entry',
68
+ 'required' => true,
69
+ 'name' => 'is_active',
70
+ ));
71
+
72
+
73
+ if (!Mage::app()->isSingleStoreMode()) {
74
+ $fieldset->addField('store_id', 'multiselect', array(
75
+ 'name' => 'stores[]',
76
+ 'label' => Mage::helper('featuredpopup')->__('Store View'),
77
+ 'title' => Mage::helper('featuredpopup')->__('Store View'),
78
+ 'required' => true,
79
+ 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
80
+ ));
81
+ }
82
+ else {
83
+ $fieldset->addField('store_id', 'hidden', array(
84
+ 'name' => 'stores[]',
85
+ 'value' => Mage::app()->getStore(true)->getId()
86
+ ));
87
+ //$model->setStoreId(Mage::app()->getStore(true)->getId()); //isto nao devera ser necessario para este caso
88
+ }
89
+
90
+ if ( Mage::getSingleton('adminhtml/session')->getFeaturedpopupData() )
91
+ {
92
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getFeaturedpopupData());
93
+ Mage::getSingleton('adminhtml/session')->setFeaturedpopupData(null);
94
+ } elseif ( Mage::registry('featuredpopup_data') ) {
95
+ $form->setValues(Mage::registry('featuredpopup_data')->getData());
96
+ }
97
+ $form->setValues($model->getData()); //coloquei
98
+ $this->setForm($form);
99
+
100
+ return parent::_prepareForm();
101
+ }
102
+
103
+
104
+
105
+
106
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tab/Formdate.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Edit_Tab_Formdate extends Mage_Adminhtml_Block_Widget_Form
18
+
19
+ {
20
+ protected function _prepareForm()
21
+ {
22
+ $form = new Varien_Data_Form();
23
+
24
+ $model = Mage::registry('featuredpopup_data');
25
+
26
+ $fieldset = $form->addFieldset('featuredpopup_date', array('legend'=>Mage::helper('featuredpopup')->__('Date Settings')));
27
+
28
+ $outputFormat = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
29
+
30
+
31
+ $fieldset->addField('from_date', 'date',array(
32
+ 'name' => 'from_date',
33
+ 'time' => true,
34
+ 'class' => 'required-entry',
35
+ 'required' => true,
36
+ 'format' => $this->escDates(),
37
+ 'label' => Mage::helper('featuredpopup')->__('From:'),
38
+ 'image' => $this->getSkinUrl('images/grid-cal.gif')
39
+ ));
40
+
41
+ $fieldset->addField('to_date', 'date',array(
42
+ 'name' => 'to_date',
43
+ 'time' => true,
44
+ 'class' => 'required-entry',
45
+ 'required' => true,
46
+ 'format' => $this->escDates(),
47
+ 'label' => Mage::helper('featuredpopup')->__('To:'),
48
+ 'image' => $this->getSkinUrl('images/grid-cal.gif')
49
+ ));
50
+
51
+ $form->setValues($model->getData());
52
+
53
+ $this->setForm($form);
54
+ return parent::_prepareForm();
55
+ }
56
+
57
+
58
+ private function escDates() {
59
+ return 'yyyy-MM-dd HH:mm:ss';
60
+ }
61
+
62
+
63
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tab/Formpopup.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Edit_Tab_Formpopup extends Mage_Adminhtml_Block_Widget_Form
18
+
19
+ {
20
+ protected function _prepareForm()
21
+ {
22
+ $form = new Varien_Data_Form();
23
+
24
+ $model = Mage::registry('featuredpopup_data');
25
+
26
+ $fieldset = $form->addFieldset('featuredpopup_popup', array('legend'=>Mage::helper('featuredpopup')->__('Popup Settings')));
27
+
28
+ // TODO: css and js styles to choose here
29
+
30
+ $fieldset->addField('delay_start', 'text', array(
31
+ 'label' => Mage::helper('featuredpopup')->__('Delay Start'),
32
+ 'name' => 'delay_start',
33
+ 'class' => 'validate-zero-or-greater',
34
+ ));
35
+
36
+ $fieldset->addField('delay_close', 'text', array(
37
+ 'label' => Mage::helper('featuredpopup')->__('Delay Close'),
38
+ 'name' => 'delay_close',
39
+ 'class' => 'validate-zero-or-greater',
40
+ ));
41
+
42
+ $fieldset->addField('priority', 'text', array(
43
+ 'label' => Mage::helper('featuredpopup')->__('Priority'),
44
+ 'name' => 'priority',
45
+ 'class' => 'validate-zero-or-greater',
46
+ ));
47
+
48
+ $fieldset->addField('opacity', 'text', array(
49
+ 'label' => Mage::helper('featuredpopup')->__('Opacity'),
50
+ 'name' => 'opacity',
51
+ 'class' => 'validate-zero-or-greater',
52
+ ));
53
+
54
+ $form->setValues($model->getData());
55
+
56
+ $this->setForm($form);
57
+ return parent::_prepareForm();
58
+ }
59
+
60
+
61
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Edit/Tabs.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
18
+ {
19
+
20
+ public function __construct()
21
+ {
22
+ parent::__construct();
23
+ $this->setId('featuredpopup_tabs');
24
+ $this->setDestElementId('edit_form');
25
+ $this->setTitle(Mage::helper('featuredpopup')->__('Featured Popup (Free)'));
26
+ }
27
+
28
+ protected function _beforeToHtml()
29
+ {
30
+ $this->addTab('form_section', array(
31
+ 'label' => Mage::helper('featuredpopup')->__('Featured Popup'),
32
+ 'title' => Mage::helper('featuredpopup')->__('Featured Popup'),
33
+ 'content' => $this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_edit_tab_form')->toHtml(),
34
+ ));
35
+
36
+ $this->addTab('date_section', array(
37
+ 'label' => Mage::helper('featuredpopup')->__('Date Settings'),
38
+ 'title' => Mage::helper('featuredpopup')->__('Date Settings'),
39
+ 'content' => $this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_edit_tab_formdate')
40
+ ->toHtml(),
41
+ ));
42
+
43
+
44
+
45
+ $this->addTab('popup_section', array(
46
+ 'label' => Mage::helper('featuredpopup')->__('Popup Settings'),
47
+ 'title' => Mage::helper('featuredpopup')->__('Popup Settings'),
48
+ 'content' => $this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_edit_tab_formpopup')->toHtml(),
49
+ ));
50
+
51
+ return parent::_beforeToHtml();
52
+ }
53
+
54
+
55
+ }
app/code/local/Toogas/Featuredpopup/Block/Adminhtml/Featuredpopup/Grid.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Adminhtml_Featuredpopup_Grid extends Mage_Adminhtml_Block_Widget_Grid
18
+ {
19
+ public function __construct()
20
+ {
21
+ parent::__construct();
22
+ $this->setId('featuredpopupGrid');
23
+ $this->setDefaultSort('featuredpopup_id');
24
+ $this->setDefaultDir('ASC');
25
+ $this->setSaveParametersInSession(true);
26
+ }
27
+
28
+ protected function _prepareCollection()
29
+ {
30
+ $collection = Mage::getModel('featuredpopup/featuredpopup')->getCollection();
31
+ $this->setCollection($collection);
32
+ return parent::_prepareCollection();
33
+ }
34
+
35
+ protected function _prepareColumns()
36
+ {
37
+ $this->addColumn('featuredpopup_id', array(
38
+ 'header' => Mage::helper('featuredpopup')->__('ID'),
39
+ 'align' =>'right',
40
+ 'width' => '50px',
41
+ 'index' => 'featuredpopup_id',
42
+ ));
43
+
44
+ $this->addColumn('popup_name', array(
45
+ 'header' => Mage::helper('featuredpopup')->__('Name'),
46
+ 'align' =>'left',
47
+ 'index' => 'popup_name',
48
+ ));
49
+
50
+
51
+ $this->addColumn('url_link', array(
52
+ 'header' => Mage::helper('featuredpopup')->__('Link'),
53
+ 'align' =>'left',
54
+ 'index' => 'url_link',
55
+ ));
56
+
57
+ $this->addColumn('from_date', array(
58
+ 'header' => Mage::helper('featuredpopup')->__('From:'),
59
+ 'type' => 'datetime',
60
+ 'index' => 'from_date',
61
+ ));
62
+
63
+ $this->addColumn('to_date', array(
64
+ 'header' => Mage::helper('featuredpopup')->__('To:'),
65
+ 'type' => 'datetime',
66
+ 'index' => 'to_date',
67
+ ));
68
+
69
+ $this->addColumn('is_active', array(
70
+ 'header' => Mage::helper('featuredpopup')->__('Status'),
71
+ 'options' => $this->helper('featuredpopup/data')->sacaStatus(),
72
+ 'type' => 'options',
73
+ 'index' => 'is_active',
74
+ ));
75
+
76
+ if (!Mage::app()->isSingleStoreMode()) {
77
+ $this->addColumn('store_id', array(
78
+ 'header' => Mage::helper('featuredpopup')->__('Store View'),
79
+ 'index' => 'store_id',
80
+ 'type' => 'store',
81
+ 'store_all' => true,
82
+ 'store_view' => true,
83
+ 'sortable' => false,
84
+ 'filter_condition_callback'
85
+ => array($this, '_filterStoreCondition'),
86
+ ));
87
+ }
88
+
89
+
90
+ $this->addColumn('action',
91
+ array(
92
+ 'header' => Mage::helper('featuredpopup')->__('Action'),
93
+ 'width' => '100',
94
+ 'type' => 'action',
95
+ 'getter' => 'getId',
96
+ 'actions' => array(
97
+ array(
98
+ 'caption' => Mage::helper('featuredpopup')->__('Edit'),
99
+ 'url' => array('base'=> '*/*/edit'),
100
+ 'field' => 'id'
101
+ )
102
+ ),
103
+ 'filter' => false,
104
+ 'sortable' => false,
105
+ 'index' => 'stores',
106
+ 'is_system' => true,
107
+ ));
108
+
109
+
110
+ return parent::_prepareColumns();
111
+ }
112
+
113
+
114
+
115
+ protected function _afterLoadCollection()
116
+ {
117
+ $this->getCollection()->walk('afterLoad');
118
+ parent::_afterLoadCollection();
119
+ }
120
+
121
+ protected function _filterStoreCondition($collection, $column)
122
+ {
123
+ if (!$value = $column->getFilter()->getValue()) {
124
+ return;
125
+ }
126
+ $this->getCollection()->addStoreFilter($value);
127
+ }
128
+
129
+
130
+
131
+
132
+
133
+
134
+ protected function _prepareMassaction()
135
+ {
136
+ $this->setMassactionIdField('featuredpopup_id');
137
+ $this->getMassactionBlock()->setFormFieldName('featuredpopup');
138
+
139
+ $this->getMassactionBlock()->addItem('delete', array(
140
+ 'label' => Mage::helper('featuredpopup')->__('Delete'),
141
+ 'url' => $this->getUrl('*/*/massDelete'),
142
+ 'confirm' => Mage::helper('featuredpopup')->__('Are you sure?')
143
+ ));
144
+
145
+
146
+ return $this;
147
+ }
148
+
149
+ public function getRowUrl($row)
150
+ {
151
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
152
+ }
153
+
154
+ }
app/code/local/Toogas/Featuredpopup/Block/Featuredpopup.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Block_Featuredpopup extends Mage_Core_Block_Template {
18
+
19
+ public $featuredpopupvar;
20
+ private $image;
21
+ private $url = '';
22
+ private $width_image = 0;
23
+ private $height_image = 0;
24
+ private $delay_start = 0;
25
+ private $delay_close;
26
+ private $opacity = 0.4;
27
+ public $okShowPopup = 0;
28
+
29
+ public function __construct() {
30
+
31
+ if (!$this->helper('featuredpopup')->getSystemStatus()) {
32
+ return;
33
+ };
34
+
35
+ $magento_now_date = $this->magentoNowDate();
36
+ $this->featuredpopupvar = Mage :: getModel('featuredpopup/featuredpopup')->getCollection()->addStoreFilter(Mage :: app()->getStore()->getId())->addFilter('is_active', 1)->addFieldToFilter('from_date', array (
37
+ 'datetime' => true,
38
+ 'to' => $magento_now_date
39
+ ))->addFieldToFilter('to_date', array (
40
+ 'datetime' => true,
41
+ 'from' => $magento_now_date
42
+ ))->setOrder('priority');
43
+
44
+ foreach ($this->featuredpopupvar as $vars) {
45
+
46
+ $this->image = $vars->getImageLink();
47
+ $this->url = $vars->getUrlLink();
48
+ $this->width_image = $vars->getWidthImage();
49
+ $this->height_image = $vars->getHeightImage();
50
+ $this->delay_start = $vars->getDelayStart();
51
+ $this->delay_close = $vars->getDelayClose();
52
+ $this->opacity = $vars->getOpacity();
53
+
54
+ $this->okShowPopup = 1;
55
+ }
56
+
57
+ }
58
+
59
+ public function _prepareLayout() {
60
+ return parent :: _prepareLayout();
61
+ }
62
+
63
+ public function obtainImage() {
64
+ return Mage :: getBaseUrl(Mage_Core_Model_Store :: URL_TYPE_MEDIA) . $this->image;
65
+ }
66
+
67
+ public function obtainUrl() {
68
+ return $this->url;
69
+ }
70
+
71
+ public function obtainWidthImage() {
72
+ return (is_numeric($this->width_image) && $this->width_image > 0) ? $this->width_image : 0;
73
+ }
74
+
75
+ public function obtainHeightImage() {
76
+ return (is_numeric($this->height_image) && $this->height_image > 0) ? $this->height_image : 0;
77
+ }
78
+
79
+ public function obtainDelayStart() {
80
+ return (is_numeric($this->delay_start) && $this->delay_start > 0) ? $this->delay_start : 0;
81
+ }
82
+
83
+ public function obtainDelayClose() {
84
+ return (is_numeric($this->delay_close) && $this->delay_close > 0) ? $this->delay_close : 0;
85
+ }
86
+
87
+ public function obtainOpacity() {
88
+ return (is_numeric($this->opacity) && $this->opacity > 0 && $this->opacity <= 1) ? $this->opacity : 0.4;
89
+ }
90
+
91
+ private function magentoNowDate() {
92
+ $now = Mage :: getModel('core/date')->timestamp(time());
93
+ return date('Y-m-d H:i:s', $now);
94
+ }
95
+
96
+ }
app/code/local/Toogas/Featuredpopup/Helper/Data.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Helper_Data extends Mage_Core_Helper_Abstract
18
+ {
19
+
20
+ public function sacaStatus() {
21
+ return array('0' => Mage::helper('featuredpopup')->__('Disabled'),
22
+ '1' => Mage::helper('featuredpopup')->__('Enabled'));
23
+ }
24
+
25
+ public function getSystemStatus() {
26
+ return (bool) Mage::getStoreConfigFlag('toogas_featuredpopup/configfeaturedpopup/featured_popup_enabled');
27
+ }
28
+
29
+
30
+ }
app/code/local/Toogas/Featuredpopup/Model/Featuredpopup.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Model_Featuredpopup extends Mage_Core_Model_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+
22
+ parent::_construct();
23
+ $this->_init('featuredpopup/featuredpopup');
24
+ }
25
+ }
app/code/local/Toogas/Featuredpopup/Model/Mysql4/Featuredpopup.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Model_Mysql4_Featuredpopup extends Mage_Core_Model_Mysql4_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+
22
+
23
+ $this->_init('featuredpopup/featuredpopup', 'featuredpopup_id');
24
+ }
25
+
26
+
27
+ /**
28
+ * Process page data before saving. As validacoes podem ser feitas aqui
29
+ *
30
+ * @param Mage_Core_Model_Abstract $object
31
+ */
32
+ protected function _beforeSave(Mage_Core_Model_Abstract $object)
33
+ {
34
+
35
+ //compare from to date
36
+ if ( strtotime($object->getData('from_date')) > strtotime($object->getData('to_date'))) {
37
+ Mage::throwException(Mage::helper('featuredpopup')->__('Range of dates wrong'));
38
+ }
39
+
40
+ return $this;
41
+ }
42
+
43
+
44
+ protected function _afterSave(Mage_Core_Model_Abstract $object)
45
+ {
46
+ $condition = $this->_getWriteAdapter()->quoteInto('featured_id = ?', $object->getId());
47
+ $this->_getWriteAdapter()->delete($this->getTable('toogas_featuredpopup_store'), $condition);
48
+
49
+ foreach ((array)$object->getData('stores') as $store) {
50
+ $storeArray = array();
51
+ $storeArray['featured_id'] = $object->getId();
52
+ $storeArray['store_id'] = $store;
53
+ $this->_getWriteAdapter()->insert($this->getTable('toogas_featuredpopup_store'), $storeArray);
54
+ }
55
+
56
+ return parent::_afterSave($object);
57
+ }
58
+
59
+
60
+
61
+
62
+ protected function _afterLoad(Mage_Core_Model_Abstract $object)
63
+ {
64
+
65
+ $select = $this->_getReadAdapter()->select()
66
+ ->from($this->getTable('toogas_featuredpopup_store'))
67
+ ->where('featured_id = ?', $object->getId());
68
+
69
+ if (!Mage::app()->isSingleStoreMode()) {
70
+
71
+ if ($data = $this->_getReadAdapter()->fetchAll($select)) {
72
+ $storesArray = array();
73
+ foreach ($data as $row) {
74
+ $storesArray[] = $row['store_id'];
75
+ }
76
+
77
+ $object->setData('store_id', $storesArray);
78
+ }
79
+
80
+ }
81
+
82
+
83
+ else { $object->setData('store_id', Mage::app()->getStore(true)->getId()); }
84
+
85
+
86
+ return parent::_afterLoad($object);
87
+ }
88
+
89
+ protected function _getLoadSelect($field, $value, $object)
90
+ {
91
+ $select = parent::_getLoadSelect($field, $value, $object);
92
+
93
+ if ($object->getStoreId()) {
94
+ $select->join(
95
+ array('cps' => $this->getTable('toogas_featuredpopup_store')),
96
+ $this->getMainTable().'.featured_id = `cps`.featuredpopup_id'
97
+ )
98
+ ->where('is_active=1 AND `cps`.store_id in (' . Mage_Core_Model_App::ADMIN_STORE_ID . ', ?) ', $object->getStoreId())
99
+ ->order('store_id DESC')
100
+ ->limit(1);
101
+ }
102
+ return $select;
103
+ }
104
+
105
+ }
app/code/local/Toogas/Featuredpopup/Model/Mysql4/Featuredpopup/Collection.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Model_Mysql4_Featuredpopup_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
18
+ {
19
+ public function _construct()
20
+ {
21
+ parent::_construct();
22
+ $this->_init('featuredpopup/featuredpopup');
23
+ }
24
+
25
+ /**
26
+ * Add Filter by store
27
+ *
28
+ * @param int|Mage_Core_Model_Store $store
29
+ * @return Mage_Cms_Model_Mysql4_Page_Collection
30
+ */
31
+ public function addStoreFilter($store, $withAdmin = true)
32
+ {
33
+
34
+ if ($store instanceof Mage_Core_Model_Store) {
35
+ $store = array($store->getId());
36
+ }
37
+
38
+ $this->getSelect()->join(
39
+ array('store_table' => $this->getTable('toogas_featuredpopup_store')),
40
+ 'main_table.featuredpopup_id = store_table.featured_id',
41
+ array()
42
+ )
43
+ ->where('store_table.store_id in (?)', ($withAdmin ? array(0, $store) : $store))
44
+ ->group('main_table.featuredpopup_id');
45
+
46
+ return $this;
47
+ }
48
+
49
+
50
+
51
+ }
app/code/local/Toogas/Featuredpopup/controllers/Adminhtml/FeaturedpopupController.php ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ class Toogas_Featuredpopup_Adminhtml_FeaturedpopupController extends Mage_Adminhtml_Controller_action
18
+ {
19
+
20
+ protected function _initAction() {
21
+
22
+
23
+ $this->loadLayout()
24
+ ->_setActiveMenu('cms/featuredpopup') //ver isto
25
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
26
+
27
+ return $this;
28
+ }
29
+
30
+ public function indexAction() {
31
+ $this->_initAction()
32
+ ->renderLayout();
33
+ }
34
+
35
+ public function editAction() {
36
+
37
+ $id = $this->getRequest()->getParam('id');
38
+ $model = Mage::getModel('featuredpopup/featuredpopup')->load($id);
39
+
40
+ if ($model->getId() || $id == 0) {
41
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
42
+ if (!empty($data)) {
43
+ $model->setData($data);
44
+ }
45
+
46
+ Mage::register('featuredpopup_data', $model);
47
+
48
+ $this->loadLayout();
49
+ $this->_setActiveMenu('cms/featuredpopup');
50
+
51
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
52
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
53
+
54
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
55
+
56
+ $this->_addContent($this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_edit'))
57
+ ->_addLeft($this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_edit_tabs'));
58
+
59
+ $this->renderLayout();
60
+ } else {
61
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('featuredpopup')->__('Item does not exist'));
62
+ $this->_redirect('*/*/');
63
+ }
64
+ }
65
+
66
+ public function newAction() {
67
+ $this->_forward('edit');
68
+ }
69
+
70
+ public function saveAction() {
71
+ if ($data = $this->getRequest()->getPost()) {
72
+
73
+
74
+ if(isset($_FILES['image_link']['name']) and (file_exists($_FILES['image_link']['tmp_name']))) {
75
+ try {
76
+ $uploader = new Varien_File_Uploader('image_link');
77
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
78
+ $uploader->setAllowRenameFiles(true);
79
+ $uploader->setFilesDispersion(false);
80
+ $path = Mage::getBaseDir('media') . DS .'toogas/featuredpopup';
81
+ $uploader->save($path, $_FILES['image_link']['name']);
82
+ $name_image_link = $uploader->getUploadedFileName();
83
+ $data['image_link'] = 'toogas/featuredpopup/' . $name_image_link;
84
+ //em cima acrescentei para ver se grava com path correcta
85
+ }catch(Exception $e) {
86
+ }
87
+ }
88
+ else {
89
+
90
+ if(isset($data['image_link']['delete']) && $data['image_link']['delete'] == 1)
91
+ $data['image_link'] = '';
92
+ else
93
+ unset($data['image_link']);
94
+ }
95
+
96
+
97
+ $model = Mage::getModel('featuredpopup/featuredpopup');
98
+ $model->setData($data)
99
+ ->setId($this->getRequest()->getParam('id'));
100
+
101
+ try {
102
+
103
+ $model->save();
104
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('featuredpopup')->__('The featured popup has been saved.'));
105
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
106
+
107
+ if ($this->getRequest()->getParam('back')) {
108
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
109
+ return;
110
+ }
111
+ $this->_redirect('*/*/');
112
+ return;
113
+ } catch (Exception $e) {
114
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
115
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
116
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
117
+ return;
118
+ }
119
+ }
120
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('featuredpopup')->__('Unable to find item to save'));
121
+ $this->_redirect('*/*/');
122
+ }
123
+
124
+ public function deleteAction() {
125
+ if( $this->getRequest()->getParam('id') > 0 ) {
126
+ try {
127
+ $model = Mage::getModel('featuredpopup/featuredpopup');
128
+
129
+ $model->setId($this->getRequest()->getParam('id'))
130
+ ->delete();
131
+
132
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
133
+ $this->_redirect('*/*/');
134
+ } catch (Exception $e) {
135
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
136
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
137
+ }
138
+ }
139
+ $this->_redirect('*/*/');
140
+ }
141
+
142
+ public function massDeleteAction() {
143
+ $featuredpopupsIds = $this->getRequest()->getParam('featuredpopup');
144
+ if(!is_array($featuredpopupsIds)) {
145
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
146
+ } else {
147
+ try {
148
+ foreach ($featuredpopupsIds as $featuredpopupId) {
149
+ $featuredpopups = Mage::getModel('featuredpopup/featuredpopup')->load($featuredpopupId);
150
+ $featuredpopups->delete();
151
+ }
152
+ Mage::getSingleton('adminhtml/session')->addSuccess(
153
+ Mage::helper('adminhtml')->__(
154
+ 'Total of %d record(s) were successfully deleted', count($featuredpopupsIds)
155
+ )
156
+ );
157
+ } catch (Exception $e) {
158
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
159
+ }
160
+ }
161
+ $this->_redirect('*/*/index');
162
+ }
163
+
164
+ public function massStatusAction()
165
+ {
166
+ $featuredpopupsIds = $this->getRequest()->getParam('featuredpopup');
167
+ if(!is_array($featuredpopupsIds)) {
168
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
169
+ } else {
170
+ try {
171
+ foreach ($featuredpopupsIds as $featuredpopupId) {
172
+ $featuredpopups = Mage::getSingleton('featuredpopup/featuredpopup')
173
+ ->load($featuredpopupId)
174
+ ->setStatus($this->getRequest()->getParam('status'))
175
+ ->setIsMassupdate(true)
176
+ ->save();
177
+ }
178
+ $this->_getSession()->addSuccess(
179
+ $this->__('Total of %d record(s) were successfully updated', count($featuredpopupsIds))
180
+ );
181
+ } catch (Exception $e) {
182
+ $this->_getSession()->addError($e->getMessage());
183
+ }
184
+ }
185
+ $this->_redirect('*/*/index');
186
+ }
187
+
188
+ public function exportCsvAction()
189
+ {
190
+ $fileName = 'featuredpopup.csv';
191
+ $content = $this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_grid')
192
+ ->getCsv();
193
+
194
+ $this->_sendUploadResponse($fileName, $content);
195
+ }
196
+
197
+ public function exportXmlAction()
198
+ {
199
+ $fileName = 'featuredpopup.xml';
200
+ $content = $this->getLayout()->createBlock('featuredpopup/adminhtml_featuredpopup_grid')
201
+ ->getXml();
202
+
203
+ $this->_sendUploadResponse($fileName, $content);
204
+ }
205
+
206
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
207
+ {
208
+ $response = $this->getResponse();
209
+ $response->setHeader('HTTP/1.1 200 OK','');
210
+ $response->setHeader('Pragma', 'public', true);
211
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
212
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
213
+ $response->setHeader('Last-Modified', date('r'));
214
+ $response->setHeader('Accept-Ranges', 'bytes');
215
+ $response->setHeader('Content-Length', strlen($content));
216
+ $response->setHeader('Content-type', $contentType);
217
+ $response->setBody($content);
218
+ $response->sendResponse();
219
+ die;
220
+ }
221
+
222
+ protected function _isAllowed()
223
+ {
224
+ return Mage::getSingleton('admin/session')->isAllowed('admin/cms/featuredpopup'); //ver isto muito bem
225
+ }
226
+
227
+
228
+ }
app/code/local/Toogas/Featuredpopup/etc/config.xml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Toogas Lda.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA (End-User License Agreement)
9
+ * that is bundled with this package in the file toogas_license-free.txt.
10
+ * It is also available at this URL:
11
+ * http://www.toogas.com/licences/toogas_license-free.txt
12
+ *
13
+ * @category Toogas
14
+ * @package Toogas_Featuredpopup
15
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
16
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Toogas_Featuredpopup>
22
+ <version>0.1.0</version>
23
+ </Toogas_Featuredpopup>
24
+ </modules>
25
+ <admin>
26
+ <routers>
27
+ <featuredpopup>
28
+ <use>admin</use>
29
+ <args>
30
+ <module>Toogas_Featuredpopup</module>
31
+ <frontName>featuredpopup</frontName>
32
+ </args>
33
+ </featuredpopup>
34
+ </routers>
35
+ </admin>
36
+ <adminhtml>
37
+ <translate>
38
+ <modules>
39
+ <Toogas_Featuredpopup>
40
+ <files>
41
+ <default>Toogas_Featuredpopup.csv</default>
42
+ </files>
43
+ </Toogas_Featuredpopup>
44
+ </modules>
45
+ </translate>
46
+ <menu>
47
+ <cms>
48
+ <children>
49
+ <featuredpopup module="featuredpopup">
50
+ <title>Featured Popup (Free)</title>
51
+ <action>featuredpopup/adminhtml_featuredpopup</action>
52
+ <sort_order>90</sort_order>
53
+ </featuredpopup>
54
+ </children>
55
+ </cms>
56
+ </menu>
57
+ <acl>
58
+ <resources>
59
+ <all>
60
+ <title>Allow Everything</title>
61
+ </all>
62
+ <admin>
63
+ <children>
64
+ <cms translate="title" module="cms">
65
+ <children>
66
+ <featuredpopup module="featuredpopup">
67
+ <title>Featured Popup (Free)</title>
68
+ <sort_order>90</sort_order>
69
+ </featuredpopup>
70
+ </children>
71
+ </cms>
72
+ <system>
73
+ <children>
74
+ <config>
75
+ <children>
76
+ <toogas_featuredpopup>
77
+ <title>Featured Popup (System)</title>
78
+ </toogas_featuredpopup>
79
+ </children>
80
+ </config>
81
+ </children>
82
+ </system>
83
+ </children>
84
+ </admin>
85
+ </resources>
86
+ </acl>
87
+ <layout>
88
+ <updates>
89
+ <featuredpopup>
90
+ <file>featuredpopup.xml</file>
91
+ </featuredpopup>
92
+ </updates>
93
+ </layout>
94
+ </adminhtml>
95
+ <frontend>
96
+ <layout>
97
+ <updates>
98
+ <featuredpopup module="Toogas_Featuredpopup">
99
+ <file>toogas_featuredpopup.xml</file>
100
+ </featuredpopup>
101
+ </updates>
102
+ </layout>
103
+ </frontend>
104
+ <global>
105
+ <models>
106
+ <featuredpopup>
107
+ <class>Toogas_Featuredpopup_Model</class>
108
+ <resourceModel>featuredpopup_mysql4</resourceModel>
109
+ </featuredpopup>
110
+ <featuredpopup_mysql4>
111
+ <class>Toogas_Featuredpopup_Model_Mysql4</class>
112
+ <entities>
113
+ <featuredpopup>
114
+ <table>toogas_featuredpopup</table>
115
+ </featuredpopup>
116
+ <featuredpopup_store>
117
+ <table>toogas_featuredpopup_store</table>
118
+ </featuredpopup_store>
119
+ <toogas_featuredpopup_store>
120
+ <table>toogas_featuredpopup_store</table>
121
+ </toogas_featuredpopup_store>
122
+ </entities>
123
+ </featuredpopup_mysql4>
124
+ </models>
125
+ <resources>
126
+ <featuredpopup_setup>
127
+ <setup>
128
+ <module>Toogas_Featuredpopup</module>
129
+ </setup>
130
+ <connection>
131
+ <use>core_setup</use>
132
+ </connection>
133
+ </featuredpopup_setup>
134
+ <featuredpopup_write>
135
+ <connection>
136
+ <use>core_write</use>
137
+ </connection>
138
+ </featuredpopup_write>
139
+ <featuredpopup_read>
140
+ <connection>
141
+ <use>core_read</use>
142
+ </connection>
143
+ </featuredpopup_read>
144
+ </resources>
145
+ <blocks>
146
+ <featuredpopup>
147
+ <class>Toogas_Featuredpopup_Block</class>
148
+ </featuredpopup>
149
+ </blocks>
150
+ <helpers>
151
+ <featuredpopup>
152
+ <class>Toogas_Featuredpopup_Helper</class>
153
+ </featuredpopup>
154
+ </helpers>
155
+ </global>
156
+ <default>
157
+ <toogas_featuredpopup>
158
+ <configfeaturedpopup>
159
+ <featured_popup_enabled>1</featured_popup_enabled>
160
+ </configfeaturedpopup>
161
+ </toogas_featuredpopup>
162
+ </default>
163
+ </config>
app/code/local/Toogas/Featuredpopup/etc/system.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Toogas Lda.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA (End-User License Agreement)
9
+ * that is bundled with this package in the file toogas_license-free.txt.
10
+ * It is also available at this URL:
11
+ * http://www.toogas.com/licences/toogas_license-free.txt
12
+ *
13
+ * @category Toogas
14
+ * @package Toogas_Featuredpopup
15
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
16
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
17
+ */
18
+ -->
19
+ <config>
20
+ <sections>
21
+ <toogas_featuredpopup translate="label" module="featuredpopup">
22
+ <label>Featured Popup</label>
23
+ <tab>toogaslda</tab>
24
+ <sort_order>10</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <groups>
29
+ <configfeaturedpopup translate="label">
30
+ <label>Featured Popup Configuration</label>
31
+ <frontend_type>text</frontend_type>
32
+ <sort_order>10</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ <fields>
37
+ <featured_popup_enabled translate="label">
38
+ <label>Status</label>
39
+ <frontend_type>select</frontend_type>
40
+ <sort_order>10</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>0</show_in_website>
43
+ <show_in_store>0</show_in_store>
44
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
45
+ </featured_popup_enabled>
46
+ </fields>
47
+ </configfeaturedpopup>
48
+ </groups>
49
+ </toogas_featuredpopup>
50
+ </sections>
51
+ </config>
app/code/local/Toogas/Featuredpopup/readme.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Simple Steps for the Featured Popup:
2
+
3
+ 1) Upload the content of the part-1 directory to your Magento store root.
4
+ 2) Upload the content of the part-2 directory to your Magento store root.
5
+ 3) Add the code to your cms/catalog/xml file layout update:
6
+
7
+ <reference name="after_body_start">
8
+ <block type="featuredpopup/featuredpopup" name="toogasfeaturedpopup"
9
+ as="toogasfeaturedpopup"
10
+ template="toogas_featuredpopup/featuredpopup.phtml" />
11
+ </reference>
12
+
13
+
14
+ Example for the homepage:
15
+ a) Go to Cms -> Pages
16
+ b) Open your Cms Page
17
+ c) Select the tab Design
18
+ d) Paste the code on the Layout Update XML text area.
19
+ e) Save your Cms Page
20
+
21
+ 4) You may need to refresh your cache.
22
+
23
+ 5) That's all. Please contact us if you need support: http://www.toogas.com
app/code/local/Toogas/Featuredpopup/sql/featuredpopup_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ $installer = $this;
18
+
19
+ $installer->startSetup();
20
+
21
+ $installer->run("
22
+
23
+ DROP TABLE IF EXISTS {$this->getTable('toogas_featuredpopup')};
24
+ CREATE TABLE {$this->getTable('toogas_featuredpopup')} (
25
+ `featuredpopup_id` int(11) unsigned NOT NULL auto_increment,
26
+ `popup_name` varchar(30) NOT NULL default '',
27
+ `image_link` varchar(255) NOT NULL default '',
28
+ `width_image` smallint(4) NOT NULL default '0',
29
+ `height_image` smallint(4) NOT NULL default '0',
30
+ `url_link` varchar(255) NOT NULL default '',
31
+ `is_active` tinyint(1) NOT NULL default '1',
32
+ `from_date` datetime NOT NULL default '0000-00-00 00:00:00',
33
+ `to_date` datetime NOT NULL default '0000-00-00 00:00:00',
34
+ `css_style` varchar(64) NOT NULL default '',
35
+ `js_style` varchar(64) NOT NULL default '',
36
+ `delay_start` tinyint(3) NOT NULL default '0',
37
+ `delay_close` tinyint(3) NOT NULL default '0',
38
+ `priority` tinyint(4) NOT NULL default '0',
39
+ `opacity` decimal(3,2) NOT NULL default '0.4',
40
+ PRIMARY KEY (`featuredpopup_id`)
41
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
42
+
43
+ DROP TABLE IF EXISTS `{$this->getTable('toogas_featuredpopup_store')}`;
44
+ CREATE TABLE `{$this->getTable('toogas_featuredpopup_store')}` (
45
+ `featured_id` int(11) unsigned NOT NULL,
46
+ `store_id` smallint(5) unsigned NOT NULL,
47
+ PRIMARY KEY (`featured_id`,`store_id`),
48
+ CONSTRAINT `FK_FEATUREDPOPUP_STORE_FEATUREDPOPUP` FOREIGN KEY (`featured_id`) REFERENCES `{$this->getTable('toogas_featuredpopup')}` (`featuredpopup_id`) ON UPDATE CASCADE ON DELETE CASCADE,
49
+ CONSTRAINT `FK_FEATUREDPOPUP_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `{$this->getTable('core/store')}` (`store_id`) ON UPDATE CASCADE ON DELETE CASCADE
50
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Store for featured popup';
51
+
52
+
53
+ ");
54
+
55
+
56
+ $installer->endSetup();
app/code/local/Toogas/Featuredpopup/toogas_license-free.txt ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Toogas Lda. End-User Licence Agreement
2
+ www.toogas.com
3
+
4
+ THIS LICENSE AGREEMENT (HEREINAFTER AGREEMENT) IS AN AGREEMENT BETWEEN YOU (THE
5
+ PERSON OR COMPANY WHO IS BEING LICENSED TO USE THE SOFTWARE OR DOCUMENTATION)
6
+ AND TOOGAS LDA. (HEREINAFTER WE/US/OUR). THE AGREEMENT APPLIES TO EVERYTHING YOU PURCHASE FROM US.
7
+
8
+ 1. By using this Software you acknowledge that you have read this Agreement,
9
+ and that you agree to the content of the Agreement and its terms, and agree
10
+ to use the Software in compliance with this Agreement.
11
+
12
+ 2. The Agreement comes into legal force at the moment when you order our
13
+ Software from our site or receive it through email or on data medium at the
14
+ our discretion.
15
+
16
+ 3. We are the copyright holder of the Software. The Software or a portion of it
17
+ is a copyrightable matter and is liable to protection by the law. Any
18
+ activity that infringes terms of this Agreement violates copyright law and
19
+ will be prosecuted according to the current law. We reserve the right to
20
+ revoke the license of any user who is holding an invalid license.
21
+
22
+ 4. This Agreement gives you the right to use the Software on
23
+ one domain solely for your own personal or business use, subject to all other
24
+ terms of this Agreement. Any distribution of the Software without our consent,
25
+ including noncommercial distribution is regarded as violation of this
26
+ Agreement and entails liability, according to the current law.
27
+
28
+ 5. You may not use any part of the code in whole or part in any other software
29
+ or product or website.
30
+
31
+ 6. You may not give, sell, distribute, sub-license, rent, lease or lend any
32
+ portion of the Software or Documentation to anyone. You may not place the
33
+ Software on a server so that it is accessible via a public network such as
34
+ the Internet for distribution purposes.
35
+
36
+ 7. You are bound to preserve the copyright information intact.
37
+
38
+ 8. We reserve the right to publish a selected list of users of our Software.
39
+
40
+ 9. We will not be liable to you for any damages (including any loss of
41
+ profits/saving, or incidental or consequential) caused to you, your
42
+ information and your business arising out of the use or inability to use
43
+ this Software.
44
+
45
+ 10. We are not liable for prosecution arising from use of the Software against
46
+ law or for any illegal use.
47
+
48
+ 11. If you fail to use the Software in accordance with the terms and conditions
49
+ of this License Agreement, it constitutes a breach of the agreement, and
50
+ your license to use the program is revoked.
51
+
52
+ 12. Toogas Lda. reserves the right to change this license agreement at any
53
+ time and impose its clauses at any given time.
54
+
55
+ 13. License agreement remains effective until terminated. We retain the right to
56
+ terminate your license to use the Software at any time, if in its sole
57
+ discretion, you are not abiding by the terms of the Agreement, including,
58
+ but not limited to, obscuring or removing any link or copyright notice as
59
+ specified in this agreement. You may terminate it at any time by destroying
60
+ all copies of the Software. Termination of this Agreement does not bind us
61
+ to return you the amount spent for purchase of the Software.
62
+
63
+ 14. If you continue to use the Software after Toogas Lda. gives you notice
64
+ of termination of your license, you hereby agree to accept an injunction to
65
+ enjoin you from its further use and to pay all costs (including but not
66
+ limited to reasonable attorney fees) to enforce our revocation of your
67
+ license and any damages suffered by us because of your misuse of
68
+ the Software.
app/code/local/Toogas/Toogaslda/Block/Adminhtml/System/Config/Fieldset/Toogas.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file licence_toogas_community.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_community.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Toogaslda
14
+ * @copyright Copyright (c) 2010 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_community.txt
16
+ */
17
+ class Toogas_Toogaslda_Block_Adminhtml_System_Config_Fieldset_Toogas
18
+ extends Mage_Adminhtml_Block_Abstract
19
+ implements Varien_Data_Form_Element_Renderer_Interface
20
+ {
21
+ protected $_template = 'toogas_toogaslda/system/config/fieldset/toogas.phtml';
22
+
23
+ public function render(Varien_Data_Form_Element_Abstract $element)
24
+ {
25
+ return $this->toHtml();
26
+ }
27
+ }
app/code/local/Toogas/Toogaslda/Helper/Data.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file licence_toogas_community.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_community.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Toogaslda
14
+ * @copyright Copyright (c) 2010 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_community.txt
16
+ */
17
+ class Toogas_Toogaslda_Helper_Data extends Mage_Core_Helper_Abstract
18
+ {
19
+
20
+
21
+
22
+
23
+ }
app/code/local/Toogas/Toogaslda/etc/config.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Toogas Lda.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA (End-User License Agreement)
9
+ * that is bundled with this package in the file licence_toogas_community.txt.
10
+ * It is also available at this URL:
11
+ * http://www.toogas.com/licences/toogas_community.txt
12
+ *
13
+ * @category Toogas
14
+ * @package Toogas_Toogaslda
15
+ * @copyright Copyright (c) 2010 Toogas Lda. (http://www.toogas.com)
16
+ * @license http://www.toogas.com/licences/toogas_community.txt
17
+ */
18
+ -->
19
+ <config>
20
+ <modules>
21
+ <Toogas_Toogaslda>
22
+ <version>1.0.0</version>
23
+ </Toogas_Toogaslda>
24
+ </modules>
25
+ <global>
26
+ <helpers>
27
+ <toogaslda>
28
+ <class>Toogas_Toogaslda_Helper</class>
29
+ </toogaslda>
30
+ </helpers>
31
+ <blocks>
32
+ <toogaslda>
33
+ <class>Toogas_Toogaslda_Block</class>
34
+ </toogaslda>
35
+ </blocks>
36
+ </global>
37
+ <adminhtml>
38
+ <translate>
39
+ <modules>
40
+ <Toogas_Toogaslda>
41
+ <files>
42
+ <default>Toogas_Toogaslda.csv</default>
43
+ </files>
44
+ </Toogas_Toogaslda>
45
+ </modules>
46
+ </translate>
47
+ <acl>
48
+ <resources>
49
+ <all>
50
+ <title>Allow Everything</title>
51
+ </all>
52
+ <admin>
53
+ <children>
54
+ <system>
55
+ <children>
56
+ <config>
57
+ <children>
58
+ <toogas_toogaslda>
59
+ <title>Toogas Lda. (Base)</title>
60
+ </toogas_toogaslda>
61
+ </children>
62
+ </config>
63
+ </children>
64
+ </system>
65
+ </children>
66
+ </admin>
67
+ </resources>
68
+ </acl>
69
+ </adminhtml>
70
+ </config>
app/code/local/Toogas/Toogaslda/etc/system.xml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Toogas Lda.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA (End-User License Agreement)
9
+ * that is bundled with this package in the file licence_toogas_community.txt.
10
+ * It is also available at this URL:
11
+ * http://www.toogas.com/licences/toogas_community.txt
12
+ *
13
+ * @category Toogas
14
+ * @package Toogas_Toogaslda
15
+ * @copyright Copyright (c) 2010 Toogas Lda. (http://www.toogas.com)
16
+ * @license http://www.toogas.com/licences/toogas_community.txt
17
+ */
18
+ -->
19
+ <config>
20
+ <tabs>
21
+ <toogaslda module="toogaslda">
22
+ <label>Toogas Lda.</label>
23
+ <sort_order>100</sort_order>
24
+ </toogaslda>
25
+ </tabs>
26
+ <sections>
27
+ <toogas_toogaslda translate="label" module="toogaslda">
28
+ <label>Contact Us</label>
29
+ <tab>toogaslda</tab>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>10000</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <groups>
36
+ <toogas_contact>
37
+ <frontend_model>toogaslda/adminhtml_system_config_fieldset_toogas</frontend_model>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>0</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
+ </toogas_contact>
44
+ </groups>
45
+ </toogas_toogaslda>
46
+ </sections>
47
+ </config>
app/design/adminhtml/default/default/layout/featuredpopup.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Toogas Lda.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA (End-User License Agreement)
9
+ * that is bundled with this package in the file toogas_license-free.txt.
10
+ * It is also available at this URL:
11
+ * http://www.toogas.com/licences/toogas_license-free.txt
12
+ *
13
+ * @category Toogas
14
+ * @package Toogas_Featuredpopup
15
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
16
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
17
+ */
18
+ -->
19
+ <layout version="0.1.0">
20
+ <featuredpopup_adminhtml_featuredpopup_index>
21
+ <reference name="content">
22
+ <block type="featuredpopup/adminhtml_featuredpopup" name="featuredpopup" />
23
+ </reference>
24
+ </featuredpopup_adminhtml_featuredpopup_index>
25
+ </layout>
app/design/adminhtml/default/default/template/toogas_toogaslda/system/config/fieldset/toogas.phtml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file licence_toogas_community.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_community.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Toogaslda
14
+ * @copyright Copyright (c) 2010 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_community.txt
16
+ */
17
+ ?>
18
+ <style>
19
+ .toogas-promo {
20
+ background:#EAF0EE url(<?php echo $this->getSkinUrl('images/toogas/toogas_logo.jpg') ?>) no-repeat scroll 5px center;
21
+ border:1px solid #CCCCCC;
22
+ margin-bottom:10px;
23
+ padding:10px 5px 5px 115px;
24
+ }
25
+ .toogas-promo h4, .toogas-promo p {
26
+ margin:0;
27
+ }
28
+ .toogas-promo h2 {
29
+ color:#444444;
30
+ font-size:1.4em;
31
+ line-height:1em;
32
+ }
33
+ .toogas-promo a {
34
+ text-decoration:none;
35
+ }
36
+
37
+ .save {
38
+ display: none;
39
+ }
40
+ </style>
41
+ <div class="toogas-promo">
42
+ <h4><?php echo Mage::helper('toogaslda')->__('Contact Toogas')?></h4>
43
+ <p><a href="http://www.toogas.com/contacts/"><?php echo Mage::helper('toogaslda')->__('Contact us!')?></a></p>
44
+ <p>&nbsp</p>
45
+ <p>&nbsp</p>
46
+ <p>&nbsp</p>
47
+ </div>
app/design/frontend/base/default/layout/toogas_featuredpopup.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Toogas Lda.
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the EULA (End-User License Agreement)
9
+ * that is bundled with this package in the file toogas_license-free.txt.
10
+ * It is also available at this URL:
11
+ * http://www.toogas.com/licences/toogas_license-free.txt
12
+ *
13
+ * @category Toogas
14
+ * @package Toogas_Featuredpopup
15
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
16
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
17
+ */
18
+ -->
19
+ <layout version="0.1.0">
20
+ <default>
21
+ <reference name="head">
22
+ <action method="addCss"><stylesheet>css/Toogas/Featuredpopup/default.css</stylesheet></action>
23
+ <action method="addJs"><script>toogas/featuredpopup/js/window.js</script></action>
24
+ </reference>
25
+ <!--
26
+ <reference name="after_body_start">
27
+ <block type="featuredpopup/featuredpopup" name="toogasfeaturedpopup" as="toogasfeaturedpopup" template="toogas_featuredpopup/featuredpopup.phtml" />
28
+ </reference>
29
+ -->
30
+ </default>
31
+ </layout>
32
+
33
+
app/design/frontend/base/default/template/toogas_featuredpopup/featuredpopup.phtml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Toogas Lda.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA (End-User License Agreement)
8
+ * that is bundled with this package in the file toogas_license-free.txt.
9
+ * It is also available at this URL:
10
+ * http://www.toogas.com/licences/toogas_license-free.txt
11
+ *
12
+ * @category Toogas
13
+ * @package Toogas_Featuredpopup
14
+ * @copyright Copyright (c) 2011 Toogas Lda. (http://www.toogas.com)
15
+ * @license http://www.toogas.com/licences/toogas_license-free.txt
16
+ */
17
+ if ( $this->okShowPopup ) :
18
+ $width = $this->obtainWidthImage(); $height = $this->obtainHeightImage(); $src_img = $this->obtainImage(); $href_link = $this->obtainUrl(); $opacity = $this->obtainOpacity(); $open_timer = $this->obtainDelayStart(); $close_timer = $this->obtainDelayClose() ?>
19
+ <div id="toogas_pop_up" onclick="closePopUp();"></div>
20
+ <img id="img_pop_up" src='<?php echo $src_img ?>' style="display:none">
21
+ <script type="text/javascript">
22
+ <?php if (is_numeric($width) && $width > 0 && is_numeric($height) && $height > 0) : ?>
23
+ var width_img = <?php echo $width ?> ;
24
+ var height_img = <?php echo $height ?>;
25
+ <?php else : ?>
26
+ var width_img = $('img_pop_up').getWidth();
27
+ var height_img = $('img_pop_up').getHeight();
28
+ <?php endif ?>
29
+ var win = new Window({className: "mac_os_x", width: width_img, height: height_img, zIndex: 10000, resizable: true, title: "", showEffect:Effect.Grow, hideEffect: Effect.SwitchOff, draggable:false, wiredDrag:true});
30
+ <?php if (is_numeric($open_timer) && $open_timer > 0) : ?>
31
+ setTimeout("initialParams(win);",<? echo $open_timer * 1000; ?>);
32
+ <?php else : ?>
33
+ initialParams(win);
34
+ <?php endif ?>
35
+ function initialParams(win)
36
+ {
37
+ $('toogas_pop_up').style.width = '100%';
38
+ $('toogas_pop_up').style.height = '100%';
39
+ <?php if (is_numeric($opacity) && $opacity > 0) : ?>
40
+ $('toogas_pop_up').setOpacity(<?php echo $opacity ?>);
41
+ <?php else : ?>
42
+ $('toogas_pop_up').setOpacity(0.4);
43
+ <?php endif ?>
44
+ $('toogas_pop_up').style.position = 'fixed';
45
+ $('toogas_pop_up').style.top = '0px';
46
+ $('toogas_pop_up').style.zIndex = '5000';
47
+ $('toogas_pop_up').style.backgroundColor = '#000000';
48
+ <?php if (is_numeric($width) && $width > 0 && is_numeric($height) && $height > 0) : ?>
49
+ win.getContent().innerHTML= "<div id='toogas'><?php if ($href_link) : ?><a href='<?php echo $href_link ?>'><img src='<?php echo $src_img ?>' style='width:<?php echo $width?>px;height:<?php echo $height?>px'></a><?php else : ?><img src='<?php echo $src_img ?>' style='width:<?php echo $width?>px;height:<?php echo $height?>px;'><?php endif ?></div>"
50
+ <?php else : ?>
51
+ win.getContent().innerHTML= "<div id='toogas'><?php if ($href_link) : ?><a href='<?php echo $href_link ?>'><img src='<?php echo $src_img ?>'></a><?php else : ?><img src='<?php echo $src_img ?>'><?php endif ?></div>"
52
+ <?php endif ?>
53
+ win.showCenter();
54
+ Event.observe('toogas', 'click', closePopUp, false);
55
+ <?php if (is_numeric($close_timer) && $close_timer > 0) { ?>
56
+ self.setTimeout("closePopUp();", <? echo $close_timer * 1000; ?>);
57
+ <?php } ?>
58
+ }
59
+
60
+ function closePopUp()
61
+ {
62
+ $('toogas_pop_up').style.width = '';
63
+ $('toogas_pop_up').style.height = '';
64
+ $('toogas_pop_up').setOpacity(1);
65
+ $('toogas_pop_up').style.position = '';
66
+ $('toogas_pop_up').style.top = '';
67
+ $('toogas_pop_up').style.zIndex = '';
68
+ $('toogas_pop_up').style.backgroundColor = '';
69
+ win.close();
70
+ }
71
+ </script>
72
+ <?php endif ?>
app/etc/modules/Toogas_Featuredpopup.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Toogas_Featuredpopup>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Toogas_Featuredpopup>
8
+ </modules>
9
+ </config>
app/locale/en_GB/Toogas_Featuredpopup.csv ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Range of dates wrong","Range of dates wrong"
2
+ "Item does not exist","Item does not exist"
3
+ "The featured popup has been saved.","The featured popup has been saved."
4
+ "Unable to find item to save","Unable to find item to save"
5
+ "Disabled","Disabled"
6
+ "Enabled","Enabled"
7
+ "Featured Popup","Featured Popup"
8
+ "Add Featured Popup","Add Featured Popup"
9
+ "ID","ID"
10
+ "Name","Name"
11
+ "Link","Link"
12
+ "From:","From:"
13
+ "To:","To:"
14
+ "Status","Status"
15
+ "Store View","Store View"
16
+ "Action","Action"
17
+ "Edit","Edit"
18
+ "Delete","Delete"
19
+ "Are you sure?","Are you sure?"
20
+ "Save","Save"
21
+ "Edit Featured Popup '%s'","Edit Featured Popup '%s'"
22
+ "New Featured Popup","New Featured Popup"
23
+ "Popup Image","Popup Image"
24
+ "Width Image","Width Image"
25
+ "Height Image","Height Image"
26
+ "Url","Url"
27
+ "Delay Start","Delay Start"
28
+ "Delay Close","Delay Close"
29
+ "Priority","Priority"
30
+ "Opacity","Opacity"
31
+ "Please upload an image.","Please upload an image."
32
+ "Add New Image","Add New Image"
33
+ "Assigned Images","Assigned Images"
34
+ "Date Settings","Date Settings"
35
+ "Popup Settings","Popup Settings"
app/locale/en_GB/Toogas_Toogaslda.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Contact Us","Contact us"
2
+ "Contact Toogas","Contact Toogas"
3
+ "Contact us!","Contact us!"
app/locale/en_US/Toogas_Featuredpopup.csv ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Range of dates wrong","Range of dates wrong"
2
+ "Item does not exist","Item does not exist"
3
+ "The featured popup has been saved.","The featured popup has been saved."
4
+ "Unable to find item to save","Unable to find item to save"
5
+ "Disabled","Disabled"
6
+ "Enabled","Enabled"
7
+ "Featured Popup","Featured Popup"
8
+ "Add Featured Popup","Add Featured Popup"
9
+ "ID","ID"
10
+ "Name","Name"
11
+ "Link","Link"
12
+ "From:","From:"
13
+ "To:","To:"
14
+ "Status","Status"
15
+ "Store View","Store View"
16
+ "Action","Action"
17
+ "Edit","Edit"
18
+ "Delete","Delete"
19
+ "Are you sure?","Are you sure?"
20
+ "Save","Save"
21
+ "Edit Featured Popup '%s'","Edit Featured Popup '%s'"
22
+ "New Featured Popup","New Featured Popup"
23
+ "Popup Image","Popup Image"
24
+ "Width Image","Width Image"
25
+ "Height Image","Height Image"
26
+ "Url","Url"
27
+ "Delay Start","Delay Start"
28
+ "Delay Close","Delay Close"
29
+ "Priority","Priority"
30
+ "Opacity","Opacity"
31
+ "Please upload an image.","Please upload an image."
32
+ "Add New Image","Add New Image"
33
+ "Assigned Images","Assigned Images"
34
+ "Date Settings","Date Settings"
35
+ "Popup Settings","Popup Settings"
app/locale/en_US/Toogas_Toogaslda.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Contact Us","Contact us"
2
+ "Contact Toogas","Contact Toogas"
3
+ "Contact us!","Contact us!"
app/locale/es_ES/Toogas_Featuredpopup.csv ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Range of dates wrong","Intervalo de Fechas Erroneo"
2
+ "Item does not exist","Item no existe"
3
+ "The featured popup has been saved.","La Ventana ha sido grabada."
4
+ "Unable to find item to save","Item no encontrado"
5
+ "Disabled","Discapacitado"
6
+ "Enabled","Activo"
7
+ "Featured Popup","Ventana de Destaque"
8
+ "Add Featured Popup","Anadir Ventana Popup"
9
+ "ID","ID"
10
+ "Name","Nombre"
11
+ "Link","Link"
12
+ "From:","De:"
13
+ "To:","Para:"
14
+ "Status","Estado"
15
+ "Store View","Vista de Tienda"
16
+ "Action","Accion"
17
+ "Edit","Editar"
18
+ "Delete","Borrar"
19
+ "Are you sure?","Esta Seguro?"
20
+ "Save","Grabar"
21
+ "Edit Featured Popup '%s'","Editar Ventana '%s'"
22
+ "New Featured Popup","Nueva Ventana"
23
+ "Popup Image","Imagen da Popup"
24
+ "Width Image","Ancho Imagen"
25
+ "Height Image","Altura Imagen"
26
+ "Url","Url"
27
+ "Delay Start","Tiempo (segundos) hasta Apertura de la Ventana"
28
+ "Delay Close","Tiempo (segundos) hasta Cierre de la Ventana"
29
+ "Priority","Prioridad"
30
+ "Opacity","Opacidad"
31
+ "Please upload an image.","Por favor suba una imagen"
32
+ "Add New Image","Anadir Nueva Imagen"
33
+ "Assigned Images","Imagenes Associadas"
34
+ "Date Settings","Parámetros de las Fechas"
35
+ "Popup Settings","Parámetros de la Ventana"
app/locale/es_ES/Toogas_Toogaslda.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Contact Us","Contacte con nosotros"
2
+ "Contact Toogas","Póngase en contacto con Toogas"
3
+ "Contact us!","Contacte con nosotros!"
app/locale/pt_BR/Toogas_Featuredpopup.csv ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Range of dates wrong","Intevalo de datas errado"
2
+ "Item does not exist","O Item não existe"
3
+ "The featured popup has been saved.","A Featured Popup foi gravada com sucesso."
4
+ "Unable to find item to save","Não foi possível encontrar o registo para gravação."
5
+ "Disabled","Não activo"
6
+ "Enabled","Activo"
7
+ "Featured Popup","Featured Popup"
8
+ "Add Featured Popup","Adicionar Featured Popup"
9
+ "ID","ID"
10
+ "Name","Nome"
11
+ "Link","Link"
12
+ "From:","De:"
13
+ "To:","Até:"
14
+ "Status","Estado"
15
+ "Store View","Vista de Loja"
16
+ "Action","Acção"
17
+ "Edit","Editar"
18
+ "Delete","Apagar"
19
+ "Are you sure?","Tem a certeza?"
20
+ "Save","Gravar"
21
+ "Edit Featured Popup '%s'","Editar a Featured Popup '%s'"
22
+ "New Featured Popup","Nova Featured Popup"
23
+ "Popup Image","Imagem do Popup"
24
+ "Width Image","Largura da Imagem"
25
+ "Height Image","Altura da Imagem"
26
+ "Url","Url"
27
+ "Delay Start","Tempo de espera para abertura"
28
+ "Delay Close","Tempo de espera para fechar"
29
+ "Priority","Prioridade"
30
+ "Opacity","Opacidade"
31
+ "Please upload an image.","Por favor faça upload de uma imagem."
32
+ "Add New Image","Adicionar Nova Imagem"
33
+ "Assigned Images","Imagens Associadas"
34
+ "Date Settings","Configuração das Datas"
35
+ "Popup Settings","Configuração do Popup"
app/locale/pt_BR/Toogas_Toogaslda.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Contact Us","Contacte-nos"
2
+ "Information about Toogas","Sobre a Toogas!"
3
+ "Contact us!","Contacte-nos!"
app/locale/pt_PT/Toogas_Featuredpopup.csv ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Range of dates wrong","Intevalo de datas errado"
2
+ "Item does not exist","O Item não existe"
3
+ "The featured popup has been saved.","A Featured Popup foi gravada com sucesso."
4
+ "Unable to find item to save","Não foi possível encontrar o registo para gravação."
5
+ "Disabled","Não activo"
6
+ "Enabled","Activo"
7
+ "Featured Popup","Featured Popup"
8
+ "Add Featured Popup","Adicionar Featured Popup"
9
+ "ID","ID"
10
+ "Name","Nome"
11
+ "Link","Link"
12
+ "From:","De:"
13
+ "To:","Até:"
14
+ "Status","Estado"
15
+ "Store View","Vista de Loja"
16
+ "Action","Acção"
17
+ "Edit","Editar"
18
+ "Delete","Apagar"
19
+ "Are you sure?","Tem a certeza?"
20
+ "Save","Gravar"
21
+ "Edit Featured Popup '%s'","Editar a Featured Popup '%s'"
22
+ "New Featured Popup","Nova Featured Popup"
23
+ "Popup Image","Imagem do Popup"
24
+ "Width Image","Largura da Imagem"
25
+ "Height Image","Altura da Imagem"
26
+ "Url","Url"
27
+ "Delay Start","Tempo de espera para abertura"
28
+ "Delay Close","Tempo de espera para fechar"
29
+ "Priority","Prioridade"
30
+ "Opacity","Opacidade"
31
+ "Please upload an image.","Por favor faça upload de uma imagem."
32
+ "Add New Image","Adicionar Nova Imagem"
33
+ "Assigned Images","Imagens Associadas"
34
+ "Date Settings","Configuração das Datas"
35
+ "Popup Settings","Configuração do Popup"
app/locale/pt_PT/Toogas_Toogaslda.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Contact Us","Contacte-nos"
2
+ "Information about Toogas","Sobre a Toogas!"
3
+ "Contact us!","Contacte-nos!"
js/toogas/featuredpopup/js/window.js ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ var Window=Class.create();Window.keepMultiModalWindow=false;Window.hasEffectLib=(typeof Effect!='undefined');Window.resizeEffectDuration=0.4;Window.prototype={initialize:function(){var id;var optionIndex=0;if(arguments.length>0){if(typeof arguments[0]=="string"){id=arguments[0];optionIndex=1;}
3
+ else
4
+ id=arguments[0]?arguments[0].id:null;}
5
+ if(!id)
6
+ id="window_"+new Date().getTime();if($(id))
7
+ alert("Window "+id+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");this.options=Object.extend({className:"dialog",blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:"&nbsp;",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[optionIndex]||{});if(this.options.blurClassName)
8
+ this.options.focusClassName=this.options.className;if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined")
9
+ this.options.top=this._round(Math.random()*500,this.options.gridY);if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined")
10
+ this.options.left=this._round(Math.random()*500,this.options.gridX);if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear)
11
+ this.options.showEffectOptions.to=this.options.opacity;}
12
+ if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear)
13
+ this.options.showEffectOptions.to=this.options.opacity;if(this.options.hideEffect==Effect.Fade)
14
+ this.options.hideEffectOptions.from=this.options.opacity;}
15
+ if(this.options.hideEffect==Element.hide)
16
+ this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose)this.destroy();}.bind(this)
17
+ if(this.options.parent!=document.body)
18
+ this.options.parent=$(this.options.parent);this.element=this._createWindow(id);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var that=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(element){element.observe("mousedown",that.eventMouseDown);element.addClassName("top_draggable");});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(element){element.observe("mousedown",that.eventMouseDown);element.addClassName("bottom_draggable");});}
19
+ if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown);}
20
+ this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+'px'});this.useLeft=true;}
21
+ else{this.element.setStyle({right:parseFloat(this.options.right)+'px'});this.useLeft=false;}
22
+ if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+'px'});this.useTop=true;}
23
+ else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+'px'});this.useTop=false;}
24
+ this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex)
25
+ this.setZIndex(this.options.zIndex)
26
+ if(this.options.destroyOnClose)
27
+ this.setDestroyOnClose(true);this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height)
28
+ this.setSize(this.options.width,this.options.height);this.setTitle(this.options.title)
29
+ Windows.register(this);},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var content=this.getContent();var originalContent=null;for(var i=0;i<content.childNodes.length;i++){originalContent=content.childNodes[i];if(originalContent.nodeType==1)
30
+ break;originalContent=null;}
31
+ if(originalContent)
32
+ this._oldParent.appendChild(originalContent);this._oldParent=null;}
33
+ if(this.sizer)
34
+ Event.stopObserving(this.sizer,"mousedown",this.eventMouseDown);if(this.options.url)
35
+ this.content.src=null
36
+ if(this.iefix)
37
+ Element.remove(this.iefix);Element.remove(this.element);Windows.unregister(this);},setCloseCallback:function(callback){this.options.closeCallback=callback;},getContent:function(){return this.content;},setContent:function(id,autoresize,autoposition){var element=$(id);if(null==element)throw"Unable to find element '"+id+"' in DOM";this._oldParent=element.parentNode;var d=null;var p=null;if(autoresize)
38
+ d=Element.getDimensions(element);if(autoposition)
39
+ p=Position.cumulativeOffset(element);var content=this.getContent();this.setHTMLContent("");content=this.getContent();content.appendChild(element);element.show();if(autoresize)
40
+ this.setSize(d.width,d.height);if(autoposition)
41
+ this.setLocation(p[1]-this.heightN,p[0]-this.widthW);},setHTMLContent:function(html){if(this.options.url){this.content.src=null;this.options.url=null;var content="<div id=\""+this.getId()+"_content\" class=\""+this.options.className+"_content\"> </div>";$(this.getId()+"_table_content").innerHTML=content;this.content=$(this.element.id+"_content");}
42
+ this.getContent().innerHTML=html;},setAjaxContent:function(url,options,showCentered,showModal){this.showFunction=showCentered?"showCenter":"show";this.showModal=showModal||false;options=options||{};this.setHTMLContent("");this.onComplete=options.onComplete;if(!this._onCompleteHandler)
43
+ this._onCompleteHandler=this._setAjaxContent.bind(this);options.onComplete=this._onCompleteHandler;new Ajax.Request(url,options);options.onComplete=this.onComplete;},_setAjaxContent:function(originalRequest){Element.update(this.getContent(),originalRequest.responseText);if(this.onComplete)
44
+ this.onComplete(originalRequest);this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(url){if(this.options.url)
45
+ this.content.src=null;this.options.url=url;var content="<iframe frameborder='0' name='"+this.getId()+"_content' id='"+this.getId()+"_content' src='"+url+"' width='"+this.width+"' height='"+this.height+"'> </iframe>";$(this.getId()+"_table_content").innerHTML=content;this.content=$(this.element.id+"_content");},getURL:function(){return this.options.url?this.options.url:null;},refresh:function(){if(this.options.url)
46
+ $(this.element.getAttribute('id')+'_content').src=this.options.url;},setCookie:function(name,expires,path,domain,secure){name=name||this.element.id;this.cookie=[name,expires,path,domain,secure];var value=WindowUtilities.getCookie(name)
47
+ if(value){var values=value.split(',');var x=values[0].split(':');var y=values[1].split(':');var w=parseFloat(values[2]),h=parseFloat(values[3]);var mini=values[4];var maxi=values[5];this.setSize(w,h);if(mini=="true")
48
+ this.doMinimize=true;else if(maxi=="true")
49
+ this.doMaximize=true;this.useLeft=x[0]=="l";this.useTop=y[0]=="t";this.element.setStyle(this.useLeft?{left:x[1]}:{right:x[1]});this.element.setStyle(this.useTop?{top:y[1]}:{bottom:y[1]});}},getId:function(){return this.element.id;},setDestroyOnClose:function(){this.options.destroyOnClose=true;},setConstraint:function(bool,padding){this.constraint=bool;this.constraintPad=Object.extend(this.constraintPad,padding||{});if(this.useTop&&this.useLeft)
50
+ this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left));},_initDrag:function(event){if(Event.element(event)==this.sizer&&this.isMinimized())
51
+ return;if(Event.element(event)!=this.sizer&&this.isMaximized())
52
+ return;if(Prototype.Browser.IE&&this.heightN==0)
53
+ this._getWindowBorderSize();this.pointer=[this._round(Event.pointerX(event),this.options.gridX),this._round(Event.pointerY(event),this.options.gridY)];if(this.options.wiredDrag)
54
+ this.currentDrag=this._createWiredElement();else
55
+ this.currentDrag=this.element;if(Event.element(event)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle('bottom'));this.rightOrg=parseFloat(this.element.getStyle('right'));this._notify("onStartResize");}
56
+ else{this.doResize=false;var closeButton=$(this.getId()+'_close');if(closeButton&&Position.within(closeButton,this.pointer[0],this.pointer[1])){this.currentDrag=null;return;}
57
+ this.toFront();if(!this.options.draggable)
58
+ return;this._notify("onStartMove");}
59
+ Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen('__invisible__','__invisible__',this.overlayOpacity);document.body.ondrag=function(){return false;};document.body.onselectstart=function(){return false;};this.currentDrag.show();Event.stop(event);},_round:function(val,round){return round==1?val:val=Math.floor(val/round)*round;},_updateDrag:function(event){var pointer=[this._round(Event.pointerX(event),this.options.gridX),this._round(Event.pointerY(event),this.options.gridY)];var dx=pointer[0]-this.pointer[0];var dy=pointer[1]-this.pointer[1];if(this.doResize){var w=this.widthOrg+dx;var h=this.heightOrg+dy;dx=this.width-this.widthOrg
60
+ dy=this.height-this.heightOrg
61
+ if(this.useLeft)
62
+ w=this._updateWidthConstraint(w)
63
+ else
64
+ this.currentDrag.setStyle({right:(this.rightOrg-dx)+'px'});if(this.useTop)
65
+ h=this._updateHeightConstraint(h)
66
+ else
67
+ this.currentDrag.setStyle({bottom:(this.bottomOrg-dy)+'px'});this.setSize(w,h);this._notify("onResize");}
68
+ else{this.pointer=pointer;if(this.useLeft){var left=parseFloat(this.currentDrag.getStyle('left'))+dx;var newLeft=this._updateLeftConstraint(left);this.pointer[0]+=newLeft-left;this.currentDrag.setStyle({left:newLeft+'px'});}
69
+ else
70
+ this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle('right'))-dx+'px'});if(this.useTop){var top=parseFloat(this.currentDrag.getStyle('top'))+dy;var newTop=this._updateTopConstraint(top);this.pointer[1]+=newTop-top;this.currentDrag.setStyle({top:newTop+'px'});}
71
+ else
72
+ this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle('bottom'))-dy+'px'});this._notify("onMove");}
73
+ if(this.iefix)
74
+ this._fixIEOverlapping();this._removeStoreLocation();Event.stop(event);},_endDrag:function(event){WindowUtilities.enableScreen('__invisible__');if(this.doResize)
75
+ this._notify("onEndResize");else
76
+ this._notify("onEndMove");Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(event);this._hideWiredElement();this._saveCookie()
77
+ document.body.ondrag=null;document.body.onselectstart=null;},_updateLeftConstraint:function(left){if(this.constraint&&this.useLeft&&this.useTop){var width=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(left<this.constraintPad.left)
78
+ left=this.constraintPad.left;if(left+this.width+this.widthE+this.widthW>width-this.constraintPad.right)
79
+ left=width-this.constraintPad.right-this.width-this.widthE-this.widthW;}
80
+ return left;},_updateTopConstraint:function(top){if(this.constraint&&this.useLeft&&this.useTop){var height=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var h=this.height+this.heightN+this.heightS;if(top<this.constraintPad.top)
81
+ top=this.constraintPad.top;if(top+h>height-this.constraintPad.bottom)
82
+ top=height-this.constraintPad.bottom-h;}
83
+ return top;},_updateWidthConstraint:function(w){if(this.constraint&&this.useLeft&&this.useTop){var width=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var left=parseFloat(this.element.getStyle("left"));if(left+w+this.widthE+this.widthW>width-this.constraintPad.right)
84
+ w=width-this.constraintPad.right-left-this.widthE-this.widthW;}
85
+ return w;},_updateHeightConstraint:function(h){if(this.constraint&&this.useLeft&&this.useTop){var height=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var top=parseFloat(this.element.getStyle("top"));if(top+h+this.heightN+this.heightS>height-this.constraintPad.bottom)
86
+ h=height-this.constraintPad.bottom-top-this.heightN-this.heightS;}
87
+ return h;},_createWindow:function(id){var className=this.options.className;var win=document.createElement("div");win.setAttribute('id',id);win.className="dialog";var content;if(this.options.url)
88
+ content="<iframe frameborder=\"0\" name=\""+id+"_content\" id=\""+id+"_content\" src=\""+this.options.url+"\"> </iframe>";else
89
+ content="<div id=\""+id+"_content\" class=\""+className+"_content\"> </div>";var closeDiv=this.options.closable?"<div class='"+className+"_close' id='"+id+"_close' onclick='Windows.close(\""+id+"\", event)'> </div>":"";var minDiv=this.options.minimizable?"<div class='"+className+"_minimize' id='"+id+"_minimize' onclick='Windows.minimize(\""+id+"\", event)'> </div>":"";var maxDiv=this.options.maximizable?"<div class='"+className+"_maximize' id='"+id+"_maximize' onclick='Windows.maximize(\""+id+"\", event)'> </div>":"";var seAttributes=this.options.resizable?"class='"+className+"_sizer' id='"+id+"_sizer'":"class='"+className+"_se'";var blank="../themes/default/blank.gif";win.innerHTML=closeDiv+minDiv+maxDiv+"\
90
+ <table id='"+id+"_row1' class=\"top table_window\">\
91
+ <tr>\
92
+ <td class='"+className+"_nw'></td>\
93
+ <td class='"+className+"_n'><div id='"+id+"_top' class='"+className+"_title title_window'>"+this.options.title+"</div></td>\
94
+ <td class='"+className+"_ne'></td>\
95
+ </tr>\
96
+ </table>\
97
+ <table id='"+id+"_row2' class=\"mid table_window\">\
98
+ <tr>\
99
+ <td class='"+className+"_w'></td>\
100
+ <td id='"+id+"_table_content' class='"+className+"_content' valign='top'>"+content+"</td>\
101
+ <td class='"+className+"_e'></td>\
102
+ </tr>\
103
+ </table>\
104
+ <table id='"+id+"_row3' class=\"bot table_window\">\
105
+ <tr>\
106
+ <td class='"+className+"_sw'></td>\
107
+ <td class='"+className+"_s'><div id='"+id+"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\
108
+ <td "+seAttributes+"></td>\
109
+ </tr>\
110
+ </table>\
111
+ ";Element.hide(win);this.options.parent.insertBefore(win,this.options.parent.firstChild);Event.observe($(id+"_content"),"load",this.options.onload);return win;},changeClassName:function(newClassName){var className=this.options.className;var id=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(value){this._toggleClassName($(id+value),className+value,newClassName+value)}.bind(this));this._toggleClassName($(id+"_top"),className+"_title",newClassName+"_title");$$("#"+id+" td").each(function(td){td.className=td.className.sub(className,newClassName);});this.options.className=newClassName;},_toggleClassName:function(element,oldClassName,newClassName){if(element){element.removeClassName(oldClassName);element.addClassName(newClassName);}},setLocation:function(top,left){top=this._updateTopConstraint(top);left=this._updateLeftConstraint(left);var e=this.currentDrag||this.element;e.setStyle({top:top+'px'});e.setStyle({left:left+'px'});this.useLeft=true;this.useTop=true;},getLocation:function(){var location={};if(this.useTop)
112
+ location=Object.extend(location,{top:this.element.getStyle("top")});else
113
+ location=Object.extend(location,{bottom:this.element.getStyle("bottom")});if(this.useLeft)
114
+ location=Object.extend(location,{left:this.element.getStyle("left")});else
115
+ location=Object.extend(location,{right:this.element.getStyle("right")});return location;},getSize:function(){return{width:this.width,height:this.height};},setSize:function(width,height,useEffect){width=parseFloat(width);height=parseFloat(height);if(!this.minimized&&width<this.options.minWidth)
116
+ width=this.options.minWidth;if(!this.minimized&&height<this.options.minHeight)
117
+ height=this.options.minHeight;if(this.options.maxHeight&&height>this.options.maxHeight)
118
+ height=this.options.maxHeight;if(this.options.maxWidth&&width>this.options.maxWidth)
119
+ width=this.options.maxWidth;if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&useEffect){new Effect.ResizeWindow(this,null,null,width,height,{duration:Window.resizeEffectDuration});}else{this.width=width;this.height=height;var e=this.currentDrag?this.currentDrag:this.element;e.setStyle({width:width+this.widthW+this.widthE+"px"})
120
+ e.setStyle({height:height+this.heightN+this.heightS+"px"})
121
+ if(!this.currentDrag||this.currentDrag==this.element){var content=$(this.element.id+'_content');content.setStyle({height:height+'px'});content.setStyle({width:width+'px'});}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true);},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true);},toFront:function(){if(this.element.style.zIndex<Windows.maxZIndex)
122
+ this.setZIndex(Windows.maxZIndex+1);if(this.iefix)
123
+ this._fixIEOverlapping();},getBounds:function(insideOnly){if(!this.width||!this.height||!this.visible)
124
+ this.computeBounds();var w=this.width;var h=this.height;if(!insideOnly){w+=this.widthW+this.widthE;h+=this.heightN+this.heightS;}
125
+ var bounds=Object.extend(this.getLocation(),{width:w+"px",height:h+"px"});return bounds;},computeBounds:function(){if(!this.width||!this.height){var size=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0,this.options.className)
126
+ if(this.height)
127
+ this.width=size+5
128
+ else
129
+ this.height=size+5}
130
+ this.setSize(this.width,this.height);if(this.centered)
131
+ this._center(this.centerTop,this.centerLeft);},show:function(modal){this.visible=true;if(modal){if(typeof this.overlayOpacity=="undefined"){var that=this;setTimeout(function(){that.show(modal)},10);return;}
132
+ Windows.addModalWindow(this);this.modal=true;this.setZIndex(Windows.maxZIndex+1);Windows.unsetOverflow(this);}
133
+ else
134
+ if(!this.element.style.zIndex)
135
+ this.setZIndex(Windows.maxZIndex+1);if(this.oldStyle)
136
+ this.getContent().setStyle({overflow:this.oldStyle});this.computeBounds();this._notify("onBeforeShow");if(this.options.showEffect!=Element.show&&this.options.showEffectOptions)
137
+ this.options.showEffect(this.element,this.options.showEffectOptions);else
138
+ this.options.showEffect(this.element);this._checkIEOverlapping();WindowUtilities.focusedWindow=this
139
+ this._notify("onShow");},showCenter:function(modal,top,left){this.centered=true;this.centerTop=top;this.centerLeft=left;this.show(modal);},isVisible:function(){return this.visible;},_center:function(top,left){var windowScroll=WindowUtilities.getWindowScroll(this.options.parent);var pageSize=WindowUtilities.getPageSize(this.options.parent);if(typeof top=="undefined")
140
+ top=(pageSize.windowHeight-(this.height+this.heightN+this.heightS))/2;top+=windowScroll.top
141
+ if(typeof left=="undefined")
142
+ left=(pageSize.windowWidth-(this.width+this.widthW+this.widthE))/2;left+=windowScroll.left
143
+ this.setLocation(top,left);this.toFront();},_recenter:function(event){if(this.centered){var pageSize=WindowUtilities.getPageSize(this.options.parent);var windowScroll=WindowUtilities.getWindowScroll(this.options.parent);if(this.pageSize&&this.pageSize.windowWidth==pageSize.windowWidth&&this.pageSize.windowHeight==pageSize.windowHeight&&this.windowScroll.left==windowScroll.left&&this.windowScroll.top==windowScroll.top)
144
+ return;this.pageSize=pageSize;this.windowScroll=windowScroll;if($('overlay_modal'))
145
+ $('overlay_modal').setStyle({height:(pageSize.pageHeight+'px')});if(this.options.recenterAuto)
146
+ this._center(this.centerTop,this.centerLeft);}},hide:function(){this.visible=false;if(this.modal){Windows.removeModalWindow(this);Windows.resetOverflow();}
147
+ this.oldStyle=this.getContent().getStyle('overflow')||"auto"
148
+ this.getContent().setStyle({overflow:"hidden"});this.options.hideEffect(this.element,this.options.hideEffectOptions);if(this.iefix)
149
+ this.iefix.hide();if(!this.doNotNotifyHide)
150
+ this._notify("onHide");},close:function(){if(this.visible){if(this.options.closeCallback&&!this.options.closeCallback(this))
151
+ return;if(this.options.destroyOnClose){var destroyFunc=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var func=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){func();destroyFunc()}}
152
+ else
153
+ this.options.hideEffectOptions.afterFinish=function(){destroyFunc()}}
154
+ Windows.updateFocusedWindow();this.doNotNotifyHide=true;this.hide();this.doNotNotifyHide=false;this._notify("onClose");}},minimize:function(){if(this.resizing)
155
+ return;var r2=$(this.getId()+"_row2");if(!this.minimized){this.minimized=true;var dh=r2.getDimensions().height;this.r2Height=dh;var h=this.element.getHeight()-dh;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,null,null,null,this.height-dh,{duration:Window.resizeEffectDuration});}else{this.height-=dh;this.element.setStyle({height:h+"px"});r2.hide();}
156
+ if(!this.useTop){var bottom=parseFloat(this.element.getStyle('bottom'));this.element.setStyle({bottom:(bottom+dh)+'px'});}}
157
+ else{this.minimized=false;var dh=this.r2Height;this.r2Height=null;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,null,null,null,this.height+dh,{duration:Window.resizeEffectDuration});}
158
+ else{var h=this.element.getHeight()+dh;this.height+=dh;this.element.setStyle({height:h+"px"})
159
+ r2.show();}
160
+ if(!this.useTop){var bottom=parseFloat(this.element.getStyle('bottom'));this.element.setStyle({bottom:(bottom-dh)+'px'});}
161
+ this.toFront();}
162
+ this._notify("onMinimize");this._saveCookie()},maximize:function(){if(this.isMinimized()||this.resizing)
163
+ return;if(Prototype.Browser.IE&&this.heightN==0)
164
+ this._getWindowBorderSize();if(this.storedLocation!=null){this._restoreLocation();if(this.iefix)
165
+ this.iefix.hide();}
166
+ else{this._storeLocation();Windows.unsetOverflow(this);var windowScroll=WindowUtilities.getWindowScroll(this.options.parent);var pageSize=WindowUtilities.getPageSize(this.options.parent);var left=windowScroll.left;var top=windowScroll.top;if(this.options.parent!=document.body){windowScroll={top:0,left:0,bottom:0,right:0};var dim=this.options.parent.getDimensions();pageSize.windowWidth=dim.width;pageSize.windowHeight=dim.height;top=0;left=0;}
167
+ if(this.constraint){pageSize.windowWidth-=Math.max(0,this.constraintPad.left)+Math.max(0,this.constraintPad.right);pageSize.windowHeight-=Math.max(0,this.constraintPad.top)+Math.max(0,this.constraintPad.bottom);left+=Math.max(0,this.constraintPad.left);top+=Math.max(0,this.constraintPad.top);}
168
+ var width=pageSize.windowWidth-this.widthW-this.widthE;var height=pageSize.windowHeight-this.heightN-this.heightS;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,top,left,width,height,{duration:Window.resizeEffectDuration});}
169
+ else{this.setSize(width,height);this.element.setStyle(this.useLeft?{left:left}:{right:left});this.element.setStyle(this.useTop?{top:top}:{bottom:top});}
170
+ this.toFront();if(this.iefix)
171
+ this._fixIEOverlapping();}
172
+ this._notify("onMaximize");this._saveCookie()},isMinimized:function(){return this.minimized;},isMaximized:function(){return(this.storedLocation!=null);},setOpacity:function(opacity){if(Element.setOpacity)
173
+ Element.setOpacity(this.element,opacity);},setZIndex:function(zindex){this.element.setStyle({zIndex:zindex});Windows.updateZindex(zindex,this);},setTitle:function(newTitle){if(!newTitle||newTitle=="")
174
+ newTitle="&nbsp;";Element.update(this.element.id+'_top',newTitle);},getTitle:function(){return $(this.element.id+'_top').innerHTML;},setStatusBar:function(element){var statusBar=$(this.getId()+"_bottom");if(typeof(element)=="object"){if(this.bottombar.firstChild)
175
+ this.bottombar.replaceChild(element,this.bottombar.firstChild);else
176
+ this.bottombar.appendChild(element);}
177
+ else
178
+ this.bottombar.innerHTML=element;},_checkIEOverlapping:function(){if(!this.iefix&&(navigator.appVersion.indexOf('MSIE')>0)&&(navigator.userAgent.indexOf('Opera')<0)&&(this.element.getStyle('position')=='absolute')){new Insertion.After(this.element.id,'<iframe id="'+this.element.id+'_iefix" '+'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" '+'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.element.id+'_iefix');}
179
+ if(this.iefix)
180
+ setTimeout(this._fixIEOverlapping.bind(this),50);},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show();},_getWindowBorderSize:function(event){var div=this._createHiddenDiv(this.options.className+"_n")
181
+ this.heightN=Element.getDimensions(div).height;div.parentNode.removeChild(div)
182
+ var div=this._createHiddenDiv(this.options.className+"_s")
183
+ this.heightS=Element.getDimensions(div).height;div.parentNode.removeChild(div)
184
+ var div=this._createHiddenDiv(this.options.className+"_e")
185
+ this.widthE=Element.getDimensions(div).width;div.parentNode.removeChild(div)
186
+ var div=this._createHiddenDiv(this.options.className+"_w")
187
+ this.widthW=Element.getDimensions(div).width;div.parentNode.removeChild(div);var div=document.createElement("div");div.className="overlay_"+this.options.className;document.body.appendChild(div);var that=this;setTimeout(function(){that.overlayOpacity=($(div).getStyle("opacity"));div.parentNode.removeChild(div);},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height;}
188
+ if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420)
189
+ this.setSize(this.width,this.height);if(this.doMaximize)
190
+ this.maximize();if(this.doMinimize)
191
+ this.minimize();},_createHiddenDiv:function(className){var objBody=document.body;var win=document.createElement("div");win.setAttribute('id',this.element.id+"_tmp");win.className=className;win.style.display='none';win.innerHTML='';objBody.insertBefore(win,objBody.firstChild);return win;},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle('top'),bottom:this.element.getStyle('bottom'),left:this.element.getStyle('left'),right:this.element.getStyle('right'),width:this.width,height:this.height};}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow)
192
+ new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration});else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height);}
193
+ Windows.resetOverflow();this._removeStoreLocation();}},_removeStoreLocation:function(){this.storedLocation=null;},_saveCookie:function(){if(this.cookie){var value="";if(this.useLeft)
194
+ value+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle('left'))
195
+ else
196
+ value+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle('right'))
197
+ if(this.useTop)
198
+ value+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle('top'))
199
+ else
200
+ value+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle('bottom'))
201
+ value+=","+(this.storedLocation?this.storedLocation.width:this.width);value+=","+(this.storedLocation?this.storedLocation.height:this.height);value+=","+this.isMinimized();value+=","+this.isMaximized();WindowUtilities.setCookie(value,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE)
202
+ this._getWindowBorderSize();var div=document.createElement("div");div.className="wired_frame "+this.options.className+"_wired_frame";div.style.position='absolute';this.options.parent.insertBefore(div,this.options.parent.firstChild);this.wiredElement=$(div);}
203
+ if(this.useLeft)
204
+ this.wiredElement.setStyle({left:this.element.getStyle('left')});else
205
+ this.wiredElement.setStyle({right:this.element.getStyle('right')});if(this.useTop)
206
+ this.wiredElement.setStyle({top:this.element.getStyle('top')});else
207
+ this.wiredElement.setStyle({bottom:this.element.getStyle('bottom')});var dim=this.element.getDimensions();this.wiredElement.setStyle({width:dim.width+"px",height:dim.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement;},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag)
208
+ return;if(this.currentDrag==this.element)
209
+ this.currentDrag=null;else{if(this.useLeft)
210
+ this.element.setStyle({left:this.currentDrag.getStyle('left')});else
211
+ this.element.setStyle({right:this.currentDrag.getStyle('right')});if(this.useTop)
212
+ this.element.setStyle({top:this.currentDrag.getStyle('top')});else
213
+ this.element.setStyle({bottom:this.currentDrag.getStyle('bottom')});this.currentDrag.hide();this.currentDrag=null;if(this.doResize)
214
+ this.setSize(this.width,this.height);}},_notify:function(eventName){if(this.options[eventName])
215
+ this.options[eventName](this);else
216
+ Windows.notify(eventName,this);}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(observer){this.removeObserver(observer);this.observers.push(observer);},removeObserver:function(observer){this.observers=this.observers.reject(function(o){return o==observer});},notify:function(eventName,win){this.observers.each(function(o){if(o[eventName])o[eventName](eventName,win);});},getWindow:function(id){return this.windows.detect(function(d){return d.getId()==id});},getFocusedWindow:function(){return this.focusedWindow;},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null;},register:function(win){this.windows.push(win);},addModalWindow:function(win){if(this.modalWindows.length==0){WindowUtilities.disableScreen(win.options.className,'overlay_modal',win.overlayOpacity,win.getId(),win.options.parent);}
217
+ else{if(Window.keepMultiModalWindow){$('overlay_modal').style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId());}
218
+ else
219
+ this.modalWindows.last().element.hide();WindowUtilities._showSelect(win.getId());}
220
+ this.modalWindows.push(win);},removeModalWindow:function(win){this.modalWindows.pop();if(this.modalWindows.length==0)
221
+ WindowUtilities.enableScreen();else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId());}
222
+ else
223
+ this.modalWindows.last().element.show();}},register:function(win){this.windows.push(win);},unregister:function(win){this.windows=this.windows.reject(function(d){return d==win});},closeAll:function(){this.windows.each(function(w){Windows.close(w.getId())});},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(win){if(win)win.close()});},minimize:function(id,event){var win=this.getWindow(id)
224
+ if(win&&win.visible)
225
+ win.minimize();Event.stop(event);},maximize:function(id,event){var win=this.getWindow(id)
226
+ if(win&&win.visible)
227
+ win.maximize();Event.stop(event);},close:function(id,event){var win=this.getWindow(id);if(win)
228
+ win.close();if(event)
229
+ Event.stop(event);},blur:function(id){var win=this.getWindow(id);if(!win)
230
+ return;if(win.options.blurClassName)
231
+ win.changeClassName(win.options.blurClassName);if(this.focusedWindow==win)
232
+ this.focusedWindow=null;win._notify("onBlur");},focus:function(id){var win=this.getWindow(id);if(!win)
233
+ return;if(this.focusedWindow)
234
+ this.blur(this.focusedWindow.getId())
235
+ if(win.options.focusClassName)
236
+ win.changeClassName(win.options.focusClassName);this.focusedWindow=win;win._notify("onFocus");},unsetOverflow:function(except){this.windows.each(function(d){d.oldOverflow=d.getContent().getStyle("overflow")||"auto";d.getContent().setStyle({overflow:"hidden"})});if(except&&except.oldOverflow)
237
+ except.getContent().setStyle({overflow:except.oldOverflow});},resetOverflow:function(){this.windows.each(function(d){if(d.oldOverflow)d.getContent().setStyle({overflow:d.oldOverflow})});},updateZindex:function(zindex,win){if(zindex>this.maxZIndex){this.maxZIndex=zindex;if(this.focusedWindow)
238
+ this.blur(this.focusedWindow.getId())}
239
+ this.focusedWindow=win;if(this.focusedWindow)
240
+ this.focus(this.focusedWindow.getId())}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.confirm);return}
241
+ content=content||"";parameters=parameters||{};var okLabel=parameters.okLabel?parameters.okLabel:"Ok";var cancelLabel=parameters.cancelLabel?parameters.cancelLabel:"Cancel";parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var okButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" ok_button'"
242
+ var cancelButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" cancel_button'"
243
+ var content="\
244
+ <div class='"+parameters.className+"_message'>"+content+"</div>\
245
+ <div class='"+parameters.className+"_buttons'>\
246
+ <input type='button' value='"+okLabel+"' onclick='Dialog.okCallback()' "+okButtonClass+"/>\
247
+ <input type='button' value='"+cancelLabel+"' onclick='Dialog.cancelCallback()' "+cancelButtonClass+"/>\
248
+ </div>\
249
+ ";return this._openDialog(content,parameters)},alert:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.alert);return}
250
+ content=content||"";parameters=parameters||{};var okLabel=parameters.okLabel?parameters.okLabel:"Ok";parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var okButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" ok_button'"
251
+ var content="\
252
+ <div class='"+parameters.className+"_message'>"+content+"</div>\
253
+ <div class='"+parameters.className+"_buttons'>\
254
+ <input type='button' value='"+okLabel+"' onclick='Dialog.okCallback()' "+okButtonClass+"/>\
255
+ </div>";return this._openDialog(content,parameters)},info:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.info);return}
256
+ content=content||"";parameters=parameters||{};parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var content="<div id='modal_dialog_message' class='"+parameters.className+"_message'>"+content+"</div>";if(parameters.showProgress)
257
+ content+="<div id='modal_dialog_progress' class='"+parameters.className+"_progress'> </div>";parameters.ok=null;parameters.cancel=null;return this._openDialog(content,parameters)},setInfoMessage:function(message){$('modal_dialog_message').update(message);},closeInfo:function(){Windows.close(this.dialogId);},_openDialog:function(content,parameters){var className=parameters.className;if(!parameters.height&&!parameters.width){parameters.width=WindowUtilities.getPageSize(parameters.options.parent||document.body).pageWidth/2;}
258
+ if(parameters.id)
259
+ this.dialogId=parameters.id;else{var t=new Date();this.dialogId='modal_dialog_'+t.getTime();parameters.id=this.dialogId;}
260
+ if(!parameters.height||!parameters.width){var size=WindowUtilities._computeSize(content,this.dialogId,parameters.width,parameters.height,5,className)
261
+ if(parameters.height)
262
+ parameters.width=size+5
263
+ else
264
+ parameters.height=size+5}
265
+ parameters.effectOptions=parameters.effectOptions;parameters.resizable=parameters.resizable||false;parameters.minimizable=parameters.minimizable||false;parameters.maximizable=parameters.maximizable||false;parameters.draggable=parameters.draggable||false;parameters.closable=parameters.closable||false;var win=new Window(parameters);win.getContent().innerHTML=content;win.showCenter(true,parameters.top,parameters.left);win.setDestroyOnClose();win.cancelCallback=parameters.onCancel||parameters.cancel;win.okCallback=parameters.onOk||parameters.ok;return win;},_getAjaxContent:function(originalRequest){Dialog.callFunc(originalRequest.responseText,Dialog.parameters)},_runAjaxRequest:function(message,parameters,callFunc){if(message.options==null)
266
+ message.options={}
267
+ Dialog.onCompleteFunc=message.options.onComplete;Dialog.parameters=parameters;Dialog.callFunc=callFunc;message.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(message.url,message.options);},okCallback:function(){var win=Windows.focusedWindow;if(!win.okCallback||win.okCallback(win)){$$("#"+win.getId()+" input").each(function(element){element.onclick=null;})
268
+ win.close();}},cancelCallback:function(){var win=Windows.focusedWindow;$$("#"+win.getId()+" input").each(function(element){element.onclick=null})
269
+ win.close();if(win.cancelCallback)
270
+ win.cancelCallback(win);}}
271
+ if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1]);}
272
+ var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;parent=parent||document.body;if(parent!=document.body){T=parent.scrollTop;L=parent.scrollLeft;W=parent.scrollWidth;H=parent.scrollHeight;}
273
+ else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}
274
+ if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight}}}
275
+ return{top:T,left:L,width:W,height:H};},getPageSize:function(parent){parent=parent||document.body;var windowWidth,windowHeight;var pageHeight,pageWidth;if(parent!=document.body){windowWidth=parent.getWidth();windowHeight=parent.getHeight();pageWidth=parent.scrollWidth;pageHeight=parent.scrollHeight;}
276
+ else{var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
277
+ if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
278
+ if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
279
+ if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}}
280
+ return{pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:windowWidth,windowHeight:windowHeight};},disableScreen:function(className,overlayId,overlayOpacity,contentId,parent){WindowUtilities.initLightbox(overlayId,className,function(){this._disableScreen(className,overlayId,overlayOpacity,contentId)}.bind(this),parent||document.body);},_disableScreen:function(className,overlayId,overlayOpacity,contentId){var objOverlay=$(overlayId);var pageSize=WindowUtilities.getPageSize(objOverlay.parentNode);if(contentId&&Prototype.Browser.IE){WindowUtilities._hideSelect();WindowUtilities._showSelect(contentId);}
281
+ objOverlay.style.height=(pageSize.pageHeight+'px');objOverlay.style.display='none';if(overlayId=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayShowEffectOptions){objOverlay.overlayOpacity=overlayOpacity;new Effect.Appear(objOverlay,Object.extend({from:0,to:overlayOpacity},Windows.overlayShowEffectOptions));}
282
+ else
283
+ objOverlay.style.display="block";},enableScreen:function(id){id=id||'overlay_modal';var objOverlay=$(id);if(objOverlay){if(id=="overlay_modal"&&Window.hasEffectLib&&Windows.overlayHideEffectOptions)
284
+ new Effect.Fade(objOverlay,Object.extend({from:objOverlay.overlayOpacity,to:0},Windows.overlayHideEffectOptions));else{objOverlay.style.display='none';objOverlay.parentNode.removeChild(objOverlay);}
285
+ if(id!="__invisible__")
286
+ WindowUtilities._showSelect();}},_hideSelect:function(id){if(Prototype.Browser.IE){id=id==null?"":"#"+id+" ";$$(id+'select').each(function(element){if(!WindowUtilities.isDefined(element.oldVisibility)){element.oldVisibility=element.style.visibility?element.style.visibility:"visible";element.style.visibility="hidden";}});}},_showSelect:function(id){if(Prototype.Browser.IE){id=id==null?"":"#"+id+" ";$$(id+'select').each(function(element){if(WindowUtilities.isDefined(element.oldVisibility)){try{element.style.visibility=element.oldVisibility;}catch(e){element.style.visibility="visible";}
287
+ element.oldVisibility=null;}
288
+ else{if(element.style.visibility)
289
+ element.style.visibility="visible";}});}},isDefined:function(object){return typeof(object)!="undefined"&&object!=null;},initLightbox:function(id,className,doneHandler,parent){if($(id)){Element.setStyle(id,{zIndex:Windows.maxZIndex+1});Windows.maxZIndex++;doneHandler();}
290
+ else{var objOverlay=document.createElement("div");objOverlay.setAttribute('id',id);objOverlay.className="overlay_"+className
291
+ objOverlay.style.display='none';objOverlay.style.position='absolute';objOverlay.style.top='0';objOverlay.style.left='0';objOverlay.style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex++;objOverlay.style.width='100%';parent.insertBefore(objOverlay,parent.firstChild);if(Prototype.Browser.WebKit&&id=="overlay_modal"){setTimeout(function(){doneHandler()},10);}
292
+ else
293
+ doneHandler();}},setCookie:function(value,parameters){document.cookie=parameters[0]+"="+escape(value)+
294
+ ((parameters[1])?"; expires="+parameters[1].toGMTString():"")+
295
+ ((parameters[2])?"; path="+parameters[2]:"")+
296
+ ((parameters[3])?"; domain="+parameters[3]:"")+
297
+ ((parameters[4])?"; secure":"");},getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else{begin+=2;}
298
+ var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
299
+ return unescape(dc.substring(begin+prefix.length,end));},_computeSize:function(content,id,width,height,margin,className){var objBody=document.body;var tmpObj=document.createElement("div");tmpObj.setAttribute('id',id);tmpObj.className=className+"_content";if(height)
300
+ tmpObj.style.height=height+"px"
301
+ else
302
+ tmpObj.style.width=width+"px"
303
+ tmpObj.style.position='absolute';tmpObj.style.top='0';tmpObj.style.left='0';tmpObj.style.display='none';tmpObj.innerHTML=content;objBody.insertBefore(tmpObj,objBody.firstChild);var size;if(height)
304
+ size=$(tmpObj).getDimensions().width+margin;else
305
+ size=$(tmpObj).getDimensions().height+margin;objBody.removeChild(tmpObj);return size;}}
js/toogas/featuredpopup/js/window_orig.js ADDED
@@ -0,0 +1,1843 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com)
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining
4
+ // a copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to
8
+ // permit persons to whom the Software is furnished to do so, subject to
9
+ // the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be
12
+ // included in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+ //
22
+ // VERSION 1.3
23
+
24
+ var Window = Class.create();
25
+
26
+ Window.keepMultiModalWindow = false;
27
+ Window.hasEffectLib = (typeof Effect != 'undefined');
28
+ Window.resizeEffectDuration = 0.4;
29
+
30
+ Window.prototype = {
31
+ // Constructor
32
+ // Available parameters : className, blurClassName, title, minWidth, minHeight, maxWidth, maxHeight, width, height, top, left, bottom, right, resizable, zIndex, opacity, recenterAuto, wiredDrag
33
+ // hideEffect, showEffect, showEffectOptions, hideEffectOptions, effectOptions, url, draggable, closable, minimizable, maximizable, parent, onload
34
+ // add all callbacks (if you do not use an observer)
35
+ // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
36
+
37
+ initialize: function() {
38
+ var id;
39
+ var optionIndex = 0;
40
+ // For backward compatibility like win= new Window("id", {...}) instead of win = new Window({id: "id", ...})
41
+ if (arguments.length > 0) {
42
+ if (typeof arguments[0] == "string" ) {
43
+ id = arguments[0];
44
+ optionIndex = 1;
45
+ }
46
+ else
47
+ id = arguments[0] ? arguments[0].id : null;
48
+ }
49
+
50
+ // Generate unique ID if not specified
51
+ if (!id)
52
+ id = "window_" + new Date().getTime();
53
+
54
+ if ($(id))
55
+ alert("Window " + id + " is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");
56
+
57
+ this.options = Object.extend({
58
+ className: "dialog",
59
+ blurClassName: null,
60
+ minWidth: 100,
61
+ minHeight: 20,
62
+ resizable: true,
63
+ closable: true,
64
+ minimizable: true,
65
+ maximizable: true,
66
+ draggable: true,
67
+ userData: null,
68
+ showEffect: (Window.hasEffectLib ? Effect.Appear : Element.show),
69
+ hideEffect: (Window.hasEffectLib ? Effect.Fade : Element.hide),
70
+ showEffectOptions: {},
71
+ hideEffectOptions: {},
72
+ effectOptions: null,
73
+ parent: document.body,
74
+ title: "&nbsp;",
75
+ url: null,
76
+ onload: Prototype.emptyFunction,
77
+ width: 200,
78
+ height: 300,
79
+ opacity: 1,
80
+ recenterAuto: true,
81
+ wiredDrag: false,
82
+ closeCallback: null,
83
+ destroyOnClose: false,
84
+ gridX: 1,
85
+ gridY: 1
86
+ }, arguments[optionIndex] || {});
87
+ if (this.options.blurClassName)
88
+ this.options.focusClassName = this.options.className;
89
+
90
+ if (typeof this.options.top == "undefined" && typeof this.options.bottom == "undefined")
91
+ this.options.top = this._round(Math.random()*500, this.options.gridY);
92
+ if (typeof this.options.left == "undefined" && typeof this.options.right == "undefined")
93
+ this.options.left = this._round(Math.random()*500, this.options.gridX);
94
+
95
+ if (this.options.effectOptions) {
96
+ Object.extend(this.options.hideEffectOptions, this.options.effectOptions);
97
+ Object.extend(this.options.showEffectOptions, this.options.effectOptions);
98
+ if (this.options.showEffect == Element.Appear)
99
+ this.options.showEffectOptions.to = this.options.opacity;
100
+ }
101
+ if (Window.hasEffectLib) {
102
+ if (this.options.showEffect == Effect.Appear)
103
+ this.options.showEffectOptions.to = this.options.opacity;
104
+
105
+ if (this.options.hideEffect == Effect.Fade)
106
+ this.options.hideEffectOptions.from = this.options.opacity;
107
+ }
108
+ if (this.options.hideEffect == Element.hide)
109
+ this.options.hideEffect = function(){ Element.hide(this.element); if (this.options.destroyOnClose) this.destroy(); }.bind(this)
110
+
111
+ if (this.options.parent != document.body)
112
+ this.options.parent = $(this.options.parent);
113
+
114
+ this.element = this._createWindow(id);
115
+ this.element.win = this;
116
+
117
+ // Bind event listener
118
+ this.eventMouseDown = this._initDrag.bindAsEventListener(this);
119
+ this.eventMouseUp = this._endDrag.bindAsEventListener(this);
120
+ this.eventMouseMove = this._updateDrag.bindAsEventListener(this);
121
+ this.eventOnLoad = this._getWindowBorderSize.bindAsEventListener(this);
122
+ this.eventMouseDownContent = this.toFront.bindAsEventListener(this);
123
+ this.eventResize = this._recenter.bindAsEventListener(this);
124
+
125
+ this.topbar = $(this.element.id + "_top");
126
+ this.bottombar = $(this.element.id + "_bottom");
127
+ this.content = $(this.element.id + "_content");
128
+
129
+ Event.observe(this.topbar, "mousedown", this.eventMouseDown);
130
+ Event.observe(this.bottombar, "mousedown", this.eventMouseDown);
131
+ Event.observe(this.content, "mousedown", this.eventMouseDownContent);
132
+ Event.observe(window, "load", this.eventOnLoad);
133
+ Event.observe(window, "resize", this.eventResize);
134
+ Event.observe(window, "scroll", this.eventResize);
135
+ Event.observe(this.options.parent, "scroll", this.eventResize);
136
+
137
+ if (this.options.draggable) {
138
+ var that = this;
139
+ [this.topbar, this.topbar.up().previous(), this.topbar.up().next()].each(function(element) {
140
+ element.observe("mousedown", that.eventMouseDown);
141
+ element.addClassName("top_draggable");
142
+ });
143
+ [this.bottombar.up(), this.bottombar.up().previous(), this.bottombar.up().next()].each(function(element) {
144
+ element.observe("mousedown", that.eventMouseDown);
145
+ element.addClassName("bottom_draggable");
146
+ });
147
+
148
+ }
149
+
150
+ if (this.options.resizable) {
151
+ this.sizer = $(this.element.id + "_sizer");
152
+ Event.observe(this.sizer, "mousedown", this.eventMouseDown);
153
+ }
154
+
155
+ this.useLeft = null;
156
+ this.useTop = null;
157
+ if (typeof this.options.left != "undefined") {
158
+ this.element.setStyle({left: parseFloat(this.options.left) + 'px'});
159
+ this.useLeft = true;
160
+ }
161
+ else {
162
+ this.element.setStyle({right: parseFloat(this.options.right) + 'px'});
163
+ this.useLeft = false;
164
+ }
165
+
166
+ if (typeof this.options.top != "undefined") {
167
+ this.element.setStyle({top: parseFloat(this.options.top) + 'px'});
168
+ this.useTop = true;
169
+ }
170
+ else {
171
+ this.element.setStyle({bottom: parseFloat(this.options.bottom) + 'px'});
172
+ this.useTop = false;
173
+ }
174
+
175
+ this.storedLocation = null;
176
+
177
+ this.setOpacity(this.options.opacity);
178
+ if (this.options.zIndex)
179
+ this.setZIndex(this.options.zIndex)
180
+
181
+ if (this.options.destroyOnClose)
182
+ this.setDestroyOnClose(true);
183
+
184
+ this._getWindowBorderSize();
185
+ this.width = this.options.width;
186
+ this.height = this.options.height;
187
+ this.visible = false;
188
+
189
+ this.constraint = false;
190
+ this.constraintPad = {top: 0, left:0, bottom:0, right:0};
191
+
192
+ if (this.width && this.height)
193
+ this.setSize(this.options.width, this.options.height);
194
+ this.setTitle(this.options.title)
195
+ Windows.register(this);
196
+ },
197
+
198
+ // Destructor
199
+ destroy: function() {
200
+ this._notify("onDestroy");
201
+ Event.stopObserving(this.topbar, "mousedown", this.eventMouseDown);
202
+ Event.stopObserving(this.bottombar, "mousedown", this.eventMouseDown);
203
+ Event.stopObserving(this.content, "mousedown", this.eventMouseDownContent);
204
+
205
+ Event.stopObserving(window, "load", this.eventOnLoad);
206
+ Event.stopObserving(window, "resize", this.eventResize);
207
+ Event.stopObserving(window, "scroll", this.eventResize);
208
+
209
+ Event.stopObserving(this.content, "load", this.options.onload);
210
+
211
+ if (this._oldParent) {
212
+ var content = this.getContent();
213
+ var originalContent = null;
214
+ for(var i = 0; i < content.childNodes.length; i++) {
215
+ originalContent = content.childNodes[i];
216
+ if (originalContent.nodeType == 1)
217
+ break;
218
+ originalContent = null;
219
+ }
220
+ if (originalContent)
221
+ this._oldParent.appendChild(originalContent);
222
+ this._oldParent = null;
223
+ }
224
+
225
+ if (this.sizer)
226
+ Event.stopObserving(this.sizer, "mousedown", this.eventMouseDown);
227
+
228
+ if (this.options.url)
229
+ this.content.src = null
230
+
231
+ if(this.iefix)
232
+ Element.remove(this.iefix);
233
+
234
+ Element.remove(this.element);
235
+ Windows.unregister(this);
236
+ },
237
+
238
+ // Sets close callback, if it sets, it should return true to be able to close the window.
239
+ setCloseCallback: function(callback) {
240
+ this.options.closeCallback = callback;
241
+ },
242
+
243
+ // Gets window content
244
+ getContent: function () {
245
+ return this.content;
246
+ },
247
+
248
+ // Sets the content with an element id
249
+ setContent: function(id, autoresize, autoposition) {
250
+ var element = $(id);
251
+ if (null == element) throw "Unable to find element '" + id + "' in DOM";
252
+ this._oldParent = element.parentNode;
253
+
254
+ var d = null;
255
+ var p = null;
256
+
257
+ if (autoresize)
258
+ d = Element.getDimensions(element);
259
+ if (autoposition)
260
+ p = Position.cumulativeOffset(element);
261
+
262
+ var content = this.getContent();
263
+ // Clear HTML (and even iframe)
264
+ this.setHTMLContent("");
265
+ content = this.getContent();
266
+
267
+ content.appendChild(element);
268
+ element.show();
269
+ if (autoresize)
270
+ this.setSize(d.width, d.height);
271
+ if (autoposition)
272
+ this.setLocation(p[1] - this.heightN, p[0] - this.widthW);
273
+ },
274
+
275
+ setHTMLContent: function(html) {
276
+ // It was an url (iframe), recreate a div content instead of iframe content
277
+ if (this.options.url) {
278
+ this.content.src = null;
279
+ this.options.url = null;
280
+
281
+ var content ="<div id=\"" + this.getId() + "_content\" class=\"" + this.options.className + "_content\"> </div>";
282
+ $(this.getId() +"_table_content").innerHTML = content;
283
+
284
+ this.content = $(this.element.id + "_content");
285
+ }
286
+
287
+ this.getContent().innerHTML = html;
288
+ },
289
+
290
+ setAjaxContent: function(url, options, showCentered, showModal) {
291
+ this.showFunction = showCentered ? "showCenter" : "show";
292
+ this.showModal = showModal || false;
293
+
294
+ options = options || {};
295
+
296
+ // Clear HTML (and even iframe)
297
+ this.setHTMLContent("");
298
+
299
+ this.onComplete = options.onComplete;
300
+ if (! this._onCompleteHandler)
301
+ this._onCompleteHandler = this._setAjaxContent.bind(this);
302
+ options.onComplete = this._onCompleteHandler;
303
+
304
+ new Ajax.Request(url, options);
305
+ options.onComplete = this.onComplete;
306
+ },
307
+
308
+ _setAjaxContent: function(originalRequest) {
309
+ Element.update(this.getContent(), originalRequest.responseText);
310
+ if (this.onComplete)
311
+ this.onComplete(originalRequest);
312
+ this.onComplete = null;
313
+ this[this.showFunction](this.showModal)
314
+ },
315
+
316
+ setURL: function(url) {
317
+ // Not an url content, change div to iframe
318
+ if (this.options.url)
319
+ this.content.src = null;
320
+ this.options.url = url;
321
+ var content= "<iframe frameborder='0' name='" + this.getId() + "_content' id='" + this.getId() + "_content' src='" + url + "' width='" + this.width + "' height='" + this.height + "'> </iframe>";
322
+ $(this.getId() +"_table_content").innerHTML = content;
323
+
324
+ this.content = $(this.element.id + "_content");
325
+ },
326
+
327
+ getURL: function() {
328
+ return this.options.url ? this.options.url : null;
329
+ },
330
+
331
+ refresh: function() {
332
+ if (this.options.url)
333
+ $(this.element.getAttribute('id') + '_content').src = this.options.url;
334
+ },
335
+
336
+ // Stores position/size in a cookie, by default named with window id
337
+ setCookie: function(name, expires, path, domain, secure) {
338
+ name = name || this.element.id;
339
+ this.cookie = [name, expires, path, domain, secure];
340
+
341
+ // Get cookie
342
+ var value = WindowUtilities.getCookie(name)
343
+ // If exists
344
+ if (value) {
345
+ var values = value.split(',');
346
+ var x = values[0].split(':');
347
+ var y = values[1].split(':');
348
+
349
+ var w = parseFloat(values[2]), h = parseFloat(values[3]);
350
+ var mini = values[4];
351
+ var maxi = values[5];
352
+
353
+ this.setSize(w, h);
354
+ if (mini == "true")
355
+ this.doMinimize = true; // Minimize will be done at onload window event
356
+ else if (maxi == "true")
357
+ this.doMaximize = true; // Maximize will be done at onload window event
358
+
359
+ this.useLeft = x[0] == "l";
360
+ this.useTop = y[0] == "t";
361
+
362
+ this.element.setStyle(this.useLeft ? {left: x[1]} : {right: x[1]});
363
+ this.element.setStyle(this.useTop ? {top: y[1]} : {bottom: y[1]});
364
+ }
365
+ },
366
+
367
+ // Gets window ID
368
+ getId: function() {
369
+ return this.element.id;
370
+ },
371
+
372
+ // Detroys itself when closing
373
+ setDestroyOnClose: function() {
374
+ this.options.destroyOnClose = true;
375
+ },
376
+
377
+ setConstraint: function(bool, padding) {
378
+ this.constraint = bool;
379
+ this.constraintPad = Object.extend(this.constraintPad, padding || {});
380
+ // Reset location to apply constraint
381
+ if (this.useTop && this.useLeft)
382
+ this.setLocation(parseFloat(this.element.style.top), parseFloat(this.element.style.left));
383
+ },
384
+
385
+ // initDrag event
386
+
387
+ _initDrag: function(event) {
388
+ // No resize on minimized window
389
+ if (Event.element(event) == this.sizer && this.isMinimized())
390
+ return;
391
+
392
+ // No move on maximzed window
393
+ if (Event.element(event) != this.sizer && this.isMaximized())
394
+ return;
395
+
396
+ if (Prototype.Browser.IE && this.heightN == 0)
397
+ this._getWindowBorderSize();
398
+
399
+ // Get pointer X,Y
400
+ this.pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
401
+ if (this.options.wiredDrag)
402
+ this.currentDrag = this._createWiredElement();
403
+ else
404
+ this.currentDrag = this.element;
405
+
406
+ // Resize
407
+ if (Event.element(event) == this.sizer) {
408
+ this.doResize = true;
409
+ this.widthOrg = this.width;
410
+ this.heightOrg = this.height;
411
+ this.bottomOrg = parseFloat(this.element.getStyle('bottom'));
412
+ this.rightOrg = parseFloat(this.element.getStyle('right'));
413
+ this._notify("onStartResize");
414
+ }
415
+ else {
416
+ this.doResize = false;
417
+
418
+ // Check if click on close button,
419
+ var closeButton = $(this.getId() + '_close');
420
+ if (closeButton && Position.within(closeButton, this.pointer[0], this.pointer[1])) {
421
+ this.currentDrag = null;
422
+ return;
423
+ }
424
+
425
+ this.toFront();
426
+
427
+ if (! this.options.draggable)
428
+ return;
429
+ this._notify("onStartMove");
430
+ }
431
+ // Register global event to capture mouseUp and mouseMove
432
+ Event.observe(document, "mouseup", this.eventMouseUp, false);
433
+ Event.observe(document, "mousemove", this.eventMouseMove, false);
434
+
435
+ // Add an invisible div to keep catching mouse event over iframes
436
+ WindowUtilities.disableScreen('__invisible__', '__invisible__', this.overlayOpacity);
437
+
438
+ // Stop selection while dragging
439
+ document.body.ondrag = function () { return false; };
440
+ document.body.onselectstart = function () { return false; };
441
+
442
+ this.currentDrag.show();
443
+ Event.stop(event);
444
+ },
445
+
446
+ _round: function(val, round) {
447
+ return round == 1 ? val : val = Math.floor(val / round) * round;
448
+ },
449
+
450
+ // updateDrag event
451
+ _updateDrag: function(event) {
452
+ var pointer = [this._round(Event.pointerX(event), this.options.gridX), this._round(Event.pointerY(event), this.options.gridY)];
453
+ var dx = pointer[0] - this.pointer[0];
454
+ var dy = pointer[1] - this.pointer[1];
455
+
456
+ // Resize case, update width/height
457
+ if (this.doResize) {
458
+ var w = this.widthOrg + dx;
459
+ var h = this.heightOrg + dy;
460
+
461
+ dx = this.width - this.widthOrg
462
+ dy = this.height - this.heightOrg
463
+
464
+ // Check if it's a right position, update it to keep upper-left corner at the same position
465
+ if (this.useLeft)
466
+ w = this._updateWidthConstraint(w)
467
+ else
468
+ this.currentDrag.setStyle({right: (this.rightOrg -dx) + 'px'});
469
+ // Check if it's a bottom position, update it to keep upper-left corner at the same position
470
+ if (this.useTop)
471
+ h = this._updateHeightConstraint(h)
472
+ else
473
+ this.currentDrag.setStyle({bottom: (this.bottomOrg -dy) + 'px'});
474
+
475
+ this.setSize(w , h);
476
+ this._notify("onResize");
477
+ }
478
+ // Move case, update top/left
479
+ else {
480
+ this.pointer = pointer;
481
+
482
+ if (this.useLeft) {
483
+ var left = parseFloat(this.currentDrag.getStyle('left')) + dx;
484
+ var newLeft = this._updateLeftConstraint(left);
485
+ // Keep mouse pointer correct
486
+ this.pointer[0] += newLeft-left;
487
+ this.currentDrag.setStyle({left: newLeft + 'px'});
488
+ }
489
+ else
490
+ this.currentDrag.setStyle({right: parseFloat(this.currentDrag.getStyle('right')) - dx + 'px'});
491
+
492
+ if (this.useTop) {
493
+ var top = parseFloat(this.currentDrag.getStyle('top')) + dy;
494
+ var newTop = this._updateTopConstraint(top);
495
+ // Keep mouse pointer correct
496
+ this.pointer[1] += newTop - top;
497
+ this.currentDrag.setStyle({top: newTop + 'px'});
498
+ }
499
+ else
500
+ this.currentDrag.setStyle({bottom: parseFloat(this.currentDrag.getStyle('bottom')) - dy + 'px'});
501
+
502
+ this._notify("onMove");
503
+ }
504
+ if (this.iefix)
505
+ this._fixIEOverlapping();
506
+
507
+ this._removeStoreLocation();
508
+ Event.stop(event);
509
+ },
510
+
511
+ // endDrag callback
512
+ _endDrag: function(event) {
513
+ // Remove temporary div over iframes
514
+ WindowUtilities.enableScreen('__invisible__');
515
+
516
+ if (this.doResize)
517
+ this._notify("onEndResize");
518
+ else
519
+ this._notify("onEndMove");
520
+
521
+ // Release event observing
522
+ Event.stopObserving(document, "mouseup", this.eventMouseUp,false);
523
+ Event.stopObserving(document, "mousemove", this.eventMouseMove, false);
524
+
525
+ Event.stop(event);
526
+
527
+ this._hideWiredElement();
528
+
529
+ // Store new location/size if need be
530
+ this._saveCookie()
531
+
532
+ // Restore selection
533
+ document.body.ondrag = null;
534
+ document.body.onselectstart = null;
535
+ },
536
+
537
+ _updateLeftConstraint: function(left) {
538
+ if (this.constraint && this.useLeft && this.useTop) {
539
+ var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
540
+
541
+ if (left < this.constraintPad.left)
542
+ left = this.constraintPad.left;
543
+ if (left + this.width + this.widthE + this.widthW > width - this.constraintPad.right)
544
+ left = width - this.constraintPad.right - this.width - this.widthE - this.widthW;
545
+ }
546
+ return left;
547
+ },
548
+
549
+ _updateTopConstraint: function(top) {
550
+ if (this.constraint && this.useLeft && this.useTop) {
551
+ var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
552
+
553
+ var h = this.height + this.heightN + this.heightS;
554
+
555
+ if (top < this.constraintPad.top)
556
+ top = this.constraintPad.top;
557
+ if (top + h > height - this.constraintPad.bottom)
558
+ top = height - this.constraintPad.bottom - h;
559
+ }
560
+ return top;
561
+ },
562
+
563
+ _updateWidthConstraint: function(w) {
564
+ if (this.constraint && this.useLeft && this.useTop) {
565
+ var width = this.options.parent == document.body ? WindowUtilities.getPageSize().windowWidth : this.options.parent.getDimensions().width;
566
+ var left = parseFloat(this.element.getStyle("left"));
567
+
568
+ if (left + w + this.widthE + this.widthW > width - this.constraintPad.right)
569
+ w = width - this.constraintPad.right - left - this.widthE - this.widthW;
570
+ }
571
+ return w;
572
+ },
573
+
574
+ _updateHeightConstraint: function(h) {
575
+ if (this.constraint && this.useLeft && this.useTop) {
576
+ var height = this.options.parent == document.body ? WindowUtilities.getPageSize().windowHeight : this.options.parent.getDimensions().height;
577
+ var top = parseFloat(this.element.getStyle("top"));
578
+
579
+ if (top + h + this.heightN + this.heightS > height - this.constraintPad.bottom)
580
+ h = height - this.constraintPad.bottom - top - this.heightN - this.heightS;
581
+ }
582
+ return h;
583
+ },
584
+
585
+
586
+ // Creates HTML window code
587
+ _createWindow: function(id) {
588
+ var className = this.options.className;
589
+ var win = document.createElement("div");
590
+ win.setAttribute('id', id);
591
+ win.className = "dialog";
592
+
593
+ var content;
594
+ if (this.options.url)
595
+ content= "<iframe frameborder=\"0\" name=\"" + id + "_content\" id=\"" + id + "_content\" src=\"" + this.options.url + "\"> </iframe>";
596
+ else
597
+ content ="<div id=\"" + id + "_content\" class=\"" +className + "_content\"> </div>";
598
+
599
+ var closeDiv = this.options.closable ? "<div class='"+ className +"_close' id='"+ id +"_close' onclick='Windows.close(\""+ id +"\", event)'> </div>" : "";
600
+ var minDiv = this.options.minimizable ? "<div class='"+ className + "_minimize' id='"+ id +"_minimize' onclick='Windows.minimize(\""+ id +"\", event)'> </div>" : "";
601
+ var maxDiv = this.options.maximizable ? "<div class='"+ className + "_maximize' id='"+ id +"_maximize' onclick='Windows.maximize(\""+ id +"\", event)'> </div>" : "";
602
+ var seAttributes = this.options.resizable ? "class='" + className + "_sizer' id='" + id + "_sizer'" : "class='" + className + "_se'";
603
+ var blank = "../themes/default/blank.gif";
604
+
605
+ win.innerHTML = closeDiv + minDiv + maxDiv + "\
606
+ <table id='"+ id +"_row1' class=\"top table_window\">\
607
+ <tr>\
608
+ <td class='"+ className +"_nw'></td>\
609
+ <td class='"+ className +"_n'><div id='"+ id +"_top' class='"+ className +"_title title_window'>"+ this.options.title +"</div></td>\
610
+ <td class='"+ className +"_ne'></td>\
611
+ </tr>\
612
+ </table>\
613
+ <table id='"+ id +"_row2' class=\"mid table_window\">\
614
+ <tr>\
615
+ <td class='"+ className +"_w'></td>\
616
+ <td id='"+ id +"_table_content' class='"+ className +"_content' valign='top'>" + content + "</td>\
617
+ <td class='"+ className +"_e'></td>\
618
+ </tr>\
619
+ </table>\
620
+ <table id='"+ id +"_row3' class=\"bot table_window\">\
621
+ <tr>\
622
+ <td class='"+ className +"_sw'></td>\
623
+ <td class='"+ className +"_s'><div id='"+ id +"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\
624
+ <td " + seAttributes + "></td>\
625
+ </tr>\
626
+ </table>\
627
+ ";
628
+ Element.hide(win);
629
+ this.options.parent.insertBefore(win, this.options.parent.firstChild);
630
+ Event.observe($(id + "_content"), "load", this.options.onload);
631
+ return win;
632
+ },
633
+
634
+
635
+ changeClassName: function(newClassName) {
636
+ var className = this.options.className;
637
+ var id = this.getId();
638
+ $A(["_close", "_minimize", "_maximize", "_sizer", "_content"]).each(function(value) { this._toggleClassName($(id + value), className + value, newClassName + value) }.bind(this));
639
+ this._toggleClassName($(id + "_top"), className + "_title", newClassName + "_title");
640
+ $$("#" + id + " td").each(function(td) {td.className = td.className.sub(className,newClassName); });
641
+ this.options.className = newClassName;
642
+ },
643
+
644
+ _toggleClassName: function(element, oldClassName, newClassName) {
645
+ if (element) {
646
+ element.removeClassName(oldClassName);
647
+ element.addClassName(newClassName);
648
+ }
649
+ },
650
+
651
+ // Sets window location
652
+ setLocation: function(top, left) {
653
+ top = this._updateTopConstraint(top);
654
+ left = this._updateLeftConstraint(left);
655
+
656
+ var e = this.currentDrag || this.element;
657
+ e.setStyle({top: top + 'px'});
658
+ e.setStyle({left: left + 'px'});
659
+
660
+ this.useLeft = true;
661
+ this.useTop = true;
662
+ },
663
+
664
+ getLocation: function() {
665
+ var location = {};
666
+ if (this.useTop)
667
+ location = Object.extend(location, {top: this.element.getStyle("top")});
668
+ else
669
+ location = Object.extend(location, {bottom: this.element.getStyle("bottom")});
670
+ if (this.useLeft)
671
+ location = Object.extend(location, {left: this.element.getStyle("left")});
672
+ else
673
+ location = Object.extend(location, {right: this.element.getStyle("right")});
674
+
675
+ return location;
676
+ },
677
+
678
+ // Gets window size
679
+ getSize: function() {
680
+ return {width: this.width, height: this.height};
681
+ },
682
+
683
+ // Sets window size
684
+ setSize: function(width, height, useEffect) {
685
+ width = parseFloat(width);
686
+ height = parseFloat(height);
687
+
688
+ // Check min and max size
689
+ if (!this.minimized && width < this.options.minWidth)
690
+ width = this.options.minWidth;
691
+
692
+ if (!this.minimized && height < this.options.minHeight)
693
+ height = this.options.minHeight;
694
+
695
+ if (this.options. maxHeight && height > this.options. maxHeight)
696
+ height = this.options. maxHeight;
697
+
698
+ if (this.options. maxWidth && width > this.options. maxWidth)
699
+ width = this.options. maxWidth;
700
+
701
+
702
+ if (this.useTop && this.useLeft && Window.hasEffectLib && Effect.ResizeWindow && useEffect) {
703
+ new Effect.ResizeWindow(this, null, null, width, height, {duration: Window.resizeEffectDuration});
704
+ } else {
705
+ this.width = width;
706
+ this.height = height;
707
+ var e = this.currentDrag ? this.currentDrag : this.element;
708
+
709
+ e.setStyle({width: width + this.widthW + this.widthE + "px"})
710
+ e.setStyle({height: height + this.heightN + this.heightS + "px"})
711
+
712
+ // Update content size
713
+ if (!this.currentDrag || this.currentDrag == this.element) {
714
+ var content = $(this.element.id + '_content');
715
+ content.setStyle({height: height + 'px'});
716
+ content.setStyle({width: width + 'px'});
717
+ }
718
+ }
719
+ },
720
+
721
+ updateHeight: function() {
722
+ this.setSize(this.width, this.content.scrollHeight, true);
723
+ },
724
+
725
+ updateWidth: function() {
726
+ this.setSize(this.content.scrollWidth, this.height, true);
727
+ },
728
+
729
+ // Brings window to front
730
+ toFront: function() {
731
+ if (this.element.style.zIndex < Windows.maxZIndex)
732
+ this.setZIndex(Windows.maxZIndex + 1);
733
+ if (this.iefix)
734
+ this._fixIEOverlapping();
735
+ },
736
+
737
+ getBounds: function(insideOnly) {
738
+ if (! this.width || !this.height || !this.visible)
739
+ this.computeBounds();
740
+ var w = this.width;
741
+ var h = this.height;
742
+
743
+ if (!insideOnly) {
744
+ w += this.widthW + this.widthE;
745
+ h += this.heightN + this.heightS;
746
+ }
747
+ var bounds = Object.extend(this.getLocation(), {width: w + "px", height: h + "px"});
748
+ return bounds;
749
+ },
750
+
751
+ computeBounds: function() {
752
+ if (! this.width || !this.height) {
753
+ var size = WindowUtilities._computeSize(this.content.innerHTML, this.content.id, this.width, this.height, 0, this.options.className)
754
+ if (this.height)
755
+ this.width = size + 5
756
+ else
757
+ this.height = size + 5
758
+ }
759
+
760
+ this.setSize(this.width, this.height);
761
+ if (this.centered)
762
+ this._center(this.centerTop, this.centerLeft);
763
+ },
764
+
765
+ // Displays window modal state or not
766
+ show: function(modal) {
767
+ this.visible = true;
768
+ if (modal) {
769
+ // Hack for Safari !!
770
+ if (typeof this.overlayOpacity == "undefined") {
771
+ var that = this;
772
+ setTimeout(function() {that.show(modal)}, 10);
773
+ return;
774
+ }
775
+ Windows.addModalWindow(this);
776
+
777
+ this.modal = true;
778
+ this.setZIndex(Windows.maxZIndex + 1);
779
+ Windows.unsetOverflow(this);
780
+ }
781
+ else
782
+ if (!this.element.style.zIndex)
783
+ this.setZIndex(Windows.maxZIndex + 1);
784
+
785
+ // To restore overflow if need be
786
+ if (this.oldStyle)
787
+ this.getContent().setStyle({overflow: this.oldStyle});
788
+
789
+ this.computeBounds();
790
+
791
+ this._notify("onBeforeShow");
792
+ if (this.options.showEffect != Element.show && this.options.showEffectOptions)
793
+ this.options.showEffect(this.element, this.options.showEffectOptions);
794
+ else
795
+ this.options.showEffect(this.element);
796
+
797
+ this._checkIEOverlapping();
798
+ WindowUtilities.focusedWindow = this
799
+ this._notify("onShow");
800
+ },
801
+
802
+ // Displays window modal state or not at the center of the page
803
+ showCenter: function(modal, top, left) {
804
+ this.centered = true;
805
+ this.centerTop = top;
806
+ this.centerLeft = left;
807
+
808
+ this.show(modal);
809
+ },
810
+
811
+ isVisible: function() {
812
+ return this.visible;
813
+ },
814
+
815
+ _center: function(top, left) {
816
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
817
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
818
+ if (typeof top == "undefined")
819
+ top = (pageSize.windowHeight - (this.height + this.heightN + this.heightS))/2;
820
+ top += windowScroll.top
821
+
822
+ if (typeof left == "undefined")
823
+ left = (pageSize.windowWidth - (this.width + this.widthW + this.widthE))/2;
824
+ left += windowScroll.left
825
+ this.setLocation(top, left);
826
+ this.toFront();
827
+ },
828
+
829
+ _recenter: function(event) {
830
+ if (this.centered) {
831
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
832
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
833
+
834
+ // Check for this stupid IE that sends dumb events
835
+ if (this.pageSize && this.pageSize.windowWidth == pageSize.windowWidth && this.pageSize.windowHeight == pageSize.windowHeight &&
836
+ this.windowScroll.left == windowScroll.left && this.windowScroll.top == windowScroll.top)
837
+ return;
838
+ this.pageSize = pageSize;
839
+ this.windowScroll = windowScroll;
840
+ // set height of Overlay to take up whole page and show
841
+ if ($('overlay_modal'))
842
+ $('overlay_modal').setStyle({height: (pageSize.pageHeight + 'px')});
843
+
844
+ if (this.options.recenterAuto)
845
+ this._center(this.centerTop, this.centerLeft);
846
+ }
847
+ },
848
+
849
+ // Hides window
850
+ hide: function() {
851
+ this.visible = false;
852
+ if (this.modal) {
853
+ Windows.removeModalWindow(this);
854
+ Windows.resetOverflow();
855
+ }
856
+ // To avoid bug on scrolling bar
857
+ this.oldStyle = this.getContent().getStyle('overflow') || "auto"
858
+ this.getContent().setStyle({overflow: "hidden"});
859
+
860
+ this.options.hideEffect(this.element, this.options.hideEffectOptions);
861
+
862
+ if(this.iefix)
863
+ this.iefix.hide();
864
+
865
+ if (!this.doNotNotifyHide)
866
+ this._notify("onHide");
867
+ },
868
+
869
+ close: function() {
870
+ // Asks closeCallback if exists
871
+ if (this.visible) {
872
+ if (this.options.closeCallback && ! this.options.closeCallback(this))
873
+ return;
874
+
875
+ if (this.options.destroyOnClose) {
876
+ var destroyFunc = this.destroy.bind(this);
877
+ if (this.options.hideEffectOptions.afterFinish) {
878
+ var func = this.options.hideEffectOptions.afterFinish;
879
+ this.options.hideEffectOptions.afterFinish = function() {func();destroyFunc() }
880
+ }
881
+ else
882
+ this.options.hideEffectOptions.afterFinish = function() {destroyFunc() }
883
+ }
884
+ Windows.updateFocusedWindow();
885
+
886
+ this.doNotNotifyHide = true;
887
+ this.hide();
888
+ this.doNotNotifyHide = false;
889
+ this._notify("onClose");
890
+ }
891
+ },
892
+
893
+ minimize: function() {
894
+ if (this.resizing)
895
+ return;
896
+
897
+ var r2 = $(this.getId() + "_row2");
898
+
899
+ if (!this.minimized) {
900
+ this.minimized = true;
901
+
902
+ var dh = r2.getDimensions().height;
903
+ this.r2Height = dh;
904
+ var h = this.element.getHeight() - dh;
905
+
906
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
907
+ new Effect.ResizeWindow(this, null, null, null, this.height -dh, {duration: Window.resizeEffectDuration});
908
+ } else {
909
+ this.height -= dh;
910
+ this.element.setStyle({height: h + "px"});
911
+ r2.hide();
912
+ }
913
+
914
+ if (! this.useTop) {
915
+ var bottom = parseFloat(this.element.getStyle('bottom'));
916
+ this.element.setStyle({bottom: (bottom + dh) + 'px'});
917
+ }
918
+ }
919
+ else {
920
+ this.minimized = false;
921
+
922
+ var dh = this.r2Height;
923
+ this.r2Height = null;
924
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
925
+ new Effect.ResizeWindow(this, null, null, null, this.height + dh, {duration: Window.resizeEffectDuration});
926
+ }
927
+ else {
928
+ var h = this.element.getHeight() + dh;
929
+ this.height += dh;
930
+ this.element.setStyle({height: h + "px"})
931
+ r2.show();
932
+ }
933
+ if (! this.useTop) {
934
+ var bottom = parseFloat(this.element.getStyle('bottom'));
935
+ this.element.setStyle({bottom: (bottom - dh) + 'px'});
936
+ }
937
+ this.toFront();
938
+ }
939
+ this._notify("onMinimize");
940
+
941
+ // Store new location/size if need be
942
+ this._saveCookie()
943
+ },
944
+
945
+ maximize: function() {
946
+ if (this.isMinimized() || this.resizing)
947
+ return;
948
+
949
+ if (Prototype.Browser.IE && this.heightN == 0)
950
+ this._getWindowBorderSize();
951
+
952
+ if (this.storedLocation != null) {
953
+ this._restoreLocation();
954
+ if(this.iefix)
955
+ this.iefix.hide();
956
+ }
957
+ else {
958
+ this._storeLocation();
959
+ Windows.unsetOverflow(this);
960
+
961
+ var windowScroll = WindowUtilities.getWindowScroll(this.options.parent);
962
+ var pageSize = WindowUtilities.getPageSize(this.options.parent);
963
+ var left = windowScroll.left;
964
+ var top = windowScroll.top;
965
+
966
+ if (this.options.parent != document.body) {
967
+ windowScroll = {top:0, left:0, bottom:0, right:0};
968
+ var dim = this.options.parent.getDimensions();
969
+ pageSize.windowWidth = dim.width;
970
+ pageSize.windowHeight = dim.height;
971
+ top = 0;
972
+ left = 0;
973
+ }
974
+
975
+ if (this.constraint) {
976
+ pageSize.windowWidth -= Math.max(0, this.constraintPad.left) + Math.max(0, this.constraintPad.right);
977
+ pageSize.windowHeight -= Math.max(0, this.constraintPad.top) + Math.max(0, this.constraintPad.bottom);
978
+ left += Math.max(0, this.constraintPad.left);
979
+ top += Math.max(0, this.constraintPad.top);
980
+ }
981
+
982
+ var width = pageSize.windowWidth - this.widthW - this.widthE;
983
+ var height= pageSize.windowHeight - this.heightN - this.heightS;
984
+
985
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow) {
986
+ new Effect.ResizeWindow(this, top, left, width, height, {duration: Window.resizeEffectDuration});
987
+ }
988
+ else {
989
+ this.setSize(width, height);
990
+ this.element.setStyle(this.useLeft ? {left: left} : {right: left});
991
+ this.element.setStyle(this.useTop ? {top: top} : {bottom: top});
992
+ }
993
+
994
+ this.toFront();
995
+ if (this.iefix)
996
+ this._fixIEOverlapping();
997
+ }
998
+ this._notify("onMaximize");
999
+
1000
+ // Store new location/size if need be
1001
+ this._saveCookie()
1002
+ },
1003
+
1004
+ isMinimized: function() {
1005
+ return this.minimized;
1006
+ },
1007
+
1008
+ isMaximized: function() {
1009
+ return (this.storedLocation != null);
1010
+ },
1011
+
1012
+ setOpacity: function(opacity) {
1013
+ if (Element.setOpacity)
1014
+ Element.setOpacity(this.element, opacity);
1015
+ },
1016
+
1017
+ setZIndex: function(zindex) {
1018
+ this.element.setStyle({zIndex: zindex});
1019
+ Windows.updateZindex(zindex, this);
1020
+ },
1021
+
1022
+ setTitle: function(newTitle) {
1023
+ if (!newTitle || newTitle == "")
1024
+ newTitle = "&nbsp;";
1025
+
1026
+ Element.update(this.element.id + '_top', newTitle);
1027
+ },
1028
+
1029
+ getTitle: function() {
1030
+ return $(this.element.id + '_top').innerHTML;
1031
+ },
1032
+
1033
+ setStatusBar: function(element) {
1034
+ var statusBar = $(this.getId() + "_bottom");
1035
+
1036
+ if (typeof(element) == "object") {
1037
+ if (this.bottombar.firstChild)
1038
+ this.bottombar.replaceChild(element, this.bottombar.firstChild);
1039
+ else
1040
+ this.bottombar.appendChild(element);
1041
+ }
1042
+ else
1043
+ this.bottombar.innerHTML = element;
1044
+ },
1045
+
1046
+ _checkIEOverlapping: function() {
1047
+ if(!this.iefix && (navigator.appVersion.indexOf('MSIE')>0) && (navigator.userAgent.indexOf('Opera')<0) && (this.element.getStyle('position')=='absolute')) {
1048
+ new Insertion.After(this.element.id, '<iframe id="' + this.element.id + '_iefix" '+ 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' + 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
1049
+ this.iefix = $(this.element.id+'_iefix');
1050
+ }
1051
+ if(this.iefix)
1052
+ setTimeout(this._fixIEOverlapping.bind(this), 50);
1053
+ },
1054
+
1055
+ _fixIEOverlapping: function() {
1056
+ Position.clone(this.element, this.iefix);
1057
+ this.iefix.style.zIndex = this.element.style.zIndex - 1;
1058
+ this.iefix.show();
1059
+ },
1060
+
1061
+ _getWindowBorderSize: function(event) {
1062
+ // Hack to get real window border size!!
1063
+ var div = this._createHiddenDiv(this.options.className + "_n")
1064
+ this.heightN = Element.getDimensions(div).height;
1065
+ div.parentNode.removeChild(div)
1066
+
1067
+ var div = this._createHiddenDiv(this.options.className + "_s")
1068
+ this.heightS = Element.getDimensions(div).height;
1069
+ div.parentNode.removeChild(div)
1070
+
1071
+ var div = this._createHiddenDiv(this.options.className + "_e")
1072
+ this.widthE = Element.getDimensions(div).width;
1073
+ div.parentNode.removeChild(div)
1074
+
1075
+ var div = this._createHiddenDiv(this.options.className + "_w")
1076
+ this.widthW = Element.getDimensions(div).width;
1077
+ div.parentNode.removeChild(div);
1078
+
1079
+ var div = document.createElement("div");
1080
+ div.className = "overlay_" + this.options.className ;
1081
+ document.body.appendChild(div);
1082
+ //alert("no timeout:\nopacity: " + div.getStyle("opacity") + "\nwidth: " + document.defaultView.getComputedStyle(div, null).width);
1083
+ var that = this;
1084
+
1085
+ // Workaround for Safari!!
1086
+ setTimeout(function() {that.overlayOpacity = ($(div).getStyle("opacity")); div.parentNode.removeChild(div);}, 10);
1087
+
1088
+ // Workaround for IE!!
1089
+ if (Prototype.Browser.IE) {
1090
+ this.heightS = $(this.getId() +"_row3").getDimensions().height;
1091
+ this.heightN = $(this.getId() +"_row1").getDimensions().height;
1092
+ }
1093
+
1094
+ // Safari size fix
1095
+ if (Prototype.Browser.WebKit && Prototype.Browser.WebKitVersion < 420)
1096
+ this.setSize(this.width, this.height);
1097
+ if (this.doMaximize)
1098
+ this.maximize();
1099
+ if (this.doMinimize)
1100
+ this.minimize();
1101
+ },
1102
+
1103
+ _createHiddenDiv: function(className) {
1104
+ var objBody = document.body;
1105
+ var win = document.createElement("div");
1106
+ win.setAttribute('id', this.element.id+ "_tmp");
1107
+ win.className = className;
1108
+ win.style.display = 'none';
1109
+ win.innerHTML = '';
1110
+ objBody.insertBefore(win, objBody.firstChild);
1111
+ return win;
1112
+ },
1113
+
1114
+ _storeLocation: function() {
1115
+ if (this.storedLocation == null) {
1116
+ this.storedLocation = {useTop: this.useTop, useLeft: this.useLeft,
1117
+ top: this.element.getStyle('top'), bottom: this.element.getStyle('bottom'),
1118
+ left: this.element.getStyle('left'), right: this.element.getStyle('right'),
1119
+ width: this.width, height: this.height };
1120
+ }
1121
+ },
1122
+
1123
+ _restoreLocation: function() {
1124
+ if (this.storedLocation != null) {
1125
+ this.useLeft = this.storedLocation.useLeft;
1126
+ this.useTop = this.storedLocation.useTop;
1127
+
1128
+ if (this.useLeft && this.useTop && Window.hasEffectLib && Effect.ResizeWindow)
1129
+ new Effect.ResizeWindow(this, this.storedLocation.top, this.storedLocation.left, this.storedLocation.width, this.storedLocation.height, {duration: Window.resizeEffectDuration});
1130
+ else {
1131
+ this.element.setStyle(this.useLeft ? {left: this.storedLocation.left} : {right: this.storedLocation.right});
1132
+ this.element.setStyle(this.useTop ? {top: this.storedLocation.top} : {bottom: this.storedLocation.bottom});
1133
+ this.setSize(this.storedLocation.width, this.storedLocation.height);
1134
+ }
1135
+
1136
+ Windows.resetOverflow();
1137
+ this._removeStoreLocation();
1138
+ }
1139
+ },
1140
+
1141
+ _removeStoreLocation: function() {
1142
+ this.storedLocation = null;
1143
+ },
1144
+
1145
+ _saveCookie: function() {
1146
+ if (this.cookie) {
1147
+ var value = "";
1148
+ if (this.useLeft)
1149
+ value += "l:" + (this.storedLocation ? this.storedLocation.left : this.element.getStyle('left'))
1150
+ else
1151
+ value += "r:" + (this.storedLocation ? this.storedLocation.right : this.element.getStyle('right'))
1152
+ if (this.useTop)
1153
+ value += ",t:" + (this.storedLocation ? this.storedLocation.top : this.element.getStyle('top'))
1154
+ else
1155
+ value += ",b:" + (this.storedLocation ? this.storedLocation.bottom :this.element.getStyle('bottom'))
1156
+
1157
+ value += "," + (this.storedLocation ? this.storedLocation.width : this.width);
1158
+ value += "," + (this.storedLocation ? this.storedLocation.height : this.height);
1159
+ value += "," + this.isMinimized();
1160
+ value += "," + this.isMaximized();
1161
+ WindowUtilities.setCookie(value, this.cookie)
1162
+ }
1163
+ },
1164
+
1165
+ _createWiredElement: function() {
1166
+ if (! this.wiredElement) {
1167
+ if (Prototype.Browser.IE)
1168
+ this._getWindowBorderSize();
1169
+ var div = document.createElement("div");
1170
+ div.className = "wired_frame " + this.options.className + "_wired_frame";
1171
+
1172
+ div.style.position = 'absolute';
1173
+ this.options.parent.insertBefore(div, this.options.parent.firstChild);
1174
+ this.wiredElement = $(div);
1175
+ }
1176
+ if (this.useLeft)
1177
+ this.wiredElement.setStyle({left: this.element.getStyle('left')});
1178
+ else
1179
+ this.wiredElement.setStyle({right: this.element.getStyle('right')});
1180
+
1181
+ if (this.useTop)
1182
+ this.wiredElement.setStyle({top: this.element.getStyle('top')});
1183
+ else
1184
+ this.wiredElement.setStyle({bottom: this.element.getStyle('bottom')});
1185
+
1186
+ var dim = this.element.getDimensions();
1187
+ this.wiredElement.setStyle({width: dim.width + "px", height: dim.height +"px"});
1188
+
1189
+ this.wiredElement.setStyle({zIndex: Windows.maxZIndex+30});
1190
+ return this.wiredElement;
1191
+ },
1192
+
1193
+ _hideWiredElement: function() {
1194
+ if (! this.wiredElement || ! this.currentDrag)
1195
+ return;
1196
+ if (this.currentDrag == this.element)
1197
+ this.currentDrag = null;
1198
+ else {
1199
+ if (this.useLeft)
1200
+ this.element.setStyle({left: this.currentDrag.getStyle('left')});
1201
+ else
1202
+ this.element.setStyle({right: this.currentDrag.getStyle('right')});
1203
+
1204
+ if (this.useTop)
1205
+ this.element.setStyle({top: this.currentDrag.getStyle('top')});
1206
+ else
1207
+ this.element.setStyle({bottom: this.currentDrag.getStyle('bottom')});
1208
+
1209
+ this.currentDrag.hide();
1210
+ this.currentDrag = null;
1211
+ if (this.doResize)
1212
+ this.setSize(this.width, this.height);
1213
+ }
1214
+ },
1215
+
1216
+ _notify: function(eventName) {
1217
+ if (this.options[eventName])
1218
+ this.options[eventName](this);
1219
+ else
1220
+ Windows.notify(eventName, this);
1221
+ }
1222
+ };
1223
+
1224
+ // Windows containers, register all page windows
1225
+ var Windows = {
1226
+ windows: [],
1227
+ modalWindows: [],
1228
+ observers: [],
1229
+ focusedWindow: null,
1230
+ maxZIndex: 0,
1231
+ overlayShowEffectOptions: {duration: 0.5},
1232
+ overlayHideEffectOptions: {duration: 0.5},
1233
+
1234
+ addObserver: function(observer) {
1235
+ this.removeObserver(observer);
1236
+ this.observers.push(observer);
1237
+ },
1238
+
1239
+ removeObserver: function(observer) {
1240
+ this.observers = this.observers.reject( function(o) { return o==observer });
1241
+ },
1242
+
1243
+ // onDestroy onStartResize onStartMove onResize onMove onEndResize onEndMove onFocus onBlur onBeforeShow onShow onHide onMinimize onMaximize onClose
1244
+ notify: function(eventName, win) {
1245
+ this.observers.each( function(o) {if(o[eventName]) o[eventName](eventName, win);});
1246
+ },
1247
+
1248
+ // Gets window from its id
1249
+ getWindow: function(id) {
1250
+ return this.windows.detect(function(d) { return d.getId() ==id });
1251
+ },
1252
+
1253
+ // Gets the last focused window
1254
+ getFocusedWindow: function() {
1255
+ return this.focusedWindow;
1256
+ },
1257
+
1258
+ updateFocusedWindow: function() {
1259
+ this.focusedWindow = this.windows.length >=2 ? this.windows[this.windows.length-2] : null;
1260
+ },
1261
+
1262
+ // Registers a new window (called by Windows constructor)
1263
+ register: function(win) {
1264
+ this.windows.push(win);
1265
+ },
1266
+
1267
+ // Add a modal window in the stack
1268
+ addModalWindow: function(win) {
1269
+ // Disable screen if first modal window
1270
+ if (this.modalWindows.length == 0) {
1271
+ WindowUtilities.disableScreen(win.options.className, 'overlay_modal', win.overlayOpacity, win.getId(), win.options.parent);
1272
+ }
1273
+ else {
1274
+ // Move overlay over all windows
1275
+ if (Window.keepMultiModalWindow) {
1276
+ $('overlay_modal').style.zIndex = Windows.maxZIndex + 1;
1277
+ Windows.maxZIndex += 1;
1278
+ WindowUtilities._hideSelect(this.modalWindows.last().getId());
1279
+ }
1280
+ // Hide current modal window
1281
+ else
1282
+ this.modalWindows.last().element.hide();
1283
+ // Fucking IE select issue
1284
+ WindowUtilities._showSelect(win.getId());
1285
+ }
1286
+ this.modalWindows.push(win);
1287
+ },
1288
+
1289
+ removeModalWindow: function(win) {
1290
+ this.modalWindows.pop();
1291
+
1292
+ // No more modal windows
1293
+ if (this.modalWindows.length == 0)
1294
+ WindowUtilities.enableScreen();
1295
+ else {
1296
+ if (Window.keepMultiModalWindow) {
1297
+ this.modalWindows.last().toFront();
1298
+ WindowUtilities._showSelect(this.modalWindows.last().getId());
1299
+ }
1300
+ else
1301
+ this.modalWindows.last().element.show();
1302
+ }
1303
+ },
1304
+
1305
+ // Registers a new window (called by Windows constructor)
1306
+ register: function(win) {
1307
+ this.windows.push(win);
1308
+ },
1309
+
1310
+ // Unregisters a window (called by Windows destructor)
1311
+ unregister: function(win) {
1312
+ this.windows = this.windows.reject(function(d) { return d==win });
1313
+ },
1314
+
1315
+ // Closes all windows
1316
+ closeAll: function() {
1317
+ this.windows.each( function(w) {Windows.close(w.getId())} );
1318
+ },
1319
+
1320
+ closeAllModalWindows: function() {
1321
+ WindowUtilities.enableScreen();
1322
+ this.modalWindows.each( function(win) {if (win) win.close()});
1323
+ },
1324
+
1325
+ // Minimizes a window with its id
1326
+ minimize: function(id, event) {
1327
+ var win = this.getWindow(id)
1328
+ if (win && win.visible)
1329
+ win.minimize();
1330
+ Event.stop(event);
1331
+ },
1332
+
1333
+ // Maximizes a window with its id
1334
+ maximize: function(id, event) {
1335
+ var win = this.getWindow(id)
1336
+ if (win && win.visible)
1337
+ win.maximize();
1338
+ Event.stop(event);
1339
+ },
1340
+
1341
+ // Closes a window with its id
1342
+ close: function(id, event) {
1343
+ var win = this.getWindow(id);
1344
+ if (win)
1345
+ win.close();
1346
+ if (event)
1347
+ Event.stop(event);
1348
+ },
1349
+
1350
+ blur: function(id) {
1351
+ var win = this.getWindow(id);
1352
+ if (!win)
1353
+ return;
1354
+ if (win.options.blurClassName)
1355
+ win.changeClassName(win.options.blurClassName);
1356
+ if (this.focusedWindow == win)
1357
+ this.focusedWindow = null;
1358
+ win._notify("onBlur");
1359
+ },
1360
+
1361
+ focus: function(id) {
1362
+ var win = this.getWindow(id);
1363
+ if (!win)
1364
+ return;
1365
+ if (this.focusedWindow)
1366
+ this.blur(this.focusedWindow.getId())
1367
+
1368
+ if (win.options.focusClassName)
1369
+ win.changeClassName(win.options.focusClassName);
1370
+ this.focusedWindow = win;
1371
+ win._notify("onFocus");
1372
+ },
1373
+
1374
+ unsetOverflow: function(except) {
1375
+ this.windows.each(function(d) { d.oldOverflow = d.getContent().getStyle("overflow") || "auto" ; d.getContent().setStyle({overflow: "hidden"}) });
1376
+ if (except && except.oldOverflow)
1377
+ except.getContent().setStyle({overflow: except.oldOverflow});
1378
+ },
1379
+
1380
+ resetOverflow: function() {
1381
+ this.windows.each(function(d) { if (d.oldOverflow) d.getContent().setStyle({overflow: d.oldOverflow}) });
1382
+ },
1383
+
1384
+ updateZindex: function(zindex, win) {
1385
+ if (zindex > this.maxZIndex) {
1386
+ this.maxZIndex = zindex;
1387
+ if (this.focusedWindow)
1388
+ this.blur(this.focusedWindow.getId())
1389
+ }
1390
+ this.focusedWindow = win;
1391
+ if (this.focusedWindow)
1392
+ this.focus(this.focusedWindow.getId())
1393
+ }
1394
+ };
1395
+
1396
+ var Dialog = {
1397
+ dialogId: null,
1398
+ onCompleteFunc: null,
1399
+ callFunc: null,
1400
+ parameters: null,
1401
+
1402
+ confirm: function(content, parameters) {
1403
+ // Get Ajax return before
1404
+ if (content && typeof content != "string") {
1405
+ Dialog._runAjaxRequest(content, parameters, Dialog.confirm);
1406
+ return
1407
+ }
1408
+ content = content || "";
1409
+
1410
+ parameters = parameters || {};
1411
+ var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
1412
+ var cancelLabel = parameters.cancelLabel ? parameters.cancelLabel : "Cancel";
1413
+
1414
+ // Backward compatibility
1415
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
1416
+ parameters.windowParameters = parameters.windowParameters || {};
1417
+
1418
+ parameters.className = parameters.className || "alert";
1419
+
1420
+ var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
1421
+ var cancelButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " cancel_button'"
1422
+ var content = "\
1423
+ <div class='" + parameters.className + "_message'>" + content + "</div>\
1424
+ <div class='" + parameters.className + "_buttons'>\
1425
+ <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
1426
+ <input type='button' value='" + cancelLabel + "' onclick='Dialog.cancelCallback()' " + cancelButtonClass + "/>\
1427
+ </div>\
1428
+ ";
1429
+ return this._openDialog(content, parameters)
1430
+ },
1431
+
1432
+ alert: function(content, parameters) {
1433
+ // Get Ajax return before
1434
+ if (content && typeof content != "string") {
1435
+ Dialog._runAjaxRequest(content, parameters, Dialog.alert);
1436
+ return
1437
+ }
1438
+ content = content || "";
1439
+
1440
+ parameters = parameters || {};
1441
+ var okLabel = parameters.okLabel ? parameters.okLabel : "Ok";
1442
+
1443
+ // Backward compatibility
1444
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
1445
+ parameters.windowParameters = parameters.windowParameters || {};
1446
+
1447
+ parameters.className = parameters.className || "alert";
1448
+
1449
+ var okButtonClass = "class ='" + (parameters.buttonClass ? parameters.buttonClass + " " : "") + " ok_button'"
1450
+ var content = "\
1451
+ <div class='" + parameters.className + "_message'>" + content + "</div>\
1452
+ <div class='" + parameters.className + "_buttons'>\
1453
+ <input type='button' value='" + okLabel + "' onclick='Dialog.okCallback()' " + okButtonClass + "/>\
1454
+ </div>";
1455
+ return this._openDialog(content, parameters)
1456
+ },
1457
+
1458
+ info: function(content, parameters) {
1459
+ // Get Ajax return before
1460
+ if (content && typeof content != "string") {
1461
+ Dialog._runAjaxRequest(content, parameters, Dialog.info);
1462
+ return
1463
+ }
1464
+ content = content || "";
1465
+
1466
+ // Backward compatibility
1467
+ parameters = parameters || {};
1468
+ parameters = Object.extend(parameters, parameters.windowParameters || {});
1469
+ parameters.windowParameters = parameters.windowParameters || {};
1470
+
1471
+ parameters.className = parameters.className || "alert";
1472
+
1473
+ var content = "<div id='modal_dialog_message' class='" + parameters.className + "_message'>" + content + "</div>";
1474
+ if (parameters.showProgress)
1475
+ content += "<div id='modal_dialog_progress' class='" + parameters.className + "_progress'> </div>";
1476
+
1477
+ parameters.ok = null;
1478
+ parameters.cancel = null;
1479
+
1480
+ return this._openDialog(content, parameters)
1481
+ },
1482
+
1483
+ setInfoMessage: function(message) {
1484
+ $('modal_dialog_message').update(message);
1485
+ },
1486
+
1487
+ closeInfo: function() {
1488
+ Windows.close(this.dialogId);
1489
+ },
1490
+
1491
+ _openDialog: function(content, parameters) {
1492
+ var className = parameters.className;
1493
+
1494
+ if (! parameters.height && ! parameters.width) {
1495
+ parameters.width = WindowUtilities.getPageSize(parameters.options.parent || document.body).pageWidth / 2;
1496
+ }
1497
+ if (parameters.id)
1498
+ this.dialogId = parameters.id;
1499
+ else {
1500
+ var t = new Date();
1501
+ this.dialogId = 'modal_dialog_' + t.getTime();
1502
+ parameters.id = this.dialogId;
1503
+ }
1504
+
1505
+ // compute height or width if need be
1506
+ if (! parameters.height || ! parameters.width) {
1507
+ var size = WindowUtilities._computeSize(content, this.dialogId, parameters.width, parameters.height, 5, className)
1508
+ if (parameters.height)
1509
+ parameters.width = size + 5
1510
+ else
1511
+ parameters.height = size + 5
1512
+ }
1513
+ parameters.effectOptions = parameters.effectOptions ;
1514
+ parameters.resizable = parameters.resizable || false;
1515
+ parameters.minimizable = parameters.minimizable || false;
1516
+ parameters.maximizable = parameters.maximizable || false;
1517
+ parameters.draggable = parameters.draggable || false;
1518
+ parameters.closable = parameters.closable || false;
1519
+
1520
+ var win = new Window(parameters);
1521
+ win.getContent().innerHTML = content;
1522
+
1523
+ win.showCenter(true, parameters.top, parameters.left);
1524
+ win.setDestroyOnClose();
1525
+
1526
+ win.cancelCallback = parameters.onCancel || parameters.cancel;
1527
+ win.okCallback = parameters.onOk || parameters.ok;
1528
+
1529
+ return win;
1530
+ },
1531
+
1532
+ _getAjaxContent: function(originalRequest) {
1533
+ Dialog.callFunc(originalRequest.responseText, Dialog.parameters)
1534
+ },
1535
+
1536
+ _runAjaxRequest: function(message, parameters, callFunc) {
1537
+ if (message.options == null)
1538
+ message.options = {}
1539
+ Dialog.onCompleteFunc = message.options.onComplete;
1540
+ Dialog.parameters = parameters;
1541
+ Dialog.callFunc = callFunc;
1542
+
1543
+ message.options.onComplete = Dialog._getAjaxContent;
1544
+ new Ajax.Request(message.url, message.options);
1545
+ },
1546
+
1547
+ okCallback: function() {
1548
+ var win = Windows.focusedWindow;
1549
+ if (!win.okCallback || win.okCallback(win)) {
1550
+ // Remove onclick on button
1551
+ $$("#" + win.getId()+" input").each(function(element) {element.onclick=null;})
1552
+ win.close();
1553
+ }
1554
+ },
1555
+
1556
+ cancelCallback: function() {
1557
+ var win = Windows.focusedWindow;
1558
+ // Remove onclick on button
1559
+ $$("#" + win.getId()+" input").each(function(element) {element.onclick=null})
1560
+ win.close();
1561
+ if (win.cancelCallback)
1562
+ win.cancelCallback(win);
1563
+ }
1564
+ }
1565
+ /*
1566
+ Based on Lightbox JS: Fullsize Image Overlays
1567
+ by Lokesh Dhakar - http://www.huddletogether.com
1568
+
1569
+ For more information on this script, visit:
1570
+ http://huddletogether.com/projects/lightbox/
1571
+
1572
+ Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
1573
+ (basically, do anything you want, just leave my name and link)
1574
+ */
1575
+
1576
+ if (Prototype.Browser.WebKit) {
1577
+ var array = navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));
1578
+ Prototype.Browser.WebKitVersion = parseFloat(array[1]);
1579
+ }
1580
+
1581
+ var WindowUtilities = {
1582
+ // From dragdrop.js
1583
+ getWindowScroll: function(parent) {
1584
+ var T, L, W, H;
1585
+ parent = parent || document.body;
1586
+ if (parent != document.body) {
1587
+ T = parent.scrollTop;
1588
+ L = parent.scrollLeft;
1589
+ W = parent.scrollWidth;
1590
+ H = parent.scrollHeight;
1591
+ }
1592
+ else {
1593
+ var w = window;
1594
+ with (w.document) {
1595
+ if (w.document.documentElement && documentElement.scrollTop) {
1596
+ T = documentElement.scrollTop;
1597
+ L = documentElement.scrollLeft;
1598
+ } else if (w.document.body) {
1599
+ T = body.scrollTop;
1600
+ L = body.scrollLeft;
1601
+ }
1602
+ if (w.innerWidth) {
1603
+ W = w.innerWidth;
1604
+ H = w.innerHeight;
1605
+ } else if (w.document.documentElement && documentElement.clientWidth) {
1606
+ W = documentElement.clientWidth;
1607
+ H = documentElement.clientHeight;
1608
+ } else {
1609
+ W = body.offsetWidth;
1610
+ H = body.offsetHeight
1611
+ }
1612
+ }
1613
+ }
1614
+ return { top: T, left: L, width: W, height: H };
1615
+ },
1616
+ //
1617
+ // getPageSize()
1618
+ // Returns array with page width, height and window width, height
1619
+ // Core code from - quirksmode.org
1620
+ // Edit for Firefox by pHaez
1621
+ //
1622
+ getPageSize: function(parent){
1623
+ parent = parent || document.body;
1624
+ var windowWidth, windowHeight;
1625
+ var pageHeight, pageWidth;
1626
+ if (parent != document.body) {
1627
+ windowWidth = parent.getWidth();
1628
+ windowHeight = parent.getHeight();
1629
+ pageWidth = parent.scrollWidth;
1630
+ pageHeight = parent.scrollHeight;
1631
+ }
1632
+ else {
1633
+ var xScroll, yScroll;
1634
+
1635
+ if (window.innerHeight && window.scrollMaxY) {
1636
+ xScroll = document.body.scrollWidth;
1637
+ yScroll = window.innerHeight + window.scrollMaxY;
1638
+ } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
1639
+ xScroll = document.body.scrollWidth;
1640
+ yScroll = document.body.scrollHeight;
1641
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
1642
+ xScroll = document.body.offsetWidth;
1643
+ yScroll = document.body.offsetHeight;
1644
+ }
1645
+
1646
+
1647
+ if (self.innerHeight) { // all except Explorer
1648
+ windowWidth = self.innerWidth;
1649
+ windowHeight = self.innerHeight;
1650
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
1651
+ windowWidth = document.documentElement.clientWidth;
1652
+ windowHeight = document.documentElement.clientHeight;
1653
+ } else if (document.body) { // other Explorers
1654
+ windowWidth = document.body.clientWidth;
1655
+ windowHeight = document.body.clientHeight;
1656
+ }
1657
+
1658
+ // for small pages with total height less then height of the viewport
1659
+ if(yScroll < windowHeight){
1660
+ pageHeight = windowHeight;
1661
+ } else {
1662
+ pageHeight = yScroll;
1663
+ }
1664
+
1665
+ // for small pages with total width less then width of the viewport
1666
+ if(xScroll < windowWidth){
1667
+ pageWidth = windowWidth;
1668
+ } else {
1669
+ pageWidth = xScroll;
1670
+ }
1671
+ }
1672
+ return {pageWidth: pageWidth ,pageHeight: pageHeight , windowWidth: windowWidth, windowHeight: windowHeight};
1673
+ },
1674
+
1675
+ disableScreen: function(className, overlayId, overlayOpacity, contentId, parent) {
1676
+ WindowUtilities.initLightbox(overlayId, className, function() {this._disableScreen(className, overlayId, overlayOpacity, contentId)}.bind(this), parent || document.body);
1677
+ },
1678
+
1679
+ _disableScreen: function(className, overlayId, overlayOpacity, contentId) {
1680
+ // prep objects
1681
+ var objOverlay = $(overlayId);
1682
+
1683
+ var pageSize = WindowUtilities.getPageSize(objOverlay.parentNode);
1684
+
1685
+ // Hide select boxes as they will 'peek' through the image in IE, store old value
1686
+ if (contentId && Prototype.Browser.IE) {
1687
+ WindowUtilities._hideSelect();
1688
+ WindowUtilities._showSelect(contentId);
1689
+ }
1690
+
1691
+ // set height of Overlay to take up whole page and show
1692
+ objOverlay.style.height = (pageSize.pageHeight + 'px');
1693
+ objOverlay.style.display = 'none';
1694
+ if (overlayId == "overlay_modal" && Window.hasEffectLib && Windows.overlayShowEffectOptions) {
1695
+ objOverlay.overlayOpacity = overlayOpacity;
1696
+ new Effect.Appear(objOverlay, Object.extend({from: 0, to: overlayOpacity}, Windows.overlayShowEffectOptions));
1697
+ }
1698
+ else
1699
+ objOverlay.style.display = "block";
1700
+ },
1701
+
1702
+ enableScreen: function(id) {
1703
+ id = id || 'overlay_modal';
1704
+ var objOverlay = $(id);
1705
+ if (objOverlay) {
1706
+ // hide lightbox and overlay
1707
+ if (id == "overlay_modal" && Window.hasEffectLib && Windows.overlayHideEffectOptions)
1708
+ new Effect.Fade(objOverlay, Object.extend({from: objOverlay.overlayOpacity, to:0}, Windows.overlayHideEffectOptions));
1709
+ else {
1710
+ objOverlay.style.display = 'none';
1711
+ objOverlay.parentNode.removeChild(objOverlay);
1712
+ }
1713
+
1714
+ // make select boxes visible using old value
1715
+ if (id != "__invisible__")
1716
+ WindowUtilities._showSelect();
1717
+ }
1718
+ },
1719
+
1720
+ _hideSelect: function(id) {
1721
+ if (Prototype.Browser.IE) {
1722
+ id = id == null ? "" : "#" + id + " ";
1723
+ $$(id + 'select').each(function(element) {
1724
+ if (! WindowUtilities.isDefined(element.oldVisibility)) {
1725
+ element.oldVisibility = element.style.visibility ? element.style.visibility : "visible";
1726
+ element.style.visibility = "hidden";
1727
+ }
1728
+ });
1729
+ }
1730
+ },
1731
+
1732
+ _showSelect: function(id) {
1733
+ if (Prototype.Browser.IE) {
1734
+ id = id == null ? "" : "#" + id + " ";
1735
+ $$(id + 'select').each(function(element) {
1736
+ if (WindowUtilities.isDefined(element.oldVisibility)) {
1737
+ // Why?? Ask IE
1738
+ try {
1739
+ element.style.visibility = element.oldVisibility;
1740
+ } catch(e) {
1741
+ element.style.visibility = "visible";
1742
+ }
1743
+ element.oldVisibility = null;
1744
+ }
1745
+ else {
1746
+ if (element.style.visibility)
1747
+ element.style.visibility = "visible";
1748
+ }
1749
+ });
1750
+ }
1751
+ },
1752
+
1753
+ isDefined: function(object) {
1754
+ return typeof(object) != "undefined" && object != null;
1755
+ },
1756
+
1757
+ // initLightbox()
1758
+ // Function runs on window load, going through link tags looking for rel="lightbox".
1759
+ // These links receive onclick events that enable the lightbox display for their targets.
1760
+ // The function also inserts html markup at the top of the page which will be used as a
1761
+ // container for the overlay pattern and the inline image.
1762
+ initLightbox: function(id, className, doneHandler, parent) {
1763
+ // Already done, just update zIndex
1764
+ if ($(id)) {
1765
+ Element.setStyle(id, {zIndex: Windows.maxZIndex + 1});
1766
+ Windows.maxZIndex++;
1767
+ doneHandler();
1768
+ }
1769
+ // create overlay div and hardcode some functional styles (aesthetic styles are in CSS file)
1770
+ else {
1771
+ var objOverlay = document.createElement("div");
1772
+ objOverlay.setAttribute('id', id);
1773
+ objOverlay.className = "overlay_" + className
1774
+ objOverlay.style.display = 'none';
1775
+ objOverlay.style.position = 'absolute';
1776
+ objOverlay.style.top = '0';
1777
+ objOverlay.style.left = '0';
1778
+ objOverlay.style.zIndex = Windows.maxZIndex + 1;
1779
+ Windows.maxZIndex++;
1780
+ objOverlay.style.width = '100%';
1781
+ parent.insertBefore(objOverlay, parent.firstChild);
1782
+ if (Prototype.Browser.WebKit && id == "overlay_modal") {
1783
+ setTimeout(function() {doneHandler()}, 10);
1784
+ }
1785
+ else
1786
+ doneHandler();
1787
+ }
1788
+ },
1789
+
1790
+ setCookie: function(value, parameters) {
1791
+ document.cookie= parameters[0] + "=" + escape(value) +
1792
+ ((parameters[1]) ? "; expires=" + parameters[1].toGMTString() : "") +
1793
+ ((parameters[2]) ? "; path=" + parameters[2] : "") +
1794
+ ((parameters[3]) ? "; domain=" + parameters[3] : "") +
1795
+ ((parameters[4]) ? "; secure" : "");
1796
+ },
1797
+
1798
+ getCookie: function(name) {
1799
+ var dc = document.cookie;
1800
+ var prefix = name + "=";
1801
+ var begin = dc.indexOf("; " + prefix);
1802
+ if (begin == -1) {
1803
+ begin = dc.indexOf(prefix);
1804
+ if (begin != 0) return null;
1805
+ } else {
1806
+ begin += 2;
1807
+ }
1808
+ var end = document.cookie.indexOf(";", begin);
1809
+ if (end == -1) {
1810
+ end = dc.length;
1811
+ }
1812
+ return unescape(dc.substring(begin + prefix.length, end));
1813
+ },
1814
+
1815
+ _computeSize: function(content, id, width, height, margin, className) {
1816
+ var objBody = document.body;
1817
+ var tmpObj = document.createElement("div");
1818
+ tmpObj.setAttribute('id', id);
1819
+ tmpObj.className = className + "_content";
1820
+
1821
+ if (height)
1822
+ tmpObj.style.height = height + "px"
1823
+ else
1824
+ tmpObj.style.width = width + "px"
1825
+
1826
+ tmpObj.style.position = 'absolute';
1827
+ tmpObj.style.top = '0';
1828
+ tmpObj.style.left = '0';
1829
+ tmpObj.style.display = 'none';
1830
+
1831
+ tmpObj.innerHTML = content;
1832
+ objBody.insertBefore(tmpObj, objBody.firstChild);
1833
+
1834
+ var size;
1835
+ if (height)
1836
+ size = $(tmpObj).getDimensions().width + margin;
1837
+ else
1838
+ size = $(tmpObj).getDimensions().height + margin;
1839
+ objBody.removeChild(tmpObj);
1840
+ return size;
1841
+ }
1842
+ }
1843
+
js/toogas/slideshow/slideshow.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var delay=3000;var start_frame=0;var el=0;var timeout=0;var timeout1=0;var timeout2=0;function init(){var lis=$('slide-images').getElementsByTagName('li');for(i=0;i<lis.length;i++){if(i!=0){lis[i].style.display='none';}}
2
+ end_frame=lis.length-1;start_slideshow(start_frame,end_frame,delay,lis,el);}
3
+ function start_slideshow(start_frame,end_frame,delay,lis,el){$('show_0').setAttribute("src","skin/frontend/base/default/images/slideshow/active.png");$('show_0').addClassName('active');timeout=setTimeout(function(){fadeInOut(start_frame,start_frame,end_frame,delay,lis,el,timeout)},delay);}
4
+ function fadeInOut(frame,start_frame,end_frame,delay,lis,el){lis=$('slide-images').getElementsByTagName('li');Effect.Fade(lis[frame]);if(frame==end_frame){frame=start_frame;}else{frame++;}
5
+ lisAppear=lis[frame];if(el<end_frame)
6
+ {var el=el+1;}
7
+ else
8
+ {var el=0;}
9
+ if(el=='0')
10
+ {$('show_'+end_frame).setAttribute("src","skin/frontend/base/default/images/slideshow/not_active.png");$('show_'+end_frame).removeClassName('active');}
11
+ $('show_'+el).setAttribute("src","skin/frontend/base/default/images/slideshow/active.png");$('show_'+el).addClassName('active');if(el>0)
12
+ {var temp=el-1;$('show_'+temp).setAttribute("src","skin/frontend/base/default/images/slideshow/not_active.png");$('show_'+temp).removeClassName('active');}
13
+ timeout1=setTimeout("Effect.Appear(lisAppear);",0);timeout2=setTimeout(function(){fadeInOut(frame,start_frame,end_frame,delay,null,el)},delay+1850);}
14
+ function disableNextImage(){$('nextImg').setAttribute("onclick","changeNextImg()");}
15
+ function disablePreviousImage(){$('previousImg').setAttribute("onclick","changePreviousImg()");}
16
+ function changeNextImg(){clearTimeout(timeout);clearTimeout(timeout1);clearTimeout(timeout2);$('nextImg').setAttribute("onclick","");var start_frame=0;var lis=$('slide-images').getElementsByTagName('li');var end_frame=lis.length-1;var show=$('show').getElementsByTagName('img');for(i=0;i<show.length;i++)
17
+ {if($(show[i].id).hasClassName('active'))
18
+ {id=show[i].id;var temp1=id.split("_");if(temp1[1]==end_frame)
19
+ {Effect.Fade(lis[temp1[1]]);var next_num=start_frame;}
20
+ else
21
+ {Effect.Fade(lis[temp1[1]]);var next_num=parseFloat(temp1[1])+parseFloat(1);}}}
22
+ lisAppear=lis[next_num];$('show_'+next_num).setAttribute("src","skin/frontend/base/default/images/slideshow/active.png");$('show_'+next_num).addClassName('active');for(i=0;i<lis.length;i++)
23
+ {if(i!=next_num)
24
+ {lis[i].style.display='none';}}
25
+ for(i=0;i<show.length;i++)
26
+ {if(show[i].id!='show_'+next_num)
27
+ {$(show[i].id).setAttribute("src","skin/frontend/base/default/images/slideshow/not_active.png");$(show[i].id).removeClassName('active');}}
28
+ setTimeout("Effect.Appear(lisAppear);",0);setTimeout("disableNextImage()",1000);}
29
+ function changePreviousImg(){clearTimeout(timeout);clearTimeout(timeout1);clearTimeout(timeout2);$('previousImg').setAttribute("onclick","");var start_frame=0;var lis=$('slide-images').getElementsByTagName('li');var end_frame=lis.length-1;var show=$('show').getElementsByTagName('img');for(i=0;i<show.length;i++)
30
+ {if($(show[i].id).hasClassName('active'))
31
+ {id=show[i].id;var temp1=id.split("_");if(temp1[1]==start_frame)
32
+ {Effect.Fade(lis[temp1[1]]);var previous_num=end_frame;}
33
+ else
34
+ {Effect.Fade(lis[temp1[1]]);var previous_num=temp1[1]-1;}}}
35
+ lisAppear=lis[previous_num];$('show_'+previous_num).setAttribute("src","skin/frontend/base/default/images/slideshow/active.png");$('show_'+previous_num).addClassName('active');for(i=0;i<lis.length;i++)
36
+ {if(i!=previous_num)
37
+ {lis[i].style.display='none';}}
38
+ for(i=0;i<show.length;i++)
39
+ {if(show[i].id!='show_'+previous_num)
40
+ {$(show[i].id).setAttribute("src","skin/frontend/base/default/images/slideshow/not_active.png");$(show[i].id).removeClassName('active');}}
41
+ setTimeout("Effect.Appear(lisAppear);",0);setTimeout("disablePreviousImage()",1000);}
42
+ Event.observe(window,'load',init,false);function showSearch()
43
+ {if($('form-search').hasClassName('hidesearch'))
44
+ {$('form-search').removeClassName('hidesearch');}
45
+ else{$('form-search').addClassName('hidesearch');}}
js/toogas/slideshow/slideshow.js~ ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var delay=3000;var start_frame=0;var el=0;var timeout=0;var timeout1=0;var timeout2=0;function init(){var lis=$('slide-images').getElementsByTagName('li');for(i=0;i<lis.length;i++){if(i!=0){lis[i].style.display='none';}}
2
+ end_frame=lis.length-1;start_slideshow(start_frame,end_frame,delay,lis,el);}
3
+ function start_slideshow(start_frame,end_frame,delay,lis,el){$('show_0').setAttribute("src","skin/frontend/toogas/default/images/active.png");$('show_0').addClassName('active');timeout=setTimeout(function(){fadeInOut(start_frame,start_frame,end_frame,delay,lis,el,timeout)},delay);}
4
+ function fadeInOut(frame,start_frame,end_frame,delay,lis,el){lis=$('slide-images').getElementsByTagName('li');Effect.Fade(lis[frame]);if(frame==end_frame){frame=start_frame;}else{frame++;}
5
+ lisAppear=lis[frame];if(el<end_frame)
6
+ {var el=el+1;}
7
+ else
8
+ {var el=0;}
9
+ if(el=='0')
10
+ {$('show_'+end_frame).setAttribute("src","skin/frontend/toogas/default/images/not_active.png");$('show_'+end_frame).removeClassName('active');}
11
+ $('show_'+el).setAttribute("src","skin/frontend/toogas/default/images/active.png");$('show_'+el).addClassName('active');if(el>0)
12
+ {var temp=el-1;$('show_'+temp).setAttribute("src","skin/frontend/toogas/default/images/not_active.png");$('show_'+temp).removeClassName('active');}
13
+ timeout1=setTimeout("Effect.Appear(lisAppear);",0);timeout2=setTimeout(function(){fadeInOut(frame,start_frame,end_frame,delay,null,el)},delay+1850);}
14
+ function disableNextImage(){$('nextImg').setAttribute("onclick","changeNextImg()");}
15
+ function disablePreviousImage(){$('previousImg').setAttribute("onclick","changePreviousImg()");}
16
+ function changeNextImg(){clearTimeout(timeout);clearTimeout(timeout1);clearTimeout(timeout2);$('nextImg').setAttribute("onclick","");var start_frame=0;var lis=$('slide-images').getElementsByTagName('li');var end_frame=lis.length-1;var show=$('show').getElementsByTagName('img');for(i=0;i<show.length;i++)
17
+ {if($(show[i].id).hasClassName('active'))
18
+ {id=show[i].id;var temp1=id.split("_");if(temp1[1]==end_frame)
19
+ {Effect.Fade(lis[temp1[1]]);var next_num=start_frame;}
20
+ else
21
+ {Effect.Fade(lis[temp1[1]]);var next_num=parseFloat(temp1[1])+parseFloat(1);}}}
22
+ lisAppear=lis[next_num];$('show_'+next_num).setAttribute("src","skin/frontend/toogas/default/images/active.png");$('show_'+next_num).addClassName('active');for(i=0;i<lis.length;i++)
23
+ {if(i!=next_num)
24
+ {lis[i].style.display='none';}}
25
+ for(i=0;i<show.length;i++)
26
+ {if(show[i].id!='show_'+next_num)
27
+ {$(show[i].id).setAttribute("src","skin/frontend/toogas/default/images/not_active.png");$(show[i].id).removeClassName('active');}}
28
+ setTimeout("Effect.Appear(lisAppear);",0);setTimeout("disableNextImage()",1000);}
29
+ function changePreviousImg(){clearTimeout(timeout);clearTimeout(timeout1);clearTimeout(timeout2);$('previousImg').setAttribute("onclick","");var start_frame=0;var lis=$('slide-images').getElementsByTagName('li');var end_frame=lis.length-1;var show=$('show').getElementsByTagName('img');for(i=0;i<show.length;i++)
30
+ {if($(show[i].id).hasClassName('active'))
31
+ {id=show[i].id;var temp1=id.split("_");if(temp1[1]==start_frame)
32
+ {Effect.Fade(lis[temp1[1]]);var previous_num=end_frame;}
33
+ else
34
+ {Effect.Fade(lis[temp1[1]]);var previous_num=temp1[1]-1;}}}
35
+ lisAppear=lis[previous_num];$('show_'+previous_num).setAttribute("src","skin/frontend/toogas/default/images/active.png");$('show_'+previous_num).addClassName('active');for(i=0;i<lis.length;i++)
36
+ {if(i!=previous_num)
37
+ {lis[i].style.display='none';}}
38
+ for(i=0;i<show.length;i++)
39
+ {if(show[i].id!='show_'+previous_num)
40
+ {$(show[i].id).setAttribute("src","skin/frontend/toogas/default/images/not_active.png");$(show[i].id).removeClassName('active');}}
41
+ setTimeout("Effect.Appear(lisAppear);",0);setTimeout("disablePreviousImage()",1000);}
42
+ Event.observe(window,'load',init,false);function showSearch()
43
+ {if($('form-search').hasClassName('hidesearch'))
44
+ {$('form-search').removeClassName('hidesearch');}
45
+ else{$('form-search').addClassName('hidesearch');}}
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>toogas_featured_popup_free_version</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.toogas.com/licences/toogas_license-free.txt">Community</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>With Featured Pop-Up extension it&#x2019;s possible to define the pop-ups you want being called from the Homepage.</summary>
10
+ <description>With fully customized options at magento&#x2019;s admin (CMS -&gt; Featured Popup) just define, for each one of them, the correspondent image, its dimensions, associated store views and the several optional settings (opacity, priority &#x2013; in case of more than one popup being called from the same page, start and close delays of the popup window and even an associated link to allow, upon a mouse clicking, to jump to that specific URL).
11
+
12
+ You can also define the &#x201C;from&#x201D; and &#x201C;to&#x201D; dates during which the popup is going to be enable and visible.</description>
13
+ <notes>Free Version of the Featured Popup.</notes>
14
+ <authors><author><name>Pedro Azevedo</name><user>auto-converted</user><email>pedrovazazevedo@toogas.com</email></author><author><name>Paulo Silva</name><user>auto-converted</user><email>psilva@toogas.com</email></author></authors>
15
+ <date>2011-02-14</date>
16
+ <time>17:09:03</time>
17
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="toogas"><dir name="Featuredpopup"><file name="featured_popup.gif" hash="ab25e7f2c819f15c78384820dad0a745"/></dir><file name="toogas_logo.jpg" hash="e8ef5fcbb97484e3a2ad1fe5d84c0a88"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="Toogas"><dir name="Featuredpopup"><dir name="default"><file name="bottom_left.gif" hash="fb99ffa815a8648f95f42698fe5dfaa1"/><file name="bottom_mid.gif" hash="49b9ca7025562ea7f070a9111282364b"/><file name="bottom_right.gif" hash="e46768f632765cd86c5fe5d0166dcf2c"/><file name="bottom_right_resize.gif" hash="1b35a4ec3b734dfe37e31ba87bcc7d99"/><file name="center_left.gif" hash="bd567580b4ee16a7a2734057cfbbe219"/><file name="center_right.gif" hash="eef184d5d89d1710313581a2ccf408e8"/><file name="clear.gif" hash="7af1206eeb0e7834a75e69d70676060d"/><file name="close.gif" hash="8a08f243c37a8e25a88d4ac135b2f07d"/><file name="inspect.gif" hash="aa2a0961067aad5c54b8634919af863b"/><file name="maximize.gif" hash="e73cd71c4979ebeadeb9e27d40a9e8fb"/><file name="minimize.gif" hash="2d2f4b1bd0506f342425f80ab76c49a3"/><file name="overlay.png" hash="536d40e87cda0c7ae7b11f1721aa52d0"/><file name="resize.gif" hash="320f534b5d444b39701e0b679529e779"/><file name="sizer.gif" hash="1b35a4ec3b734dfe37e31ba87bcc7d99"/><file name="top_left.gif" hash="9c5e5920bfc189a45cc618099af93aa8"/><file name="top_mid.gif" hash="a12ff2b944025ad2d127d033dae5e9e1"/><file name="top_right.gif" hash="0cf1ec5b93f8ac8fcce0e2f72cf7f45e"/></dir><dir name="mac_os_x"><file name="B.png" hash="2fea4a4d5e990fa375ad9eaf020bee5e"/><file name="BL.png" hash="ea146bd3aad0711cdff18d9c4da9ef91"/><file name="BL_Main.png" hash=""/><file name="BR.png" hash="2b2e6565cee5e26dda2f01a1f49bbc29"/><file name="BR_Main.png" hash=""/><file name="B_Main.png" hash="cf6434f14c177549cb105409c57ad6a1"/><file name="close.gif" hash="8a08f243c37a8e25a88d4ac135b2f07d"/><file name="L.png" hash="853d64d3d3bf796216f4a5316678af91"/><file name="L_Main.png" hash="634dacbbe3897ff7ece850d1dbb9965e"/><file name="maximize.gif" hash="e73cd71c4979ebeadeb9e27d40a9e8fb"/><file name="minimize.gif" hash="2d2f4b1bd0506f342425f80ab76c49a3"/><file name="R.png" hash="987d585b4a287276e24432b4698d9bc0"/><file name="R_Main.png" hash="e3b066b234b460afebd1d423eb483dd7"/><file name="T.png" hash="827cdb4c01906725269435d11daf3294"/><file name="TL.png" hash="87c0672cbef7a0a4e9bb3133cb93ddaa"/><file name="TL_Main.png" hash="137daac506cf6748cb56536a436ba137"/><file name="TR.png" hash="b69408667b74fc79bb49a9a7585be0ca"/><file name="TR_Main.png" hash="c510261f75c9887efea1fbd1bbed35f1"/><file name="T_Main.png" hash="a0aec2a53e2cbdbe7ef589ca7c999ffe"/></dir><file name="default.css" hash="60cd9ab79c6c09ab21b770443a910d04"/></dir></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="featuredpopup.xml" hash="f720029f4bf9fc7faef47b3589f17848"/></dir><dir name="template"><dir name="toogas_toogaslda"><dir name="system"><dir name="config"><dir name="fieldset"><file name="toogas.phtml" hash="813549d1e4456d9c58bae8911d851672"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="toogas_featuredpopup.xml" hash="4291651633167a90f06d12617cfa9067"/></dir><dir name="template"><dir name="toogas_featuredpopup"><file name="featuredpopup.phtml" hash="2a4128e76afb2ad05e5b448145021fdc"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_GB"><file name="Toogas_Featuredpopup.csv" hash="7f321efbc01725fb27c9746fc102d51e"/><file name="Toogas_Toogaslda.csv" hash="fba436aad6f9db392405de33fea5ad49"/></dir><dir name="en_US"><file name="Toogas_Featuredpopup.csv" hash="7f321efbc01725fb27c9746fc102d51e"/><file name="Toogas_Toogaslda.csv" hash="fba436aad6f9db392405de33fea5ad49"/></dir><dir name="es_ES"><file name="Toogas_Featuredpopup.csv" hash="8ef5fc4e310ac7ba80c53c7036bf8e32"/><file name="Toogas_Toogaslda.csv" hash="4742f5912349c51917bb068cce36e07a"/></dir><dir name="pt_BR"><file name="Toogas_Featuredpopup.csv" hash="cf68df906ba4f1e454f1db6c1d6a0aa9"/><file name="Toogas_Toogaslda.csv" hash="50d38d03fd09c4cfef6df07ca47a8f81"/></dir><dir name="pt_PT"><file name="Toogas_Featuredpopup.csv" hash="cf68df906ba4f1e454f1db6c1d6a0aa9"/><file name="Toogas_Toogaslda.csv" hash="50d38d03fd09c4cfef6df07ca47a8f81"/></dir></target><target name="mageweb"><dir name="js"><dir name="toogas"><dir name="featuredpopup"><dir name="js"><file name="window.js" hash="0b119d6ec8c49da99a854dad60a4195f"/><file name="window_orig.js" hash="1e305ad1d962f10a56c6970babc03d32"/></dir></dir><dir name="slideshow"><file name="slideshow.js" hash="89c706c0022ccae11ddb9f47b474bde9"/><file name="slideshow.js~" hash="d4bfadb98c4b8128d469ba1cf940e6df"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Toogas_Featuredpopup.xml" hash="fc847368b47d545494326a6163d0bd01"/></dir></target><target name="magelocal"><dir name="Toogas"><dir name="Featuredpopup"><dir name="Block"><dir name="Adminhtml"><dir name="Featuredpopup"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="71430b8ba385a8ff06b32a08913a91c5"/><file name="Formdate.php" hash="947053788ca8d46a0fa6a1d807ffe107"/><file name="Formpopup.php" hash="b526f94e5aadb61cd416779085c33fd9"/></dir><file name="Form.php" hash="2a8d2f7660915e5e6b026303731464a2"/><file name="Tabs.php" hash="8c34437d2f1327543de687decef1f1bb"/></dir><file name="Edit.php" hash="fc2922ab151d22fb4ef72f2b7b88b51e"/><file name="Grid.php" hash="411d840ab4d95e6f991d73aa910ff1d5"/></dir><file name="Featuredpopup.php" hash="7ac83e834616624d360e5f1467c0d251"/></dir><file name="Featuredpopup.php" hash="362328c098d781f3476f77132105520a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FeaturedpopupController.php" hash="058fce266aada913e85d185a5247d3be"/></dir></dir><dir name="etc"><file name="config.xml" hash="3dc6ae6b52d7428315705c00907c993c"/><file name="system.xml" hash="f85813a49b50ce67135d316155f18f8d"/></dir><dir name="Helper"><file name="Data.php" hash="37d55824d6f3aefbb8146c9563ccac21"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Featuredpopup"><file name="Collection.php" hash="f1b61a4cb961d627ae6f34168c48947d"/></dir><file name="Featuredpopup.php" hash="447c5bf1704b39fdc8470d58af76a13a"/></dir><file name="Featuredpopup.php" hash="84ecce07407ff5f904b1244fcdf6761d"/></dir><dir name="sql"><dir name="featuredpopup_setup"><file name="mysql4-install-0.1.0.php" hash="74c854d97d1844e1226a90e98d488921"/></dir></dir><file name="readme.txt" hash="d2b0f89a0065d0747fc9b7d2ceb358ce"/><file name="toogas_license-free.txt" hash="0bc9e50942f208c5c3d0d556a90861a9"/></dir><dir name="Toogaslda"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Toogas.php" hash="b2e74f7d9cbd8bce9d232ef12dc96de7"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="13c5051d30c9d67fd640a8701159750b"/><file name="system.xml" hash="a2797ad1121cf332b5b2dbb2f60c7da6"/></dir><dir name="Helper"><file name="Data.php" hash="9b7b50f15e375cd2a6e33ceb9938253b"/></dir></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies/>
20
+ </package>
skin/adminhtml/default/default/images/toogas/Featuredpopup/featured_popup.gif ADDED
Binary file
skin/adminhtml/default/default/images/toogas/toogas_logo.jpg ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default.css ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .overlay_dialog{background-color:#666666;filter:alpha(opacity=60);-moz-opacity:0.6;opacity:0.6;}
2
+ .overlay___invisible__{background-color:#666666;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;}
3
+ .dialog_nw{width:9px;height:23px;background:transparent url(default/top_left.gif)no-repeat 0 0;}
4
+ .dialog_n{background:transparent url(default/top_mid.gif)repeat-x 0 0;height:23px;}
5
+ .dialog_ne{width:9px;height:23px;background:transparent url(default/top_right.gif)no-repeat 0 0;}
6
+ .dialog_e{width:2px;background:transparent url(default/center_right.gif)repeat-y 0 0;}
7
+ .dialog_w{width:2px;background:transparent url(default/center_left.gif)repeat-y 0 0;}
8
+ .dialog_sw{width:9px;height:19px;background:transparent url(default/bottom_left.gif)no-repeat 0 0;}
9
+ .dialog_s{background:transparent url(default/bottom_mid.gif)repeat-x 0 0;height:19px;}
10
+ .dialog_se{width:9px;height:19px;background:transparent url(default/bottom_right.gif)no-repeat 0 0;}
11
+ .dialog_sizer{width:9px;height:19px;background:transparent url(default/sizer.gif)no-repeat 0 0;cursor:se-resize;}
12
+ .dialog_close{width:14px;height:14px;background:transparent url(default/close.gif)no-repeat 0 0;position:absolute;top:5px;left:8px;cursor:pointer;z-index:2000;}
13
+ .dialog_minimize{width:14px;height:15px;background:transparent url(default/minimize.gif)no-repeat 0 0;position:absolute;top:5px;left:28px;cursor:pointer;z-index:2000;}
14
+ .dialog_maximize{width:14px;height:15px;background:transparent url(default/maximize.gif)no-repeat 0 0;position:absolute;top:5px;left:49px;cursor:pointer;z-index:2000;}
15
+ .dialog_title{float:left;height:14px;font-family:Tahoma, Arial, sans-serif;font-size:12px;text-align:center;width:100%;color:#000;}
16
+ .dialog_content{overflow:auto;color:#DDD;font-family:Tahoma, Arial, sans-serif;font-size:10px;background-color:#123;}
17
+ .top_draggable, .bottom_draggable{cursor:move;}
18
+ .status_bar{font-size:12px;}
19
+ .status_bar input{font-size:12px;}
20
+ .wired_frame{display:block;position:absolute;border:1px #000 dashed;}
21
+ .dialog{display:block;position:absolute;}
22
+ .dialog table.table_window{border-collapse:collapse;border-spacing:0;width:100%;margin:0px;padding:0px;}
23
+ .dialog table.table_window td , .dialog table.table_window th{padding:0;}
24
+ .dialog .title_window{-moz-user-select:none;}
25
+ .overlay_mac_os_x{background-color:#85BBEF;filter:alpha(opacity=60);-moz-opacity:0.6;opacity:0.6;}
26
+ .mac_os_x_nw{width:24px;height:30px;}
27
+ .mac_os_x_n{height:30px;}
28
+ .mac_os_x_ne{width:31px;height:30px;}
29
+ .mac_os_x_w{width:16px;}
30
+ .mac_os_x_e{width:16px;}
31
+ .mac_os_x_sw{width:31px;height:40px;}
32
+ .mac_os_x_s{height:40px;}
33
+ .mac_os_x_se, .mac_os_x_sizer{width:31px;height:40px;}
34
+ .mac_os_x_sizer{cursor:se-resize;}
35
+ .mac_os_x_close{width:19px;height:19px;position:absolute;top:12px;left:25px;cursor:pointer;z-index:1000;}
36
+ .mac_os_x_minimize{width:19px;height:19px;position:absolute;top:12px;left:45px;cursor:pointer;z-index:1000;}
37
+ .mac_os_x_maximize{width:19px;height:19px;position:absolute;top:12px;left:65px;cursor:pointer;z-index:1000;}
38
+ .mac_os_x_title{float:left;height:14px;font-family:Tahoma, Arial, sans-serif;font-size:12px;text-align:center;margin-top:8px;width:100%;color:#000;}
39
+ .mac_os_x_content{overflow:hidden;color:#222;font-family:Tahoma, Arial, sans-serif;font-size:10px;background:#FFF;}
40
+ .mac_os_x_s .status_bar{padding-bottom:24px;}
41
+ * html .mac_os_x_nw{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL_Main.png", sizingMethod="crop");}* html .mac_os_x_n{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T_Main.png", sizingMethod="scale");}
42
+ * html .mac_os_x_ne{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR_Main.png", sizingMethod="crop");}
43
+ * html .mac_os_x_w{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L_Main.png", sizingMethod="scale");}
44
+ * html .mac_os_x_e{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R_Main.png", sizingMethod="scale");}
45
+ * html .mac_os_x_sw{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL_Main.png", sizingMethod="crop");}
46
+ * html .mac_os_x_s{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B_Main.png", sizingMethod="scale");}
47
+ * html .mac_os_x_se{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop");}
48
+ * html .mac_os_x_sizer{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop");}
49
+ .overlay_blur_os_x{background-color:#85BBEF;filter:alpha(opacity=60);-moz-opacity:0.6;opacity:0.6;}
50
+ .blur_os_x_nw{background:transparent url(mac_os_x/TL.png)no-repeat 0 0;width:24px;height:30px;}
51
+ .blur_os_x_n{background:transparent url(mac_os_x/T.png)repeat-x 0 0;height:30px;}
52
+ .blur_os_x_ne{background:transparent url(mac_os_x/TR.png)no-repeat 0 0;width:31px;height:30px;}
53
+ .blur_os_x_w{background:transparent url(mac_os_x/L.png)repeat-y top left;width:16px;}
54
+ .blur_os_x_e{background:transparent url(mac_os_x/R.png)repeat-y top right;width:16px;}
55
+ .blur_os_x_sw{background:transparent url(mac_os_x/BL.png)no-repeat 0 0;width:31px;height:40px;}
56
+ .blur_os_x_s{background:transparent url(mac_os_x/B.png)repeat-x 0 0;height:40px;}
57
+ .blur_os_x_se, .blur_os_x_sizer{background:transparent url(mac_os_x/BR.png)no-repeat 0 0;width:31px;height:40px;}
58
+ .blur_os_x_sizer{cursor:se-resize;}
59
+ .blur_os_x_close{width:19px;height:19px;background:transparent url(mac_os_x/close.gif)no-repeat 0 0;position:absolute;top:12px;left:25px;cursor:pointer;z-index:1000;}
60
+ .blur_os_x_minimize{width:19px;height:19px;background:transparent url(mac_os_x/minimize.gif)no-repeat 0 0;position:absolute;top:12px;left:45px;cursor:pointer;z-index:1000;}
61
+ .blur_os_x_maximize{width:19px;height:19px;background:transparent url(mac_os_x/maximize.gif)no-repeat 0 0;position:absolute;top:12px;left:65px;cursor:pointer;z-index:1000;}
62
+ .blur_os_x_title{float:left;height:14px;font-family:Tahoma, Arial, sans-serif;font-size:12px;text-align:center;margin-top:8px;width:100%;color:#000;}
63
+ .blur_os_x_content{overflow:auto;color:#222;font-family:Tahoma, Arial, sans-serif;font-size:10px;background:#FFF;}
64
+ .blur_os_x_s .status_bar{padding-bottom:24px;}
65
+ * html .blur_os_x_nw{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL.png", sizingMethod="crop");}
66
+ * html .blur_os_x_n{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T.png", sizingMethod="scale");}
67
+ * html .blur_os_x_ne{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR.png", sizingMethod="crop");}
68
+ * html .blur_os_x_w{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L.png", sizingMethod="scale");}
69
+ * html .blur_os_x_e{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R.png", sizingMethod="scale");}
70
+ * html .blur_os_x_sw{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL.png", sizingMethod="crop");}
71
+ * html .blur_os_x_s{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B.png", sizingMethod="scale");}
72
+ * html .blur_os_x_se{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop");}
73
+ * html .blur_os_x_sizer{background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop");}
skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_left.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_mid.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_right.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/bottom_right_resize.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/center_left.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/center_right.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/clear.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/close.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/inspect.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/maximize.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/minimize.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/overlay.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/resize.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/sizer.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/top_left.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/top_mid.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/default/top_right.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/B.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/BL.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/BR.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/B_Main.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/L.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/L_Main.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/R.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/R_Main.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/T.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TL.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TL_Main.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TR.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/TR_Main.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/T_Main.png ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/close.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/maximize.gif ADDED
Binary file
skin/frontend/base/default/css/Toogas/Featuredpopup/mac_os_x/minimize.gif ADDED
Binary file