Version Notes
First Release
Download this release
Release Info
Developer | saurabh chandela |
Extension | Product_Video_Telemantis |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files.php +27 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files.php~ +27 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files/Grid.php +113 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files/Grid.php~ +113 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/File/Size.php +55 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/File/Size.php~ +55 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/Timestamp.php +42 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/Timestamp.php~ +42 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Link.php +31 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Link.php~ +31 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Size.php +26 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Size.php~ +26 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Timestamp.php +52 -0
- app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Timestamp.php~ +52 -0
- app/code/community/Telemantis/FileAttributes/Block/Form/Element/File.php +162 -0
- app/code/community/Telemantis/FileAttributes/Block/Form/Element/File.php~ +162 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Attributes/Configuration.php +232 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Attributes/Configuration.php~ +232 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Abstract.php +36 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Abstract.php~ +36 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Attribute.php +60 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Attribute.php~ +60 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Boolean.php +23 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Boolean.php~ +23 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Exceptions/Handling/Mode.php +23 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Exceptions/Handling/Mode.php~ +23 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/File/Save/Moment.php +23 -0
- app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/File/Save/Moment.php~ +23 -0
- app/code/community/Telemantis/FileAttributes/Helper/Config.php +146 -0
- app/code/community/Telemantis/FileAttributes/Helper/Config.php~ +146 -0
- app/code/community/Telemantis/FileAttributes/Helper/Data.php +77 -0
- app/code/community/Telemantis/FileAttributes/Helper/Data.php~ +77 -0
- app/code/community/Telemantis/FileAttributes/Model/Attribute/Backend/File.php +446 -0
- app/code/community/Telemantis/FileAttributes/Model/Attribute/Backend/File.php~ +446 -0
- app/code/community/Telemantis/FileAttributes/Model/Attribute/Frontend/File.php +35 -0
- app/code/community/Telemantis/FileAttributes/Model/Attribute/Frontend/File.php~ +34 -0
- app/code/community/Telemantis/FileAttributes/Model/Observer.php +65 -0
- app/code/community/Telemantis/FileAttributes/Model/Observer.php~ +65 -0
- app/code/community/Telemantis/FileAttributes/Model/Obsolete/Files/Collection.php +81 -0
- app/code/community/Telemantis/FileAttributes/Model/Obsolete/Files/Collection.php~ +81 -0
- app/code/community/Telemantis/FileAttributes/Model/System/Config/Backend/Serialized/Attributes/Configuration.php +123 -0
- app/code/community/Telemantis/FileAttributes/Model/System/Config/Backend/Serialized/Attributes/Configuration.php~ +123 -0
- app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/Exceptions/Handling/Mode.php +23 -0
- app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/Exceptions/Handling/Mode.php~ +23 -0
- app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/File/Save/Moment.php +23 -0
- app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/File/Save/Moment.php~ +23 -0
- app/code/community/Telemantis/FileAttributes/controllers/Adminhtml/Obsolete/FilesController.php +99 -0
- app/code/community/Telemantis/FileAttributes/controllers/Adminhtml/Obsolete/FilesController.php~ +99 -0
- app/code/community/Telemantis/FileAttributes/etc/adminhtml.xml +103 -0
- app/code/community/Telemantis/FileAttributes/etc/adminhtml.xml~ +103 -0
- app/code/community/Telemantis/FileAttributes/etc/config.xml +165 -0
- app/code/community/Telemantis/FileAttributes/etc/config.xml~ +165 -0
- app/code/community/Telemantis/FileAttributes/etc/system.xml +84 -0
- app/code/community/Telemantis/FileAttributes/etc/system.xml~ +84 -0
- app/code/community/Telemantis/Video/Block/Video.php +46 -0
- app/code/community/Telemantis/Video/Helper/Data.php +38 -0
- app/code/community/Telemantis/Video/Helper/Data.php~ +38 -0
- app/code/community/Telemantis/Video/Model/Source.php +16 -0
- app/code/community/Telemantis/Video/Model/Source.php~ +16 -0
- app/code/community/Telemantis/Video/etc/config.xml +74 -0
- app/code/community/Telemantis/Video/etc/config.xml~ +40 -0
- app/code/community/Telemantis/Video/etc/system.xml +113 -0
- app/code/community/Telemantis/Video/etc/system.xml~ +86 -0
- app/design/adminhtml/default/default/layout/tl/fileattributes.xml +35 -0
- app/design/adminhtml/default/default/template/tl/fileattributes/system/config/form/field/array.phtml +193 -0
- app/design/frontend/default/default/layout/video.xml +25 -0
- app/design/frontend/default/default/template/video/media.phtml +104 -0
- app/design/frontend/default/default/template/video/media.phtml~ +112 -0
- app/design/frontend/default/default/template/video/video.phtml +76 -0
- app/design/frontend/default/default/template/video/video.phtml~ +63 -0
- app/etc/modules/Telemantis_FileAttributes.xml +9 -0
- app/etc/modules/Telemantis_Video.xml +9 -0
- js/tl/fileattributes/script.js +314 -0
- js/tl/fileattributes/script.js~ +314 -0
- js/video/jwplayer.flash.swf +0 -0
- js/video/jwplayer.html5.js +1 -0
- js/video/jwplayer.js +1 -0
- js/video/jwplayer6.js +1 -0
- js/video/player.swf +0 -0
- js/video/swfobject.js +4 -0
- js/video/swfobject/expressInstall.swf +0 -0
- js/video/swfobject/index.html +28 -0
- js/video/swfobject/index_dynamic.html +17 -0
- js/video/swfobject/src/expressInstall.as +70 -0
- js/video/swfobject/src/expressInstall.fla +0 -0
- js/video/swfobject/src/swfobject.js +777 -0
- js/video/swfobject/swfobject.js +4 -0
- js/video/swfobject/test.swf +0 -0
- js/video/video.js +22 -0
- js/video/video.js~ +18 -0
- package.xml +18 -0
- skin/adminhtml/default/default/tl/fileattributes/images/ico_compact.png +0 -0
- skin/adminhtml/default/default/tl/fileattributes/images/ico_unpack.png +0 -0
- skin/adminhtml/default/default/tl/fileattributes/styles.css +2 -0
- skin/frontend/default/default/css/video/video.css +12 -0
- skin/frontend/default/default/css/video/video.css~ +12 -0
- skin/frontend/default/default/images/video/Skyvideoicon.png +0 -0
- skin/frontend/default/default/images/video/close.jpg +0 -0
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Obsolete_Files
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Container
|
18 |
+
{
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
$this->_controller = 'adminhtml_obsolete_files';
|
22 |
+
$this->_blockGroup = 'fileattributes';
|
23 |
+
$this->_headerText = $this->__('Manage Obsolete Files');
|
24 |
+
parent::__construct();
|
25 |
+
$this->removeButton('add');
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files.php~
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Obsolete_Files
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Container
|
18 |
+
{
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
$this->_controller = 'adminhtml_obsolete_files';
|
22 |
+
$this->_blockGroup = 'fileattributes';
|
23 |
+
$this->_headerText = $this->__('Manage Obsolete Files');
|
24 |
+
parent::__construct();
|
25 |
+
$this->removeButton('add');
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files/Grid.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Obsolete_Files_Grid
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid
|
18 |
+
{
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
parent::__construct();
|
22 |
+
$this->setId('BLFA_ObsoleteFilesGrid')
|
23 |
+
->setSaveParametersInSession(true)
|
24 |
+
->setUseAjax(false);
|
25 |
+
}
|
26 |
+
|
27 |
+
protected function _prepareCollection()
|
28 |
+
{
|
29 |
+
$collection = Mage::getModel('fileattributes/obsolete_files_collection');
|
30 |
+
$this->setCollection($collection);
|
31 |
+
return parent::_prepareCollection();
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function _prepareColumns()
|
35 |
+
{
|
36 |
+
$helper = Mage::helper('fileattributes');
|
37 |
+
|
38 |
+
$this->addColumn('basename', array(
|
39 |
+
'header' => $helper->__('File Name'),
|
40 |
+
'index' => 'basename',
|
41 |
+
));
|
42 |
+
|
43 |
+
$this->addColumn('extension', array(
|
44 |
+
'header' => $helper->__('Extension'),
|
45 |
+
'index' => 'extension',
|
46 |
+
));
|
47 |
+
|
48 |
+
$this->addColumn('size', array(
|
49 |
+
'header' => $helper->__('Size'),
|
50 |
+
'index' => 'size',
|
51 |
+
'filter' => 'fileattributes/adminhtml_widget_grid_column_filter_file_size',
|
52 |
+
'renderer' => 'fileattributes/adminhtml_widget_grid_column_renderer_file_size',
|
53 |
+
));
|
54 |
+
|
55 |
+
$this->addColumn('updated_at', array(
|
56 |
+
'header' => $helper->__('Updated At'),
|
57 |
+
'index' => 'updated_at',
|
58 |
+
'filter_time' => true,
|
59 |
+
'filter' => 'fileattributes/adminhtml_widget_grid_column_filter_timestamp',
|
60 |
+
'renderer' => 'fileattributes/adminhtml_widget_grid_column_renderer_timestamp',
|
61 |
+
));
|
62 |
+
|
63 |
+
$this->addColumn('url', array(
|
64 |
+
'header' => $helper->__('File'),
|
65 |
+
'index' => 'url',
|
66 |
+
'filter' => false,
|
67 |
+
'sortable' => false,
|
68 |
+
'renderer' => 'fileattributes/adminhtml_widget_grid_column_renderer_file_link',
|
69 |
+
));
|
70 |
+
|
71 |
+
$this->addColumn('action',
|
72 |
+
array(
|
73 |
+
'header' => $this->__('Actions'),
|
74 |
+
'width' => '120px',
|
75 |
+
'type' => 'action',
|
76 |
+
'getter' => 'getId',
|
77 |
+
'actions' => array(
|
78 |
+
array(
|
79 |
+
'caption' => $this->__('Delete'),
|
80 |
+
'confirm' => $this->__('Are you sure?'),
|
81 |
+
'url' => array(
|
82 |
+
'base' => '*/*/delete',
|
83 |
+
),
|
84 |
+
'field' => 'file'
|
85 |
+
)
|
86 |
+
),
|
87 |
+
'filter' => false,
|
88 |
+
'sortable' => false,
|
89 |
+
'index' => 'id',
|
90 |
+
));
|
91 |
+
|
92 |
+
return parent::_prepareColumns();
|
93 |
+
}
|
94 |
+
|
95 |
+
public function getRowUrl($row)
|
96 |
+
{
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function _prepareMassaction()
|
101 |
+
{
|
102 |
+
$this->setMassactionIdField('id');
|
103 |
+
$this->getMassactionBlock()->setFormFieldName('files');
|
104 |
+
|
105 |
+
$this->getMassactionBlock()->addItem('mass_delete', array(
|
106 |
+
'label' => $this->__('Delete'),
|
107 |
+
'url' => $this->getUrl('*/*/massDelete', array('_current' => true)),
|
108 |
+
'confirm' => $this->__('Are you sure?'),
|
109 |
+
));
|
110 |
+
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Obsolete/Files/Grid.php~
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Obsolete_Files_Grid
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid
|
18 |
+
{
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
parent::__construct();
|
22 |
+
$this->setId('BLFA_ObsoleteFilesGrid')
|
23 |
+
->setSaveParametersInSession(true)
|
24 |
+
->setUseAjax(false);
|
25 |
+
}
|
26 |
+
|
27 |
+
protected function _prepareCollection()
|
28 |
+
{
|
29 |
+
$collection = Mage::getModel('fileattributes/obsolete_files_collection');
|
30 |
+
$this->setCollection($collection);
|
31 |
+
return parent::_prepareCollection();
|
32 |
+
}
|
33 |
+
|
34 |
+
protected function _prepareColumns()
|
35 |
+
{
|
36 |
+
$helper = Mage::helper('fileattributes');
|
37 |
+
|
38 |
+
$this->addColumn('basename', array(
|
39 |
+
'header' => $helper->__('File Name'),
|
40 |
+
'index' => 'basename',
|
41 |
+
));
|
42 |
+
|
43 |
+
$this->addColumn('extension', array(
|
44 |
+
'header' => $helper->__('Extension'),
|
45 |
+
'index' => 'extension',
|
46 |
+
));
|
47 |
+
|
48 |
+
$this->addColumn('size', array(
|
49 |
+
'header' => $helper->__('Size'),
|
50 |
+
'index' => 'size',
|
51 |
+
'filter' => 'fileattributes/adminhtml_widget_grid_column_filter_file_size',
|
52 |
+
'renderer' => 'fileattributes/adminhtml_widget_grid_column_renderer_file_size',
|
53 |
+
));
|
54 |
+
|
55 |
+
$this->addColumn('updated_at', array(
|
56 |
+
'header' => $helper->__('Updated At'),
|
57 |
+
'index' => 'updated_at',
|
58 |
+
'filter_time' => true,
|
59 |
+
'filter' => 'fileattributes/adminhtml_widget_grid_column_filter_timestamp',
|
60 |
+
'renderer' => 'fileattributes/adminhtml_widget_grid_column_renderer_timestamp',
|
61 |
+
));
|
62 |
+
|
63 |
+
$this->addColumn('url', array(
|
64 |
+
'header' => $helper->__('File'),
|
65 |
+
'index' => 'url',
|
66 |
+
'filter' => false,
|
67 |
+
'sortable' => false,
|
68 |
+
'renderer' => 'fileattributes/adminhtml_widget_grid_column_renderer_file_link',
|
69 |
+
));
|
70 |
+
|
71 |
+
$this->addColumn('action',
|
72 |
+
array(
|
73 |
+
'header' => $this->__('Actions'),
|
74 |
+
'width' => '120px',
|
75 |
+
'type' => 'action',
|
76 |
+
'getter' => 'getId',
|
77 |
+
'actions' => array(
|
78 |
+
array(
|
79 |
+
'caption' => $this->__('Delete'),
|
80 |
+
'confirm' => $this->__('Are you sure?'),
|
81 |
+
'url' => array(
|
82 |
+
'base' => '*/*/delete',
|
83 |
+
),
|
84 |
+
'field' => 'file'
|
85 |
+
)
|
86 |
+
),
|
87 |
+
'filter' => false,
|
88 |
+
'sortable' => false,
|
89 |
+
'index' => 'id',
|
90 |
+
));
|
91 |
+
|
92 |
+
return parent::_prepareColumns();
|
93 |
+
}
|
94 |
+
|
95 |
+
public function getRowUrl($row)
|
96 |
+
{
|
97 |
+
return false;
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function _prepareMassaction()
|
101 |
+
{
|
102 |
+
$this->setMassactionIdField('id');
|
103 |
+
$this->getMassactionBlock()->setFormFieldName('files');
|
104 |
+
|
105 |
+
$this->getMassactionBlock()->addItem('mass_delete', array(
|
106 |
+
'label' => $this->__('Delete'),
|
107 |
+
'url' => $this->getUrl('*/*/massDelete', array('_current' => true)),
|
108 |
+
'confirm' => $this->__('Are you sure?'),
|
109 |
+
));
|
110 |
+
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/File/Size.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Filter_File_Size
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Range
|
18 |
+
{
|
19 |
+
protected function _parseUnitValue($value)
|
20 |
+
{
|
21 |
+
return max(0, min(3, intval($value)));
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getHtml()
|
25 |
+
{
|
26 |
+
$helper = Mage::helper('fileattributes');
|
27 |
+
$html = parent::getHtml();
|
28 |
+
$html .= '<div class="range"><div class="range-line"><span class="label">'.$helper->__('In:').'</span> <select name="'.$this->_getHtmlName().'[unit]" id="'.$this->_getHtmlId().'_unit" class="no-changes">';
|
29 |
+
$unit = $this->_parseUnitValue($this->getValue('unit'));
|
30 |
+
$html .= '<option value="0"'.($unit === 0 ? ' selected="selected"' : '').'>'.$helper->__('Bytes').'</option>';
|
31 |
+
$html .= '<option value="1"'.($unit === 1 ? ' selected="selected"' : '').'>'.$helper->__('Kilobytes').'</option>';
|
32 |
+
$html .= '<option value="2"'.($unit === 2 ? ' selected="selected"' : '').'>'.$helper->__('Megabytes').'</option>';
|
33 |
+
$html .= '<option value="3"'.($unit === 3 ? ' selected="selected"' : '').'>'.$helper->__('Gigabytes').'</option>';
|
34 |
+
$html .= '</select></div></div>';
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getValue($index=null)
|
39 |
+
{
|
40 |
+
if (is_array($value = parent::getValue($index))) {
|
41 |
+
if (isset($value['unit'])) {
|
42 |
+
$unit = $this->_parseUnitValue($value['unit']);
|
43 |
+
} else {
|
44 |
+
$unit = 0;
|
45 |
+
}
|
46 |
+
if (isset($value['from']) && (strlen($value['from']) > 0)) {
|
47 |
+
$value['from'] *= pow(1024, $unit);
|
48 |
+
}
|
49 |
+
if (isset($value['to']) && (strlen($value['to']) > 0)) {
|
50 |
+
$value['to'] *= pow(1024, $unit);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
return $value;
|
54 |
+
}
|
55 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/File/Size.php~
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Filter_File_Size
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Range
|
18 |
+
{
|
19 |
+
protected function _parseUnitValue($value)
|
20 |
+
{
|
21 |
+
return max(0, min(3, intval($value)));
|
22 |
+
}
|
23 |
+
|
24 |
+
public function getHtml()
|
25 |
+
{
|
26 |
+
$helper = Mage::helper('fileattributes');
|
27 |
+
$html = parent::getHtml();
|
28 |
+
$html .= '<div class="range"><div class="range-line"><span class="label">'.$helper->__('In:').'</span> <select name="'.$this->_getHtmlName().'[unit]" id="'.$this->_getHtmlId().'_unit" class="no-changes">';
|
29 |
+
$unit = $this->_parseUnitValue($this->getValue('unit'));
|
30 |
+
$html .= '<option value="0"'.($unit === 0 ? ' selected="selected"' : '').'>'.$helper->__('Bytes').'</option>';
|
31 |
+
$html .= '<option value="1"'.($unit === 1 ? ' selected="selected"' : '').'>'.$helper->__('Kilobytes').'</option>';
|
32 |
+
$html .= '<option value="2"'.($unit === 2 ? ' selected="selected"' : '').'>'.$helper->__('Megabytes').'</option>';
|
33 |
+
$html .= '<option value="3"'.($unit === 3 ? ' selected="selected"' : '').'>'.$helper->__('Gigabytes').'</option>';
|
34 |
+
$html .= '</select></div></div>';
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getValue($index=null)
|
39 |
+
{
|
40 |
+
if (is_array($value = parent::getValue($index))) {
|
41 |
+
if (isset($value['unit'])) {
|
42 |
+
$unit = $this->_parseUnitValue($value['unit']);
|
43 |
+
} else {
|
44 |
+
$unit = 0;
|
45 |
+
}
|
46 |
+
if (isset($value['from']) && (strlen($value['from']) > 0)) {
|
47 |
+
$value['from'] *= pow(1024, $unit);
|
48 |
+
}
|
49 |
+
if (isset($value['to']) && (strlen($value['to']) > 0)) {
|
50 |
+
$value['to'] *= pow(1024, $unit);
|
51 |
+
}
|
52 |
+
}
|
53 |
+
return $value;
|
54 |
+
}
|
55 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/Timestamp.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Filter_Timestamp
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Datetime
|
18 |
+
{
|
19 |
+
public function getValue($index=null)
|
20 |
+
{
|
21 |
+
if ($index) {
|
22 |
+
if ($data = $this->getData('value', 'orig_'.$index)) {
|
23 |
+
return $data;
|
24 |
+
}
|
25 |
+
return null;
|
26 |
+
}
|
27 |
+
$value = $this->getData('value');
|
28 |
+
if (!empty($value['to']) && !$this->getColumn()->getFilterTime()) {
|
29 |
+
$datetime = $value['to'];
|
30 |
+
$datetime->addSecond(self::END_OF_DAY_IN_SECONDS);
|
31 |
+
}
|
32 |
+
if (!empty($value['from'])) {
|
33 |
+
$datetime = $value['from'];
|
34 |
+
$value['from'] = $datetime->getTimestamp();
|
35 |
+
}
|
36 |
+
if (!empty($value['to'])) {
|
37 |
+
$datetime = $value['to'];
|
38 |
+
$value['to'] = $datetime->getTimestamp();
|
39 |
+
}
|
40 |
+
return $value;
|
41 |
+
}
|
42 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Filter/Timestamp.php~
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category BL
|
11 |
+
* @package BL_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class BL_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Filter_Timestamp
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Datetime
|
18 |
+
{
|
19 |
+
public function getValue($index=null)
|
20 |
+
{
|
21 |
+
if ($index) {
|
22 |
+
if ($data = $this->getData('value', 'orig_'.$index)) {
|
23 |
+
return $data;
|
24 |
+
}
|
25 |
+
return null;
|
26 |
+
}
|
27 |
+
$value = $this->getData('value');
|
28 |
+
if (!empty($value['to']) && !$this->getColumn()->getFilterTime()) {
|
29 |
+
$datetime = $value['to'];
|
30 |
+
$datetime->addSecond(self::END_OF_DAY_IN_SECONDS);
|
31 |
+
}
|
32 |
+
if (!empty($value['from'])) {
|
33 |
+
$datetime = $value['from'];
|
34 |
+
$value['from'] = $datetime->getTimestamp();
|
35 |
+
}
|
36 |
+
if (!empty($value['to'])) {
|
37 |
+
$datetime = $value['to'];
|
38 |
+
$value['to'] = $datetime->getTimestamp();
|
39 |
+
}
|
40 |
+
return $value;
|
41 |
+
}
|
42 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Link.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Renderer_File_Link
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
18 |
+
{
|
19 |
+
public function render(Varien_Object $row)
|
20 |
+
{
|
21 |
+
if ($value = $this->_getValue($row)) {
|
22 |
+
return '<a href="'.$value.'" target="_blank">'.$this->helper('fileattributes')->__('View File').'</a>';
|
23 |
+
}
|
24 |
+
return parent::render($row);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function renderExport(Varien_Object $row)
|
28 |
+
{
|
29 |
+
return parent::render($row);
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Link.php~
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category BL
|
11 |
+
* @package BL_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class BL_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Renderer_File_Link
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
18 |
+
{
|
19 |
+
public function render(Varien_Object $row)
|
20 |
+
{
|
21 |
+
if ($value = $this->_getValue($row)) {
|
22 |
+
return '<a href="'.$value.'" target="_blank">'.$this->helper('fileattributes')->__('View File').'</a>';
|
23 |
+
}
|
24 |
+
return parent::render($row);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function renderExport(Varien_Object $row)
|
28 |
+
{
|
29 |
+
return parent::render($row);
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Size.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Renderer_File_Size
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
18 |
+
{
|
19 |
+
public function _getValue(Varien_Object $row)
|
20 |
+
{
|
21 |
+
if (!is_null($size = parent::_getValue($row))) {
|
22 |
+
return Mage::helper('fileattributes')->getFileSizeForDisplay($size, 2);
|
23 |
+
}
|
24 |
+
return null;
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/File/Size.php~
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category BL
|
11 |
+
* @package BL_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class BL_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Renderer_File_Size
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
18 |
+
{
|
19 |
+
public function _getValue(Varien_Object $row)
|
20 |
+
{
|
21 |
+
if (!is_null($size = parent::_getValue($row))) {
|
22 |
+
return Mage::helper('fileattributes')->getFileSizeForDisplay($size, 2);
|
23 |
+
}
|
24 |
+
return null;
|
25 |
+
}
|
26 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Timestamp.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Renderer_Timestamp
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
18 |
+
{
|
19 |
+
protected static $_format = null;
|
20 |
+
|
21 |
+
protected function _getFormat()
|
22 |
+
{
|
23 |
+
$format = $this->getColumn()->getFormat();
|
24 |
+
|
25 |
+
if (!$format) {
|
26 |
+
if (is_null(self::$_format)) {
|
27 |
+
try {
|
28 |
+
self::$_format = Mage::app()->getLocale()->getDateTimeFormat(
|
29 |
+
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
|
30 |
+
);
|
31 |
+
} catch (Exception $e) { }
|
32 |
+
}
|
33 |
+
$format = self::$_format;
|
34 |
+
}
|
35 |
+
|
36 |
+
return $format;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function render(Varien_Object $row)
|
40 |
+
{
|
41 |
+
if ($data = $this->_getValue($row)) {
|
42 |
+
$format = $this->_getFormat();
|
43 |
+
try {
|
44 |
+
$data = Mage::app()->getLocale()->date($data, Zend_Date::TIMESTAMP)->toString($format);
|
45 |
+
} catch (Exception $e) {
|
46 |
+
$data = Mage::app()->getLocale()->date($data, Zend_Date::TIMESTAMP)->toString($format);
|
47 |
+
}
|
48 |
+
return $data;
|
49 |
+
}
|
50 |
+
return $this->getColumn()->getDefault();
|
51 |
+
}
|
52 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Adminhtml/Widget/Grid/Column/Renderer/Timestamp.php~
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category BL
|
11 |
+
* @package BL_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class BL_FileAttributes_Block_Adminhtml_Widget_Grid_Column_Renderer_Timestamp
|
17 |
+
extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
|
18 |
+
{
|
19 |
+
protected static $_format = null;
|
20 |
+
|
21 |
+
protected function _getFormat()
|
22 |
+
{
|
23 |
+
$format = $this->getColumn()->getFormat();
|
24 |
+
|
25 |
+
if (!$format) {
|
26 |
+
if (is_null(self::$_format)) {
|
27 |
+
try {
|
28 |
+
self::$_format = Mage::app()->getLocale()->getDateTimeFormat(
|
29 |
+
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM
|
30 |
+
);
|
31 |
+
} catch (Exception $e) { }
|
32 |
+
}
|
33 |
+
$format = self::$_format;
|
34 |
+
}
|
35 |
+
|
36 |
+
return $format;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function render(Varien_Object $row)
|
40 |
+
{
|
41 |
+
if ($data = $this->_getValue($row)) {
|
42 |
+
$format = $this->_getFormat();
|
43 |
+
try {
|
44 |
+
$data = Mage::app()->getLocale()->date($data, Zend_Date::TIMESTAMP)->toString($format);
|
45 |
+
} catch (Exception $e) {
|
46 |
+
$data = Mage::app()->getLocale()->date($data, Zend_Date::TIMESTAMP)->toString($format);
|
47 |
+
}
|
48 |
+
return $data;
|
49 |
+
}
|
50 |
+
return $this->getColumn()->getDefault();
|
51 |
+
}
|
52 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Form/Element/File.php
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Form_Element_File
|
17 |
+
extends Varien_Data_Form_Element_Abstract
|
18 |
+
{
|
19 |
+
public function __construct($data)
|
20 |
+
{
|
21 |
+
parent::__construct($data);
|
22 |
+
$this->setType('file');
|
23 |
+
$this->setExtType('file');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getElementHtml()
|
27 |
+
{
|
28 |
+
$html = '';
|
29 |
+
|
30 |
+
if ($this->getValue()) {
|
31 |
+
$url = Mage::helper('fileattributes')->getFileUrl($this->getValue());
|
32 |
+
$html = '<a href="'.$url.'" target="_blank">'.$this->getValue().'</a><br />';
|
33 |
+
}
|
34 |
+
|
35 |
+
$this->setClass('input-file');
|
36 |
+
if ($this->getEntityAttribute()->getIsRequired()) {
|
37 |
+
if (!$this->getValue()) {
|
38 |
+
// Add required class only if we don't have any current value, because of file inputs
|
39 |
+
$this->addClass('required-entry');
|
40 |
+
}
|
41 |
+
} else {
|
42 |
+
// No delete for required attributes, to delete a file it is just needed to change it
|
43 |
+
$html .= $this->_getDeleteCheckbox();
|
44 |
+
}
|
45 |
+
|
46 |
+
$html .= parent::getElementHtml();
|
47 |
+
$html .= $this->_getDescriptionHtml();
|
48 |
+
|
49 |
+
return $html;
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function _getDeleteCheckbox()
|
53 |
+
{
|
54 |
+
if ($this->getValue()) {
|
55 |
+
$html = '<span class="delete-file">';
|
56 |
+
$html .= '<input type="checkbox" name="'.parent::getName().'[delete]" value="1" class="checkbox" id="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' disabled="disabled"': '').' onchange="(this.checked ? $(\''.$this->getHtmlId().'\').disable() : $(\''.$this->getHtmlId().'\').enable());"/>';
|
57 |
+
$html .= '<label for="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' class="disabled"' : '').'> '.Mage::helper('fileattributes')->__('Delete File').'</label>';
|
58 |
+
$html .= $this->_getHiddenInput();
|
59 |
+
$html .= '</span>';
|
60 |
+
return $html;
|
61 |
+
}
|
62 |
+
return '';
|
63 |
+
}
|
64 |
+
|
65 |
+
protected function _getHiddenInput()
|
66 |
+
{
|
67 |
+
return '<input type="hidden" name="'.parent::getName().'[value]" value="'.$this->getValue().'" />';
|
68 |
+
}
|
69 |
+
|
70 |
+
protected function _getDescriptionHtml()
|
71 |
+
{
|
72 |
+
$attributeModel = Mage::getModel('fileattributes/attribute_backend_file')
|
73 |
+
->setAttribute($this->getEntityAttribute());
|
74 |
+
|
75 |
+
$config = Mage::helper('fileattributes/config')
|
76 |
+
->getAttributeConfiguration($this->getEntityAttribute()->getId());
|
77 |
+
|
78 |
+
if (!isset($config['display_config']) || !$config['display_config']) {
|
79 |
+
return '';
|
80 |
+
}
|
81 |
+
|
82 |
+
$helper = Mage::helper('fileattributes');
|
83 |
+
$html = array();
|
84 |
+
|
85 |
+
// File extensions
|
86 |
+
if (isset($config['allowed_file_extensions'])
|
87 |
+
&& is_array($exts = $config['allowed_file_extensions'])) {
|
88 |
+
sort($exts);
|
89 |
+
$html[] = array($helper->__('Allowed File Extensions'), implode(', ', $exts));
|
90 |
+
} elseif (isset($config['forbidden_file_extensions'])
|
91 |
+
&& is_array($exts = $config['forbidden_file_extensions'])) {
|
92 |
+
sort($exts);
|
93 |
+
$html[] = array($helper->__('Forbidden File Extensions'), implode(', ', $exts));
|
94 |
+
}
|
95 |
+
|
96 |
+
// File size
|
97 |
+
$serverMaxFileSize = $attributeModel->getUploadMaxFileSize();
|
98 |
+
if (($config['file_max_size'] > 0)
|
99 |
+
&& ($config['file_max_size'] < $serverMaxFileSize)) {
|
100 |
+
$html[] = array(
|
101 |
+
$helper->__('Maximum File Size'),
|
102 |
+
$helper->__('%s (configuration)', $helper->getFileSizeForDisplay($config['file_max_size']))
|
103 |
+
);
|
104 |
+
} else {
|
105 |
+
$html[] = array(
|
106 |
+
$helper->__('Maximum File Size'),
|
107 |
+
$helper->__('%s (server)', $helper->getFileSizeForDisplay($serverMaxFileSize))
|
108 |
+
);
|
109 |
+
}
|
110 |
+
|
111 |
+
// MIME types
|
112 |
+
if (isset($config['allowed_mime_types'])
|
113 |
+
&& is_array($types = $config['allowed_mime_types'])) {
|
114 |
+
$types = array_values($types);
|
115 |
+
sort($types);
|
116 |
+
$html[] = array($helper->__('Allowed File Types'), implode(', ', $types));
|
117 |
+
} elseif (isset($config['forbidden_mime_types'])
|
118 |
+
&& is_array($types = $config['forbidden_mime_types'])) {
|
119 |
+
$types = array_values($types);
|
120 |
+
sort($types);
|
121 |
+
$html[] = array($helper->__('Forbidden File Types'), implode(', ', $types));
|
122 |
+
}
|
123 |
+
|
124 |
+
// Image only
|
125 |
+
if ($config['image_only']) {
|
126 |
+
$html[] = array($helper->__('Image Only'), $helper->__('Yes'));
|
127 |
+
}
|
128 |
+
|
129 |
+
if ($config['image_min_width'] > 0) {
|
130 |
+
$html[] = array($helper->__('Image Minimum Width'), $helper->__('%spx', $config['image_min_width']));
|
131 |
+
}
|
132 |
+
if ($config['image_max_width'] > 0) {
|
133 |
+
$html[] = array($helper->__('Image Maximum Width'), $helper->__('%spx', $config['image_max_width']));
|
134 |
+
}
|
135 |
+
if ($config['image_min_height'] > 0) {
|
136 |
+
$html[] = array($helper->__('Image Minimum Height'), $helper->__('%spx', $config['image_min_height']));
|
137 |
+
}
|
138 |
+
if ($config['image_max_height'] > 0) {
|
139 |
+
$html[] = array($helper->__('Image Maximum Height'), $helper->__('%spx', $config['image_max_height']));
|
140 |
+
}
|
141 |
+
|
142 |
+
if (!empty($html)) {
|
143 |
+
// Wrap all configs in a toggleable table
|
144 |
+
$result = '<br /><a href="#" onclick="$(\''.$this->getHtmlId().'_config_container\').toggle(); return false;">';
|
145 |
+
$result .= $helper->__('Show / Hide Configuration File').'</a>';
|
146 |
+
$result .= '<div id="'.$this->getHtmlId().'_config_container" style="display: none;">';
|
147 |
+
$result .= '<table class="blfa-file-configuration-table">';
|
148 |
+
foreach ($html as $part) {
|
149 |
+
$result .= '<tr><th>'.$part[0].'</th><td>'.$part[1].'</td></tr>';
|
150 |
+
}
|
151 |
+
$result .= '</table>';
|
152 |
+
return $result;
|
153 |
+
} else {
|
154 |
+
return '';
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getName()
|
159 |
+
{
|
160 |
+
return $this->getData('name');
|
161 |
+
}
|
162 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/Form/Element/File.php~
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_Form_Element_File
|
17 |
+
extends Varien_Data_Form_Element_Abstract
|
18 |
+
{
|
19 |
+
public function __construct($data)
|
20 |
+
{
|
21 |
+
parent::__construct($data);
|
22 |
+
$this->setType('file');
|
23 |
+
$this->setExtType('file');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getElementHtml()
|
27 |
+
{
|
28 |
+
$html = '';
|
29 |
+
|
30 |
+
if ($this->getValue()) {
|
31 |
+
$url = Mage::helper('fileattributes')->getFileUrl($this->getValue());
|
32 |
+
$html = '<a href="'.$url.'" target="_blank">'.$this->getValue().'</a><br />';
|
33 |
+
}
|
34 |
+
|
35 |
+
$this->setClass('input-file');
|
36 |
+
if ($this->getEntityAttribute()->getIsRequired()) {
|
37 |
+
if (!$this->getValue()) {
|
38 |
+
// Add required class only if we don't have any current value, because of file inputs
|
39 |
+
$this->addClass('required-entry');
|
40 |
+
}
|
41 |
+
} else {
|
42 |
+
// No delete for required attributes, to delete a file it is just needed to change it
|
43 |
+
$html .= $this->_getDeleteCheckbox();
|
44 |
+
}
|
45 |
+
|
46 |
+
$html .= parent::getElementHtml();
|
47 |
+
$html .= $this->_getDescriptionHtml();
|
48 |
+
|
49 |
+
return $html;
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function _getDeleteCheckbox()
|
53 |
+
{
|
54 |
+
if ($this->getValue()) {
|
55 |
+
$html = '<span class="delete-file">';
|
56 |
+
$html .= '<input type="checkbox" name="'.parent::getName().'[delete]" value="1" class="checkbox" id="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' disabled="disabled"': '').' onchange="(this.checked ? $(\''.$this->getHtmlId().'\').disable() : $(\''.$this->getHtmlId().'\').enable());"/>';
|
57 |
+
$html .= '<label for="'.$this->getHtmlId().'_delete"'.($this->getDisabled() ? ' class="disabled"' : '').'> '.Mage::helper('fileattributes')->__('Delete File').'</label>';
|
58 |
+
$html .= $this->_getHiddenInput();
|
59 |
+
$html .= '</span>';
|
60 |
+
return $html;
|
61 |
+
}
|
62 |
+
return '';
|
63 |
+
}
|
64 |
+
|
65 |
+
protected function _getHiddenInput()
|
66 |
+
{
|
67 |
+
return '<input type="hidden" name="'.parent::getName().'[value]" value="'.$this->getValue().'" />';
|
68 |
+
}
|
69 |
+
|
70 |
+
protected function _getDescriptionHtml()
|
71 |
+
{
|
72 |
+
$attributeModel = Mage::getModel('fileattributes/attribute_backend_file')
|
73 |
+
->setAttribute($this->getEntityAttribute());
|
74 |
+
|
75 |
+
$config = Mage::helper('fileattributes/config')
|
76 |
+
->getAttributeConfiguration($this->getEntityAttribute()->getId());
|
77 |
+
|
78 |
+
if (!isset($config['display_config']) || !$config['display_config']) {
|
79 |
+
return '';
|
80 |
+
}
|
81 |
+
|
82 |
+
$helper = Mage::helper('fileattributes');
|
83 |
+
$html = array();
|
84 |
+
|
85 |
+
// File extensions
|
86 |
+
if (isset($config['allowed_file_extensions'])
|
87 |
+
&& is_array($exts = $config['allowed_file_extensions'])) {
|
88 |
+
sort($exts);
|
89 |
+
$html[] = array($helper->__('Allowed File Extensions'), implode(', ', $exts));
|
90 |
+
} elseif (isset($config['forbidden_file_extensions'])
|
91 |
+
&& is_array($exts = $config['forbidden_file_extensions'])) {
|
92 |
+
sort($exts);
|
93 |
+
$html[] = array($helper->__('Forbidden File Extensions'), implode(', ', $exts));
|
94 |
+
}
|
95 |
+
|
96 |
+
// File size
|
97 |
+
$serverMaxFileSize = $attributeModel->getUploadMaxFileSize();
|
98 |
+
if (($config['file_max_size'] > 0)
|
99 |
+
&& ($config['file_max_size'] < $serverMaxFileSize)) {
|
100 |
+
$html[] = array(
|
101 |
+
$helper->__('Maximum File Size'),
|
102 |
+
$helper->__('%s (configuration)', $helper->getFileSizeForDisplay($config['file_max_size']))
|
103 |
+
);
|
104 |
+
} else {
|
105 |
+
$html[] = array(
|
106 |
+
$helper->__('Maximum File Size'),
|
107 |
+
$helper->__('%s (server)', $helper->getFileSizeForDisplay($serverMaxFileSize))
|
108 |
+
);
|
109 |
+
}
|
110 |
+
|
111 |
+
// MIME types
|
112 |
+
if (isset($config['allowed_mime_types'])
|
113 |
+
&& is_array($types = $config['allowed_mime_types'])) {
|
114 |
+
$types = array_values($types);
|
115 |
+
sort($types);
|
116 |
+
$html[] = array($helper->__('Allowed File Types'), implode(', ', $types));
|
117 |
+
} elseif (isset($config['forbidden_mime_types'])
|
118 |
+
&& is_array($types = $config['forbidden_mime_types'])) {
|
119 |
+
$types = array_values($types);
|
120 |
+
sort($types);
|
121 |
+
$html[] = array($helper->__('Forbidden File Types'), implode(', ', $types));
|
122 |
+
}
|
123 |
+
|
124 |
+
// Image only
|
125 |
+
if ($config['image_only']) {
|
126 |
+
$html[] = array($helper->__('Image Only'), $helper->__('Yes'));
|
127 |
+
}
|
128 |
+
|
129 |
+
if ($config['image_min_width'] > 0) {
|
130 |
+
$html[] = array($helper->__('Image Minimum Width'), $helper->__('%spx', $config['image_min_width']));
|
131 |
+
}
|
132 |
+
if ($config['image_max_width'] > 0) {
|
133 |
+
$html[] = array($helper->__('Image Maximum Width'), $helper->__('%spx', $config['image_max_width']));
|
134 |
+
}
|
135 |
+
if ($config['image_min_height'] > 0) {
|
136 |
+
$html[] = array($helper->__('Image Minimum Height'), $helper->__('%spx', $config['image_min_height']));
|
137 |
+
}
|
138 |
+
if ($config['image_max_height'] > 0) {
|
139 |
+
$html[] = array($helper->__('Image Maximum Height'), $helper->__('%spx', $config['image_max_height']));
|
140 |
+
}
|
141 |
+
|
142 |
+
if (!empty($html)) {
|
143 |
+
// Wrap all configs in a toggleable table
|
144 |
+
$result = '<br /><a href="#" onclick="$(\''.$this->getHtmlId().'_config_container\').toggle(); return false;">';
|
145 |
+
$result .= $helper->__('Show / Hide Configuration File').'</a>';
|
146 |
+
$result .= '<div id="'.$this->getHtmlId().'_config_container" style="display: none;">';
|
147 |
+
$result .= '<table class="blfa-file-configuration-table">';
|
148 |
+
foreach ($html as $part) {
|
149 |
+
$result .= '<tr><th>'.$part[0].'</th><td>'.$part[1].'</td></tr>';
|
150 |
+
}
|
151 |
+
$result .= '</table>';
|
152 |
+
return $result;
|
153 |
+
} else {
|
154 |
+
return '';
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getName()
|
159 |
+
{
|
160 |
+
return $this->getData('name');
|
161 |
+
}
|
162 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Attributes/Configuration.php
ADDED
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Attributes_Configuration
|
17 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
18 |
+
{
|
19 |
+
/*
|
20 |
+
Renderers for specific columns
|
21 |
+
*/
|
22 |
+
protected $_displayConfigSelectRenderer = null;
|
23 |
+
protected $_attributeSelectRenderer = null;
|
24 |
+
protected $_imageOnlySelectRenderer = null;
|
25 |
+
protected $_fileSaveMomentSelectRenderer = null;
|
26 |
+
protected $_exceptionsHandlingModeSelectRenderer = null;
|
27 |
+
|
28 |
+
public function __construct()
|
29 |
+
{
|
30 |
+
parent::__construct();
|
31 |
+
// Use our own template, made for configs with lots of columns
|
32 |
+
$this->setTemplate('bl/fileattributes/system/config/form/field/array.phtml');
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function _renderCellTemplate($columnName)
|
36 |
+
{
|
37 |
+
if (!empty($this->_columns[$columnName])
|
38 |
+
&& $this->_columns[$columnName]['renderer']) {
|
39 |
+
$column = $this->_columns[$columnName];
|
40 |
+
$inputName = $this->getElement()->getName() . '[#{_id}]['.$columnName.']';
|
41 |
+
|
42 |
+
$html = $column['renderer']->setColumn($column)
|
43 |
+
->setColumnName($columnName)
|
44 |
+
->setInputName($inputName)
|
45 |
+
->toHtml();
|
46 |
+
|
47 |
+
return $this->jsQuoteEscape($html);
|
48 |
+
}
|
49 |
+
return parent::_renderCellTemplate($columnName);
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function _getDisplayConfigSelectRenderer()
|
53 |
+
{
|
54 |
+
if (is_null($this->_displayConfigSelectRenderer)) {
|
55 |
+
$this->_displayConfigSelectRenderer = $this->getLayout()->createBlock(
|
56 |
+
'fileattributes/system_config_form_field_select_boolean', '',
|
57 |
+
array('is_render_to_js_template' => true)
|
58 |
+
);
|
59 |
+
$this->_displayConfigSelectRenderer->setExtraParams('style="width:80px"');
|
60 |
+
}
|
61 |
+
return $this->_displayConfigSelectRenderer;
|
62 |
+
}
|
63 |
+
|
64 |
+
protected function _getAttributeSelectRenderer()
|
65 |
+
{
|
66 |
+
if (is_null($this->_attributeSelectRenderer)) {
|
67 |
+
$this->_attributeSelectRenderer = $this->getLayout()->createBlock(
|
68 |
+
'fileattributes/system_config_form_field_select_attribute', '',
|
69 |
+
array('is_render_to_js_template' => true)
|
70 |
+
);
|
71 |
+
$this->_attributeSelectRenderer->setExtraParams('style="width:200px"');
|
72 |
+
}
|
73 |
+
return $this->_attributeSelectRenderer;
|
74 |
+
}
|
75 |
+
|
76 |
+
protected function _getImageOnlySelectRenderer()
|
77 |
+
{
|
78 |
+
if (is_null($this->_imageOnlySelectRenderer)) {
|
79 |
+
$this->_imageOnlySelectRenderer = $this->getLayout()->createBlock(
|
80 |
+
'fileattributes/system_config_form_field_select_boolean', '',
|
81 |
+
array('is_render_to_js_template' => true)
|
82 |
+
);
|
83 |
+
$this->_imageOnlySelectRenderer->setExtraParams('style="width:80px"');
|
84 |
+
}
|
85 |
+
return $this->_imageOnlySelectRenderer;
|
86 |
+
}
|
87 |
+
|
88 |
+
protected function _getFileSaveMomentSelectRenderer()
|
89 |
+
{
|
90 |
+
if (is_null($this->_fileSaveMomentSelectRenderer)) {
|
91 |
+
$this->_fileSaveMomentSelectRenderer = $this->getLayout()->createBlock(
|
92 |
+
'fileattributes/system_config_form_field_select_file_save_moment', '',
|
93 |
+
array('is_render_to_js_template' => true)
|
94 |
+
);
|
95 |
+
$this->_fileSaveMomentSelectRenderer->setExtraParams('style="width:200px"');
|
96 |
+
}
|
97 |
+
return $this->_fileSaveMomentSelectRenderer;
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function _getExceptionsHandlingModeSelectRenderer()
|
101 |
+
{
|
102 |
+
if (is_null($this->_exceptionsHandlingModeSelectRenderer)) {
|
103 |
+
$this->_exceptionsHandlingModeSelectRenderer = $this->getLayout()->createBlock(
|
104 |
+
'fileattributes/system_config_form_field_select_exceptions_handling_mode', '',
|
105 |
+
array('is_render_to_js_template' => true)
|
106 |
+
);
|
107 |
+
$this->_exceptionsHandlingModeSelectRenderer->setExtraParams('style="width:100px"');
|
108 |
+
}
|
109 |
+
return $this->_exceptionsHandlingModeSelectRenderer;
|
110 |
+
}
|
111 |
+
|
112 |
+
protected function _prepareToRender()
|
113 |
+
{
|
114 |
+
$this->addColumn('attribute_id', array(
|
115 |
+
'label' => $this->__('Attribute'),
|
116 |
+
'renderer' => $this->_getAttributeSelectRenderer(),
|
117 |
+
));
|
118 |
+
$this->addColumn('display_config', array(
|
119 |
+
'label' => $this->__('Display Configuration On Fields'),
|
120 |
+
'renderer' => $this->_getDisplayConfigSelectRenderer(),
|
121 |
+
));
|
122 |
+
$this->addColumn('file_save_moment', array(
|
123 |
+
'label' => $this->__('File Save Moment'),
|
124 |
+
'renderer' => $this->_getFileSaveMomentSelectRenderer(),
|
125 |
+
));
|
126 |
+
$this->addColumn('exceptions_handling_mode', array(
|
127 |
+
'label' => $this->__('Exceptions Handling Mode'),
|
128 |
+
'renderer' => $this->_getExceptionsHandlingModeSelectRenderer(),
|
129 |
+
));
|
130 |
+
$this->addColumn('allowed_file_extensions', array(
|
131 |
+
'label' => $this->__('Allowed File Extensions'),
|
132 |
+
'style' => 'width:180px',
|
133 |
+
));
|
134 |
+
$this->addColumn('forbidden_file_extensions', array(
|
135 |
+
'label' => $this->__('Forbidden File Extensions'),
|
136 |
+
'style' => 'width:180px',
|
137 |
+
));
|
138 |
+
$this->addColumn('file_max_size', array(
|
139 |
+
'label' => $this->__('File Max Size'),
|
140 |
+
'style' => 'width:90px',
|
141 |
+
));
|
142 |
+
$this->addColumn('allowed_mime_types', array(
|
143 |
+
'label' => $this->__('Allowed MIME Types'),
|
144 |
+
'style' => 'width:180px',
|
145 |
+
));
|
146 |
+
$this->addColumn('forbidden_mime_types', array(
|
147 |
+
'label' => $this->__('Forbidden MIME Types'),
|
148 |
+
'style' => 'width:180px',
|
149 |
+
));
|
150 |
+
$this->addColumn('image_only', array(
|
151 |
+
'label' => $this->__('Image Only'),
|
152 |
+
'renderer' => $this->_getImageOnlySelectRenderer(),
|
153 |
+
));
|
154 |
+
$this->addColumn('image_min_width', array(
|
155 |
+
'label' => $this->__('Image Min Width'),
|
156 |
+
'style' => 'width:60px',
|
157 |
+
));
|
158 |
+
$this->addColumn('image_max_width', array(
|
159 |
+
'label' => $this->__('Image Max Width'),
|
160 |
+
'style' => 'width:60px',
|
161 |
+
));
|
162 |
+
$this->addColumn('image_min_height', array(
|
163 |
+
'label' => $this->__('Image Min Height'),
|
164 |
+
'style' => 'width:60px',
|
165 |
+
));
|
166 |
+
$this->addColumn('image_max_height', array(
|
167 |
+
'label' => $this->__('Image Max Height'),
|
168 |
+
'style' => 'width:60px',
|
169 |
+
));
|
170 |
+
|
171 |
+
$this->_addAfter = false;
|
172 |
+
$this->_addButtonLabel = $this->__('Add Configuration');
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Prepare default values for given row's select fields
|
177 |
+
*
|
178 |
+
* @param Varien_Object $row Row data object
|
179 |
+
*/
|
180 |
+
protected function _prepareArrayRow(Varien_Object $row)
|
181 |
+
{
|
182 |
+
parent::_prepareArrayRow($row);
|
183 |
+
|
184 |
+
$displayConfig = ($row->hasData('display_config') ? (bool)$row->getData('display_config') : false);
|
185 |
+
$row->setData(
|
186 |
+
'option_extra_attr_'.$this->_getDisplayConfigSelectRenderer()->calcOptionHash($displayConfig ? 1 : 0),
|
187 |
+
'selected="selected"'
|
188 |
+
);
|
189 |
+
$row->setData(
|
190 |
+
'option_extra_attr_'.$this->_getAttributeSelectRenderer()->calcOptionHash($row->getData('attribute_id')),
|
191 |
+
'selected="selected"'
|
192 |
+
);
|
193 |
+
$row->setData(
|
194 |
+
'option_extra_attr_'.$this->_getFileSaveMomentSelectRenderer()->calcOptionHash($row->getData('file_save_moment')),
|
195 |
+
'selected="selected"'
|
196 |
+
);
|
197 |
+
$row->setData(
|
198 |
+
'option_extra_attr_'.$this->_getExceptionsHandlingModeSelectRenderer()->calcOptionHash($row->getData('exceptions_handling_mode')),
|
199 |
+
'selected="selected"'
|
200 |
+
);
|
201 |
+
$imageOnly = ($row->hasData('image_only') ? (bool)$row->getData('image_only') : false);
|
202 |
+
$row->setData(
|
203 |
+
'option_extra_attr_'.$this->_getImageOnlySelectRenderer()->calcOptionHash($imageOnly ? 1 : 0),
|
204 |
+
'selected="selected"'
|
205 |
+
);
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Prepare default values for default row
|
210 |
+
*
|
211 |
+
* @return string Default values JSON
|
212 |
+
*/
|
213 |
+
public function getDefaultArrayRowJson()
|
214 |
+
{
|
215 |
+
return Zend_Json::encode(array_fill_keys(array(
|
216 |
+
'option_extra_attr_'.$this->_getDisplayConfigSelectRenderer()->calcOptionHash(1),
|
217 |
+
// Same values as used in category images' backend model
|
218 |
+
'option_extra_attr_'.$this->_getFileSaveMomentSelectRenderer()->calcOptionHash(
|
219 |
+
Telemantis_FileAttributes_Model_Attribute_Backend_File::FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE
|
220 |
+
),
|
221 |
+
'option_extra_attr_'.$this->_getExceptionsHandlingModeSelectRenderer()->calcOptionHash(
|
222 |
+
Telemantis_FileAttributes_Model_Attribute_Backend_File::EXCEPTIONS_HANDLING_MODE_LOG
|
223 |
+
),
|
224 |
+
'option_extra_attr_'.$this->_getImageOnlySelectRenderer()->calcOptionHash(0),
|
225 |
+
), 'selected="selected"'));
|
226 |
+
}
|
227 |
+
|
228 |
+
public function getEmptyWidth()
|
229 |
+
{
|
230 |
+
return 500;
|
231 |
+
}
|
232 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Attributes/Configuration.php~
ADDED
@@ -0,0 +1,232 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Attributes_Configuration
|
17 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
18 |
+
{
|
19 |
+
/*
|
20 |
+
Renderers for specific columns
|
21 |
+
*/
|
22 |
+
protected $_displayConfigSelectRenderer = null;
|
23 |
+
protected $_attributeSelectRenderer = null;
|
24 |
+
protected $_imageOnlySelectRenderer = null;
|
25 |
+
protected $_fileSaveMomentSelectRenderer = null;
|
26 |
+
protected $_exceptionsHandlingModeSelectRenderer = null;
|
27 |
+
|
28 |
+
public function __construct()
|
29 |
+
{
|
30 |
+
parent::__construct();
|
31 |
+
// Use our own template, made for configs with lots of columns
|
32 |
+
$this->setTemplate('bl/fileattributes/system/config/form/field/array.phtml');
|
33 |
+
}
|
34 |
+
|
35 |
+
protected function _renderCellTemplate($columnName)
|
36 |
+
{
|
37 |
+
if (!empty($this->_columns[$columnName])
|
38 |
+
&& $this->_columns[$columnName]['renderer']) {
|
39 |
+
$column = $this->_columns[$columnName];
|
40 |
+
$inputName = $this->getElement()->getName() . '[#{_id}]['.$columnName.']';
|
41 |
+
|
42 |
+
$html = $column['renderer']->setColumn($column)
|
43 |
+
->setColumnName($columnName)
|
44 |
+
->setInputName($inputName)
|
45 |
+
->toHtml();
|
46 |
+
|
47 |
+
return $this->jsQuoteEscape($html);
|
48 |
+
}
|
49 |
+
return parent::_renderCellTemplate($columnName);
|
50 |
+
}
|
51 |
+
|
52 |
+
protected function _getDisplayConfigSelectRenderer()
|
53 |
+
{
|
54 |
+
if (is_null($this->_displayConfigSelectRenderer)) {
|
55 |
+
$this->_displayConfigSelectRenderer = $this->getLayout()->createBlock(
|
56 |
+
'fileattributes/system_config_form_field_select_boolean', '',
|
57 |
+
array('is_render_to_js_template' => true)
|
58 |
+
);
|
59 |
+
$this->_displayConfigSelectRenderer->setExtraParams('style="width:80px"');
|
60 |
+
}
|
61 |
+
return $this->_displayConfigSelectRenderer;
|
62 |
+
}
|
63 |
+
|
64 |
+
protected function _getAttributeSelectRenderer()
|
65 |
+
{
|
66 |
+
if (is_null($this->_attributeSelectRenderer)) {
|
67 |
+
$this->_attributeSelectRenderer = $this->getLayout()->createBlock(
|
68 |
+
'fileattributes/system_config_form_field_select_attribute', '',
|
69 |
+
array('is_render_to_js_template' => true)
|
70 |
+
);
|
71 |
+
$this->_attributeSelectRenderer->setExtraParams('style="width:200px"');
|
72 |
+
}
|
73 |
+
return $this->_attributeSelectRenderer;
|
74 |
+
}
|
75 |
+
|
76 |
+
protected function _getImageOnlySelectRenderer()
|
77 |
+
{
|
78 |
+
if (is_null($this->_imageOnlySelectRenderer)) {
|
79 |
+
$this->_imageOnlySelectRenderer = $this->getLayout()->createBlock(
|
80 |
+
'fileattributes/system_config_form_field_select_boolean', '',
|
81 |
+
array('is_render_to_js_template' => true)
|
82 |
+
);
|
83 |
+
$this->_imageOnlySelectRenderer->setExtraParams('style="width:80px"');
|
84 |
+
}
|
85 |
+
return $this->_imageOnlySelectRenderer;
|
86 |
+
}
|
87 |
+
|
88 |
+
protected function _getFileSaveMomentSelectRenderer()
|
89 |
+
{
|
90 |
+
if (is_null($this->_fileSaveMomentSelectRenderer)) {
|
91 |
+
$this->_fileSaveMomentSelectRenderer = $this->getLayout()->createBlock(
|
92 |
+
'fileattributes/system_config_form_field_select_file_save_moment', '',
|
93 |
+
array('is_render_to_js_template' => true)
|
94 |
+
);
|
95 |
+
$this->_fileSaveMomentSelectRenderer->setExtraParams('style="width:200px"');
|
96 |
+
}
|
97 |
+
return $this->_fileSaveMomentSelectRenderer;
|
98 |
+
}
|
99 |
+
|
100 |
+
protected function _getExceptionsHandlingModeSelectRenderer()
|
101 |
+
{
|
102 |
+
if (is_null($this->_exceptionsHandlingModeSelectRenderer)) {
|
103 |
+
$this->_exceptionsHandlingModeSelectRenderer = $this->getLayout()->createBlock(
|
104 |
+
'fileattributes/system_config_form_field_select_exceptions_handling_mode', '',
|
105 |
+
array('is_render_to_js_template' => true)
|
106 |
+
);
|
107 |
+
$this->_exceptionsHandlingModeSelectRenderer->setExtraParams('style="width:100px"');
|
108 |
+
}
|
109 |
+
return $this->_exceptionsHandlingModeSelectRenderer;
|
110 |
+
}
|
111 |
+
|
112 |
+
protected function _prepareToRender()
|
113 |
+
{
|
114 |
+
$this->addColumn('attribute_id', array(
|
115 |
+
'label' => $this->__('Attribute'),
|
116 |
+
'renderer' => $this->_getAttributeSelectRenderer(),
|
117 |
+
));
|
118 |
+
$this->addColumn('display_config', array(
|
119 |
+
'label' => $this->__('Display Configuration On Fields'),
|
120 |
+
'renderer' => $this->_getDisplayConfigSelectRenderer(),
|
121 |
+
));
|
122 |
+
$this->addColumn('file_save_moment', array(
|
123 |
+
'label' => $this->__('File Save Moment'),
|
124 |
+
'renderer' => $this->_getFileSaveMomentSelectRenderer(),
|
125 |
+
));
|
126 |
+
$this->addColumn('exceptions_handling_mode', array(
|
127 |
+
'label' => $this->__('Exceptions Handling Mode'),
|
128 |
+
'renderer' => $this->_getExceptionsHandlingModeSelectRenderer(),
|
129 |
+
));
|
130 |
+
$this->addColumn('allowed_file_extensions', array(
|
131 |
+
'label' => $this->__('Allowed File Extensions'),
|
132 |
+
'style' => 'width:180px',
|
133 |
+
));
|
134 |
+
$this->addColumn('forbidden_file_extensions', array(
|
135 |
+
'label' => $this->__('Forbidden File Extensions'),
|
136 |
+
'style' => 'width:180px',
|
137 |
+
));
|
138 |
+
$this->addColumn('file_max_size', array(
|
139 |
+
'label' => $this->__('File Max Size'),
|
140 |
+
'style' => 'width:90px',
|
141 |
+
));
|
142 |
+
$this->addColumn('allowed_mime_types', array(
|
143 |
+
'label' => $this->__('Allowed MIME Types'),
|
144 |
+
'style' => 'width:180px',
|
145 |
+
));
|
146 |
+
$this->addColumn('forbidden_mime_types', array(
|
147 |
+
'label' => $this->__('Forbidden MIME Types'),
|
148 |
+
'style' => 'width:180px',
|
149 |
+
));
|
150 |
+
$this->addColumn('image_only', array(
|
151 |
+
'label' => $this->__('Image Only'),
|
152 |
+
'renderer' => $this->_getImageOnlySelectRenderer(),
|
153 |
+
));
|
154 |
+
$this->addColumn('image_min_width', array(
|
155 |
+
'label' => $this->__('Image Min Width'),
|
156 |
+
'style' => 'width:60px',
|
157 |
+
));
|
158 |
+
$this->addColumn('image_max_width', array(
|
159 |
+
'label' => $this->__('Image Max Width'),
|
160 |
+
'style' => 'width:60px',
|
161 |
+
));
|
162 |
+
$this->addColumn('image_min_height', array(
|
163 |
+
'label' => $this->__('Image Min Height'),
|
164 |
+
'style' => 'width:60px',
|
165 |
+
));
|
166 |
+
$this->addColumn('image_max_height', array(
|
167 |
+
'label' => $this->__('Image Max Height'),
|
168 |
+
'style' => 'width:60px',
|
169 |
+
));
|
170 |
+
|
171 |
+
$this->_addAfter = false;
|
172 |
+
$this->_addButtonLabel = $this->__('Add Configuration');
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Prepare default values for given row's select fields
|
177 |
+
*
|
178 |
+
* @param Varien_Object $row Row data object
|
179 |
+
*/
|
180 |
+
protected function _prepareArrayRow(Varien_Object $row)
|
181 |
+
{
|
182 |
+
parent::_prepareArrayRow($row);
|
183 |
+
|
184 |
+
$displayConfig = ($row->hasData('display_config') ? (bool)$row->getData('display_config') : false);
|
185 |
+
$row->setData(
|
186 |
+
'option_extra_attr_'.$this->_getDisplayConfigSelectRenderer()->calcOptionHash($displayConfig ? 1 : 0),
|
187 |
+
'selected="selected"'
|
188 |
+
);
|
189 |
+
$row->setData(
|
190 |
+
'option_extra_attr_'.$this->_getAttributeSelectRenderer()->calcOptionHash($row->getData('attribute_id')),
|
191 |
+
'selected="selected"'
|
192 |
+
);
|
193 |
+
$row->setData(
|
194 |
+
'option_extra_attr_'.$this->_getFileSaveMomentSelectRenderer()->calcOptionHash($row->getData('file_save_moment')),
|
195 |
+
'selected="selected"'
|
196 |
+
);
|
197 |
+
$row->setData(
|
198 |
+
'option_extra_attr_'.$this->_getExceptionsHandlingModeSelectRenderer()->calcOptionHash($row->getData('exceptions_handling_mode')),
|
199 |
+
'selected="selected"'
|
200 |
+
);
|
201 |
+
$imageOnly = ($row->hasData('image_only') ? (bool)$row->getData('image_only') : false);
|
202 |
+
$row->setData(
|
203 |
+
'option_extra_attr_'.$this->_getImageOnlySelectRenderer()->calcOptionHash($imageOnly ? 1 : 0),
|
204 |
+
'selected="selected"'
|
205 |
+
);
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Prepare default values for default row
|
210 |
+
*
|
211 |
+
* @return string Default values JSON
|
212 |
+
*/
|
213 |
+
public function getDefaultArrayRowJson()
|
214 |
+
{
|
215 |
+
return Zend_Json::encode(array_fill_keys(array(
|
216 |
+
'option_extra_attr_'.$this->_getDisplayConfigSelectRenderer()->calcOptionHash(1),
|
217 |
+
// Same values as used in category images' backend model
|
218 |
+
'option_extra_attr_'.$this->_getFileSaveMomentSelectRenderer()->calcOptionHash(
|
219 |
+
Telemantis_FileAttributes_Model_Attribute_Backend_File::FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE
|
220 |
+
),
|
221 |
+
'option_extra_attr_'.$this->_getExceptionsHandlingModeSelectRenderer()->calcOptionHash(
|
222 |
+
Telemantis_FileAttributes_Model_Attribute_Backend_File::EXCEPTIONS_HANDLING_MODE_LOG
|
223 |
+
),
|
224 |
+
'option_extra_attr_'.$this->_getImageOnlySelectRenderer()->calcOptionHash(0),
|
225 |
+
), 'selected="selected"'));
|
226 |
+
}
|
227 |
+
|
228 |
+
public function getEmptyWidth()
|
229 |
+
{
|
230 |
+
return 500;
|
231 |
+
}
|
232 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Abstract.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
abstract class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
17 |
+
extends Mage_Core_Block_Html_Select
|
18 |
+
{
|
19 |
+
abstract protected function _getSourceModelName();
|
20 |
+
|
21 |
+
public function setInputName($value)
|
22 |
+
{
|
23 |
+
return $this->setName($value);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function _toHtml()
|
27 |
+
{
|
28 |
+
if (!$this->getOptions() && $this->_getSourceModelName()) {
|
29 |
+
$options = Mage::getModel($this->_getSourceModelName())->toOptionArray();
|
30 |
+
foreach ($options as $option) {
|
31 |
+
$this->addOption($option['value'], $option['label']);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
return parent::_toHtml();
|
35 |
+
}
|
36 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Abstract.php~
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
abstract class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
17 |
+
extends Mage_Core_Block_Html_Select
|
18 |
+
{
|
19 |
+
abstract protected function _getSourceModelName();
|
20 |
+
|
21 |
+
public function setInputName($value)
|
22 |
+
{
|
23 |
+
return $this->setName($value);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function _toHtml()
|
27 |
+
{
|
28 |
+
if (!$this->getOptions() && $this->_getSourceModelName()) {
|
29 |
+
$options = Mage::getModel($this->_getSourceModelName())->toOptionArray();
|
30 |
+
foreach ($options as $option) {
|
31 |
+
$this->addOption($option['value'], $option['label']);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
return parent::_toHtml();
|
35 |
+
}
|
36 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Attribute.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Attribute
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected $_attributes;
|
20 |
+
|
21 |
+
protected function _getSourceModelName()
|
22 |
+
{
|
23 |
+
return null;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Return all "blfa_file" EAV attributes
|
28 |
+
*
|
29 |
+
* @return array
|
30 |
+
*/
|
31 |
+
protected function _getAttributes()
|
32 |
+
{
|
33 |
+
if (is_null($this->_attributes)) {
|
34 |
+
$eavConfig = Mage::getSingleton('eav/config');
|
35 |
+
$attributes = $this->helper('fileattributes')->getFileAttributesCollection();
|
36 |
+
|
37 |
+
foreach ($attributes as $attribute) {
|
38 |
+
$type = $eavConfig->getEntityType($attribute->getEntityTypeId());
|
39 |
+
$label = $this->__('%s (%s)', $attribute->getFrontendLabel(), $type->getEntityTypeCode());
|
40 |
+
$this->_attributes[$attribute->getId()] = $label;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
return $this->_attributes;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function setInputName($value)
|
47 |
+
{
|
48 |
+
return $this->setName($value);
|
49 |
+
}
|
50 |
+
|
51 |
+
public function _toHtml()
|
52 |
+
{
|
53 |
+
if (!$this->getOptions()) {
|
54 |
+
foreach ($this->_getAttributes() as $id => $label) {
|
55 |
+
$this->addOption($id, $label);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
return Mage_Core_Block_Html_Select::_toHtml();
|
59 |
+
}
|
60 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Attribute.php~
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Attribute
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected $_attributes;
|
20 |
+
|
21 |
+
protected function _getSourceModelName()
|
22 |
+
{
|
23 |
+
return null;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Return all "blfa_file" EAV attributes
|
28 |
+
*
|
29 |
+
* @return array
|
30 |
+
*/
|
31 |
+
protected function _getAttributes()
|
32 |
+
{
|
33 |
+
if (is_null($this->_attributes)) {
|
34 |
+
$eavConfig = Mage::getSingleton('eav/config');
|
35 |
+
$attributes = $this->helper('fileattributes')->getFileAttributesCollection();
|
36 |
+
|
37 |
+
foreach ($attributes as $attribute) {
|
38 |
+
$type = $eavConfig->getEntityType($attribute->getEntityTypeId());
|
39 |
+
$label = $this->__('%s (%s)', $attribute->getFrontendLabel(), $type->getEntityTypeCode());
|
40 |
+
$this->_attributes[$attribute->getId()] = $label;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
return $this->_attributes;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function setInputName($value)
|
47 |
+
{
|
48 |
+
return $this->setName($value);
|
49 |
+
}
|
50 |
+
|
51 |
+
public function _toHtml()
|
52 |
+
{
|
53 |
+
if (!$this->getOptions()) {
|
54 |
+
foreach ($this->_getAttributes() as $id => $label) {
|
55 |
+
$this->addOption($id, $label);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
return Mage_Core_Block_Html_Select::_toHtml();
|
59 |
+
}
|
60 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Boolean.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Boolean
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected function _getSourceModelName()
|
20 |
+
{
|
21 |
+
return 'adminhtml/system_config_source_yesno';
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Boolean.php~
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Boolean
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected function _getSourceModelName()
|
20 |
+
{
|
21 |
+
return 'adminhtml/system_config_source_yesno';
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Exceptions/Handling/Mode.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Exceptions_Handling_Mode
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected function _getSourceModelName()
|
20 |
+
{
|
21 |
+
return 'fileattributes/system_config_source_exceptions_handling_mode';
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/Exceptions/Handling/Mode.php~
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Exceptions_Handling_Mode
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected function _getSourceModelName()
|
20 |
+
{
|
21 |
+
return 'fileattributes/system_config_source_exceptions_handling_mode';
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/File/Save/Moment.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_File_Save_Moment
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected function _getSourceModelName()
|
20 |
+
{
|
21 |
+
return 'fileattributes/system_config_source_file_save_moment';
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Block/System/Config/Form/Field/Select/File/Save/Moment.php~
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_File_Save_Moment
|
17 |
+
extends Telemantis_FileAttributes_Block_System_Config_Form_Field_Select_Abstract
|
18 |
+
{
|
19 |
+
protected function _getSourceModelName()
|
20 |
+
{
|
21 |
+
return 'fileattributes/system_config_source_file_save_moment';
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Helper/Config.php
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Helper_Config
|
17 |
+
extends Mage_Core_Helper_Abstract
|
18 |
+
{
|
19 |
+
// XML paths of system config values
|
20 |
+
const XML_CONFIG_FILE_SAVE_MOMENT = 'fileattributes/configuration/file_save_moment';
|
21 |
+
const XML_CONFIG_EXCEPTIONS_HANDLING_MODE = 'fileattributes/configuration/exceptions_handling_mode';
|
22 |
+
const XML_CONFIG_ATTRIBUTES_CONFIGURATIONS = 'fileattributes/configuration/attributes_configurations';
|
23 |
+
const XML_CONFIG_ALLOW_MIME_HEADER_CHECK = 'fileattributes/configuration/allow_mime_header_check';
|
24 |
+
|
25 |
+
protected $_attributesConfigs = array();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Return a serialized config value surely unserialized
|
29 |
+
*
|
30 |
+
* @param string $key Key of config value to get
|
31 |
+
* @return array Unserialized config value
|
32 |
+
*/
|
33 |
+
protected function _getSerializedConfig($key)
|
34 |
+
{
|
35 |
+
$values = Mage::getStoreConfig($key);
|
36 |
+
if (!is_array($values)) {
|
37 |
+
/*
|
38 |
+
Unserialize values if needed
|
39 |
+
(should always be the case, as _afterLoad() is not called with getStoreConfig())
|
40 |
+
*/
|
41 |
+
$values = @unserialize($values);
|
42 |
+
$values = (is_array($values) ? $values : array());
|
43 |
+
}
|
44 |
+
return $values;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getFileSaveMoment()
|
48 |
+
{
|
49 |
+
return Mage::getStoreConfig(self::XML_CONFIG_FILE_SAVE_MOMENT);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getExceptionsHandlingMode()
|
53 |
+
{
|
54 |
+
return Mage::getStoreConfig(self::XML_CONFIG_EXCEPTIONS_HANDLING_MODE);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Parse file extensions string with various separators
|
59 |
+
*
|
60 |
+
* @param string $extensions String to parse
|
61 |
+
* @return array|null
|
62 |
+
*/
|
63 |
+
protected function _parseExtensionsString($extensions)
|
64 |
+
{
|
65 |
+
preg_match_all('/[a-z0-9]+/si', strtolower($extensions), $matches);
|
66 |
+
if (isset($matches[0]) && is_array($matches[0]) && (count($matches[0]) > 0)) {
|
67 |
+
return $matches[0];
|
68 |
+
}
|
69 |
+
return null;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Parse MIME types string (code + label) with given separator
|
74 |
+
*
|
75 |
+
* @param string $types String to parse
|
76 |
+
* @param string $sep Values separator
|
77 |
+
* @return array|null
|
78 |
+
*/
|
79 |
+
protected function _parseMimeTypesString($types, $sep=',')
|
80 |
+
{
|
81 |
+
// TODO allow to backslash separator ?
|
82 |
+
$types = explode($sep, $types);
|
83 |
+
if (($typesNumber = count($types)) > 1) {
|
84 |
+
$result = array();
|
85 |
+
for ($i=0; $i<$typesNumber-1; $i+=2) {
|
86 |
+
$result[$types[$i]] = $types[$i+1];
|
87 |
+
}
|
88 |
+
return $result;
|
89 |
+
}
|
90 |
+
return null;
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Return attribute's configuration
|
96 |
+
*
|
97 |
+
* @param int $attributeId ID of attribute from which to get config
|
98 |
+
* @param bool $defaultNull Will return null if attribute has no config set, else empty config array
|
99 |
+
* @return null|array
|
100 |
+
*/
|
101 |
+
public function getAttributeConfiguration($attributeId, $defaultNull=false)
|
102 |
+
{
|
103 |
+
if (!array_key_exists($attributeId, $this->_attributesConfigs)) {
|
104 |
+
$config = null;
|
105 |
+
|
106 |
+
foreach ($this->_getSerializedConfig(self::XML_CONFIG_ATTRIBUTES_CONFIGURATIONS) as $attribute) {
|
107 |
+
if ($attribute['attribute_id'] == $attributeId) {
|
108 |
+
// Parse serialized configs
|
109 |
+
$config = $attribute;
|
110 |
+
$config['allowed_mime_types'] = $this->_parseMimeTypesString($attribute['allowed_mime_types']);
|
111 |
+
$config['forbidden_mime_types'] = $this->_parseMimeTypesString($attribute['forbidden_mime_types']);
|
112 |
+
$config['allowed_file_extensions'] = $this->_parseExtensionsString($attribute['allowed_file_extensions']);
|
113 |
+
$config['forbidden_file_extensions'] = $this->_parseExtensionsString($attribute['forbidden_file_extensions']);
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
if (is_null($config)) {
|
119 |
+
$config = ($defaultNull ? null : array(
|
120 |
+
'attribute_id' => $attributeId,
|
121 |
+
'display_config' => false,
|
122 |
+
'file_save_moment' => $this->getFileSaveMoment(),
|
123 |
+
'file_max_size' => '',
|
124 |
+
'image_only' => false,
|
125 |
+
'image_min_width' => '',
|
126 |
+
'image_max_width' => '',
|
127 |
+
'image_min_height' => '',
|
128 |
+
'image_max_height' => '',
|
129 |
+
'allowed_mime_types' => null,
|
130 |
+
'forbidden_mime_types' => null,
|
131 |
+
'exceptions_handling_mode' => $this->getExceptionsHandlingMode(),
|
132 |
+
'allowed_file_extensions' => null,
|
133 |
+
'forbidden_file_extensions' => null,
|
134 |
+
));
|
135 |
+
}
|
136 |
+
|
137 |
+
$this->_attributesConfigs[$attributeId] = $config;
|
138 |
+
}
|
139 |
+
return $this->_attributesConfigs[$attributeId];
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getAllowMimeHeaderCheck()
|
143 |
+
{
|
144 |
+
return Mage::getStoreConfig(self::XML_CONFIG_ALLOW_MIME_HEADER_CHECK);
|
145 |
+
}
|
146 |
+
}
|
app/code/community/Telemantis/FileAttributes/Helper/Config.php~
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Helper_Config
|
17 |
+
extends Mage_Core_Helper_Abstract
|
18 |
+
{
|
19 |
+
// XML paths of system config values
|
20 |
+
const XML_CONFIG_FILE_SAVE_MOMENT = 'fileattributes/configuration/file_save_moment';
|
21 |
+
const XML_CONFIG_EXCEPTIONS_HANDLING_MODE = 'fileattributes/configuration/exceptions_handling_mode';
|
22 |
+
const XML_CONFIG_ATTRIBUTES_CONFIGURATIONS = 'fileattributes/configuration/attributes_configurations';
|
23 |
+
const XML_CONFIG_ALLOW_MIME_HEADER_CHECK = 'fileattributes/configuration/allow_mime_header_check';
|
24 |
+
|
25 |
+
protected $_attributesConfigs = array();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Return a serialized config value surely unserialized
|
29 |
+
*
|
30 |
+
* @param string $key Key of config value to get
|
31 |
+
* @return array Unserialized config value
|
32 |
+
*/
|
33 |
+
protected function _getSerializedConfig($key)
|
34 |
+
{
|
35 |
+
$values = Mage::getStoreConfig($key);
|
36 |
+
if (!is_array($values)) {
|
37 |
+
/*
|
38 |
+
Unserialize values if needed
|
39 |
+
(should always be the case, as _afterLoad() is not called with getStoreConfig())
|
40 |
+
*/
|
41 |
+
$values = @unserialize($values);
|
42 |
+
$values = (is_array($values) ? $values : array());
|
43 |
+
}
|
44 |
+
return $values;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getFileSaveMoment()
|
48 |
+
{
|
49 |
+
return Mage::getStoreConfig(self::XML_CONFIG_FILE_SAVE_MOMENT);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function getExceptionsHandlingMode()
|
53 |
+
{
|
54 |
+
return Mage::getStoreConfig(self::XML_CONFIG_EXCEPTIONS_HANDLING_MODE);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Parse file extensions string with various separators
|
59 |
+
*
|
60 |
+
* @param string $extensions String to parse
|
61 |
+
* @return array|null
|
62 |
+
*/
|
63 |
+
protected function _parseExtensionsString($extensions)
|
64 |
+
{
|
65 |
+
preg_match_all('/[a-z0-9]+/si', strtolower($extensions), $matches);
|
66 |
+
if (isset($matches[0]) && is_array($matches[0]) && (count($matches[0]) > 0)) {
|
67 |
+
return $matches[0];
|
68 |
+
}
|
69 |
+
return null;
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Parse MIME types string (code + label) with given separator
|
74 |
+
*
|
75 |
+
* @param string $types String to parse
|
76 |
+
* @param string $sep Values separator
|
77 |
+
* @return array|null
|
78 |
+
*/
|
79 |
+
protected function _parseMimeTypesString($types, $sep=',')
|
80 |
+
{
|
81 |
+
// TODO allow to backslash separator ?
|
82 |
+
$types = explode($sep, $types);
|
83 |
+
if (($typesNumber = count($types)) > 1) {
|
84 |
+
$result = array();
|
85 |
+
for ($i=0; $i<$typesNumber-1; $i+=2) {
|
86 |
+
$result[$types[$i]] = $types[$i+1];
|
87 |
+
}
|
88 |
+
return $result;
|
89 |
+
}
|
90 |
+
return null;
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Return attribute's configuration
|
96 |
+
*
|
97 |
+
* @param int $attributeId ID of attribute from which to get config
|
98 |
+
* @param bool $defaultNull Will return null if attribute has no config set, else empty config array
|
99 |
+
* @return null|array
|
100 |
+
*/
|
101 |
+
public function getAttributeConfiguration($attributeId, $defaultNull=false)
|
102 |
+
{
|
103 |
+
if (!array_key_exists($attributeId, $this->_attributesConfigs)) {
|
104 |
+
$config = null;
|
105 |
+
|
106 |
+
foreach ($this->_getSerializedConfig(self::XML_CONFIG_ATTRIBUTES_CONFIGURATIONS) as $attribute) {
|
107 |
+
if ($attribute['attribute_id'] == $attributeId) {
|
108 |
+
// Parse serialized configs
|
109 |
+
$config = $attribute;
|
110 |
+
$config['allowed_mime_types'] = $this->_parseMimeTypesString($attribute['allowed_mime_types']);
|
111 |
+
$config['forbidden_mime_types'] = $this->_parseMimeTypesString($attribute['forbidden_mime_types']);
|
112 |
+
$config['allowed_file_extensions'] = $this->_parseExtensionsString($attribute['allowed_file_extensions']);
|
113 |
+
$config['forbidden_file_extensions'] = $this->_parseExtensionsString($attribute['forbidden_file_extensions']);
|
114 |
+
break;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
if (is_null($config)) {
|
119 |
+
$config = ($defaultNull ? null : array(
|
120 |
+
'attribute_id' => $attributeId,
|
121 |
+
'display_config' => false,
|
122 |
+
'file_save_moment' => $this->getFileSaveMoment(),
|
123 |
+
'file_max_size' => '',
|
124 |
+
'image_only' => false,
|
125 |
+
'image_min_width' => '',
|
126 |
+
'image_max_width' => '',
|
127 |
+
'image_min_height' => '',
|
128 |
+
'image_max_height' => '',
|
129 |
+
'allowed_mime_types' => null,
|
130 |
+
'forbidden_mime_types' => null,
|
131 |
+
'exceptions_handling_mode' => $this->getExceptionsHandlingMode(),
|
132 |
+
'allowed_file_extensions' => null,
|
133 |
+
'forbidden_file_extensions' => null,
|
134 |
+
));
|
135 |
+
}
|
136 |
+
|
137 |
+
$this->_attributesConfigs[$attributeId] = $config;
|
138 |
+
}
|
139 |
+
return $this->_attributesConfigs[$attributeId];
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getAllowMimeHeaderCheck()
|
143 |
+
{
|
144 |
+
return Mage::getStoreConfig(self::XML_CONFIG_ALLOW_MIME_HEADER_CHECK);
|
145 |
+
}
|
146 |
+
}
|
app/code/community/Telemantis/FileAttributes/Helper/Data.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Helper_Data
|
17 |
+
extends Mage_Core_Helper_Abstract
|
18 |
+
{
|
19 |
+
public function getFileAttributesCollection()
|
20 |
+
{
|
21 |
+
return Mage::getModel('eav/entity_attribute')
|
22 |
+
->getCollection()
|
23 |
+
->addFieldToFilter('backend_model', 'fileattributes/attribute_backend_file');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Return file's full URL
|
28 |
+
*
|
29 |
+
* @param string $file File name
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function getFileUrl($file)
|
33 |
+
{
|
34 |
+
return Mage::getModel('fileattributes/attribute_backend_file')->getFileUrl($file);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Return an entity's file full URL
|
39 |
+
*
|
40 |
+
* @param Varien_Object $entity Entity owning the file
|
41 |
+
* @param string $attribute Code of the attribute corresponding to the file
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function getEntityFileUrl($entity, $attributeCode)
|
45 |
+
{
|
46 |
+
if ($file = $entity->getDataUsingMethod($attributeCode)) {
|
47 |
+
return $this->getFileUrl($file);
|
48 |
+
}
|
49 |
+
return false;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Return a file size which is suitable for display
|
54 |
+
*
|
55 |
+
* @param int $size File size in bytes
|
56 |
+
* @param bool $roundTo Whether to round size value when it is converted to higher units
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function getFileSizeForDisplay($size, $roundTo=null)
|
60 |
+
{
|
61 |
+
$units = array('bytes', 'kb', 'mb', 'gb');
|
62 |
+
$unitsNumber = count($units);
|
63 |
+
$i = 0;
|
64 |
+
while (($i++ < $unitsNumber) && ($size > 1024)) $size /= 1024;
|
65 |
+
return $this->__('%s '.$units[$i-1], (!is_null($roundTo) ? round($size, $roundTo) : $size));
|
66 |
+
}
|
67 |
+
|
68 |
+
public function decodeFileName($file)
|
69 |
+
{
|
70 |
+
return base64_decode($file);
|
71 |
+
}
|
72 |
+
|
73 |
+
public function encodeFileName($file)
|
74 |
+
{
|
75 |
+
return base64_encode($file);
|
76 |
+
}
|
77 |
+
}
|
app/code/community/Telemantis/FileAttributes/Helper/Data.php~
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Helper_Data
|
17 |
+
extends Mage_Core_Helper_Abstract
|
18 |
+
{
|
19 |
+
public function getFileAttributesCollection()
|
20 |
+
{
|
21 |
+
return Mage::getModel('eav/entity_attribute')
|
22 |
+
->getCollection()
|
23 |
+
->addFieldToFilter('backend_model', 'fileattributes/attribute_backend_file');
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Return file's full URL
|
28 |
+
*
|
29 |
+
* @param string $file File name
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function getFileUrl($file)
|
33 |
+
{
|
34 |
+
return Mage::getModel('fileattributes/attribute_backend_file')->getFileUrl($file);
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Return an entity's file full URL
|
39 |
+
*
|
40 |
+
* @param Varien_Object $entity Entity owning the file
|
41 |
+
* @param string $attribute Code of the attribute corresponding to the file
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
public function getEntityFileUrl($entity, $attributeCode)
|
45 |
+
{
|
46 |
+
if ($file = $entity->getDataUsingMethod($attributeCode)) {
|
47 |
+
return $this->getFileUrl($file);
|
48 |
+
}
|
49 |
+
return false;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Return a file size which is suitable for display
|
54 |
+
*
|
55 |
+
* @param int $size File size in bytes
|
56 |
+
* @param bool $roundTo Whether to round size value when it is converted to higher units
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function getFileSizeForDisplay($size, $roundTo=null)
|
60 |
+
{
|
61 |
+
$units = array('bytes', 'kb', 'mb', 'gb');
|
62 |
+
$unitsNumber = count($units);
|
63 |
+
$i = 0;
|
64 |
+
while (($i++ < $unitsNumber) && ($size > 1024)) $size /= 1024;
|
65 |
+
return $this->__('%s '.$units[$i-1], (!is_null($roundTo) ? round($size, $roundTo) : $size));
|
66 |
+
}
|
67 |
+
|
68 |
+
public function decodeFileName($file)
|
69 |
+
{
|
70 |
+
return base64_decode($file);
|
71 |
+
}
|
72 |
+
|
73 |
+
public function encodeFileName($file)
|
74 |
+
{
|
75 |
+
return base64_encode($file);
|
76 |
+
}
|
77 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Attribute/Backend/File.php
ADDED
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Attribute_Backend_File
|
17 |
+
extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
|
18 |
+
{
|
19 |
+
const EXCEPTIONS_HANDLING_MODE_IGNORE = 'ignore';
|
20 |
+
const EXCEPTIONS_HANDLING_MODE_THROW = 'throw';
|
21 |
+
const EXCEPTIONS_HANDLING_MODE_LOG = 'log';
|
22 |
+
|
23 |
+
const FILE_SAVE_MOMENT_BEFORE_ENTITY_SAVE = 'before';
|
24 |
+
const FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE = 'after';
|
25 |
+
|
26 |
+
protected $_pendingSaveObject = null;
|
27 |
+
protected $_pendingSaveValue = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Delete a previously uploaded file
|
31 |
+
*
|
32 |
+
* @param string $fileName Name of the file to delete
|
33 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
34 |
+
*/
|
35 |
+
protected function _deleteFile($fileName)
|
36 |
+
{
|
37 |
+
$io = new Varien_Io_File();
|
38 |
+
$io->rm($this->getFileDir($fileName, false));
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Delete a previously uploaded file (wrapper for _deleteFile)
|
44 |
+
*
|
45 |
+
* @param string $fileName Name of the file to delete
|
46 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
47 |
+
*/
|
48 |
+
public function deleteFile($fileName)
|
49 |
+
{
|
50 |
+
return $this->_deleteFile($fileName);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Main destination directory
|
55 |
+
*
|
56 |
+
* @param boolean $relative If true, returns relative path to the webroot
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function getTargetDir($relative=false)
|
60 |
+
{
|
61 |
+
$fullPath = rtrim(Mage::getBaseDir('media'), DS) . DS . 'blfa_files';
|
62 |
+
return ($relative ? str_replace(Mage::getBaseDir(), '', $fullPath) : $fullPath);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Main destination URL
|
67 |
+
*
|
68 |
+
* @param boolean $relative If true, returns relative url to the webroot
|
69 |
+
* @param boolean $secure If true, returns secure URL
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
public function getTargetUrl($relative=false, $secure=null)
|
73 |
+
{
|
74 |
+
$fullUrl = rtrim(Mage::getBaseUrl('media'), '/') . '/blfa_files';
|
75 |
+
return ($relative ? str_replace(Mage::getBaseUrl(), '', $fullUrl) : $fullUrl);
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* File path
|
80 |
+
*
|
81 |
+
* @param string $fileName File name
|
82 |
+
* @param bool $relative If true, returns relative path to the webroot
|
83 |
+
* @return string
|
84 |
+
*/
|
85 |
+
public function getFileDir($fileName, $relative=false)
|
86 |
+
{
|
87 |
+
return $this->getTargetDir($relative) . DS . $fileName;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* File URL
|
92 |
+
*
|
93 |
+
* @param string $fileName File name
|
94 |
+
* @param boolean $relative If true, returns relative url to the webroot
|
95 |
+
* @param boolean $secure If true, returns secure URL
|
96 |
+
* @return string
|
97 |
+
*/
|
98 |
+
public function getFileUrl($fileName, $relative=false, $secure=null)
|
99 |
+
{
|
100 |
+
return $this->getTargetUrl($relative, $secure) . '/' . $fileName;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Save value for current attribute on given object
|
105 |
+
*
|
106 |
+
* @param Mage_Core_Model_Abstract $object
|
107 |
+
* @param mixed $value
|
108 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
109 |
+
*/
|
110 |
+
protected function _saveObjectAttributeValue($object, $value)
|
111 |
+
{
|
112 |
+
$attribute = $this->getAttribute();
|
113 |
+
$object->setData($attribute->getName(), $value);
|
114 |
+
$attribute->getEntity()->saveAttribute($object, $attribute->getName());
|
115 |
+
return $this;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Save attribute file for given object
|
120 |
+
*
|
121 |
+
* @param Mage_Core_Model_Abstract $object
|
122 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
123 |
+
*/
|
124 |
+
protected function _saveAttributeFile($object)
|
125 |
+
{
|
126 |
+
$helper = Mage::helper('fileattributes');
|
127 |
+
$attribute = $this->getAttribute();
|
128 |
+
$value = $object->getData($attribute->getName());
|
129 |
+
$label = $attribute->getFrontendLabel();
|
130 |
+
$maxFileSize = $this->getUploadMaxFilesize();
|
131 |
+
/*
|
132 |
+
Using enableHeaderCheck() on Zend "mime-type" file validators seems to be not useful,
|
133 |
+
as it checks the type retrieved from Zend_File_Transfer,
|
134 |
+
and Zend_File_Transfer_Adapter_Abstract::_detectMimeType() seems to not be using a different detection
|
135 |
+
than those validators, actually it does just return "application/octet-stream" by default
|
136 |
+
*/
|
137 |
+
//$allowMimeHeaderCheck = Mage::helper('fileattributes/config')->getAllowMimeHeaderCheck();
|
138 |
+
|
139 |
+
if (is_array($value) && !empty($value['delete'])) {
|
140 |
+
// Just reset value, files deletion is accessible from elsewhere
|
141 |
+
if ($object->getId()) {
|
142 |
+
$this->_saveObjectAttributeValue($object, '');
|
143 |
+
} else {
|
144 |
+
$this->_pendingSaveObject = $object;
|
145 |
+
$this->_pendingSaveValue = '';
|
146 |
+
}
|
147 |
+
return $this;
|
148 |
+
}
|
149 |
+
|
150 |
+
$upload = new Zend_File_Transfer_Adapter_Http();
|
151 |
+
$file = $attribute->getName();
|
152 |
+
|
153 |
+
try {
|
154 |
+
$origData = $object->getOrigData();
|
155 |
+
$origFile = (isset($origData[$file]) ? $origData[$file] : null);
|
156 |
+
$newFile = (is_array($value) ? $value['value'] : $value);
|
157 |
+
|
158 |
+
if (!$upload->isUploaded($file)
|
159 |
+
&& (!$attribute->getIsRequired() || ($newFile == $origFile))) {
|
160 |
+
// No need to go further
|
161 |
+
return $this;
|
162 |
+
}
|
163 |
+
|
164 |
+
$fileInfo = $upload->getFileInfo($file);
|
165 |
+
$fileInfo = $fileInfo[$file];
|
166 |
+
$fileInfo['title'] = $fileInfo['name'];
|
167 |
+
} catch (Exception $e) {
|
168 |
+
// Upload error
|
169 |
+
if (isset($_SERVER['CONTENT_LENGTH']) && ($_SERVER['CONTENT_LENGTH'] < $maxFileSize)) {
|
170 |
+
$size = Mage::helper('fileattributes')->getFileSizeForDisplay($maxFileSize, 2);
|
171 |
+
Mage::throwException($helper->__('The file you uploaded for "%s" attribute is larger than the %s allowed by server', $label, $size));
|
172 |
+
} else {
|
173 |
+
Mage::throwException($helper->__('An error occured during file upload for "%s" attribute', $label));
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
$config = Mage::helper('fileattributes/config')->getAttributeConfiguration($attribute->getId());
|
178 |
+
|
179 |
+
// Validation for MIME types
|
180 |
+
if (isset($config['allowed_mime_types'])
|
181 |
+
&& is_array($validate = $config['allowed_mime_types'])) {
|
182 |
+
$upload->addValidator('MimeType', false, array_keys($validate));
|
183 |
+
//$upload->getValidator('MimeType')->enableHeaderCheck($allowMimeHeaderCheck);
|
184 |
+
} elseif (isset($config['forbidden_mime_types'])
|
185 |
+
&& is_array($validate = $config['forbidden_mime_types'])) {
|
186 |
+
$upload->addValidator('ExcludeMimeType', false, array_keys($validate));
|
187 |
+
//$upload->getValidator('ExcludeMimeType')->enableHeaderCheck($allowMimeHeaderCheck);
|
188 |
+
}
|
189 |
+
|
190 |
+
// Validation for image-only flag
|
191 |
+
if (isset($config['image_only']) && $config['image_only']) {
|
192 |
+
$upload->addValidator('IsImage', false);
|
193 |
+
//$upload->getValidator('IsImage')->enableHeaderCheck($allowMimeHeaderCheck);
|
194 |
+
}
|
195 |
+
|
196 |
+
// Validation for image dimensions
|
197 |
+
$validate = array();
|
198 |
+
if ($config['image_min_width'] > 0) {
|
199 |
+
$validate['minwidth'] = $config['image_min_width'];
|
200 |
+
}
|
201 |
+
if ($config['image_max_width'] > 0) {
|
202 |
+
$validate['maxwidth'] = $config['image_max_width'];
|
203 |
+
}
|
204 |
+
if ($config['image_min_height'] > 0) {
|
205 |
+
$validate['minheight'] = $config['image_min_height'];
|
206 |
+
}
|
207 |
+
if ($config['image_max_height'] > 0) {
|
208 |
+
$validate['maxheight'] = $config['image_max_height'];
|
209 |
+
}
|
210 |
+
if (count($validate) > 0) {
|
211 |
+
$upload->addValidator('ImageSize', false, $validate);
|
212 |
+
}
|
213 |
+
|
214 |
+
// Validation for file extensions
|
215 |
+
if (isset($config['allowed_file_extensions'])
|
216 |
+
&& is_array($validate = $config['allowed_file_extensions'])) {
|
217 |
+
$upload->addValidator('Extension', false, $validate);
|
218 |
+
} elseif (isset($config['forbidden_file_extensions'])
|
219 |
+
&& is_array($validate = $config['forbidden_file_extensions'])) {
|
220 |
+
$upload->addValidator('ExcludeExtension', false, $validate);
|
221 |
+
}
|
222 |
+
|
223 |
+
// Validation for maximum filesize (take the smallest between config and server ones)
|
224 |
+
$validate = ($config['file_max_size'] > 0 ? min($config['file_max_size'], $maxFileSize) : $maxFileSize);
|
225 |
+
$upload->addValidator('FilesSize', false, array('max' => $validate));
|
226 |
+
|
227 |
+
// Let's upload (if possible) !
|
228 |
+
if ($upload->isUploaded($file) && $upload->isValid($file)) {
|
229 |
+
try {
|
230 |
+
$uploader = new Varien_File_Uploader($attribute->getName());
|
231 |
+
$uploader->setAllowCreateFolders(true)
|
232 |
+
->setAllowRenameFiles(true)
|
233 |
+
->setFilesDispersion(false);
|
234 |
+
|
235 |
+
if (!$uploader->save($this->getTargetDir())) {
|
236 |
+
Mage::throwException($helper->__('File "%s" upload failed for "%s" attribute', $fileInfo['name'], $label));
|
237 |
+
}
|
238 |
+
|
239 |
+
if ($object->getId()) {
|
240 |
+
$this->_saveObjectAttributeValue($object, $uploader->getUploadedFileName());
|
241 |
+
} else {
|
242 |
+
$this->_pendingSaveObject = $object;
|
243 |
+
$this->_pendingSaveValue = $uploader->getUploadedFileName();
|
244 |
+
}
|
245 |
+
} catch (Exception $e) {
|
246 |
+
Mage::throwException($helper->__('An error occured during file "%s" upload for "%s" attribute : "%s"', $fileInfo['name'], $label, $e->getMessage()));
|
247 |
+
}
|
248 |
+
} elseif (($errors = $upload->getErrors())
|
249 |
+
&& ($errors = $this->_parseValidatorErrors($errors, $fileInfo, $label))
|
250 |
+
&& (count($errors) > 0)) {
|
251 |
+
// Known upload error(s)
|
252 |
+
Mage::throwException(implode("<br />", $errors));
|
253 |
+
} else {
|
254 |
+
// Unknown or not handled upload error
|
255 |
+
Mage::throwException($helper->__('You must upload a valid file for "%s" attribute', $label));
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Handle attribute file action callback
|
261 |
+
*
|
262 |
+
* @param callback $callback
|
263 |
+
* @param array $params
|
264 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
265 |
+
*/
|
266 |
+
protected function _handleAttributeFileAction($callback, array $params=array())
|
267 |
+
{
|
268 |
+
try {
|
269 |
+
call_user_func_array($callback, $params);
|
270 |
+
} catch (Exception $e) {
|
271 |
+
$config = Mage::helper('fileattributes/config')
|
272 |
+
->getAttributeConfiguration($this->getAttribute()->getId());
|
273 |
+
|
274 |
+
if (isset($config['exceptions_handling_mode'])) {
|
275 |
+
if ($config['exceptions_handling_mode'] == self::EXCEPTIONS_HANDLING_MODE_THROW) {
|
276 |
+
Mage::throwException($e->getMessage());
|
277 |
+
} elseif ($config['exceptions_handling_mode'] == self::EXCEPTIONS_HANDLING_MODE_LOG) {
|
278 |
+
Mage::logException($e);
|
279 |
+
} // Else ignore mode
|
280 |
+
} else {
|
281 |
+
Mage::logException($e);
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Before save attribute manipulation
|
288 |
+
*
|
289 |
+
* @param Mage_Core_Model_Abstract $object
|
290 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
291 |
+
*/
|
292 |
+
public function beforeSave($object)
|
293 |
+
{
|
294 |
+
$config = Mage::helper('fileattributes/config')
|
295 |
+
->getAttributeConfiguration($this->getAttribute()->getId());
|
296 |
+
|
297 |
+
if (isset($config['file_save_moment'])
|
298 |
+
&& ($config['file_save_moment'] == self::FILE_SAVE_MOMENT_BEFORE_ENTITY_SAVE)) {
|
299 |
+
$this->_handleAttributeFileAction(array($this, '_saveAttributeFile'), array($object));
|
300 |
+
}
|
301 |
+
|
302 |
+
return $this;
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* After save attribute manipulation
|
307 |
+
*
|
308 |
+
* @param Mage_Core_Model_Abstract $object
|
309 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
310 |
+
*/
|
311 |
+
public function afterSave($object)
|
312 |
+
{
|
313 |
+
$config = Mage::helper('fileattributes/config')
|
314 |
+
->getAttributeConfiguration($this->getAttribute()->getId());
|
315 |
+
|
316 |
+
if (isset($config['file_save_moment'])
|
317 |
+
&& ($config['file_save_moment'] == self::FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE)) {
|
318 |
+
$this->_handleAttributeFileAction(array($this, '_saveAttributeFile'), array($object));
|
319 |
+
}
|
320 |
+
|
321 |
+
if (!is_null($this->_pendingSaveObject)
|
322 |
+
&& ($this->_pendingSaveObject == $object)) {
|
323 |
+
$this->_pendingSaveObject = null;
|
324 |
+
$value = $this->_pendingSaveValue;
|
325 |
+
$this->_pendingSaveValue = null;
|
326 |
+
$this->_handleAttributeFileAction(array($this, '_saveObjectAttributeValue'), array($object, $value));
|
327 |
+
}
|
328 |
+
|
329 |
+
return $this;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Parse error messages from upload validator errors
|
334 |
+
*
|
335 |
+
* @param array $errors Validation failure message codes
|
336 |
+
* @param array $fileInfo File info
|
337 |
+
* @return array Error messages
|
338 |
+
*/
|
339 |
+
protected function _parseValidatorErrors($errors, $fileInfo, $label)
|
340 |
+
{
|
341 |
+
$messages = array();
|
342 |
+
$helper = Mage::helper('fileattributes');
|
343 |
+
|
344 |
+
foreach ($errors as $errorCode) {
|
345 |
+
if (($errorCode == Zend_Validate_File_Extension::FALSE_EXTENSION)
|
346 |
+
|| ($errorCode == Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION)) {
|
347 |
+
// Invalid file extension
|
348 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute has an invalid extension', $fileInfo['name'], $label);
|
349 |
+
} elseif (($errorCode == Zend_Validate_File_MimeType::FALSE_TYPE)
|
350 |
+
|| ($errorCode == Zend_Validate_File_ExcludeMimeType::FALSE_TYPE)) {
|
351 |
+
// Invalid file type
|
352 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute is of an invalid type', $fileInfo['name'], $label);
|
353 |
+
} elseif ($errorCode == Zend_Validate_File_IsImage::FALSE_TYPE) {
|
354 |
+
// Invalid image
|
355 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute is not an image', $fileInfo['name'], $label);
|
356 |
+
} elseif (($errorCode == Zend_Validate_File_ImageSize::WIDTH_TOO_BIG)
|
357 |
+
|| ($errorCode == Zend_Validate_File_ImageSize::HEIGHT_TOO_BIG)) {
|
358 |
+
// Too large images dimensions
|
359 |
+
$messages[] = $helper->__('The dimensions of the image "%s" you uploaded for "%s" attribute exceed ones allowed by configuration', $fileInfo['name'], $label);
|
360 |
+
} elseif (($errorCode == Zend_Validate_File_ImageSize::WIDTH_TOO_SMALL)
|
361 |
+
|| ($errorCode == Zend_Validate_File_ImageSize::HEIGHT_TOO_SMALL)) {
|
362 |
+
// Too small images dimensions
|
363 |
+
$messages[] = $helper->__('The dimensions of the image "%s" you uploaded for "%s" attribute are smaller than ones required by configuration', $fileInfo['name'], $label);
|
364 |
+
} elseif (($errorCode == Zend_Validate_File_FilesSize::TOO_BIG)
|
365 |
+
|| ($errorCode == Zend_Validate_File_Upload::INI_SIZE)) {
|
366 |
+
// Wrong file size
|
367 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute has a larger size than the one allowed by server or configuration', $fileInfo['name'], $label);
|
368 |
+
} elseif (($errorCode == Zend_Validate_File_MimeType::NOT_DETECTED)
|
369 |
+
|| ($errorCode == Zend_Validate_File_ExcludeMimeType::NOT_DETECTED)
|
370 |
+
|| ($errorCode == Zend_Validate_File_IsImage::NOT_DETECTED)) {
|
371 |
+
// MIME type not detected
|
372 |
+
$messages[] = $helper->__('The MIME type of the file "%s" you uploaded for "%s" attribute could not be detected', $fileInfo['name'], $label);
|
373 |
+
}// TODO handle other error codes ?
|
374 |
+
}
|
375 |
+
|
376 |
+
return array_unique($messages);
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Return max upload filesize in bytes
|
381 |
+
*
|
382 |
+
* @return int
|
383 |
+
*/
|
384 |
+
public function getUploadMaxFilesize()
|
385 |
+
{
|
386 |
+
return min($this->_getBytesIniValue('upload_max_filesize'), $this->_getBytesIniValue('post_max_size'));
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Return php.ini setting value in bytes
|
391 |
+
*
|
392 |
+
* @param string $iniKey Var name to look for in php.ini
|
393 |
+
* @return int Setting value
|
394 |
+
*/
|
395 |
+
protected function _getBytesIniValue($iniKey)
|
396 |
+
{
|
397 |
+
$bytes = @ini_get($iniKey);
|
398 |
+
|
399 |
+
// Kilobytes
|
400 |
+
if (stristr($bytes, 'k')) {
|
401 |
+
$bytes = intval($bytes) * 1024;
|
402 |
+
// Megabytes
|
403 |
+
} elseif (stristr($bytes, 'm')) {
|
404 |
+
$bytes = intval($bytes) * 1024 * 1024;
|
405 |
+
// Gigabytes
|
406 |
+
} elseif (stristr($bytes, 'g')) {
|
407 |
+
$bytes = intval($bytes) * 1024 * 1024 * 1024;
|
408 |
+
}
|
409 |
+
|
410 |
+
return (int)$bytes;
|
411 |
+
}
|
412 |
+
|
413 |
+
static public function getExceptionsHandlingModesAsOptionArray()
|
414 |
+
{
|
415 |
+
$helper = Mage::helper('fileattributes');
|
416 |
+
return array(
|
417 |
+
array(
|
418 |
+
'value' => self::EXCEPTIONS_HANDLING_MODE_THROW,
|
419 |
+
'label' => $helper->__('Throw'),
|
420 |
+
),
|
421 |
+
array(
|
422 |
+
'value' => self::EXCEPTIONS_HANDLING_MODE_LOG,
|
423 |
+
'label' => $helper->__('Log'),
|
424 |
+
),
|
425 |
+
array(
|
426 |
+
'value' => self::EXCEPTIONS_HANDLING_MODE_IGNORE,
|
427 |
+
'label' => $helper->__('Ignore'),
|
428 |
+
),
|
429 |
+
);
|
430 |
+
}
|
431 |
+
|
432 |
+
static public function getFileSaveMomentsAsOptionArray()
|
433 |
+
{
|
434 |
+
$helper = Mage::helper('fileattributes');
|
435 |
+
return array(
|
436 |
+
array(
|
437 |
+
'value' => self::FILE_SAVE_MOMENT_BEFORE_ENTITY_SAVE,
|
438 |
+
'label' => $helper->__('Before Entity Save'),
|
439 |
+
),
|
440 |
+
array(
|
441 |
+
'value' => self::FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE,
|
442 |
+
'label' => $helper->__('After Entity Save'),
|
443 |
+
),
|
444 |
+
);
|
445 |
+
}
|
446 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Attribute/Backend/File.php~
ADDED
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Attribute_Backend_File
|
17 |
+
extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
|
18 |
+
{
|
19 |
+
const EXCEPTIONS_HANDLING_MODE_IGNORE = 'ignore';
|
20 |
+
const EXCEPTIONS_HANDLING_MODE_THROW = 'throw';
|
21 |
+
const EXCEPTIONS_HANDLING_MODE_LOG = 'log';
|
22 |
+
|
23 |
+
const FILE_SAVE_MOMENT_BEFORE_ENTITY_SAVE = 'before';
|
24 |
+
const FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE = 'after';
|
25 |
+
|
26 |
+
protected $_pendingSaveObject = null;
|
27 |
+
protected $_pendingSaveValue = null;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Delete a previously uploaded file
|
31 |
+
*
|
32 |
+
* @param string $fileName Name of the file to delete
|
33 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
34 |
+
*/
|
35 |
+
protected function _deleteFile($fileName)
|
36 |
+
{
|
37 |
+
$io = new Varien_Io_File();
|
38 |
+
$io->rm($this->getFileDir($fileName, false));
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Delete a previously uploaded file (wrapper for _deleteFile)
|
44 |
+
*
|
45 |
+
* @param string $fileName Name of the file to delete
|
46 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
47 |
+
*/
|
48 |
+
public function deleteFile($fileName)
|
49 |
+
{
|
50 |
+
return $this->_deleteFile($fileName);
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Main destination directory
|
55 |
+
*
|
56 |
+
* @param boolean $relative If true, returns relative path to the webroot
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function getTargetDir($relative=false)
|
60 |
+
{
|
61 |
+
$fullPath = rtrim(Mage::getBaseDir('media'), DS) . DS . 'blfa_files';
|
62 |
+
return ($relative ? str_replace(Mage::getBaseDir(), '', $fullPath) : $fullPath);
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Main destination URL
|
67 |
+
*
|
68 |
+
* @param boolean $relative If true, returns relative url to the webroot
|
69 |
+
* @param boolean $secure If true, returns secure URL
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
public function getTargetUrl($relative=false, $secure=null)
|
73 |
+
{
|
74 |
+
$fullUrl = rtrim(Mage::getBaseUrl('media'), '/') . '/blfa_files';
|
75 |
+
return ($relative ? str_replace(Mage::getBaseUrl(), '', $fullUrl) : $fullUrl);
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* File path
|
80 |
+
*
|
81 |
+
* @param string $fileName File name
|
82 |
+
* @param bool $relative If true, returns relative path to the webroot
|
83 |
+
* @return string
|
84 |
+
*/
|
85 |
+
public function getFileDir($fileName, $relative=false)
|
86 |
+
{
|
87 |
+
return $this->getTargetDir($relative) . DS . $fileName;
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* File URL
|
92 |
+
*
|
93 |
+
* @param string $fileName File name
|
94 |
+
* @param boolean $relative If true, returns relative url to the webroot
|
95 |
+
* @param boolean $secure If true, returns secure URL
|
96 |
+
* @return string
|
97 |
+
*/
|
98 |
+
public function getFileUrl($fileName, $relative=false, $secure=null)
|
99 |
+
{
|
100 |
+
return $this->getTargetUrl($relative, $secure) . '/' . $fileName;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Save value for current attribute on given object
|
105 |
+
*
|
106 |
+
* @param Mage_Core_Model_Abstract $object
|
107 |
+
* @param mixed $value
|
108 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
109 |
+
*/
|
110 |
+
protected function _saveObjectAttributeValue($object, $value)
|
111 |
+
{
|
112 |
+
$attribute = $this->getAttribute();
|
113 |
+
$object->setData($attribute->getName(), $value);
|
114 |
+
$attribute->getEntity()->saveAttribute($object, $attribute->getName());
|
115 |
+
return $this;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Save attribute file for given object
|
120 |
+
*
|
121 |
+
* @param Mage_Core_Model_Abstract $object
|
122 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
123 |
+
*/
|
124 |
+
protected function _saveAttributeFile($object)
|
125 |
+
{
|
126 |
+
$helper = Mage::helper('fileattributes');
|
127 |
+
$attribute = $this->getAttribute();
|
128 |
+
$value = $object->getData($attribute->getName());
|
129 |
+
$label = $attribute->getFrontendLabel();
|
130 |
+
$maxFileSize = $this->getUploadMaxFilesize();
|
131 |
+
/*
|
132 |
+
Using enableHeaderCheck() on Zend "mime-type" file validators seems to be not useful,
|
133 |
+
as it checks the type retrieved from Zend_File_Transfer,
|
134 |
+
and Zend_File_Transfer_Adapter_Abstract::_detectMimeType() seems to not be using a different detection
|
135 |
+
than those validators, actually it does just return "application/octet-stream" by default
|
136 |
+
*/
|
137 |
+
//$allowMimeHeaderCheck = Mage::helper('fileattributes/config')->getAllowMimeHeaderCheck();
|
138 |
+
|
139 |
+
if (is_array($value) && !empty($value['delete'])) {
|
140 |
+
// Just reset value, files deletion is accessible from elsewhere
|
141 |
+
if ($object->getId()) {
|
142 |
+
$this->_saveObjectAttributeValue($object, '');
|
143 |
+
} else {
|
144 |
+
$this->_pendingSaveObject = $object;
|
145 |
+
$this->_pendingSaveValue = '';
|
146 |
+
}
|
147 |
+
return $this;
|
148 |
+
}
|
149 |
+
|
150 |
+
$upload = new Zend_File_Transfer_Adapter_Http();
|
151 |
+
$file = $attribute->getName();
|
152 |
+
|
153 |
+
try {
|
154 |
+
$origData = $object->getOrigData();
|
155 |
+
$origFile = (isset($origData[$file]) ? $origData[$file] : null);
|
156 |
+
$newFile = (is_array($value) ? $value['value'] : $value);
|
157 |
+
|
158 |
+
if (!$upload->isUploaded($file)
|
159 |
+
&& (!$attribute->getIsRequired() || ($newFile == $origFile))) {
|
160 |
+
// No need to go further
|
161 |
+
return $this;
|
162 |
+
}
|
163 |
+
|
164 |
+
$fileInfo = $upload->getFileInfo($file);
|
165 |
+
$fileInfo = $fileInfo[$file];
|
166 |
+
$fileInfo['title'] = $fileInfo['name'];
|
167 |
+
} catch (Exception $e) {
|
168 |
+
// Upload error
|
169 |
+
if (isset($_SERVER['CONTENT_LENGTH']) && ($_SERVER['CONTENT_LENGTH'] < $maxFileSize)) {
|
170 |
+
$size = Mage::helper('fileattributes')->getFileSizeForDisplay($maxFileSize, 2);
|
171 |
+
Mage::throwException($helper->__('The file you uploaded for "%s" attribute is larger than the %s allowed by server', $label, $size));
|
172 |
+
} else {
|
173 |
+
Mage::throwException($helper->__('An error occured during file upload for "%s" attribute', $label));
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
$config = Mage::helper('fileattributes/config')->getAttributeConfiguration($attribute->getId());
|
178 |
+
|
179 |
+
// Validation for MIME types
|
180 |
+
if (isset($config['allowed_mime_types'])
|
181 |
+
&& is_array($validate = $config['allowed_mime_types'])) {
|
182 |
+
$upload->addValidator('MimeType', false, array_keys($validate));
|
183 |
+
//$upload->getValidator('MimeType')->enableHeaderCheck($allowMimeHeaderCheck);
|
184 |
+
} elseif (isset($config['forbidden_mime_types'])
|
185 |
+
&& is_array($validate = $config['forbidden_mime_types'])) {
|
186 |
+
$upload->addValidator('ExcludeMimeType', false, array_keys($validate));
|
187 |
+
//$upload->getValidator('ExcludeMimeType')->enableHeaderCheck($allowMimeHeaderCheck);
|
188 |
+
}
|
189 |
+
|
190 |
+
// Validation for image-only flag
|
191 |
+
if (isset($config['image_only']) && $config['image_only']) {
|
192 |
+
$upload->addValidator('IsImage', false);
|
193 |
+
//$upload->getValidator('IsImage')->enableHeaderCheck($allowMimeHeaderCheck);
|
194 |
+
}
|
195 |
+
|
196 |
+
// Validation for image dimensions
|
197 |
+
$validate = array();
|
198 |
+
if ($config['image_min_width'] > 0) {
|
199 |
+
$validate['minwidth'] = $config['image_min_width'];
|
200 |
+
}
|
201 |
+
if ($config['image_max_width'] > 0) {
|
202 |
+
$validate['maxwidth'] = $config['image_max_width'];
|
203 |
+
}
|
204 |
+
if ($config['image_min_height'] > 0) {
|
205 |
+
$validate['minheight'] = $config['image_min_height'];
|
206 |
+
}
|
207 |
+
if ($config['image_max_height'] > 0) {
|
208 |
+
$validate['maxheight'] = $config['image_max_height'];
|
209 |
+
}
|
210 |
+
if (count($validate) > 0) {
|
211 |
+
$upload->addValidator('ImageSize', false, $validate);
|
212 |
+
}
|
213 |
+
|
214 |
+
// Validation for file extensions
|
215 |
+
if (isset($config['allowed_file_extensions'])
|
216 |
+
&& is_array($validate = $config['allowed_file_extensions'])) {
|
217 |
+
$upload->addValidator('Extension', false, $validate);
|
218 |
+
} elseif (isset($config['forbidden_file_extensions'])
|
219 |
+
&& is_array($validate = $config['forbidden_file_extensions'])) {
|
220 |
+
$upload->addValidator('ExcludeExtension', false, $validate);
|
221 |
+
}
|
222 |
+
|
223 |
+
// Validation for maximum filesize (take the smallest between config and server ones)
|
224 |
+
$validate = ($config['file_max_size'] > 0 ? min($config['file_max_size'], $maxFileSize) : $maxFileSize);
|
225 |
+
$upload->addValidator('FilesSize', false, array('max' => $validate));
|
226 |
+
|
227 |
+
// Let's upload (if possible) !
|
228 |
+
if ($upload->isUploaded($file) && $upload->isValid($file)) {
|
229 |
+
try {
|
230 |
+
$uploader = new Varien_File_Uploader($attribute->getName());
|
231 |
+
$uploader->setAllowCreateFolders(true)
|
232 |
+
->setAllowRenameFiles(true)
|
233 |
+
->setFilesDispersion(false);
|
234 |
+
|
235 |
+
if (!$uploader->save($this->getTargetDir())) {
|
236 |
+
Mage::throwException($helper->__('File "%s" upload failed for "%s" attribute', $fileInfo['name'], $label));
|
237 |
+
}
|
238 |
+
|
239 |
+
if ($object->getId()) {
|
240 |
+
$this->_saveObjectAttributeValue($object, $uploader->getUploadedFileName());
|
241 |
+
} else {
|
242 |
+
$this->_pendingSaveObject = $object;
|
243 |
+
$this->_pendingSaveValue = $uploader->getUploadedFileName();
|
244 |
+
}
|
245 |
+
} catch (Exception $e) {
|
246 |
+
Mage::throwException($helper->__('An error occured during file "%s" upload for "%s" attribute : "%s"', $fileInfo['name'], $label, $e->getMessage()));
|
247 |
+
}
|
248 |
+
} elseif (($errors = $upload->getErrors())
|
249 |
+
&& ($errors = $this->_parseValidatorErrors($errors, $fileInfo, $label))
|
250 |
+
&& (count($errors) > 0)) {
|
251 |
+
// Known upload error(s)
|
252 |
+
Mage::throwException(implode("<br />", $errors));
|
253 |
+
} else {
|
254 |
+
// Unknown or not handled upload error
|
255 |
+
Mage::throwException($helper->__('You must upload a valid file for "%s" attribute', $label));
|
256 |
+
}
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Handle attribute file action callback
|
261 |
+
*
|
262 |
+
* @param callback $callback
|
263 |
+
* @param array $params
|
264 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
265 |
+
*/
|
266 |
+
protected function _handleAttributeFileAction($callback, array $params=array())
|
267 |
+
{
|
268 |
+
try {
|
269 |
+
call_user_func_array($callback, $params);
|
270 |
+
} catch (Exception $e) {
|
271 |
+
$config = Mage::helper('fileattributes/config')
|
272 |
+
->getAttributeConfiguration($this->getAttribute()->getId());
|
273 |
+
|
274 |
+
if (isset($config['exceptions_handling_mode'])) {
|
275 |
+
if ($config['exceptions_handling_mode'] == self::EXCEPTIONS_HANDLING_MODE_THROW) {
|
276 |
+
Mage::throwException($e->getMessage());
|
277 |
+
} elseif ($config['exceptions_handling_mode'] == self::EXCEPTIONS_HANDLING_MODE_LOG) {
|
278 |
+
Mage::logException($e);
|
279 |
+
} // Else ignore mode
|
280 |
+
} else {
|
281 |
+
Mage::logException($e);
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Before save attribute manipulation
|
288 |
+
*
|
289 |
+
* @param Mage_Core_Model_Abstract $object
|
290 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
291 |
+
*/
|
292 |
+
public function beforeSave($object)
|
293 |
+
{
|
294 |
+
$config = Mage::helper('fileattributes/config')
|
295 |
+
->getAttributeConfiguration($this->getAttribute()->getId());
|
296 |
+
|
297 |
+
if (isset($config['file_save_moment'])
|
298 |
+
&& ($config['file_save_moment'] == self::FILE_SAVE_MOMENT_BEFORE_ENTITY_SAVE)) {
|
299 |
+
$this->_handleAttributeFileAction(array($this, '_saveAttributeFile'), array($object));
|
300 |
+
}
|
301 |
+
|
302 |
+
return $this;
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* After save attribute manipulation
|
307 |
+
*
|
308 |
+
* @param Mage_Core_Model_Abstract $object
|
309 |
+
* @return Telemantis_FileAttributes_Model_Attribute_Backend_File
|
310 |
+
*/
|
311 |
+
public function afterSave($object)
|
312 |
+
{
|
313 |
+
$config = Mage::helper('fileattributes/config')
|
314 |
+
->getAttributeConfiguration($this->getAttribute()->getId());
|
315 |
+
|
316 |
+
if (isset($config['file_save_moment'])
|
317 |
+
&& ($config['file_save_moment'] == self::FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE)) {
|
318 |
+
$this->_handleAttributeFileAction(array($this, '_saveAttributeFile'), array($object));
|
319 |
+
}
|
320 |
+
|
321 |
+
if (!is_null($this->_pendingSaveObject)
|
322 |
+
&& ($this->_pendingSaveObject == $object)) {
|
323 |
+
$this->_pendingSaveObject = null;
|
324 |
+
$value = $this->_pendingSaveValue;
|
325 |
+
$this->_pendingSaveValue = null;
|
326 |
+
$this->_handleAttributeFileAction(array($this, '_saveObjectAttributeValue'), array($object, $value));
|
327 |
+
}
|
328 |
+
|
329 |
+
return $this;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Parse error messages from upload validator errors
|
334 |
+
*
|
335 |
+
* @param array $errors Validation failure message codes
|
336 |
+
* @param array $fileInfo File info
|
337 |
+
* @return array Error messages
|
338 |
+
*/
|
339 |
+
protected function _parseValidatorErrors($errors, $fileInfo, $label)
|
340 |
+
{
|
341 |
+
$messages = array();
|
342 |
+
$helper = Mage::helper('fileattributes');
|
343 |
+
|
344 |
+
foreach ($errors as $errorCode) {
|
345 |
+
if (($errorCode == Zend_Validate_File_Extension::FALSE_EXTENSION)
|
346 |
+
|| ($errorCode == Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION)) {
|
347 |
+
// Invalid file extension
|
348 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute has an invalid extension', $fileInfo['name'], $label);
|
349 |
+
} elseif (($errorCode == Zend_Validate_File_MimeType::FALSE_TYPE)
|
350 |
+
|| ($errorCode == Zend_Validate_File_ExcludeMimeType::FALSE_TYPE)) {
|
351 |
+
// Invalid file type
|
352 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute is of an invalid type', $fileInfo['name'], $label);
|
353 |
+
} elseif ($errorCode == Zend_Validate_File_IsImage::FALSE_TYPE) {
|
354 |
+
// Invalid image
|
355 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute is not an image', $fileInfo['name'], $label);
|
356 |
+
} elseif (($errorCode == Zend_Validate_File_ImageSize::WIDTH_TOO_BIG)
|
357 |
+
|| ($errorCode == Zend_Validate_File_ImageSize::HEIGHT_TOO_BIG)) {
|
358 |
+
// Too large images dimensions
|
359 |
+
$messages[] = $helper->__('The dimensions of the image "%s" you uploaded for "%s" attribute exceed ones allowed by configuration', $fileInfo['name'], $label);
|
360 |
+
} elseif (($errorCode == Zend_Validate_File_ImageSize::WIDTH_TOO_SMALL)
|
361 |
+
|| ($errorCode == Zend_Validate_File_ImageSize::HEIGHT_TOO_SMALL)) {
|
362 |
+
// Too small images dimensions
|
363 |
+
$messages[] = $helper->__('The dimensions of the image "%s" you uploaded for "%s" attribute are smaller than ones required by configuration', $fileInfo['name'], $label);
|
364 |
+
} elseif (($errorCode == Zend_Validate_File_FilesSize::TOO_BIG)
|
365 |
+
|| ($errorCode == Zend_Validate_File_Upload::INI_SIZE)) {
|
366 |
+
// Wrong file size
|
367 |
+
$messages[] = $helper->__('The file "%s" you uploaded for "%s" attribute has a larger size than the one allowed by server or configuration', $fileInfo['name'], $label);
|
368 |
+
} elseif (($errorCode == Zend_Validate_File_MimeType::NOT_DETECTED)
|
369 |
+
|| ($errorCode == Zend_Validate_File_ExcludeMimeType::NOT_DETECTED)
|
370 |
+
|| ($errorCode == Zend_Validate_File_IsImage::NOT_DETECTED)) {
|
371 |
+
// MIME type not detected
|
372 |
+
$messages[] = $helper->__('The MIME type of the file "%s" you uploaded for "%s" attribute could not be detected', $fileInfo['name'], $label);
|
373 |
+
}// TODO handle other error codes ?
|
374 |
+
}
|
375 |
+
|
376 |
+
return array_unique($messages);
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Return max upload filesize in bytes
|
381 |
+
*
|
382 |
+
* @return int
|
383 |
+
*/
|
384 |
+
public function getUploadMaxFilesize()
|
385 |
+
{
|
386 |
+
return min($this->_getBytesIniValue('upload_max_filesize'), $this->_getBytesIniValue('post_max_size'));
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Return php.ini setting value in bytes
|
391 |
+
*
|
392 |
+
* @param string $iniKey Var name to look for in php.ini
|
393 |
+
* @return int Setting value
|
394 |
+
*/
|
395 |
+
protected function _getBytesIniValue($iniKey)
|
396 |
+
{
|
397 |
+
$bytes = @ini_get($iniKey);
|
398 |
+
|
399 |
+
// Kilobytes
|
400 |
+
if (stristr($bytes, 'k')) {
|
401 |
+
$bytes = intval($bytes) * 1024;
|
402 |
+
// Megabytes
|
403 |
+
} elseif (stristr($bytes, 'm')) {
|
404 |
+
$bytes = intval($bytes) * 1024 * 1024;
|
405 |
+
// Gigabytes
|
406 |
+
} elseif (stristr($bytes, 'g')) {
|
407 |
+
$bytes = intval($bytes) * 1024 * 1024 * 1024;
|
408 |
+
}
|
409 |
+
|
410 |
+
return (int)$bytes;
|
411 |
+
}
|
412 |
+
|
413 |
+
static public function getExceptionsHandlingModesAsOptionArray()
|
414 |
+
{
|
415 |
+
$helper = Mage::helper('fileattributes');
|
416 |
+
return array(
|
417 |
+
array(
|
418 |
+
'value' => self::EXCEPTIONS_HANDLING_MODE_THROW,
|
419 |
+
'label' => $helper->__('Throw'),
|
420 |
+
),
|
421 |
+
array(
|
422 |
+
'value' => self::EXCEPTIONS_HANDLING_MODE_LOG,
|
423 |
+
'label' => $helper->__('Log'),
|
424 |
+
),
|
425 |
+
array(
|
426 |
+
'value' => self::EXCEPTIONS_HANDLING_MODE_IGNORE,
|
427 |
+
'label' => $helper->__('Ignore'),
|
428 |
+
),
|
429 |
+
);
|
430 |
+
}
|
431 |
+
|
432 |
+
static public function getFileSaveMomentsAsOptionArray()
|
433 |
+
{
|
434 |
+
$helper = Mage::helper('fileattributes');
|
435 |
+
return array(
|
436 |
+
array(
|
437 |
+
'value' => self::FILE_SAVE_MOMENT_BEFORE_ENTITY_SAVE,
|
438 |
+
'label' => $helper->__('Before Entity Save'),
|
439 |
+
),
|
440 |
+
array(
|
441 |
+
'value' => self::FILE_SAVE_MOMENT_AFTER_ENTITY_SAVE,
|
442 |
+
'label' => $helper->__('After Entity Save'),
|
443 |
+
),
|
444 |
+
);
|
445 |
+
}
|
446 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Attribute/Frontend/File.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Attribute_Frontend_File
|
17 |
+
extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Get file attribute's formatted value from an entity
|
21 |
+
*
|
22 |
+
* @param Varien_Object $object Entity owning file value
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
public function getValue(Varien_Object $object)
|
26 |
+
{
|
27 |
+
|
28 |
+
$data = '';
|
29 |
+
if ($value = parent::getValue($object)) {
|
30 |
+
// $data = '<a href="'.Mage::helper('fileattributes')->getFileUrl($value).'" target="_blank">'.$value.'</a>';
|
31 |
+
$data = '<a href="'.Mage::helper('fileattributes')->getFileUrl($value).'" target="_blank">Download</a>';
|
32 |
+
}
|
33 |
+
return $data;
|
34 |
+
}
|
35 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Attribute/Frontend/File.php~
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Attribute_Frontend_File
|
17 |
+
extends Mage_Eav_Model_Entity_Attribute_Frontend_Abstract
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Get file attribute's formatted value from an entity
|
21 |
+
*
|
22 |
+
* @param Varien_Object $object Entity owning file value
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
public function getValue(Varien_Object $object)
|
26 |
+
{
|
27 |
+
$data = '';
|
28 |
+
if ($value = parent::getValue($object)) {
|
29 |
+
// $data = '<a href="'.Mage::helper('fileattributes')->getFileUrl($value).'" target="_blank">'.$value.'</a>';
|
30 |
+
$data = '<a href="'.Mage::helper('fileattributes')->getFileUrl($value).'" target="_blank">Download</a>';
|
31 |
+
}
|
32 |
+
return $data;
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Observer.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Observer
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Add file type to available EAV attributes types
|
20 |
+
* Used in system config's attributes management page
|
21 |
+
*
|
22 |
+
* @param Varien_Event_Observer $observer
|
23 |
+
*/
|
24 |
+
public function addFileAttributeType(Varien_Event_Observer $observer)
|
25 |
+
{
|
26 |
+
if ($response = $observer->getEvent()->getResponse()) {
|
27 |
+
if (!is_array($types = $response->getTypes())) {
|
28 |
+
$types = array();
|
29 |
+
}
|
30 |
+
$types[] = array(
|
31 |
+
'value' => 'blfa_file',
|
32 |
+
'label' => Mage::helper('fileattributes')->__('File'),
|
33 |
+
'hide_fields' => array(
|
34 |
+
'is_unique',
|
35 |
+
'frontend_class',
|
36 |
+
'is_configurable',
|
37 |
+
|
38 |
+
'is_filterable',
|
39 |
+
'is_filterable_in_search',
|
40 |
+
'is_used_for_promo_rules',
|
41 |
+
'position',
|
42 |
+
'_default_value',
|
43 |
+
),
|
44 |
+
);
|
45 |
+
$response->setTypes($types);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Force some values before "blfa_file" EAV attributes save
|
51 |
+
*
|
52 |
+
* @param Varien_Event_Observer $observer
|
53 |
+
*/
|
54 |
+
public function onAttributeSaveBefore(Varien_Event_Observer $observer)
|
55 |
+
{
|
56 |
+
if (($attribute = $observer->getEvent()->getAttribute())
|
57 |
+
&& ($attribute->getFrontendInput() == 'blfa_file')) {
|
58 |
+
$attribute->setBackendModel('fileattributes/attribute_backend_file')
|
59 |
+
->setBackendType('varchar')
|
60 |
+
->setFrontendModel('fileattributes/attribute_frontend_file')
|
61 |
+
->setFrontendInputRenderer('fileattributes/form_element_file')
|
62 |
+
->setIsHtmlAllowedOnFront(1);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Observer.php~
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Observer
|
17 |
+
{
|
18 |
+
/**
|
19 |
+
* Add file type to available EAV attributes types
|
20 |
+
* Used in system config's attributes management page
|
21 |
+
*
|
22 |
+
* @param Varien_Event_Observer $observer
|
23 |
+
*/
|
24 |
+
public function addFileAttributeType(Varien_Event_Observer $observer)
|
25 |
+
{
|
26 |
+
if ($response = $observer->getEvent()->getResponse()) {
|
27 |
+
if (!is_array($types = $response->getTypes())) {
|
28 |
+
$types = array();
|
29 |
+
}
|
30 |
+
$types[] = array(
|
31 |
+
'value' => 'blfa_file',
|
32 |
+
'label' => Mage::helper('fileattributes')->__('File'),
|
33 |
+
'hide_fields' => array(
|
34 |
+
'is_unique',
|
35 |
+
'frontend_class',
|
36 |
+
'is_configurable',
|
37 |
+
|
38 |
+
'is_filterable',
|
39 |
+
'is_filterable_in_search',
|
40 |
+
'is_used_for_promo_rules',
|
41 |
+
'position',
|
42 |
+
'_default_value',
|
43 |
+
),
|
44 |
+
);
|
45 |
+
$response->setTypes($types);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Force some values before "blfa_file" EAV attributes save
|
51 |
+
*
|
52 |
+
* @param Varien_Event_Observer $observer
|
53 |
+
*/
|
54 |
+
public function onAttributeSaveBefore(Varien_Event_Observer $observer)
|
55 |
+
{
|
56 |
+
if (($attribute = $observer->getEvent()->getAttribute())
|
57 |
+
&& ($attribute->getFrontendInput() == 'blfa_file')) {
|
58 |
+
$attribute->setBackendModel('fileattributes/attribute_backend_file')
|
59 |
+
->setBackendType('varchar')
|
60 |
+
->setFrontendModel('fileattributes/attribute_frontend_file')
|
61 |
+
->setFrontendInputRenderer('fileattributes/form_element_file')
|
62 |
+
->setIsHtmlAllowedOnFront(1);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Obsolete/Files/Collection.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Obsolete_Files_Collection
|
17 |
+
extends Varien_Data_Collection_Filesystem
|
18 |
+
{
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
parent::__construct();
|
22 |
+
$this->_collectRecursively = false;
|
23 |
+
$this->_allowedFilesMask = '/^.+$/i';
|
24 |
+
$this->addTargetDir(Mage::getModel('fileattributes/attribute_backend_file')->getTargetDir());
|
25 |
+
$this->addExcludeFilter($this->_getUsedFiles());
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _generateRow($filename)
|
29 |
+
{
|
30 |
+
$fileInfos = pathinfo($filename);
|
31 |
+
$fileStats = stat($filename);
|
32 |
+
return array_merge(parent::_generateRow($filename), array(
|
33 |
+
'id' => Mage::helper('fileattributes')->encodeFilename(basename($filename)),
|
34 |
+
'url' => Mage::helper('fileattributes')->getFileUrl(basename($filename)),
|
35 |
+
'size' => $fileStats['size'],
|
36 |
+
'extension' => (isset($fileInfos['extension']) ? $fileInfos['extension'] : ''),
|
37 |
+
'updated_at' => $fileStats['mtime'],
|
38 |
+
));
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function _getUsedFiles()
|
42 |
+
{
|
43 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
44 |
+
$attributes = Mage::helper('fileattributes')->getFileAttributesCollection();
|
45 |
+
$usedFiles = array();
|
46 |
+
|
47 |
+
foreach ($attributes as $attribute) {
|
48 |
+
$products->addAttributeToSelect($attribute->getAttributeCode())
|
49 |
+
->addAttributeToFilter($attribute->getAttributeCode(), array(
|
50 |
+
array('neq' => ''),
|
51 |
+
array('notnull' => 1),
|
52 |
+
));
|
53 |
+
}
|
54 |
+
|
55 |
+
foreach ($products as $product) {
|
56 |
+
foreach ($attributes as $attribute) {
|
57 |
+
if ($file = $product->getData($attribute->getAttributeCode())) {
|
58 |
+
$usedFiles[] = $file;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return $usedFiles;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function addExcludeFilter(array $files)
|
67 |
+
{
|
68 |
+
// "nin" filter uses "filterCallbackIn" but this method does not exist...
|
69 |
+
return $this->addCallbackFilter('basename', $files, 'nin', array($this, 'filterCallbackInArray'), true);
|
70 |
+
}
|
71 |
+
|
72 |
+
public function toOptionArray()
|
73 |
+
{
|
74 |
+
return $this->_toOptionArray('basename', 'filename');
|
75 |
+
}
|
76 |
+
|
77 |
+
public function toOptionHash()
|
78 |
+
{
|
79 |
+
return $this->_toOptionHash('basename', 'filename');
|
80 |
+
}
|
81 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/Obsolete/Files/Collection.php~
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_Obsolete_Files_Collection
|
17 |
+
extends Varien_Data_Collection_Filesystem
|
18 |
+
{
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
parent::__construct();
|
22 |
+
$this->_collectRecursively = false;
|
23 |
+
$this->_allowedFilesMask = '/^.+$/i';
|
24 |
+
$this->addTargetDir(Mage::getModel('fileattributes/attribute_backend_file')->getTargetDir());
|
25 |
+
$this->addExcludeFilter($this->_getUsedFiles());
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _generateRow($filename)
|
29 |
+
{
|
30 |
+
$fileInfos = pathinfo($filename);
|
31 |
+
$fileStats = stat($filename);
|
32 |
+
return array_merge(parent::_generateRow($filename), array(
|
33 |
+
'id' => Mage::helper('fileattributes')->encodeFilename(basename($filename)),
|
34 |
+
'url' => Mage::helper('fileattributes')->getFileUrl(basename($filename)),
|
35 |
+
'size' => $fileStats['size'],
|
36 |
+
'extension' => (isset($fileInfos['extension']) ? $fileInfos['extension'] : ''),
|
37 |
+
'updated_at' => $fileStats['mtime'],
|
38 |
+
));
|
39 |
+
}
|
40 |
+
|
41 |
+
protected function _getUsedFiles()
|
42 |
+
{
|
43 |
+
$products = Mage::getModel('catalog/product')->getCollection();
|
44 |
+
$attributes = Mage::helper('fileattributes')->getFileAttributesCollection();
|
45 |
+
$usedFiles = array();
|
46 |
+
|
47 |
+
foreach ($attributes as $attribute) {
|
48 |
+
$products->addAttributeToSelect($attribute->getAttributeCode())
|
49 |
+
->addAttributeToFilter($attribute->getAttributeCode(), array(
|
50 |
+
array('neq' => ''),
|
51 |
+
array('notnull' => 1),
|
52 |
+
));
|
53 |
+
}
|
54 |
+
|
55 |
+
foreach ($products as $product) {
|
56 |
+
foreach ($attributes as $attribute) {
|
57 |
+
if ($file = $product->getData($attribute->getAttributeCode())) {
|
58 |
+
$usedFiles[] = $file;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return $usedFiles;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function addExcludeFilter(array $files)
|
67 |
+
{
|
68 |
+
// "nin" filter uses "filterCallbackIn" but this method does not exist...
|
69 |
+
return $this->addCallbackFilter('basename', $files, 'nin', array($this, 'filterCallbackInArray'), true);
|
70 |
+
}
|
71 |
+
|
72 |
+
public function toOptionArray()
|
73 |
+
{
|
74 |
+
return $this->_toOptionArray('basename', 'filename');
|
75 |
+
}
|
76 |
+
|
77 |
+
public function toOptionHash()
|
78 |
+
{
|
79 |
+
return $this->_toOptionHash('basename', 'filename');
|
80 |
+
}
|
81 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/System/Config/Backend/Serialized/Attributes/Configuration.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_System_Config_Backend_Serialized_Attributes_Configuration
|
17 |
+
extends Mage_Adminhtml_Model_System_Config_Backend_Serialized
|
18 |
+
{
|
19 |
+
protected $_sourcesOptions = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Verify an integer value taken in an array
|
23 |
+
*
|
24 |
+
* @param mixed $array Hash of values
|
25 |
+
* @param mixed $key Key of value to verify
|
26 |
+
* @return null|mixed
|
27 |
+
*/
|
28 |
+
protected function _verifyIntValue(array $array, $key)
|
29 |
+
{
|
30 |
+
return (isset($array[$key]) && is_numeric($array[$key]) && (($value = intval($array[$key])) > 0) ? $value : null);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Verify a value taken in an array, from an options source
|
35 |
+
*
|
36 |
+
* @param mixed $array Hash of values
|
37 |
+
* @param mixed $key Key of value to verify
|
38 |
+
* @param mixed $modelName Source model name
|
39 |
+
* @param mixed $internal True if source model is internal to this module
|
40 |
+
* @return null|mixed
|
41 |
+
*/
|
42 |
+
protected function _verifySourceValue(array $array, $key, $modelName, $internal=true)
|
43 |
+
{
|
44 |
+
if ($internal) {
|
45 |
+
$modelName = 'fileattributes/system_config_source_'.$modelName;
|
46 |
+
}
|
47 |
+
if (!isset($this->_sourcesOptions[$modelName])) {
|
48 |
+
$options = Mage::getModel($modelName)->toOptionArray();
|
49 |
+
$this->_sourcesOptions[$modelName] = array();
|
50 |
+
foreach ($options as $option) {
|
51 |
+
$this->_sourcesOptions[$modelName][] = $option['value'];
|
52 |
+
}
|
53 |
+
}
|
54 |
+
if (isset($array[$key])
|
55 |
+
&& in_array($array[$key], $this->_sourcesOptions[$modelName])) {
|
56 |
+
return $array[$key];
|
57 |
+
} else {
|
58 |
+
return null;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function _afterLoad()
|
63 |
+
{
|
64 |
+
parent::_afterLoad();
|
65 |
+
|
66 |
+
// Remove obsolete configuration (unexisting attributes)
|
67 |
+
if (is_array($value = $this->getValue())) {
|
68 |
+
$attributes = Mage::helper('fileattributes')->getFileAttributesCollection();
|
69 |
+
foreach ($value as $key => $config) {
|
70 |
+
if (!$attributes->getItemById($config['attribute_id'])) {
|
71 |
+
unset($value[$key]);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
$this->setValue($value);
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
protected function _beforeSave()
|
79 |
+
{
|
80 |
+
// Clean given value by removing "__empty" and incomplete sub values
|
81 |
+
$value = $this->getValue();
|
82 |
+
$attributes = Mage::helper('fileattributes')->getFileAttributesCollection();
|
83 |
+
$foundIds = array();
|
84 |
+
|
85 |
+
if (is_array($value)) {
|
86 |
+
if (isset($value['__empty'])) {
|
87 |
+
unset($value['__empty']);
|
88 |
+
}
|
89 |
+
foreach ($value as $key => $config) {
|
90 |
+
if (!isset($config['attribute_id'])
|
91 |
+
|| !$attributes->getItemById($config['attribute_id'])
|
92 |
+
|| isset($foundIds[$config['attribute_id']])) {
|
93 |
+
unset($value[$key]);
|
94 |
+
} else {
|
95 |
+
$attributeId = $config['attribute_id'];
|
96 |
+
$foundIds[$attributeId] = true;
|
97 |
+
|
98 |
+
$value[$key] = array(
|
99 |
+
'attribute_id' => $attributeId,
|
100 |
+
'display_config' => (isset($config['display_config']) ? (bool)$config['display_config'] : false),
|
101 |
+
'file_save_moment' => $this->_verifySourceValue($config, 'file_save_moment', 'file_save_moment'),
|
102 |
+
'file_max_size' => $this->_verifyIntValue($config, 'file_max_size'),
|
103 |
+
'image_only' => (isset($config['image_only']) ? (bool)$config['image_only'] : false),
|
104 |
+
'image_min_width' => $this->_verifyIntValue($config, 'image_min_width'),
|
105 |
+
'image_max_width' => $this->_verifyIntValue($config, 'image_max_width'),
|
106 |
+
'image_min_height' => $this->_verifyIntValue($config, 'image_min_height'),
|
107 |
+
'image_max_height' => $this->_verifyIntValue($config, 'image_max_height'),
|
108 |
+
'allowed_mime_types' => (isset($config['allowed_mime_types']) ? $config['allowed_mime_types'] : ''),
|
109 |
+
'forbidden_mime_types' => (isset($config['forbidden_mime_types']) ? $config['forbidden_mime_types'] : ''),
|
110 |
+
'exceptions_handling_mode' => $this->_verifySourceValue($config, 'exceptions_handling_mode', 'exceptions_handling_mode'),
|
111 |
+
'allowed_file_extensions' => (isset($config['allowed_file_extensions']) ? $config['allowed_file_extensions'] : ''),
|
112 |
+
'forbidden_file_extensions' => (isset($config['forbidden_file_extensions']) ? $config['forbidden_file_extensions'] : ''),
|
113 |
+
);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
} else {
|
117 |
+
$value = array();
|
118 |
+
}
|
119 |
+
|
120 |
+
$this->setValue($value);
|
121 |
+
parent::_beforeSave();
|
122 |
+
}
|
123 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/System/Config/Backend/Serialized/Attributes/Configuration.php~
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_System_Config_Backend_Serialized_Attributes_Configuration
|
17 |
+
extends Mage_Adminhtml_Model_System_Config_Backend_Serialized
|
18 |
+
{
|
19 |
+
protected $_sourcesOptions = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Verify an integer value taken in an array
|
23 |
+
*
|
24 |
+
* @param mixed $array Hash of values
|
25 |
+
* @param mixed $key Key of value to verify
|
26 |
+
* @return null|mixed
|
27 |
+
*/
|
28 |
+
protected function _verifyIntValue(array $array, $key)
|
29 |
+
{
|
30 |
+
return (isset($array[$key]) && is_numeric($array[$key]) && (($value = intval($array[$key])) > 0) ? $value : null);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Verify a value taken in an array, from an options source
|
35 |
+
*
|
36 |
+
* @param mixed $array Hash of values
|
37 |
+
* @param mixed $key Key of value to verify
|
38 |
+
* @param mixed $modelName Source model name
|
39 |
+
* @param mixed $internal True if source model is internal to this module
|
40 |
+
* @return null|mixed
|
41 |
+
*/
|
42 |
+
protected function _verifySourceValue(array $array, $key, $modelName, $internal=true)
|
43 |
+
{
|
44 |
+
if ($internal) {
|
45 |
+
$modelName = 'fileattributes/system_config_source_'.$modelName;
|
46 |
+
}
|
47 |
+
if (!isset($this->_sourcesOptions[$modelName])) {
|
48 |
+
$options = Mage::getModel($modelName)->toOptionArray();
|
49 |
+
$this->_sourcesOptions[$modelName] = array();
|
50 |
+
foreach ($options as $option) {
|
51 |
+
$this->_sourcesOptions[$modelName][] = $option['value'];
|
52 |
+
}
|
53 |
+
}
|
54 |
+
if (isset($array[$key])
|
55 |
+
&& in_array($array[$key], $this->_sourcesOptions[$modelName])) {
|
56 |
+
return $array[$key];
|
57 |
+
} else {
|
58 |
+
return null;
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function _afterLoad()
|
63 |
+
{
|
64 |
+
parent::_afterLoad();
|
65 |
+
|
66 |
+
// Remove obsolete configuration (unexisting attributes)
|
67 |
+
if (is_array($value = $this->getValue())) {
|
68 |
+
$attributes = Mage::helper('fileattributes')->getFileAttributesCollection();
|
69 |
+
foreach ($value as $key => $config) {
|
70 |
+
if (!$attributes->getItemById($config['attribute_id'])) {
|
71 |
+
unset($value[$key]);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
$this->setValue($value);
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
protected function _beforeSave()
|
79 |
+
{
|
80 |
+
// Clean given value by removing "__empty" and incomplete sub values
|
81 |
+
$value = $this->getValue();
|
82 |
+
$attributes = Mage::helper('fileattributes')->getFileAttributesCollection();
|
83 |
+
$foundIds = array();
|
84 |
+
|
85 |
+
if (is_array($value)) {
|
86 |
+
if (isset($value['__empty'])) {
|
87 |
+
unset($value['__empty']);
|
88 |
+
}
|
89 |
+
foreach ($value as $key => $config) {
|
90 |
+
if (!isset($config['attribute_id'])
|
91 |
+
|| !$attributes->getItemById($config['attribute_id'])
|
92 |
+
|| isset($foundIds[$config['attribute_id']])) {
|
93 |
+
unset($value[$key]);
|
94 |
+
} else {
|
95 |
+
$attributeId = $config['attribute_id'];
|
96 |
+
$foundIds[$attributeId] = true;
|
97 |
+
|
98 |
+
$value[$key] = array(
|
99 |
+
'attribute_id' => $attributeId,
|
100 |
+
'display_config' => (isset($config['display_config']) ? (bool)$config['display_config'] : false),
|
101 |
+
'file_save_moment' => $this->_verifySourceValue($config, 'file_save_moment', 'file_save_moment'),
|
102 |
+
'file_max_size' => $this->_verifyIntValue($config, 'file_max_size'),
|
103 |
+
'image_only' => (isset($config['image_only']) ? (bool)$config['image_only'] : false),
|
104 |
+
'image_min_width' => $this->_verifyIntValue($config, 'image_min_width'),
|
105 |
+
'image_max_width' => $this->_verifyIntValue($config, 'image_max_width'),
|
106 |
+
'image_min_height' => $this->_verifyIntValue($config, 'image_min_height'),
|
107 |
+
'image_max_height' => $this->_verifyIntValue($config, 'image_max_height'),
|
108 |
+
'allowed_mime_types' => (isset($config['allowed_mime_types']) ? $config['allowed_mime_types'] : ''),
|
109 |
+
'forbidden_mime_types' => (isset($config['forbidden_mime_types']) ? $config['forbidden_mime_types'] : ''),
|
110 |
+
'exceptions_handling_mode' => $this->_verifySourceValue($config, 'exceptions_handling_mode', 'exceptions_handling_mode'),
|
111 |
+
'allowed_file_extensions' => (isset($config['allowed_file_extensions']) ? $config['allowed_file_extensions'] : ''),
|
112 |
+
'forbidden_file_extensions' => (isset($config['forbidden_file_extensions']) ? $config['forbidden_file_extensions'] : ''),
|
113 |
+
);
|
114 |
+
}
|
115 |
+
}
|
116 |
+
} else {
|
117 |
+
$value = array();
|
118 |
+
}
|
119 |
+
|
120 |
+
$this->setValue($value);
|
121 |
+
parent::_beforeSave();
|
122 |
+
}
|
123 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/Exceptions/Handling/Mode.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_System_Config_Source_Exceptions_Handling_Mode
|
17 |
+
{
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return Mage::getModel('fileattributes/attribute_backend_file')
|
21 |
+
->getExceptionsHandlingModesAsOptionArray();
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/Exceptions/Handling/Mode.php~
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_System_Config_Source_Exceptions_Handling_Mode
|
17 |
+
{
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return Mage::getModel('fileattributes/attribute_backend_file')
|
21 |
+
->getExceptionsHandlingModesAsOptionArray();
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/File/Save/Moment.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_System_Config_Source_File_Save_Moment
|
17 |
+
{
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return Mage::getModel('fileattributes/attribute_backend_file')
|
21 |
+
->getFileSaveMomentsAsOptionArray();
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/Model/System/Config/Source/File/Save/Moment.php~
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Model_System_Config_Source_File_Save_Moment
|
17 |
+
{
|
18 |
+
public function toOptionArray()
|
19 |
+
{
|
20 |
+
return Mage::getModel('fileattributes/attribute_backend_file')
|
21 |
+
->getFileSaveMomentsAsOptionArray();
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Telemantis/FileAttributes/controllers/Adminhtml/Obsolete/FilesController.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Adminhtml_Obsolete_FilesController
|
17 |
+
extends Mage_Adminhtml_Controller_Action
|
18 |
+
{
|
19 |
+
protected function _initAction($layoutIds=null)
|
20 |
+
{
|
21 |
+
$this->loadLayout($layoutIds)
|
22 |
+
->_setActiveMenu('system/fileattributes/obsolete_files')
|
23 |
+
->_title($this->__('File Attributes'))
|
24 |
+
->_title($this->__('Manage Obsolete Files'))
|
25 |
+
->_addBreadcrumb($this->__('File Attributes'), $this->__('File Attributes'))
|
26 |
+
->_addBreadcrumb($this->__('Manage Obsolete Files'), $this->__('Manage Obsolete Files'));
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function indexAction()
|
31 |
+
{
|
32 |
+
if ($this->getRequest()->getQuery('ajax')) {
|
33 |
+
$this->_forward('grid');
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
$this->_initAction()->renderLayout();
|
37 |
+
}
|
38 |
+
|
39 |
+
public function deleteAction()
|
40 |
+
{
|
41 |
+
if ($file = $this->getRequest()->getParam('file')) {
|
42 |
+
$files = Mage::getModel('fileattributes/obsolete_files_collection');
|
43 |
+
if ($file = $files->getItemById($file)) {
|
44 |
+
try {
|
45 |
+
Mage::getModel('fileattributes/attribute_backend_file')
|
46 |
+
->deleteFile($file->getBasename());
|
47 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The obsolete file has been successfully deleted.'));
|
48 |
+
} catch (Exception $e) {
|
49 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
50 |
+
}
|
51 |
+
} else {
|
52 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('This obsolete file no longer exists.'));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
$this->_redirect('*/*/');
|
56 |
+
}
|
57 |
+
|
58 |
+
public function massDeleteAction()
|
59 |
+
{
|
60 |
+
if (!$this->_validateFiles()) {
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
try {
|
65 |
+
$collection = Mage::getModel('fileattributes/obsolete_files_collection');
|
66 |
+
$files = $this->getRequest()->getParam('files');
|
67 |
+
$model = Mage::getModel('fileattributes/attribute_backend_file');
|
68 |
+
$deleted = 0;
|
69 |
+
|
70 |
+
foreach ($files as $file) {
|
71 |
+
if ($file = $collection->getItemById($file)) {
|
72 |
+
$model->deleteFile($file->getBasename());
|
73 |
+
$deleted++;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
$this->_getSession()->addSuccess($this->__('Total of %d obsolete file(s) have been deleted.', $deleted));
|
78 |
+
} catch (Exception $e) {
|
79 |
+
$this->_getSession()->addError($e->getMessage());
|
80 |
+
}
|
81 |
+
|
82 |
+
$this->getResponse()->setRedirect($this->getUrl('*/*/index'));
|
83 |
+
}
|
84 |
+
|
85 |
+
protected function _validateFiles()
|
86 |
+
{
|
87 |
+
if (!is_array($this->getRequest()->getParam('files', null))) {
|
88 |
+
$this->_getSession()->addError($this->__('Please select obsolete files to update'));
|
89 |
+
$this->_redirect('*/*/index', array('_current' => true));
|
90 |
+
return false;
|
91 |
+
}
|
92 |
+
return true;
|
93 |
+
}
|
94 |
+
|
95 |
+
protected function _isAllowed()
|
96 |
+
{
|
97 |
+
return Mage::getSingleton('admin/session')->isAllowed('system/fileattributes/obsolete_files');
|
98 |
+
}
|
99 |
+
}
|
app/code/community/Telemantis/FileAttributes/controllers/Adminhtml/Obsolete/FilesController.php~
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* NOTICE OF LICENSE
|
4 |
+
*
|
5 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
6 |
+
* that is bundled with this package in the file LICENSE.txt.
|
7 |
+
* It is also available through the world-wide-web at this URL:
|
8 |
+
* http://opensource.org/licenses/osl-3.0.php
|
9 |
+
*
|
10 |
+
* @category Telemantis
|
11 |
+
* @package Telemantis_FileAttributes
|
12 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
13 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
14 |
+
*/
|
15 |
+
|
16 |
+
class Telemantis_FileAttributes_Adminhtml_Obsolete_FilesController
|
17 |
+
extends Mage_Adminhtml_Controller_Action
|
18 |
+
{
|
19 |
+
protected function _initAction($layoutIds=null)
|
20 |
+
{
|
21 |
+
$this->loadLayout($layoutIds)
|
22 |
+
->_setActiveMenu('system/fileattributes/obsolete_files')
|
23 |
+
->_title($this->__('File Attributes'))
|
24 |
+
->_title($this->__('Manage Obsolete Files'))
|
25 |
+
->_addBreadcrumb($this->__('File Attributes'), $this->__('File Attributes'))
|
26 |
+
->_addBreadcrumb($this->__('Manage Obsolete Files'), $this->__('Manage Obsolete Files'));
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function indexAction()
|
31 |
+
{
|
32 |
+
if ($this->getRequest()->getQuery('ajax')) {
|
33 |
+
$this->_forward('grid');
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
$this->_initAction()->renderLayout();
|
37 |
+
}
|
38 |
+
|
39 |
+
public function deleteAction()
|
40 |
+
{
|
41 |
+
if ($file = $this->getRequest()->getParam('file')) {
|
42 |
+
$files = Mage::getModel('fileattributes/obsolete_files_collection');
|
43 |
+
if ($file = $files->getItemById($file)) {
|
44 |
+
try {
|
45 |
+
Mage::getModel('fileattributes/attribute_backend_file')
|
46 |
+
->deleteFile($file->getBasename());
|
47 |
+
Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The obsolete file has been successfully deleted.'));
|
48 |
+
} catch (Exception $e) {
|
49 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
50 |
+
}
|
51 |
+
} else {
|
52 |
+
Mage::getSingleton('adminhtml/session')->addError($this->__('This obsolete file no longer exists.'));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
$this->_redirect('*/*/');
|
56 |
+
}
|
57 |
+
|
58 |
+
public function massDeleteAction()
|
59 |
+
{
|
60 |
+
if (!$this->_validateFiles()) {
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
try {
|
65 |
+
$collection = Mage::getModel('fileattributes/obsolete_files_collection');
|
66 |
+
$files = $this->getRequest()->getParam('files');
|
67 |
+
$model = Mage::getModel('fileattributes/attribute_backend_file');
|
68 |
+
$deleted = 0;
|
69 |
+
|
70 |
+
foreach ($files as $file) {
|
71 |
+
if ($file = $collection->getItemById($file)) {
|
72 |
+
$model->deleteFile($file->getBasename());
|
73 |
+
$deleted++;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
$this->_getSession()->addSuccess($this->__('Total of %d obsolete file(s) have been deleted.', $deleted));
|
78 |
+
} catch (Exception $e) {
|
79 |
+
$this->_getSession()->addError($e->getMessage());
|
80 |
+
}
|
81 |
+
|
82 |
+
$this->getResponse()->setRedirect($this->getUrl('*/*/index'));
|
83 |
+
}
|
84 |
+
|
85 |
+
protected function _validateFiles()
|
86 |
+
{
|
87 |
+
if (!is_array($this->getRequest()->getParam('files', null))) {
|
88 |
+
$this->_getSession()->addError($this->__('Please select obsolete files to update'));
|
89 |
+
$this->_redirect('*/*/index', array('_current' => true));
|
90 |
+
return false;
|
91 |
+
}
|
92 |
+
return true;
|
93 |
+
}
|
94 |
+
|
95 |
+
protected function _isAllowed()
|
96 |
+
{
|
97 |
+
return Mage::getSingleton('admin/session')->isAllowed('system/fileattributes/obsolete_files');
|
98 |
+
}
|
99 |
+
}
|
app/code/community/Telemantis/FileAttributes/etc/adminhtml.xml
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also availaTelemantise through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Telemantis
|
12 |
+
* @package Telemantis_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<config>
|
18 |
+
<events>
|
19 |
+
<adminhtml_product_attribute_types>
|
20 |
+
<observers>
|
21 |
+
<fileattributes>
|
22 |
+
<type>model</type>
|
23 |
+
<class>fileattributes/observer</class>
|
24 |
+
<method>addFileAttributeType</method>
|
25 |
+
</fileattributes>
|
26 |
+
</observers>
|
27 |
+
</adminhtml_product_attribute_types>
|
28 |
+
</events>
|
29 |
+
<layout>
|
30 |
+
<updates>
|
31 |
+
<fileattributes>
|
32 |
+
<file>Telemantis/fileattributes.xml</file>
|
33 |
+
</fileattributes>
|
34 |
+
</updates>
|
35 |
+
</layout>
|
36 |
+
<translate>
|
37 |
+
<modules>
|
38 |
+
<fileattributes>
|
39 |
+
<files>
|
40 |
+
<default>Telemantis_FileAttributes.csv</default>
|
41 |
+
</files>
|
42 |
+
</fileattributes>
|
43 |
+
</modules>
|
44 |
+
</translate>
|
45 |
+
<acl>
|
46 |
+
<resources>
|
47 |
+
<all>
|
48 |
+
<title>Allow Everything</title>
|
49 |
+
</all>
|
50 |
+
<admin>
|
51 |
+
<children>
|
52 |
+
<system>
|
53 |
+
<children>
|
54 |
+
<fileattributes>
|
55 |
+
<title>File Attributes</title>
|
56 |
+
<sort_order>20</sort_order>
|
57 |
+
<children>
|
58 |
+
<obsolete_files translate="title" module="fileattributes">
|
59 |
+
<title>Manage Obsolete Files</title>
|
60 |
+
<sort_order>10</sort_order>
|
61 |
+
</obsolete_files>
|
62 |
+
<setup translate="title" module="fileattributes">
|
63 |
+
<title>Setup</title>
|
64 |
+
<sort_order>20</sort_order>
|
65 |
+
</setup>
|
66 |
+
</children>
|
67 |
+
</fileattributes>
|
68 |
+
<config>
|
69 |
+
<children>
|
70 |
+
<fileattributes translate="title" module="fileattributes">
|
71 |
+
<title>File Attributes Configuration</title>
|
72 |
+
</fileattributes>
|
73 |
+
</children>
|
74 |
+
</config>
|
75 |
+
</children>
|
76 |
+
</system>
|
77 |
+
</children>
|
78 |
+
</admin>
|
79 |
+
</resources>
|
80 |
+
</acl>
|
81 |
+
<menu>
|
82 |
+
<system>
|
83 |
+
<children>
|
84 |
+
<fileattributes translate="title" module="fileattributes">
|
85 |
+
<title>File Attributes</title>
|
86 |
+
<sort_order>20</sort_order>
|
87 |
+
<children>
|
88 |
+
<obsolete_files translate="title" module="fileattributes">
|
89 |
+
<title>Manage Obsolete Files</title>
|
90 |
+
<sort_order>10</sort_order>
|
91 |
+
<action>fileattributes/adminhtml_obsolete_file/index</action>
|
92 |
+
</obsolete_files>
|
93 |
+
<setup translate="title" module="fileattributes">
|
94 |
+
<title>Setup</title>
|
95 |
+
<sort_order>20</sort_order>
|
96 |
+
<action>adminhtml/system_config/edit/section/fileattributes/</action>
|
97 |
+
</setup>
|
98 |
+
</children>
|
99 |
+
</fileattributes>
|
100 |
+
</children>
|
101 |
+
</system>
|
102 |
+
</menu>
|
103 |
+
</config>
|
app/code/community/Telemantis/FileAttributes/etc/adminhtml.xml~
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also availaTelemantise through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Telemantis
|
12 |
+
* @package Telemantis_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<config>
|
18 |
+
<events>
|
19 |
+
<adminhtml_product_attribute_types>
|
20 |
+
<observers>
|
21 |
+
<fileattributes>
|
22 |
+
<type>model</type>
|
23 |
+
<class>fileattributes/observer</class>
|
24 |
+
<method>addFileAttributeType</method>
|
25 |
+
</fileattributes>
|
26 |
+
</observers>
|
27 |
+
</adminhtml_product_attribute_types>
|
28 |
+
</events>
|
29 |
+
<layout>
|
30 |
+
<updates>
|
31 |
+
<fileattributes>
|
32 |
+
<file>Telemantis/fileattributes.xml</file>
|
33 |
+
</fileattributes>
|
34 |
+
</updates>
|
35 |
+
</layout>
|
36 |
+
<translate>
|
37 |
+
<modules>
|
38 |
+
<fileattributes>
|
39 |
+
<files>
|
40 |
+
<default>Telemantis_FileAttributes.csv</default>
|
41 |
+
</files>
|
42 |
+
</fileattributes>
|
43 |
+
</modules>
|
44 |
+
</translate>
|
45 |
+
<acl>
|
46 |
+
<resources>
|
47 |
+
<all>
|
48 |
+
<title>Allow Everything</title>
|
49 |
+
</all>
|
50 |
+
<admin>
|
51 |
+
<children>
|
52 |
+
<system>
|
53 |
+
<children>
|
54 |
+
<fileattributes>
|
55 |
+
<title>File Attributes</title>
|
56 |
+
<sort_order>20</sort_order>
|
57 |
+
<children>
|
58 |
+
<obsolete_files translate="title" module="fileattributes">
|
59 |
+
<title>Manage Obsolete Files</title>
|
60 |
+
<sort_order>10</sort_order>
|
61 |
+
</obsolete_files>
|
62 |
+
<setup translate="title" module="fileattributes">
|
63 |
+
<title>Setup</title>
|
64 |
+
<sort_order>20</sort_order>
|
65 |
+
</setup>
|
66 |
+
</children>
|
67 |
+
</fileattributes>
|
68 |
+
<config>
|
69 |
+
<children>
|
70 |
+
<fileattributes translate="title" module="fileattributes">
|
71 |
+
<title>File Attributes Configuration</title>
|
72 |
+
</fileattributes>
|
73 |
+
</children>
|
74 |
+
</config>
|
75 |
+
</children>
|
76 |
+
</system>
|
77 |
+
</children>
|
78 |
+
</admin>
|
79 |
+
</resources>
|
80 |
+
</acl>
|
81 |
+
<menu>
|
82 |
+
<system>
|
83 |
+
<children>
|
84 |
+
<fileattributes translate="title" module="fileattributes">
|
85 |
+
<title>File Attributes</title>
|
86 |
+
<sort_order>20</sort_order>
|
87 |
+
<children>
|
88 |
+
<obsolete_files translate="title" module="fileattributes">
|
89 |
+
<title>Manage Obsolete Files</title>
|
90 |
+
<sort_order>10</sort_order>
|
91 |
+
<action>fileattributes/adminhtml_obsolete_file/index</action>
|
92 |
+
</obsolete_files>
|
93 |
+
<setup translate="title" module="fileattributes">
|
94 |
+
<title>Setup</title>
|
95 |
+
<sort_order>20</sort_order>
|
96 |
+
<action>adminhtml/system_config/edit/section/fileattributes/</action>
|
97 |
+
</setup>
|
98 |
+
</children>
|
99 |
+
</fileattributes>
|
100 |
+
</children>
|
101 |
+
</system>
|
102 |
+
</menu>
|
103 |
+
</config>
|
app/code/community/Telemantis/FileAttributes/etc/config.xml
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Telemantis
|
12 |
+
* @package Telemantis_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<config>
|
18 |
+
<modules>
|
19 |
+
<Telemantis_FileAttributes>
|
20 |
+
<version>0.9.3.2</version>
|
21 |
+
</Telemantis_FileAttributes>
|
22 |
+
</modules>
|
23 |
+
<global>
|
24 |
+
<blocks>
|
25 |
+
<fileattributes>
|
26 |
+
<class>Telemantis_FileAttributes_Block</class>
|
27 |
+
</fileattributes>
|
28 |
+
</blocks>
|
29 |
+
<helpers>
|
30 |
+
<fileattributes>
|
31 |
+
<class>Telemantis_FileAttributes_Helper</class>
|
32 |
+
</fileattributes>
|
33 |
+
</helpers>
|
34 |
+
<models>
|
35 |
+
<fileattributes>
|
36 |
+
<class>Telemantis_FileAttributes_Model</class>
|
37 |
+
</fileattributes>
|
38 |
+
</models>
|
39 |
+
<events>
|
40 |
+
<catalog_entity_attribute_save_before>
|
41 |
+
<observers>
|
42 |
+
<fileattributes>
|
43 |
+
<type>model</type>
|
44 |
+
<class>fileattributes/observer</class>
|
45 |
+
<method>onAttributeSaveBefore</method>
|
46 |
+
</fileattributes>
|
47 |
+
</observers>
|
48 |
+
</catalog_entity_attribute_save_before>
|
49 |
+
</events>
|
50 |
+
</global>
|
51 |
+
<admin>
|
52 |
+
<routers>
|
53 |
+
<fileattributes>
|
54 |
+
<use>admin</use>
|
55 |
+
<args>
|
56 |
+
<module>Telemantis_FileAttributes</module>
|
57 |
+
<frontName>fileattributes</frontName>
|
58 |
+
</args>
|
59 |
+
</fileattributes>
|
60 |
+
</routers>
|
61 |
+
</admin>
|
62 |
+
<adminhtml>
|
63 |
+
<events>
|
64 |
+
<adminhtml_product_attribute_types>
|
65 |
+
<observers>
|
66 |
+
<fileattributes>
|
67 |
+
<type>model</type>
|
68 |
+
<class>fileattributes/observer</class>
|
69 |
+
<method>addFileAttributeType</method>
|
70 |
+
</fileattributes>
|
71 |
+
</observers>
|
72 |
+
</adminhtml_product_attribute_types>
|
73 |
+
</events>
|
74 |
+
<layout>
|
75 |
+
<updates>
|
76 |
+
<fileattributes>
|
77 |
+
<file>tl/fileattributes.xml</file>
|
78 |
+
</fileattributes>
|
79 |
+
</updates>
|
80 |
+
</layout>
|
81 |
+
<translate>
|
82 |
+
<modules>
|
83 |
+
<fileattributes>
|
84 |
+
<files>
|
85 |
+
<default>Telemantis_FileAttributes.csv</default>
|
86 |
+
</files>
|
87 |
+
</fileattributes>
|
88 |
+
</modules>
|
89 |
+
</translate>
|
90 |
+
<acl>
|
91 |
+
<resources>
|
92 |
+
<all>
|
93 |
+
<title>Allow Everything</title>
|
94 |
+
</all>
|
95 |
+
<admin>
|
96 |
+
<children>
|
97 |
+
<system>
|
98 |
+
<children>
|
99 |
+
<fileattributes>
|
100 |
+
<title>File Attributes</title>
|
101 |
+
<sort_order>20</sort_order>
|
102 |
+
<children>
|
103 |
+
<obsolete_files translate="title" module="fileattributes">
|
104 |
+
<title>Manage Obsolete Files</title>
|
105 |
+
<sort_order>10</sort_order>
|
106 |
+
</obsolete_files>
|
107 |
+
<setup translate="title" module="fileattributes">
|
108 |
+
<title>Setup</title>
|
109 |
+
<sort_order>20</sort_order>
|
110 |
+
</setup>
|
111 |
+
</children>
|
112 |
+
</fileattributes>
|
113 |
+
<config>
|
114 |
+
<children>
|
115 |
+
<fileattributes translate="title" module="fileattributes">
|
116 |
+
<title>File Attributes Configuration</title>
|
117 |
+
</fileattributes>
|
118 |
+
</children>
|
119 |
+
</config>
|
120 |
+
</children>
|
121 |
+
</system>
|
122 |
+
</children>
|
123 |
+
</admin>
|
124 |
+
</resources>
|
125 |
+
</acl>
|
126 |
+
<menu>
|
127 |
+
<system>
|
128 |
+
<children>
|
129 |
+
<fileattributes translate="title" module="fileattributes">
|
130 |
+
<title>File Attributes</title>
|
131 |
+
<sort_order>20</sort_order>
|
132 |
+
<children>
|
133 |
+
<obsolete_files translate="title" module="fileattributes">
|
134 |
+
<title>Manage Obsolete Files</title>
|
135 |
+
<sort_order>10</sort_order>
|
136 |
+
<action>fileattributes/adminhtml_obsolete_files/index</action>
|
137 |
+
</obsolete_files>
|
138 |
+
<setup translate="title" module="fileattributes">
|
139 |
+
<title>Setup</title>
|
140 |
+
<sort_order>20</sort_order>
|
141 |
+
<action>adminhtml/system_config/edit/section/fileattributes/</action>
|
142 |
+
</setup>
|
143 |
+
</children>
|
144 |
+
</fileattributes>
|
145 |
+
</children>
|
146 |
+
</system>
|
147 |
+
</menu>
|
148 |
+
</adminhtml>
|
149 |
+
<default>
|
150 |
+
<general>
|
151 |
+
<validator_data>
|
152 |
+
<input_types>
|
153 |
+
<blfa_file>blfa_file</blfa_file>
|
154 |
+
</input_types>
|
155 |
+
</validator_data>
|
156 |
+
</general>
|
157 |
+
<fileattributes>
|
158 |
+
<configuration>
|
159 |
+
<file_save_moment>after</file_save_moment>
|
160 |
+
<exceptions_handling_mode>log</exceptions_handling_mode>
|
161 |
+
<allow_mime_header_check>0</allow_mime_header_check>
|
162 |
+
</configuration>
|
163 |
+
</fileattributes>
|
164 |
+
</default>
|
165 |
+
</config>
|
app/code/community/Telemantis/FileAttributes/etc/config.xml~
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Telemantis
|
12 |
+
* @package Telemantis_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<config>
|
18 |
+
<modules>
|
19 |
+
<Telemantis_FileAttributes>
|
20 |
+
<version>0.9.3.2</version>
|
21 |
+
</Telemantis_FileAttributes>
|
22 |
+
</modules>
|
23 |
+
<global>
|
24 |
+
<blocks>
|
25 |
+
<fileattributes>
|
26 |
+
<class>Telemantis_FileAttributes_Block</class>
|
27 |
+
</fileattributes>
|
28 |
+
</blocks>
|
29 |
+
<helpers>
|
30 |
+
<fileattributes>
|
31 |
+
<class>Telemantis_FileAttributes_Helper</class>
|
32 |
+
</fileattributes>
|
33 |
+
</helpers>
|
34 |
+
<models>
|
35 |
+
<fileattributes>
|
36 |
+
<class>Telemantis_FileAttributes_Model</class>
|
37 |
+
</fileattributes>
|
38 |
+
</models>
|
39 |
+
<events>
|
40 |
+
<catalog_entity_attribute_save_before>
|
41 |
+
<observers>
|
42 |
+
<fileattributes>
|
43 |
+
<type>model</type>
|
44 |
+
<class>fileattributes/observer</class>
|
45 |
+
<method>onAttributeSaveBefore</method>
|
46 |
+
</fileattributes>
|
47 |
+
</observers>
|
48 |
+
</catalog_entity_attribute_save_before>
|
49 |
+
</events>
|
50 |
+
</global>
|
51 |
+
<admin>
|
52 |
+
<routers>
|
53 |
+
<fileattributes>
|
54 |
+
<use>admin</use>
|
55 |
+
<args>
|
56 |
+
<module>Telemantis_FileAttributes</module>
|
57 |
+
<frontName>fileattributes</frontName>
|
58 |
+
</args>
|
59 |
+
</fileattributes>
|
60 |
+
</routers>
|
61 |
+
</admin>
|
62 |
+
<adminhtml>
|
63 |
+
<events>
|
64 |
+
<adminhtml_product_attribute_types>
|
65 |
+
<observers>
|
66 |
+
<fileattributes>
|
67 |
+
<type>model</type>
|
68 |
+
<class>fileattributes/observer</class>
|
69 |
+
<method>addFileAttributeType</method>
|
70 |
+
</fileattributes>
|
71 |
+
</observers>
|
72 |
+
</adminhtml_product_attribute_types>
|
73 |
+
</events>
|
74 |
+
<layout>
|
75 |
+
<updates>
|
76 |
+
<fileattributes>
|
77 |
+
<file>tl/fileattributes.xml</file>
|
78 |
+
</fileattributes>
|
79 |
+
</updates>
|
80 |
+
</layout>
|
81 |
+
<translate>
|
82 |
+
<modules>
|
83 |
+
<fileattributes>
|
84 |
+
<files>
|
85 |
+
<default>Telemantis_FileAttributes.csv</default>
|
86 |
+
</files>
|
87 |
+
</fileattributes>
|
88 |
+
</modules>
|
89 |
+
</translate>
|
90 |
+
<acl>
|
91 |
+
<resources>
|
92 |
+
<all>
|
93 |
+
<title>Allow Everything</title>
|
94 |
+
</all>
|
95 |
+
<admin>
|
96 |
+
<children>
|
97 |
+
<system>
|
98 |
+
<children>
|
99 |
+
<fileattributes>
|
100 |
+
<title>File Attributes</title>
|
101 |
+
<sort_order>20</sort_order>
|
102 |
+
<children>
|
103 |
+
<obsolete_files translate="title" module="fileattributes">
|
104 |
+
<title>Manage Obsolete Files</title>
|
105 |
+
<sort_order>10</sort_order>
|
106 |
+
</obsolete_files>
|
107 |
+
<setup translate="title" module="fileattributes">
|
108 |
+
<title>Setup</title>
|
109 |
+
<sort_order>20</sort_order>
|
110 |
+
</setup>
|
111 |
+
</children>
|
112 |
+
</fileattributes>
|
113 |
+
<config>
|
114 |
+
<children>
|
115 |
+
<fileattributes translate="title" module="fileattributes">
|
116 |
+
<title>File Attributes Configuration</title>
|
117 |
+
</fileattributes>
|
118 |
+
</children>
|
119 |
+
</config>
|
120 |
+
</children>
|
121 |
+
</system>
|
122 |
+
</children>
|
123 |
+
</admin>
|
124 |
+
</resources>
|
125 |
+
</acl>
|
126 |
+
<menu>
|
127 |
+
<system>
|
128 |
+
<children>
|
129 |
+
<fileattributes translate="title" module="fileattributes">
|
130 |
+
<title>File Attributes</title>
|
131 |
+
<sort_order>20</sort_order>
|
132 |
+
<children>
|
133 |
+
<obsolete_files translate="title" module="fileattributes">
|
134 |
+
<title>Manage Obsolete Files</title>
|
135 |
+
<sort_order>10</sort_order>
|
136 |
+
<action>fileattributes/adminhtml_obsolete_files/index</action>
|
137 |
+
</obsolete_files>
|
138 |
+
<setup translate="title" module="fileattributes">
|
139 |
+
<title>Setup</title>
|
140 |
+
<sort_order>20</sort_order>
|
141 |
+
<action>adminhtml/system_config/edit/section/fileattributes/</action>
|
142 |
+
</setup>
|
143 |
+
</children>
|
144 |
+
</fileattributes>
|
145 |
+
</children>
|
146 |
+
</system>
|
147 |
+
</menu>
|
148 |
+
</adminhtml>
|
149 |
+
<default>
|
150 |
+
<general>
|
151 |
+
<validator_data>
|
152 |
+
<input_types>
|
153 |
+
<blfa_file>blfa_file</blfa_file>
|
154 |
+
</input_types>
|
155 |
+
</validator_data>
|
156 |
+
</general>
|
157 |
+
<fileattributes>
|
158 |
+
<configuration>
|
159 |
+
<file_save_moment>after</file_save_moment>
|
160 |
+
<exceptions_handling_mode>log</exceptions_handling_mode>
|
161 |
+
<allow_mime_header_check>0</allow_mime_header_check>
|
162 |
+
</configuration>
|
163 |
+
</fileattributes>
|
164 |
+
</default>
|
165 |
+
</config>
|
app/code/community/Telemantis/FileAttributes/etc/system.xml
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Telemantis
|
12 |
+
* @package Telemantis_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<config>
|
18 |
+
<sections>
|
19 |
+
<fileattributes translate="label" module="fileattributes">
|
20 |
+
<label>File Attributes</label>
|
21 |
+
<tab>general</tab>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>8000</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>0</show_in_website>
|
26 |
+
<show_in_store>0</show_in_store>
|
27 |
+
<groups>
|
28 |
+
<configuration translate="label">
|
29 |
+
<label>Configuration</label>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>10</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>0</show_in_website>
|
34 |
+
<show_in_store>0</show_in_store>
|
35 |
+
<fields>
|
36 |
+
<attributes_configurations translate="label comment">
|
37 |
+
<label>Attributes Configurations</label>
|
38 |
+
<frontend_model>fileattributes/system_config_form_field_attributes_configuration</frontend_model>
|
39 |
+
<backend_model>fileattributes/system_config_backend_serialized_attributes_configuration</backend_model>
|
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 |
+
<comment><![CDATA[<span style="text-decoration:underline;">Columns descriptions :</span><br /><strong>- Display Configuration On Fields:</strong> if set to <em>Yes</em>, configuration restrictions will be displayed on each file attribute field<br /><strong>- File Save Moment:</strong> when the file will be uploaded during entity save (the choices correspond to the _beforeSave() and _afterSave() models methods)<br /><strong>- Exceptions Handling Mode:</strong> by which way will be handled exceptions that may be thrown during file upload<br /><strong>- Allowed File Extensions:</strong> only files with those extensions will be allowed to be uploaded. This value accept various separators for listed extensions<br /><strong>- Forbidden File Extensions:</strong> all files with those extensions won't be allowed to be uploaded. This value is only used if <em>Allowed File Extensions</em> is left empty, and behaves the same way<br /><strong>- File Max Size:</strong> uploaded files will not be able to have a size bigger than one defined in this value. Please note that if server's max upload size if smaller than this value, it will be used instead<br /><strong>- Allowed MIME Types:</strong> only files with those MIME types will be allowed to uploaded. For each MIME type, indicate first its code, then its label as it will be seen by user, and separate all values with a comma<br /><strong>- Forbidden MIME Types:</strong> all files with those MIME types won't be allowed to be uploaded. This value is only used if <em>Allowed Mime Types</em> is left empty, and behaves the same way<br /><strong>- Image Only:</strong> if set to <em>Yes</em>, only images files will be allowed to be uploaded (work with MIME types validation)<br /><br /><em>Concerning the 4 following values, defining a dimension for at least one of them implies that only images files will be allowed to be uploaded</em><br /><br /><strong>- Image Min Width:</strong> only images with a width equal or greater than this value will be allowed to be uploaded<br /><strong>- Image Max Width:</strong> only images with a width equal or lesser than this value will be allowed to be uploaded<br /><strong>- Image Min Height:</strong> only images with a height equal or greater than this value will be allowed to be uploaded<br /><strong>- Image Max Height:</strong> only images with a height equal or lesser than this value will be allowed to be uploaded<br /><br /><span style="text-decoration:underline;">Note on MIME types detection :</span><br />MIME types detection is used for <em>Allowed MIME types</em>, <em>Forbidden MIME types</em> and <em>Image Only</em> values, but requires the availability of either the <em>fileinfo</em> PHP extension or the <em>mime_content_type</em> PHP function]]></comment>
|
45 |
+
</attributes_configurations>
|
46 |
+
<file_save_moment translate="label comment">
|
47 |
+
<label>Default File Save Moment</label>
|
48 |
+
<frontend_type>select</frontend_type>
|
49 |
+
<source_model>fileattributes/system_config_source_file_save_moment</source_model>
|
50 |
+
<sort_order>20</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>0</show_in_website>
|
53 |
+
<show_in_store>0</show_in_store>
|
54 |
+
<comment><![CDATA[Will be used if an attribute has no configuration set]]></comment>
|
55 |
+
</file_save_moment>
|
56 |
+
<exceptions_handling_mode translate="label comment">
|
57 |
+
<label>Default Exceptions Handling Mode</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<source_model>fileattributes/system_config_source_exceptions_handling_mode</source_model>
|
60 |
+
<sort_order>30</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>0</show_in_website>
|
63 |
+
<show_in_store>0</show_in_store>
|
64 |
+
<comment><![CDATA[Will be used if an attribute has no configuration set]]></comment>
|
65 |
+
</exceptions_handling_mode>
|
66 |
+
<!--
|
67 |
+
// See Telemantis_FileAttributes_Model_Attribute_Backend_File on line 132
|
68 |
+
<allow_mime_header_check translate="label comment">
|
69 |
+
<label>Allow HTTP header check for MIME types validation</label>
|
70 |
+
<frontend_type>select</frontend_type>
|
71 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
72 |
+
<sort_order>40</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>0</show_in_website>
|
75 |
+
<show_in_store>0</show_in_store>
|
76 |
+
<comment><![CDATA[Depending on your server configuration, this may be needed to validate files MIME types (also used for "Image Only" value), but keep in mind that MIME type given by HTTP header is not secure and can easily be changed]]></comment>
|
77 |
+
</allow_mime_header_check>
|
78 |
+
-->
|
79 |
+
</fields>
|
80 |
+
</configuration>
|
81 |
+
</groups>
|
82 |
+
</fileattributes>
|
83 |
+
</sections>
|
84 |
+
</config>
|
app/code/community/Telemantis/FileAttributes/etc/system.xml~
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category Telemantis
|
12 |
+
* @package Telemantis_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<config>
|
18 |
+
<sections>
|
19 |
+
<fileattributes translate="label" module="fileattributes">
|
20 |
+
<label>File Attributes</label>
|
21 |
+
<tab>general</tab>
|
22 |
+
<frontend_type>text</frontend_type>
|
23 |
+
<sort_order>8000</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>0</show_in_website>
|
26 |
+
<show_in_store>0</show_in_store>
|
27 |
+
<groups>
|
28 |
+
<configuration translate="label">
|
29 |
+
<label>Configuration</label>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>10</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>0</show_in_website>
|
34 |
+
<show_in_store>0</show_in_store>
|
35 |
+
<fields>
|
36 |
+
<attributes_configurations translate="label comment">
|
37 |
+
<label>Attributes Configurations</label>
|
38 |
+
<frontend_model>fileattributes/system_config_form_field_attributes_configuration</frontend_model>
|
39 |
+
<backend_model>fileattributes/system_config_backend_serialized_attributes_configuration</backend_model>
|
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 |
+
<comment><![CDATA[<span style="text-decoration:underline;">Columns descriptions :</span><br /><strong>- Display Configuration On Fields:</strong> if set to <em>Yes</em>, configuration restrictions will be displayed on each file attribute field<br /><strong>- File Save Moment:</strong> when the file will be uploaded during entity save (the choices correspond to the _beforeSave() and _afterSave() models methods)<br /><strong>- Exceptions Handling Mode:</strong> by which way will be handled exceptions that may be thrown during file upload<br /><strong>- Allowed File Extensions:</strong> only files with those extensions will be allowed to be uploaded. This value accept various separators for listed extensions<br /><strong>- Forbidden File Extensions:</strong> all files with those extensions won't be allowed to be uploaded. This value is only used if <em>Allowed File Extensions</em> is left empty, and behaves the same way<br /><strong>- File Max Size:</strong> uploaded files will not be able to have a size bigger than one defined in this value. Please note that if server's max upload size if smaller than this value, it will be used instead<br /><strong>- Allowed MIME Types:</strong> only files with those MIME types will be allowed to uploaded. For each MIME type, indicate first its code, then its label as it will be seen by user, and separate all values with a comma<br /><strong>- Forbidden MIME Types:</strong> all files with those MIME types won't be allowed to be uploaded. This value is only used if <em>Allowed Mime Types</em> is left empty, and behaves the same way<br /><strong>- Image Only:</strong> if set to <em>Yes</em>, only images files will be allowed to be uploaded (work with MIME types validation)<br /><br /><em>Concerning the 4 following values, defining a dimension for at least one of them implies that only images files will be allowed to be uploaded</em><br /><br /><strong>- Image Min Width:</strong> only images with a width equal or greater than this value will be allowed to be uploaded<br /><strong>- Image Max Width:</strong> only images with a width equal or lesser than this value will be allowed to be uploaded<br /><strong>- Image Min Height:</strong> only images with a height equal or greater than this value will be allowed to be uploaded<br /><strong>- Image Max Height:</strong> only images with a height equal or lesser than this value will be allowed to be uploaded<br /><br /><span style="text-decoration:underline;">Note on MIME types detection :</span><br />MIME types detection is used for <em>Allowed MIME types</em>, <em>Forbidden MIME types</em> and <em>Image Only</em> values, but requires the availability of either the <em>fileinfo</em> PHP extension or the <em>mime_content_type</em> PHP function]]></comment>
|
45 |
+
</attributes_configurations>
|
46 |
+
<file_save_moment translate="label comment">
|
47 |
+
<label>Default File Save Moment</label>
|
48 |
+
<frontend_type>select</frontend_type>
|
49 |
+
<source_model>fileattributes/system_config_source_file_save_moment</source_model>
|
50 |
+
<sort_order>20</sort_order>
|
51 |
+
<show_in_default>1</show_in_default>
|
52 |
+
<show_in_website>0</show_in_website>
|
53 |
+
<show_in_store>0</show_in_store>
|
54 |
+
<comment><![CDATA[Will be used if an attribute has no configuration set]]></comment>
|
55 |
+
</file_save_moment>
|
56 |
+
<exceptions_handling_mode translate="label comment">
|
57 |
+
<label>Default Exceptions Handling Mode</label>
|
58 |
+
<frontend_type>select</frontend_type>
|
59 |
+
<source_model>fileattributes/system_config_source_exceptions_handling_mode</source_model>
|
60 |
+
<sort_order>30</sort_order>
|
61 |
+
<show_in_default>1</show_in_default>
|
62 |
+
<show_in_website>0</show_in_website>
|
63 |
+
<show_in_store>0</show_in_store>
|
64 |
+
<comment><![CDATA[Will be used if an attribute has no configuration set]]></comment>
|
65 |
+
</exceptions_handling_mode>
|
66 |
+
<!--
|
67 |
+
// See Telemantis_FileAttributes_Model_Attribute_Backend_File on line 132
|
68 |
+
<allow_mime_header_check translate="label comment">
|
69 |
+
<label>Allow HTTP header check for MIME types validation</label>
|
70 |
+
<frontend_type>select</frontend_type>
|
71 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
72 |
+
<sort_order>40</sort_order>
|
73 |
+
<show_in_default>1</show_in_default>
|
74 |
+
<show_in_website>0</show_in_website>
|
75 |
+
<show_in_store>0</show_in_store>
|
76 |
+
<comment><![CDATA[Depending on your server configuration, this may be needed to validate files MIME types (also used for "Image Only" value), but keep in mind that MIME type given by HTTP header is not secure and can easily be changed]]></comment>
|
77 |
+
</allow_mime_header_check>
|
78 |
+
-->
|
79 |
+
</fields>
|
80 |
+
</configuration>
|
81 |
+
</groups>
|
82 |
+
</fileattributes>
|
83 |
+
</sections>
|
84 |
+
</config>
|
app/code/community/Telemantis/Video/Block/Video.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* To change this template, choose Tools | Templates
|
5 |
+
* and open the template in the editor.
|
6 |
+
*/
|
7 |
+
|
8 |
+
class Telemantis_Video_Block_Video extends Mage_Core_Block_Template
|
9 |
+
{
|
10 |
+
public $_login;
|
11 |
+
|
12 |
+
public $_width;
|
13 |
+
|
14 |
+
public $_height;
|
15 |
+
|
16 |
+
public $_strech;
|
17 |
+
|
18 |
+
public $_autostart;
|
19 |
+
|
20 |
+
public $_control;
|
21 |
+
|
22 |
+
public $_controlbar;
|
23 |
+
|
24 |
+
public $_flag=1;
|
25 |
+
|
26 |
+
protected function _construct()
|
27 |
+
{
|
28 |
+
echo "kela lele"; exit;
|
29 |
+
$this->_login= Mage::getStoreConfig('video/video_group/login');
|
30 |
+
$this->_width = Mage::getStoreConfig('video/video_group/width');
|
31 |
+
$this->_height = Mage::getStoreConfig('video/video_group/height');
|
32 |
+
$this->_strech = Mage::getStoreConfig('video/video_group/stretch');
|
33 |
+
$this->_autostart = Mage::getStoreConfig('video/video_group/autostart');
|
34 |
+
$this->_controls = Mage::getStoreConfig('video/video_group/controls');
|
35 |
+
$this->_controlbar = Mage::getStoreConfig('video/video_group/controlbar');
|
36 |
+
|
37 |
+
$this->_autostart= $this->_autostart == 1 ? 'true' : 'false';
|
38 |
+
$this->_controls= $this->_controls == 1 ? 'true' : 'false';
|
39 |
+
$this->_controlbar= $this->_controlbar == 1 ? 'over' : 'none';
|
40 |
+
|
41 |
+
$this->_flag=1;
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
?>
|
app/code/community/Telemantis/Video/Helper/Data.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Contacts
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Contacts base helper
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_Contacts
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Telemantis_Video_Helper_Data extends Mage_Core_Helper_Abstract
|
35 |
+
{
|
36 |
+
|
37 |
+
|
38 |
+
}
|
app/code/community/Telemantis/Video/Helper/Data.php~
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Contacts
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Contacts base helper
|
29 |
+
*
|
30 |
+
* @category Mage
|
31 |
+
* @package Mage_Contacts
|
32 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
+
*/
|
34 |
+
class Telemantis_Video_Helper_Data extends Mage_Core_Helper_Abstract
|
35 |
+
{
|
36 |
+
|
37 |
+
|
38 |
+
}
|
app/code/community/Telemantis/Video/Model/Source.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Telemantis_Video_Model_Source extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function toOptionArray()
|
7 |
+
{
|
8 |
+
return array(
|
9 |
+
array('value' => 'none', 'label' =>'None'),
|
10 |
+
array('value' => 'exactfit', 'label' => 'Exactfit'),
|
11 |
+
array('value' => 'uniform', 'label' =>'Uniform'),
|
12 |
+
array('value' => 'fill', 'label' =>'Fill'),
|
13 |
+
// and so on...
|
14 |
+
);
|
15 |
+
}
|
16 |
+
}
|
app/code/community/Telemantis/Video/Model/Source.php~
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Telemantis_Video_Model_Source extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function toOptionArray()
|
7 |
+
{
|
8 |
+
return array(
|
9 |
+
array('value' => 'none', 'label' =>'None'),
|
10 |
+
array('value' => 'exactfit', 'label' => 'Exactfit'),
|
11 |
+
array('value' => 'uniform', 'label' =>'Uniform'),
|
12 |
+
array('value' => 'fill', 'label' =>'Fill'),
|
13 |
+
// and so on...
|
14 |
+
);
|
15 |
+
}
|
16 |
+
}
|
app/code/community/Telemantis/Video/etc/config.xml
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Telemantis_Video>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Telemantis_Video>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<helpers>
|
10 |
+
<video>
|
11 |
+
<class>Telemantis_Video_Helper</class>
|
12 |
+
</video>
|
13 |
+
</helpers>
|
14 |
+
<models>
|
15 |
+
<video>
|
16 |
+
<class>Telemantis_Video_Model</class>
|
17 |
+
</video>
|
18 |
+
</models>
|
19 |
+
</global>
|
20 |
+
<frontend>
|
21 |
+
<routers>
|
22 |
+
<video>
|
23 |
+
<use>standard</use>
|
24 |
+
<args>
|
25 |
+
<module>Telemantis_Video</module>
|
26 |
+
<frontName>video</frontName>
|
27 |
+
</args>
|
28 |
+
</video>
|
29 |
+
</routers>
|
30 |
+
<layout>
|
31 |
+
<updates>
|
32 |
+
<video>
|
33 |
+
<file>video.xml</file>
|
34 |
+
</video>
|
35 |
+
</updates>
|
36 |
+
</layout>
|
37 |
+
|
38 |
+
</frontend>
|
39 |
+
|
40 |
+
<!-- ... -->
|
41 |
+
<adminhtml>
|
42 |
+
<acl>
|
43 |
+
<resources>
|
44 |
+
<admin>
|
45 |
+
<children>
|
46 |
+
<system>
|
47 |
+
<children>
|
48 |
+
<config>
|
49 |
+
<children>
|
50 |
+
<video>
|
51 |
+
<title>Video Module Section</title>
|
52 |
+
</video>
|
53 |
+
</children>
|
54 |
+
</config>
|
55 |
+
</children>
|
56 |
+
</system>
|
57 |
+
</children>
|
58 |
+
</admin>
|
59 |
+
</resources>
|
60 |
+
</acl>
|
61 |
+
</adminhtml>
|
62 |
+
<!-- ... -->
|
63 |
+
|
64 |
+
<default>
|
65 |
+
<video>
|
66 |
+
<video_group>
|
67 |
+
<active>1</active>
|
68 |
+
<width>800</width>
|
69 |
+
<height>800</height>
|
70 |
+
<stretch>fill</stretch>
|
71 |
+
</video_group>
|
72 |
+
</video>
|
73 |
+
</default>
|
74 |
+
</config>
|
app/code/community/Telemantis/Video/etc/config.xml~
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Telemantis_Video>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Telemantis_Video>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
|
10 |
+
<helpers>
|
11 |
+
<video>
|
12 |
+
<class>Telemantis_Video_Helper</class>
|
13 |
+
</video>
|
14 |
+
</helpers>
|
15 |
+
<models>
|
16 |
+
<video>
|
17 |
+
<class>Telemantis_Video_Model</class>
|
18 |
+
</video>
|
19 |
+
</models>
|
20 |
+
</global>
|
21 |
+
<frontend>
|
22 |
+
<routers>
|
23 |
+
<video>
|
24 |
+
<use>standard</use>
|
25 |
+
<args>
|
26 |
+
<module>Telemantis_Video</module>
|
27 |
+
<frontName>video</frontName>
|
28 |
+
</args>
|
29 |
+
</video>
|
30 |
+
</routers>
|
31 |
+
<layout>
|
32 |
+
<updates>
|
33 |
+
<video>
|
34 |
+
<file>video.xml</file>
|
35 |
+
</video>
|
36 |
+
</updates>
|
37 |
+
</layout>
|
38 |
+
|
39 |
+
</frontend>
|
40 |
+
</config>
|
app/code/community/Telemantis/Video/etc/system.xml
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<videoconfig translate="label" module="video">
|
5 |
+
<label>Telemantis Video Config</label>
|
6 |
+
<sort_order>99999</sort_order>
|
7 |
+
</videoconfig>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<video translate="label" module="video">
|
11 |
+
<label>Video Config Options</label>
|
12 |
+
<tab>videoconfig</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>1000</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<video_group translate="label">
|
20 |
+
<label>Video Config Fields</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>1</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
|
27 |
+
|
28 |
+
<fields>
|
29 |
+
<active translate="label">
|
30 |
+
<label>Enabled</label>
|
31 |
+
<frontend_type>select</frontend_type>
|
32 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
33 |
+
<sort_order>1</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>1</show_in_website>
|
36 |
+
<show_in_store>0</show_in_store>
|
37 |
+
</active>
|
38 |
+
|
39 |
+
<login translate="label">
|
40 |
+
<label>User login for video</label>
|
41 |
+
<frontend_type>select</frontend_type>
|
42 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
43 |
+
<sort_order>2</sort_order>
|
44 |
+
<show_in_default>1</show_in_default>
|
45 |
+
<show_in_website>1</show_in_website>
|
46 |
+
<show_in_store>0</show_in_store>
|
47 |
+
</login>
|
48 |
+
|
49 |
+
<width translate="label">
|
50 |
+
<label>Width</label>
|
51 |
+
<frontend_type>text</frontend_type>
|
52 |
+
<sort_order>3</sort_order>
|
53 |
+
<show_in_default>1</show_in_default>
|
54 |
+
<show_in_website>1</show_in_website>
|
55 |
+
<show_in_store>0</show_in_store>
|
56 |
+
</width>
|
57 |
+
|
58 |
+
<height translate="label">
|
59 |
+
<label>Height</label>
|
60 |
+
<frontend_type>text</frontend_type>
|
61 |
+
<sort_order>4</sort_order>
|
62 |
+
<show_in_default>1</show_in_default>
|
63 |
+
<show_in_website>1</show_in_website>
|
64 |
+
<show_in_store>0</show_in_store>
|
65 |
+
</height>
|
66 |
+
|
67 |
+
<stretch translate="label">
|
68 |
+
<label>Video Streching</label>
|
69 |
+
<frontend_type>select</frontend_type>
|
70 |
+
<source_model>video/source</source_model>
|
71 |
+
<sort_order>5</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>0</show_in_store>
|
75 |
+
</stretch>
|
76 |
+
|
77 |
+
<autostart translate="label">
|
78 |
+
<label>Autostart Video</label>
|
79 |
+
<frontend_type>select</frontend_type>
|
80 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
81 |
+
<sort_order>6</sort_order>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>0</show_in_store>
|
85 |
+
</autostart>
|
86 |
+
|
87 |
+
<controls translate="label">
|
88 |
+
<label>Controls</label>
|
89 |
+
<frontend_type>select</frontend_type>
|
90 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
91 |
+
<sort_order>7</sort_order>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>0</show_in_store>
|
95 |
+
</controls>
|
96 |
+
|
97 |
+
<controlbar translate="label">
|
98 |
+
<label>Control Bar</label>
|
99 |
+
<frontend_type>select</frontend_type>
|
100 |
+
<comment>To show control bar with video</comment>
|
101 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
102 |
+
<sort_order>8</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>0</show_in_store>
|
106 |
+
</controlbar>
|
107 |
+
|
108 |
+
</fields>
|
109 |
+
</video_group>
|
110 |
+
</groups>
|
111 |
+
</video>
|
112 |
+
</sections>
|
113 |
+
</config>
|
app/code/community/Telemantis/Video/etc/system.xml~
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<general>
|
5 |
+
<groups>
|
6 |
+
<video translate="label" module="video">
|
7 |
+
<label>Video Player Gift card </label>
|
8 |
+
<sort_order>670</sort_order>
|
9 |
+
<show_in_default>1</show_in_default>
|
10 |
+
<show_in_website>1</show_in_website>
|
11 |
+
<show_in_store>0</show_in_store>
|
12 |
+
<fields>
|
13 |
+
<active translate="label">
|
14 |
+
<label>Enabled</label>
|
15 |
+
<frontend_type>select</frontend_type>
|
16 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
17 |
+
<sort_order>1</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>0</show_in_store>
|
21 |
+
</active>
|
22 |
+
|
23 |
+
<login translate="label">
|
24 |
+
<label>User login for video</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>2</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</login>
|
32 |
+
|
33 |
+
<width translate="label">
|
34 |
+
<label>Width</label>
|
35 |
+
<frontend_type>text</frontend_type>
|
36 |
+
<sort_order>3</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
</width>
|
41 |
+
|
42 |
+
<height translate="label">
|
43 |
+
<label>Height</label>
|
44 |
+
<frontend_type>text</frontend_type>
|
45 |
+
<sort_order>3</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>0</show_in_store>
|
49 |
+
</height>
|
50 |
+
|
51 |
+
<stretch translate="label">
|
52 |
+
<label>Video Streching</label>
|
53 |
+
<frontend_type>select</frontend_type>
|
54 |
+
<source_model>video/source</source_model>
|
55 |
+
<sort_order>4</sort_order>
|
56 |
+
<show_in_default>1</show_in_default>
|
57 |
+
<show_in_website>1</show_in_website>
|
58 |
+
<show_in_store>0</show_in_store>
|
59 |
+
</stretch>
|
60 |
+
|
61 |
+
<autostart translate="label">
|
62 |
+
<label>Autostart Video</label>
|
63 |
+
<frontend_type>select</frontend_type>
|
64 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
65 |
+
<sort_order>6</sort_order>
|
66 |
+
<show_in_default>1</show_in_default>
|
67 |
+
<show_in_website>1</show_in_website>
|
68 |
+
<show_in_store>0</show_in_store>
|
69 |
+
</autostart>
|
70 |
+
|
71 |
+
<controls translate="label">
|
72 |
+
<label>Controls</label>
|
73 |
+
<frontend_type>select</frontend_type>
|
74 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
75 |
+
<sort_order>7</sort_order>
|
76 |
+
<show_in_default>1</show_in_default>
|
77 |
+
<show_in_website>1</show_in_website>
|
78 |
+
<show_in_store>0</show_in_store>
|
79 |
+
</controls>
|
80 |
+
|
81 |
+
</fields>
|
82 |
+
</video>
|
83 |
+
</groups>
|
84 |
+
</general>
|
85 |
+
</sections>
|
86 |
+
</config>
|
app/design/adminhtml/default/default/layout/tl/fileattributes.xml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* NOTICE OF LICENSE
|
5 |
+
*
|
6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
8 |
+
* It is also available through the world-wide-web at this URL:
|
9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
10 |
+
*
|
11 |
+
* @category BL
|
12 |
+
* @package BL_FileAttributes
|
13 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
14 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
15 |
+
*/
|
16 |
+
-->
|
17 |
+
<layout>
|
18 |
+
<default>
|
19 |
+
<reference name="head">
|
20 |
+
<action method="addCss"><css>tl/fileattributes/styles.css</css></action>
|
21 |
+
</reference>
|
22 |
+
</default>
|
23 |
+
|
24 |
+
<adminhtml_system_config_edit>
|
25 |
+
<reference name="head">
|
26 |
+
<action method="addJs"><js>tl/fileattributes/script.js</js></action>
|
27 |
+
</reference>
|
28 |
+
</adminhtml_system_config_edit>
|
29 |
+
|
30 |
+
<fileattributes_adminhtml_obsolete_files_index>
|
31 |
+
<reference name="content">
|
32 |
+
<block type="fileattributes/adminhtml_obsolete_files" name="fileattributes.obsolete_files" />
|
33 |
+
</reference>
|
34 |
+
</fileattributes_adminhtml_obsolete_files_index>
|
35 |
+
</layout>
|
app/design/adminhtml/default/default/template/tl/fileattributes/system/config/form/field/array.phtml
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
/**
|
29 |
+
* NOTICE OF LICENSE
|
30 |
+
*
|
31 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
32 |
+
* that is bundled with this package in the file LICENSE.txt.
|
33 |
+
* It is also available through the world-wide-web at this URL:
|
34 |
+
* http://opensource.org/licenses/osl-3.0.php
|
35 |
+
*
|
36 |
+
* @category BL
|
37 |
+
* @package BL_FileAttributes
|
38 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
39 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
40 |
+
*/
|
41 |
+
?>
|
42 |
+
<?php
|
43 |
+
$_htmlId = $this->getHtmlId() ? $this->getHtmlId() : '_' . uniqid();
|
44 |
+
$_colspan = 2;
|
45 |
+
if (!$this->_addAfter) {
|
46 |
+
$_colspan -= 1;
|
47 |
+
}
|
48 |
+
$_columnsNumber = count($this->_columns) + $_colspan;
|
49 |
+
$_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
|
50 |
+
?>
|
51 |
+
|
52 |
+
<div class="grid" id="grid<?php echo $_htmlId ?>">
|
53 |
+
<table cellpadding="0" cellspacing="0" class="border">
|
54 |
+
<tbody>
|
55 |
+
|
56 |
+
<tr class="headings" id="headings<?php echo $_htmlId ?>">
|
57 |
+
<?php foreach ($this->_columns as $columnName => $column):?>
|
58 |
+
<th><?php echo $column['label'] ?></th>
|
59 |
+
<?php endforeach;?>
|
60 |
+
<th <?php echo $_colspan?>></th>
|
61 |
+
</tr>
|
62 |
+
|
63 |
+
<tr id="addRow<?php echo $_htmlId ?>">
|
64 |
+
<td colspan="<?php echo $_columnsNumber ?>" class="a-right">
|
65 |
+
<button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>">
|
66 |
+
<span><?php echo $this->_addButtonLabel ?></span>
|
67 |
+
</button>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
|
71 |
+
</tbody>
|
72 |
+
</table>
|
73 |
+
<input type="hidden" name="<?php echo $this->getElement()->getName() ?>[__empty]" value="" />
|
74 |
+
</div>
|
75 |
+
<div id="empty<?php echo $_htmlId ?>" <?php if ($this->getEmptyWidth()): ?>style="width:<?php echo $this->getEmptyWidth() ?>px;"<?php endif ?>>
|
76 |
+
<button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>">
|
77 |
+
<span><?php echo $this->_addButtonLabel ?></span>
|
78 |
+
</button>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
<script type="text/javascript">
|
82 |
+
//<![CDATA[
|
83 |
+
// create row creator
|
84 |
+
var arrayRow<?php echo $_htmlId ?> = {
|
85 |
+
// define row prototypeJS template
|
86 |
+
template : new Template(
|
87 |
+
'<tr id="#{_id}">'
|
88 |
+
<?php foreach ($this->_columns as $columnName => $column):?>
|
89 |
+
+'<td>'
|
90 |
+
+'<?php echo $this->_renderCellTemplate($columnName)?>'
|
91 |
+
+'<\/td>'
|
92 |
+
<?php endforeach;?>
|
93 |
+
<?php if ($this->_addAfter):?>
|
94 |
+
+'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><?php echo Mage::helper('adminhtml')->__('Add after') ?><\/span><\/button><\/td>'
|
95 |
+
<?php endif;?>
|
96 |
+
+'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><?php echo Mage::helper('adminhtml')->__('Delete') ?><\/span><\/button><\/td>'
|
97 |
+
+'<\/tr>'
|
98 |
+
),
|
99 |
+
|
100 |
+
rowsCount : 0,
|
101 |
+
|
102 |
+
add : function(templateData, insertAfterId, useCompacter)
|
103 |
+
{
|
104 |
+
// generate default template data
|
105 |
+
if ('' == templateData) {
|
106 |
+
var d = new Date();
|
107 |
+
var templateData = {
|
108 |
+
<?php foreach ($this->_columns as $columnName => $column):?>
|
109 |
+
<?php echo $columnName ?> : '',
|
110 |
+
<?php endforeach;?>
|
111 |
+
_id : '_' + d.getTime() + '_' + d.getMilliseconds()
|
112 |
+
};
|
113 |
+
<?php if ($_defaultJson = $this->getDefaultArrayRowJson()): ?>
|
114 |
+
templateData = $H(templateData).merge(<?php echo $this->getDefaultArrayRowJson() ?>).toObject();
|
115 |
+
<?php endif ?>
|
116 |
+
}
|
117 |
+
|
118 |
+
// insert before last row
|
119 |
+
if ('' == insertAfterId) {
|
120 |
+
Element.insert($('addRow<?php echo $_htmlId ?>'), {before: this.template.evaluate(templateData)});
|
121 |
+
}
|
122 |
+
// insert after specified row
|
123 |
+
else {
|
124 |
+
Element.insert($(insertAfterId), {after: this.template.evaluate(templateData)});
|
125 |
+
}
|
126 |
+
|
127 |
+
<?php if ($this->_addAfter):?>
|
128 |
+
Event.observe('addAfterBtn' + templateData._id, 'click', this.add.bind(this, '', templateData._id));
|
129 |
+
<?php endif;?>
|
130 |
+
|
131 |
+
this.rowsCount += 1;
|
132 |
+
|
133 |
+
if (useCompacter) {
|
134 |
+
compacter<?php echo $_htmlId ?>.addRow($(templateData._id));
|
135 |
+
}
|
136 |
+
},
|
137 |
+
|
138 |
+
del : function(rowId)
|
139 |
+
{
|
140 |
+
compacter<?php echo $_htmlId ?>.removeRow($(rowId));
|
141 |
+
$(rowId).remove();
|
142 |
+
this.rowsCount -= 1;
|
143 |
+
if (0 == this.rowsCount) {
|
144 |
+
this.showButtonOnly();
|
145 |
+
}
|
146 |
+
},
|
147 |
+
|
148 |
+
showButtonOnly : function()
|
149 |
+
{
|
150 |
+
$('grid<?php echo $_htmlId ?>').hide();
|
151 |
+
$('empty<?php echo $_htmlId ?>').show();
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
// bind add action to "Add" button in last row
|
156 |
+
Event.observe('addToEndBtn<?php echo $_htmlId ?>', 'click', arrayRow<?php echo $_htmlId ?>.add.bind(arrayRow<?php echo $_htmlId ?>, '', '', true));
|
157 |
+
|
158 |
+
// add existing rows
|
159 |
+
<?php
|
160 |
+
$_addAfterId = "headings{$_htmlId}";
|
161 |
+
foreach ($this->getArrayRows() as $_rowId => $_row) {
|
162 |
+
echo "arrayRow{$_htmlId}.add(" . $_row->toJson() . ", '{$_addAfterId}', false);\n";
|
163 |
+
$_addAfterId = $_rowId;
|
164 |
+
}
|
165 |
+
?>
|
166 |
+
|
167 |
+
// initialize standalone button
|
168 |
+
$('empty<?php echo $_htmlId ?>').hide();
|
169 |
+
Event.observe('emptyAddBtn<?php echo $_htmlId ?>', 'click', function () {
|
170 |
+
$('grid<?php echo $_htmlId ?>').show();
|
171 |
+
$('empty<?php echo $_htmlId ?>').hide();
|
172 |
+
arrayRow<?php echo $_htmlId ?>.add('', '', true);
|
173 |
+
});
|
174 |
+
|
175 |
+
// compact table
|
176 |
+
var compacter<?php echo $_htmlId ?> = new blfa.SystemConfigArrayFieldCompacter('grid<?php echo $_htmlId ?>', 25, {
|
177 |
+
compactImageUrl: '<?php echo $this->getSkinUrl('bl/fileattributes/images/ico_compact.png') ?>',
|
178 |
+
unpackImageUrl: '<?php echo $this->getSkinUrl('bl/fileattributes/images/ico_unpack.png') ?>',
|
179 |
+
compactTitle: '<?php echo $this->jsQuoteEscape($this->__('Minimize')) ?>',
|
180 |
+
unpackTitle: '<?php echo $this->jsQuoteEscape($this->__('Maximize')) ?>'
|
181 |
+
});
|
182 |
+
|
183 |
+
// if no rows, hide grid and show button only
|
184 |
+
<?php if (!$this->getArrayRows()):?>
|
185 |
+
arrayRow<?php echo $_htmlId ?>.showButtonOnly();
|
186 |
+
<?php endif;?>
|
187 |
+
|
188 |
+
// toggle the grid, if element is disabled (depending on scope)
|
189 |
+
<?php if ($this->getElement()->getDisabled()):?>
|
190 |
+
toggleValueElements({checked:true}, $('grid<?php echo $_htmlId ?>').parentNode);
|
191 |
+
<?php endif;?>
|
192 |
+
//]]>
|
193 |
+
</script>
|
app/design/frontend/default/default/layout/video.xml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<catalog_product_view translate="label">
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addJs"><script>video/jwplayer.js</script></action>
|
6 |
+
<action method="addJs"><script>video/video.js</script></action>
|
7 |
+
<action method="addCss"><stylesheet>css/video/video.css</stylesheet></action>
|
8 |
+
<!--<action method="addJs"><script>video/jwplayer.html5.js</script></action> -->
|
9 |
+
</reference>
|
10 |
+
|
11 |
+
<reference name="content">
|
12 |
+
<block type="catalog/product_view" name="product_video" as="product_video">
|
13 |
+
<action method="setTemplate" ifconfig="video/video_group/active"><template>video/video.phtml</template></action>
|
14 |
+
</block>
|
15 |
+
</reference>
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
<reference name="product.info.media">
|
20 |
+
<action method="setTemplate" ifconfig="video/video_group/active"><template>video/media.phtml</template></action>
|
21 |
+
</reference>
|
22 |
+
|
23 |
+
</catalog_product_view>
|
24 |
+
|
25 |
+
</layout>
|
app/design/frontend/default/default/template/video/media.phtml
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Product media data template
|
29 |
+
*
|
30 |
+
* @see Mage_Catalog_Block_Product_View_Media
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<?php
|
34 |
+
|
35 |
+
$_product = $this->getProduct();
|
36 |
+
$_helper = $this->helper('catalog/output');
|
37 |
+
?>
|
38 |
+
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
|
39 |
+
<p class="product-image product-image-zoom">
|
40 |
+
<?php
|
41 |
+
$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
42 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
43 |
+
?>
|
44 |
+
</p>
|
45 |
+
<p class="zoom-notice" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p>
|
46 |
+
<div class="zoom">
|
47 |
+
<img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" title="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" />
|
48 |
+
<div id="track">
|
49 |
+
<div id="handle"></div>
|
50 |
+
</div>
|
51 |
+
<img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" title="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" />
|
52 |
+
</div>
|
53 |
+
<script type="text/javascript">
|
54 |
+
//<![CDATA[
|
55 |
+
Event.observe(window, 'load', function() {
|
56 |
+
product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint');
|
57 |
+
});
|
58 |
+
//]]>
|
59 |
+
</script>
|
60 |
+
<?php else: ?>
|
61 |
+
<p class="product-image">
|
62 |
+
<?php
|
63 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
64 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
65 |
+
?>
|
66 |
+
</p>
|
67 |
+
<?php endif; ?>
|
68 |
+
<?php if (count($this->getGalleryImages()) > 0): ?>
|
69 |
+
<div class="more-views">
|
70 |
+
<h2><?php echo $this->__('More Views') ?></h2>
|
71 |
+
<ul>
|
72 |
+
<?php foreach ($this->getGalleryImages() as $_image): ?>
|
73 |
+
<li>
|
74 |
+
<a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
|
75 |
+
</li>
|
76 |
+
<?php endforeach; ?>
|
77 |
+
</ul>
|
78 |
+
</div>
|
79 |
+
<?php endif; ?>
|
80 |
+
|
81 |
+
<?php
|
82 |
+
$login= Mage::getStoreConfig('general/video/login');
|
83 |
+
$flag=1;
|
84 |
+
|
85 |
+
?>
|
86 |
+
|
87 |
+
|
88 |
+
<?php if ($video = $_product->getVideo()): ?>
|
89 |
+
|
90 |
+
<?php if($login): ?>
|
91 |
+
|
92 |
+
<?php if(!Mage::helper('customer')->isLoggedIn()): ?>
|
93 |
+
|
94 |
+
<a href=<?php echo $this->getUrl('customer/account/login')?>><?php echo $this->helper('core')->__('Please login To watch video') ?></a>
|
95 |
+
|
96 |
+
<?php $flag=0; endif; ?>
|
97 |
+
<?php endif; ?>
|
98 |
+
<?php if($flag): ?>
|
99 |
+
<?php if( file_exists( getcwd() .'/media/blfa_files/'. $video ) ): ?>
|
100 |
+
<a href="#" onclick="showVideo(); return false;" class="video_anchor"><img src="<?php echo $this->getSkinUrl('images/video/Skyvideoicon.png') ?>" width="100"/></a>
|
101 |
+
<?php endif; ?>
|
102 |
+
<?php endif; ?>
|
103 |
+
<?php endif; ?>
|
104 |
+
|
app/design/frontend/default/default/template/video/media.phtml~
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Product media data template
|
29 |
+
*
|
30 |
+
* @see Mage_Catalog_Block_Product_View_Media
|
31 |
+
*/
|
32 |
+
?>
|
33 |
+
<?php
|
34 |
+
|
35 |
+
$_product = $this->getProduct();
|
36 |
+
$_helper = $this->helper('catalog/output');
|
37 |
+
?>
|
38 |
+
<?php if ($_product->getImage() != 'no_selection' && $_product->getImage()): ?>
|
39 |
+
<p class="product-image product-image-zoom">
|
40 |
+
<?php
|
41 |
+
$_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
42 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
43 |
+
?>
|
44 |
+
</p>
|
45 |
+
<p class="zoom-notice" id="track_hint"><?php echo $this->__('Double click on above image to view full picture') ?></p>
|
46 |
+
<div class="zoom">
|
47 |
+
<img id="zoom_out" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_out.gif') ?>" alt="<?php echo $this->__('Zoom Out') ?>" title="<?php echo $this->__('Zoom Out') ?>" class="btn-zoom-out" />
|
48 |
+
<div id="track">
|
49 |
+
<div id="handle"></div>
|
50 |
+
</div>
|
51 |
+
<img id="zoom_in" src="<?php echo $this->getSkinUrl('images/slider_btn_zoom_in.gif') ?>" alt="<?php echo $this->__('Zoom In') ?>" title="<?php echo $this->__('Zoom In') ?>" class="btn-zoom-in" />
|
52 |
+
</div>
|
53 |
+
<script type="text/javascript">
|
54 |
+
//<![CDATA[
|
55 |
+
Event.observe(window, 'load', function() {
|
56 |
+
product_zoom = new Product.Zoom('image', 'track', 'handle', 'zoom_in', 'zoom_out', 'track_hint');
|
57 |
+
});
|
58 |
+
//]]>
|
59 |
+
</script>
|
60 |
+
<?php else: ?>
|
61 |
+
<p class="product-image">
|
62 |
+
<?php
|
63 |
+
$_img = '<img src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
|
64 |
+
echo $_helper->productAttribute($_product, $_img, 'image');
|
65 |
+
?>
|
66 |
+
</p>
|
67 |
+
<?php endif; ?>
|
68 |
+
<?php if (count($this->getGalleryImages()) > 0): ?>
|
69 |
+
<div class="more-views">
|
70 |
+
<h2><?php echo $this->__('More Views') ?></h2>
|
71 |
+
<ul>
|
72 |
+
<?php foreach ($this->getGalleryImages() as $_image): ?>
|
73 |
+
<li>
|
74 |
+
<a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"><img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" width="56" height="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" /></a>
|
75 |
+
</li>
|
76 |
+
<?php endforeach; ?>
|
77 |
+
</ul>
|
78 |
+
</div>
|
79 |
+
<?php endif; ?>
|
80 |
+
|
81 |
+
<?php
|
82 |
+
$login= Mage::getStoreConfig('general/video/login');
|
83 |
+
$flag=1;
|
84 |
+
|
85 |
+
?>
|
86 |
+
|
87 |
+
|
88 |
+
<?php if ($video = $_product->getVideo()): ?>
|
89 |
+
|
90 |
+
<?php if($login): ?>
|
91 |
+
|
92 |
+
<?php if(!Mage::helper('customer')->isLoggedIn()): ?>
|
93 |
+
|
94 |
+
<a href=<?php echo $this->getUrl('customer/account/login')?>><?php echo $this->helper('core')->__('Please login To watch video') ?></a>
|
95 |
+
|
96 |
+
<?php $flag=0; endif; ?>
|
97 |
+
<?php endif; ?>
|
98 |
+
<?php if($flag): ?>
|
99 |
+
<?php if( file_exists( getcwd() .'/media/blfa_files/'. $video ) ): ?>
|
100 |
+
<a href="#" onclick="showVideo(); return false;" class="vidoe_anhcor"><img src="<?php echo $this->getSkinUrl('images/Skyvideoicon.png') ?>" width="100"/></a>
|
101 |
+
|
102 |
+
<script type="text/javascript">
|
103 |
+
function showVideo(){
|
104 |
+
document.getElementById('vid').style.display="block";
|
105 |
+
jwplayer().play(true);
|
106 |
+
}
|
107 |
+
//]]>
|
108 |
+
</script>
|
109 |
+
<?php endif; ?>
|
110 |
+
<?php endif; ?>
|
111 |
+
<?php endif; ?>
|
112 |
+
|
app/design/frontend/default/default/template/video/video.phtml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$login= Mage::getStoreConfig('video/video_group/login');
|
4 |
+
$width = Mage::getStoreConfig('video/video_group/width');
|
5 |
+
$height = Mage::getStoreConfig('video/video_group/height');
|
6 |
+
$strech = Mage::getStoreConfig('video/video_group/stretch');
|
7 |
+
$autostart = Mage::getStoreConfig('video/video_group/autostart');
|
8 |
+
$controls = Mage::getStoreConfig('video/video_group/controls');
|
9 |
+
$controlbar = Mage::getStoreConfig('video/video_group/controlbar');
|
10 |
+
|
11 |
+
$autostart= $autostart == 1 ? 'true' : 'false';
|
12 |
+
$controls= $controls == 1 ? 'true' : 'false';
|
13 |
+
$controlbar= $controlbar == 1 ? 'over' : 'none';
|
14 |
+
|
15 |
+
$flag=1;
|
16 |
+
|
17 |
+
?>
|
18 |
+
|
19 |
+
<?php if($login): ?><?php if(!Mage::helper('customer')->isLoggedIn()): $flag=0; endif; ?><?php endif; ?>
|
20 |
+
|
21 |
+
<?php if($flag): ?>
|
22 |
+
|
23 |
+
<?php $_product = $this->getProduct();?>
|
24 |
+
|
25 |
+
<?php if( $video = $_product->getVideo() ){ ?>
|
26 |
+
<?php
|
27 |
+
$video_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."blfa_files/".$video;
|
28 |
+
$swf_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS)."video/player.swf";
|
29 |
+
?>
|
30 |
+
<div class="product_video" onmouseover="$('close_a').show();" onmouseout="$('close_a').hide()" >
|
31 |
+
|
32 |
+
<?php if( file_exists( getcwd() .'/media/blfa_files/'. $video ) ){ ?>
|
33 |
+
|
34 |
+
|
35 |
+
<div class="video" id="vid" <?php if($autostart=='true'): ?>style=display:block <?php endif; ?> >
|
36 |
+
<div class="a_container"> <a href="#" onclick="stopVideo()" style="display:none" id="close_a"> <img src="<?php echo $this->getSkinUrl('images/video/close.jpg') ?>" width="18"/> </a></div>
|
37 |
+
<div id="container" >Loading the player ...</div>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<?php } else { ?>
|
41 |
+
<script> alert("video <?php echo $video ?> not found");</script>
|
42 |
+
<?php } ?>
|
43 |
+
</div>
|
44 |
+
<?php } ?>
|
45 |
+
<?php endif ;?>
|
46 |
+
|
47 |
+
|
48 |
+
<script type="text/javascript">
|
49 |
+
jwplayer("container").setup({
|
50 |
+
flashplayer: "<?php echo $swf_url ?>",
|
51 |
+
autostart: <?php echo $autostart ?>,
|
52 |
+
controlbar: "<?php echo $controlbar ?>",
|
53 |
+
file: "<?php echo $video_url ?>",
|
54 |
+
//type: 'mp4',
|
55 |
+
controls:<?php echo $controls ?>,
|
56 |
+
logo: {
|
57 |
+
hide: true,
|
58 |
+
position: 'top-left'
|
59 |
+
|
60 |
+
},
|
61 |
+
width: '<?php echo $width ?>',
|
62 |
+
height: '<?php echo $height ?>',
|
63 |
+
stretching:'<?php echo $strech ?>',
|
64 |
+
screencolor:'FFFFFF',
|
65 |
+
//fallback:false,
|
66 |
+
|
67 |
+
plugins: {
|
68 |
+
'viral-2': {'oncomplete':'False','onpause':'False','functions':'All'}
|
69 |
+
},
|
70 |
+
events: {
|
71 |
+
onComplete: function() {document.getElementById('vid').style.display="none" ;}
|
72 |
+
}
|
73 |
+
});
|
74 |
+
|
75 |
+
</script>
|
76 |
+
|
app/design/frontend/default/default/template/video/video.phtml~
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
|
3 |
+
.video{display: block;left: 254px;position: absolute;top: 197px;}
|
4 |
+
|
5 |
+
|
6 |
+
</style>
|
7 |
+
<?php
|
8 |
+
|
9 |
+
$login= Mage::getStoreConfig('general/video/login');
|
10 |
+
$flag=1;
|
11 |
+
|
12 |
+
?>
|
13 |
+
|
14 |
+
<?php if($login): ?><?php if(!Mage::helper('customer')->isLoggedIn()): $flag=0; endif; ?><?php endif; ?>
|
15 |
+
|
16 |
+
<?php if($flag): ?>
|
17 |
+
<?php $_product = $this->getProduct();?>
|
18 |
+
|
19 |
+
<?php if( $video = $_product->getVideo() ){ ?>
|
20 |
+
<?php
|
21 |
+
$video_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."blfa_files/".$video;
|
22 |
+
$swf_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS)."video/jwplayer.flash.swf";
|
23 |
+
?>
|
24 |
+
<div class="products">
|
25 |
+
|
26 |
+
<?php if( file_exists( getcwd() .'/media/blfa_files/'. $video ) ){ ?>
|
27 |
+
|
28 |
+
|
29 |
+
<div class="video" id="vid">
|
30 |
+
<div id="container" >Loading the player ...</div>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<script type="text/javascript">
|
34 |
+
jwplayer("container").setup({
|
35 |
+
flashplayer: "<?php echo $swf_url ?>",
|
36 |
+
autostart: true,
|
37 |
+
file: "<?php echo $video_url ?>",
|
38 |
+
//type: 'mp4',
|
39 |
+
controls:false,
|
40 |
+
logo: {
|
41 |
+
hide: true,
|
42 |
+
position: 'top-left'
|
43 |
+
|
44 |
+
},
|
45 |
+
width: '265',
|
46 |
+
height: '300',
|
47 |
+
stretching:'fill',
|
48 |
+
screencolor:'FFFFFF',
|
49 |
+
//fallback:false,
|
50 |
+
events: {
|
51 |
+
onComplete: function() {document.getElementById('vid').style.display="none" ;}
|
52 |
+
}
|
53 |
+
});
|
54 |
+
</script>
|
55 |
+
|
56 |
+
|
57 |
+
<?php } else { ?>
|
58 |
+
<script> alert("video <?php echo $video ?> not found");</script>
|
59 |
+
<?php } ?>
|
60 |
+
</div>
|
61 |
+
<?php } ?>
|
62 |
+
<?php endif ;?>
|
63 |
+
|
app/etc/modules/Telemantis_FileAttributes.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Telemantis_FileAttributes>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Telemantis_FileAttributes>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Telemantis_Video.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Telemantis_Video>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Telemantis_Video>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/tl/fileattributes/script.js
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* NOTICE OF LICENSE
|
3 |
+
*
|
4 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
5 |
+
* that is bundled with this package in the file LICENSE.txt.
|
6 |
+
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://opensource.org/licenses/osl-3.0.php
|
8 |
+
*
|
9 |
+
* @category Telemantis
|
10 |
+
* @package Telemantis_FileAttributes
|
11 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
12 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
13 |
+
*/
|
14 |
+
|
15 |
+
if (typeof(blfa) == 'undefined') {
|
16 |
+
var blfa = {};
|
17 |
+
}
|
18 |
+
|
19 |
+
blfa.SystemConfigArrayFieldCompacter = Class.create()
|
20 |
+
blfa.SystemConfigArrayFieldCompacter.prototype =
|
21 |
+
{
|
22 |
+
initialize: function(containerId, compactedWidth, config)
|
23 |
+
{
|
24 |
+
// Some cells styles are not working with IE 6/7, then do nothing at all on those browsers
|
25 |
+
this.isAppliable = (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
|
26 |
+
this.isAppliable = (this.isAppliable ? (Number(RegExp.$1) != 6) && (Number(Regexp.$1) != 7) : true);
|
27 |
+
|
28 |
+
this.containerId = containerId;
|
29 |
+
this.container = $(this.containerId);
|
30 |
+
this.table = this.container.getElementsBySelector('table').first();
|
31 |
+
|
32 |
+
this.compactedWidth = compactedWidth;
|
33 |
+
this.config = Object.extend({
|
34 |
+
compactImageUrl: '',
|
35 |
+
unpackImageUrl: '',
|
36 |
+
compactTitle: '',
|
37 |
+
unpackTitle: ''
|
38 |
+
}, config || {});
|
39 |
+
|
40 |
+
this.unpackedColumn = null;
|
41 |
+
this.initRows();
|
42 |
+
this.initColumnsWidths(true, true);
|
43 |
+
},
|
44 |
+
|
45 |
+
initRows: function()
|
46 |
+
{
|
47 |
+
if (!this.isAppliable) {
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
|
51 |
+
this.rows = this.table.getElementsBySelector('tr');
|
52 |
+
this.rowsNumber = this.rows.length;
|
53 |
+
this.rowsCells = $H({});
|
54 |
+
this.columnsNumber = 0;
|
55 |
+
this.columnsTitles = $A({});
|
56 |
+
|
57 |
+
this.rows.each(function(row, rowIndex){
|
58 |
+
if (rowIndex < this.rowsNumber-1) {
|
59 |
+
// All rows but last ("Add row") one
|
60 |
+
var cellTagName = (rowIndex == 0 ? 'th' : 'td');
|
61 |
+
var cells = $(row).getElementsBySelector(cellTagName);
|
62 |
+
|
63 |
+
if (rowIndex == 0) {
|
64 |
+
this.columnsNumber = cells.length;
|
65 |
+
}
|
66 |
+
|
67 |
+
cells.each(function(cell, columnIndex){
|
68 |
+
cell = $(cell);
|
69 |
+
|
70 |
+
if (columnIndex < this.columnsNumber-1) {
|
71 |
+
// All cells but last one (actions buttons)
|
72 |
+
if (rowIndex == 0) {
|
73 |
+
// Header row
|
74 |
+
|
75 |
+
// Get column title (will be used for all column's cells)
|
76 |
+
this.columnsTitles.push(cell.innerHTML);
|
77 |
+
cell.writeAttribute('title', cell.innerHTML);
|
78 |
+
|
79 |
+
// Add a button to shrink / extends the whold corresponding column
|
80 |
+
var img = $(document.createElement('img'));
|
81 |
+
img.writeAttribute({
|
82 |
+
'src': this.config.unpackImageUrl,
|
83 |
+
'title': this.config.unpackTitle,
|
84 |
+
'alt': this.config.unpackTitle
|
85 |
+
});
|
86 |
+
img.setStyle({
|
87 |
+
'cursor': 'pointer',
|
88 |
+
'verticalAlign': 'middle',
|
89 |
+
'marginRight': '3px'
|
90 |
+
});
|
91 |
+
|
92 |
+
img.observe('click', function(){
|
93 |
+
if (this.unpackedColumn
|
94 |
+
&& (this.unpackedColumn-1 == columnIndex)) {
|
95 |
+
this.compactColumn(columnIndex);
|
96 |
+
this.unpackedColumn = null;
|
97 |
+
} else {
|
98 |
+
if (this.unpackedColumn) {
|
99 |
+
this.compactColumn(this.unpackedColumn-1);
|
100 |
+
}
|
101 |
+
this.unpackColumn(columnIndex);
|
102 |
+
this.unpackedColumn = columnIndex+1;
|
103 |
+
}
|
104 |
+
}.bind(this));
|
105 |
+
|
106 |
+
cell.insert({'top': img});
|
107 |
+
} else {
|
108 |
+
// Common row
|
109 |
+
cell.writeAttribute('title', this.columnsTitles[columnIndex]);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}.bind(this));
|
113 |
+
|
114 |
+
this.rowsCells.set(row.id, cells);
|
115 |
+
}
|
116 |
+
}.bind(this));
|
117 |
+
},
|
118 |
+
|
119 |
+
setCellWidth: function(cell, width, unpacked)
|
120 |
+
{
|
121 |
+
cell.setStyle({
|
122 |
+
'width': width+'px',
|
123 |
+
'maxWidth': (unpacked ? '' : width+'px'),
|
124 |
+
'overflow': (unpacked ? 'visible' : 'hidden')
|
125 |
+
}).writeAttribute('width', width);
|
126 |
+
},
|
127 |
+
|
128 |
+
setColumnWidth: function(index, width, unpacked)
|
129 |
+
{
|
130 |
+
this.rowsCells.values().each(function(cells){
|
131 |
+
this.setCellWidth(cells[index], width, unpacked);
|
132 |
+
}.bind(this));
|
133 |
+
},
|
134 |
+
|
135 |
+
initColumnsWidths: function(all, option)
|
136 |
+
{
|
137 |
+
if (!this.isAppliable) {
|
138 |
+
return;
|
139 |
+
}
|
140 |
+
|
141 |
+
this.table.setStyle({'tableLayout': 'auto'});
|
142 |
+
|
143 |
+
if (!all) {
|
144 |
+
// Row given : init its widths and refresh columns widths whenever needed
|
145 |
+
var rowId = option;
|
146 |
+
this.rowsWidths.set(rowId, $A({}));
|
147 |
+
var updatedColumns = $A({});
|
148 |
+
|
149 |
+
this.rowsCells.get(rowId).each(function(cell, columnIndex){
|
150 |
+
var width = cell.getWidth();
|
151 |
+
this.rowsWidths.get(rowId)[columnIndex] = width;
|
152 |
+
if (width > this.columnsWidths[columnIndex]) {
|
153 |
+
this.columnsWidths[columnIndex] = width;
|
154 |
+
updatedColumns.push(columnIndex);
|
155 |
+
}
|
156 |
+
}.bind(this));
|
157 |
+
|
158 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
159 |
+
if (updatedColumns.indexOf(i) != -1) {
|
160 |
+
if (i == this.columnsNumber-1) {
|
161 |
+
// Last column was updated : fix again its dimensions accordingly
|
162 |
+
this.setColumnWidth(i, this.columnsWidths[i], true);
|
163 |
+
} else if (this.unpackedColumn && (i == this.unpackedColumn-1)) {
|
164 |
+
// Currently unpacked column was updated : unpack it again
|
165 |
+
this.unpackColumn(i);
|
166 |
+
} else {
|
167 |
+
// All other columns : compact current cell
|
168 |
+
this.setColumnWidth(i, this.compactedWidth, false);
|
169 |
+
}
|
170 |
+
} else {
|
171 |
+
if (this.unpackedColumn && (this.unpackedColumn-1 == i)) {
|
172 |
+
this.setCellWidth(this.rowsCells.get(rowId)[i], this.columnsWidths[i], true);
|
173 |
+
} else {
|
174 |
+
this.setCellWidth(this.rowsCells.get(rowId)[i], this.compactedWidth, false);
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
} else {
|
179 |
+
if (option) {
|
180 |
+
// Complete init of columns/rows cells widths
|
181 |
+
this.columnsWidths = $A({});
|
182 |
+
this.rowsWidths = $H({});
|
183 |
+
|
184 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
185 |
+
this.columnsWidths[i] = 0;
|
186 |
+
}
|
187 |
+
|
188 |
+
// Compute max width for each column
|
189 |
+
this.rowsCells.values().each(function(cells, rowIndex){
|
190 |
+
var rowId = this.rows[rowIndex].id;
|
191 |
+
this.rowsWidths.set(rowId, $A({}));
|
192 |
+
|
193 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
194 |
+
this.rowsWidths.get(rowId)[i] = cells[i].getWidth();
|
195 |
+
this.columnsWidths[i] = Math.max(this.rowsWidths.get(rowId)[i], this.columnsWidths[i]);
|
196 |
+
}
|
197 |
+
}.bind(this));
|
198 |
+
|
199 |
+
// Fix last column width now, as it is not said to be compactable
|
200 |
+
this.setColumnWidth(this.columnsNumber-1, this.columnsWidths[this.columnsNumber-1], true);
|
201 |
+
|
202 |
+
// Then compact all columns but action one
|
203 |
+
for (var i=0; i<this.columnsNumber-1; i++) {
|
204 |
+
this.compactColumn(i);
|
205 |
+
}
|
206 |
+
} else {
|
207 |
+
// Only refresh columns widths from already computed rows cells widths
|
208 |
+
var newWidths = $A({});
|
209 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
210 |
+
newWidths[i] = 0;
|
211 |
+
}
|
212 |
+
|
213 |
+
this.rowsWidths.values().each(function(widths){
|
214 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
215 |
+
newWidths[i] = Math.max(widths[i], newWidths[i]);
|
216 |
+
}
|
217 |
+
}.bind(this));
|
218 |
+
|
219 |
+
newWidths.each(function(width, index){
|
220 |
+
if (width != this.columnsWidths[index]) {
|
221 |
+
// Changed width
|
222 |
+
this.columnsWidths[index] = width;
|
223 |
+
|
224 |
+
if (index == this.columnsNumber-1) {
|
225 |
+
// Last column was updated : fix again its dimensions accordingly
|
226 |
+
this.setColumnWidth(this.columnsNumber-1, width, true);
|
227 |
+
} else if (this.unpackedColumn && (index == this.unpackedColumn-1)) {
|
228 |
+
// Currently unpacked column was updated : unpack it again
|
229 |
+
this.unpackColumn(index);
|
230 |
+
}
|
231 |
+
}
|
232 |
+
}.bind(this));
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
this.table.setStyle({'tableLayout': 'fixed'});
|
237 |
+
},
|
238 |
+
|
239 |
+
unpackColumn: function(index)
|
240 |
+
{
|
241 |
+
if (!this.isAppliable) {
|
242 |
+
return;
|
243 |
+
}
|
244 |
+
|
245 |
+
this.rowsCells.values().each(function(cells, rowIndex){
|
246 |
+
var cell = cells[index];
|
247 |
+
if (cell) {
|
248 |
+
this.setCellWidth(cell, this.columnsWidths[index], true);
|
249 |
+
if (rowIndex == 0) {
|
250 |
+
cell.getElementsBySelector('img').first().writeAttribute({
|
251 |
+
'src': this.config.compactImageUrl,
|
252 |
+
'title': this.config.compactTitle,
|
253 |
+
'alt': this.config.compactTitle
|
254 |
+
});
|
255 |
+
}
|
256 |
+
}
|
257 |
+
}.bind(this));
|
258 |
+
},
|
259 |
+
|
260 |
+
compactColumn: function(index)
|
261 |
+
{
|
262 |
+
if (!this.isAppliable) {
|
263 |
+
return;
|
264 |
+
}
|
265 |
+
|
266 |
+
this.rowsCells.values().each(function(cells, rowIndex){
|
267 |
+
var cell = cells[index];
|
268 |
+
if (cell) {
|
269 |
+
this.setCellWidth(cell, this.compactedWidth, false);
|
270 |
+
if (rowIndex == 0) {
|
271 |
+
cell.getElementsBySelector('img').first().writeAttribute({
|
272 |
+
'src': this.config.unpackImageUrl,
|
273 |
+
'title': this.config.unpackTitle,
|
274 |
+
'alt': this.config.unpackTitle
|
275 |
+
});
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}.bind(this));
|
279 |
+
},
|
280 |
+
|
281 |
+
addRow: function(row)
|
282 |
+
{
|
283 |
+
if (!this.isAppliable) {
|
284 |
+
return;
|
285 |
+
}
|
286 |
+
|
287 |
+
// Init row values
|
288 |
+
var rowId = row.id;
|
289 |
+
this.rowsCells.set(rowId, $(row).getElementsBySelector('td'));
|
290 |
+
this.rowsCells.get(rowId).each(function(cell, columnIndex){
|
291 |
+
cell = $(cell);
|
292 |
+
if (columnIndex < this.columnsNumber-1) {
|
293 |
+
cell.writeAttribute('title', this.columnsTitles[columnIndex]);
|
294 |
+
}
|
295 |
+
}.bind(this));
|
296 |
+
|
297 |
+
// Refresh widths
|
298 |
+
this.initColumnsWidths(false, rowId);
|
299 |
+
},
|
300 |
+
|
301 |
+
removeRow: function(row)
|
302 |
+
{
|
303 |
+
if (!this.isAppliable) {
|
304 |
+
return;
|
305 |
+
}
|
306 |
+
|
307 |
+
// Delete rows widths and cells
|
308 |
+
var rowId = row.id;
|
309 |
+
this.rowsCells.unset(rowId);
|
310 |
+
this.rowsWidths.unset(rowId);
|
311 |
+
// Refresh widths
|
312 |
+
this.initColumnsWidths(true, false);
|
313 |
+
}
|
314 |
+
}
|
js/tl/fileattributes/script.js~
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* NOTICE OF LICENSE
|
3 |
+
*
|
4 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
5 |
+
* that is bundled with this package in the file LICENSE.txt.
|
6 |
+
* It is also available through the world-wide-web at this URL:
|
7 |
+
* http://opensource.org/licenses/osl-3.0.php
|
8 |
+
*
|
9 |
+
* @category Telemantis
|
10 |
+
* @package Telemantis_FileAttributes
|
11 |
+
* @copyright Copyright (c) 2011 Benoît Leulliette <benoit.leulliette@gmail.com>
|
12 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
13 |
+
*/
|
14 |
+
|
15 |
+
if (typeof(blfa) == 'undefined') {
|
16 |
+
var blfa = {};
|
17 |
+
}
|
18 |
+
|
19 |
+
blfa.SystemConfigArrayFieldCompacter = Class.create()
|
20 |
+
blfa.SystemConfigArrayFieldCompacter.prototype =
|
21 |
+
{
|
22 |
+
initialize: function(containerId, compactedWidth, config)
|
23 |
+
{
|
24 |
+
// Some cells styles are not working with IE 6/7, then do nothing at all on those browsers
|
25 |
+
this.isAppliable = (/MSIE (\d+\.\d+);/.test(navigator.userAgent));
|
26 |
+
this.isAppliable = (this.isAppliable ? (Number(RegExp.$1) != 6) && (Number(Regexp.$1) != 7) : true);
|
27 |
+
|
28 |
+
this.containerId = containerId;
|
29 |
+
this.container = $(this.containerId);
|
30 |
+
this.table = this.container.getElementsBySelector('table').first();
|
31 |
+
|
32 |
+
this.compactedWidth = compactedWidth;
|
33 |
+
this.config = Object.extend({
|
34 |
+
compactImageUrl: '',
|
35 |
+
unpackImageUrl: '',
|
36 |
+
compactTitle: '',
|
37 |
+
unpackTitle: ''
|
38 |
+
}, config || {});
|
39 |
+
|
40 |
+
this.unpackedColumn = null;
|
41 |
+
this.initRows();
|
42 |
+
this.initColumnsWidths(true, true);
|
43 |
+
},
|
44 |
+
|
45 |
+
initRows: function()
|
46 |
+
{
|
47 |
+
if (!this.isAppliable) {
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
|
51 |
+
this.rows = this.table.getElementsBySelector('tr');
|
52 |
+
this.rowsNumber = this.rows.length;
|
53 |
+
this.rowsCells = $H({});
|
54 |
+
this.columnsNumber = 0;
|
55 |
+
this.columnsTitles = $A({});
|
56 |
+
|
57 |
+
this.rows.each(function(row, rowIndex){
|
58 |
+
if (rowIndex < this.rowsNumber-1) {
|
59 |
+
// All rows but last ("Add row") one
|
60 |
+
var cellTagName = (rowIndex == 0 ? 'th' : 'td');
|
61 |
+
var cells = $(row).getElementsBySelector(cellTagName);
|
62 |
+
|
63 |
+
if (rowIndex == 0) {
|
64 |
+
this.columnsNumber = cells.length;
|
65 |
+
}
|
66 |
+
|
67 |
+
cells.each(function(cell, columnIndex){
|
68 |
+
cell = $(cell);
|
69 |
+
|
70 |
+
if (columnIndex < this.columnsNumber-1) {
|
71 |
+
// All cells but last one (actions buttons)
|
72 |
+
if (rowIndex == 0) {
|
73 |
+
// Header row
|
74 |
+
|
75 |
+
// Get column title (will be used for all column's cells)
|
76 |
+
this.columnsTitles.push(cell.innerHTML);
|
77 |
+
cell.writeAttribute('title', cell.innerHTML);
|
78 |
+
|
79 |
+
// Add a button to shrink / extends the whold corresponding column
|
80 |
+
var img = $(document.createElement('img'));
|
81 |
+
img.writeAttribute({
|
82 |
+
'src': this.config.unpackImageUrl,
|
83 |
+
'title': this.config.unpackTitle,
|
84 |
+
'alt': this.config.unpackTitle
|
85 |
+
});
|
86 |
+
img.setStyle({
|
87 |
+
'cursor': 'pointer',
|
88 |
+
'verticalAlign': 'middle',
|
89 |
+
'marginRight': '3px'
|
90 |
+
});
|
91 |
+
|
92 |
+
img.observe('click', function(){
|
93 |
+
if (this.unpackedColumn
|
94 |
+
&& (this.unpackedColumn-1 == columnIndex)) {
|
95 |
+
this.compactColumn(columnIndex);
|
96 |
+
this.unpackedColumn = null;
|
97 |
+
} else {
|
98 |
+
if (this.unpackedColumn) {
|
99 |
+
this.compactColumn(this.unpackedColumn-1);
|
100 |
+
}
|
101 |
+
this.unpackColumn(columnIndex);
|
102 |
+
this.unpackedColumn = columnIndex+1;
|
103 |
+
}
|
104 |
+
}.bind(this));
|
105 |
+
|
106 |
+
cell.insert({'top': img});
|
107 |
+
} else {
|
108 |
+
// Common row
|
109 |
+
cell.writeAttribute('title', this.columnsTitles[columnIndex]);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}.bind(this));
|
113 |
+
|
114 |
+
this.rowsCells.set(row.id, cells);
|
115 |
+
}
|
116 |
+
}.bind(this));
|
117 |
+
},
|
118 |
+
|
119 |
+
setCellWidth: function(cell, width, unpacked)
|
120 |
+
{
|
121 |
+
cell.setStyle({
|
122 |
+
'width': width+'px',
|
123 |
+
'maxWidth': (unpacked ? '' : width+'px'),
|
124 |
+
'overflow': (unpacked ? 'visible' : 'hidden')
|
125 |
+
}).writeAttribute('width', width);
|
126 |
+
},
|
127 |
+
|
128 |
+
setColumnWidth: function(index, width, unpacked)
|
129 |
+
{
|
130 |
+
this.rowsCells.values().each(function(cells){
|
131 |
+
this.setCellWidth(cells[index], width, unpacked);
|
132 |
+
}.bind(this));
|
133 |
+
},
|
134 |
+
|
135 |
+
initColumnsWidths: function(all, option)
|
136 |
+
{
|
137 |
+
if (!this.isAppliable) {
|
138 |
+
return;
|
139 |
+
}
|
140 |
+
|
141 |
+
this.table.setStyle({'tableLayout': 'auto'});
|
142 |
+
|
143 |
+
if (!all) {
|
144 |
+
// Row given : init its widths and refresh columns widths whenever needed
|
145 |
+
var rowId = option;
|
146 |
+
this.rowsWidths.set(rowId, $A({}));
|
147 |
+
var updatedColumns = $A({});
|
148 |
+
|
149 |
+
this.rowsCells.get(rowId).each(function(cell, columnIndex){
|
150 |
+
var width = cell.getWidth();
|
151 |
+
this.rowsWidths.get(rowId)[columnIndex] = width;
|
152 |
+
if (width > this.columnsWidths[columnIndex]) {
|
153 |
+
this.columnsWidths[columnIndex] = width;
|
154 |
+
updatedColumns.push(columnIndex);
|
155 |
+
}
|
156 |
+
}.bind(this));
|
157 |
+
|
158 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
159 |
+
if (updatedColumns.indexOf(i) != -1) {
|
160 |
+
if (i == this.columnsNumber-1) {
|
161 |
+
// Last column was updated : fix again its dimensions accordingly
|
162 |
+
this.setColumnWidth(i, this.columnsWidths[i], true);
|
163 |
+
} else if (this.unpackedColumn && (i == this.unpackedColumn-1)) {
|
164 |
+
// Currently unpacked column was updated : unpack it again
|
165 |
+
this.unpackColumn(i);
|
166 |
+
} else {
|
167 |
+
// All other columns : compact current cell
|
168 |
+
this.setColumnWidth(i, this.compactedWidth, false);
|
169 |
+
}
|
170 |
+
} else {
|
171 |
+
if (this.unpackedColumn && (this.unpackedColumn-1 == i)) {
|
172 |
+
this.setCellWidth(this.rowsCells.get(rowId)[i], this.columnsWidths[i], true);
|
173 |
+
} else {
|
174 |
+
this.setCellWidth(this.rowsCells.get(rowId)[i], this.compactedWidth, false);
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
} else {
|
179 |
+
if (option) {
|
180 |
+
// Complete init of columns/rows cells widths
|
181 |
+
this.columnsWidths = $A({});
|
182 |
+
this.rowsWidths = $H({});
|
183 |
+
|
184 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
185 |
+
this.columnsWidths[i] = 0;
|
186 |
+
}
|
187 |
+
|
188 |
+
// Compute max width for each column
|
189 |
+
this.rowsCells.values().each(function(cells, rowIndex){
|
190 |
+
var rowId = this.rows[rowIndex].id;
|
191 |
+
this.rowsWidths.set(rowId, $A({}));
|
192 |
+
|
193 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
194 |
+
this.rowsWidths.get(rowId)[i] = cells[i].getWidth();
|
195 |
+
this.columnsWidths[i] = Math.max(this.rowsWidths.get(rowId)[i], this.columnsWidths[i]);
|
196 |
+
}
|
197 |
+
}.bind(this));
|
198 |
+
|
199 |
+
// Fix last column width now, as it is not said to be compactable
|
200 |
+
this.setColumnWidth(this.columnsNumber-1, this.columnsWidths[this.columnsNumber-1], true);
|
201 |
+
|
202 |
+
// Then compact all columns but action one
|
203 |
+
for (var i=0; i<this.columnsNumber-1; i++) {
|
204 |
+
this.compactColumn(i);
|
205 |
+
}
|
206 |
+
} else {
|
207 |
+
// Only refresh columns widths from already computed rows cells widths
|
208 |
+
var newWidths = $A({});
|
209 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
210 |
+
newWidths[i] = 0;
|
211 |
+
}
|
212 |
+
|
213 |
+
this.rowsWidths.values().each(function(widths){
|
214 |
+
for (var i=0; i<this.columnsNumber; i++) {
|
215 |
+
newWidths[i] = Math.max(widths[i], newWidths[i]);
|
216 |
+
}
|
217 |
+
}.bind(this));
|
218 |
+
|
219 |
+
newWidths.each(function(width, index){
|
220 |
+
if (width != this.columnsWidths[index]) {
|
221 |
+
// Changed width
|
222 |
+
this.columnsWidths[index] = width;
|
223 |
+
|
224 |
+
if (index == this.columnsNumber-1) {
|
225 |
+
// Last column was updated : fix again its dimensions accordingly
|
226 |
+
this.setColumnWidth(this.columnsNumber-1, width, true);
|
227 |
+
} else if (this.unpackedColumn && (index == this.unpackedColumn-1)) {
|
228 |
+
// Currently unpacked column was updated : unpack it again
|
229 |
+
this.unpackColumn(index);
|
230 |
+
}
|
231 |
+
}
|
232 |
+
}.bind(this));
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
this.table.setStyle({'tableLayout': 'fixed'});
|
237 |
+
},
|
238 |
+
|
239 |
+
unpackColumn: function(index)
|
240 |
+
{
|
241 |
+
if (!this.isAppliable) {
|
242 |
+
return;
|
243 |
+
}
|
244 |
+
|
245 |
+
this.rowsCells.values().each(function(cells, rowIndex){
|
246 |
+
var cell = cells[index];
|
247 |
+
if (cell) {
|
248 |
+
this.setCellWidth(cell, this.columnsWidths[index], true);
|
249 |
+
if (rowIndex == 0) {
|
250 |
+
cell.getElementsBySelector('img').first().writeAttribute({
|
251 |
+
'src': this.config.compactImageUrl,
|
252 |
+
'title': this.config.compactTitle,
|
253 |
+
'alt': this.config.compactTitle
|
254 |
+
});
|
255 |
+
}
|
256 |
+
}
|
257 |
+
}.bind(this));
|
258 |
+
},
|
259 |
+
|
260 |
+
compactColumn: function(index)
|
261 |
+
{
|
262 |
+
if (!this.isAppliable) {
|
263 |
+
return;
|
264 |
+
}
|
265 |
+
|
266 |
+
this.rowsCells.values().each(function(cells, rowIndex){
|
267 |
+
var cell = cells[index];
|
268 |
+
if (cell) {
|
269 |
+
this.setCellWidth(cell, this.compactedWidth, false);
|
270 |
+
if (rowIndex == 0) {
|
271 |
+
cell.getElementsBySelector('img').first().writeAttribute({
|
272 |
+
'src': this.config.unpackImageUrl,
|
273 |
+
'title': this.config.unpackTitle,
|
274 |
+
'alt': this.config.unpackTitle
|
275 |
+
});
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}.bind(this));
|
279 |
+
},
|
280 |
+
|
281 |
+
addRow: function(row)
|
282 |
+
{
|
283 |
+
if (!this.isAppliable) {
|
284 |
+
return;
|
285 |
+
}
|
286 |
+
|
287 |
+
// Init row values
|
288 |
+
var rowId = row.id;
|
289 |
+
this.rowsCells.set(rowId, $(row).getElementsBySelector('td'));
|
290 |
+
this.rowsCells.get(rowId).each(function(cell, columnIndex){
|
291 |
+
cell = $(cell);
|
292 |
+
if (columnIndex < this.columnsNumber-1) {
|
293 |
+
cell.writeAttribute('title', this.columnsTitles[columnIndex]);
|
294 |
+
}
|
295 |
+
}.bind(this));
|
296 |
+
|
297 |
+
// Refresh widths
|
298 |
+
this.initColumnsWidths(false, rowId);
|
299 |
+
},
|
300 |
+
|
301 |
+
removeRow: function(row)
|
302 |
+
{
|
303 |
+
if (!this.isAppliable) {
|
304 |
+
return;
|
305 |
+
}
|
306 |
+
|
307 |
+
// Delete rows widths and cells
|
308 |
+
var rowId = row.id;
|
309 |
+
this.rowsCells.unset(rowId);
|
310 |
+
this.rowsWidths.unset(rowId);
|
311 |
+
// Refresh widths
|
312 |
+
this.initColumnsWidths(true, false);
|
313 |
+
}
|
314 |
+
}
|
js/video/jwplayer.flash.swf
ADDED
Binary file
|
js/video/jwplayer.html5.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(a){a.html5={};a.html5.version="6.1.2972"})(jwplayer);(function(a){var g=document,e=window;a.serialize=function(j){if(j==null){return null}else{if(j.toString().toLowerCase()=="true"){return true}else{if(j.toString().toLowerCase()=="false"){return false}else{if(isNaN(Number(j))||j.length>5||j.length==0){return j}else{return Number(j)}}}}};a.filterSources=function(k){var o,p,j=a.extensionmap;if(k){p=[];for(var m=0;m<k.length;m++){var n=k[m].type,l=k[m].file;if(!n){n=j.extType(a.extension(l));k[m].type=n}if(c(n)){if(!o){o=n}if(n==o){p.push(a.extend({},k[m]))}}}}return p};function c(j){var k=a.extensionmap.types[j];return(!!k&&jwplayer.vid.canPlayType(k))}a.ajax=function(n,m,j){var l;if(n.indexOf("#")>0){n=n.replace(/#.*$/,"")}if(b(n)&&a.exists(e.XDomainRequest)){l=new XDomainRequest();l.onload=f(l,n,m,j);l.onerror=d(j,n,l)}else{if(a.exists(e.XMLHttpRequest)){l=new XMLHttpRequest();l.onreadystatechange=h(l,n,m,j);l.onerror=d(j,n)}else{if(j){j()}}}try{l.open("GET",n,true);l.send(null)}catch(k){if(j){j(n)}}return l};function b(j){if(j&&j.indexOf("://")>=0){if(j.split("/")[2]!=e.location.href.split("/")[2]){return true}}return false}function d(j,l,k){return function(){j("Error loading file")}}function h(k,m,l,j){return function(){if(k.readyState===4){switch(k.status){case 200:f(k,m,l,j)();break;case 404:j("File not found")}}}}function f(k,m,l,j){return function(){try{var n=k.responseXML;if(n&&n.firstChild){return l(k)}}catch(p){}var o=a.parseXML(k.responseText);if(o&&o.firstChild){k=a.extend({},k,{responseXML:o})}else{if(j){j(k.responseText?"Invalid XML":m)}return}l(k)}}a.parseXML=function(j){try{var k;if(e.DOMParser){k=(new DOMParser()).parseFromString(j,"text/xml");try{if(k.childNodes[0].firstChild.nodeName=="parsererror"){return}}catch(l){}}else{k=new ActiveXObject("Microsoft.XMLDOM");k.async="false";k.loadXML(j)}return k}catch(l){return}};a.parseDimension=function(j){if(typeof j=="string"){if(j===""){return 0}else{if(j.lastIndexOf("%")>-1){return j}else{return parseInt(j.replace("px",""),10)}}}return j};a.timeFormat=function(l){if(l>0){var k=Math.floor(l/3600),m=Math.floor((l-k*3600)/60),j=Math.floor(l%60);return(k?k+":":"")+(m<10?"0":"")+m+":"+(j<10?"0":"")+j;return str}else{return"00:00"}};a.seconds=function(l){l=l.replace(",",".");var j=l.split(":");var k=0;if(l.substr(-1)=="s"){k=Number(l.substr(0,l.length-1))}else{if(l.substr(-1)=="m"){k=Number(l.substr(0,l.length-1))*60}else{if(l.substr(-1)=="h"){k=Number(l.substr(0,l.length-1))*3600}else{if(j.length>1){k=Number(j[j.length-1]);k+=Number(j[j.length-2])*60;if(j.length==3){k+=Number(j[j.length-3])*3600}}else{k=Number(l)}}}}return k};a.bounds=function(k){if(!k){return{left:0,right:0,width:0,height:0,top:0,bottom:0}}var o=k,n=0,m=0,l=isNaN(k.offsetWidth)?0:k.offsetWidth,j=isNaN(k.offsetHeight)?0:k.offsetHeight;do{n+=isNaN(o.offsetLeft)?0:o.offsetLeft;m+=isNaN(o.offsetTop)?0:o.offsetTop}while(o=o.offsetParent);return{left:n,top:m,width:l,height:j,right:n+l,bottom:m+j}};a.empty=function(j){if(!j){return}while(j.childElementCount>0){j.removeChild(j.children[0])}}})(jwplayer.utils);(function(p){var a={},n,c={},j=0,o=p.exists,d={},e=false,b=".jwplayer ";function l(){var r=document.createElement("style");r.type="text/css";document.getElementsByTagName("head")[0].appendChild(r);return r}var m=p.css=function(r,u,s){if(!a[r]){if(e){a[r]=l()}else{if(!n||n.sheet.cssRules.length>50000){n=l()}a[r]=n}}if(!o(s)){s=false}if(!c[r]){c[r]={}}for(var t in u){var v=q(t,u[t],s);if(o(c[r][t])&&!o(v)){delete c[r][t]}else{if(o(v)){c[r][t]=v}}}if(j>0){return}k(r)};m.block=function(){j++};m.unblock=function(){j=Math.max(j-1,0);if(j==0){h()}};var h=function(){for(var r in a){k(r)}};function q(t,u,r){if(typeof u==="undefined"){return undefined}var s=r?" !important":"";if(!isNaN(u)){switch(t){case"z-index":case"opacity":return u+s;break;default:if(t.match(/color/i)){return"#"+p.pad(u.toString(16).replace(/^0x/i,""),6)+s}else{if(u===0){return 0+s}else{return Math.ceil(u)+"px"+s}}break}}else{if(!!u.match(/png|gif|jpe?g/i)&&u.indexOf("url")<0){return"url("+u+")"}return u+s}}function k(r){if(e){a[r].innerHTML=f(r);return}var s=a[r].sheet,t=d[r];if(s){var u=s.cssRules;if(p.exists(t)&&t<u.length&&u[t].selectorText==r){s.deleteRule(t)}else{d[r]=u.length}s.insertRule(f(r),d[r])}}function f(r){var s=r+"{\n";var u=c[r];for(var t in u){s+=" "+t+": "+u[t]+";\n"}s+="}\n";return s}p.clearCss=function(s){for(var t in c){if(t.indexOf(s)>=0){delete c[t]}}for(var r in a){if(r.indexOf(s)>=0){a[r].innerHTML=""}}};p.transform=function(s,u){var r="-transform",t;u=u?u:"";if(typeof s=="string"){t={};t["-webkit"+r]=u;t["-ms"+r]=u;t["-moz"+r]=u;t["-o"+r]=u;p.css(s,t)}else{r="Transform";t=s.style;t["webkit"+r]=u;t["Moz"+r]=u;t["ms"+r]=u;t["O"+r]=u}};p.dragStyle=function(r,s){p.css(r,{"-webkit-user-select":s,"-moz-user-select":s,"-ms-user-select":s,"-webkit-user-drag":s,"user-select":s,"user-drag":s})};p.transitionStyle=function(r,s){if(navigator.userAgent.match(/5\.\d(\.\d)? safari/i)){return}p.css(r,{"-webkit-transition":s,"-moz-transition":s,"-o-transition":s})};p.rotate=function(r,s){p.transform(r,"rotate("+s+"deg)")};function g(){m(b+["","div","span","a","img","ul","li","video"].join(","+b)+", .jwclick",{margin:0,padding:0,border:0,color:"#000000","font-size":"100%",font:"inherit","vertical-align":"baseline","background-color":"transparent","text-align":"left"});m(b+"ul",{"list-style":"none"})}g()})(jwplayer.utils);(function(a){a.scale=function(e,d,c,h,j){var g,f=a.exists;if(!f(d)){d=1}if(!f(c)){c=1}if(!f(h)){h=0}if(!f(j)){j=0}if(d==1&&c==1&&h==0&&j==0){g=""}else{g="scale("+d+","+c+") translate("+h+"px,"+j+"px)"}a.transform(e,g)};a.stretch=function(l,q,p,h,n,j){if(!q){return}if(!l){l=b.UNIFORM}if(!p||!h||!n||!j){return}var d=p/n,g=h/j,o=0,k=0,c={},e=(q.tagName.toLowerCase()=="video"),f=false,m;if(e){a.transform(q)}m="jw"+l.toLowerCase();switch(l.toLowerCase()){case b.FILL:if(d>g){n=n*d;j=j*d}else{n=n*g;j=j*g}case b.NONE:d=g=1;case b.EXACTFIT:f=true;break;case b.UNIFORM:default:if(d>g){if(n*g/p>0.95){f=true;m="jwexactfit"}else{n=n*g;j=j*g}}else{if(j*d/h>0.95){f=true;m="jwexactfit"}else{n=n*d;j=j*d}}if(f){g=Math.ceil(100*h/j)/100;d=Math.ceil(100*p/n)/100}break}if(e){if(f){q.style.width=n+"px";q.style.height=j+"px";o=((p-n)/2)/d;k=((h-j)/2)/g;a.scale(q,d,g,o,k)}else{q.style.width="";q.style.height=""}}else{q.className=q.className.replace(/\s*jw(none|exactfit|uniform|fill)/g,"");q.className+=" "+m}};var b=a.stretching={NONE:"none",FILL:"fill",UNIFORM:"uniform",EXACTFIT:"exactfit"}})(jwplayer.utils);(function(a){a.parsers={localName:function(b){if(!b){return""}else{if(b.localName){return b.localName}else{if(b.baseName){return b.baseName}else{return""}}}},textContent:function(b){if(!b){return""}else{if(b.textContent){return b.textContent}else{if(b.text){return b.text}else{return""}}}},getChildNode:function(c,b){return c.childNodes[b]},numChildren:function(b){if(b.childNodes){return b.childNodes.length}else{return 0}}}})(jwplayer.html5);(function(a){a.dfxp=function(g,b){var d,c,j=jwplayer.utils.seconds;function h(l){if(l==0){b("Crossdomain loading denied: "+c)}else{if(l==404){b("DFXP File not found: "+c)}else{b("Error "+l+" loading DFXP file: "+c)}}}this.load=function(m){c=m;try{d.open("GET",m,true);d.send(null)}catch(l){b("Error loading DFXP File: "+m)}};function f(p){var m=[{begin:0,text:""}];p=p.replace(/^\s+/,"").replace(/\s+$/,"");var o=p.split("</p>");var q=[];for(var l=0;l<o.length;l++){if(o[l].indexOf("<p")>=0){o[l]=o[l].substr(o[l].indexOf("<p")+2).replace(/^\s+/,"").replace(/\s+$/,"");q.push(o[l])}}o=q;for(l=0;l<o.length;l++){var n=k(o[l]);if(n.text){m.push(n);if(n.end){m.push({begin:n.end,text:""});delete n.end}}}if(m.length>1){g(m)}else{b("Invalid DFXP file: "+c)}}function k(o){var n={};try{var l=o.indexOf('begin="');o=o.substr(l+7);l=o.indexOf('" end="');n.begin=j(o.substr(0,l));o=o.substr(l+7);l=o.indexOf('">');n.end=j(o.substr(0,l));o=o.substr(l+2);n.text=o}catch(m){}return n}function e(){d=new XMLHttpRequest();d.onreadystatechange=function(){if(d.readyState===4){if(d.status===200){f(d.responseText)}else{h(d.status)}}}}e()}})(jwplayer.html5.parsers);(function(b){var a=b.html5.parsers;var d=a.jwparser=function(){};var c="jwplayer";d.parseEntry=function(h,j){for(var f=0;f<h.childNodes.length;f++){var g=h.childNodes[f];if(g.prefix==c){var e=a.localName(g);j[e]=b.utils.serialize(a.textContent(g));if(e=="file"&&j.sources){delete j.sources}}if(!j.file){j.file=j.link}}return j}})(jwplayer);(function(e){var b=jwplayer.utils,h=b.xmlAttribute,c=e.localName,a=e.textContent,d=e.numChildren;var g=e.mediaparser=function(){};var f="media";g.parseGroup=function(o,q){var n,l,j=[];function p(r){var s={zh:"Chinese",nl:"Dutch",en:"English",fr:"French",de:"German",it:"Italian",ja:"Japanese",pt:"Portuguese",ru:"Russian",es:"Spanish"};if(s[r]){return s[r]}return r}for(l=0;l<d(o);l++){n=o.childNodes[l];if(n.prefix==f){if(!c(n)){continue}switch(c(n).toLowerCase()){case"content":if(h(n,"duration")){q.duration=b.seconds(h(n,"duration"))}if(d(n)>0){q=g.parseGroup(n,q)}if(h(n,"url")){if(!q.sources){q.sources=[]}q.sources.push({file:h(n,"url"),type:h(n,"type"),width:h(n,"width"),label:h(n,"height")?h(n,"height")+"p":undefined})}break;case"title":q.title=a(n);break;case"description":q.description=a(n);break;case"guid":q.mediaid=a(n);break;case"thumbnail":q.image=h(n,"url");break;case"player":var k=n.url;break;case"group":g.parseGroup(n,q);break;case"subtitle":var m={};m.file=h(n,"url");if(h(n,"lang").length>0){m.label=p(h(n,"lang"))}j.push(m)}}}if(j.length>0){q.captions=j}return q}})(jwplayer.html5.parsers);(function(g){var b=jwplayer.utils,a=g.textContent,e=g.getChildNode,f=g.numChildren,d=g.localName;g.rssparser={};g.rssparser.parse=function(o){var h=[];for(var m=0;m<f(o);m++){var n=e(o,m),k=d(n).toLowerCase();if(k=="channel"){for(var l=0;l<f(n);l++){var p=e(n,l);if(d(p).toLowerCase()=="item"){h.push(c(p))}}}}return h};function c(l){var m={};for(var j=0;j<l.childNodes.length;j++){var k=l.childNodes[j];var h=d(k);if(!h){continue}switch(h.toLowerCase()){case"enclosure":m.file=b.xmlAttribute(k,"url");break;case"title":m.title=a(k);break;case"guid":m.mediaid=a(k);break;case"pubdate":m.date=a(k);break;case"description":m.description=a(k);break;case"link":m.link=a(k);break;case"category":if(m.tags){m.tags+=a(k)}else{m.tags=a(k)}break}}m=g.mediaparser.parseGroup(l,m);m=g.jwparser.parseEntry(l,m);return new jwplayer.playlist.item(m)}})(jwplayer.html5.parsers);(function(a){a.srt=function(h,b){var e,d,m=jwplayer.utils,l=m.seconds;function j(n){if(n==0){b("Crossdomain loading denied: "+d)}else{if(n==404){b("SRT File not found: "+d)}else{b("Error "+n+" loading SRT file: "+d)}}}this.load=function(o){d=o;try{if(c(o)&&m.exists(window.XDomainRequest)){e=new XDomainRequest();e.onload=function(){var p=e.responseText;g(p)};e.onerror=function(){var p=e.status;j(p)}}e.open("GET",o,true);e.send(null)}catch(n){b("Error loading SRT File: "+o)}};function g(r){var o=[{begin:0,text:""}];r=r.replace(/^\s+/,"").replace(/\s+$/,"");var q=r.split("\r\n\r\n");if(q.length==1){q=r.split("\n\n")}for(var n=0;n<q.length;n++){if(q[n]=="WEBVTT"){continue}var p=k(q[n]);if(p.text){o.push(p);if(p.end){o.push({begin:p.end,text:""});delete p.end}}}if(o.length>1){h(o)}else{b("Invalid SRT file: "+d)}}function k(s){var r={};var t=s.split("\r\n");if(t.length==1){t=s.split("\n")}try{var n=1;if(t[0].indexOf(" --> ")>0){n=0}var p=t[n].indexOf(" --> ");if(p>0){r.begin=l(t[n].substr(0,p));r.end=l(t[n].substr(p+5))}if(t[n+1]){r.text=t[n+1];for(var q=n+2;q<t.length;q++){r.text+="<br/>"+t[q]}}}catch(o){}return r}function c(n){if(n&&n.indexOf("://")>=0){if(n.split("/")[2]!=window.location.href.split("/")[2]){return true}}return false}function f(){e=new XMLHttpRequest();e.onreadystatechange=function(){if(e.readyState===4){if(e.status===200){g(e.responseText)}else{j(e.status)}}}}f()}})(jwplayer.html5.parsers);(function(e){var k=jwplayer.utils,l=jwplayer.events,m=l.state,h=k.css,g="playing",j=document,a=".jwcaptions",b="absolute",c="none",f="100%",d="hidden";e.captions=function(H,u){var N=H,v,w,K={back:true,color:"#FFFFFF",fontSize:15},J={fontFamily:"Arial,sans-serif",fontStyle:"normal",fontWeight:"normal",textDecoration:"none"},R,Q,y,s=[],r=0,S=false,F,B=new l.eventdispatcher();k.extend(this,B);function D(){v=j.createElement("div");v.id=N.id+"_caption";v.className="jwcaptions";N.jwAddEventListener(l.JWPLAYER_PLAYER_STATE,C);N.jwAddEventListener(l.JWPLAYER_PLAYLIST_ITEM,M);N.jwAddEventListener(l.JWPLAYER_MEDIA_ERROR,L);N.jwAddEventListener(l.JWPLAYER_ERROR,L);N.jwAddEventListener(l.JWPLAYER_READY,t);N.jwAddEventListener(l.JWPLAYER_MEDIA_TIME,n);N.jwAddEventListener(l.JWPLAYER_FULLSCREEN,x)}function L(U){k.log("CAPTIONS("+U+")")}function G(){Q="idle";q()}function C(U){switch(U.newstate){case m.IDLE:G();break;case m.PLAYING:A();break}}function x(U){S=U.fullscreen;if(U.fullscreen){I();setTimeout(I,500)}else{q()}}function I(){var U=v.offsetHeight,V=v.offsetWidth;if(U!=0&&V!=0){R.resize(V,Math.round(U*0.94))}}function M(Z){y=0;s=[];R.update(0);var Y=N.jwGetPlaylist()[N.jwGetPlaylistIndex()],U=Y.captions,X=0,V="",W="";if(U){for(X=0;X<U.length;X++){W=U[X].file;if(W){if(U[X].label){s.push(U[X])}else{V=W.substring(W.lastIndexOf("/")+1,W.indexOf("."));s.push({file:W,label:V})}}}}r=0;q();O(l.JWPLAYER_CAPTIONS_LIST,p(),r)}function T(U){F=U;k.ajax(U,z,E)}function z(V){var W=V.responseXML.firstChild,U;if(e.parsers.localName(W)=="tt"){U=new jwplayer.html5.parsers.dfxp(P,L)}else{U=new jwplayer.html5.parsers.srt(P,L)}U.load(F)}function E(V){var U=new jwplayer.html5.parsers.srt(P,L);U.load(F)}function P(U){R.populate(U);s[y].data=U;q()}function A(U){Q=g;q()}function q(){if(!s.length){R.hide()}else{if(Q==g&&r>0){R.show();if(S){x({fullscreen:true});return}var U=N.jwGetWidth();if(N._model&&N._model.config&&N._model.config.listbar&&N._model.config.listbar.size){U=U-N._model.config.listbar.size}R.resize(U,Math.round(N.jwGetHeight()*0.94))}else{R.hide()}}}function t(){for(var U in K){if(u&&u[U.toLowerCase()]!=undefined){if(U=="color"){J.color="#"+String(u.color).substr(-6)}else{J[U]=u[U.toLowerCase()]}}else{J[U]=K[U]}}R=new jwplayer.html5.captions.renderer(J,v);q()}function o(U){if(U>0){y=U-1;r=U}else{r=0}if(s[y].data){R.populate(s[y].data)}else{T(s[y].file)}q()}function n(U){R.update(U.position)}function O(X,W,V){var U={type:X,tracks:W,track:V};B.sendEvent(X,U)}function p(){var V=new Array();V.push({label:"(Off)"});for(var U=0;U<s.length;U++){V.push({label:s[U].label})}return V}this.element=function(){return v};this.getCaptionsList=function(){return p()};this.getCurrentCaptions=function(){return r};this.setCurrentCaptions=function(U){if(U>=0&&r!=U&&U<=s.length){o(U);O(l.JWPLAYER_CAPTIONS_CHANGED,p(),r)}};D()};h(a,{position:b,cursor:"pointer",width:f,height:f,overflow:d})})(jwplayer.html5);(function(a){a.captions.renderer=function(q,g){var j,p,f,k,o,l,b="visible",e;this.hide=function(){c({display:"none"})};this.populate=function(r){k=-1;p=r;d()};function m(r){c({left:"0px",top:"0px"});f.innerHTML=r;if(r==""){b="hidden"}else{b="visible"}setTimeout(n,20)}this.resize=function(s,r){e=s;j=r;n()};function n(){c({left:"0px",top:"0px"});var s=Math.round(q.fontSize*Math.pow(e/400,0.6)),r=Math.round(s*1.4),u,t;c({maxWidth:e+"px",fontSize:s+"px",lineHeight:r+"px",visibility:b});u=Math.round(e/2-f.clientWidth/2);t=Math.round(j-f.clientHeight);c({left:u+"px",top:t+"px"})}function d(){var s=-1;for(var r=0;r<p.length;r++){if(p[r]["begin"]<=l&&(r==p.length-1||p[r+1]["begin"]>=l)){s=r;break}}if(s==-1){m("")}else{if(s!=k){k=s;m(p[r]["text"])}}}function h(){f=document.createElement("div");g.appendChild(f);c({color:"#"+q.color.substr(-6),display:"block",fontFamily:q.fontFamily,fontStyle:q.fontStyle,fontWeight:q.fontWeight,height:"auto",margin:"0 0 0 0",padding:"3px 9px",position:"absolute",textAlign:"center",textDecoration:q.textDecoration,wordWrap:"break-word",width:"auto"});if(q.back){c({background:"#000"})}else{c({textShadow:"-2px 0px 1px #000,2px 0px 1px #000,0px -2px 1px #000,0px 2px 1px #000,-1px 1px 1px #000,1px 1px 1px #000,1px -1px 1px #000,1px 1px 1px #000"})}}h();this.show=function(){c({display:"block"});n()};function c(r){for(var s in r){f.style[s]=r[s]}}this.update=function(r){l=r;if(p){d()}}}})(jwplayer.html5);(function(q){var m=q.html5,z=q.utils,c=q.events,g=c.state,t=z.css,C=z.transitionStyle,d="button",s="text",h="divider",v="slider",k="relative",l="absolute",b="none",r="block",A="inline",p="inline-block",n="hidden",e="left",F="right",o="100%",x="opacity .15s, background .15s, visibility .15s",w={display:b},a={display:E},D=".jwcontrolbar",u=false,j=true,B=null,E=undefined,y=window,f=document;m.controlbar=function(ai,aW){var a7,Y,N=ao("divider",h),J={margin:8,maxwidth:800,font:"Arial,sans-serif",fontsize:11,fontcolor:parseInt("eeeeee",16),fontweight:"bold",layout:{left:{position:"left",elements:[ao("play",d),N,ao("prev",d),ao("next",d),ao("divider",h,"nextdiv"),ao("elapsed",s)]},center:{position:"center",elements:[ao("time",v)]},right:{position:"right",elements:[ao("duration",s),N,ao("hd",d),ao("cc",d),N,ao("mute",d),ao("volume",v),N,ao("fullscreen",d)]}}},aH,ba,aw,R,bq,aM,bA,an,a5,ax,bm,ak,bt,bk,aL,aB,Z,bj,ap,by,U,aX,aC,M,a0,a6=u,aV=u,aY=0,W=0,bu={play:"pause",mute:"unmute",fullscreen:"normalscreen"},bF={play:u,mute:u,fullscreen:u},bf={play:al,mute:bB,fullscreen:aT,next:a8,prev:aK},bD={time:bE,volume:aS},O={},ah=this;function ao(bH,bJ,bI){return{name:bH,type:bJ,className:bI}}function be(){aw={};a7=ai;aM=a7.id+"_controlbar";bA=an=0;bq=aO();bq.id=aM;bq.className="jwcontrolbar";Y=a7.skin;ba=Y.getComponentLayout("controlbar");if(!ba){ba=J.layout}z.clearCss("#"+aM);bx();aZ();aa();setTimeout(function(){P();bz()},0);ah.visible=false}function aa(){a7.jwAddEventListener(c.JWPLAYER_MEDIA_TIME,bh);a7.jwAddEventListener(c.JWPLAYER_PLAYER_STATE,ad);a7.jwAddEventListener(c.JWPLAYER_MEDIA_MUTE,bz);a7.jwAddEventListener(c.JWPLAYER_MEDIA_VOLUME,P);a7.jwAddEventListener(c.JWPLAYER_MEDIA_BUFFER,ag);a7.jwAddEventListener(c.JWPLAYER_FULLSCREEN,ay);a7.jwAddEventListener(c.JWPLAYER_PLAYLIST_LOADED,ar);a7.jwAddEventListener(c.JWPLAYER_MEDIA_LEVELS,bC);a7.jwAddEventListener(c.JWPLAYER_MEDIA_LEVEL_CHANGED,bc);a7.jwAddEventListener(c.JWPLAYER_CAPTIONS_LIST,bs);a7.jwAddEventListener(c.JWPLAYER_CAPTIONS_CHANGED,am);bq.addEventListener("mouseover",function(){y.addEventListener("mousemove",T,u);y.addEventListener("mouseup",T,u);y.addEventListener("mousedown",aE,u)},false);bq.addEventListener("mouseout",function(){y.removeEventListener("mousemove",T);y.removeEventListener("mouseup",T);y.removeEventListener("mousedown",aE);f.onselectstart=null},false)}function bh(bI){var bH=u,bJ;if(aw.elapsed){bJ=z.timeFormat(bI.position);aw.elapsed.innerHTML=bJ;bH=(bJ.length!=z.timeFormat(an).length)}if(aw.duration){bJ=z.timeFormat(bI.duration);aw.duration.innerHTML=bJ;bH=(bH||(bJ.length!=z.timeFormat(bA).length))}if(bI.duration>0){au(bI.position/bI.duration)}else{au(0)}bA=bI.duration;an=bI.position;if(bH){aR()}}function ad(bH){switch(bH.newstate){case g.BUFFERING:case g.PLAYING:t(aU(".jwtimeSliderThumb"),{opacity:1});L("play",j);break;case g.PAUSED:if(!aV){L("play",u)}break;case g.IDLE:L("play",u);t(aU(".jwtimeSliderThumb"),{opacity:0});if(aw.timeRail){aw.timeRail.className="jwrail";setTimeout(function(){aw.timeRail.className+=" jwsmooth"},100)}at(0);bh({position:0,duration:0});break}}function bz(){var bH=a7.jwGetMute();L("mute",bH);H(bH?0:bt)}function P(){bt=a7.jwGetVolume()/100;H(bt)}function ag(bH){at(bH.bufferPercent/100)}function ay(bH){L("fullscreen",bH.fullscreen);bo()}function ar(bH){t(aU(".jwhd"),w);t(aU(".jwcc"),w);bo();aR()}function bC(bH){a5=bH.levels;if(a5&&a5.length>1&&U){t(aU(".jwhd"),{display:E});U.clearOptions();for(var bI=0;bI<a5.length;bI++){U.addOption(a5[bI].label,bI)}bc(bH)}else{t(aU(".jwhd"),{display:"none"})}aR()}function bc(bH){ax=bH.currentQuality;if(U&&ax>=0){U.setActive(bH.currentQuality)}}function bs(bH){bm=bH.tracks;if(bm&&bm.length>1&&aC){t(aU(".jwcc"),{display:E});aC.clearOptions();for(var bI=0;bI<bm.length;bI++){aC.addOption(bm[bI].label,bI)}am(bH)}else{t(aU(".jwcc"),{display:"none"})}aR()}function am(bH){if(!bm){return}ak=bH.track;if(aC&&ak>=0){aC.setActive(bH.track)}}function bn(){return(!!f.querySelector("#"+a7.id+" .jwplaylist")&&!a7.jwGetFullscreen())}function bx(){aH=z.extend({},J,Y.getComponentSettings("controlbar"),aW);R=aI("background").height;t("#"+aM,{height:R,bottom:a6?0:aH.margin});t(aU(".jwtext"),{font:aH.fontsize+"px/"+aI("background").height+"px "+aH.font,color:aH.fontcolor,"font-weight":aH.fontweight});t(aU(".jwoverlay"),{bottom:R});if(aH.maxwidth>0){t(aU(),{"max-width":aH.maxwidth})}}function aU(bH){return"#"+aM+(bH?" "+bH:"")}function aO(){return br("span")}function br(bH){return f.createElement(bH)}function aZ(){var bJ=aq("capLeft");var bI=aq("capRight");var bH=aq("background",{position:l,left:aI("capLeft").width,right:aI("capRight").width,"background-repeat":"repeat-x"},j);if(bH){a1(bq,bH)}if(bJ){a1(bq,bJ)}bg();if(bI){a1(bq,bI)}}function aQ(bH){switch(bH.type){case h:return aA(bH);break;case s:return bG(bH.name);break;case d:if(bH.name!="blank"){return X(bH.name)}break;case v:return av(bH.name);break}}function aq(bJ,bI,bK,bO,bL){var bN=aO();bN.className="jw"+bJ;var bH=bO?" left center":" center";var bP=aI(bJ);bN.innerHTML=" ";if(!bP||bP.src==""){return}var bM;if(bK){bM={background:"url('"+bP.src+"') repeat-x "+bH,height:bL?bP.height:E}}else{bM={background:"url('"+bP.src+"') no-repeat"+bH,width:bP.width,height:bL?bP.height:E}}bN.skin=bP;t(aU(".jw"+bJ),z.extend(bM,bI));aw[bJ]=bN;return bN}function X(bJ){if(!aI(bJ+"Button").src){return B}var bL=aO();bL.className="jw"+bJ+" jwbuttoncontainer";var bK=br("button");bK.addEventListener("click",aj(bJ),u);bK.innerHTML=" ";a1(bL,bK);var bM=aI(bJ+"Button");var bI=aI(bJ+"ButtonOver");bb(aU(".jw"+bJ+" button"),bM,bI);var bH=bu[bJ];if(bH){bb(aU(".jw"+bJ+".jwtoggle button"),aI(bH+"Button"),aI(bH+"ButtonOver"))}aw[bJ]=bL;return bL}function bb(bH,bI,bJ){if(!bI.src){return}t(bH,{width:bI.width,background:"url("+bI.src+") center no-repeat"});if(bJ.src){t(bH+":hover",{background:"url("+bJ.src+") center no-repeat"})}}function aj(bH){return function(){if(bf[bH]){bf[bH]()}}}function al(){if(bF.play){a7.jwPause()}else{a7.jwPlay()}}function bB(){a7.jwSetMute();bz({mute:bF.mute})}function aP(bI){for(var bH in O){if(bH!=bI&&O.hasOwnProperty(bH)){O[bH].hide()}}}function V(){if(a6){return}bk.show();aP("volume")}function aS(bH){H(bH);if(bH<0.1){bH=0}if(bH>0.9){bH=1}a7.jwSetVolume(bH*100)}function bp(){if(a6){return}M.show();aP("fullscreen")}function bE(bH){a7.jwSeek(bH*bA)}function aT(){a7.jwSetFullscreen()}function a8(){a7.jwPlaylistNext()}function aK(){a7.jwPlaylistPrev()}function L(bH,bI){if(!z.exists(bI)){bI=!bF[bH]}if(aw[bH]){aw[bH].className="jw"+bH+(bI?" jwtoggle jwtoggling":" jwtoggling");setTimeout(function(){aw[bH].className=aw[bH].className.replace(" jwtoggling","")},100)}bF[bH]=bI}function az(bH){return aM+"_"+bH}function bG(bH,bL){var bJ={};var bK=aI(bH+"Background");if(bK.src){var bI=aO();bI.id=az(bH);bI.className="jwtext jw"+bH;bJ.background="url("+bK.src+") no-repeat center";bJ["background-size"]="100% "+aI("background").height+"px";t(aU(".jw"+bH),bJ);bI.innerHTML="00:00";aw[bH]=bI;return bI}return null}function aA(bI){var bH;if(bI.width){bH=aO();bH.className="jwblankDivider";t(bH,{width:parseInt(bI.width)})}else{if(bI.element){bH=aq(bI.element)}else{bH=aq(bI.name);if(!bH){bH=aO();bH.className="jwblankDivider"}}}if(bI.className){bH.className+=" "+bI.className}return bH}function aF(){if(a5&&a5.length>1){if(by){clearTimeout(by);by=undefined}U.show();aP("hd")}}function af(){if(bm&&bm.length>1){if(aX){clearTimeout(aX);aX=undefined}aC.show();aP("cc")}}function a3(bH){if(bH>=0&&bH<a5.length){a7.jwSetCurrentQuality(bH);U.hide()}}function ae(bH){if(bH>=0&&bH<bm.length){a7.jwSetCurrentCaptions(bH);aC.hide()}}function aJ(){L("cc")}function av(bH){var bJ=aO(),bK=bH+(bH=="time"?"Slider":""),bQ=bK+"Cap",bM=bH=="volume",bL=bM?"Top":"Left",bS=bM?"Bottom":"Right",bO=aq(bQ+bL,B,u,u,bM),bP=aq(bQ+bS,B,u,u,bM),bI=a9(bH,bM,bL,bS),bT=aI(bQ+bL),bR=aI(bQ+bL),bN=aI(bH+"SliderRail");bJ.className="jwslider jw"+bH;if(bO){a1(bJ,bO)}a1(bJ,bI);if(bP){if(bM){bP.className+=" jwcapBottom"}a1(bJ,bP)}t(aU(".jw"+bH+" .jwrail"),{left:bM?E:bT.width,right:bM?E:bR.width,top:bM?bT.height:E,bottom:bM?bR.height:E,width:bM?o:E,height:bM?"auto":E});aw[bH]=bJ;bJ.vertical=bM;if(bH=="time"){bj=new m.overlay(aM+"_timetooltip",Y);ap=br("div");ap.className="jwoverlaytext";bj.setContents(ap);aB=bI;Q(0);a1(bI,bj.element());bv(bJ);au(0);at(0)}else{if(bH=="volume"){ac(bJ,bM,bL,bS)}}return bJ}function a9(bI,bN,bM,bW){var bJ=aO(),bP=["Rail","Buffer","Progress"],bT;bJ.className="jwrail jwsmooth";for(var bR=0;bR<bP.length;bR++){var bL=(bI=="time"?"Slider":""),bS=bI+bL+bP[bR],bQ=aq(bS,B,!bN,(bI=="volume")),bO=aq(bS+"Cap"+bM,B,u,u,bN),bU=aq(bS+"Cap"+bW,B,u,u,bN),bX=aI(bS+"Cap"+bM),bV=aI(bS+"Cap"+bW);if(bQ){var bK=aO();bK.className="jwrailgroup "+bP[bR];if(bO){a1(bK,bO)}a1(bK,bQ);if(bU){a1(bK,bU);bU.className+=" jwcap"+(bN?"Bottom":"Right")}t(aU(".jwrailgroup."+bP[bR]),{"min-width":(bN?E:bX.width+bV.width)});bK.capSize=bN?bX.height+bV.height:bX.width+bV.width;t(aU("."+bQ.className),{left:bN?E:bX.width,right:bN?E:bV.width,top:bN?bX.height:E,bottom:bN?bV.height:E,height:bN?"auto":E});if(bR==2){bT=bK}aw[bS]=bK;a1(bJ,bK)}}var bH=aq(bI+bL+"Thumb",B,u,u,bN);if(bH){t(aU("."+bH.className),{opacity:bI=="time"?0:1,"margin-top":bN?bH.skin.height/-2:E});bH.className+=" jwthumb";a1(bN&&bT?bT:bJ,bH)}bJ.addEventListener("mousedown",a4(bI),u);if(bI=="time"){bJ.addEventListener("mousemove",bd,u);bJ.addEventListener("mouseout",ab,u)}aw[bI+"Rail"]=bJ;return bJ}function a2(){var bH=a7.jwGetState();return(bH==g.IDLE)}function aE(bH){bH.preventDefault();f.onselectstart=function(){return u}}function a4(bH){return(function(bI){if(bI.button!=0){return}aw[bH+"Rail"].className="jwrail";if(bH=="time"){if(!a2()){a7.jwSeekDrag(j);aV=bH}}else{aV=bH}})}function T(bH){var bJ=(new Date()).getTime();if(bJ-W>50){aN(bH);W=bJ}if(!aV||bH.button!=0){return}var bL=aw[aV].getElementsByClassName("jwrail")[0],bM=z.bounds(bL),bI=aV,bK=aw[bI].vertical?(bM.bottom-bH.pageY)/bM.height:(bH.pageX-bM.left)/bM.width;if(bH.type=="mouseup"){if(bI=="time"){a7.jwSeekDrag(u)}aw[bI+"Rail"].className="jwrail jwsmooth";aV=B;bD[bI](bK)}else{if(aV=="time"){au(bK)}else{H(bK)}if(bJ-aY>500){aY=bJ;bD[aV](bK)}}return false}function bd(bH){if(bj&&bA&&!a6){bj.show()}}function ab(bH){if(bj){bj.hide()}}function aN(bI){Z=z.bounds(aB);if(!Z||Z.width==0){return}var bJ=bj.element(),bH=(bI.pageX-Z.left)-y.pageXOffset;if(bH>=0&&bH<=Z.width){bJ.style.left=Math.round(bH)+"px";Q(bA*bH/Z.width)}}function Q(bH){ap.innerHTML=z.timeFormat(bH)}function bv(bH){if(aw.timeSliderThumb){t(aU(".jwtimeSliderThumb"),{"margin-left":(aI("timeSliderThumb").width/-2)})}at(0);au(0)}function ac(bJ,bH,bL,bI){var bK="volume";t(aU(".jwvolume"),{width:aI(bK+"Rail").width+(bH?0:aI(bK+"Cap"+bL).width+aI(bK+"Cap"+bI).width),height:bH?(aI(bK+"Cap"+bL).height+aI(bK+"Rail").height+aI(bK+"RailCap"+bL).height+aI(bK+"RailCap"+bI).height+aI(bK+"Cap"+bI).height):E});if(bH){bJ.className+=" jwvertical"}}var S={};function bg(){G("left");G("center");G("right");a1(bq,S.left);a1(bq,S.center);a1(bq,S.right);bl();t(aU(".jwright"),{right:aI("capRight").width})}function bl(){if(aw.hd){U=new m.menu("hd",aM+"_hd",Y,a3);bw(U,aw.hd,aF,K);O.hd=U}if(aw.cc){aC=new m.menu("cc",aM+"_cc",Y,ae);bw(aC,aw.cc,af,bi);O.cc=aC}if(aw.mute&&aw.volume&&aw.volume.vertical){bk=new m.overlay(aM+"_volumeoverlay",Y);bk.setContents(aw.volume);bw(bk,aw.mute,V);O.volume=bk}if(aw.fullscreen){M=new m.overlay(aM+"_fullscreenoverlay",Y);var bH=br("div");bH.className="jwoverlaytext";bH.innerHTML="Fullscreen";M.setContents(bH);bw(M,aw.fullscreen,bp);O.fullscreen=M}}function bi(){aX=setTimeout(aC.hide,500)}function K(){by=setTimeout(U.hide,500)}function bw(bH,bJ,bK,bL){var bI=bH.element();a1(bJ,bI);bJ.addEventListener("mousemove",bK,u);if(bL){bJ.addEventListener("mouseout",bL,u)}else{bJ.addEventListener("mouseout",bH.hide,u)}t("#"+bI.id,{left:"50%"})}function G(bI){var bH=aO();bH.className="jwgroup jw"+bI;S[bI]=bH;if(ba[bI]){I(ba[bI],S[bI])}}function I(bK,bH){if(bK&&bK.elements.length>0){for(var bJ=0;bJ<bK.elements.length;bJ++){var bI=aQ(bK.elements[bJ]);if(bI){if(bK.elements[bJ].name=="volume"&&bI.vertical){bk=new m.overlay(aM+"_volumeOverlay",Y);bk.setContents(bI)}else{a1(bH,bI)}}}}}var aR=function(){clearTimeout(a0);a0=setTimeout(ah.redraw,0)};ah.redraw=function(){bx();var bJ=aI("capLeft"),bI=aI("capRight");t(aU(".jwgroup.jwcenter"),{left:Math.round(z.parseDimension(S.left.offsetWidth)+bJ.width),right:Math.round(z.parseDimension(S.right.offsetWidth)+bI.width)});var bH=(bq.parentNode.clientWidth>aH.maxwidth),bK=a6?0:aH.margin;t(aU(),{left:bH?"50%":bK,right:bH?E:bK,"margin-left":bH?bq.clientWidth/-2:E,width:bH?o:E});aD()};function bo(){if(a7.jwGetPlaylist().length>1&&!bn()){t(aU(".jwnext"),a);t(aU(".jwprev"),a);t(aU(".nextdiv"),a)}else{t(aU(".jwnext"),w);t(aU(".jwprev"),w);t(aU(".nextdiv"),w)}}function aD(){var bJ,bI,bH;aL=z.bounds(bq);for(bI in O){bH=O[bI];bH.offsetX(0);bJ=z.bounds(bH.element());if(bJ.right>aL.right){bH.offsetX(aL.right-bJ.right)}else{if(bJ.left<aL.left){bH.offsetX(aL.left-bJ.left)}}}}ah.audioMode=function(bH){if(bH!=a6){a6=bH;t(aU(".jwfullscreen"),{display:bH?b:E});t(aU(".jwhd"),{display:bH?b:E});t(aU(".jwcc"),{display:bH?b:E});aR()}};ah.element=function(){return bq};ah.margin=function(){return parseInt(aH.margin)};function at(bH){bH=Math.min(Math.max(0,bH),1);if(aw.timeSliderBuffer){aw.timeSliderBuffer.style.width=bH*100+"%";aw.timeSliderBuffer.style.opacity=bH>0?1:0}}function aG(bK,bO){var bI=aw[bK].vertical,bN=bK+(bK=="time"?"Slider":""),bM=100*Math.min(Math.max(0,bO),1)+"%",bJ=aw[bN+"Progress"],bH=aw[bN+"Thumb"],bL=u;if(bJ){if(bI){bJ.style.height=bM;bJ.style.bottom=0;if(bJ.clientHeight<=bJ.capSize){bL=j}}else{bJ.style.width=bM;if(bJ.clientWidth<=bJ.capSize){bL=j}}bJ.style.opacity=((!bL&&bO>0)||aV)?1:0}if(bH){if(bI){bH.style.top=0}else{bH.style.left=bM}}}function H(bH){aG("volume",bH)}function au(bH){aG("time",bH)}function aI(bH){var bI=Y.getSkinElement(bH.indexOf("volume")==0?"tooltip":"controlbar",bH);if(bI){return bI}else{return{width:0,height:0,src:"",image:E,ready:u}}}function a1(bH,bI){bH.appendChild(bI)}ah.show=function(){ah.visible=true;bq.style.opacity=1};ah.hide=function(){ah.visible=false;bq.style.opacity=0};be()};t(D,{position:l,opacity:0});t(D+" span",{height:o});z.dragStyle(D+" span",b);t(D+" .jwgroup",{display:A});t(D+" span, "+D+" .jwgroup button,"+D+" .jwleft",{position:k,"float":e});t(D+" .jwright",{position:l});t(D+" .jwcenter",{position:l});t(D+" buttoncontainer,"+D+" button",{display:p,height:o,border:b,cursor:"pointer"});t(D+" .jwcapRight,"+D+" .jwtimeSliderCapRight,"+D+" .jwvolumeCapRight",{right:0,position:l});t(D+" .jwcapBottom",{bottom:0,position:l});t(D+" .jwtime",{position:l,height:o,width:o,left:0});t(D+" .jwthumb",{position:l,height:o,cursor:"pointer"});t(D+" .jwrail",{position:l,cursor:"pointer"});t(D+" .jwrailgroup",{position:l,width:o});t(D+" .jwrailgroup span",{position:l});t(D+" .jwdivider+.jwdivider",{display:b});t(D+" .jwtext",{padding:"0 5px","text-align":"center"});t(D+" .jwoverlaytext",{padding:3});t(D+" .jwvertical *",{display:r});C(D,x);C(D+" button",x);C(D+" .jwtime .jwsmooth span",x+", width .15s linear, left .15s linear");C(D+" .jwtoggling",b)})(jwplayer);(function(d){var c=d.html5,a=d.utils,e=d.events,b=e.state;c.controller=function(j,k){var o=j,l=k,s=j.getVideo(),z=this,L=new e.eventdispatcher(o.id,o.config.debug),u=false,p=-1,D,M,g,B=[];a.extend(this,L);function Q(){o.addEventListener(e.JWPLAYER_MEDIA_BUFFER_FULL,t);o.addEventListener(e.JWPLAYER_MEDIA_COMPLETE,function(U){setTimeout(G,25)});o.addEventListener(e.JWPLAYER_MEDIA_ERROR,function(V){var U=a.extend({},V);U.type=e.JWPLAYER_ERROR;L.sendEvent(U.type,U)})}function v(U){if(!u){l.completeSetup();L.sendEvent(U.type,U);if(d.utils.exists(window.jwplayer.playerReady)){d.playerReady(U)}o.addGlobalListener(q);l.addGlobalListener(q);L.sendEvent(d.events.JWPLAYER_PLAYLIST_LOADED,{playlist:o.playlist});L.sendEvent(d.events.JWPLAYER_PLAYLIST_ITEM,{index:o.item});O();if(o.autostart&&!a.isMobile()){H()}u=true;while(B.length>0){var V=B.shift();F(V.method,V.arguments)}}}function q(U){L.sendEvent(U.type,U)}function t(U){s.play()}function O(U){A();switch(a.typeOf(U)){case"string":S(U);break;case"object":case"array":o.setPlaylist(new d.playlist(U));break;case"number":o.setItem(U);break}}function S(V){var U=new c.playlistloader();U.addEventListener(e.JWPLAYER_PLAYLIST_LOADED,function(W){O(W.playlist)});U.addEventListener(e.JWPLAYER_ERROR,function(W){O([]);W.message="Could not load playlist: "+W.message;q(W)});U.load(V)}function H(V){if(!a.exists(V)){V=true}if(!V){return h()}try{if(p>=0){O(p);p=-1}M=H;if(!D){D=true;L.sendEvent(e.JWPLAYER_MEDIA_BEFOREPLAY);D=false;if(g){g=false;M=null;return}}if(f()){if(o.playlist.length==0){return false}s.load(o.playlist[o.item])}else{if(o.state==b.PAUSED){s.play()}}return true}catch(U){L.sendEvent(e.JWPLAYER_ERROR,U);M=null}return false}function A(){M=null;try{if(!f()){s.stop()}if(D){g=true}return true}catch(U){L.sendEvent(e.JWPLAYER_ERROR,U)}return false}function h(V){if(!a.exists(V)){V=true}if(!V){return H()}try{switch(o.state){case b.PLAYING:case b.BUFFERING:s.pause();break;default:if(D){g=true}}return true}catch(U){L.sendEvent(e.JWPLAYER_ERROR,U)}return false;if(o.state==b.PLAYING||o.state==b.BUFFERING){s.pause()}}function f(){return(o.state==b.IDLE)}function C(U){if(o.state!=b.PLAYING){H(true)}s.seek(U)}function x(U){l.fullscreen(U)}function r(U){o.stretching=U;l.resize()}function I(U){O(U);H()}function J(){I(o.item-1)}function m(){I(o.item+1)}function G(){if(!f()){return}M=G;if(o.repeat){m()}else{if(o.item==o.playlist.length-1){p=0;A();setTimeout(function(){L.sendEvent(e.JWPLAYER_PLAYLIST_COMPLETE)},0)}else{m()}}}function y(U){s.setCurrentQuality(U)}function R(){if(s){return s.getCurrentQuality()}else{return -1}}function P(){if(s){return s.getQualityLevels()}else{return null}}function T(U){l.setCurrentCaptions(U)}function K(){return l.getCurrentCaptions()}function E(){return l.getCaptionsList()}function w(){try{return o.getVideo().detachMedia()}catch(U){return null}}function n(){try{var U=o.getVideo().attachMedia();if(typeof M=="function"){M()}}catch(V){return null}}function N(U){return function(){if(u){F(U,arguments)}else{B.push({method:U,arguments:arguments})}}}function F(W,V){var U=[];for(i=0;i<V.length;i++){U.push(V[i])}W.apply(this,U)}this.play=N(H);this.pause=N(h);this.seek=N(C);this.stop=N(A);this.load=N(O);this.next=N(m);this.prev=N(J);this.item=N(I);this.setVolume=N(o.setVolume);this.setMute=N(o.setMute);this.setFullscreen=N(x);this.setStretching=N(r);this.detachMedia=w;this.attachMedia=n;this.setCurrentQuality=N(y);this.getCurrentQuality=R;this.getQualityLevels=P;this.setCurrentCaptions=N(T);this.getCurrentCaptions=K;this.getCaptionsList=E;this.playerReady=v;Q()}})(jwplayer);(function(a){a.html5.defaultskin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Six" version="2.0" target="6.0"><components><component name="controlbar"><settings><setting name="margin" value="8"/><setting name="fontcolor" value="eeeeee"/><setting name="fontsize" value="11"/><setting name="fontweight" value="bold"/><setting name="maxwidth" value="800"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAaCAIAAAD5ZqGGAAAAJklEQVR42mNKSUlhevToEdPXr1+Z/v37RxH+//8/htjv379BZgMA4j5LOzqaqAsAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAaCAYAAAB/75arAAAAh0lEQVR42t2RywnDMAxAhSbJRukGPtgDdJSO0k7U4IOPBhuM8b9SIAG3p0JPFTwETxJICIFCSrkqpZ7EYFAIsbbW7s65RWsNDJK4ee/BGAMhhB2stS7WWui9n7CEGOMsaXwSZ+d/yR+cOcaY+HL8vcByyzl/7HllyX8qpexgSulBhQvl7XjxCydafIt3Z4BrAAAAAElFTkSuQmCC"/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAaCAYAAAB/75arAAAAjUlEQVR42tWRywnDMAxAhSbJRukGPtgDdJSO0k7U4INPvthgjP+VSlsSkkvpqYKH4EnCFkKl1Hhxl1LOQIFaa2Ccc1Nr7SqEmDGEAIwxBrz3QIUL9t7hjbUWaq3TRqaUWMJGMjS+l4edfy2/XHOMAWt+eJ3FTuacWS5YSgEmxviU9M/z58R0tIXEifLtATSUfIsSwhegAAAAAElFTkSuQmCC"/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAaCAYAAAB2BDbRAAAAEElEQVR42mP4//8/A8NAEgDiqk2zfDlcXgAAAABJRU5ErkJggg=="/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAAdUlEQVR42u2TsQ3AIAwE2YARMkJGyCiMwiiMwgjUFMAIjOC8lMJdiIjd+aSrr3i9MwzjHXoYMOgFmAIvvQCT4aEXYNLvEK2ZMEKvFODQVqC1Rl/sve8Faq20cMIIvUYgQR5ZMJDh6RixQIF8NMHAgMEZhrHNDU+1T3s3o0CaAAAAAElFTkSuQmCC"/><element name="playButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAABhUlEQVR42uXVzUoCYRTGcXNGR3HSDPtASyIhrIjaFJlBRBRUdAUGQQurdVfSrl2LuhEvYxR1IYroRhCEWU1/4R2Yxcz4MUlQB34bGc6D58y8r+/vl2EYczNpKvitzN9/orEEGUEoQhAyJDNs2gAJCiKIYVGIQUUIAWvQNM2jWMEGtoRNpJBAFOGJgsRDAahYRRbHuMAVznGEHaSxZBNkvyPLQhXEkUEew+riE88o4AYn2BVBCcxDgWz+G6fxhLGMPdzBWh184RUPuEUOWaSwgBBkpwAZESRxiALsqoV3EXSPSxwgLUIUc1xOAWvI4RFupeENRVxjH0moCMBvF6BiHXkUMap0lPCCM2QQh2LuwingFE8Ytwa4wTYSCEEaGVCtVo1x1Gq1CQPEiDRNM9yUy2W92WyWdF13HJHrkt2aNxoNbTAYuC555Gtq17her7f6/f7HmK+p+4dmbcysO71ez8OHZnNUDBtXKpVuu932clTM/rCb/XHt/cL5/SvT+6XvKcz3r+sbpPMfjCOvfIMAAAAASUVORK5CYII="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAAN0lEQVR42u3NoQ0AMAwDwe6/YYBncWlUyQFBBX+SickfADM/0k+AQCbJffHfqir3hZ/ADwEAowtQ1mmQzb8rQgAAAABJRU5ErkJggg=="/><element name="pauseButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAABdUlEQVR42t2WzWrCQBSFq1FSaSjaFi1iF6UFtdBdF6WhC0Hoym3BlSAu+wbddSF9xfyTJ7k9gRMJuY2Oi2w88BG5zLlHZiYzOTttiUijyP768Y2bxCKVv0nD+B/T2AY2OAcdPnOKNZtjrdx/KMCi6QJ0wTW44fOKFGtdjrXzEJPml2AA7sEEPIExeCRj1iYcM6CnOoTz2AYOuAVT8Arm4APMwDuZsTbnmCk9Dns0qxbVBj3wAFzR+iRlufT02IOLrqenA/rgGSxE64uUtaCnzx7WfwEtLtYQvIClaH2Tspb0DNmjtS9gxHldidYPKWtFz+hQgAPuwBtYi9aWlLXOPPQ6JgEu2IjWLylrQ89xAVEUSRzHkiSJpGm6C8jqBVSA8RR5nie+70sQBHmjbUZWL6CmyHiRVQAXWQfoRTbapiqA21QH6G1q9KJl5jwkDMPdi6YCzF40fVSoAB4VKqDiqKj1sKv9uK71wqn9yqzt0q/vs+Wk9QeSkdKwXIKzCgAAAABJRU5ErkJggg=="/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAcCAYAAABsxO8nAAAAfUlEQVR42u2MwQnAIAxFu4EjOIIjOFJH6EiCF8fw7BQZwf5AegkU2tje8uGR5Afe5vH8mTHGZG5+EXSzSPoMCEyzCPd+9SYRZgCFb7MIJNB5XxURT7OotTYFkql5Jqq1TiGBzrvinUj2AMqSSHXHikj3GZBVpH8R9M3j+Tgn8lcGnlSSd08AAAAASUVORK5CYII="/><element name="prevButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAcCAYAAABsxO8nAAABhUlEQVR42uXUz0oCURTH8VKz/BNFmZJ/iMAoEmohlRRI7Yp2Qa0igyJc9Qot2vUGbnwB3yJXPYKaCi5m62LQzSymr3KE09hAi1nVgQ93hnv4wZ259878o7Jte/YXfADPcAvwIeDgFwHMKYFJoDPILw0hREQYCyKMKBZlDCEIvzMkiAhWEEdCxlURRwoZJBGTwOA4SC0nLJMb2MGujFlsIYc8DrCPrIRHZtR3mccSMtI0qTMUcYoLXKGMTxxiE8t6WSHEsI2iCirhDg94RgVDmTtHDmvjILWsBPZwqYJe8Io3vEPXDfJY10ERJGXiWjVXUYMBZ5VQQMoZlMIRblVzHSZ+qkccI62DokijgHvVbMGtnnCCjGtQu922R7rdriXPU3SQ69IajYY9MhgM6p1Ox5R3zbE0l4+tmquWZdV6vZ7hDNIf2/X3T5r17zcM40MH6d/vuiGleWpD9vv9SrPZHDLn2JAuR0QFTR0R0zTLrVbr2xHx7NB6do14drF5dtV6c/n/7foCpva8IJ04vWUAAAAASUVORK5CYII="/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAcCAYAAABsxO8nAAAAdklEQVR42u3OwQnAIAyF4WzgCB3BERypI3QkwYtjeHaKjGBfIeClFmvaWx58KAg/ks329WqtBbbBW7vMhhowBH2o2/WhLoJTh0QBrw4JfhXKObcBlnMulFJqNwp4uS+HIjjCNKGDZKshhkCYJlRge/ot2Ww/7gSJGQaejWvrvwAAAABJRU5ErkJggg=="/><element name="nextButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAcCAYAAABsxO8nAAABjElEQVR42uXUPUvDQBwGcNvUatOK4kuKfUEERVGwg/iCguimuAk6iQqKOPkVHLr5DVz8An4LO/kR2jQtZMjaIbRLhvOpPOHOJMahnfQPP5IcyXO5S+5G/ngJIRKUpMRvwiEyIAWjPl5rlApIhgJ5YxoykIMJHnUYJx2ylGFHWjAozQdnoQBlKIIBM2RAnsdpBqa/hbHRgCWowBZswjoss30V1nhcYKe6P0w/aAoWYRua8ABncAKHcABHQlaFbz0JY/589YPm2Psxb+zBCzzCLVzBtWAxeIVvlQHND5rnUC5ArXd4hio8Ke2nsAF5OTwEcWJ32WuwHHiDV6XtnB0XIKsGlWAP7iCqXKgp15ewA8VgUBn24R5+Kk85v+EISpCLDLIsS0Rpt9sez+OC5NDq9boIarVabrfbrfE6bmhysoMhtm07nud9TTbb4iZbfn41xHGcD/Xzsz3u88sfsn9jo9HodTqd0A/JoLgfUi4R0zSbrutGLhEGxS2RwRftMLeRwTe2oW21g2/+/6c+AdO5vCABA1zBAAAAAElFTkSuQmCC"/><element name="elapsedBackground" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAaCAYAAAB2BDbRAAAAEElEQVR42mP4//8/A8NAEgDiqk2zfDlcXgAAAABJRU5ErkJggg=="/><element name="timeSliderCapLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAcCAYAAABCgc61AAAAD0lEQVQoFWNgGAWjYGgCAAK8AAEb3eOQAAAAAElFTkSuQmCC"/><element name="timeSliderCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAcCAYAAABCgc61AAAAD0lEQVQoFWNgGAWjYGgCAAK8AAEb3eOQAAAAAElFTkSuQmCC"/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAALElEQVQY02NkQAOMg1aAmZn5P4oALy8vqoCYmBiqgIKCAqqAmpoaxQJDJsQA+54Krz/ExkoAAAAASUVORK5CYII="/><element name="timeSliderRailCapLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAAWklEQVR42tWLsQlAIQwFBcVKGyEGK61cJ/tXGeVptPjwN/DgQnIQ9xYxRgkhqPceLqUkW5g5Z7g91BYiQq31BDAzxhjmDb13zDnN+/IP0lr7glFKkX3oCc+wAHpnIpi5hlqoAAAAAElFTkSuQmCC"/><element name="timeSliderRailCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAAVklEQVR42tXJMQ4AIQhEURKMFZZCrLDyOty/4ijsYuJWewEn+c0buGeIGKUUr7XahtZaENHJgJmj9x7vkTnMOSMTkY2w1opMVX/BPxhjJNgBFxGDq/YAy/oipxG/oRoAAAAASUVORK5CYII="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAAE0lEQVQYV2NgGErgPxoeKIGhAQB1/x/hLROY4wAAAABJRU5ErkJggg=="/><element name="timeSliderBufferCapLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAAJ0lEQVQYlWNgGGrAH4jvA/F/GOc/EobLwAX+ExTA0IJhKIa1QwMAAIX5GqOIS3lSAAAAAElFTkSuQmCC"/><element name="timeSliderBufferCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAAJ0lEQVQY02NgGErgPxDfB2J/ZAEY9kcXuI8u8J+gwH2chqJYOzQAALXhGqOFxXzUAAAAAElFTkSuQmCC"/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAALUlEQVQYV2NgGCqA8T8QIAuwoPEZWD58+IAq8Pr1a1IF3r59iyrw9+9fhqEJABv9F+gP7YohAAAAAElFTkSuQmCC"/><element name="timeSliderProgressCapLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAASklEQVR42tXDQQ0AIAwDwDqcPhLQgAlM8JqDORilnyVY4JLDX0iaOgWZaeccVkSEKyv23nxjrcU35pyurBhjWO+dFZDWmqkr8Y0Lr65i67XRzKcAAAAASUVORK5CYII="/><element name="timeSliderProgressCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAcCAYAAABGdB6IAAAAS0lEQVQY09XDQQ0AIRAEwXa4+iYBDZjABC8c4ADmHheStUAlBc/wb9oOAM45vvfewVrL6WSM4Zzeu3Naa04npRTftdZAkiVNScFTPhkFYuvY2zeUAAAAAElFTkSuQmCC"/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAcCAYAAABYvS47AAAAwElEQVR42tWTPQrCQBCF84OsYJCIYEQrsZAU6QKx9xheyG4L6zTZs3iInGZ9Tx4iAWHaDHwwvPlgyWY2mVvFGNNf/gmZyEUm0q+kwQI4sBROWf6R2ShcgRJsRanM0UnUrEEFTuBC1FeaOYoF2IMaXMGNqK81KyhuwDmEcB/H8RVV7JlxRofiDjTe+0eclLKGDsUDaPu+91NRWUuH4hF0wzA8p6Kyjo5ZNB9t/hjz9Zgv3PwLzUthXjPT4hqewrzqDfMnQ2tu8Pr1AAAAAElFTkSuQmCC"/><element name="durationBackground" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAaCAYAAAB2BDbRAAAAEElEQVR42mP4//8/A8NAEgDiqk2zfDlcXgAAAABJRU5ErkJggg=="/><element name="hdButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAcCAMAAACu5JSlAAAAZlBMVEUAAACysrLZ2dkmJiYuLi4xMTE3Nzc8PDxAQEBJSUlRUVFSUlJaWlpdXV1jY2NpaWlsbGx0dHR3d3d4eHh9fX2KioqPj4+SkpKVlZWXl5ehoaGpqamsrKyysrK3t7fCwsLNzc3Z2dkN+/dcAAAAA3RSTlMAf3+Sa81KAAAAh0lEQVQoU+3J0RpCQBCA0dW/i02KpEIzzPu/ZJc+7CM4t8e5k3PuYgmX9VNttv2W2iww9gDhe/iK3mZYHhRVIBwe+l9PYQWjzbB/BYB6gdl096ra4WP0PD/kqh25qq4vIjfuIvBuuMrkaURk8yUvGUAiefSU0/5hkJZSPECcZP8J62epztzpDzcuFrDsGN7pAAAAAElFTkSuQmCC"/><element name="hdButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAcCAYAAACZOmSXAAACFUlEQVR42u2WsWoCQRCGE42I5AikkSBaGSwsAiIpQi4BK0vF+qwEjb1gaWMlaGfvA5xYWvgCNraChY0+gU+wmR3+DcPGC0lQrnHg43bvbv5/d25v764uYYdS6voc/MY0AqLEzYmICt3roJlGiRgRJxLELXD+g8hPQDPGHnIAwjiOpHsiSaSINMj8CeRBIwlNBx7RY8Z3xAORJZ6IZ+KFeCXcP/KK3GdoZbU2POLGPIJyOLiYJ96ICuERDaJJtIiPX9JCTgMaFWjm4eHIBRZHWR6Jd8JXpw8f2o/aS5Y8QSRRnqo6X1ThkTTmN1iRKTwfz87o9/sql8updrutTBSLRT63WCzUZDLhtoCvT6dTW8qDR8o2T2OBNL5leJ4WZBMd+/3+y+RwOKhut8vtUqnE92JgfLSiAY+0NHeIDFZo085gI5gvl0s+GjMKPpoq2IOzogmPzDFzl1eriPV6zSI2eAw8c/TZ1M6RAW33R/PtdqsMo9GIRQqFgqrVagy1+dxwOFSz2YzbrutaOeIckOaBZd9sNgro2bFQp9Mx575m5fu+6vV63K7X63xttVqZwfE1qSXLHrjgZEK5XGah8XjM/fl8bsx1nyuBWcqq6DweiNSSCy7wVZMJMNKm3B8MBkac+zCT8CBgLLFetYBNBjefHLnJBG6vu93OP7Wx1pTba6gfllA/qaH+TIT6GxXaD2Q4v86XoPgE1h55oNE1QD4AAAAASUVORK5CYII="/><element name="ccButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAMAAACqEUSYAAAAXVBMVEUAAACysrLZ2dkmJiYuLi4xMTFAQEBHR0dJSUlKSkpRUVFSUlJaWlpdXV1jY2N0dHR9fX1/f3+Pj4+SkpKVlZWXl5ehoaGpqamsrKytra2ysrK3t7fCwsLNzc3Z2dky1qB2AAAAA3RSTlMAf3+Sa81KAAAAe0lEQVR42uXNQRKCMBAAQWCCIgGCGEU3sv9/JpXykCLxB8y1D1OdsEaLmqT6p6M6wKn6FuyWaUQL9zdcW2yuLV49dmTUL2S6gcYsr+IbwgdC7MYj/EoqIoZFHF1PL08QkYNO0MG8wMUw5LoOwCQyG+jWTMuS1iXW1SnbAaDLE32SOX+lAAAAAElFTkSuQmCC"/><element name="ccButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAcCAYAAACdz7SqAAAB8UlEQVR42uWWsWoCQRCGEzUcEhFsQpCzUiwsBBGLoElrp0HbsxI09j6ClaXgW5xYWvgCNhaWFjb6BD7BZmb5HWSXXAw5rnHg43bd3f/fG+f27uE+Qyn1GCa3mMVAnEj8k7jowdwyxKQnwiGSxDNI/Qmsg4YDzbh15/jRwaIM8UJkCRfkbsQFWWhkoOmwh2nqEGnilcgTZaJGvBF1onEjdaypQSMPzbRlzLvBYIl4J9qER/SJATEkvn5hiLl9rG1DqwTtFFId06ZIQ4H4IHwVXvjQLMDDkcJC/svEpwo5oFmGR1JSjD++ptNixGQyUcViUeD+JRaLhapWqzLmeZ46n8+mhAftLKo6cTF1UQB921AEpT2bzdRms5F+q9Vic5lnRB/armmaI+ooBAkI6TvCnYnwaDTitr5ynE4n2YQRA9aGR8o0baAKOXSaRMQOufP1eq2CApqNQNPD4aCY3W4nptS36Ha7emy5XHL/R4JNkd79fq8uVCoVLez7vu5Pp1Pd73Q6qtfrcZuvemy1WskmrzQC0yuFdL1gPB5rERhJez6f80ak32w29QbxHxumdiFZj8z1gu12KwUD9EYwzuYwk43xGsPUfmSswwGTwyLwcJBj8Hg8+mEZklbgMRj9gR/9qy36l3j0nyuRfphF+wl69/ENcVv6gzz3ulwAAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAAA30lEQVR42u2UzQmEMBCFtwNLsARLSAkpwVJSwpZgCQEv6skS5iieLCElzL6FJwxCDlllT3nwkb8hXxLQV01Nzc/Z9739l8gBBRE0j94AiBk3oAceJCCPCM2GauY6zh3AsR/vit5AT8zzBbZCoWdNWypQS0YmQM2tekpDkWzbNs1xqRMQwGraMtk8z5rD1k3TJJgLYF2WZfi2oEw2jqPm4HoHhHMOJNCDAxTLnGHIyALXhRLPmnsfOU+dTpkRJooc+/F1N/bpzLjhITxFAp77i1w3440UxALRzQPU1NTk8gF0y3zyjAvd3AAAAABJRU5ErkJggg=="/><element name="muteButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAAC2UlEQVR42u3WPUwTYRzHcWmBFnqKBYpAHVSQoEB8QTQaiMSILhgDiiFxUBMSlUETnYiDg9GJmDA44OCgo8bF18EFibq5MEBpeUsDIaVAm6P02qTUb5N/k5P2oNg46ZN88tz1yT2//p9e77lt/1u6Fo/Hc9L5GwEmmJGrY4bpz0JlcoOAPFhRCAU2FMAi46YtBa4LyEM+LBKwHSUoh1OUYaeM5yUDtxpSAAVFKJZJd6MGh9GEY6jHXjigpAQaBskySQWlcMpE+3FQJj+DDtxBN9pxCjUogw25yEkJEWbkw4ZiqaBWJm9GK86jEz0YRKKNok9Cm1El11th/i1QF2TBDuxCtYS0oQv3MIObuI+nGMIwIljAQ1xGI5xQINWlBhXBiTqclgtv4xXCUsUTDOADotAwIsce9OIsqmFHPkzJsORvpKACDVLNNfThJ/TtBb7ADRfCEjQm4/3okHkcyaXU3xAW2FEtFW3U3uAbVDn3IQYvQhjGVTSiHIX6MDMK4EA9LsRisbgR2jt8wg/OtbW1NZU+Qu+nX6T/zth1nEBl8q5cH1aGQ+icmpqKG9GHeb1ebWlpSZ2bm4v4fL7A7OzsIn1GYQ7Uod3lcsWN0N6GQqGhyclJNXG+srLic7vdseXlZa/H4wkRnLKMRr9ZFVr8fv8jLh4MBAKv+fbudWEvCfs8Pz/vUVXVRbXaxMRENBgMjiXGV1dX094g6e7GcqmuFVfQiwcszfvx8fGwhPXjGYEf+SxKNRqhI4nj6elpw1vf6A9dgRo0yUWXcINv/piJvRzfRV80Gh1gBb6yAsMERahugc82/FOnC1RQonvYHkELzoXD4S76i+jGLYKeJ6qlolGCtvC4gv5Jr9tGKrEPB9CAoziJNnRqmtaz2YM40+3FCgV2OHT71x7UStXH0ZTJFpNpqEWqtUnFRShFxWabZ1bvHLpd2yrhijB4LcjyXSSLF56sw4WE/HPtFwoiecfnKRGcAAAAAElFTkSuQmCC"/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAAAk0lEQVR42u2NwQnDMAxFtUFH6AgdISN0hI6UEf4Oxgdvkas9RUZQ/yEBYdChgoZC9eCBLBs/SZLkjxlj3Ol2RehJd6rfDq1UT81eKcwZVCMB9Zw/p7CzfErvXT2ndzB3kAitNfUUQ60V555zLFZKUU/zBscOdo7EFiOcmFLMcQli4y+6Bz4LBx90E3JV8CZJkvwsb8qa9F25tXYIAAAAAElFTkSuQmCC"/><element name="unmuteButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAcCAYAAACQ0cTtAAACOUlEQVR42u3WS2sTURjG8ZqJuTSJTW1T26YqrWmN1jt2ISpWTb1ABS3iRkS84WUndlNQFN34Fdy5d+U36MJVQVroKgnmvgqBZBV3Gf8DTyQMzMggRZC+8CNnJsn75CRnzqRvu/6/Mk1zRw8fwBhbEeSDAT92ih+cU7D8dYiahxFFTPoR1HOG+Fxm7h6kRiE1H8Y49iKJEcQRRRghhQegmTuFKkQMBBDBbkwgjVOY0+Mh7McoEhjSa+OIIawehluYgSB2YQ9SOI0MbuEFfuCizs8ijYOYwRSSCo8g0J2hU9AAkmp0AbfxDJ/RhlV3sYgFZPR4GedwApMKDMNvD+v+RlGM4aga3McKvqO3XuKhxt/wFI+xClOBScTU12dfEEEMIqUZudU7vMKajjewrvGqZjiFOAL2MANhJHAENzqdjumE+ojXeMvxJkyxAh/hEqYxiKBT2AiOY6lQKJhOesNqtdpm93y1WvUUlsAsFrPZrOmEeo/lcrm8Zh1XKpUNxuvWuFgsun6N9t/sAM43Go0PzWbzU6vV+sInztvClvHEGpdKpd8LxArinPMCsa9GjGp287iD51ip1+tfc7ncTzV7gJu4igVc8bL07Rf0GGYwhwyWcI9Zvsnn80XG13EGx3AYafzxonYKjOoNE2pyEmcx3263r2nLmu7ZJ4e9b1ew7fQxhY5jUgEp7FPIAPq9bcTut5cQoohjSOKIIKjGhrjeYryEBhWMnnuZ9+buoaJgUcjW/xeRvu36F/ULlStUoyVtQSYAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAAbElEQVR42u2R0QnAIAxEu1lWc5/+ZYKs4TTWjwS0qIFrP+/BkYMLOdCLELKn1tpG5TleYF2yyMUzvCAOZDtwgU85PJGE/+NPyuTJG1Uts/9+sI0+y6GCrtunLHKJHbjAZYcd8x28IJTmhJAtD4gEt9ueDIktAAAAAElFTkSuQmCC"/><element name="fullscreenButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAACFUlEQVR42t2W324SURCHhS67VCoFbYhRkbQsaCwVSwgUaZP2yia9Mb6MN41vYfpIfYIm5QIegJfA3yTfSU52c1i98KabfGGYmd+cPX+Gw7On+2w2m5JPUfxfC5dhB8pQKooXvjGCiohFFRJ8EVTwVSHGtxOckSuOsCb2xUsDe0/swl42jiZxg2wr/kK0REf0DOzX4hXIzsVbaPODsH4VUSOxL8biwsD+SCEhOx/vo61Rq5zd1JipdhBkn6k4hmk2iKZDjdhtuj9Awnqm4twTPopf4lKM4BLfo0tCk1IjCQ3QFF0xR+QK/BBXYgxX+PycOdpmaAC3RG1xiui7uMWeic8ww3dLzgZNO7tEoU1OxYhpX7Dmd+KDgT0ldk5umt/k/DGtioZ4y/E7EUMx4JQcQR/fkJwemgY1OKbhAd6wnscU+ESRQ+jhOyGniyY4QFlE4rk4sCKIJyzFaLVa/XaNhT0iNiH30LTUiEJ9UGeqg8ViYRv3TVxjj80PY3zXloM9QFvf1gcN3mRiIr3pvX2u1+ufHMMvMDefn2MatI2iPjgSZyYylsvlg77fiK/umGLfWMzlmQbt3/UBQoc7530IxLf3QeT3AYIZbzbE9w5SfGfknGb6IAr1Qez9XL8XXabdxtc0sNvEuuS20MZFd0LsXThNqOOrQg0fcS6cXPHiKzOB2L8yg3GKG4WXfoBSUfz//W15ss8fvEcYMYnLr+AAAAAASUVORK5CYII="/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAAbElEQVR42u2Q0QnAMAhEu5kD588JXMNpbIUEpCBpe5+9B4JczF3MQQjpcfeBz+4vxpMe2ULSIF9YjaqWM+hXWRrdA2YZah61Wv2/qGrU6nQkQK6yLmCeCbzFCmk02FxWX/WyYXw1H69mCSEtJ16St50Fqd0HAAAAAElFTkSuQmCC"/><element name="normalscreenButtonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAACDUlEQVR42u2Vy0ojURCGZ9Kmk4A63cYLMhdE28tCECUgxCuzGBDc6AgO7uYizKAP4NKNb6S+g08gSZO8QZ7h+Bd8ScDDIZmsLfhIpc7/V53uPnS/e4uRwjn3vsto2sHiggdrw2iGaT4miiKGEhShBDEU8YSH9Jr3G4yLSZGID+Q9qCXk0rIBhoSaj4kyxlnxUXyBz+ITKKcuDdoEb+9KQrufEHPiXqyLLVETmwDUpEE7h7cYGhBxmQk72xAWR+KY/Bs4akfkG3gSekTebaJYFlWxKLbFDQ2e+P0BvRqabTxVekT+M+gPmBKZ2BWn4tn146czCNa+o83wlkNXUGAxRVx3fvyC11HHk9KjQFtvQIxoSeyIE/Fb/BWX5EK5auQnaJfwxsMMyMSeOKPZVX8IzVUjP0Ob+QP8Y1rhPq6Kg2az6Yw8z12j0XCKf4blVuuum9Y8eCvBY8ritFgTXzudzl273c4VzlBcG93/tmYa05oHb2XQMZ0RK2JfnFujVquVs9M/huVWY+g52hXzDjqmJe7jgqhZI+3wVvkFA04N8gtbI6/hSekRhV4VMS+vee3uAeOeOOSs1w3yQ9Zq0j6aB2/sPwP/ZTeFYUEsc/mZWISM2jKaeTzeyy50FWV2k/LgquQJpNSmySfxeLsPfnAQlzCC1dgAoInxDP9Vg8gAauG1//82I/ZM1DztW4wSL9xQTRdfTNL0AAAAAElFTkSuQmCC"/></elements></component><component name="display"><settings><setting name="bufferinterval" value="100"/><setting name="bufferrotation" value="45"/><setting name="fontcolor" value="cccccc"/><setting name="overcolor" value="ffffff"/><setting name="fontsize" value="15"/><setting name="fontweight" value="normal"/></settings><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA8CAIAAAAok0etAAAAJUlEQVR42mNKTU1lunnzJtP///+ZGBgYwDQ6xiVOrhw1zSNRPQBu5Zagca3K1AAAAABJRU5ErkJggg=="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAnElEQVR42u2WvQ2DMBCFv8I1M3gjMoTpMwqjkI1S0RnJEhaiuZcFEuyCBCnyqz+9+9XpHMAwDD0wAp4PciGEXtK0risxRvZ9fw+a2ZhzZp5njuTMzC/LQklOEtu21YGSyqCZ1YHfcazR1Tle6FjVnr+q+vz2XJxjW4p2Utr2tFn/OvT5s5b0BHwJdmZ2Bybg0NmllB5d190kHb5cL8J5WhbWZJeBAAAAAElFTkSuQmCC"/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAmklEQVR42mNKTU39jwffB2J/BiBgunnzJgM2/PjxY4bPnz8r/P//f0NKSoo/E5DBgA1//fqV4enTpyDFDP/+/ZvAxEAAvHnzBqRQAaeJMPzz508wTVAhDBOlEGg1LUxkIAIMtBsH0ERigmf4+XpggodGbhxNFKNFymiRMhrXA1Gk0D+uoQH+gIkIRSCrC5gIeOIBkA74+PHjRgDhswBcaL43lQAAAABJRU5ErkJggg=="/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAFy0lEQVR42oWXy2sk1xWHv1vvR1erNeqWZ2TFiSQ/ZI2GMBDygsRhTIwZgg3ZeeFV9lnlT8giS/8BhqxCICYJ2TgPhzEhYLJQFgMT2SN79JhoMq1Hq7tVXV3ve7PoktQjd8sHCpq6zVfn8TvnVAkumRLnPzV0LFw8XCwgI2ZITEaJFIqJZlxCneEEAg0bn0Y8176eB2CG19tuhx4DUpRiMtIYw40gooJqGHjMHi5urzt39JZgeHRwb/nBPJRIFOWVHqoRzEDHQKvOTGpxc/uW+zNnzUcQoy9vvx/EbkxKgWS6h0og0DGxcbAxERRIdIKDBfeOszZPgCDmcE2+3n68dMyADJSYFLRx7p2JS0B9a34YCGEMb3aQ+HJGb/kEGIBPQLyUB1joiLXGYx1FwmBSyAIDm2DY2ljVX9WXoXzy8db6f1tSM8V5UkGghwB/t36x0iYfBR2xj3wWKNDQcahvrNo/Mr7joZPcSlYffPT9XTsbnCTE+EDKkPy4FvaK9xaGWZ5XBJ9FHl8A9Sp/NrWtr8Xftl5v0STAFqqhiqx94/TpQC1krZKYHtFm+PsXtz7IP9E7RaLiswxaJGSXQ9Yxh4G+7FHHAmoqE/ELHe+lg6WHX/y6fC1tqqDYHt5bfuAe/9PtFZHMxgviXGTyQthCCNDPNaODoQqi2d6tk6c7eYByw5faboferugY+ZQ+OcshSHIjKp8k6wk+UBAruW+dEjJ01NIhJuqs9XpG1sjUMx4mX+4URXHz6ONPk1c6Sym6ign7w/vrbQYMKBAIFJKcgvzW8aafaWO4bFw6QmlomKOubV/fXHVv21/HlPvx/dbm6i5dIopKFhKFRKJEnefQK0LJHuk40MDAxsGjhp/4O3PdQEo3Wmk3OvQZkFBWQDW6hAJMrmEDIf1xFYJQNjZ+P9iaLwLLDNQLoZORkVSjKqn8U6M/f6kGGgEmkBOOwEIF+FvNf78ys2bXhC6j5PPbO8+fEBGTkI+GwLTZh80i1nkm90nBwOoFGy83f+Dd8IUgFdq1f+Vv9IOclOIrcNoYDiwW2UFqmJtzM2vejRYt1VJNVXvOe3mzXlVVwlQcBGO4ETIAAyNxzZqHjwF4KmEwN3TQERe5m2LmpDuVnsYnColSqCtRV5hG4cT5ICFBVc2QDdyEEoX4Cmg+6Y5Gvtbpb0ZPO5zQEx0RtvsPb3arAa9dCQwvZkxV5xAMskb4ra0N8rUoEE5+cvrZd3fqKQqdEjV9uwGS/UuykWfC9nrBw1bma1pQrHT9mISEjIyC/ErhTBS2gY6NjYODGZob9T23KN3oe4fLAxIyCqSQSlwS0BWtpyEwMbBxP2v87RszC1Zd09J+/+nSzk/axOQUVXEu2m9m+nAwUECBRgl/Xphfqc066Cp1rcauejRYGe1fdY5UijXz0wsc6CzyaAwolBKAQnxU9+e9RkP5CDKEk9345GBlQHHmW9U7cu+aZTwzXi1qz66A0aF27DmBjYsGWHg49Y6HgfmF8buga0KQvd37Zk5pOsXl0kzcKUqq8ccKkKVC/MP7zYI7YxlwlP+qe3fv3YGrlQKyK9++FAo5F+10k/mYUcgxcf/58Ej/4+J803UsBTm+/SG3P38x+o93CTe2U7Tz7BRvdvP/hftdTuhyQq93sP/Dk3u+2/CdgDoz1Jlxm7N/mPllKEpLjOGi8Z1igFBKIClI39n+LcOoNiuITsODH+/OJU9cXbexlQ7Y5NTs0HpN3Xn81wXLrLyM2J8UsqQkaw1+/vAvhx0floZv9MhRqSykHJtEUgJ8kPKoUc8MYMhwQg6FUlACkuLNFA1GAkFoSZJnKsMGCjLivJmNVNHvTevFqmFQlBRkJAwZkpCSk7/VOzg5jUMGRIT04qPuT/uV1KfYuWyEUiO/RrNWAQLxanp370Oas56paVF61L27t55Ne3c9l9u4KXHpVEe/b/6pEVoXwqa8av4Iplr1VaChoVVejzKrrlpd/wdqZ96EzbsuCAAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAACL0lEQVR42u2T64nCUBCF7SAlpIQtISVYQkrYElKCJaSElHBL8LfPKD7wyUXxgYrOzkCyHC6b3LgasywOfBDuOTNzcklq73rXfygiqjMxk1YsZ38lXIOyq1F1OI/s5VUZsAlBNOMlaDhvVhXOZ7B80D4ztNeV+VNY9VdUzg3VM/5srM9XhXOMb0zleJXxjTqlB7xer8HtdiPAy/KKhl7pLTXc5XJxGc1QggJNIXgOfs24pQU8nU4hQynn89kFjZD0XDyGFpYS7nA4uMfjkYAQddQEQwtRk1lPD7jb7SKGUvb7vWvoTdCbqIkXNCF6arjNZuNtt1sCAtPDZwp09YMe4AyZ+bSAWmvFUILm4Y7Fo0xderQUep5Rq9XKW6/XBAQ/+fi8AZ5GhicwZj1+i4vFIl4ul5QQZ/lYC8AX5Pi+58nsh8LNZjOfoZT5fO7neAPwZgaUGeIB/F+Fm0wmznQ6jRlKyH1b1uvgred5zbmy6+6Ao9EoGI/HBHh5ftF/6SXZdVe44XDoMJqhBFWgxwO/V8CvwK+Z4rfY7/eDOI4JsC4cDAYO4yVYl8lM3CE7C4XrdrsuQym9Xi+qlVQyW3YArrWp3W6HDKV0Oh1usler1fLTHnku0iOzxQ+EtiUfDAHYYOsl5I6+0Oj9yDNHYNSM84KADqOhNyq65K5fX/wP9tpfznrV9kWu7dbtn1bxgCHj1sorfKmwaEDFUMUo21XrCsNpyVD4yl8GflLvetcfqy+dCCa6ODMoXAAAAABJRU5ErkJggg=="/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArElEQVR42u3YywnAIBBFUTtJaSnFUqzLhVjKZDZmI8HfGx3CPLj7AyKIjoic5pwBDWhAA+oBei5wlxMYClgGh6KBcKgUEAaVBi5DdwGnobuBw9BTwG7oaWATqgX4CdUGrKBagWX3MjCl5DmSKOe8Dowxeo7ABQ5zxGDgC4NdEhCwgmkBfsJOA5uwU8Bu2G7gMGwXcBomDVyGSQFhMDQQDkO+ZuxnwYAGNOAfgQ8LTbXBn1RvGQAAAABJRU5ErkJggg=="/><element name="playIconOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAACJElEQVR42u2YS0sCURTHNc3sTWEPelMQUQQtKnptIojosWgdFLTIFu2qdZ8i6Cv0BVq3KUi3IqgI4hN0rS5v/xtnahh1Gqd7Z0bowA/EWcyPM/ece+9xMcZcTsbVcoJ6gedul4VhSJBLEW0a3LKFdQVVYh7gBT7QQfjoP48ia5egh4S6QT8YJPjvHuAH7bJEGwpq5PrACJgB88QsGAcBet4pQ1RPsI1eyLM0ChbABtgD+2AXrINFMAWGZIg2ajNKQfDsDYA5sA2ewRt4ANfgDByCLbAEpkWL6gl66CXDYBmcgBf2E1HwCG7BBTiWIaon6KXCGANrlK1XVhtx8ATuZYgaEZwAm+ASvLPGkZAh+psgL5BJWn9X4IP9HkJFjQrugCAIMeMhRLQZQV61YdZ86Ikq7amXGr5XK2mFYCPRI1rbi/QOvjt1UTa/Ja0U1IregXNwAFZpZwpoJe0QVLcn3kdvwCntUrOUST+tSVsFlYjQzsQ3ghXquz2URUcIKvFEa3Kaqlv5zMYFi8ViOJlMMhmUSqW/CxYKhXAsFmMiSafTkXK5LOYTixTMZDLxSqUitkhECEIsUa1W5bSZvwiqxOQ1ajOCdcSkbXVBCIYEiQk/LHwdt/L5/IdVYqYOrBB8t0rM1JE/l8u91msXMsRMXZqy2eyLqsFGqY/ZdmmquXZC6jmVSr1R57fv2un4i3tLjD4cPzxqifGb4weYjh0B/0/5m+QT3Dh1BNFdpj4AAAAASUVORK5CYII="/><element name="replayIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAABxUlEQVR42u2XwY3CMBBF0wElpARKcAkpISWkhJRACS5hS3AJnOHAwoEDB2QOHJCQmP2DcrBGycZ2BtiVMtKTEGLe/NixJYq55prrxUVEBjSgBStgu88NMJ8KVXZBPI2XBxaU7wi2AJbyy7LjVeGWwNP08uzSDlcDPzLUCcZ+X79j5RyofumtgNNeSfnO+QG5SfCYIc+kd3LgQKxzpNzT9cqy2VfJ4BPr70iptXpG42JXWcXH4+EBBbhCqdgl3D5JcL/fDSBBpRWQXT3++N253W4NoABfKBc7xYwmuvl6vbaAApx2QHaKGW108+VysYAC1AOyU8yID3g+n1eAAtQDslPMiA94Op1aQAHqAdkpZsQHPB6PDaAA9UPCTjEj/pAcDgcDSJB1zez3e9Pjr3r8Jkm82+08oADe5lSH6Xqt+N4Jd/oObbdbCyhks9mYREcd9D9DskN6gU0OCFEJSODBIsGxEv22c5Ag7/9KJyTBV0K/AzSCLXKLV6vnieuEftkr+RY7khVyGQyqJ74iEp0/TxBVTGKPedX2aj1UC+jPhuTDBEgvpH7AdUJA/4GAw2GAAy2oNQ7KlEt+DWwXxoBFMddc/6x+ACbEv+zn5grUAAAAAElFTkSuQmCC"/><element name="replayIconOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAGZklEQVR42rWYTWxUVRiGoTPM0LG20IEypUCKTX9IhCK0iqAVGtQAIUasAyaAWkaJJlZMhigs8CcaEhdSdSNx0bhRFrqQjS66BTFGFiSFgC2/bWkhQIFSZ4pwfW/ynOTkwO3l9yZPAnfO+b53vvOd95zpuLt9PM8bb1EgIhB1iECBPWfcw3psUQiYIOKiUCTEIw4JPoszNmqLfRjCIkYUyYtFqSgT5aJCzIAK3pUxppg5RmzkgQh1KjZRFJEwJSpFrZgnGsQisRgW8W4eYyqZU0qMiXZF70dcRMRYslKqUyMWiCaxUrSI9aJVZKCVdy2MaWJODTFKiRkz1bxXcXGWJyWqRaN4QaTF2yIrOkSn2C8Oii7+3clnWcammdtIrBSx4wEiQ8VNFCV847limVgn2kQ7QvIi7Mkztp2564g1l9gl5ELkHVaOiTPFfLGCpdspjoh7fY4QI0PM+eQosSsZtiFilH4GAVaJd0UH1bivhxgdxFxFjhnkjAVuHARGad4US7CCQL+JfEjSs6IfzoaOV0xiryBXitxRBAb2XZLd1iwyIZUbEHvFJ2KreB+28m6vGAipZIZcNeR2+hGBGGgR5W6kmXcGiBsVv4odYrNIYyfLYaVI89kOxo4GiNxJrkZyF6FlvNt7cfypFjtoC9gQQ2K3yBK4GY+rE1VQx7tmxmSZMxSwcdrIWYuGuOlFu/cSopzAa7EF9xkl0QdiDSdGNfOSogSSvKtmzBrm7A6oZDs5FzAvYXrRXt5ijqQmjLXLjcJSZUnYKGYjpohvHYM475KMaWROlhju00XOJjRIC8vsLG8d/ZO9efNmTngWA/TTOqoymzmFBONqJbhY8FkpYxcxd4cfy4mdQ/xKUWcv8ziCFXLzqBctN27c6Lh+/bpno3d7afpmli7JPPfQdy8ZhYytZu5mP9Zt4nf4udFQxryIEWj6r0Fs0ITOXC7nWeSxjbTpE2u3FYQYv3GH6cxN+7H8mHYOP6efGw30oQRa5lzBMrRqwv7h4WHPMDIychZvM0uQDDma3Crir7SQYvkx7Rx+Tj83GiqMaRuBxv8Wi4wmdA0NDXmGK1eu9GHAy7GRSeZYCrt5O71YLZ4XW/yYdo5r164dwLQXGz8MFKjJBy9cuOCBHyBYYHDV4ggrwnqmWR67RTH77RxXr14NFugu8eXLl/cPDg564Adwltgx09tsDERNFeUkrKIHXxIf+jHtHMoZtMS3bhJ9u86+vj7P0N/fbzbJq+IJxtoHu3ueT0JUragn7tNU7w3xhR/TzqGcQZvkVptRuTtOnTrl2egb+jbzlnhOPIYIU0X7qvYoFZgnll68eHE79vGa2CS2q4V+d+MrZ4DNBBj1iRMncsePH/cMZ86c8Zd5m3iZICmRsHzQvQ0tu3Tp0uea61fob/3/Yy4G3/X29p63YytXoFEHHnUS1HXs2DHPRsuwhz551jqSYoiLIjhFG7xy7ty5PWauRPXo3c+q1J9uXOU6zCHgHnXBlwX51K6jR496NgqWy+fzH+nzF+2bhznaWN5ZYololai/7Pmq5HnF+M+Nq1zfcAwudC8LY1233jt9+vRhN5iW4xBLMcdcMAkWoy+rsKM2je1jXiCq3j84xConJg4RfGFNj46OfuZXzQ44MDDwAwJqxGQRt08LkqwW2zQ3P5a47u7uER1x32vsO2Ipl4oSx2Mdi8Dx2a0btOPalehfBfT96kes5imW0vRg1HGCtJbt27Dq6fTYp7G7RCsGPZM24UYd8KMJ15+DyBY1+9c+3OmeoXpTERW1e5jqb/Q3VJjAXj0a+5UlcFaYQNvLUghp8EXBQqo7zbrNROzjEkPeJCM+gJAxUZ934a/uDi4Y8+8xJJyC6VZChblBW/ZSYAmcyQ7OnDx5shsRoWjsPusAcHowWOQE+7CHIucGTdWxGAlkqd7s6ekZRMCdMMwXqwwT6C63ERoDhHG8gVXBCvOTNUiMv7NlP/16/lBf/6Ij9FNsq15Mt3923tWfel1RDHONfpp4XDt/IzbSpx47JDH7tGl+km196Z/FXN0yYi2eu5DqTXZ+uN/341rUZBIt4GLawg3ldbEei1qNjy5BWB2tUWqf7Q9WIH2IRSWxizmcyU9Cg6jnfRVjyhlfbHrbFfcwRCZo9ClY1XQoF2UImsSmSlD52IOtXPiPpBiJEwF/9TcbLupuOjfu/32eYAv3OqcpAAAAAElFTkSuQmCC"/></elements></component><component name="dock"><settings><setting name="iconalpha" value="0.75"/><setting name="iconalphaactive" value="0.5"/><setting name="iconalphaover" value="1"/><setting name="margin" value="8"/></settings><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA80lEQVR42u2WQQqDMBBFQ4pQeoVueiN7BtG9R+lR7IlaAllnIZaCxHR+KWLpou7mCxE+Jm7m8b+TiTXy1HVdim5N0yQNoTYYwGKrqiqnaer6vj865x4aQm0wgMXGGC/yYfTeP4dhiBpCbTCAxQrZKYQwppSMpsAAFgAZJiGy90LbITCAhc8hBneWLs2RMegrMgZ3ZodYIuP8qSnbfpmhln66jO5gpOsyhsh4HaI7qfMs29Qsy5H9iyxfYddMe8r7EFWX5cg2FVkeritO6rtsCoILWgEWONRiY4zZy3unoU9tmNLaEMJVFmeRl48HDaE2GMDyAjEWKwKFLBqcAAAAAElFTkSuQmCC"/><element name="buttonOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAA80lEQVR42u2WQQqDMBBFQ4pQeoVueiN7BtG9R+lR7IlaAllnIZaCxHR+KWLpou7mCxE+Jm7m8b+TiTXy1HVdim5N0yQNoTYYwGKrqiqnaer6vj865x4aQm0wgMXGGC/yYfTeP4dhiBpCbTCAxQrZKYQwppSMpsAAFgAZJiGy90LbITCAhc8hBneWLs2RMegrMgZ3ZodYIuP8qSnbfpmhln66jO5gpOsyhsh4HaI7qfMs29Qsy5H9iyxfYddMe8r7EFWX5cg2FVkeritO6rtsCoILWgEWONRiY4zZy3unoU9tmNLaEMJVFmeRl48HDaE2GMDyAjEWKwKFLBqcAAAAAElFTkSuQmCC"/><element name="buttonActive" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAABD0lEQVR42u2XQQ6CMBREm97BeCnjIQjcxLt4KVckrKuphYIC/jEtKRu3fxaSDGlh0ZeZ/2mxRq66rs+iW9M0bw1hbTCAxVZVdVqW5eq9P7Rte9cQ1gYDWOw8zxd5ELque4QQeg1hbTCAxQrZ0Tn3XNd11BQYwAKgkUmI7DsQyklTYAALn0Nyi4lyVBZciltkDNpFpu3QrqizZcoiLeqi7dUj2xxKFa6q/C3idIiyywgiI3ZIBi9th8BQdhmFdl3GuJepn4fy8eMf2c/IEtBEENnEu9uz1BBvlzFGRvHXwRmZUMU0icpCUUfL4E7pEhwayvOIllLbD3DIY2KMUSvsvDZYrHPuLYM+v9BQgunB8gFJekgEq5c0PwAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAEklEQVR42mP4//8/AzJmIF0AAHImL9Fd8LZHAAAAAElFTkSuQmCC"/></elements></component><component name="playlist"><settings><setting name="activecolor" value="bfbfbf"/><setting name="backgroundcolor" value="262626"/><setting name="fontcolor" value="999999"/><setting name="fontsize" value="11"/><setting name="fontweight" value="normal"/><setting name="overcolor" value="cccccc"/><setting name="titlecolor" value="cccccc"/><setting name="titleactivecolor" value="ffffff"/><setting name="titleovercolor" value="ffffff"/><setting name="titlesize" value="13"/><setting name="titleweight" value="normal"/></settings><elements><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAACCAIAAABANcwGAAAAKElEQVR42mNhGPqAmZmZiYkJQsIZuLgsvr6+Q9q3/2Dg79+/yAxcXADiODDtLQ68BAAAAABJRU5ErkJggg=="/><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAMElEQVR42u3BMQEAAADCoPVPbQ0PoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAXA2RQAAEB5C4HAAAAAElFTkSuQmCC"/><element name="itemActive" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAkklEQVR42u3QsQkAIAxFQQsHy/4LqYWohYW9IAj34ENIeTkiRvq7vlb3ynHXB/+Wk64CCBAgQIACCBAgQAEECBCgAAIECFAAAQIEKIAAAQIUQIAAAQogQIAABRAgQIACCBAgQAEECBAgQAEECBCgAAIECFAAAQIEKIAAAQIUQIAAAQogQIAABRAgQIACCBAgQJ1NmcoiAdM9H4IAAAAASUVORK5CYII="/><element name="itemImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADYAAAA2CAAAAACpLjUBAAAAeklEQVR42mPiJQswMXCSARiYGFjIAEBtZAEmRnJ0MZJrG321jfpt1G+DzW8jMUj2lzMwlO8n2W87PMrLPXaQ7LfOHR4eOzpJ99vLe/deku63eItDhyziSfab5fGFC49bkuy3jIUMDAszRtPkaDYd9duo34aT3/6TARgA1wJNszqw3XsAAAAASUVORK5CYII="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAKCAYAAACqnE5VAAAAEklEQVQ4EWNgGAWjYBSMAnQAAAQaAAFh133DAAAAAElFTkSuQmCC"/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAKCAYAAACqnE5VAAAAEklEQVQ4EWNgGAWjYBSMAnQAAAQaAAFh133DAAAAAElFTkSuQmCC"/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAABCAYAAADAW76WAAAAEElEQVR42mNiIA78J4AJAgCXsgf7Men2/QAAAABJRU5ErkJggg=="/><element name="sliderRailCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAECAYAAACQli8lAAAAJklEQVR42mNgIA78J4CpBu7jseQ+NS3yx2ORPwOVgT+az+6TYgkAKMIaoyp3CGoAAAAASUVORK5CYII="/><element name="sliderRailCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAECAYAAACQli8lAAAALElEQVR42mNgIB74A/F9IP4PxfehYlQF/kgWoGOqWnYfj0X3qWnRfwKYIAAAPu0ao3yGmCgAAAAASUVORK5CYII="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAABCAYAAADAW76WAAAAMElEQVR42mP+//8/Q0NDA16sqqr6Pycnp6G0tLShqqqqoba2tgEEGhsbG6CgkZAZAEhcK/uBtK2eAAAAAElFTkSuQmCC"/><element name="sliderThumbCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAECAYAAACQli8lAAAAUElEQVR42q3NoREAIQwEwHSYJjOo1IBIDfEx+EgEDMfLVwyCbWDphoig1gp3R2sNmYneO+acWGuBXimlxCEKekVV+RAxvWRm/EXxi2KMcZ1sxLJpnEUZrv0AAAAASUVORK5CYII="/><element name="sliderThumbCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAECAYAAACQli8lAAAAUklEQVR42q3NoREAIQwFUTpMk0wUNSBSAz4mPhIBk8/JUwwiW8C+8pqI0BhDzQzujjmnrrWoZNZao947Pgg/CHtvREQexsx6gTQNqrXiAuHlcQDl9mmceNYnwwAAAABJRU5ErkJggg=="/></elements></component><component name="tooltip"><settings><setting name="fontcase" value="normal"/><setting name="fontcolor" value="cccccc"/><setting name="fontsize" value="12"/><setting name="fontweight" value="normal"/><setting name="activecolor" value="cccccc"/><setting name="overcolor" value="ffffff"/></settings><elements><element name="arrow" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAASklEQVR42p3KQQ2AMAAEwXOAi/lWSqUgpZIqASmVAN+GNECYZH8bHDhfOoLyYSxJEuwP054Z+mLqucOGMU0DW1ZQp7HmCRpa/roABHU6b1RN/woAAAAASUVORK5CYII="/><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAADklEQVR42mNQQwIMxHEAuXQHISaBGr0AAAAASUVORK5CYII="/><element name="capTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAADklEQVR42mNQQwIMxHEAuXQHISaBGr0AAAAASUVORK5CYII="/><element name="capBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAADklEQVR42mNQQwIMxHEAuXQHISaBGr0AAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAADklEQVR42mNQQwIMxHEAuXQHISaBGr0AAAAASUVORK5CYII="/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAADklEQVR42mNQQwIMxHEAuXQHISaBGr0AAAAASUVORK5CYII="/><element name="capTopLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAIElEQVR42mNgAAI1NTV/IL4PxP9hnP8wzACTQRb4j4wBSrYUAF5mO7QAAAAASUVORK5CYII="/><element name="capTopRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAH0lEQVR42mNQU1P7D8T3gdifAQSgAjDsjy5wH13gPwBoAhQA/dBvkQAAAABJRU5ErkJggg=="/><element name="capBottomLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAHUlEQVR42mNQU1P7j4wZgMR9dAF/FAEQgAqCVQIAxzkUAKo9yiMAAAAASUVORK5CYII="/><element name="capBottomRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAHElEQVR42mNQU1P7j4wZ0ATuowv4wwTugzlAAADkhRQAhODqdgAAAABJRU5ErkJggg=="/><element name="menuTopHD" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAYCAYAAABtGnqsAAABKUlEQVR42u2WYQ2DMBSEcYCESuAHAioBCZOAhOFgEiahEpCAhEpAQtcu1+TSwSDbfrDtvuQFWtpHe7lXqCohhBAPDMPQxBhjhBhzjDM9O3MbfWmspfYVc82zeegPlCMUkfpc8f4aa2qOKl5eYI+2iTHlTewU0Mc4bQnPAq6No/UYtN1SniMJmDbuFhzp9wgYr11yIO6ndwWknPd3cM6jCrhValsCJod0VMrduwJS3nDY0qWF9tlB1Gf2OBDlVp5j7kMCpvzjN3xATD6kIYjjcwclPi6dUXhWiu/x7D8EJJFmOMvDSX3hOI/rTOJOuWRp7CWLQnPGLMZPCkjOsuTEtLG6+LDY4lfFruRp4ELLsTQH48xaHv1kCiGEECLStm1QvB5ykBBCiJe5AX69621Fd8YvAAAAAElFTkSuQmCC"/><element name="menuTopCC" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAYCAYAAAAF6fiUAAABjklEQVR42u1X3c2DMAzsBhmBEXhggIzACIzACGUDRmCEjsAIGSEjMAIfkS7oegr0oQ/9IvkkC2HH+fHZDjweBoPBYDAIpmlqD1kP2Q/ZDhnEPsA2kM5Dt5PfWNBnSfpnEpojvUfYwyE92ZJulPXWi/3ONQff5eDhvcG7pzGvFJwcAA2I+DUcRFnrJABkhTwe8yX/lgiIYl9pP0/af9CkqYmAlN0v0TV08HTASAdvSgRAF4S4OwJiDjbZEykLVwAFnQlYMJfT/dZIwFtbKNjHXOIga6aAxOyPoATxvSNgL6zFQd7xXLEu2xzmCpCTjBoJOLNOKqClrH7r9RcEjBqEDwRsmrVcjURAbm09V4O00EXPUBMBDfde7rGwRRm/aEbezH1HwMxBo17eqy9d1iu1r/6ujdZ4D2wo94inQ5BmGdvD/i0BDkTn9d6+Zgq+Qb6CNmpBm94ntX4NeamEttRbMc59OjS3iqvLEjpfaF/+qi3KPrz9SBgMBoPBYDD8a3Rdt5v8TiwDDQaDwWD4Ef4AO4h4lB2vwSEAAAAASUVORK5CYII="/><element name="menuOption" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAuElEQVR42u2SQQqGIBCF/wOU1UYUMjAiQdSTeI4O2DnmUL9PatVq3AUNPBhEPt6bmd9XL6u+77uiXHRAV9+1wvais4iEEFXor7e9xdkJiJSSjDG0LAsppWgYhgplOb2iVdi2bRRCqHLOkdb6dpo5wAPu4AyglFJVjJGstTSOI+EPF4iYD+C6rjRNExuIyJgZYgJU5b2neZ7vBWX2UrAAzAwx4QwwuLuX0no2mBlAcMY4G85hf/Wu+gNm+kvWRCvtuQAAAABJRU5ErkJggg=="/><element name="menuOptionOver" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABfklEQVR42r2VTWqDUBSFG6v5KcVJsWTWaUZdRLuNbsNxt5CZ4/xsIJhAkGQJ3UBCcCA6UhBJQDDk9h04giREKQkVPpD37j3cc+/z+dD0iEirSn10s4hGHokG/iReEdIVbUVH0SMdrumlcKMYKzEUTwpT8aKwAN9N7hmMbdWKsYJnCrwpBop3MuCaxZh2KXrNpsHAPpK32+2H4zjfw+HQAXjHGoX7jDUu7FNQpxULCa7rftm2/TMajeLZbJaB8XgcYw17FLWYo58LaizfhCVVxScSl8vlYbPZSBiGEkWR7HY78TzvgD3E0L7JXO3cbpdNH8AaqoFYmqZSFIUcj0fZ7/fi+75MJpMYMYhlTre0XR1GT/GK5qNfsIjKIFY+p9NJ4jiW1Wp1QAximdODRqMgbKKyqmCSJLJYLLJrgrWW0TPYhBDI81yCIJDpdHrVcu1QMAD0DDZRGcTW63XdUJqPDSqdz+cZ+oZhNB6b+x/s+396t18Od72+/vuCvf0X8At7J48fIgP61QAAAABJRU5ErkJggg=="/><element name="menuOptionActive" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABfklEQVR42r2VTWqDUBSFG6v5KcVJsWTWaUZdRLuNbsNxt5CZ4/xsIJhAkGQJ3UBCcCA6UhBJQDDk9h04giREKQkVPpD37j3cc+/z+dD0iEirSn10s4hGHokG/iReEdIVbUVH0SMdrumlcKMYKzEUTwpT8aKwAN9N7hmMbdWKsYJnCrwpBop3MuCaxZh2KXrNpsHAPpK32+2H4zjfw+HQAXjHGoX7jDUu7FNQpxULCa7rftm2/TMajeLZbJaB8XgcYw17FLWYo58LaizfhCVVxScSl8vlYbPZSBiGEkWR7HY78TzvgD3E0L7JXO3cbpdNH8AaqoFYmqZSFIUcj0fZ7/fi+75MJpMYMYhlTre0XR1GT/GK5qNfsIjKIFY+p9NJ4jiW1Wp1QAximdODRqMgbKKyqmCSJLJYLLJrgrWW0TPYhBDI81yCIJDpdHrVcu1QMAD0DDZRGcTW63XdUJqPDSqdz+cZ+oZhNB6b+x/s+396t18Od72+/vuCvf0X8At7J48fIgP61QAAAABJRU5ErkJggg=="/><element name="volumeCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAAFUlEQVR42mP4//8/AzUxw6iBg89AACt1ZqjY29nMAAAAAElFTkSuQmCC"/><element name="volumeCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAAFUlEQVR42mP4//8/AzUxw6iBg89AACt1ZqjY29nMAAAAAElFTkSuQmCC"/><element name="volumeRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAYAAABmdppWAAAAPklEQVR42u3MoREAIAwDQDpI95+xVwG2AjziY3IR+ViPZOaeu7tXVc2O2y+AQCAQCAQCgUAgEAgEAoHAP8ADVGLAaqN7TdUAAAAASUVORK5CYII="/><element name="volumeRailCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAAXklEQVR42pXOMQrAIAyFYUGSIeqQuLh4Ju8/eZRXIhQ6WMHhhxDIRwKAsKv3jm+tNagqcs4gIvzdhQM4d2BKCcw8r8FSyqi1Lsgzs/WdgzHGcQ2+qIhMhzyffXe6eQBmfbZnUQ+tqAAAAABJRU5ErkJggg=="/><element name="volumeRailCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAAX0lEQVR42p2OsQrAIAxEhRAHoxB1cfGb/P/JTzkboVsttMODcOEe5wC4EymlEUKYMUYYdlv21jk+VHXUWtFa25RStlREQETjs7D3Pi9wY9Kc8xZ67+cfIZ6EtpKZceot+LS2cEn/XGYAAAAASUVORK5CYII="/><element name="volumeProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAA8CAYAAABmdppWAAAASUlEQVR42u3MQQ0AUQjE0CFYgARQjGvWwBewh/beZ3enV7t77q7MVFWpuzUzigiZmSTZ6zNAQEBAQEBAQEBAQEBAQEBAQMB/gB8nJqOYNsUfIAAAAABJRU5ErkJggg=="/><element name="volumeProgressCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAAVUlEQVR42pXMwQkAIQxE0XSYshQtImXYhh3kKFiD+L3s3iTgwBz/E0BuTylRSsHMaK3Re2fOyd6bb9dOAtAD0J/BnLMGoD6DgNRa1cz8B8cYvtbSqDn4F/TaDHcq1wAAAABJRU5ErkJggg=="/><element name="volumeProgressCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAAVElEQVR42mP5//8/Ay7Q09PjLyIiMkFCQkJBUlKSQVxc/IGoqGgBMzPzRlx6WHBJdHZ2+jMxMW1AFgMapAAVCwDijSQZCHT5BAbcYALJBgKBAjlyAHZIEpxZZYn/AAAAAElFTkSuQmCC"/><element name="volumeThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAAnklEQVR42mP4//8/AxbMBMTsQMwHxMJALALFwlAxdqgaDL24DOMGYoVly5ZFVldXz6ysrFwOwiA2SAwkB1XDRMhARqjtigcPHsw/d+7c9Z9A8B8KQGyQGEgOpAaqlpGQgSAv2Vy7du38fxwAKmcDVYvXQCZoOHkjuwwdQOW8oWqZCBkICvyA/4RBAFQt/Q2kqpepHilUTzZUT9gUZz0ACDf945eBHBQAAAAASUVORK5CYII="/></elements></component></components></skin>';this.xml=a.utils.parseXML(this.text);return this}})(jwplayer);(function(g){var o=jwplayer.utils,p=jwplayer.events,q=p.state,m=o.css,n=document,a=".jwdisplay",j=".jwpreview",l=".jwerror",d=true,k=false,b="absolute",c="none",h="100%",e="hidden",f="opacity .25s, background-image .25s, color .25s";g.display=function(u,M){var t=u,F=u.skin,X,aa,J,w,H,S,V,r=k,ab={},Q=k,W=k,T={},s,K,Y=o.extend({showicons:d,bufferrotation:45,bufferinterval:100,fontcolor:"#ccc",overcolor:"#fff",fontsize:15,fontweight:""},F.getComponentSettings("display"),M),O=new p.eventdispatcher();o.extend(this,O);function U(){X=n.createElement("div");X.id=t.id+"_display";X.className="jwdisplay";aa=n.createElement("div");aa.className="jwpreview jw"+t.jwGetStretching();X.appendChild(aa);t.jwAddEventListener(p.JWPLAYER_PLAYER_STATE,z);t.jwAddEventListener(p.JWPLAYER_PLAYLIST_ITEM,x);t.jwAddEventListener(p.JWPLAYER_PLAYLIST_COMPLETE,P);t.jwAddEventListener(p.JWPLAYER_MEDIA_ERROR,y);t.jwAddEventListener(p.JWPLAYER_ERROR,y);X.addEventListener("click",Z,k);R();z({newstate:q.IDLE})}function Z(ac){switch(t.jwGetState()){case q.PLAYING:case q.BUFFERING:t.jwPause();break;default:t.jwPlay();break}O.sendEvent(p.JWPLAYER_DISPLAY_CLICK)}this.clickHandler=Z;function R(){var ac={font:Y.fontweight+" "+Y.fontsize+"px/"+(parseInt(Y.fontsize)+3)+"px Arial,Helvetica,sans-serif",color:Y.fontcolor},ad={color:Y.overcolor};K=new g.displayicon(X.id+"_button",t,ac,ad);X.appendChild(K.element())}function B(ac,ad){if(!Y.showicons){return}if(ac||ad){K.setRotation(ac=="buffer"?parseInt(Y.bufferrotation):0,parseInt(Y.bufferinterval));K.setIcon(ac);K.setText(ad)}else{K.hide()}}function x(){C();J=t.jwGetPlaylist()[t.jwGetPlaylistIndex()];var ac=J?J.image:"";v(ac)}function v(ac){if(w!=ac){if(w){L(j,k)}w=ac;I()}else{if(w){L(j,d)}}A(t.jwGetState())}function P(){W=d;B("replay");var ac=t.jwGetPlaylist()[0];v(ac.image)}var G;function z(ac){clearTimeout(G);G=setTimeout(function(){A(ac.newstate)},100)}function A(ac){if(K){K.setRotation(0)}switch(ac){case q.IDLE:if(!Q&&!W){if(w&&!r){L(j,d)}B("play",J?J.title:"")}break;case q.BUFFERING:C();W=k;B("buffer");break;case q.PLAYING:B();break;case q.PAUSED:B("play");break}}this.hidePreview=function(ac){r=ac;L(j,!ac)};this.element=function(){return X};function N(ac){return"#"+X.id+" "+ac}function I(){if(w){var ac=new Image();ac.addEventListener("load",E,k);ac.src=w}else{m(N(j),{"background-image":undefined});L(j,k);H=S=0}}function E(){H=this.width;S=this.height;A(t.jwGetState());D();if(w){m(N(j),{"background-image":"url("+w+")"})}}function y(ac){Q=d;B("error",ac.message)}function C(){Q=k;if(ab.error){ab.error.setText()}}function D(){if(X.clientWidth*X.clientHeight>0){o.stretch(t.jwGetStretching(),aa,X.clientWidth,X.clientHeight,H,S)}}this.redraw=D;function L(ac,ad){if(!o.exists(T[ac])){T[ac]=false}if(T[ac]!=ad){T[ac]=ad;m(N(ac),{opacity:ad?1:0,visibility:ad?"visible":"hidden"})}}this.show=function(){if(K&&t.jwGetState()!=q.PLAYING){K.show()}};this.hide=function(){if(K){K.hide()}};this.setAlternateClickHandler=function(ac){_alternateClickHandler=ac};this.revertAlternateClickHandler=function(){_alternateClickHandler=undefined};U()};m(a,{position:b,cursor:"pointer",width:h,height:h,overflow:e});m(a+" .jwpreview",{position:b,width:h,height:h,background:"no-repeat center",overflow:e,opacity:0});m(a+", "+a+" *",{"-webkit-transition":f,"-moz-transition":f,"-o-transition":f})})(jwplayer.html5);(function(d){var j=jwplayer.utils,l=jwplayer.events,m=l.state,g=j.css,c=".jwdisplayIcon",f=undefined,h=document,b="none",e="100%",k="center",a="absolute";d.displayicon=function(K,F,v,C){var L=F,y=L.skin,r=K,z,M,R,B,x,q,D,H,G=0;function A(){z=O("jwdisplayIcon");z.id=r;w();q=O("jwtext",z,v,C);D=O("icon",z);o();p()}function t(S,T){return"#"+r+(T?":hover":"")+" "+(S?S:"")}function O(T,V,U,S){var W=h.createElement("div");W.className=T;if(V){V.appendChild(W)}P(T,"."+T,U,S);return W}function w(){M=I("background");R=I("capLeft");B=I("capRight");x=(R.width*B.width>0);var S={"background-image":"url("+R.src+"), url("+M.src+"), url("+B.src+")","background-position":"left,center,right","background-repeat":"no-repeat",padding:"0 "+B.width+"px 0 "+R.width+"px",height:M.height,"margin-top":M.height/-2};g(t(),S);if(M.overSrc){S["background-image"]="url("+R.overSrc+"), url("+M.overSrc+"), url("+B.overSrc+")"}g("#"+L.id+" .jwdisplay:hover "+t(),S)}function P(U,S,W,T){var V=I(U);if(U=="replayIcon"&&!V.src){V=I("playIcon")}W=j.extend({},W);if(U.indexOf("Icon")>0){G=V.width}if(V.src){W["background-image"]="url("+V.src+")";W.width=V.width}g(t(S),W);T=j.extend({},T);if(V.overSrc){T["background-image"]="url("+V.overSrc+")"}H=V;g("#"+L.id+" .jwdisplay:hover "+(S?S:t()),T)}function I(T){var U=y.getSkinElement("display",T),S=y.getSkinElement("display",T+"Over");if(U){U.overSrc=(S&&S.src)?S.src:"";return U}return{src:"",overSrc:"",width:0,height:0}}function p(){var T=x||(G==0),U="px "+e,S;g(t(".jwtext"),{display:(q.innerHTML&&T)?f:b});setTimeout(function(){S=Math.max(H.width,j.bounds(z).width-B.width-R.width);if(j.isFF()||j.isIE()){S++}if(j.isChrome()&&z.parentNode.clientWidth%2==1){S++}g(t(),{"background-size":[R.width+U,S+U,B.width+U].join(",")},true)},0)}this.element=function(){return z};this.setText=function(T){var S=q.style;q.innerHTML=T?T.replace(":",":<br>"):"";S.height="0";S.display="block";if(T){while(n(q)>2){q.innerHTML=q.innerHTML.replace(/(.*) .*$/,"$1...")}}S.height="";S.display="";p()};this.setIcon=function(T){var S=O("icon");S.id=z.id+"_"+T;P(T+"Icon","#"+S.id);z.replaceChild(S,D);D=S};var u,s=0,Q;function J(T,S){clearInterval(u);Q=0;s=T;if(T==0){N()}else{u=setInterval(N,S)}}function N(){Q=(Q+s)%360;j.rotate(D,Q)}this.setRotation=J;function n(S){return Math.floor(S.scrollHeight/h.defaultView.getComputedStyle(S,null).lineHeight.replace("px",""))}var o=this.hide=function(){z.style.opacity=0};var E=this.show=function(){z.style.opacity=1};A()};g(c,{display:"table",cursor:"pointer",position:"relative","margin-left":"auto","margin-right":"auto",top:"50%"},true);g(c+" div",{position:"relative",display:"table-cell","vertical-align":"middle","background-repeat":"no-repeat","background-position":k});g(c+" div",{"vertical-align":"middle"},true);g(c+" .jwtext",{color:"#fff",padding:"0 1px","max-width":"300px","overflow-y":"hidden","text-align":k,"-webkit-user-select":b,"-moz-user-select":b,"-ms-user-select":b,"user-select":b})})(jwplayer.html5);(function(e){var l=jwplayer.utils,n=jwplayer.events,o=n.state,j=l.css,d=l.bounds,a=".jwdock",h=".jwdockbuttons",g=undefined,k=document,c="none",f="100%",m="center",b="absolute";e.dock=function(z,I){var C=z,B={iconalpha:0.75,iconalphaactive:0.5,iconalphaover:1,margin:8},u=l.extend({},B,I),p=C.id+"_dock",v=C.skin,K,E=0,s={},t={},w,F,J,D=this;function x(){D.visible=false;w=H("div","jwdock");F=H("div","jwdockbuttons");w.appendChild(F);w.id=p;y();setTimeout(function(){J=d(w)})}function y(){var M=A("button"),N=A("buttonOver"),O=A("buttonActive");if(!M){return}j(q(),{height:M.height,padding:u.margin});j(h,{height:M.height});j(q("button"),{width:M.width,cursor:"pointer",border:"none",background:M.src});if(N.src){j(q("button:hover"),{background:N.src})}if(O.src){j(q("button:active"),{background:O.src})}j(q("button>div"),{opacity:u.iconalpha});j(q("button:hover>div"),{opacity:u.iconalphaover});j(q("button:active>div"),{opacity:u.iconalphaactive});j(q(".jwoverlay"),{top:u.margin+M.height});G("capLeft",F);G("capRight",F);G("divider")}function G(O,N){var M=A(O);j(q("."+O),{width:M.width,background:M.src});return H("div",O,N)}function q(M,N){return"#"+p+" "+(M?M:"")}function H(O,M,N){var P=k.createElement(O);if(M){P.className=M}if(N){N.appendChild(P)}return P}function A(M){var N=v.getSkinElement("dock",M);return N?N:{width:0,height:0,src:""}}D.redraw=function(){J=d(w)};function L(N){var Q=t[N],M,P=s[N],R,O=d(P.icon);Q.offsetX(0);R=d(w);j("#"+Q.element().id,{left:O.left-R.left+O.width/2});M=d(Q.element());if(R.left>M.left){Q.offsetX(R.left-M.left+8)}}D.element=function(){return w};D.offset=function(M){j(q(),{"margin-left":M})};D.hide=function(){D.visible=false;w.style.opacity=0;w.style.visibility="hidden"};D.show=function(){D.visible=true;w.style.opacity=1;w.style.visibility="visible"};D.addButton=function(M,U,Q,N){if(s[N]){return}var O=H("div","divider",F),P=H("button",null,F),T=H("div",null,P);T.id=p+"_"+N;T.innerHTML=" ";j("#"+T.id,{"background-image":M});if(typeof Q=="string"){Q=new Function(Q)}P.addEventListener("click",Q);s[N]={element:P,label:U,divider:O,icon:T};if(U){var V=new e.overlay(T.id+"_tooltip",v,true),R=H("div");R.id=V.id+"_label";R.innerHTML=U;j("#"+R.id,{padding:3});V.setContents(R);var S;P.addEventListener("mouseover",function(){clearTimeout(S);L(N);V.show();for(var W in t){if(W!=N){t[W].hide()}}},false);P.addEventListener("mouseout",function(){S=setTimeout(V.hide,100)},false);w.appendChild(V.element());t[N]=V}E++;r()};D.removeButton=function(M){if(s[M]){F.removeChild(s[M].element);F.removeChild(s[M].divider);delete s[M];E--;r()}};D.numButtons=function(){return E};function r(){j(h+" .capLeft, "+h+" .capRight",{display:E?"block":"none"})}x()};j(a,{position:"absolute",width:f,opacity:0,});j(a+" > *",{height:f,"float":"left"});j(a+" > .jwoverlay",{height:"auto","float":"none","z-index":99});j(h,{position:"absolute"});j(h+" button",{position:"relative"});j(h+" > *",{height:f,"float":"left"});j(h+" .divider",{display:"none"});j(h+" button ~ .divider",{display:"block"});j(h+" .capLeft, "+h+" .capRight",{display:"none"});j(h+" .capRight",{"float":"right"});j(h+" button > div",{left:0,right:0,top:0,bottom:0,margin:5,position:"absolute","background-position":"center","background-repeat":"no-repeat"});l.transitionStyle(a,"background .15s, opacity .15s");l.transitionStyle(a+" .jwoverlay","opacity .15s");l.transitionStyle(h+" button div","opacity .15s")})(jwplayer.html5);(function(a){var e=jwplayer,c=e.utils,d=e.events,b=d.state,f=e.playlist;a.instream=function(C,q,B,D){var x={controlbarseekable:"always",controlbarpausable:true,controlbarstoppable:true,playlistclickable:true};var z,E,G=C,I=q,n=B,A=D,v,L,s,K,j,k,l,p,u,m=false,o,h,r=this;this.load=function(P,O){g();m=true;E=c.extend(x,O);z=new f.item(P);J();h=document.createElement("div");h.id=r.id+"_instream_container";A.detachMedia();v=l.getTag();k=I.playlist[I.item];j=G.jwGetState();if(j==b.BUFFERING||j==b.PLAYING){v.pause()}L=v.src?v.src:v.currentSrc;s=v.innerHTML;K=v.currentTime;u=new a.display(r);u.setAlternateClickHandler(function(Q){if(_fakemodel.state==b.PAUSED){r.jwInstreamPlay()}else{H(d.JWPLAYER_INSTREAM_CLICK,Q)}});h.appendChild(u.element());if(!c.isMobile()){p=new a.controlbar(r);h.appendChild(p.element())}n.setupInstream(h,v);t();l.load(z)};this.jwInstreamDestroy=function(O){if(!m){return}m=false;if(j!=b.IDLE){l.load(k,false)}else{l.stop(true)}l.detachMedia();n.destroyInstream();if(p){try{p.element().parentNode.removeChild(p.getDisplayElement())}catch(P){}}H(d.JWPLAYER_INSTREAM_DESTROYED,{reason:(O?"complete":"destroyed")},true);A.attachMedia();if(j==b.BUFFERING||j==b.PLAYING){v.play();if(I.playlist[I.item]==k){I.getVideo().seek(K)}}return};this.jwInstreamAddEventListener=function(O,P){o.addEventListener(O,P)};this.jwInstreamRemoveEventListener=function(O,P){o.removeEventListener(O,P)};this.jwInstreamPlay=function(){if(!m){return}l.play(true)};this.jwInstreamPause=function(){if(!m){return}l.pause(true)};this.jwInstreamSeek=function(O){if(!m){return}l.seek(O)};this.jwInstreamGetState=function(){if(!m){return undefined}return _fakemodel.state};this.jwInstreamGetPosition=function(){if(!m){return undefined}return _fakemodel.position};this.jwInstreamGetDuration=function(){if(!m){return undefined}return _fakemodel.duration};this.playlistClickable=function(){return(!m||E.playlistclickable.toString().toLowerCase()=="true")};function w(){_fakemodel=new a.model({});o=new d.eventdispatcher();G.jwAddEventListener(d.JWPLAYER_RESIZE,t);G.jwAddEventListener(d.JWPLAYER_FULLSCREEN,t)}function g(){A.setMute(I.mute);A.setVolume(I.volume)}function J(){if(!l){l=new a.video(I.getVideo().getTag());l.addGlobalListener(M);l.addEventListener(d.JWPLAYER_MEDIA_META,N);l.addEventListener(d.JWPLAYER_MEDIA_COMPLETE,y);l.addEventListener(d.JWPLAYER_MEDIA_BUFFER_FULL,F)}l.attachMedia()}function M(O){if(m){H(O.type,O)}}function F(O){if(m){l.play()}}function y(O){if(m){setTimeout(function(){r.jwInstreamDestroy(true)},10)}}function N(O){if(O.metadata.width&&O.metadata.height){n.resizeMedia()}}function H(O,P,Q){if(m||Q){o.sendEvent(O,P)}}function t(){if(p){p.redraw()}if(u){u.redraw()}}this.jwPlay=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPlay()}};this.jwPause=function(O){if(E.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPause()}};this.jwStop=function(){if(E.controlbarstoppable.toString().toLowerCase()=="true"){this.jwInstreamDestroy();G.jwStop()}};this.jwSeek=function(O){switch(E.controlbarseekable.toLowerCase()){case"always":this.jwInstreamSeek(O);break;case"backwards":if(_fakemodel.position>O){this.jwInstreamSeek(O)}break}};this.jwGetPosition=function(){};this.jwGetDuration=function(){};this.jwGetWidth=G.jwGetWidth;this.jwGetHeight=G.jwGetHeight;this.jwGetFullscreen=G.jwGetFullscreen;this.jwSetFullscreen=G.jwSetFullscreen;this.jwGetVolume=function(){return I.volume};this.jwSetVolume=function(O){l.volume(O);G.jwSetVolume(O)};this.jwGetMute=function(){return I.mute};this.jwSetMute=function(O){l.mute(O);G.jwSetMute(O)};this.jwGetState=function(){return _fakemodel.state};this.jwGetPlaylist=function(){return[z]};this.jwGetPlaylistIndex=function(){return 0};this.jwGetStretching=function(){return I.config.stretching};this.jwAddEventListener=function(P,O){o.addEventListener(P,O)};this.jwRemoveEventListener=function(P,O){o.removeEventListener(P,O)};this.skin=G.skin;this.id=G.id+"_instream";w();return this}})(jwplayer.html5);(function(c){var n=c.utils,h=c.html5,m=n.css,j=undefined,k="free",f="pro",g="premium",o="ads",e="open",p="http://www.longtailvideo.com/jwpabout/?a=l&v=",a="visible",d="hidden",l=".jwlogo";var b=h.logo=function(x,y){var D=x,E=D.id+"_logo",t,r,u=b.defaults,C=false;function v(){B();s()}function B(){if(u.prefix){var F=c.version.split(/\W/).splice(0,2).join("/");if(u.prefix.indexOf(F)<0){u.prefix+=F+"/"}}try{if(n.isHTTPS()){u.prefix=u.prefix.replace("http://","https://ssl.")}}catch(H){}var G=z(w());u.link=p+c.version+"&m=h&e="+G;t=n.extend({},u,y);t.hide=(t.hide.toString()=="true")}function s(){r=document.createElement("img");r.className="jwlogo";r.id=E;if(!t.file){r.style.display="none";return}var F=(/(\w+)-(\w+)/).exec(t.position),G={},H=t.margin;if(F.length==3){G[F[1]]=H;G[F[2]]=H}else{G.top=G.right=H}m(q(),G);r.src=(t.prefix?t.prefix:"")+t.file;r.onclick=A}this.resize=function(G,F){};this.element=function(){return r};this.offset=function(F){m(q(),{"margin-bottom":F})};this.position=function(){return t.position};this.margin=function(){return parseInt(t.margin)};function A(F){if(n.exists(F)){F.stopPropagation()}if(C&&t.link){D.jwPause();D.jwSetFullscreen(false);window.open(t.link,t.linktarget)}return}function w(){if(c().config.key){var F=new n.key(c().config.key);return F.edition()}else{return e}}function z(F){if(F==f){return"p"}else{if(F==g){return"r"}else{if(F==o){return"a"}else{if(F==e){return"o"}else{return"f"}}}}}function q(F){return"#"+E+" "+(F?F:"")}this.hide=function(F){if(t.hide||F){C=false;r.style.visibility="hidden";r.style.opacity=0}};this.show=function(){C=true;r.style.visibility="visible";r.style.opacity=1};v();return this};b.defaults={prefix:"http://p.jwpcdn.com/",file:"logo.png",link:p+c.version+"&m=h&e=f",linktarget:"_top",margin:8,hide:false,position:"top-right"};m(l,{cursor:"pointer",position:"absolute","z-index":100,opacity:0});n.transitionStyle(l,"visibility .15s, opacity .15s")})(jwplayer);(function(c){var f=c.html5,k=c.utils,j=k.css,h="jwmenu",d="jwoption",g=undefined,a="#ffffff",b="#cccccc";f.menu=function(m,n,B,t){var x=B,z=m,y=n,o=t,q=new f.overlay(y+"_overlay",B),r=k.extend({fontcase:g,fontcolor:b,fontsize:11,fontweight:g,activecolor:a,overcolor:a},B.getComponentSettings("tooltip")),p,A=[];function w(){p=u(h);p.id=y;var G=s("menuTop"+m),E=s("menuOption"),D=s("menuOptionOver"),F=s("menuOptionActive");if(G){p.appendChild(G.image)}if(E){var C="#"+n+" ."+d;j(C,{"background-image":E.src,height:E.height,color:r.fontcolor,"padding-left":E.width,font:r.fontweight+" "+r.fontsize+"px Arial,Helvetica,sans-serif","line-height":E.height,"text-transform":(r.fontcase=="upper")?"uppercase":g});j(C+":hover",{"background-image":D.src?D.src:g,color:r.overcolor});j(C+".active",{"background-image":F.src?F.src:g,color:r.activecolor})}q.setContents(p)}this.element=function(){return q.element()};this.addOption=function(C,E){var D=u(d,p);D.id=y+"_option_"+E;D.innerHTML=C;D.addEventListener("click",v(A.length,E));A.push(D)};function v(C,D){return function(){l(C);if(o){o(D)}}}this.clearOptions=function(){while(A.length>0){p.removeChild(A.pop())}};var l=this.setActive=function(C){for(var D=0;D<A.length;D++){var E=A[D];E.className=E.className.replace(" active","");if(D==C){E.className+=" active"}}};function u(D,C){var E=document.createElement("div");if(D){E.className=D}if(C){C.appendChild(E)}return E}function s(C){var D=B.getSkinElement("tooltip",C);return D?D:{width:0,height:0,src:g}}this.show=q.show;this.hide=q.hide;this.offsetX=q.offsetX;w()};function e(l){return"."+l.replace(/ /g," .")}j(e(h+" "+d),{"background-repeat":"no-repeat",cursor:"pointer",position:"relative"})})(jwplayer);(function(b){var a=jwplayer.utils,d=jwplayer.events,e=undefined,c=true,f=false;b.model=function(j){var p=this,l,r,s=a.getCookies(),g={controlbar:{},display:{}},n={autostart:f,controls:c,debug:e,fullscreen:f,height:320,mobilecontrols:f,mute:f,playlist:[],playlistposition:"none",playlistsize:180,repeat:f,skin:e,stretching:a.stretching.UNIFORM,width:480,volume:90};function o(t){for(var u in t){t[u]=a.serialize(t[u])}return t}function q(){a.extend(p,new d.eventdispatcher());p.config=o(a.extend({},n,s,j));a.extend(p,{id:j.id,state:d.state.IDLE,duration:-1,position:0,buffer:0},p.config);p.playlist=[];p.setItem(0);r=document.createElement("video");l=new b.video(r);l.volume(p.volume);l.mute(p.mute);l.addGlobalListener(k)}var m={};m[d.JWPLAYER_MEDIA_MUTE]="mute";m[d.JWPLAYER_MEDIA_VOLUME]="volume";m[d.JWPLAYER_PLAYER_STATE]="newstate->state";m[d.JWPLAYER_MEDIA_BUFFER]="bufferPercent->buffer";m[d.JWPLAYER_MEDIA_TIME]="position,duration";function k(t){var A=(m[t.type]?m[t.type].split(","):[]),x,z;if(A.length>0){for(x=0;x<A.length;x++){var v=A[x],w=v.split("->"),y=w[0],u=w[1]?w[1]:y;if(p[u]!=t[y]){p[u]=t[y];z=true}}if(z){p.sendEvent(t.type,t)}}else{p.sendEvent(t.type,t)}}p.getVideo=function(){return l};p.seekDrag=function(t){l.seekDrag(t)};p.setFullscreen=function(t){if(t!=p.fullscreen){p.fullscreen=t;p.sendEvent(d.JWPLAYER_FULLSCREEN,{fullscreen:t})}};p.setPlaylist=function(t){p.playlist=h(t);if(p.playlist.length==0){p.sendEvent(d.JWPLAYER_ERROR,{message:"Error loading playlist: No playable sources found"})}else{p.sendEvent(d.JWPLAYER_PLAYLIST_LOADED,{playlist:t});p.item=-1;p.setItem(0)}};function h(w){var u=[];for(var t=0;t<w.length;t++){var v=a.extend({},w[t]);v.sources=a.filterSources(v.sources);if(v.sources.length>0){u.push(v)}}return u}p.setItem=function(t){var u;if(t==p.playlist.length||t<-1){u=0}else{if(t==-1||t>p.playlist.length){u=p.playlist.length-1}else{u=t}}if(u!=p.item){p.item=u;p.sendEvent(d.JWPLAYER_PLAYLIST_ITEM,{index:p.item})}};p.setVolume=function(t){if(p.mute&&t>0){p.setMute(f)}t=Math.round(t);if(!p.mute){a.saveCookie("volume",t)}l.volume(t)};p.setMute=function(t){if(!a.exists(t)){t=!p.mute}a.saveCookie("mute",t);l.mute(t)};p.componentConfig=function(t){return g[t]};q()}})(jwplayer.html5);(function(k){var e=k.html5,r=k.utils,n=r.css,s=r.transitionStyle,c="relative",d="absolute",g="hidden",j="100%",q="opacity .15s, visibility .15s, left .01s linear",l=".jwoverlay",a="jwcontents",p="top",f="bottom",h="right",m="left",t="#ffffff",u=undefined,b=document,o={fontcase:u,fontcolor:t,fontsize:12,fontweight:u,activecolor:t,overcolor:t};e.overlay=function(H,K,E){var B=K,x=H,C,Q,I=0,J,N,M=E,v=r.extend({},o,B.getComponentSettings("tooltip")),z={},L=this;function D(){C=O(l.replace(".",""));C.id=x;J=y("arrow","jwarrow")[1];N=J.height;n(A("jwarrow"),{position:d,bottom:M?u:0,top:M?0:u,width:J.width,height:N,left:"50%"});P(p,m);P(f,m);P(p,h);P(f,h);P(m);P(h);P(p);P(f);y("background","jwback");n(A("jwback"),{left:z.left,right:z.right,top:z.top,bottom:z.bottom});Q=O(a,C);n(A(a)+" *",{color:v.fontcolor,font:v.fontweight+" "+(v.fontsize)+"px Arial,Helvetica,sans-serif","text-transform":(v.fontcase=="upper")?"uppercase":u});if(M){r.transform(A("jwarrow"),"rotate(180deg)")}n(A(),{padding:(z.top+1)+"px "+z.right+"px "+(z.bottom+1)+"px "+z.left+"px"});L.showing=false}function A(R){return"#"+x+(R?" ."+R:"")}function O(S,R){var T=b.createElement("div");if(S){T.className=S}if(R){R.appendChild(T)}return T}function y(R,T){var S=G(R),U=O(T,C);n(A(T.replace(" ",".")),{"background-image":S.src});return[U,S]}function P(X,W){if(!W){W=""}var T=y("cap"+X+W,"jwborder jw"+X+(W?W:"")),R=T[0],U=T[1],S={"background-image":U.src,width:(X==m||W==m||X==h||W==h)?U.width:u,height:(X==p||W==p||X==f||W==f)?U.height:u};S[X]=((X==f&&!M)||(X==p&&M))?N:0;if(W){S[W]=0}n(A(R.className.replace(/ /g,".")),S);var V={},Z={},Y={left:U.width,right:U.width,top:(M?N:0)+U.height,bottom:(M?0:N)+U.height};if(W){V[W]=Y[W];V[X]=0;Z[X]=Y[X];Z[W]=0;n(A("jw"+X),V);n(A("jw"+W),Z);z[X]=Y[X];z[W]=Y[W]}}L.element=function(){return C};var F;L.setContents=function(R){r.empty(Q);Q.appendChild(R);clearTimeout(F);F=setTimeout(w,0)};L.offsetX=function(R){I=R;clearTimeout(F);w()};function w(){if(C.clientWidth==0){return}n(A(),{"margin-left":Math.round(I-C.clientWidth/2)});n(A("jwarrow"),{"margin-left":Math.round((J.width/-2)-I)})}L.borderWidth=function(){return z.left};function G(R){var S=B.getSkinElement("tooltip",R);if(S){return S}else{return{width:0,height:0,src:"",image:u,ready:false}}}L.show=function(){L.showing=true;C.style.opacity=1;C.style.visibility="visible"};L.hide=function(){L.showing=false;C.style.opacity=0;C.style.visibility=g};D()};n(l,{position:d,visibility:g,opacity:0});n(l+" .jwcontents",{position:c,"z-index":1});n(l+" .jwborder",{position:d,"background-size":j+" "+j},true);n(l+" .jwback",{position:d,"background-size":j+" "+j});s(l,q)})(jwplayer);(function(b){var a=jwplayer.utils;b.player=function(d){var n=this,l,h,j,c;function m(){l=new b.model(d);n.id=l.id;h=new b.view(n,l);j=new b.controller(l,h);n._model=l;jwplayer.utils.css.block();e();var o=new b.setup(l,h,j);o.addEventListener(jwplayer.events.JWPLAYER_READY,f);o.addEventListener(jwplayer.events.JWPLAYER_ERROR,k);o.start()}function f(o){j.playerReady(o);a.css.unblock()}function k(o){a.log("There was a problem setting up the player: ",o);a.css.unblock()}function e(){n.jwPlay=j.play;n.jwPause=j.pause;n.jwStop=j.stop;n.jwSeek=j.seek;n.jwSetVolume=j.setVolume;n.jwSetMute=j.setMute;n.jwLoad=j.load;n.jwPlaylistNext=j.next;n.jwPlaylistPrev=j.prev;n.jwPlaylistItem=j.item;n.jwSetFullscreen=j.setFullscreen;n.jwResize=h.resize;n.jwSeekDrag=l.seekDrag;n.jwSetStretching=j.setStretching;n.jwGetQualityLevels=j.getQualityLevels;n.jwGetCurrentQuality=j.getCurrentQuality;n.jwSetCurrentQuality=j.setCurrentQuality;n.jwGetCaptionsList=j.getCaptionsList;n.jwGetCurrentCaptions=j.getCurrentCaptions;n.jwSetCurrentCaptions=j.setCurrentCaptions;n.jwSetControls=h.setControls;n.jwGetSafeRegion=h.getSafeRegion;n.jwGetPlaylistIndex=g("item");n.jwGetPosition=g("position");n.jwGetDuration=g("duration");n.jwGetBuffer=g("buffer");n.jwGetWidth=g("width");n.jwGetHeight=g("height");n.jwGetFullscreen=g("fullscreen");n.jwGetVolume=g("volume");n.jwGetMute=g("mute");n.jwGetState=g("state");n.jwGetStretching=g("stretching");n.jwGetPlaylist=g("playlist");n.jwGetControls=g("controls");n.jwDetachMedia=j.detachMedia;n.jwAttachMedia=j.attachMedia;n.jwLoadInstream=function(p,o){if(!c){c=new b.instream(n,l,h,j)}setTimeout(function(){c.load(p,o)},10)};n.jwInstreamDestroy=function(){if(c){c.jwInstreamDestroy()}};n.jwPlayerDestroy=function(){if(h){h.destroy()}};n.jwAddEventListener=j.addEventListener;n.jwRemoveEventListener=j.removeEventListener;n.jwDockAddButton=h.addButton;n.jwDockRemoveButton=h.removeButton}function g(o){return function(){return l[o]}}m()}})(jwplayer.html5);(function(g){var b="#FFFFFF",d="#CCCCCC",l="#333333",h="#999999",k="normal",f={size:180,backgroundcolor:l,fontcolor:h,overcolor:d,activecolor:d,titlecolor:d,titleovercolor:b,titleactivecolor:b,fontweight:k,titleweight:k,fontsize:11,titlesize:13},q=jwplayer.events,o=jwplayer.utils,m=o.css,p=".jwplaylist",n=document,a="absolute",c="relative",e="hidden",j="100%";g.playlistcomponent=function(I,T){var N=I,B=N.skin,s=o.extend({},f,N.skin.getComponentSettings("playlist"),T),O,C,r,w,u,A=-1,D,t,v=60,x={background:undefined,divider:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.element=function(){return O};this.redraw=function(){if(t){t.redraw()}};this.show=function(){_show(O)};this.hide=function(){_hide(O)};function y(){O=R("div","jwplaylist");O.id=N.id+"_jwplayer_playlistcomponent";C=R("div","jwlistcontainer");S(O,C);Q();if(x.item){v=x.item.height}G();N.jwAddEventListener(q.JWPLAYER_PLAYLIST_LOADED,J);N.jwAddEventListener(q.JWPLAYER_PLAYLIST_ITEM,L)}function z(U){return"#"+O.id+(U?" ."+U:"")}function G(){var X=0,W=0,U=0;o.clearCss(z());m(z(),{"background-color":s.backgroundcolor});m(z("jwlist"),{"background-image":x.background?" url("+x.background.src+")":""});m(z("jwlist *"),{color:s.fontcolor,font:s.fontweight+" "+s.fontsize+"px Arial, Helvetica, sans-serif"});if(x.itemImage){X=(v-x.itemImage.height)/2+"px ";W=x.itemImage.width;U=x.itemImage.height}else{W=v*4/3;U=v}if(x.divider){m(z("jwplaylistdivider"),{"background-image":"url("+x.divider.src+")","background-size":j+" "+x.divider.height+"px",width:j,height:x.divider.height})}m(z("jwplaylistimg"),{height:U,width:W,margin:X?(X+X+X+X):"0 5px 0 0"});m(z("jwlist li"),{"background-image":x.item?"url("+x.item.src+")":"",height:v,"background-size":j+" "+v+"px",cursor:"pointer"});var V={overflow:"hidden"};if(s.activecolor!==""){V.color=s.activecolor}if(x.itemActive){V["background-image"]="url("+x.itemActive.src+")"}m(z("jwlist li.active"),V);m(z("jwlist li.active .jwtitle"),{color:s.titleactivecolor});var Y={overflow:"hidden"};if(s.overcolor!==""){Y.color=s.overcolor}if(x.itemOver){Y["background-image"]="url("+x.itemOver.src+")"}m(z("jwlist li:hover"),Y);m(z("jwlist li:hover .jwtitle"),{color:s.titleovercolor});m(z("jwtextwrapper"),{height:v-5,position:c});m(z("jwtitle"),{height:15,overflow:"hidden",display:"inline-block",width:j,color:s.titlecolor,"margin-top":X?X:7,"line-height":13,"font-size":s.titlesize,"font-weight":s.titleweight});m(z("jwdescription"),{display:"block","font-size":s.fontsize,"line-height":19,"margin-top":5,overflow:"hidden",height:v,position:c})}function F(){var U=R("ul","jwlist");U.id=O.id+"_ul"+Math.round(Math.random()*10000000);return U}function H(X){var ac=r[X],ab=R("li","jwitem"),V;ab.id=u.id+"_item_"+X;if(X>0){V=R("div","jwplaylistdivider");S(ab,V)}var Y=R("div","jwplaylistimg jwfill");if(M()&&(ac.image||ac["playlist.image"]||x.itemImage)){var Z;if(ac["playlist.image"]){Z=ac["playlist.image"]}else{if(ac.image){Z=ac.image}else{if(x.itemImage){Z=x.itemImage.src}}}m("#"+ab.id+" .jwplaylistimg",{"background-image":Z?"url("+Z+")":null});S(ab,Y)}var U=R("div","jwtextwrapper");var aa=R("span","jwtitle");aa.innerHTML=(ac&&ac.title)?ac.title:"";S(U,aa);if(ac.description){var W=R("span","jwdescription");W.innerHTML=ac.description;S(U,W)}S(ab,U);return ab}function R(V,U){var W=n.createElement(V);if(U){W.className=U}return W}function S(U,V){U.appendChild(V)}function J(V){C.innerHTML="";r=K();if(!r){return}items=[];u=F();for(var W=0;W<r.length;W++){var U=H(W);U.onclick=P(W);S(u,U);items.push(U)}A=N.jwGetPlaylistIndex();if(o.isIOS()&&window.iScroll){O.innerHTML="";S(O,u);u.style.height=v*r.length+"px";var X=new iScroll(O.id)}else{S(C,u);t=new g.playlistslider(O.id+"_slider",N.skin,O,u)}}function K(){var V=N.jwGetPlaylist();var W=[];for(var U=0;U<V.length;U++){if(!V[U]["ova.hidden"]){W.push(V[U])}}return W}function P(U){return function(){D=U;N.jwPlaylistItem(U);N.jwPlay(true)}}function E(){var U=N.jwGetPlaylistIndex();if(U==D){return}D=-1;if(o.isIOS()&&window.iScroll){u.scrollTop=U*v}else{if(t&&t.visible()){t.thumbPosition(U/(N.jwGetPlaylist().length-1))}}}function M(){return true}function L(U){if(A>=0){n.getElementById(u.id+"_item_"+A).className="jwitem";A=U.index}n.getElementById(u.id+"_item_"+U.index).className="jwitem active";E()}function Q(){for(var U in x){x[U]=B.getSkinElement("playlist",U)}}y();return this};m(p,{position:a,width:j,height:j});o.dragStyle(p,"none");m(p+" .jwplaylistimg",{position:c,width:j,"float":"left",margin:"0 5px 0 0",background:"#000",overflow:e});m(p+" .jwlist",{position:a,width:j,"list-style":"none",margin:0,padding:0});m(p+" .jwlistcontainer",{position:a,overflow:e,width:j,height:j});m(p+" .jwlist li",{width:j});m(p+" .jwtextwrapper",{overflow:e});m(p+" .jwplaylistdivider",{position:a})})(jwplayer.html5);(function(b){var d=jwplayer,a=d.utils,c=d.events;b.playlistloader=function(){var g=new c.eventdispatcher();a.extend(this,g);this.load=function(k){a.ajax(k,h,f)};function h(k){try{var n=k.responseXML.firstChild;if(b.parsers.localName(n)=="xml"){n=n.nextSibling}if(b.parsers.localName(n)!="rss"){e("Not a valid RSS feed");return}var m=new d.playlist(b.parsers.rssparser.parse(n));m=j(m);if(m&&m.length&&m[0].sources&&m[0].sources.length&&m[0].sources[0].file){g.sendEvent(c.JWPLAYER_PLAYLIST_LOADED,{playlist:m})}else{e("No playable sources found")}}catch(l){e()}}function j(o){if(!o){return}var m=[],l,n,k;for(l=0;l<o.length;l++){n=o[l];k=a.filterSources(n.sources);if(k&&k.length){n.sources=k;m.push(n)}}return m}function f(k){e(k.match(/invalid/i)?"Not a valid RSS feed":"")}function e(k){g.sendEvent(c.JWPLAYER_ERROR,{message:k?k:"Error loading file"})}}})(jwplayer.html5);(function(k){var a=jwplayer.events,r=jwplayer.utils,n=r.css,b="jwslider",p="jwslidertop",h="jwsliderbottom",f="jwrail",q="jwrailtop",o="jwrailback",m="jwrailbottom",c="jwthumb",u="jwthumbtop",j="jwthumbback",t="jwthumbbottom",e=document,s=window,v=undefined,g="absolute",l="100%";k.playlistslider=function(T,K,H,X){var M=K,V=T,Y=X,af,C,ac,Q,ag=0,U,ad,ai=true,D,P,ab,y,aa,w,E,O,S,ae,J;this.element=function(){return af};this.visible=function(){return ai};function G(){var ak,aj;af=ah(b,null,H);af.id=T;af.addEventListener("mousedown",B,false);af.addEventListener("click",Z,false);N();S=D.height;ae=P.height;n(W(),{width:ab.width});n(W(f),{top:S,bottom:ae});n(W(c),{top:S});ak=ah(p,D,af);aj=ah(h,P,af);C=ah(f,null,af);ac=ah(c,null,af);ak.addEventListener("mousedown",x(-1),false);aj.addEventListener("mousedown",x(1),false);ah(q,y,C);ah(o,ab,C,true);ah(m,aa,C);n(W(o),{top:y.height,bottom:aa.height});ah(u,E,ac);ah(j,w,ac,true);ah(t,O,ac);n(W(j),{top:E.height,bottom:O.height});I();if(Y){Y.addEventListener("mousewheel",A,false);Y.addEventListener("DOMMouseScroll",A,false)}}function W(aj){return"#"+af.id+(aj?" ."+aj:"")}function ah(am,al,ak,aj){var an=e.createElement("div");if(am){an.className=am;if(al){n(W(am),{"background-image":al.src?al.src:v,"background-repeat":aj?"repeat-y":"no-repeat",height:aj?v:al.height})}}if(ak){ak.appendChild(an)}return an}function N(){D=F("sliderCapTop");P=F("sliderCapBottom");ab=F("sliderRail");y=F("sliderRailCapTop");aa=F("sliderRailCapBottom");w=F("sliderThumb");E=F("sliderThumbCapTop");O=F("sliderThumbCapBottom")}function F(aj){var ak=M.getSkinElement("playlist",aj);return ak?ak:{width:0,height:0,src:v}}var I=this.redraw=function(){clearTimeout(J);J=setTimeout(function(){if(Y&&Y.clientHeight){R(Y.parentNode.clientHeight/Y.clientHeight)}else{J=setTimeout(I,10)}},0)};function A(aj){if(!ai){return}aj=aj?aj:s.event;var ak=aj.detail?aj.detail*-1:aj.wheelDelta/40;L(ag-ak/10);if(aj.stopPropagation){aj.stopPropagation()}if(aj.preventDefault){aj.preventDefault()}aj.cancelBubble=true;aj.cancel=true;aj.returnValue=false;return false}function R(aj){if(aj<0){aj=0}if(aj>1){ai=false}else{ai=true;n(W(c),{height:Math.max(C.clientHeight*aj,E.height+O.height)})}n(W(),{visibility:ai?"visible":"hidden"});if(Y){Y.style.width=ai?Y.parentElement.clientWidth-ab.width+"px":""}}var L=this.thumbPosition=function(aj){if(isNaN(aj)){aj=0}ag=Math.max(0,Math.min(1,aj));n(W(c),{top:S+(C.clientHeight-ac.clientHeight)*ag});if(X){X.style.top=(af.clientHeight-X.scrollHeight)*ag+"px"}};function B(aj){if(aj.button==0){Q=true}e.onselectstart=function(){return false};s.addEventListener("mousemove",Z,false);s.addEventListener("mouseup",z,false)}function Z(aj){if(Q||aj.type=="click"){var ao=r.bounds(C),al=ac.clientHeight/2,ak=ao.height-al,an=aj.pageY-ao.top,am=(an-al)/(ak-al);L(am)}}function x(aj){return function(ak){if(ak.button>0){return}L(ag+(aj*0.05));U=setTimeout(function(){ad=setInterval(function(){L(ag+(aj*0.05))},50)},500)}}function z(){Q=false;s.removeEventListener("mousemove",Z);s.removeEventListener("mouseup",z);e.onselectstart=v;clearTimeout(U);clearInterval(ad)}G();return this};function d(){var w=[],x;for(x=0;x<arguments.length;x++){w.push(".jwplaylist ."+arguments[x])}return w.join(",")}n(d(b),{position:g,height:l,visibility:"hidden",right:0,top:0,cursor:"pointer","z-index":1});n(d(b)+" *",{position:g,width:l,"background-position":"center","background-size":l+" "+l});n(d(p,q,u),{top:0});n(d(h,m,t),{bottom:0})})(jwplayer.html5);(function(e){var l=jwplayer.utils,j=l.css,a="About JW Player ",m="http://www.longtailvideo.com/jwpabout/?a=r&v=",k=document,h=".jwclick",g=h+"_item",f="100%",b="none",d="5px 5px 7px rgba(0,0,0,.10), 0px 1px 0px rgba(255,255,255,.3) inset",c="#FFF";e.rightclick=function(r,p){var x=r,q,w=l.extend({aboutlink:m+e.version+"&m=h&e=o",abouttext:a+e.version+"..."},p),n=false,y,s;function v(){q=k.getElementById(x.id);y=t(h);y.id=x.id+"_menu";y.style.display=b;q.oncontextmenu=o;y.onmouseover=function(){n=true};y.onmouseout=function(){n=false};k.addEventListener("mousedown",z,false);s=t(g);s.innerHTML=w.abouttext;s.onclick=u;y.appendChild(s);q.appendChild(y)}function t(A){var B=k.createElement("div");B.className=A.replace(".","");return B}function u(){window.location.href=w.aboutlink}function o(A){if(n){return}if(A==null){A=window.event}var D=A.target!=null?A.target:A.srcElement,B=l.bounds(q),C=B.top,E=B.left;y.style.display=b;y.style.left=A.pageX-E+"px";y.style.top=A.pageY-C+"px";y.style.display="block";A.preventDefault()}function z(){if(n){return}else{y.style.display=b}}this.element=function(){return y};this.destroy=function(){k.removeEventListener("mousedown",z,false)};v()};j(h,{"background-color":c,"-webkit-border-radius":5,"-moz-border-radius":5,"border-radius":5,height:"auto",border:"1px solid #bcbcbc","font-family":'"MS Sans Serif", "Geneva", sans-serif',"font-size":10,width:320,"-webkit-box-shadow":d,"-moz-box-shadow":d,"box-shadow":d,position:"absolute","z-index":999},true);j(h+" div",{padding:"8px 21px",margin:"0px","background-color":c,border:"none","font-family":'"MS Sans Serif", "Geneva", sans-serif',"font-size":10,color:"inherit"},true);j(g,{padding:"8px 21px","text-align":"left",cursor:"pointer"},true);j(g+":hover",{"background-color":"#595959",color:c},true);j(g+" a",{"text-decoration":b,color:"#000"},true);j(h+" hr",{width:f,padding:0,margin:0,border:"1px #e9e9e9 solid"},true)})(jwplayer.html5);(function(f){var h=jwplayer,l=h.utils,m=h.events,a=h.playlist,j=1,e=2,d=3,k=4,c=5,b=6,g=7;f.setup=function(t,I,J){var M=t,q=I,G=J,v={},D={},B,A=new m.eventdispatcher(),w=false,x=[];function u(){s(j,p);s(e,R,j);s(d,z,j);s(k,L,d);s(c,Q,k+","+e);s(b,K,c+","+d);s(g,E,b)}function s(S,U,T){x.push({name:S,method:U,depends:T})}function H(){for(var U=0;U<x.length;U++){var S=x[U];if(P(S.depends)){x.splice(U,1);try{S.method();H()}catch(T){y(T.message)}return}}if(x.length>0&&!w){setTimeout(H,500)}}function P(U){if(!U){return true}var T=U.toString().split(",");for(var S=0;S<T.length;S++){if(!v[T[S]]){return false}}return true}function o(S){v[S]=true}function p(){o(j)}function R(){B=new f.skin();B.load(M.config.skin,C,O)}function C(S){o(e)}function O(S){y("Error loading skin: "+S)}function z(){switch(l.typeOf(M.config.playlist)){case"string":var S=new f.playlistloader();S.addEventListener(m.JWPLAYER_PLAYLIST_LOADED,n);S.addEventListener(m.JWPLAYER_ERROR,F);S.load(M.config.playlist);break;case"array":r(new a(M.config.playlist))}}function n(S){r(S.playlist)}function r(S){M.setPlaylist(S);if(M.playlist[0].sources.length==0){y("Error loading playlist: No playable sources found")}else{o(d)}}function F(S){y("Error loading playlist: "+S.message)}function L(){var T=M.playlist[M.item].image;if(T){var S=new Image();S.addEventListener("load",N,false);S.addEventListener("error",N,false);S.src=T;setTimeout(N,500)}else{o(k)}}function N(){o(k)}function Q(){q.setup(B);o(c)}function K(){o(b)}function E(){A.sendEvent(m.JWPLAYER_READY);o(g)}function y(S){w=true;A.sendEvent(m.JWPLAYER_ERROR,{message:S});q.setupError(S)}l.extend(this,A);this.start=H;u()}})(jwplayer.html5);(function(a){a.skin=function(){var b={};var d=false;this.load=function(g,f,e){new a.skinloader(g,function(h){d=true;b=h;if(typeof f=="function"){f()}},function(h){if(typeof e=="function"){e(h)}})};this.getSkinElement=function(e,f){e=c(e);f=c(f);if(d){try{return b[e].elements[f]}catch(g){jwplayer.utils.log("No such skin component / element: ",[e,f])}}return null};this.getComponentSettings=function(e){e=c(e);if(d&&b&&b[e]){return b[e].settings}return null};this.getComponentLayout=function(e){e=c(e);if(d){var f=b[e].layout;if(f&&(f.left||f.right||f.center)){return b[e].layout}}return null};function c(e){return e.toLowerCase()}}})(jwplayer.html5);(function(b){var a=jwplayer.utils,c="Skin formatting error";b.skinloader=function(f,l,h){var j={},n=l,v=h,s=true,w,x=f,g=false,u;function z(){if(typeof x!="string"||x===""){y(b.defaultskin().xml)}else{if(a.extension(x)!="xml"){v("Skin not a valid file type");return}var A=new b.skinloader("",o,v)}}function o(A){j=A;a.ajax(a.getAbsolutePath(x),function(B){try{if(a.exists(B.responseXML)){y(B.responseXML);return}}catch(C){v(c)}},function(B){v(B)})}function m(A,B){return A?A.getElementsByTagName(B):null}function y(F){var E=m(F,"skin")[0],M=m(E,"component"),Y=E.getAttribute("target");if(!Y||parseFloat(Y)>parseFloat(jwplayer.version)){v("Incompatible player version")}if(M.length===0){n(j);return}for(var P=0;P<M.length;P++){var K=k(M[P].getAttribute("name")),J={settings:{},elements:{},layout:{}},O=m(m(M[P],"elements")[0],"element");j[K]=J;for(var N=0;N<O.length;N++){q(O[N],K)}var G=m(M[P],"settings")[0];if(G&&G.childNodes.length>0){var S=m(G,"setting");for(var X=0;X<S.length;X++){var Z=S[X].getAttribute("name");var Q=S[X].getAttribute("value");if(/color$/.test(Z)){Q=a.stringToColor(Q)}J.settings[k(Z)]=Q}}var T=m(M[P],"layout")[0];if(T&&T.childNodes.length>0){var U=m(T,"group");for(var D=0;D<U.length;D++){var I=U[D],H={elements:[]};J.layout[k(I.getAttribute("position"))]=H;for(var W=0;W<I.attributes.length;W++){var L=I.attributes[W];H[L.name]=L.value}var V=m(I,"*");for(var C=0;C<V.length;C++){var A=V[C];H.elements.push({type:A.tagName});for(var B=0;B<A.attributes.length;B++){var R=A.attributes[B];H.elements[C][k(R.name)]=R.value}if(!a.exists(H.elements[C].name)){H.elements[C].name=A.tagName}}}}s=false;p()}}function p(){clearInterval(w);if(!g){w=setInterval(function(){e()},100)}}function q(F,E){E=k(E);var D=new Image(),A=k(F.getAttribute("name")),C=F.getAttribute("src"),H;if(C.indexOf("data:image/png;base64,")===0){H=C}else{var B=a.getAbsolutePath(x);var G=B.substr(0,B.lastIndexOf("/"));H=[G,E,C].join("/")}j[E].elements[A]={height:0,width:0,src:"",ready:false,image:D};D.onload=function(I){r(D,A,E)};D.onerror=function(I){g=true;p();v("Skin image not found: "+this.src)};D.src=H}function d(){for(var B in j){var D=j[B];for(var A in D.elements){var E=D.elements[A];var C=E.image;C.onload=null;C.onerror=null;delete E.image;delete D.elements[A]}delete j[B]}}function e(){for(var A in j){if(A!="properties"){for(var B in j[A].elements){if(!t(A,B).ready){return}}}}if(s==false){clearInterval(w);n(j)}}function r(B,D,C){var A=t(C,D);if(A){A.height=B.height;A.width=B.width;A.src=B.src;A.ready=true;p()}else{a.log("Loaded an image for a missing element: "+C+"."+D)}}function t(A,B){return j[k(A)]?j[k(A)].elements[k(B)]:null}function k(A){return A?A.toLowerCase():""}z()}})(jwplayer.html5);(function(c){var a=c.utils,d=c.events,b=d.state;c.html5.video=function(X){var R={abort:A,canplay:r,canplaythrough:A,durationchange:D,emptied:A,ended:m,error:n,loadeddata:A,loadedmetadata:r,loadstart:A,pause:W,play:W,playing:W,progress:E,ratechange:A,readystatechange:A,seeked:I,seeking:A,stalled:A,suspend:A,timeupdate:Y,volumechange:k,waiting:v},y=a.extensionmap,G,M,ae,w,ad,p,U,ac,L,S,H,e=b.IDLE,N,o=-1,K=-1,O=new d.eventdispatcher(),t=false,J,F=-1,g=this;a.extend(g,O);function Z(af){w=af;T();w.controls=true;w.controls=false;t=true}function T(){for(var af in R){w.addEventListener(af,R[af],false)}}function s(af,ag){if(t){O.sendEvent(af,ag)}}function A(af){}function D(ag){if(!t){return}var af=ab(w.duration);if(ad!=af){ad=af}Y()}function Y(af){if(!t){return}if(e==b.PLAYING&&!H){p=ab(w.currentTime);s(d.JWPLAYER_MEDIA_TIME,{position:p,duration:ad});if(p>=ad&&ad>3&&!a.isAndroid(2.3)){V()}}}function ab(af){return Number(af.toFixed(1))}function r(af){A(af);if(!t){return}if(!ac){ac=true;q()}}function E(af){if(ac&&S>0){setTimeout(function(){B(S)},200)}}function q(){if(!L){L=true;s(d.JWPLAYER_MEDIA_BUFFER_FULL)}}function W(af){if(!t||H){return}if(w.paused){if(w.currentTime==w.duration&&w.duration>3){V()}else{f()}}else{x(b.PLAYING)}}function v(af){if(!t){return}x(b.BUFFERING)}function n(af){if(!t){return}a.log("Error playing media: %o",w.error);O.sendEvent(d.JWPLAYER_MEDIA_ERROR,{message:"Error loading media: File could not be played"});x(b.IDLE)}function l(ai){var af;if(a.typeOf(ai)=="array"&&ai.length>0){af=[];for(var ah=0;ah<ai.length;ah++){var aj=ai[ah],ag={};ag.label=Q(aj)?Q(aj):ah;if(aj.width){ag.width=aj.width}if(aj.height){ag.height=aj.height}if(aj.bitrate){ag.bitrate=aj.bitrate}af[ah]=ag}}return af}function j(ag){var af=l(ag);if(af){O.sendEvent(d.JWPLAYER_MEDIA_LEVELS,{levels:af,currentQuality:F})}}function Q(af){if(af.label){return af.label}else{if(af.height){return af.height+"p"}else{if(af.width){return Math.round(af.width*9/16)+"p"}else{if(af.bitrate){return af.bitrate+"kbps"}else{return 0}}}}}g.load=function(af){if(!t){return}G=af;S=0;ad=af.duration?af.duration:-1;p=0;J=G.sources;C();j(J);u()};function C(){if(F<0){F=0}var ah=J.slice(0).sort(function(ak,aj){return Number(aj.width)-Number(ak.width)}),ag=a.bounds(w),af,ai;for(af=0;af<ah.length;af++){ai=ah[af];if(ai.width&&ai.width<=ag.width){F=J.indexOf(ai);break}}}function u(){ac=false;L=false;M=J[F];x(b.BUFFERING);w.src=M.file;w.load();o=setInterval(h,100);if(a.isIPod()||a.isAndroid(2.3)){q()}}var z=g.stop=function(){if(!t){return}w.removeAttribute("src");if(!a.isIE()){w.load()}F=-1;clearInterval(o);x(b.IDLE)};g.play=function(){if(t&&!H){w.play()}};var f=g.pause=function(){if(t){w.pause();x(b.PAUSED)}};g.seekDrag=function(af){if(!t){return}H=af;if(af){w.pause()}else{w.play()}};var B=g.seek=function(af){if(!t){return}if(ac){S=0;w.currentTime=af}else{S=af}};function I(){if(!H){s(d.JWPLAYER_MEDIA_SEEK,{position:p,offset:w.currentTime})}}var aa=g.volume=function(af){w.volume=Math.min(Math.max(0,af/100),1)};function k(af){s(d.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(w.volume*100)});s(d.JWPLAYER_MEDIA_MUTE,{mute:w.muted})}g.mute=function(af){if(!a.exists(af)){af=!w.mute}if(af){if(!w.muted){N=w.volume*100;w.muted=true;aa(0)}}else{if(w.muted){aa(N);w.muted=false}}};function x(af){if(af==b.PAUSED&&e==b.IDLE){return}if(H){return}if(e!=af){var ag=e;e=af;s(d.JWPLAYER_PLAYER_STATE,{oldstate:ag,newstate:af})}}function h(){if(!t){return}var af=P();if(af!=K){K=af;s(d.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(K*100)})}if(af>=1){clearInterval(o)}}function P(){if(w.buffered.length==0||w.duration==0){return 0}else{return w.buffered.end(w.buffered.length-1)/w.duration}}function m(){if(a.isAndroid(2.3)){V()}}function V(){if(e!=b.IDLE){F=-1;x(b.IDLE);s(d.JWPLAYER_MEDIA_BEFORECOMPLETE);s(d.JWPLAYER_MEDIA_COMPLETE)}}g.detachMedia=function(){t=false;return w};g.attachMedia=function(){t=true};g.getTag=function(){return w};g.audioMode=function(){if(!J){return false}var af=J[0].type;return(af=="aac"||af=="mp3"||af=="vorbis")};g.setCurrentQuality=function(ag){if(F==ag){return}ag=parseInt(ag);if(ag>=0){if(J&&J.length>ag){F=ag;s(d.JWPLAYER_MEDIA_LEVEL_CHANGED,{currentQuality:ag,levels:l(J)});var af=w.currentTime;u();g.seek(af)}}};g.getCurrentQuality=function(){return F};g.getQualityLevels=function(){return l(J)};Z(X)}})(jwplayer);(function(l){var p=jwplayer,x=p.utils,a=jwplayer.events,f=a.state,r=x.css,t=x.bounds,w=x.isMobile(),d=x.isIPad(),A=x.isIPod(),h=x.isAndroid(),g=document,o="jwplayer",b="."+o+".jwfullscreen",q="jwmain",z="jwinstream",y="jwvideo",c="jwcontrols",e="jwplaylistcontainer",k=true,s=false,v="opacity .5s ease",n="100%",j="absolute",u=" !important",m="hidden";l.view=function(M,H){var L=M,J=H,am,Y,W,at,D=0,aF=2000,F,aO,R,aE,aP,aA,ap,aw=x.extend({},J.componentConfig("logo")),an,aJ,T,ag=(J.mobilecontrols),aG=s,ah,P,au,aB,aC=s,ax=new a.eventdispatcher();x.extend(this,ax);function aL(){am=aI("div",o);am.id=L.id;ai(J.width,J.height);var aS=document.getElementById(L.id);aS.parentNode.replaceChild(am,aS)}this.getCurrentCaptions=function(){return an.getCurrentCaptions()};this.setCurrentCaptions=function(aS){an.setCurrentCaptions(aS)};this.getCaptionsList=function(){return an.getCaptionsList()};this.setup=function(aT){if(aG){return}L.skin=aT;Y=aI("span",q);aO=aI("span",y);F=J.getVideo().getTag();aO.appendChild(F);W=aI("span",c);R=aI("span",z);at=aI("span",e);C();Y.appendChild(aO);Y.appendChild(W);Y.appendChild(R);var aS=aI("div");aS.style.position="absolute";aS.style.width="100%";aS.style.height="100%";aS.appendChild(Y);aS.appendChild(at);am.appendChild(aS);g.addEventListener("webkitfullscreenchange",aK,s);F.addEventListener("webkitbeginfullscreen",aK,s);F.addEventListener("webkitendfullscreen",aK,s);g.addEventListener("mozfullscreenchange",aK,s);g.addEventListener("keydown",ay,s);L.jwAddEventListener(a.JWPLAYER_PLAYER_READY,aH);L.jwAddEventListener(a.JWPLAYER_PLAYER_STATE,O);L.jwAddEventListener(a.JWPLAYER_PLAYLIST_COMPLETE,aD);O({newstate:f.IDLE});W.addEventListener("mouseout",av,s);W.addEventListener("mousemove",aQ,s);if(x.isIE()){aO.addEventListener("mousemove",aQ,s);aO.addEventListener("click",aP.clickHandler)}N(aE);N(aA);N(ap)};function N(aS){if(aS){aS.element().addEventListener("mousemove",ak,s);aS.element().addEventListener("mouseout",aN,s)}}function aI(aT,aS){var aU=g.createElement(aT);if(aS){aU.className=aS}return aU}function aQ(){clearTimeout(D);if(L.jwGetState()==f.PLAYING||L.jwGetState()==f.PAUSED){az();if(!aC){D=setTimeout(av,aF)}}}function ak(){clearTimeout(D);aC=k}function aN(){aC=s}function av(){if(L.jwGetState()!=f.BUFFERING){Q();ac();aa()}clearTimeout(D);D=0}function ao(aS){ax.sendEvent(aS.type,aS)}function C(){var aU=J.width,aS=J.height,aV=J.componentConfig("controlbar"),aT=J.componentConfig("display");G(aS);an=new l.captions(L,J.captions);an.addEventListener(a.JWPLAYER_CAPTIONS_LIST,ao);an.addEventListener(a.JWPLAYER_CAPTIONS_CHANGED,ao);W.appendChild(an.element());aP=new l.display(L,aT);aP.addEventListener(a.JWPLAYER_DISPLAY_CLICK,ao);if(T){aP.hidePreview(k)}W.appendChild(aP.element());ap=new l.logo(L,aw);W.appendChild(ap.element());aA=new l.dock(L,J.componentConfig("dock"));W.appendChild(aA.element());if(L.edition){au=new l.rightclick(L,{abouttext:J.abouttext,aboutlink:J.aboutlink})}else{au=new l.rightclick(L,{})}if(J.playlistsize&&J.playlistposition&&J.playlistposition!="none"){aJ=new l.playlistcomponent(L,{});at.appendChild(aJ.element())}if(!w||ag){aE=new l.controlbar(L,aV);W.appendChild(aE.element());if(ag){az()}}setTimeout(function(){ai(J.width,J.height)},0)}var ad=this.fullscreen=function(aS){if(!x.exists(aS)){aS=!J.fullscreen}if(aS){if(!J.fullscreen){if(!d){aj(k)}if(am.requestFullScreen){am.requestFullScreen()}else{if(am.mozRequestFullScreen){am.mozRequestFullScreen()}else{if(am.webkitRequestFullScreen){am.webkitRequestFullScreen()}}}J.setFullscreen(k)}}else{if(!d){aj(s)}if(J.fullscreen){J.setFullscreen(s);if(g.cancelFullScreen){g.cancelFullScreen()}else{if(g.mozCancelFullScreen){g.mozCancelFullScreen()}else{if(g.webkitCancelFullScreen){g.webkitCancelFullScreen()}else{if(F.webkitExitFullScreen){F.webkitExitFullScreen()}}}}}if(d&&L.jwGetState()==f.PAUSED){setTimeout(E,500)}}af(aE);af(aP);af(aA);K();if(J.fullscreen){aB=setInterval(K,200)}else{clearInterval(aB)}setTimeout(function(){var aT=x.bounds(Y);J.width=aT.width;J.height=aT.height;ax.sendEvent(a.JWPLAYER_RESIZE)},0)};function af(aS){if(aS){aS.redraw()}}function ai(aU,aS){if(x.exists(aU)&&x.exists(aS)){J.width=aU;J.height=aS}am.style.width=isNaN(aU)?aU:aU+"px";am.style.height=isNaN(aS)?aS:aS+"px";if(aP){aP.redraw()}if(aE){aE.redraw()}if(ap){setTimeout(function(){ap.offset(aE&&ap.position().indexOf("bottom")>=0?aE.element().clientHeight+aE.margin():0);if(aA){aA.offset(ap.position()=="top-left"?ap.element().clientWidth+ap.margin():0)}},500)}var aW=J.playlistsize,aX=J.playlistposition;if(aJ&&aW&&(aX=="right"||aX=="bottom")){aJ.redraw();var aT={display:"block"},aV={};aT[aX]=0;aV[aX]=aW;if(aX=="right"){aT.width=aW}else{aT.height=aW}r(ar(e),aT);r(ar(q),aV)}G(aS);K();ax.sendEvent(a.JWPLAYER_RESIZE);return}function G(aS){T=((!w||ag)&&aS<=40&&aS.toString().indexOf("%")<0);if(aE){if(T){aE.audioMode(k);az();aP.hidePreview(k);U();Z(s)}else{aE.audioMode(s);aM(L.jwGetState())}}if(ap&&T){aa()}am.style.backgroundColor=T?"transparent":"#000"}function K(){if(F){x.stretch(J.stretching,F,aO.clientWidth,aO.clientHeight,F.videoWidth,F.videoHeight)}}this.resize=ai;this.resizeMedia=K;var al=this.completeSetup=function(){r(ar(),{opacity:1})};function ay(aS){if(J.fullscreen){switch(aS.keyCode){case 27:ad(s);break}}}function aj(aS){if(aS){am.className+=" jwfullscreen";(g.getElementsByTagName("body")[0]).style["overflow-y"]="hidden"}else{am.className=am.className.replace(/\s+jwfullscreen/,"");(g.getElementsByTagName("body")[0]).style["overflow-y"]=""}}function aR(){var aS=[g.mozFullScreenElement,g.webkitCurrentFullScreenElement,F.webkitDisplayingFullscreen];for(var aT=0;aT<aS.length;aT++){if(aS[aT]&&(!aS[aT].id||aS[aT].id==L.id)){return k}}return s}function aK(aS){var aT=aR();if(J.fullscreen!=aT){ad(aT)}}function V(){if(aE){aE.show()}}function Q(){if(aE&&!T&&!ag){aE.hide()}}function I(){if(aA&&!T&&(!w||ah)){aA.show()}}function ac(){if(aA&&!(ah||ag)){aA.hide()}}function B(){if(ap&&!T){ap.show()}}function aa(){if(ap&&(!ag||T)){ap.hide(T)}}function E(){if(aP&&J.controls&&!T){if(!A||L.jwGetState()==f.IDLE){aP.show()}}if(w&&!ag){if(h){W.style.display="block"}if(!(w&&J.fullscreen)){F.controls=false}}}function U(){if(aP){if(w&&!ag){if(h){W.style.display="none"}F.controls=true}aP.hide()}}function S(){Q();ac();aa()}function az(){if(J.controls||T){V();I()}B()}function X(aT,aS){if(aS.right<aT.left||aS.left>aT.right){return aT}if(aS.bottom<aT.top||aS.top>aT.bottom){return aT}var aU=(aS.y>aS.height/2),aV={x:aT.x,y:aU?aT.y:aS.bottom,width:aT.width}}function Z(aS){aS=aS&&!T;r(ar(y),{visibility:aS?"visible":"hidden",opacity:aS?1:0})}function aD(){ah=k;ad(false);if(J.controls){I()}}function aH(aS){P=k}var ab;function O(aS){ah=s;clearTimeout(ab);ab=setTimeout(function(){aM(aS.newstate)},100)}function aM(aS){switch(aS){case f.PLAYING:if(!J.getVideo().audioMode()||w){Z(k);K();aP.hidePreview(k);if(w){if(!(d&&ag)){U()}}}else{Z(s);aP.hidePreview(T)}aQ();break;case f.IDLE:if(!h){Z(s)}av();if(!T){aP.hidePreview(s);E();if(!aw.hide){B()}}break;case f.BUFFERING:E();if(w){Z(k)}else{az()}break;case f.PAUSED:E();if(!w||ag){az()}break}}function ar(aS){return"#"+L.id+(aS?" ."+aS:"")}this.setupInstream=function(aS,aT){aq(ar(z),k);aq(ar(c),s);R.appendChild(aS);_instreamVideo=aT;O({newstate:f.PLAYING});_instreamMode=k};var ae=this.destroyInstream=function(){aq(ar(z),s);aq(ar(c),k);R.innerHTML="";_instreamVideo=null;_instreamMode=s;ai(J.width,J.height)};this.setupError=function(aS){aG=true;jwplayer.embed.errorScreen(am,aS);al()};function aq(aS,aT){r(aS,{display:aT?"block":"none"})}this.addButton=function(aU,aS,aT,aV){if(aA){aA.addButton(aU,aS,aT,aV)}};this.removeButton=function(aS){if(aA){aA.removeButton(aS)}};this.setControls=function(aT){var aU=J.controls,aS=aT?k:s;J.controls=aS;if(aS!=aU){if(aS){E()}else{S();U()}ax.sendEvent(a.JWPLAYER_CONTROLS,{controls:aS})}};this.getSafeRegion=function(){var aZ=J.controls,a0=x.bounds(Y),aU=a0.top,aX=x.bounds(aE?aE.element():null),aT=(aA.numButtons()>0),aW=x.bounds(aA.element()),aV=x.bounds(ap.element()),aY=(ap.position().indexOf("top")==0),aS={};aS.x=0;aS.y=Math.max(aT?(aW.top+aW.height-aU):0,aY?(aV.top+aV.height-aU):0);aS.width=a0.width;if(aX.height){aS.height=(aY?aX.top:aV.top)-aS.y-aU}else{aS.height=a0.height-aS.y}return{x:0,y:aZ?aS.y:0,width:aZ?aS.width:0,height:aZ?aS.height:0}};this.destroy=function(){g.removeEventListener("webkitfullscreenchange",aK,s);g.removeEventListener("mozfullscreenchange",aK,s);F.removeEventListener("webkitbeginfullscreen",aK,s);F.removeEventListener("webkitendfullscreen",aK,s);g.removeEventListener("keydown",ay,s);if(au){au.destroy()}};aL()};r("."+o,{position:"relative",opacity:0,"min-height":x.isMobile()?200:0,"-webkit-transition":v,"-moz-transition":v,"-o-transition":v});r("."+q,{position:j,left:0,right:0,top:0,bottom:0,"-webkit-transition":v,"-moz-transition":v,"-o-transition":v});r("."+y+" ,."+c,{position:j,height:n,width:n,"-webkit-transition":v,"-moz-transition":v,"-o-transition":v});r("."+y,{visibility:"hidden",overflow:"hidden",cursor:"pointer"});r("."+y+" video",{background:"transparent",width:n,height:n});r("."+e,{position:j,height:n,width:n,display:"none"});r("."+z,{position:j,top:0,left:0,bottom:0,right:0,display:"none"});r(b,{width:n,height:n,left:0,right:0,top:0,bottom:0,"z-index":1000,position:"fixed"},k);r(b+" ."+q,{left:0,right:0,top:0,bottom:0},k);r(b+" ."+e,{display:"none"},k);r("."+o+" .jwuniform",{"background-size":"contain"+u});r("."+o+" .jwfill",{"background-size":"cover"+u,"background-position":"center"});r("."+o+" .jwexactfit",{"background-size":n+" "+n+u})})(jwplayer.html5);(function(b){var d=jwplayer.utils.extend,c=b.logo,a;a=function(f,e){if(f.edition()=="free"){e=null}else{c.defaults.file="";c.defaults.prefix=""}d(this,new c(f,e))};a.defaults={prefix:"",file:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG0AAAATCAYAAACa0IPnAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NUVGQjQ0N0ZEOThDMTFFMUFDMUZCMzY5RkYyQkY5NDUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NUVGQjQ0ODBEOThDMTFFMUFDMUZCMzY5RkYyQkY5NDUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo1RUZCNDQ3REQ5OEMxMUUxQUMxRkIzNjlGRjJCRjk0NSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo1RUZCNDQ3RUQ5OEMxMUUxQUMxRkIzNjlGRjJCRjk0NSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pr5HQqEAAArQSURBVHja3JkJUNT3Fcf3AARBQVFR8IjGCw1aT9R6UKVe0TgYOxNHG5tqD+o48ajVia21mdaJ49FoCloNKho0FkbjQRwRvAUVFUO8gCDKIbccciyw7Pbztr+1G2Sp0yKj/c28+f/3d733e993/f6r1TTSwsLCtDwcIbPq0kM6qErTeHOCau2MtVLPWpv9rE2n1pps+FQ3ssfPoR5QNHRN8+o3bSNn/Z/awoULn707NDZBr9d7ms3m3/FqqKurO8rv4Vqt1l+n031B35kG04OZ68f4Td4/bzAWxNjk+vr6Sw4ODpENgNXRP54956pDuog87JPCMxtKgO5Y0K6t/dDJyWlQSUlJbbt27V4H0PpB05UBOkOHoMfNtXmjoBUUFHTu0qXLcl5rsrOzEzw8PMagrPcNBoOHs7NzIv1P1dS2gPJXFN0KcB86OjoKqAarhzF/GfPHsV8B+2j8/f2f8bh69aq2b9++E9n3l/K7pqYmi32c2OM9+Q2gyRiLyHD26dOnJvapq6iocOzYseMrj1hhYeEPkHOz9XdZWVmau7v7ywWttLRUD2hVAGIsKioq43dKp06dzCaTaSSK80bR4g2aqqqqka1bt7aGv3bQaJR+Vn5UVlb2xbt64kk1t2/fTtq/f79x7Nix/2bs4KARENhXk5ubmxwREfE5wDjDtzvzJnp5eQ3CEDYCZgB71kMayCzPV72Vl5c7Ir8BoxMv07i4uLyH3HF2Qn/zgEYoMgth7Zpu3brpk5OTLxOiCtzc3LwBozcCWEDDM2aj/Hr6Cl1dXTvhEXMA0QIaAI/FuroQ0tLbtGmTcvjwYVODECx8TAqM/MTExHCV09q0b9/+CYf+LXsNKS4u9mBvC1gC9OsAWqtWrSznkjNawlHbtu9ifDsA79JLA00p0srU7dSpUwljxoxJx8O8UKQ/yj5FvxFQZgNc7fHjx0MXLFjwMZ4xmjEpLkwoeBjC6/HUxGvXruVMnz79+4wVAMzX4GD1J06cKFdDJVlZWRUc0BHgawBdC1+tzLPOVy0AWgR1U+Facu1nUB30J2UAYVCGDdvxas1B6KTq+wCaAXlCD6DdkFW5A6CV0FdQMfRTqAL6RKKgXaWqs8lTNWfeQ6EJcr6XApowE+WgNGHumJ+fX4anpdI3Bqv/IYp0wxPeYsiT0HY7Ly8vwmg0fshYV0DsQ38W7wNlD7wv/vr16xU2yn4ONHJmN57vKnn8evTo8QHjjjk5OUmZmZkV/fv3t8yjz6T2WUTo3iryIVcpAHtLwUN/R/ivRb5x7DkW626NQSxXLH34/WcMadyDBw8u9+rVy52+cNa9TUQph0yMTWDPQEL6CsYiOdsQwvXPONuP6NNAPRivevz4cXjXrl3tgmY9lw1o8tuPtf9gjyAFfPN7GgewgAZjS/n66NGjC3369HmH0OVPUeFOPpuBp2lQ7FkKjDxqjRsUFj8mns9AETGenp5+1dXV+Sjj7vnz5032DiZ8ePrS9YUKuc7SBw/Jc5/ideUzZszQSR+kleeuXbsyeO66efNmJgCVwstr7dq1wciznFC94+LFi1/PmTMngEgxDz5/FE9EvoEUB2Jwj44ePZq4YsWK1YzNio+PPxIeHh4LMPWTJk0aPHfu3F/z/jFjkZzRRfHtgfHE79y5M4xQryNNFC9evNiuUq3nsgVNtUB0c5ozLuA9tdlBE8aS06w55MKFC3Hjx4/Pw4IHECJ9EP5tBNMlJCREEdoMa9asOenn5zcZgUZw6GKs31Uqzxs3btybNWuW3RAifPDktEOHDn3VoUMHN3KY4datW/koNxVLP8P+dYRYq+VawuSxY8cSV61a5TRv3rwJyOCPnOJ+bdjP6eHDhx327dv3JTwlJ7ZHljms2YM8k0VejODC0KFDs8TipbDp169fdWhoaFsA1sHTgPwSFXwYe4v3GuEH4GkHDhwIEWNQOitbtmyZpqnw2NDTbNoogLvK3iG8/0VV2+b/CjSsVsdhTIqpWaxaPA3m4mkaCoUcrDiNfl9Cwx845JtUlVmExmTWmqKiohKZX4YnilA+zDOjhGunT58u2rBhg13QxCI5wOODBw9+qu40NaIUuZ6xr1EldgtJFSmKP3fu3Bq6l0nOI/xm4hEFeJtWGZoeb8/hSnGYPBpMhbqANccZn838ciLG11OnTu3MXu6ETm337t3Fot4RJ5eCh/U6gDYQAnszbhS+ACyFVizylL6IUpvwNGvzgD6CfgOFSpiGctXZ6/4jaHfu3JGd+yHsaN4jBw4cWMYBMdLWLuSAUooLy4WYsXrC3A0UHIiXTVVAxhEaq0RA7iIZHPTGgAEDJsrXCxRZInctWdeUN8tavMDIvLymlCCEodRKzuR9JQb0ZOPGjX+LjIxMwlAMVKefIZe77MteZjx/H6C9TygTj1lNBdeTXHZl8+bNsVTEXsOHD68W3qz7Eg9KByA9Stb7+Pi44+FFAJSEsU2UOejCGBgYaJD3F2lWY2wCNOtXE7kmiQGuwdCToGgMRO7BUp2Xqy9FAqTo59mXFgcO34lccBJFdEPJk9PS0jaQi4JRpAOhKoswdNOqOKrA2JEjR/6Kd1fp43Anly5davHOkJCQQgC/wJiApgHA7+R+NnPmzKYqLK0CRNewUGlQQksu06FYM4pvTxg2c7hKwuP19evX38ODpkFdbEMuIfVbDho3atQo8aLljBs5zzXOV0RuNuDZ1ymmek6bNq0rhc4ecnMF8g8BtJUZGRm/J3JkYSSOqmrVWUPei4LWRHi014YosjQAFCMuQ+4HqnK1fuar1M2fP7+cA0ThUUVY1E9QznXy1gI8JTcpKSn6yZMn+dYQtXfv3m8AOROhTDyzr1y5Em8NXSTqOiq5JKxaPM+M532ze/fuR9bxhqRKYpOyyHp786zjzDdC+ujo6Jz09PSrXMq7E86PoxzJD4sB0bIXipbQrrl06VLVmTNn9tIvHqUlTGbHxMQcVrJWbNq0KQQA4/HSsUSL80FBQRfJb3vg5U0LZI6JtWYb/pqmZLQlSSkYmO5F5zdGrO8M9QOTadB8RXOhRQ6pqamV69at28ahKkeMGDEM6+tAnio8cuRIHMXBEWuSFMuhv2rr1q2HsMxcFHdv8ODBRbbWxyX8W8DfL6fGyk8yv8aeWbHeTD66hVfHYOXnevfubdcE8fAYhP0OA7qHIeSmpKRsoHpbSG71Jv9Ub9++PdLX1/cNPND3/v37xRRMIqt5yZIll/G4NK4Qg8i/9ykmErds2WLZkwIpgfD5EZFkVkBAwDDCpysFR0lsbGwCUeME6zV3795NwyDiyIPnAbF2ypQpL/a1WKs1SSh3+JermZrx3m7Jt1qbDm+5y8gFXhUC6XYugl5QF+Wy2Q0qH0Gwu9ojw3Y9Cn9uI6y8A483JdIynmlPUub1kks+lMO8Yn5LwTJQ5QQpVm5B7kq2ZOZYvn8CkjPhORXL9QwLC1sRHBy8o5G95XL+hiqC5JL+kPV5asxdXbClSMik/4UA2LZt20iuF7/AO11QcrN97ccGngPtpTa8qiW/JA0SEMgHQYS41XjJXfLVRGTIbwnmFERuygH0zfwXjXxtqndoKS225DdDrDEKsDrC0wOgSgipuwwGQ35L8YdXhaoAm62R375XdraUIlsMtIiIiNCeNDysND4+/g6X57/Dv1DzGjfbSlSr+f9sfSUlqW98+U193H0d2z8FGACF4VIWnpOTrQAAAABJRU5ErkJggg%3D%3D",};d(a.defaults,c.defaults);b.logo=a})(jwplayer.html5);(function(a){var b=a.model,c;c=function(e){var f=new jwplayer.utils.key(e.key),g=new b(e),d=g.componentConfig;g.edition=function(){return f.edition()};g.componentConfig=function(h){if(h=="logo"){return g.logo}else{return d(h)}};return g};a.model=c})(jwplayer.html5);(function(a){a.player.prototype.edition=function(){return this._model.edition()}})(jwplayer.html5);(function(e){var g=jwplayer.utils.extend,h=e.rightclick,k,f="free",c="pro",d="premium",j="ads",b="open",a="About JW Player ",l="http://www.longtailvideo.com/jwpabout/?a=r&v=";k=function(n,m){if(n.edition()=="free"){m.aboutlink=l+e.version+"&m=h&e=f";delete m.abouttext}else{if(!m.aboutlink){m.aboutlink=l+e.version+"&m=h&e="+p(n.edition())}if(m.abouttext){m.abouttext="About "+m.abouttext+" ..."}else{var o=n.edition();o=o.charAt(0).toUpperCase()+o.substr(1);m.abouttext=a+e.version+" ("+o+" edition)"}}function p(q){if(q==c){return"p"}else{if(q==d){return"r"}else{if(q==j){return"a"}else{return"f"}}}}g(this,new h(n,m))};e.rightclick=k})(jwplayer.html5);(function(b){var a=b.view,c=function(f,d){var g=new a(f,d),e=d.edition();if(e=="invalid"){g.setupError("Error setting up player: Invalid license key")}return g};b.view=c})(jwplayer.html5);
|
js/video/jwplayer.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
if(typeof jwplayer=="undefined"){var jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};var $jw=jwplayer;jwplayer.version="5.10.2295";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(b){b.utils=function(){};b.utils.typeOf=function(d){var c=typeof d;if(c==="object"){if(d){if(d instanceof Array){c="array"}}else{c="null"}}return c};b.utils.extend=function(){var c=b.utils.extend["arguments"];if(c.length>1){for(var e=1;e<c.length;e++){for(var d in c[e]){c[0][d]=c[e][d]}}return c[0]}return null};b.utils.clone=function(f){var c;var d=b.utils.clone["arguments"];if(d.length==1){switch(b.utils.typeOf(d[0])){case"object":c={};for(var e in d[0]){c[e]=b.utils.clone(d[0][e])}break;case"array":c=[];for(var e in d[0]){c[e]=b.utils.clone(d[0][e])}break;default:return d[0];break}}return c};b.utils.extension=function(c){if(!c){return""}c=c.substring(c.lastIndexOf("/")+1,c.length);c=c.split("?")[0];if(c.lastIndexOf(".")>-1){return c.substr(c.lastIndexOf(".")+1,c.length).toLowerCase()}return};b.utils.html=function(c,d){c.innerHTML=d};b.utils.wrap=function(c,d){if(c.parentNode){c.parentNode.replaceChild(d,c)}d.appendChild(c)};b.utils.ajax=function(g,f,c){var e;if(window.XMLHttpRequest){e=new XMLHttpRequest()}else{e=new ActiveXObject("Microsoft.XMLHTTP")}e.onreadystatechange=function(){if(e.readyState===4){if(e.status===200){if(f){if(!b.utils.exists(e.responseXML)){try{if(window.DOMParser){var h=(new DOMParser()).parseFromString(e.responseText,"text/xml");if(h){e=b.utils.extend({},e,{responseXML:h})}}else{h=new ActiveXObject("Microsoft.XMLDOM");h.async="false";h.loadXML(e.responseText);e=b.utils.extend({},e,{responseXML:h})}}catch(j){if(c){c(g)}}}f(e)}}else{if(c){c(g)}}}};try{e.open("GET",g,true);e.send(null)}catch(d){if(c){c(g)}}return e};b.utils.load=function(d,e,c){d.onreadystatechange=function(){if(d.readyState===4){if(d.status===200){if(e){e()}}else{if(c){c()}}}}};b.utils.find=function(d,c){return d.getElementsByTagName(c)};b.utils.append=function(c,d){c.appendChild(d)};b.utils.isIE=function(){return((!+"\v1")||(typeof window.ActiveXObject!="undefined"))};b.utils.userAgentMatch=function(d){var c=navigator.userAgent.toLowerCase();return(c.match(d)!==null)};b.utils.isIOS=function(){return b.utils.userAgentMatch(/iP(hone|ad|od)/i)};b.utils.isIPad=function(){return b.utils.userAgentMatch(/iPad/i)};b.utils.isIPod=function(){return b.utils.userAgentMatch(/iP(hone|od)/i)};b.utils.isAndroid=function(){return b.utils.userAgentMatch(/android/i)};b.utils.isLegacyAndroid=function(){return b.utils.userAgentMatch(/android 2.[012]/i)};b.utils.isBlackberry=function(){return b.utils.userAgentMatch(/blackberry/i)};b.utils.isMobile=function(){return b.utils.userAgentMatch(/(iP(hone|ad|od))|android/i)};b.utils.getFirstPlaylistItemFromConfig=function(c){var d={};var e;if(c.playlist&&c.playlist.length){e=c.playlist[0]}else{e=c}d.file=e.file;d.levels=e.levels;d.streamer=e.streamer;d.playlistfile=e.playlistfile;d.provider=e.provider;if(!d.provider){if(d.file&&(d.file.toLowerCase().indexOf("youtube.com")>-1||d.file.toLowerCase().indexOf("youtu.be")>-1)){d.provider="youtube"}if(d.streamer&&d.streamer.toLowerCase().indexOf("rtmp://")==0){d.provider="rtmp"}if(e.type){d.provider=e.type.toLowerCase()}}if(d.provider=="audio"){d.provider="sound"}return d};b.utils.getOuterHTML=function(c){if(c.outerHTML){return c.outerHTML}else{try{return new XMLSerializer().serializeToString(c)}catch(d){return""}}};b.utils.setOuterHTML=function(f,e){if(f.outerHTML){f.outerHTML=e}else{var g=document.createElement("div");g.innerHTML=e;var c=document.createRange();c.selectNodeContents(g);var d=c.extractContents();f.parentNode.insertBefore(d,f);f.parentNode.removeChild(f)}};b.utils.hasFlash=function(){if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]!="undefined"){return true}if(typeof window.ActiveXObject!="undefined"){try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return true}catch(c){}}return false};b.utils.getPluginName=function(c){if(c.lastIndexOf("/")>=0){c=c.substring(c.lastIndexOf("/")+1,c.length)}if(c.lastIndexOf("-")>=0){c=c.substring(0,c.lastIndexOf("-"))}if(c.lastIndexOf(".swf")>=0){c=c.substring(0,c.lastIndexOf(".swf"))}if(c.lastIndexOf(".js")>=0){c=c.substring(0,c.lastIndexOf(".js"))}return c};b.utils.getPluginVersion=function(c){if(c.lastIndexOf("-")>=0){if(c.lastIndexOf(".js")>=0){return c.substring(c.lastIndexOf("-")+1,c.lastIndexOf(".js"))}else{if(c.lastIndexOf(".swf")>=0){return c.substring(c.lastIndexOf("-")+1,c.lastIndexOf(".swf"))}else{return c.substring(c.lastIndexOf("-")+1)}}}return""};b.utils.getAbsolutePath=function(j,h){if(!b.utils.exists(h)){h=document.location.href}if(!b.utils.exists(j)){return undefined}if(a(j)){return j}var k=h.substring(0,h.indexOf("://")+3);var g=h.substring(k.length,h.indexOf("/",k.length+1));var d;if(j.indexOf("/")===0){d=j.split("/")}else{var e=h.split("?")[0];e=e.substring(k.length+g.length+1,e.lastIndexOf("/"));d=e.split("/").concat(j.split("/"))}var c=[];for(var f=0;f<d.length;f++){if(!d[f]||!b.utils.exists(d[f])||d[f]=="."){continue}else{if(d[f]==".."){c.pop()}else{c.push(d[f])}}}return k+g+"/"+c.join("/")};function a(d){if(!b.utils.exists(d)){return}var e=d.indexOf("://");var c=d.indexOf("?");return(e>0&&(c<0||(c>e)))}b.utils.pluginPathType={ABSOLUTE:"ABSOLUTE",RELATIVE:"RELATIVE",CDN:"CDN"};b.utils.getPluginPathType=function(d){if(typeof d!="string"){return}d=d.split("?")[0];var e=d.indexOf("://");if(e>0){return b.utils.pluginPathType.ABSOLUTE}var c=d.indexOf("/");var f=b.utils.extension(d);if(e<0&&c<0&&(!f||!isNaN(f))){return b.utils.pluginPathType.CDN}return b.utils.pluginPathType.RELATIVE};b.utils.mapEmpty=function(c){for(var d in c){return false}return true};b.utils.mapLength=function(d){var c=0;for(var e in d){c++}return c};b.utils.log=function(d,c){if(typeof console!="undefined"&&typeof console.log!="undefined"){if(c){console.log(d,c)}else{console.log(d)}}};b.utils.css=function(d,g,c){if(b.utils.exists(d)){for(var e in g){try{if(typeof g[e]==="undefined"){continue}else{if(typeof g[e]=="number"&&!(e=="zIndex"||e=="opacity")){if(isNaN(g[e])){continue}if(e.match(/color/i)){g[e]="#"+b.utils.strings.pad(g[e].toString(16),6)}else{g[e]=Math.ceil(g[e])+"px"}}}d.style[e]=g[e]}catch(f){}}}};b.utils.isYouTube=function(c){return(c.indexOf("youtube.com")>-1||c.indexOf("youtu.be")>-1)};b.utils.transform=function(e,d,c,g,h){if(!b.utils.exists(d)){d=1}if(!b.utils.exists(c)){c=1}if(!b.utils.exists(g)){g=0}if(!b.utils.exists(h)){h=0}if(d==1&&c==1&&g==0&&h==0){e.style.webkitTransform="";e.style.MozTransform="";e.style.OTransform=""}else{var f="scale("+d+","+c+") translate("+g+"px,"+h+"px)";e.style.webkitTransform=f;e.style.MozTransform=f;e.style.OTransform=f}};b.utils.stretch=function(k,q,p,g,n,h){if(typeof p=="undefined"||typeof g=="undefined"||typeof n=="undefined"||typeof h=="undefined"){return}var d=p/n;var f=g/h;var m=0;var l=0;var e=false;var c={};if(q.parentElement){q.parentElement.style.overflow="hidden"}b.utils.transform(q);switch(k.toUpperCase()){case b.utils.stretching.NONE:c.width=n;c.height=h;c.top=(g-c.height)/2;c.left=(p-c.width)/2;break;case b.utils.stretching.UNIFORM:if(d>f){c.width=n*f;c.height=h*f;if(c.width/p>0.95){e=true;d=Math.ceil(100*p/c.width)/100;f=1;c.width=p}}else{c.width=n*d;c.height=h*d;if(c.height/g>0.95){e=true;d=1;f=Math.ceil(100*g/c.height)/100;c.height=g}}c.top=(g-c.height)/2;c.left=(p-c.width)/2;break;case b.utils.stretching.FILL:if(d>f){c.width=n*d;c.height=h*d}else{c.width=n*f;c.height=h*f}c.top=(g-c.height)/2;c.left=(p-c.width)/2;break;case b.utils.stretching.EXACTFIT:c.width=n;c.height=h;var o=Math.round((n/2)*(1-1/d));var j=Math.round((h/2)*(1-1/f));e=true;c.top=c.left=0;break;default:break}if(e){b.utils.transform(q,d,f,o,j)}b.utils.css(q,c)};b.utils.stretching={NONE:"NONE",FILL:"FILL",UNIFORM:"UNIFORM",EXACTFIT:"EXACTFIT"};b.utils.deepReplaceKeyName=function(k,e,c){switch(b.utils.typeOf(k)){case"array":for(var g=0;g<k.length;g++){k[g]=b.utils.deepReplaceKeyName(k[g],e,c)}break;case"object":for(var f in k){var j,h;if(e instanceof Array&&c instanceof Array){if(e.length!=c.length){continue}else{j=e;h=c}}else{j=[e];h=[c]}var d=f;for(var g=0;g<j.length;g++){d=d.replace(new RegExp(e[g],"g"),c[g])}k[d]=b.utils.deepReplaceKeyName(k[f],e,c);if(f!=d){delete k[f]}}break}return k};b.utils.isInArray=function(e,d){if(!(e)||!(e instanceof Array)){return false}for(var c=0;c<e.length;c++){if(d===e[c]){return true}}return false};b.utils.exists=function(c){switch(typeof(c)){case"string":return(c.length>0);break;case"object":return(c!==null);case"undefined":return false}return true};b.utils.empty=function(c){if(typeof c.hasChildNodes=="function"){while(c.hasChildNodes()){c.removeChild(c.firstChild)}}};b.utils.parseDimension=function(c){if(typeof c=="string"){if(c===""){return 0}else{if(c.lastIndexOf("%")>-1){return c}else{return parseInt(c.replace("px",""),10)}}}return c};b.utils.getDimensions=function(c){if(c&&c.style){return{x:b.utils.parseDimension(c.style.left),y:b.utils.parseDimension(c.style.top),width:b.utils.parseDimension(c.style.width),height:b.utils.parseDimension(c.style.height)}}else{return{}}};b.utils.getElementWidth=function(c){if(!c){return null}else{if(c==document.body){return b.utils.parentNode(c).clientWidth}else{if(c.clientWidth>0){return c.clientWidth}else{if(c.style){return b.utils.parseDimension(c.style.width)}else{return null}}}}};b.utils.getElementHeight=function(c){if(!c){return null}else{if(c==document.body){return b.utils.parentNode(c).clientHeight}else{if(c.clientHeight>0){return c.clientHeight}else{if(c.style){return b.utils.parseDimension(c.style.height)}else{return null}}}}};b.utils.timeFormat=function(c){str="00:00";if(c>0){str=Math.floor(c/60)<10?"0"+Math.floor(c/60)+":":Math.floor(c/60)+":";str+=Math.floor(c%60)<10?"0"+Math.floor(c%60):Math.floor(c%60)}return str};b.utils.useNativeFullscreen=function(){return(navigator&&navigator.vendor&&navigator.vendor.indexOf("Apple")==0)};b.utils.parentNode=function(c){if(!c){return document.body}else{if(c.parentNode){return c.parentNode}else{if(c.parentElement){return c.parentElement}else{return c}}}};b.utils.getBoundingClientRect=function(c){if(typeof c.getBoundingClientRect=="function"){return c.getBoundingClientRect()}else{return{left:c.offsetLeft+document.body.scrollLeft,top:c.offsetTop+document.body.scrollTop,width:c.offsetWidth,height:c.offsetHeight}}};b.utils.translateEventResponse=function(e,c){var g=b.utils.extend({},c);if(e==b.api.events.JWPLAYER_FULLSCREEN&&!g.fullscreen){g.fullscreen=g.message=="true"?true:false;delete g.message}else{if(typeof g.data=="object"){g=b.utils.extend(g,g.data);delete g.data}else{if(typeof g.metadata=="object"){b.utils.deepReplaceKeyName(g.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var d=["position","duration","offset"];for(var f in d){if(g[d[f]]){g[d[f]]=Math.round(g[d[f]]*1000)/1000}}return g};b.utils.saveCookie=function(c,d){document.cookie="jwplayer."+c+"="+d+"; path=/"};b.utils.getCookies=function(){var f={};var e=document.cookie.split("; ");for(var d=0;d<e.length;d++){var c=e[d].split("=");if(c[0].indexOf("jwplayer.")==0){f[c[0].substring(9,c[0].length)]=c[1]}}return f};b.utils.readCookie=function(c){return b.utils.getCookies()[c]}})(jwplayer);(function(a){a.events=function(){};a.events.COMPLETE="COMPLETE";a.events.ERROR="ERROR"})(jwplayer);(function(jwplayer){jwplayer.events.eventdispatcher=function(debug){var _debug=debug;var _listeners;var _globallisteners;this.resetEventListeners=function(){_listeners={};_globallisteners=[]};this.resetEventListeners();this.addEventListener=function(type,listener,count){try{if(!jwplayer.utils.exists(_listeners[type])){_listeners[type]=[]}if(typeof(listener)=="string"){eval("listener = "+listener)}_listeners[type].push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeEventListener=function(type,listener){if(!_listeners[type]){return}try{for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){if(_listeners[type][listenerIndex].listener.toString()==listener.toString()){_listeners[type].splice(listenerIndex,1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.addGlobalListener=function(listener,count){try{if(typeof(listener)=="string"){eval("listener = "+listener)}_globallisteners.push({listener:listener,count:count})}catch(err){jwplayer.utils.log("error",err)}return false};this.removeGlobalListener=function(listener){if(!listener){return}try{for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){if(_globallisteners[globalListenerIndex].listener.toString()==listener.toString()){_globallisteners.splice(globalListenerIndex,1);break}}}catch(err){jwplayer.utils.log("error",err)}return false};this.sendEvent=function(type,data){if(!jwplayer.utils.exists(data)){data={}}if(_debug){jwplayer.utils.log(type,data)}if(typeof _listeners[type]!="undefined"){for(var listenerIndex=0;listenerIndex<_listeners[type].length;listenerIndex++){try{_listeners[type][listenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener: "+err.toString(),_listeners[type][listenerIndex].listener)}if(_listeners[type][listenerIndex]){if(_listeners[type][listenerIndex].count===1){delete _listeners[type][listenerIndex]}else{if(_listeners[type][listenerIndex].count>0){_listeners[type][listenerIndex].count=_listeners[type][listenerIndex].count-1}}}}}for(var globalListenerIndex=0;globalListenerIndex<_globallisteners.length;globalListenerIndex++){try{_globallisteners[globalListenerIndex].listener(data)}catch(err){jwplayer.utils.log("There was an error while handling a listener: "+err.toString(),_globallisteners[globalListenerIndex].listener)}if(_globallisteners[globalListenerIndex]){if(_globallisteners[globalListenerIndex].count===1){delete _globallisteners[globalListenerIndex]}else{if(_globallisteners[globalListenerIndex].count>0){_globallisteners[globalListenerIndex].count=_globallisteners[globalListenerIndex].count-1}}}}}}})(jwplayer);(function(a){var b={};a.utils.animations=function(){};a.utils.animations.transform=function(c,d){c.style.webkitTransform=d;c.style.MozTransform=d;c.style.OTransform=d;c.style.msTransform=d};a.utils.animations.transformOrigin=function(c,d){c.style.webkitTransformOrigin=d;c.style.MozTransformOrigin=d;c.style.OTransformOrigin=d;c.style.msTransformOrigin=d};a.utils.animations.rotate=function(c,d){a.utils.animations.transform(c,["rotate(",d,"deg)"].join(""))};a.utils.cancelAnimation=function(c){delete b[c.id]};a.utils.fadeTo=function(m,f,e,j,h,d){if(b[m.id]!=d&&a.utils.exists(d)){return}if(m.style.opacity==f){return}var c=new Date().getTime();if(d>c){setTimeout(function(){a.utils.fadeTo(m,f,e,j,0,d)},d-c)}if(m.style.display=="none"){m.style.display="block"}if(!a.utils.exists(j)){j=m.style.opacity===""?1:m.style.opacity}if(m.style.opacity==f&&m.style.opacity!==""&&a.utils.exists(d)){if(f===0){m.style.display="none"}return}if(!a.utils.exists(d)){d=c;b[m.id]=d}if(!a.utils.exists(h)){h=0}var k=(e>0)?((c-d)/(e*1000)):0;k=k>1?1:k;var l=f-j;var g=j+(k*l);if(g>1){g=1}else{if(g<0){g=0}}m.style.opacity=g;if(h>0){b[m.id]=d+h*1000;a.utils.fadeTo(m,f,e,j,0,b[m.id]);return}setTimeout(function(){a.utils.fadeTo(m,f,e,j,0,d)},10)}})(jwplayer);(function(a){a.utils.arrays=function(){};a.utils.arrays.indexOf=function(c,d){for(var b=0;b<c.length;b++){if(c[b]==d){return b}}return -1};a.utils.arrays.remove=function(c,d){var b=a.utils.arrays.indexOf(c,d);if(b>-1){c.splice(b,1)}}})(jwplayer);(function(a){a.utils.extensionmap={"3gp":{html5:"video/3gpp",flash:"video"},"3gpp":{html5:"video/3gpp"},"3g2":{html5:"video/3gpp2",flash:"video"},"3gpp2":{html5:"video/3gpp2"},flv:{flash:"video"},f4a:{html5:"audio/mp4"},f4b:{html5:"audio/mp4",flash:"video"},f4v:{html5:"video/mp4",flash:"video"},mov:{html5:"video/quicktime",flash:"video"},m4a:{html5:"audio/mp4",flash:"video"},m4b:{html5:"audio/mp4"},m4p:{html5:"audio/mp4"},m4v:{html5:"video/mp4",flash:"video"},mp4:{html5:"video/mp4",flash:"video"},rbs:{flash:"sound"},aac:{html5:"audio/aac",flash:"video"},mp3:{html5:"audio/mp3",flash:"sound"},ogg:{html5:"audio/ogg"},oga:{html5:"audio/ogg"},ogv:{html5:"video/ogg"},webm:{html5:"video/webm"},m3u8:{html5:"audio/x-mpegurl"},gif:{flash:"image"},jpeg:{flash:"image"},jpg:{flash:"image"},swf:{flash:"image"},png:{flash:"image"},wav:{html5:"audio/x-wav"}}})(jwplayer);(function(e){e.utils.mediaparser=function(){};var g={element:{width:"width",height:"height",id:"id","class":"className",name:"name"},media:{src:"file",preload:"preload",autoplay:"autostart",loop:"repeat",controls:"controls"},source:{src:"file",type:"type",media:"media","data-jw-width":"width","data-jw-bitrate":"bitrate"},video:{poster:"image"}};var f={};e.utils.mediaparser.parseMedia=function(j){return d(j)};function c(k,j){if(!e.utils.exists(j)){j=g[k]}else{e.utils.extend(j,g[k])}return j}function d(n,j){if(f[n.tagName.toLowerCase()]&&!e.utils.exists(j)){return f[n.tagName.toLowerCase()](n)}else{j=c("element",j);var o={};for(var k in j){if(k!="length"){var m=n.getAttribute(k);if(e.utils.exists(m)){o[j[k]]=m}}}var l=n.style["#background-color"];if(l&&!(l=="transparent"||l=="rgba(0, 0, 0, 0)")){o.screencolor=l}return o}}function h(n,k){k=c("media",k);var l=[];var j=e.utils.selectors("source",n);for(var m in j){if(!isNaN(m)){l.push(a(j[m]))}}var o=d(n,k);if(e.utils.exists(o.file)){l[0]={file:o.file}}o.levels=l;return o}function a(l,k){k=c("source",k);var j=d(l,k);j.width=j.width?j.width:0;j.bitrate=j.bitrate?j.bitrate:0;return j}function b(l,k){k=c("video",k);var j=h(l,k);return j}f.media=h;f.audio=h;f.source=a;f.video=b})(jwplayer);(function(a){a.utils.loaderstatus={NEW:"NEW",LOADING:"LOADING",ERROR:"ERROR",COMPLETE:"COMPLETE"};a.utils.scriptloader=function(c){var d=a.utils.loaderstatus.NEW;var b=new a.events.eventdispatcher();a.utils.extend(this,b);this.load=function(){if(d==a.utils.loaderstatus.NEW){d=a.utils.loaderstatus.LOADING;var e=document.createElement("script");e.onload=function(f){d=a.utils.loaderstatus.COMPLETE;b.sendEvent(a.events.COMPLETE)};e.onerror=function(f){d=a.utils.loaderstatus.ERROR;b.sendEvent(a.events.ERROR)};e.onreadystatechange=function(){if(e.readyState=="loaded"||e.readyState=="complete"){d=a.utils.loaderstatus.COMPLETE;b.sendEvent(a.events.COMPLETE)}};document.getElementsByTagName("head")[0].appendChild(e);e.src=c}};this.getStatus=function(){return d}}})(jwplayer);(function(a){a.utils.selectors=function(b,e){if(!a.utils.exists(e)){e=document}b=a.utils.strings.trim(b);var c=b.charAt(0);if(c=="#"){return e.getElementById(b.substr(1))}else{if(c=="."){if(e.getElementsByClassName){return e.getElementsByClassName(b.substr(1))}else{return a.utils.selectors.getElementsByTagAndClass("*",b.substr(1))}}else{if(b.indexOf(".")>0){var d=b.split(".");return a.utils.selectors.getElementsByTagAndClass(d[0],d[1])}else{return e.getElementsByTagName(b)}}}return null};a.utils.selectors.getElementsByTagAndClass=function(e,h,g){var j=[];if(!a.utils.exists(g)){g=document}var f=g.getElementsByTagName(e);for(var d=0;d<f.length;d++){if(a.utils.exists(f[d].className)){var c=f[d].className.split(" ");for(var b=0;b<c.length;b++){if(c[b]==h){j.push(f[d])}}}}return j}})(jwplayer);(function(a){a.utils.strings=function(){};a.utils.strings.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.utils.strings.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c};a.utils.strings.serialize=function(b){if(b==null){return null}else{if(b=="true"){return true}else{if(b=="false"){return false}else{if(isNaN(Number(b))||b.length>5||b.length==0){return b}else{return Number(b)}}}}};a.utils.strings.seconds=function(d){d=d.replace(",",".");var b=d.split(":");var c=0;if(d.substr(-1)=="s"){c=Number(d.substr(0,d.length-1))}else{if(d.substr(-1)=="m"){c=Number(d.substr(0,d.length-1))*60}else{if(d.substr(-1)=="h"){c=Number(d.substr(0,d.length-1))*3600}else{if(b.length>1){c=Number(b[b.length-1]);c+=Number(b[b.length-2])*60;if(b.length==3){c+=Number(b[b.length-3])*3600}}else{c=Number(d)}}}}return c};a.utils.strings.xmlAttribute=function(b,c){for(var d=0;d<b.attributes.length;d++){if(b.attributes[d].name&&b.attributes[d].name.toLowerCase()==c.toLowerCase()){return b.attributes[d].value.toString()}}return""};a.utils.strings.jsonToString=function(f){var h=h||{};if(h&&h.stringify){return h.stringify(f)}var c=typeof(f);if(c!="object"||f===null){if(c=="string"){f='"'+f.replace(/"/g,'\\"')+'"'}else{return String(f)}}else{var g=[],b=(f&&f.constructor==Array);for(var d in f){var e=f[d];switch(typeof(e)){case"string":e='"'+e.replace(/"/g,'\\"')+'"';break;case"object":if(a.utils.exists(e)){e=a.utils.strings.jsonToString(e)}break}if(b){if(typeof(e)!="function"){g.push(String(e))}}else{if(typeof(e)!="function"){g.push('"'+d+'":'+String(e))}}}if(b){return"["+String(g)+"]"}else{return"{"+String(g)+"}"}}}})(jwplayer);(function(c){var d=new RegExp(/^(#|0x)[0-9a-fA-F]{3,6}/);c.utils.typechecker=function(g,f){f=!c.utils.exists(f)?b(g):f;return e(g,f)};function b(f){var g=["true","false","t","f"];if(g.toString().indexOf(f.toLowerCase().replace(" ",""))>=0){return"boolean"}else{if(d.test(f)){return"color"}else{if(!isNaN(parseInt(f,10))&&parseInt(f,10).toString().length==f.length){return"integer"}else{if(!isNaN(parseFloat(f))&&parseFloat(f).toString().length==f.length){return"float"}}}}return"string"}function e(g,f){if(!c.utils.exists(f)){return g}switch(f){case"color":if(g.length>0){return a(g)}return null;case"integer":return parseInt(g,10);case"float":return parseFloat(g);case"boolean":if(g.toLowerCase()=="true"){return true}else{if(g=="1"){return true}}return false}return g}function a(f){switch(f.toLowerCase()){case"blue":return parseInt("0000FF",16);case"green":return parseInt("00FF00",16);case"red":return parseInt("FF0000",16);case"cyan":return parseInt("00FFFF",16);case"magenta":return parseInt("FF00FF",16);case"yellow":return parseInt("FFFF00",16);case"black":return parseInt("000000",16);case"white":return parseInt("FFFFFF",16);default:f=f.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(f.length==3){f=f.charAt(0)+f.charAt(0)+f.charAt(1)+f.charAt(1)+f.charAt(2)+f.charAt(2)}return parseInt(f,16)}return parseInt("000000",16)}})(jwplayer);(function(a){a.utils.parsers=function(){};a.utils.parsers.localName=function(b){if(!b){return""}else{if(b.localName){return b.localName}else{if(b.baseName){return b.baseName}else{return""}}}};a.utils.parsers.textContent=function(b){if(!b){return""}else{if(b.textContent){return b.textContent}else{if(b.text){return b.text}else{return""}}}}})(jwplayer);(function(a){a.utils.parsers.jwparser=function(){};a.utils.parsers.jwparser.PREFIX="jwplayer";a.utils.parsers.jwparser.parseEntry=function(c,d){for(var b=0;b<c.childNodes.length;b++){if(c.childNodes[b].prefix==a.utils.parsers.jwparser.PREFIX){d[a.utils.parsers.localName(c.childNodes[b])]=a.utils.strings.serialize(a.utils.parsers.textContent(c.childNodes[b]));if(a.utils.parsers.localName(c.childNodes[b])=="file"&&d.levels){delete d.levels}}if(!d.file&&String(d.link).toLowerCase().indexOf("youtube")>-1){d.file=d.link}}return d};a.utils.parsers.jwparser.getProvider=function(c){if(c.type){return c.type}else{if(c.file.indexOf("youtube.com/w")>-1||c.file.indexOf("youtube.com/v")>-1||c.file.indexOf("youtu.be/")>-1){return"youtube"}else{if(c.streamer&&c.streamer.indexOf("rtmp")==0){return"rtmp"}else{if(c.streamer&&c.streamer.indexOf("http")==0){return"http"}else{var b=a.utils.strings.extension(c.file);if(extensions.hasOwnProperty(b)){return extensions[b]}}}}}return""}})(jwplayer);(function(a){a.utils.parsers.mediaparser=function(){};a.utils.parsers.mediaparser.PREFIX="media";a.utils.parsers.mediaparser.parseGroup=function(d,f){var e=false;for(var c=0;c<d.childNodes.length;c++){if(d.childNodes[c].prefix==a.utils.parsers.mediaparser.PREFIX){if(!a.utils.parsers.localName(d.childNodes[c])){continue}switch(a.utils.parsers.localName(d.childNodes[c]).toLowerCase()){case"content":if(!e){f.file=a.utils.strings.xmlAttribute(d.childNodes[c],"url")}if(a.utils.strings.xmlAttribute(d.childNodes[c],"duration")){f.duration=a.utils.strings.seconds(a.utils.strings.xmlAttribute(d.childNodes[c],"duration"))}if(a.utils.strings.xmlAttribute(d.childNodes[c],"start")){f.start=a.utils.strings.seconds(a.utils.strings.xmlAttribute(d.childNodes[c],"start"))}if(d.childNodes[c].childNodes&&d.childNodes[c].childNodes.length>0){f=a.utils.parsers.mediaparser.parseGroup(d.childNodes[c],f)}if(a.utils.strings.xmlAttribute(d.childNodes[c],"width")||a.utils.strings.xmlAttribute(d.childNodes[c],"bitrate")||a.utils.strings.xmlAttribute(d.childNodes[c],"url")){if(!f.levels){f.levels=[]}f.levels.push({width:a.utils.strings.xmlAttribute(d.childNodes[c],"width"),bitrate:a.utils.strings.xmlAttribute(d.childNodes[c],"bitrate"),file:a.utils.strings.xmlAttribute(d.childNodes[c],"url")})}break;case"title":f.title=a.utils.parsers.textContent(d.childNodes[c]);break;case"description":f.description=a.utils.parsers.textContent(d.childNodes[c]);break;case"keywords":f.tags=a.utils.parsers.textContent(d.childNodes[c]);break;case"thumbnail":f.image=a.utils.strings.xmlAttribute(d.childNodes[c],"url");break;case"credit":f.author=a.utils.parsers.textContent(d.childNodes[c]);break;case"player":var b=d.childNodes[c].url;if(b.indexOf("youtube.com")>=0||b.indexOf("youtu.be")>=0){e=true;f.file=a.utils.strings.xmlAttribute(d.childNodes[c],"url")}break;case"group":a.utils.parsers.mediaparser.parseGroup(d.childNodes[c],f);break}}}return f}})(jwplayer);(function(b){b.utils.parsers.rssparser=function(){};b.utils.parsers.rssparser.parse=function(f){var c=[];for(var e=0;e<f.childNodes.length;e++){if(b.utils.parsers.localName(f.childNodes[e]).toLowerCase()=="channel"){for(var d=0;d<f.childNodes[e].childNodes.length;d++){if(b.utils.parsers.localName(f.childNodes[e].childNodes[d]).toLowerCase()=="item"){c.push(a(f.childNodes[e].childNodes[d]))}}}}return c};function a(d){var e={};for(var c=0;c<d.childNodes.length;c++){if(!b.utils.parsers.localName(d.childNodes[c])){continue}switch(b.utils.parsers.localName(d.childNodes[c]).toLowerCase()){case"enclosure":e.file=b.utils.strings.xmlAttribute(d.childNodes[c],"url");break;case"title":e.title=b.utils.parsers.textContent(d.childNodes[c]);break;case"pubdate":e.date=b.utils.parsers.textContent(d.childNodes[c]);break;case"description":e.description=b.utils.parsers.textContent(d.childNodes[c]);break;case"link":e.link=b.utils.parsers.textContent(d.childNodes[c]);break;case"category":if(e.tags){e.tags+=b.utils.parsers.textContent(d.childNodes[c])}else{e.tags=b.utils.parsers.textContent(d.childNodes[c])}break}}e=b.utils.parsers.mediaparser.parseGroup(d,e);e=b.utils.parsers.jwparser.parseEntry(d,e);return new b.html5.playlistitem(e)}})(jwplayer);(function(a){var c={};var b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,f,e){var d=a.utils.getPluginName(h);if(c[d]){c[d].registerPlugin(h,f,e)}else{a.utils.log("A plugin ("+h+") was registered with the player that was not loaded. Please check your configuration.");for(var g in b){b[g].pluginFailed()}}}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]}}})(jwplayer);(function(a){a.plugins.pluginmodes={FLASH:"FLASH",JAVASCRIPT:"JAVASCRIPT",HYBRID:"HYBRID"};a.plugins.plugin=function(b){var d="http://plugins.longtailvideo.com";var j=a.utils.loaderstatus.NEW;var k;var h;var l;var c=new a.events.eventdispatcher();a.utils.extend(this,c);function e(){switch(a.utils.getPluginPathType(b)){case a.utils.pluginPathType.ABSOLUTE:return b;case a.utils.pluginPathType.RELATIVE:return a.utils.getAbsolutePath(b,window.location.href);case a.utils.pluginPathType.CDN:var o=a.utils.getPluginName(b);var n=a.utils.getPluginVersion(b);var m=(window.location.href.indexOf("https://")==0)?d.replace("http://","https://secure"):d;return m+"/"+a.version.split(".")[0]+"/"+o+"/"+o+(n!==""?("-"+n):"")+".js"}}function g(m){l=setTimeout(function(){j=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)},1000)}function f(m){j=a.utils.loaderstatus.ERROR;c.sendEvent(a.events.ERROR)}this.load=function(){if(j==a.utils.loaderstatus.NEW){if(b.lastIndexOf(".swf")>0){k=b;j=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE);return}j=a.utils.loaderstatus.LOADING;var m=new a.utils.scriptloader(e());m.addEventListener(a.events.COMPLETE,g);m.addEventListener(a.events.ERROR,f);m.load()}};this.registerPlugin=function(o,n,m){if(l){clearTimeout(l);l=undefined}if(n&&m){k=m;h=n}else{if(typeof n=="string"){k=n}else{if(typeof n=="function"){h=n}else{if(!n&&!m){k=o}}}}j=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)};this.getStatus=function(){return j};this.getPluginName=function(){return a.utils.getPluginName(b)};this.getFlashPath=function(){if(k){switch(a.utils.getPluginPathType(k)){case a.utils.pluginPathType.ABSOLUTE:return k;case a.utils.pluginPathType.RELATIVE:if(b.lastIndexOf(".swf")>0){return a.utils.getAbsolutePath(k,window.location.href)}return a.utils.getAbsolutePath(k,e());case a.utils.pluginPathType.CDN:if(k.indexOf("-")>-1){return k+"h"}return k+"-h"}}return null};this.getJS=function(){return h};this.getPluginmode=function(){if(typeof k!="undefined"&&typeof h!="undefined"){return a.plugins.pluginmodes.HYBRID}else{if(typeof k!="undefined"){return a.plugins.pluginmodes.FLASH}else{if(typeof h!="undefined"){return a.plugins.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(n,m,o){return new h(n,m,o)};this.getURL=function(){return b}}})(jwplayer);(function(a){a.plugins.pluginloader=function(h,e){var g={};var k=a.utils.loaderstatus.NEW;var d=false;var b=false;var c=new a.events.eventdispatcher();a.utils.extend(this,c);function f(){if(!b){b=true;k=a.utils.loaderstatus.COMPLETE;c.sendEvent(a.events.COMPLETE)}}function j(){if(!b){var m=0;for(plugin in g){var l=g[plugin].getStatus();if(l==a.utils.loaderstatus.LOADING||l==a.utils.loaderstatus.NEW){m++}}if(m==0){f()}}}this.setupPlugins=function(n,l,s){var m={length:0,plugins:{}};var p={length:0,plugins:{}};for(var o in g){var q=g[o].getPluginName();if(g[o].getFlashPath()){m.plugins[g[o].getFlashPath()]=l.plugins[o];m.plugins[g[o].getFlashPath()].pluginmode=g[o].getPluginmode();m.length++}if(g[o].getJS()){var r=document.createElement("div");r.id=n.id+"_"+q;r.style.position="absolute";r.style.zIndex=p.length+10;p.plugins[q]=g[o].getNewInstance(n,l.plugins[o],r);p.length++;if(typeof p.plugins[q].resize!="undefined"){n.onReady(s(p.plugins[q],r,true));n.onResize(s(p.plugins[q],r))}}}n.plugins=p.plugins;return m};this.load=function(){k=a.utils.loaderstatus.LOADING;d=true;for(var l in e){if(a.utils.exists(l)){g[l]=h.addPlugin(l);g[l].addEventListener(a.events.COMPLETE,j);g[l].addEventListener(a.events.ERROR,j)}}for(l in g){g[l].load()}d=false;j()};this.pluginFailed=function(){f()};this.getStatus=function(){return k}}})(jwplayer);(function(b){var a=[];b.api=function(d){this.container=d;this.id=d.id;var m={};var t={};var p={};var c=[];var g=undefined;var k=false;var h=[];var r=undefined;var o=b.utils.getOuterHTML(d);var s={};var j={};this.getBuffer=function(){return this.callInternal("jwGetBuffer")};this.getContainer=function(){return this.container};function e(v,u){return function(A,w,x,y){if(v.renderingMode=="flash"||v.renderingMode=="html5"){var z;if(w){j[A]=w;z="jwplayer('"+v.id+"').callback('"+A+"')"}else{if(!w&&j[A]){delete j[A]}}g.jwDockSetButton(A,z,x,y)}return u}}this.getPlugin=function(u){var w=this;var v={};if(u=="dock"){return b.utils.extend(v,{setButton:e(w,v),show:function(){w.callInternal("jwDockShow");return v},hide:function(){w.callInternal("jwDockHide");return v},onShow:function(x){w.componentListener("dock",b.api.events.JWPLAYER_COMPONENT_SHOW,x);return v},onHide:function(x){w.componentListener("dock",b.api.events.JWPLAYER_COMPONENT_HIDE,x);return v}})}else{if(u=="controlbar"){return b.utils.extend(v,{show:function(){w.callInternal("jwControlbarShow");return v},hide:function(){w.callInternal("jwControlbarHide");return v},onShow:function(x){w.componentListener("controlbar",b.api.events.JWPLAYER_COMPONENT_SHOW,x);return v},onHide:function(x){w.componentListener("controlbar",b.api.events.JWPLAYER_COMPONENT_HIDE,x);return v}})}else{if(u=="display"){return b.utils.extend(v,{show:function(){w.callInternal("jwDisplayShow");return v},hide:function(){w.callInternal("jwDisplayHide");return v},onShow:function(x){w.componentListener("display",b.api.events.JWPLAYER_COMPONENT_SHOW,x);return v},onHide:function(x){w.componentListener("display",b.api.events.JWPLAYER_COMPONENT_HIDE,x);return v}})}else{return this.plugins[u]}}}};this.callback=function(u){if(j[u]){return j[u]()}};this.getDuration=function(){return this.callInternal("jwGetDuration")};this.getFullscreen=function(){return this.callInternal("jwGetFullscreen")};this.getHeight=function(){return this.callInternal("jwGetHeight")};this.getLockState=function(){return this.callInternal("jwGetLockState")};this.getMeta=function(){return this.getItemMeta()};this.getMute=function(){return this.callInternal("jwGetMute")};this.getPlaylist=function(){var v=this.callInternal("jwGetPlaylist");if(this.renderingMode=="flash"){b.utils.deepReplaceKeyName(v,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var u=0;u<v.length;u++){if(!b.utils.exists(v[u].index)){v[u].index=u}}return v};this.getPlaylistItem=function(u){if(!b.utils.exists(u)){u=this.getCurrentItem()}return this.getPlaylist()[u]};this.getPosition=function(){return this.callInternal("jwGetPosition")};this.getRenderingMode=function(){return this.renderingMode};this.getState=function(){return this.callInternal("jwGetState")};this.getVolume=function(){return this.callInternal("jwGetVolume")};this.getWidth=function(){return this.callInternal("jwGetWidth")};this.setFullscreen=function(u){if(!b.utils.exists(u)){this.callInternal("jwSetFullscreen",!this.callInternal("jwGetFullscreen"))}else{this.callInternal("jwSetFullscreen",u)}return this};this.setMute=function(u){if(!b.utils.exists(u)){this.callInternal("jwSetMute",!this.callInternal("jwGetMute"))}else{this.callInternal("jwSetMute",u)}return this};this.lock=function(){return this};this.unlock=function(){return this};this.load=function(u){this.callInternal("jwLoad",u);return this};this.playlistItem=function(u){this.callInternal("jwPlaylistItem",u);return this};this.playlistPrev=function(){this.callInternal("jwPlaylistPrev");return this};this.playlistNext=function(){this.callInternal("jwPlaylistNext");return this};this.resize=function(v,u){if(this.renderingMode=="html5"){g.jwResize(v,u)}else{this.container.width=v;this.container.height=u;var w=document.getElementById(this.id+"_wrapper");if(w){w.style.width=v+"px";w.style.height=u+"px"}}return this};this.play=function(u){if(typeof u=="undefined"){u=this.getState();if(u==b.api.events.state.PLAYING||u==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPlay",u)}return this};this.pause=function(u){if(typeof u=="undefined"){u=this.getState();if(u==b.api.events.state.PLAYING||u==b.api.events.state.BUFFERING){this.callInternal("jwPause")}else{this.callInternal("jwPlay")}}else{this.callInternal("jwPause",u)}return this};this.stop=function(){this.callInternal("jwStop");return this};this.seek=function(u){this.callInternal("jwSeek",u);return this};this.setVolume=function(u){this.callInternal("jwSetVolume",u);return this};this.loadInstream=function(v,u){r=new b.api.instream(this,g,v,u);return r};this.onBufferChange=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER,u)};this.onBufferFull=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,u)};this.onError=function(u){return this.eventListener(b.api.events.JWPLAYER_ERROR,u)};this.onFullscreen=function(u){return this.eventListener(b.api.events.JWPLAYER_FULLSCREEN,u)};this.onMeta=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_META,u)};this.onMute=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_MUTE,u)};this.onPlaylist=function(u){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,u)};this.onPlaylistItem=function(u){return this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,u)};this.onReady=function(u){return this.eventListener(b.api.events.API_READY,u)};this.onResize=function(u){return this.eventListener(b.api.events.JWPLAYER_RESIZE,u)};this.onComplete=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,u)};this.onSeek=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_SEEK,u)};this.onTime=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_TIME,u)};this.onVolume=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_VOLUME,u)};this.onBeforePlay=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BEFOREPLAY,u)};this.onBeforeComplete=function(u){return this.eventListener(b.api.events.JWPLAYER_MEDIA_BEFORECOMPLETE,u)};this.onBuffer=function(u){return this.stateListener(b.api.events.state.BUFFERING,u)};this.onPause=function(u){return this.stateListener(b.api.events.state.PAUSED,u)};this.onPlay=function(u){return this.stateListener(b.api.events.state.PLAYING,u)};this.onIdle=function(u){return this.stateListener(b.api.events.state.IDLE,u)};this.remove=function(){if(!k){throw"Cannot call remove() before player is ready";return}q(this)};function q(u){h=[];if(b.utils.getOuterHTML(u.container)!=o){b.api.destroyPlayer(u.id,o)}}this.setup=function(v){if(b.embed){var u=this.id;q(this);var w=b(u);w.config=v;return new b.embed(w)}return this};this.registerPlugin=function(w,v,u){b.plugins.registerPlugin(w,v,u)};this.setPlayer=function(u,v){g=u;this.renderingMode=v};this.stateListener=function(u,v){if(!t[u]){t[u]=[];this.eventListener(b.api.events.JWPLAYER_PLAYER_STATE,f(u))}t[u].push(v);return this};this.detachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwDetachMedia")}};this.attachMedia=function(){if(this.renderingMode=="html5"){return this.callInternal("jwAttachMedia")}};function f(u){return function(w){var v=w.newstate,y=w.oldstate;if(v==u){var x=t[v];if(x){for(var z=0;z<x.length;z++){if(typeof x[z]=="function"){x[z].call(this,{oldstate:y,newstate:v})}}}}}}this.componentListener=function(u,v,w){if(!p[u]){p[u]={}}if(!p[u][v]){p[u][v]=[];this.eventListener(v,l(u,v))}p[u][v].push(w);return this};function l(u,v){return function(x){if(u==x.component){var w=p[u][v];if(w){for(var y=0;y<w.length;y++){if(typeof w[y]=="function"){w[y].call(this,x)}}}}}}this.addInternalListener=function(u,v){try{u.jwAddEventListener(v,'function(dat) { jwplayer("'+this.id+'").dispatchEvent("'+v+'", dat); }')}catch(w){b.utils.log("Could not add internal listener")}};this.eventListener=function(u,v){if(!m[u]){m[u]=[];if(g&&k){this.addInternalListener(g,u)}}m[u].push(v);return this};this.dispatchEvent=function(w){if(m[w]){var v=_utils.translateEventResponse(w,arguments[1]);for(var u=0;u<m[w].length;u++){if(typeof m[w][u]=="function"){m[w][u].call(this,v)}}}};this.dispatchInstreamEvent=function(u){if(r){r.dispatchEvent(u,arguments)}};this.callInternal=function(){if(k){var w=arguments[0],u=[];for(var v=1;v<arguments.length;v++){u.push(arguments[v])}if(typeof g!="undefined"&&typeof g[w]=="function"){if(u.length==2){return(g[w])(u[0],u[1])}else{if(u.length==1){return(g[w])(u[0])}else{return(g[w])()}}}return null}else{h.push(arguments)}};this.playerReady=function(v){k=true;if(!g){this.setPlayer(document.getElementById(v.id))}this.container=document.getElementById(this.id);for(var u in m){this.addInternalListener(g,u)}this.eventListener(b.api.events.JWPLAYER_PLAYLIST_ITEM,function(w){s={}});this.eventListener(b.api.events.JWPLAYER_MEDIA_META,function(w){b.utils.extend(s,w.metadata)});this.dispatchEvent(b.api.events.API_READY);while(h.length>0){this.callInternal.apply(this,h.shift())}};this.getItemMeta=function(){return s};this.getCurrentItem=function(){return this.callInternal("jwGetPlaylistIndex")};function n(w,y,x){var u=[];if(!y){y=0}if(!x){x=w.length-1}for(var v=y;v<=x;v++){u.push(w[v])}return u}return this};b.api.selectPlayer=function(d){var c;if(!b.utils.exists(d)){d=0}if(d.nodeType){c=d}else{if(typeof d=="string"){c=document.getElementById(d)}}if(c){var e=b.api.playerById(c.id);if(e){return e}else{return b.api.addPlayer(new b.api(c))}}else{if(typeof d=="number"){return b.getPlayers()[d]}}return null};b.api.events={API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"};b.api.events.state={BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"};b.api.playerById=function(d){for(var c=0;c<a.length;c++){if(a[c].id==d){return a[c]}}return null};b.api.addPlayer=function(c){for(var d=0;d<a.length;d++){if(a[d]==c){return c}}a.push(c);return c};b.api.destroyPlayer=function(h,d){var g=-1;for(var l=0;l<a.length;l++){if(a[l].id==h){g=l;continue}}if(g>=0){try{a[g].callInternal("jwDestroy")}catch(k){}var c=document.getElementById(a[g].id);if(document.getElementById(a[g].id+"_wrapper")){c=document.getElementById(a[g].id+"_wrapper")}if(c){if(d){b.utils.setOuterHTML(c,d)}else{var j=document.createElement("div");var f=c.id;if(c.id.indexOf("_wrapper")==c.id.length-8){newID=c.id.substring(0,c.id.length-8)}j.setAttribute("id",f);c.parentNode.replaceChild(j,c)}}a.splice(g,1)}return null};b.getPlayers=function(){return a.slice(0)}})(jwplayer);var _userPlayerReady=(typeof playerReady=="function")?playerReady:undefined;playerReady=function(b){var a=jwplayer.api.playerById(b.id);if(a){a.playerReady(b)}else{jwplayer.api.selectPlayer(b.id).playerReady(b)}if(_userPlayerReady){_userPlayerReady.call(this,b)}};(function(a){a.api.instream=function(c,j,n,q){var h=c;var b=j;var g=n;var k=q;var e={};var p={};function f(){h.callInternal("jwLoadInstream",n,q)}function m(r,s){b.jwInstreamAddEventListener(s,'function(dat) { jwplayer("'+h.id+'").dispatchInstreamEvent("'+s+'", dat); }')}function d(r,s){if(!e[r]){e[r]=[];m(b,r)}e[r].push(s);return this}function o(r,s){if(!p[r]){p[r]=[];d(a.api.events.JWPLAYER_PLAYER_STATE,l(r))}p[r].push(s);return this}function l(r){return function(t){var s=t.newstate,v=t.oldstate;if(s==r){var u=p[s];if(u){for(var w=0;w<u.length;w++){if(typeof u[w]=="function"){u[w].call(this,{oldstate:v,newstate:s,type:t.type})}}}}}}this.dispatchEvent=function(u,t){if(e[u]){var s=_utils.translateEventResponse(u,t[1]);for(var r=0;r<e[u].length;r++){if(typeof e[u][r]=="function"){e[u][r].call(this,s)}}}};this.onError=function(r){return d(a.api.events.JWPLAYER_ERROR,r)};this.onFullscreen=function(r){return d(a.api.events.JWPLAYER_FULLSCREEN,r)};this.onMeta=function(r){return d(a.api.events.JWPLAYER_MEDIA_META,r)};this.onMute=function(r){return d(a.api.events.JWPLAYER_MEDIA_MUTE,r)};this.onComplete=function(r){return d(a.api.events.JWPLAYER_MEDIA_COMPLETE,r)};this.onSeek=function(r){return d(a.api.events.JWPLAYER_MEDIA_SEEK,r)};this.onTime=function(r){return d(a.api.events.JWPLAYER_MEDIA_TIME,r)};this.onVolume=function(r){return d(a.api.events.JWPLAYER_MEDIA_VOLUME,r)};this.onBuffer=function(r){return o(a.api.events.state.BUFFERING,r)};this.onPause=function(r){return o(a.api.events.state.PAUSED,r)};this.onPlay=function(r){return o(a.api.events.state.PLAYING,r)};this.onIdle=function(r){return o(a.api.events.state.IDLE,r)};this.onInstreamClick=function(r){return d(a.api.events.JWPLAYER_INSTREAM_CLICK,r)};this.onInstreamDestroyed=function(r){return d(a.api.events.JWPLAYER_INSTREAM_DESTROYED,r)};this.play=function(r){b.jwInstreamPlay(r)};this.pause=function(r){b.jwInstreamPause(r)};this.seek=function(r){b.jwInstreamSeek(r)};this.destroy=function(){b.jwInstreamDestroy()};this.getState=function(){return b.jwInstreamGetState()};this.getDuration=function(){return b.jwInstreamGetDuration()};this.getPosition=function(){return b.jwInstreamGetPosition()};f()}})(jwplayer);(function(a){var c=a.utils;a.embed=function(h){var k={width:400,height:300,components:{controlbar:{position:"over"}}};var g=c.mediaparser.parseMedia(h.container);var f=new a.embed.config(c.extend(k,g,h.config),this);var j=a.plugins.loadPlugins(h.id,f.plugins);function d(n,m){for(var l in m){if(typeof n[l]=="function"){(n[l]).call(n,m[l])}}}function e(){if(j.getStatus()==c.loaderstatus.COMPLETE){for(var n=0;n<f.modes.length;n++){if(f.modes[n].type&&a.embed[f.modes[n].type]){var p=f.modes[n].config;var t=f;if(p){t=c.extend(c.clone(f),p);var s=["file","levels","playlist"];for(var m=0;m<s.length;m++){var q=s[m];if(c.exists(p[q])){for(var l=0;l<s.length;l++){if(l!=m){var o=s[l];if(c.exists(t[o])&&!c.exists(p[o])){delete t[o]}}}}}}var r=new a.embed[f.modes[n].type](document.getElementById(h.id),f.modes[n],t,j,h);if(r.supportsConfig()){r.embed();d(h,f.events);return h}}}c.log("No suitable players found");new a.embed.logo(c.extend({hide:true},f.components.logo),"none",h.id)}}j.addEventListener(a.events.COMPLETE,e);j.addEventListener(a.events.ERROR,e);j.load();return h};function b(){if(!document.body){return setTimeout(b,15)}var d=c.selectors.getElementsByTagAndClass("video","jwplayer");for(var e=0;e<d.length;e++){var f=d[e];if(f.id==""){f.id="jwplayer_"+Math.round(Math.random()*100000)}a(f.id).setup({})}}b()})(jwplayer);(function(e){var k=e.utils;function h(m){var l=[{type:"flash",src:m?m:"/jwplayer/player.swf"},{type:"html5"},{type:"download"}];if(k.isAndroid()){l[0]=l.splice(1,1,l[0])[0]}return l}var a={players:"modes",autoplay:"autostart"};function b(o){var n=o.toLowerCase();var m=["left","right","top","bottom"];for(var l=0;l<m.length;l++){if(n==m[l]){return true}}return false}function c(m){var l=false;l=(m instanceof Array)||(typeof m=="object"&&!m.position&&!m.size);return l}function j(l){if(typeof l=="string"){if(parseInt(l).toString()==l||l.toLowerCase().indexOf("px")>-1){return parseInt(l)}}return l}var g=["playlist","dock","controlbar","logo","display"];function f(l){var o={};switch(k.typeOf(l.plugins)){case"object":for(var n in l.plugins){o[k.getPluginName(n)]=n}break;case"string":var p=l.plugins.split(",");for(var m=0;m<p.length;m++){o[k.getPluginName(p[m])]=p[m]}break}return o}function d(p,o,n,l){if(k.typeOf(p[o])!="object"){p[o]={}}var m=p[o][n];if(k.typeOf(m)!="object"){p[o][n]=m={}}if(l){if(o=="plugins"){var q=k.getPluginName(n);m[l]=p[q+"."+l];delete p[q+"."+l]}else{m[l]=p[n+"."+l];delete p[n+"."+l]}}}e.embed.deserialize=function(m){var n=f(m);for(var l in n){d(m,"plugins",n[l])}for(var q in m){if(q.indexOf(".")>-1){var p=q.split(".");var o=p[0];var q=p[1];if(k.isInArray(g,o)){d(m,"components",o,q)}else{if(n[o]){d(m,"plugins",n[o],q)}}}}return m};e.embed.config=function(l,v){var u=k.extend({},l);var s;if(c(u.playlist)){s=u.playlist;delete u.playlist}u=e.embed.deserialize(u);u.height=j(u.height);u.width=j(u.width);if(typeof u.plugins=="string"){var m=u.plugins.split(",");if(typeof u.plugins!="object"){u.plugins={}}for(var q=0;q<m.length;q++){var r=k.getPluginName(m[q]);if(typeof u[r]=="object"){u.plugins[m[q]]=u[r];delete u[r]}else{u.plugins[m[q]]={}}}}for(var t=0;t<g.length;t++){var p=g[t];if(k.exists(u[p])){if(typeof u[p]!="object"){if(!u.components[p]){u.components[p]={}}if(p=="logo"){u.components[p].file=u[p]}else{u.components[p].position=u[p]}delete u[p]}else{if(!u.components[p]){u.components[p]={}}k.extend(u.components[p],u[p]);delete u[p]}}if(typeof u[p+"size"]!="undefined"){if(!u.components[p]){u.components[p]={}}u.components[p].size=u[p+"size"];delete u[p+"size"]}}if(typeof u.icons!="undefined"){if(!u.components.display){u.components.display={}}u.components.display.icons=u.icons;delete u.icons}for(var o in a){if(u[o]){if(!u[a[o]]){u[a[o]]=u[o]}delete u[o]}}var n;if(u.flashplayer&&!u.modes){n=h(u.flashplayer);delete u.flashplayer}else{if(u.modes){if(typeof u.modes=="string"){n=h(u.modes)}else{if(u.modes instanceof Array){n=u.modes}else{if(typeof u.modes=="object"&&u.modes.type){n=[u.modes]}}}delete u.modes}else{n=h()}}u.modes=n;if(s){u.playlist=s}return u}})(jwplayer);(function(a){a.embed.download=function(c,g,b,d,f){this.embed=function(){var k=a.utils.extend({},b);var q={};var j=b.width?b.width:480;if(typeof j!="number"){j=parseInt(j,10)}var m=b.height?b.height:320;if(typeof m!="number"){m=parseInt(m,10)}var u,o,n;var s={};if(b.playlist&&b.playlist.length){s.file=b.playlist[0].file;o=b.playlist[0].image;s.levels=b.playlist[0].levels}else{s.file=b.file;o=b.image;s.levels=b.levels}if(s.file){u=s.file}else{if(s.levels&&s.levels.length){u=s.levels[0].file}}n=u?"pointer":"auto";var l={display:{style:{cursor:n,width:j,height:m,backgroundColor:"#000",position:"relative",textDecoration:"none",border:"none",display:"block"}},display_icon:{style:{cursor:n,position:"absolute",display:u?"block":"none",top:0,left:0,border:0,margin:0,padding:0,zIndex:3,width:50,height:50,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNrs18ENgjAYhmFouDOCcQJGcARHgE10BDcgTOIosAGwQOuPwaQeuFRi2p/3Sb6EC5L3QCxZBgAAAOCorLW1zMn65TrlkH4NcV7QNcUQt7Gn7KIhxA+qNIR81spOGkL8oFJDyLJRdosqKDDkK+iX5+d7huzwM40xptMQMkjIOeRGo+VkEVvIPfTGIpKASfYIfT9iCHkHrBEzf4gcUQ56aEzuGK/mw0rHpy4AAACAf3kJMACBxjAQNRckhwAAAABJRU5ErkJggg==)"}},display_iconBackground:{style:{cursor:n,position:"absolute",display:u?"block":"none",top:((m-50)/2),left:((j-50)/2),border:0,width:50,height:50,margin:0,padding:0,zIndex:2,backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEpJREFUeNrszwENADAIA7DhX8ENoBMZ5KR10EryckCJiIiIiIiIiIiIiIiIiIiIiIh8GmkRERERERERERERERERERERERGRHSPAAPlXH1phYpYaAAAAAElFTkSuQmCC)"}},display_image:{style:{width:j,height:m,display:o?"block":"none",position:"absolute",cursor:n,left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1,border:"none"}}};var h=function(v,x,y){var w=document.createElement(v);if(y){w.id=y}else{w.id=c.id+"_jwplayer_"+x}a.utils.css(w,l[x].style);return w};q.display=h("a","display",c.id);if(u){q.display.setAttribute("href",a.utils.getAbsolutePath(u))}q.display_image=h("img","display_image");q.display_image.setAttribute("alt","Click to download...");if(o){q.display_image.setAttribute("src",a.utils.getAbsolutePath(o))}if(true){q.display_icon=h("div","display_icon");q.display_iconBackground=h("div","display_iconBackground");q.display.appendChild(q.display_image);q.display_iconBackground.appendChild(q.display_icon);q.display.appendChild(q.display_iconBackground)}_css=a.utils.css;_hide=function(v){_css(v,{display:"none"})};function r(v){_imageWidth=q.display_image.naturalWidth;_imageHeight=q.display_image.naturalHeight;t()}function t(){a.utils.stretch(a.utils.stretching.UNIFORM,q.display_image,j,m,_imageWidth,_imageHeight)}q.display_image.onerror=function(v){_hide(q.display_image)};q.display_image.onload=r;c.parentNode.replaceChild(q.display,c);var p=(b.plugins&&b.plugins.logo)?b.plugins.logo:{};q.display.appendChild(new a.embed.logo(b.components.logo,"download",c.id));f.container=document.getElementById(f.id);f.setPlayer(q.display,"download")};this.supportsConfig=function(){if(b){var j=a.utils.getFirstPlaylistItemFromConfig(b);if(typeof j.file=="undefined"&&typeof j.levels=="undefined"){return true}else{if(j.file){return e(j.file,j.provider,j.playlistfile)}else{if(j.levels&&j.levels.length){for(var h=0;h<j.levels.length;h++){if(j.levels[h].file&&e(j.levels[h].file,j.provider,j.playlistfile)){return true}}}}}}else{return true}};function e(j,l,h){if(h){return false}var k=["image","sound","youtube","http"];if(l&&(k.toString().indexOf(l)>-1)){return true}if(!l||(l&&l=="video")){var m=a.utils.extension(j);if(m&&a.utils.extensionmap[m]){return true}}return false}}})(jwplayer);(function(a){a.embed.flash=function(f,g,l,e,j){function m(o,n,p){var q=document.createElement("param");q.setAttribute("name",n);q.setAttribute("value",p);o.appendChild(q)}function k(o,p,n){return function(q){if(n){document.getElementById(j.id+"_wrapper").appendChild(p)}var s=document.getElementById(j.id).getPluginConfig("display");o.resize(s.width,s.height);var r={left:s.x,top:s.y};a.utils.css(p,r)}}function d(p){if(!p){return{}}var r={};for(var o in p){var n=p[o];for(var q in n){r[o+"."+q]=n[q]}}return r}function h(q,p){if(q[p]){var s=q[p];for(var o in s){var n=s[o];if(typeof n=="string"){if(!q[o]){q[o]=n}}else{for(var r in n){if(!q[o+"."+r]){q[o+"."+r]=n[r]}}}}delete q[p]}}function b(q){if(!q){return{}}var t={},s=[];for(var n in q){var p=a.utils.getPluginName(n);var o=q[n];s.push(n);for(var r in o){t[p+"."+r]=o[r]}}t.plugins=s.join(",");return t}function c(p){var n=p.netstreambasepath?"":"netstreambasepath="+encodeURIComponent(window.location.href.split("#")[0])+"&";for(var o in p){if(typeof(p[o])=="object"){n+=o+"="+encodeURIComponent("[[JSON]]"+a.utils.strings.jsonToString(p[o]))+"&"}else{n+=o+"="+encodeURIComponent(p[o])+"&"}}return n.substring(0,n.length-1)}this.embed=function(){l.id=j.id;var A;var r=a.utils.extend({},l);var o=r.width;var y=r.height;if(f.id+"_wrapper"==f.parentNode.id){A=document.getElementById(f.id+"_wrapper")}else{A=document.createElement("div");A.id=f.id+"_wrapper";a.utils.wrap(f,A);a.utils.css(A,{position:"relative",width:o,height:y})}var p=e.setupPlugins(j,r,k);if(p.length>0){a.utils.extend(r,b(p.plugins))}else{delete r.plugins}var s=["height","width","modes","events"];for(var v=0;v<s.length;v++){delete r[s[v]]}var q="opaque";if(r.wmode){q=r.wmode}h(r,"components");h(r,"providers");if(typeof r["dock.position"]!="undefined"){if(r["dock.position"].toString().toLowerCase()=="false"){r.dock=r["dock.position"];delete r["dock.position"]}}var x=a.utils.getCookies();for(var n in x){if(typeof(r[n])=="undefined"){r[n]=x[n]}}var z="#000000";var u;if(a.utils.isIE()){var w='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" bgcolor="'+z+'" width="100%" height="100%" id="'+f.id+'" name="'+f.id+'" tabindex=0"">';w+='<param name="movie" value="'+g.src+'">';w+='<param name="allowfullscreen" value="true">';w+='<param name="allowscriptaccess" value="always">';w+='<param name="seamlesstabbing" value="true">';w+='<param name="wmode" value="'+q+'">';w+='<param name="flashvars" value="'+c(r)+'">';w+="</object>";a.utils.setOuterHTML(f,w);u=document.getElementById(f.id)}else{var t=document.createElement("object");t.setAttribute("type","application/x-shockwave-flash");t.setAttribute("data",g.src);t.setAttribute("width","100%");t.setAttribute("height","100%");t.setAttribute("bgcolor","#000000");t.setAttribute("id",f.id);t.setAttribute("name",f.id);t.setAttribute("tabindex",0);m(t,"allowfullscreen","true");m(t,"allowscriptaccess","always");m(t,"seamlesstabbing","true");m(t,"wmode",q);m(t,"flashvars",c(r));f.parentNode.replaceChild(t,f);u=t}j.container=u;j.setPlayer(u,"flash")};this.supportsConfig=function(){if(a.utils.hasFlash()){if(l){var o=a.utils.getFirstPlaylistItemFromConfig(l);if(typeof o.file=="undefined"&&typeof o.levels=="undefined"){return true}else{if(o.file){return flashCanPlay(o.file,o.provider)}else{if(o.levels&&o.levels.length){for(var n=0;n<o.levels.length;n++){if(o.levels[n].file&&flashCanPlay(o.levels[n].file,o.provider)){return true}}}}}}else{return true}}return false};flashCanPlay=function(n,p){var o=["video","http","sound","image"];if(p&&(o.toString().indexOf(p)<0)){return true}var q=a.utils.extension(n);if(!q){return true}if(a.utils.exists(a.utils.extensionmap[q])&&!a.utils.exists(a.utils.extensionmap[q].flash)){return false}return true}}})(jwplayer);(function(a){a.embed.html5=function(c,g,b,d,f){function e(j,k,h){return function(l){var m=document.getElementById(c.id+"_displayarea");if(h){m.appendChild(k)}j.resize(m.clientWidth,m.clientHeight);k.left=m.style.left;k.top=m.style.top}}this.embed=function(){if(a.html5){d.setupPlugins(f,b,e);c.innerHTML="";var j=a.utils.extend({screencolor:"0x000000"},b);var h=["plugins","modes","events"];for(var k=0;k<h.length;k++){delete j[h[k]]}if(j.levels&&!j.sources){j.sources=b.levels}if(j.skin&&j.skin.toLowerCase().indexOf(".zip")>0){j.skin=j.skin.replace(/\.zip/i,".xml")}var l=new (a.html5(c)).setup(j);f.container=document.getElementById(f.id);f.setPlayer(l,"html5")}else{return null}};this.supportsConfig=function(){if(!!a.vid.canPlayType){if(b){var j=a.utils.getFirstPlaylistItemFromConfig(b);if(typeof j.file=="undefined"&&typeof j.levels=="undefined"){return true}else{if(j.file){return html5CanPlay(a.vid,j.file,j.provider,j.playlistfile)}else{if(j.levels&&j.levels.length){for(var h=0;h<j.levels.length;h++){if(j.levels[h].file&&html5CanPlay(a.vid,j.levels[h].file,j.provider,j.playlistfile)){return true}}}}}}else{return true}}return false};html5CanPlay=function(k,j,l,h){if(h){return false}if(l&&l=="youtube"){return true}if(l&&l!="video"&&l!="http"&&l!="sound"){return false}if(navigator.userAgent.match(/BlackBerry/i)!==null){return false}var m=a.utils.extension(j);if(!a.utils.exists(m)||!a.utils.exists(a.utils.extensionmap[m])){return true}if(!a.utils.exists(a.utils.extensionmap[m].html5)){return false}if(a.utils.isLegacyAndroid()&&m.match(/m4v|mp4/)){return true}return browserCanPlay(k,a.utils.extensionmap[m].html5)};browserCanPlay=function(j,h){if(!h){return true}if(j.canPlayType(h)){return true}else{if(h=="audio/mp3"&&navigator.userAgent.match(/safari/i)){return j.canPlayType("audio/mpeg")}else{return false}}}}})(jwplayer);(function(a){a.embed.logo=function(m,l,d){var j={prefix:"http://l.longtailvideo.com/"+l+"/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",linktarget:"_top",margin:8,out:0.5,over:1,timeout:5,hide:false,position:"bottom-left"};_css=a.utils.css;var b;var h;k();function k(){o();c();f()}function o(){if(j.prefix){var q=a.version.split(/\W/).splice(0,2).join("/");if(j.prefix.indexOf(q)<0){j.prefix+=q+"/"}}h=a.utils.extend({},j)}function p(){var s={border:"none",textDecoration:"none",position:"absolute",cursor:"pointer",zIndex:10};s.display=h.hide?"none":"block";var r=h.position.toLowerCase().split("-");for(var q in r){s[r[q]]=h.margin}return s}function c(){b=document.createElement("img");b.id=d+"_jwplayer_logo";b.style.display="none";b.onload=function(q){_css(b,p());e()};if(!h.file){return}if(h.file.indexOf("http://")===0){b.src=h.file}else{b.src=h.prefix+h.file}}if(!h.file){return}function f(){if(h.link){b.onmouseover=g;b.onmouseout=e;b.onclick=n}else{this.mouseEnabled=false}}function n(q){if(typeof q!="undefined"){q.preventDefault();q.stopPropagation()}if(h.link){window.open(h.link,h.linktarget)}return}function e(q){if(h.link){b.style.opacity=h.out}return}function g(q){if(h.hide){b.style.opacity=h.over}return}return b}})(jwplayer);(function(a){a.html5=function(b){var c=b;this.setup=function(d){a.utils.extend(this,new a.html5.api(c,d));return this};return this}})(jwplayer);(function(a){var d=a.utils;var b=d.css;var c=d.isIOS();a.html5.view=function(n,H,h){var m=n;var y=H;var j=h;var R;var g;var t;var o;var F;var P;var O;var E=false;var x=false;var A,N;var f,S,u;function L(){R=document.createElement("div");R.id=y.id;R.className=y.className;_videowrapper=document.createElement("div");_videowrapper.id=R.id+"_video_wrapper";y.id=R.id+"_video";b(R,{position:"relative",height:j.height,width:j.width,padding:0,backgroundColor:U(),zIndex:0});function U(){if(m.skin.getComponentSettings("display")&&m.skin.getComponentSettings("display").backgroundcolor){return m.skin.getComponentSettings("display").backgroundcolor}return parseInt("000000",16)}b(y,{width:"100%",height:"100%",top:0,left:0,zIndex:1,margin:"auto",display:"block"});b(_videowrapper,{overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0});d.wrap(y,R);d.wrap(y,_videowrapper);o=document.createElement("div");o.id=R.id+"_displayarea";R.appendChild(o);_instreamArea=document.createElement("div");_instreamArea.id=R.id+"_instreamarea";b(_instreamArea,{overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:100,background:"000000",display:"none"});R.appendChild(_instreamArea)}function K(){for(var U=0;U<j.plugins.order.length;U++){var V=j.plugins.order[U];if(d.exists(j.plugins.object[V].getDisplayElement)){j.plugins.object[V].height=d.parseDimension(j.plugins.object[V].getDisplayElement().style.height);j.plugins.object[V].width=d.parseDimension(j.plugins.object[V].getDisplayElement().style.width);j.plugins.config[V].currentPosition=j.plugins.config[V].position}}v()}function s(U){x=j.fullscreen}function p(U){if(S){return}switch(U.newstate){case a.api.events.state.PLAYING:if(j.getMedia()&&j.getMedia().hasChrome()){o.style.display="none"}break;default:o.style.display="block";break}l()}function v(V){var X=j.getMedia()?j.getMedia().getDisplayElement():null;if(d.exists(X)){if(O!=X){if(O&&O.parentNode){O.parentNode.replaceChild(X,O)}O=X}for(var U=0;U<j.plugins.order.length;U++){var W=j.plugins.order[U];if(d.exists(j.plugins.object[W].getDisplayElement)){j.plugins.config[W].currentPosition=j.plugins.config[W].position}}}G(j.width,j.height)}this.setup=function(){if(j&&j.getMedia()){y=j.getMedia().getDisplayElement()}L();K();m.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,p);m.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_LOADED,v);m.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_BEFOREPLAY,s);m.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_META,function(V){l()});var U;if(d.exists(window.onresize)){U=window.onresize}window.onresize=function(V){if(d.exists(U)){try{U(V)}catch(X){}}if(m.jwGetFullscreen()){if(!B()){var W=d.getBoundingClientRect(document.body);j.width=Math.abs(W.left)+Math.abs(W.right);j.height=window.innerHeight;G(j.width,j.height)}}else{G(j.width,j.height)}}};function M(U){switch(U.keyCode){case 27:if(m.jwGetFullscreen()){m.jwSetFullscreen(false)}break;case 32:if(m.jwGetState()!=a.api.events.state.IDLE&&m.jwGetState()!=a.api.events.state.PAUSED){m.jwPause()}else{m.jwPlay()}break}}function G(U,ad){if(R.style.display=="none"){return}var X=[].concat(j.plugins.order);X.reverse();F=X.length+2;if(x&&B()){try{if(j.fullscreen&&!j.getMedia().getDisplayElement().webkitDisplayingFullscreen){j.fullscreen=false}}catch(aa){}}if(!j.fullscreen){g=U;t=ad;if(typeof U=="string"&&U.indexOf("%")>0){g=d.getElementWidth(d.parentNode(R))*parseInt(U.replace("%"),"")/100}else{g=U}if(typeof ad=="string"&&ad.indexOf("%")>0){t=d.getElementHeight(d.parentNode(R))*parseInt(ad.replace("%"),"")/100}else{t=ad}var Y={top:0,bottom:0,left:0,right:0,width:g,height:t,position:"absolute"};b(o,Y);var ae={};var ab;try{ab=j.plugins.object.display.getDisplayElement()}catch(aa){}if(ab){ae.width=d.parseDimension(ab.style.width);ae.height=d.parseDimension(ab.style.height)}var ac=d.extend({},Y,ae,{zIndex:_instreamArea.style.zIndex,display:_instreamArea.style.display});b(_instreamArea,ac);b(R,{height:t,width:g});var Z=w(I,X);if(Z.length>0){F+=Z.length;var W=Z.indexOf("playlist"),V=Z.indexOf("controlbar");if(W>=0&&V>=0){Z[W]=Z.splice(V,1,Z[W])[0]}w(q,Z,true)}A=d.getElementWidth(o);N=d.getElementHeight(o)}else{if(!B()&&!c){w(e,X,true)}}l()}var r;function w(ab,X,Y){r=0;var Z=[];for(var W=0;W<X.length;W++){var aa=X[W];if(d.exists(j.plugins.object[aa].getDisplayElement)){if(j.plugins.config[aa].currentPosition!=a.html5.view.positions.NONE){var U=ab(aa,F--);if(!U){Z.push(aa)}else{var V=U.width;var ac=U.height;if(Y){delete U.width;delete U.height}b(j.plugins.object[aa].getDisplayElement(),U);j.plugins.object[aa].resize(V,ac)}}else{b(j.plugins.object[aa].getDisplayElement(),{display:"none"})}}}return Z}function I(V,W){if(d.exists(j.plugins.object[V].getDisplayElement)){if(j.plugins.config[V].position&&T(j.plugins.config[V].position)){if(!d.exists(j.plugins.object[V].getDisplayElement().parentNode)){R.appendChild(j.plugins.object[V].getDisplayElement())}var U=z(V);U.zIndex=W;return U}}return false}function q(U,V){if(!d.exists(j.plugins.object[U].getDisplayElement().parentNode)){o.appendChild(j.plugins.object[U].getDisplayElement())}return{position:"absolute",width:(d.getElementWidth(o)-d.parseDimension(o.style.right)),height:(d.getElementHeight(o)-d.parseDimension(o.style.bottom)),zIndex:V}}function e(U,V){return{position:"fixed",width:j.width,height:j.height,zIndex:V}}var l=this.resizeMedia=function(){o.style.position="absolute";var W=j.getMedia()?j.getMedia().getDisplayElement():u;if(!W){return}if(W&&W.tagName.toLowerCase()=="video"){if(!W.videoWidth||!W.videoHeight){W.style.width=o.style.width;W.style.height=o.style.height;return}W.style.position="absolute";d.fadeTo(W,1,0.25);if(W.parentNode){W.parentNode.style.left=o.style.left;W.parentNode.style.top=o.style.top}if(j.fullscreen&&m.jwGetStretching()==a.utils.stretching.EXACTFIT&&!d.isMobile()){var U=document.createElement("div");d.stretch(a.utils.stretching.UNIFORM,U,d.getElementWidth(o),d.getElementHeight(o),A,N);d.stretch(a.utils.stretching.EXACTFIT,W,d.parseDimension(U.style.width),d.parseDimension(U.style.height),W.videoWidth?W.videoWidth:400,W.videoHeight?W.videoHeight:300);b(W,{left:U.style.left,top:U.style.top})}else{if(!c){d.stretch(m.jwGetStretching(),W,d.getElementWidth(o),d.getElementHeight(o),W.videoWidth?W.videoWidth:400,W.videoHeight?W.videoHeight:300)}}}else{var V=j.plugins.object.display.getDisplayElement();if(V){j.getMedia().resize(d.parseDimension(V.style.width),d.parseDimension(V.style.height))}else{j.getMedia().resize(d.parseDimension(o.style.width),d.parseDimension(o.style.height))}}};var z=this.getComponentPosition=function(V){var W={position:"absolute",margin:0,padding:0,top:null};var U=j.plugins.config[V].currentPosition.toLowerCase();switch(U.toUpperCase()){case a.html5.view.positions.TOP:W.top=d.parseDimension(o.style.top);W.left=d.parseDimension(o.style.left);W.width=d.getElementWidth(o)-d.parseDimension(o.style.left)-d.parseDimension(o.style.right);W.height=j.plugins.object[V].height;o.style[U]=d.parseDimension(o.style[U])+j.plugins.object[V].height+"px";o.style.height=d.getElementHeight(o)-W.height+"px";break;case a.html5.view.positions.RIGHT:W.top=d.parseDimension(o.style.top);W.right=d.parseDimension(o.style.right);W.width=j.plugins.object[V].width;W.height=d.getElementHeight(o)-d.parseDimension(o.style.top)-d.parseDimension(o.style.bottom);o.style.width=d.getElementWidth(o)-W.width+"px";break;case a.html5.view.positions.BOTTOM:W.left=d.parseDimension(o.style.left);W.width=d.getElementWidth(o)-d.parseDimension(o.style.left)-d.parseDimension(o.style.right);W.height=j.plugins.object[V].height;W.bottom=d.parseDimension(o.style.bottom+r);r+=W.height;o.style.height=d.getElementHeight(o)-W.height+"px";break;case a.html5.view.positions.LEFT:W.top=d.parseDimension(o.style.top);W.left=d.parseDimension(o.style.left);W.width=j.plugins.object[V].width;W.height=d.getElementHeight(o)-d.parseDimension(o.style.top)-d.parseDimension(o.style.bottom);o.style[U]=d.parseDimension(o.style[U])+j.plugins.object[V].width+"px";o.style.width=d.getElementWidth(o)-W.width+"px";break;default:break}return W};this.resize=G;var J,k,Q;var C=this.fullscreen=function(W){if(c){return}var Y;try{Y=j.getMedia().getDisplayElement()}catch(X){}if(W){k=j.width;Q=j.height}var aa={position:"fixed",width:"100%",height:"100%",top:0,left:0,zIndex:2147483000},Z={position:"relative",height:k,width:Q,zIndex:0};if(B()&&Y&&Y.webkitSupportsFullscreen){if(W&&!Y.webkitDisplayingFullscreen){try{b(Y,aa);d.transform(Y);J=o.style.display;o.style.display="none";Y.webkitEnterFullscreen()}catch(V){}}else{if(!W){b(Y,Z);l();if(Y.webkitDisplayingFullscreen){try{Y.webkitExitFullscreen()}catch(V){}}o.style.display=J}}E=false}else{if(W){document.onkeydown=M;clearInterval(P);var U=d.getBoundingClientRect(document.body);j.width=Math.abs(U.left)+Math.abs(U.right);j.height=window.innerHeight;b(R,aa);aa.zIndex=1;if(j.getMedia()&&j.getMedia().getDisplayElement()){b(j.getMedia().getDisplayElement(),aa)}aa.zIndex=2;b(o,aa);E=true}else{document.onkeydown="";j.width=g;j.height=t;b(R,Z);E=false}G(j.width,j.height)}};function T(U){return([a.html5.view.positions.TOP,a.html5.view.positions.RIGHT,a.html5.view.positions.BOTTOM,a.html5.view.positions.LEFT].toString().indexOf(U.toUpperCase())>-1)}function B(){if(m.jwGetState()!=a.api.events.state.IDLE&&!E&&(j.getMedia()&&j.getMedia().getDisplayElement()&&j.getMedia().getDisplayElement().webkitSupportsFullscreen)&&d.useNativeFullscreen()){return true}return false}this.setupInstream=function(U,V){d.css(_instreamArea,{display:"block",position:"absolute"});o.style.display="none";_instreamArea.appendChild(U);u=V;S=true};var D=this.destroyInstream=function(){_instreamArea.style.display="none";_instreamArea.innerHTML="";o.style.display="block";u=null;S=false;G(j.width,j.height)}};a.html5.view.positions={TOP:"TOP",RIGHT:"RIGHT",BOTTOM:"BOTTOM",LEFT:"LEFT",OVER:"OVER",NONE:"NONE"}})(jwplayer);(function(a){var b={backgroundcolor:"",margin:10,font:"Arial,sans-serif",fontsize:10,fontcolor:parseInt("000000",16),fontstyle:"normal",fontweight:"bold",buttoncolor:parseInt("ffffff",16),position:a.html5.view.positions.BOTTOM,idlehide:false,hideplaylistcontrols:false,forcenextprev:false,layout:{left:{position:"left",elements:[{name:"play",type:"button"},{name:"divider",type:"divider"},{name:"prev",type:"button"},{name:"divider",type:"divider"},{name:"next",type:"button"},{name:"divider",type:"divider"},{name:"elapsed",type:"text"}]},center:{position:"center",elements:[{name:"time",type:"slider"}]},right:{position:"right",elements:[{name:"duration",type:"text"},{name:"blank",type:"button"},{name:"divider",type:"divider"},{name:"mute",type:"button"},{name:"volume",type:"slider"},{name:"divider",type:"divider"},{name:"fullscreen",type:"button"}]}}};_utils=a.utils;_css=_utils.css;_hide=function(c){_css(c,{display:"none"})};_show=function(c){_css(c,{display:"block"})};a.html5.controlbar=function(m,Y){window.controlbar=this;var l=m;var D=_utils.extend({},b,l.skin.getComponentSettings("controlbar"),Y);if(D.position==a.html5.view.positions.NONE||typeof a.html5.view.positions[D.position]=="undefined"){return}if(_utils.mapLength(l.skin.getComponentLayout("controlbar"))>0){D.layout=l.skin.getComponentLayout("controlbar")}var ag;var R;var af;var E;var w="none";var h;var k;var ah;var g;var f;var z;var S={};var q=false;var c={};var Q=-1;var ac;var j=false;var p;var d;var V=false;var G=false;var H;var aa=new a.html5.eventdispatcher();_utils.extend(this,aa);function K(){if(!ac){ac=l.skin.getSkinElement("controlbar","background");if(!ac){ac={width:0,height:0,src:null}}}return ac}function O(){af=0;E=0;R=0;if(!q){var ap={height:K().height,backgroundColor:D.backgroundcolor};ag=document.createElement("div");ag.id=l.id+"_jwplayer_controlbar";_css(ag,ap)}var ao=(l.skin.getSkinElement("controlbar","capLeft"));var an=(l.skin.getSkinElement("controlbar","capRight"));if(ao){y("capLeft","left",false,ag)}ad("background",ag,{position:"absolute",height:K().height,left:(ao?ao.width:0),zIndex:0},"img");if(K().src){S.background.src=K().src}ad("elements",ag,{position:"relative",height:K().height,zIndex:1});if(an){y("capRight","right",false,ag)}}this.getDisplayElement=function(){return ag};this.resize=function(ap,an){T();_utils.cancelAnimation(ag);f=ap;z=an;if(G!=l.jwGetFullscreen()){G=l.jwGetFullscreen();if(!G){Z()}d=undefined}var ao=x();J({id:l.id,duration:ah,position:k});v({id:l.id,bufferPercent:g});return ao};this.show=function(){if(j){j=false;_show(ag);W()}};this.hide=function(){if(!j){j=true;_hide(ag);ae()}};function r(){var ao=["timeSlider","volumeSlider","timeSliderRail","volumeSliderRail"];for(var ap in ao){var an=ao[ap];if(typeof S[an]!="undefined"){c[an]=_utils.getBoundingClientRect(S[an])}}}var e;function Z(an){if(j){return}clearTimeout(p);if(D.position==a.html5.view.positions.OVER||l.jwGetFullscreen()){switch(l.jwGetState()){case a.api.events.state.PAUSED:case a.api.events.state.IDLE:if(ag&&ag.style.opacity<1&&(!D.idlehide||_utils.exists(an))){e=false;setTimeout(function(){if(!e){X()}},100)}if(D.idlehide){p=setTimeout(function(){A()},2000)}break;default:e=true;if(an){X()}p=setTimeout(function(){A()},2000);break}}else{X()}}function A(){if(!j){ae();if(ag.style.opacity==1){_utils.cancelAnimation(ag);_utils.fadeTo(ag,0,0.1,1,0)}}}function X(){if(!j){W();if(ag.style.opacity==0){_utils.cancelAnimation(ag);_utils.fadeTo(ag,1,0.1,0,0)}}}function I(an){return function(){if(V&&d!=an){d=an;aa.sendEvent(an,{component:"controlbar",boundingRect:P()})}}}var W=I(a.api.events.JWPLAYER_COMPONENT_SHOW);var ae=I(a.api.events.JWPLAYER_COMPONENT_HIDE);function P(){if(D.position==a.html5.view.positions.OVER||l.jwGetFullscreen()){return _utils.getDimensions(ag)}else{return{x:0,y:0,width:0,height:0}}}function ad(ar,aq,ap,an){var ao;if(!q){if(!an){an="div"}ao=document.createElement(an);S[ar]=ao;ao.id=ag.id+"_"+ar;aq.appendChild(ao)}else{ao=document.getElementById(ag.id+"_"+ar)}if(_utils.exists(ap)){_css(ao,ap)}return ao}function N(){if(l.jwGetHeight()<=40){D.layout=_utils.clone(D.layout);for(var an=0;an<D.layout.left.elements.length;an++){if(D.layout.left.elements[an].name=="fullscreen"){D.layout.left.elements.splice(an,1)}}for(an=0;an<D.layout.right.elements.length;an++){if(D.layout.right.elements[an].name=="fullscreen"){D.layout.right.elements.splice(an,1)}}o()}am(D.layout.left);am(D.layout.center);am(D.layout.right)}function am(aq,an){var ar=aq.position=="right"?"right":"left";var ap=_utils.extend([],aq.elements);if(_utils.exists(an)){ap.reverse()}var aq=ad(aq.position+"Group",S.elements,{"float":"left",styleFloat:"left",cssFloat:"left",height:"100%"});for(var ao=0;ao<ap.length;ao++){C(ap[ao],ar,aq)}}function L(){return R++}function C(ar,au,aw){var aq,ao,ap,an,ax;if(!aw){aw=S.elements}if(ar.type=="divider"){y("divider"+L(),au,true,aw,undefined,ar.width,ar.element);return}switch(ar.name){case"play":y("playButton",au,false,aw);y("pauseButton",au,true,aw);U("playButton","jwPlay");U("pauseButton","jwPause");break;case"prev":y("prevButton",au,true,aw);U("prevButton","jwPlaylistPrev");break;case"stop":y("stopButton",au,true,aw);U("stopButton","jwStop");break;case"next":y("nextButton",au,true,aw);U("nextButton","jwPlaylistNext");break;case"elapsed":y("elapsedText",au,true,aw,null,null,l.skin.getSkinElement("controlbar","elapsedBackground"));break;case"time":ao=!_utils.exists(l.skin.getSkinElement("controlbar","timeSliderCapLeft"))?0:l.skin.getSkinElement("controlbar","timeSliderCapLeft").width;ap=!_utils.exists(l.skin.getSkinElement("controlbar","timeSliderCapRight"))?0:l.skin.getSkinElement("controlbar","timeSliderCapRight").width;aq=au=="left"?ao:ap;ax={height:K().height,position:"relative","float":"left",styleFloat:"left",cssFloat:"left"};var at=ad("timeSlider",aw,ax);y("timeSliderCapLeft",au,true,at,"relative");y("timeSliderRail",au,false,at,"relative");y("timeSliderBuffer",au,false,at,"absolute");y("timeSliderProgress",au,false,at,"absolute");y("timeSliderThumb",au,false,at,"absolute");y("timeSliderCapRight",au,true,at,"relative");ab("time");break;case"fullscreen":y("fullscreenButton",au,false,aw);y("normalscreenButton",au,true,aw);U("fullscreenButton","jwSetFullscreen",true);U("normalscreenButton","jwSetFullscreen",false);break;case"volume":ao=!_utils.exists(l.skin.getSkinElement("controlbar","volumeSliderCapLeft"))?0:l.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;ap=!_utils.exists(l.skin.getSkinElement("controlbar","volumeSliderCapRight"))?0:l.skin.getSkinElement("controlbar","volumeSliderCapRight").width;aq=au=="left"?ao:ap;an=l.skin.getSkinElement("controlbar","volumeSliderRail").width+ao+ap;ax={height:K().height,position:"relative",width:an,"float":"left",styleFloat:"left",cssFloat:"left"};var av=ad("volumeSlider",aw,ax);y("volumeSliderCapLeft",au,false,av,"relative");y("volumeSliderRail",au,false,av,"relative");y("volumeSliderProgress",au,false,av,"absolute");y("volumeSliderThumb",au,false,av,"absolute");y("volumeSliderCapRight",au,false,av,"relative");ab("volume");break;case"mute":y("muteButton",au,false,aw);y("unmuteButton",au,true,aw);U("muteButton","jwSetMute",true);U("unmuteButton","jwSetMute",false);break;case"duration":y("durationText",au,true,aw,null,null,l.skin.getSkinElement("controlbar","durationBackground"));break}}function y(aq,au,ao,ax,ar,an,ap){if(_utils.exists(l.skin.getSkinElement("controlbar",aq))||aq.indexOf("Text")>0||aq.indexOf("divider")===0){var at={height:"100%",position:ar?ar:"relative",display:"block","float":"left",styleFloat:"left",cssFloat:"left"};if((aq.indexOf("next")===0||aq.indexOf("prev")===0)&&(l.jwGetPlaylist().length<2||D.hideplaylistcontrols.toString()=="true")){if(D.forcenextprev.toString()!="true"){ao=false;at.display="none"}}var ay;if(aq.indexOf("Text")>0){aq.innerhtml="00:00";at.font=D.fontsize+"px/"+(K().height+1)+"px "+D.font;at.color=D.fontcolor;at.textAlign="center";at.fontWeight=D.fontweight;at.fontStyle=D.fontstyle;at.cursor="default";if(ap){at.background="url("+ap.src+") no-repeat center";at.backgroundSize="100% "+K().height+"px"}at.padding="0 5px"}else{if(aq.indexOf("divider")===0){if(an){if(!isNaN(parseInt(an))){ay=parseInt(an)}}else{if(ap){var av=l.skin.getSkinElement("controlbar",ap);if(av){at.background="url("+av.src+") repeat-x center left";ay=av.width}}else{at.background="url("+l.skin.getSkinElement("controlbar","divider").src+") repeat-x center left";ay=l.skin.getSkinElement("controlbar","divider").width}}}else{at.background="url("+l.skin.getSkinElement("controlbar",aq).src+") repeat-x center left";ay=l.skin.getSkinElement("controlbar",aq).width}}if(au=="left"){if(ao){af+=ay}}else{if(au=="right"){if(ao){E+=ay}}}if(_utils.typeOf(ax)=="undefined"){ax=S.elements}at.width=ay;if(q){_css(S[aq],at)}else{var aw=ad(aq,ax,at);if(_utils.exists(l.skin.getSkinElement("controlbar",aq+"Over"))){aw.onmouseover=function(az){aw.style.backgroundImage=["url(",l.skin.getSkinElement("controlbar",aq+"Over").src,")"].join("")};aw.onmouseout=function(az){aw.style.backgroundImage=["url(",l.skin.getSkinElement("controlbar",aq).src,")"].join("")}}if(aq.indexOf("divider")==0){aw.setAttribute("class","divider")}aw.innerHTML=" "}}}function F(){l.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,B);l.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_ITEM,t);l.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_BUFFER,v);l.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,s);l.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_TIME,J);l.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,al);l.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_VOLUME,n);l.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_COMPLETE,M)}function B(){if(!D.hideplaylistcontrols){if(l.jwGetPlaylist().length>1||D.forcenextprev.toString()=="true"){_show(S.nextButton);_show(S.prevButton)}else{_hide(S.nextButton);_hide(S.prevButton)}x();ai()}}function t(an){ah=l.jwGetPlaylist()[an.index].duration;Q=-1;J({id:l.id,duration:ah,position:0});v({id:l.id,bufferProgress:0})}function ai(){J({id:l.id,duration:l.jwGetDuration(),position:0});v({id:l.id,bufferProgress:0});al({id:l.id,mute:l.jwGetMute()});s({id:l.id,newstate:a.api.events.state.IDLE});n({id:l.id,volume:l.jwGetVolume()})}function U(ap,aq,ao){if(q){return}if(_utils.exists(l.skin.getSkinElement("controlbar",ap))){var an=S[ap];if(_utils.exists(an)){_css(an,{cursor:"pointer"});if(aq=="fullscreen"){an.onmouseup=function(ar){ar.stopPropagation();l.jwSetFullscreen(!l.jwGetFullscreen())}}else{an.onmouseup=function(ar){ar.stopPropagation();if(_utils.exists(ao)){l[aq](ao)}else{l[aq]()}}}}}}function ab(an){if(q){return}var ao=S[an+"Slider"];_css(S.elements,{cursor:"pointer"});_css(ao,{cursor:"pointer"});ao.onmousedown=function(ap){w=an};ao.onmouseup=function(ap){ap.stopPropagation();ak(ap.pageX)};ao.onmousemove=function(ap){if(w=="time"){h=true;var aq=ap.pageX-c[an+"Slider"].left-window.pageXOffset;_css(S[w+"SliderThumb"],{left:aq})}}}function ak(ao){h=false;var an;if(w=="time"){an=ao-c.timeSliderRail.left+window.pageXOffset;var aq=an/c.timeSliderRail.width*ah;if(aq<0){aq=0}else{if(aq>ah){aq=ah-3}}if(l.jwGetState()==a.api.events.state.PAUSED||l.jwGetState()==a.api.events.state.IDLE){l.jwPlay()}l.jwSeek(aq)}else{if(w=="volume"){an=ao-c.volumeSliderRail.left-window.pageXOffset;var ap=Math.round(an/c.volumeSliderRail.width*100);if(ap<10){ap=0}else{if(ap>100){ap=100}}if(l.jwGetMute()){l.jwSetMute(false)}l.jwSetVolume(ap)}}w="none"}function v(ao){if(_utils.exists(ao.bufferPercent)){g=ao.bufferPercent}if(c.timeSliderRail){var aq=l.skin.getSkinElement("controlbar","timeSliderCapLeft");var ap=c.timeSliderRail.width;var an=isNaN(Math.round(ap*g/100))?0:Math.round(ap*g/100);_css(S.timeSliderBuffer,{width:an,left:aq?aq.width:0})}}function al(an){if(an.mute){_hide(S.muteButton);_show(S.unmuteButton);_hide(S.volumeSliderProgress)}else{_show(S.muteButton);_hide(S.unmuteButton);_show(S.volumeSliderProgress)}}function s(an){if(an.newstate==a.api.events.state.BUFFERING||an.newstate==a.api.events.state.PLAYING){_show(S.pauseButton);_hide(S.playButton)}else{_hide(S.pauseButton);_show(S.playButton)}Z();if(an.newstate==a.api.events.state.IDLE){_hide(S.timeSliderBuffer);_hide(S.timeSliderProgress);_hide(S.timeSliderThumb);J({id:l.id,duration:l.jwGetDuration(),position:0})}else{_show(S.timeSliderBuffer);if(an.newstate!=a.api.events.state.BUFFERING){_show(S.timeSliderProgress);_show(S.timeSliderThumb)}}}function M(an){v({bufferPercent:0});J(_utils.extend(an,{position:0,duration:ah}))}function J(at){if(_utils.exists(at.position)){k=at.position}var ao=false;if(_utils.exists(at.duration)&&at.duration!=ah){ah=at.duration;ao=true}var aq=(k===ah===0)?0:k/ah;var av=c.timeSliderRail;if(av){var ap=isNaN(Math.round(av.width*aq))?0:Math.round(av.width*aq);var au=l.skin.getSkinElement("controlbar","timeSliderCapLeft");var ar=ap+(au?au.width:0);if(S.timeSliderProgress){_css(S.timeSliderProgress,{width:ap,left:au?au.width:0});if(!h){if(S.timeSliderThumb){S.timeSliderThumb.style.left=ar+"px"}}}}if(S.durationText){S.durationText.innerHTML=_utils.timeFormat(ah)}if(S.elapsedText){var an=_utils.timeFormat(k);S.elapsedText.innerHTML=an;if(Q!=an.length){ao=true;Q=an.length}}if(ao){x()}}function o(){var an=S.elements.childNodes;var at,aq;for(var ap=0;ap<an.length;ap++){var ar=an[ap].childNodes;for(var ao in ar){if(isNaN(parseInt(ao,10))){continue}if(ar[ao].id.indexOf(ag.id+"_divider")===0&&aq&&aq.id.indexOf(ag.id+"_divider")===0&&ar[ao].style.backgroundImage==aq.style.backgroundImage){ar[ao].style.display="none"}else{if(ar[ao].id.indexOf(ag.id+"_divider")===0&&at&&at.style.display!="none"){ar[ao].style.display="block"}}if(ar[ao].style.display!="none"){aq=ar[ao]}at=ar[ao]}}}function aj(){if(l.jwGetFullscreen()){_show(S.normalscreenButton);_hide(S.fullscreenButton)}else{_hide(S.normalscreenButton);_show(S.fullscreenButton)}if(l.jwGetState()==a.api.events.state.BUFFERING||l.jwGetState()==a.api.events.state.PLAYING){_show(S.pauseButton);_hide(S.playButton)}else{_hide(S.pauseButton);_show(S.playButton)}if(l.jwGetMute()==true){_hide(S.muteButton);_show(S.unmuteButton);_hide(S.volumeSliderProgress)}else{_show(S.muteButton);_hide(S.unmuteButton);_show(S.volumeSliderProgress)}}function x(){o();aj();var ap={width:f};var ax={"float":"left",styleFloat:"left",cssFloat:"left"};if(D.position==a.html5.view.positions.OVER||l.jwGetFullscreen()){ap.left=D.margin;ap.width-=2*D.margin;ap.top=z-K().height-D.margin;ap.height=K().height}var ar=l.skin.getSkinElement("controlbar","capLeft");var av=l.skin.getSkinElement("controlbar","capRight");ax.width=ap.width-(ar?ar.width:0)-(av?av.width:0);var aq=_utils.getBoundingClientRect(S.leftGroup).width;var au=_utils.getBoundingClientRect(S.rightGroup).width;var at=ax.width-aq-au-1;var ao=at;var an=l.skin.getSkinElement("controlbar","timeSliderCapLeft");var aw=l.skin.getSkinElement("controlbar","timeSliderCapRight");if(_utils.exists(an)){ao-=an.width}if(_utils.exists(aw)){ao-=aw.width}S.timeSlider.style.width=at+"px";S.timeSliderRail.style.width=ao+"px";_css(ag,ap);_css(S.elements,ax);_css(S.background,ax);r();return ap}function n(at){if(_utils.exists(S.volumeSliderRail)){var ap=isNaN(at.volume/100)?1:at.volume/100;var aq=_utils.parseDimension(S.volumeSliderRail.style.width);var an=isNaN(Math.round(aq*ap))?0:Math.round(aq*ap);var au=_utils.parseDimension(S.volumeSliderRail.style.right);var ao=(!_utils.exists(l.skin.getSkinElement("controlbar","volumeSliderCapLeft")))?0:l.skin.getSkinElement("controlbar","volumeSliderCapLeft").width;_css(S.volumeSliderProgress,{width:an,left:ao});if(S.volumeSliderThumb){var ar=(an-Math.round(_utils.parseDimension(S.volumeSliderThumb.style.width)/2));ar=Math.min(Math.max(ar,0),aq-_utils.parseDimension(S.volumeSliderThumb.style.width));_css(S.volumeSliderThumb,{left:ar})}if(_utils.exists(S.volumeSliderCapLeft)){_css(S.volumeSliderCapLeft,{left:0})}}}function T(){try{var ao=(l.id.indexOf("_instream")>0?l.id.replace("_instream",""):l.id);H=document.getElementById(ao);H.addEventListener("mousemove",Z)}catch(an){_utils.log("Could not add mouse listeners to controlbar: "+an)}}function u(){O();N();r();q=true;F();D.idlehide=(D.idlehide.toString().toLowerCase()=="true");if(D.position==a.html5.view.positions.OVER&&D.idlehide){ag.style.opacity=0;V=true}else{ag.style.opacity=1;setTimeout((function(){V=true;W()}),1)}T();ai()}u();return this}})(jwplayer);(function(b){var a=["width","height","state","playlist","item","position","buffer","duration","volume","mute","fullscreen"];var c=b.utils;b.html5.controller=function(o,K,f,h){var n=o,m=f,j=h,y=K,M=true,G=-1,A=false,d=false,P,C=[],q=false;var D=(c.exists(m.config.debug)&&(m.config.debug.toString().toLowerCase()=="console")),N=new b.html5.eventdispatcher(y.id,D);c.extend(this,N);function L(T){if(q){N.sendEvent(T.type,T)}else{C.push(T)}}function s(T){if(!q){q=true;N.sendEvent(b.api.events.JWPLAYER_READY,T);if(b.utils.exists(window.playerReady)){playerReady(T)}if(b.utils.exists(window[f.config.playerReady])){window[f.config.playerReady](T)}while(C.length>0){var V=C.shift();N.sendEvent(V.type,V)}if(f.config.autostart&&!b.utils.isIOS()){O()}while(x.length>0){var U=x.shift();B(U.method,U.arguments)}}}m.addGlobalListener(L);m.addEventListener(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL,function(){m.getMedia().play()});m.addEventListener(b.api.events.JWPLAYER_MEDIA_TIME,function(T){if(T.position>=m.playlist[m.item].start&&G>=0){m.playlist[m.item].start=G;G=-1}});m.addEventListener(b.api.events.JWPLAYER_MEDIA_COMPLETE,function(T){setTimeout(E,25)});m.addEventListener(b.api.events.JWPLAYER_PLAYLIST_LOADED,O);m.addEventListener(b.api.events.JWPLAYER_FULLSCREEN,p);function F(){try{P=F;if(!A){A=true;N.sendEvent(b.api.events.JWPLAYER_MEDIA_BEFOREPLAY);A=false;if(d){d=false;P=null;return}}v(m.item);if(m.playlist[m.item].levels[0].file.length>0){if(M||m.state==b.api.events.state.IDLE){m.getMedia().load(m.playlist[m.item]);M=false}else{if(m.state==b.api.events.state.PAUSED){m.getMedia().play()}}}return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T);P=null}return false}function e(){try{if(m.playlist[m.item].levels[0].file.length>0){switch(m.state){case b.api.events.state.PLAYING:case b.api.events.state.BUFFERING:if(m.getMedia()){m.getMedia().pause()}break;default:if(A){d=true}}}return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function z(T){try{if(m.playlist[m.item].levels[0].file.length>0){if(typeof T!="number"){T=parseFloat(T)}switch(m.state){case b.api.events.state.IDLE:if(G<0){G=m.playlist[m.item].start;m.playlist[m.item].start=T}if(!A){F()}break;case b.api.events.state.PLAYING:case b.api.events.state.PAUSED:case b.api.events.state.BUFFERING:m.seek(T);break}}return true}catch(U){N.sendEvent(b.api.events.JWPLAYER_ERROR,U)}return false}function w(T){P=null;if(!c.exists(T)){T=true}try{if((m.state!=b.api.events.state.IDLE||T)&&m.getMedia()){m.getMedia().stop(T)}if(A){d=true}return true}catch(U){N.sendEvent(b.api.events.JWPLAYER_ERROR,U)}return false}function k(){try{if(m.playlist[m.item].levels[0].file.length>0){if(m.config.shuffle){v(S())}else{if(m.item+1==m.playlist.length){v(0)}else{v(m.item+1)}}}if(m.state!=b.api.events.state.IDLE){var U=m.state;m.state=b.api.events.state.IDLE;N.sendEvent(b.api.events.JWPLAYER_PLAYER_STATE,{oldstate:U,newstate:b.api.events.state.IDLE})}F();return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function I(){try{if(m.playlist[m.item].levels[0].file.length>0){if(m.config.shuffle){v(S())}else{if(m.item===0){v(m.playlist.length-1)}else{v(m.item-1)}}}if(m.state!=b.api.events.state.IDLE){var U=m.state;m.state=b.api.events.state.IDLE;N.sendEvent(b.api.events.JWPLAYER_PLAYER_STATE,{oldstate:U,newstate:b.api.events.state.IDLE})}F();return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function S(){var T=null;if(m.playlist.length>1){while(!c.exists(T)){T=Math.floor(Math.random()*m.playlist.length);if(T==m.item){T=null}}}else{T=0}return T}function H(U){if(!m.playlist||!m.playlist[U]){return false}try{if(m.playlist[U].levels[0].file.length>0){var V=m.state;if(V!==b.api.events.state.IDLE){if(m.playlist[m.item]&&m.playlist[m.item].provider==m.playlist[U].provider){w(false)}else{w()}}v(U);F()}return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function v(T){if(!m.playlist[T]){return}m.setActiveMediaProvider(m.playlist[T]);if(m.item!=T){m.item=T;M=true;N.sendEvent(b.api.events.JWPLAYER_PLAYLIST_ITEM,{index:T})}}function g(U){try{v(m.item);var V=m.getMedia();switch(typeof(U)){case"number":V.volume(U);break;case"string":V.volume(parseInt(U,10));break}m.setVolume(U);return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function r(U){try{v(m.item);var V=m.getMedia();if(typeof U=="undefined"){V.mute(!m.mute);m.setMute(!m.mute)}else{if(U.toString().toLowerCase()=="true"){V.mute(true);m.setMute(true)}else{V.mute(false);m.setMute(false)}}return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function J(U,T){try{m.width=U;m.height=T;j.resize(U,T);N.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:m.width,height:m.height});return true}catch(V){N.sendEvent(b.api.events.JWPLAYER_ERROR,V)}return false}function u(U,V){try{if(typeof U=="undefined"){U=!m.fullscreen}if(typeof V=="undefined"){V=true}if(U!=m.fullscreen){m.fullscreen=(U.toString().toLowerCase()=="true");j.fullscreen(m.fullscreen);if(V){N.sendEvent(b.api.events.JWPLAYER_FULLSCREEN,{fullscreen:m.fullscreen})}N.sendEvent(b.api.events.JWPLAYER_RESIZE,{width:m.width,height:m.height})}return true}catch(T){N.sendEvent(b.api.events.JWPLAYER_ERROR,T)}return false}function R(T){try{w();if(A){d=false}m.loadPlaylist(T);if(m.playlist[m.item].provider){v(m.item);if(m.config.autostart.toString().toLowerCase()=="true"&&!c.isIOS()&&!A){F()}return true}else{return false}}catch(U){N.sendEvent(b.api.events.JWPLAYER_ERROR,U)}return false}function O(T){if(!c.isIOS()){v(m.item);if(m.config.autostart.toString().toLowerCase()=="true"&&!c.isIOS()){F()}}}function p(T){u(T.fullscreen,false)}function t(){try{return m.getMedia().detachMedia()}catch(T){return null}}function l(){try{var T=m.getMedia().attachMedia();if(typeof P=="function"){P()}}catch(U){return null}}b.html5.controller.repeatoptions={LIST:"LIST",ALWAYS:"ALWAYS",SINGLE:"SINGLE",NONE:"NONE"};function E(){if(m.state!=b.api.events.state.IDLE){return}P=E;switch(m.config.repeat.toUpperCase()){case b.html5.controller.repeatoptions.SINGLE:F();break;case b.html5.controller.repeatoptions.ALWAYS:if(m.item==m.playlist.length-1&&!m.config.shuffle){H(0)}else{k()}break;case b.html5.controller.repeatoptions.LIST:if(m.item==m.playlist.length-1&&!m.config.shuffle){w();v(0)}else{k()}break;default:w();break}}var x=[];function Q(T){return function(){if(q){B(T,arguments)}else{x.push({method:T,arguments:arguments})}}}function B(V,U){var T=[];for(i=0;i<U.length;i++){T.push(U[i])}V.apply(this,T)}this.play=Q(F);this.pause=Q(e);this.seek=Q(z);this.stop=Q(w);this.next=Q(k);this.prev=Q(I);this.item=Q(H);this.setVolume=Q(g);this.setMute=Q(r);this.resize=Q(J);this.setFullscreen=Q(u);this.load=Q(R);this.playerReady=s;this.detachMedia=t;this.attachMedia=l;this.beforePlay=function(){return A};this.destroy=function(){if(m.getMedia()){m.getMedia().destroy()}}}})(jwplayer);(function(a){a.html5.defaultSkin=function(){this.text='<?xml version="1.0" ?><skin author="LongTail Video" name="Five" version="1.1"><components><component name="controlbar"><settings><setting name="margin" value="20"/><setting name="fontsize" value="11"/><setting name="fontcolor" value="0x000000"/></settings><layout><group position="left"><button name="play"/><divider name="divider"/><button name="prev"/><divider name="divider"/><button name="next"/><divider name="divider"/><text name="elapsed"/></group><group position="center"><slider name="time"/></group><group position="right"><text name="duration"/><divider name="divider"/><button name="blank"/><divider name="divider"/><button name="mute"/><slider name="volume"/><divider name="divider"/><button name="fullscreen"/></group></layout><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAElJREFUOI3t1LERACAMQlFgGvcfxNIhHMK4gsUvUviOmgtNsiAZkBSEKxKEnCYkkQrJn/YwbUNiSDDYRZaQRDaShv+oX9GBZEIuK+8hXVLs+/YAAAAASUVORK5CYII="/><element name="blankButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="capLeft" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="capRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAYAAAA7zJfaAAAAQElEQVQIWz3LsRGAMADDQJ0XB5bMINABZ9GENGrszxhjT2WLSqxEJG2JQrTMdV2q5LpOAvyRaVmsi7WdeZ/7+AAaOTq7BVrfOQAAAABJRU5ErkJggg=="/><element name="divider" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAYCAIAAAC0rgCNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADhJREFUCB0FwcENgEAAw7Aq+893g8APUILNOQcbFRktVGqUVFRkWNz3xTa2sUaLNUosKlRUvvf5AdbWOTtzmzyWAAAAAElFTkSuQmCC"/><element name="playButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAANUlEQVR42u2RsQkAAAjD/NTTPaW6dXLrINJA1kBpGPMAjDWmOgp1HFQXx+b1KOefO4oxY57R73YnVYCQUCQAAAAASUVORK5CYII="/><element name="pauseButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAIUlEQVQ4jWNgGAWjYOiD/0gYG3/U0FFDB4Oho2AUDAYAAEwiL9HrpdMVAAAAAElFTkSuQmCC"/><element name="prevButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQklEQVQ4y2NgGAWjYOiD/1AMA/JAfB5NjCJD/YH4PRaLyDa0H4lNNUP/DxlD59PCUBCIp3ZEwYA+NZLUKBgFgwEAAN+HLX9sB8u8AAAAAElFTkSuQmCC"/><element name="nextButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAYCAYAAAAVibZIAAAAQElEQVQ4y2NgGAWjYOiD/0B8Hojl0cT+U2ooCL8HYn9qGwrD/bQw9P+QMXQ+tSMqnpoRBUpS+tRMUqNgFAwGAADxZy1/mHvFnAAAAABJRU5ErkJggg=="/><element name="timeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAOElEQVRIDe3BwQkAIRADwAhhw/nU/kWwUK+KPITMABFh19Y+F0acY8CJvX9wYpXgRElwolSIiMf9ZWEDhtwurFsAAAAASUVORK5CYII="/><element name="timeSliderBuffer" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAN0lEQVRIDe3BwQkAMQwDMBcc55mRe9zi7RR+FCwBEWG39vcfGHFm4MTuhhMlwYlVBSdKhYh43AW/LQMKm1spzwAAAABJRU5ErkJggg=="/><element name="timeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAIElEQVRIiWNgGAWjYBTQBfynMR61YCRYMApGwSigMQAAiVWPcbq6UkIAAAAASUVORK5CYII="/><element name="timeSliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAYCAYAAAA/OUfnAAAAO0lEQVQYlWP4//8/Awwz0JgDBP/BeN6Cxf/hnI2btiI4u/fsQ3AOHjqK4Jw4eQbBOX/hEoKDYjSd/AMA4cS4mfLsorgAAAAASUVORK5CYII="/><element name="muteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAJklEQVQ4y2NgGAUjDcwH4v/kaPxPikZkxcNVI9mBQ5XoGAWDFwAAsKAXKQQmfbUAAAAASUVORK5CYII="/><element name="unmuteButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAYCAYAAADKx8xXAAAAMklEQVQ4y2NgGAWDHPyntub5xBr6Hwv/Pzk2/yfVG/8psRFE25Oq8T+tQnsIaB4FVAcAi2YVysVY52AAAAAASUVORK5CYII="/><element name="volumeSliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAACmpqampqbBXAu8AAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderProgress" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAAAAAAAAAACDY+nAAAAAAnRSTlMAgJsrThgAAAArSURBVAhbY2AgErBAyA4I2QEhOyBkB4TsYOhAoaCCUCUwDTDtMMNgRuMHAFB5FoGH5T0UAAAAAElFTkSuQmCC"/><element name="volumeSliderCapRight" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAYCAYAAAAyJzegAAAAFElEQVQYV2P8//8/AzpgHBUc7oIAGZdH0RjKN8EAAAAASUVORK5CYII="/><element name="fullscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAQklEQVRIiWNgGAWjYMiD/0iYFDmSLbDHImdPLQtgBpEiR7Zl2NijAA5oEkT/0Whi5UiyAJ8BVMsHNMtoo2AUDAIAAGdcIN3IDNXoAAAAAElFTkSuQmCC"/><element name="normalscreenButton" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAP0lEQVRIx2NgGAWjYMiD/1RSQ5QB/wmIUWzJfzx8qhj+n4DYCAY0DyJ7PBbYU8sHMEvwiZFtODXUjIJRMJgBACpWIN2ZxdPTAAAAAElFTkSuQmCC"/></elements></component><component name="display"><elements><element name="background" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/><element name="playIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiUlEQVR42u3XSw2AMBREURwgAQlIQAISKgUpSEFKJeCg5b0E0kWBTVcD9ySTsL0Jn9IBAAAA+K2UUrBlW/Rr5ZDoIeeuoFkxJD9ss03aIXXQqB9SttoG7ZA6qNcOKdttiwcJh9RB+iFl4SshkRBuLR72+9cvH0SOKI2HRo7x/Fi1/uoCAAAAwLsD8ki99IlO2dQAAAAASUVORK5CYII="/><element name="muteIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAVUlEQVR42u3WMQrAIAxAUW/g/SdvGmvpoOBeSHgPsjj5QTANAACARCJilIhYM0tEvJM+Ik3Id9E957kQIb+F3OdCPC0hPkQriqWx9hp/x/QGAABQyAPLB22VGrpLDgAAAABJRU5ErkJggg=="/><element name="errorIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAA/0lEQVR42u2U0QmEMBAF7cASLMESUoIlpARLSCkpwRJSgiWkhOvAXD4WsgRkyaG5DbyB+Yvg8KITAAAAAAAYk+u61mwk15EjPtlEfihmqIiZR1Qx80ghjgdUuiHXGHSVsoag0x6x8DUoyjD5KovmEJ9NTDMRPIT0mtdIUkjlonuNohO+Ha99DTmkuGgKCTcvebAzx82ZoCWC3/3aIMWSRucaxcjORSFY4xpFdjYJGp1rFGcyCYZ/RVh6AUnfcNZ2zih3/mGj1jVCdiNDwyrq1rA/xMdeEXvDVdnYc1vDc3uPkDObXrlaxbNHSOohQhr/WOeLEWfWTgAAAAAAADzNF9sHJ7PJ57MlAAAAAElFTkSuQmCC"/><element name="bufferIcon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAACBklEQVR42u3Zv0sCYRzH8USTzOsHHEWGkC1HgaDgkktGDjUYtDQ01RDSljQ1BLU02+rk1NTm2NLq4Nx/0L/h9fnCd3j4cnZe1/U8xiO8h3uurufF0/3COd/3/0UWYiEWYiEWYiGJQ+J8xuPxKhXjEMZANinjIZhkGuVRNioE4wVURo4JkHm0xKWmhRAc1bh1EyCUw5BcBIjHiApKa4CErko6DEJwuRo6IRKzyJD8FJAyI3Zp2zRImiBcRhlfo5RtlxCcE3CcDNpGrhYIT2IhAJKilO0VRmzJ32fAMTpBTS0QMfGwlcuKMRftE0DJ0wCJdcOsCkBdXP3Mh9CEFUBTPS9mDZJBG6io4aqVzMdCokCw9H3kT6j/C/9iDdSeUMNC7DkyyxAs/Rk6Qss8FPWRZgdVtUH4DjxEn1zxh+/zj1wHlf4MQhNGrwqA6sY40U8JonRJwEQh+AO3AvCG6gHv4U7IY4krxkroWoAOkoQMGfCBrgIm+YBGqPENpIJ66CJg3x66Y0gnSUidAEEnNr9jjLiWMn5DiWP0OC/oAsCgkq43xBdGDMQr7YASP/vEkHvdl1+JOCcEV5sC4hGEOzTlPuKgd0b0xD4JkRcOgnRRTjdErkYhAsQVq6IdUuPJtmk7BCL3t/h88cx91pKQkI/pkDx6pmYTIjEoxiHsN1YWYiEWYiEWknhflZ5IErA5nr8AAAAASUVORK5CYII="/></elements></component><component name="dock"><settings><setting name="fontcolor" value="0xffffff"/></settings><elements><element name="button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlOZpuml+rYAAAASSURBVBhXY2AYJuA/GBwY6jQAyDyoK8QcL4QAAAAASUVORK5CYII="/></elements></component><component name="playlist"><settings><setting name="backgroundcolor" value="0xe8e8e8"/></settings><elements><element name="item" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAIAAAC1nk4lAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHBJREFUaN7t2MENwCAMBEEe9N8wSKYC/D8YV7CyJoRkVtVImxkZPQInMxoP0XiIxkM0HsGbjjSNBx544IEHHnjggUe/6UQeey0PIh7XTftGxKPj4eXCtLsHHh+ZxkO0Iw8PR55Ni8ZD9Hu/EAoP0dc5RRg9qeRjVF8AAAAASUVORK5CYII="/><element name="sliderCapTop" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/><element name="sliderRail" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAKElEQVQ4y2P4//8/Az68bNmy/+iYkB6GUUNHDR01dNTQUUNHDaXcUABUDOKhcxnsSwAAAABJRU5ErkJggg=="/><element name="sliderThumb" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAJUlEQVQ4T2P4//8/Ay4MBP9xYbz6Rg0dNXTU0FFDRw0dNZRyQwHH4NBa7GJsXAAAAABJRU5ErkJggg=="/><element name="sliderCapBottom" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAHCAYAAADnCQYGAAAAFUlEQVQokWP8//8/A7UB46ihI9hQAKt6FPPXhVGHAAAAAElFTkSuQmCC"/></elements></component></components></skin>';this.xml=null;if(window.DOMParser){parser=new DOMParser();this.xml=parser.parseFromString(this.text,"text/xml")}else{this.xml=new ActiveXObject("Microsoft.XMLDOM");this.xml.async="false";this.xml.loadXML(this.text)}return this}})(jwplayer);(function(a){_utils=a.utils;_css=_utils.css;_hide=function(b){_css(b,{display:"none"})};_show=function(b){_css(b,{display:"block"})};a.html5.display=function(k,K){var j={icons:true,showmute:false};var X=_utils.extend({},j,K);var h=k;var W={};var e;var w;var z;var T;var u;var M;var E;var N=!_utils.exists(h.skin.getComponentSettings("display").bufferrotation)?15:parseInt(h.skin.getComponentSettings("display").bufferrotation,10);var s=!_utils.exists(h.skin.getComponentSettings("display").bufferinterval)?100:parseInt(h.skin.getComponentSettings("display").bufferinterval,10);var D=-1;var v=a.api.events.state.IDLE;var O=true;var d;var C=false,V=true;var p="";var g=false;var o=false;var m;var y,R;var L=new a.html5.eventdispatcher();_utils.extend(this,L);var H={display:{style:{cursor:"pointer",top:0,left:0,overflow:"hidden"},click:n},display_icon:{style:{cursor:"pointer",position:"absolute",top:((h.skin.getSkinElement("display","background").height-h.skin.getSkinElement("display","playIcon").height)/2),left:((h.skin.getSkinElement("display","background").width-h.skin.getSkinElement("display","playIcon").width)/2),border:0,margin:0,padding:0,zIndex:3,display:"none"}},display_iconBackground:{style:{cursor:"pointer",position:"absolute",top:((w-h.skin.getSkinElement("display","background").height)/2),left:((e-h.skin.getSkinElement("display","background").width)/2),border:0,backgroundImage:(["url(",h.skin.getSkinElement("display","background").src,")"]).join(""),width:h.skin.getSkinElement("display","background").width,height:h.skin.getSkinElement("display","background").height,margin:0,padding:0,zIndex:2,display:"none"}},display_image:{style:{display:"none",width:e,height:w,position:"absolute",cursor:"pointer",left:0,top:0,margin:0,padding:0,textDecoration:"none",zIndex:1}},display_text:{style:{zIndex:4,position:"relative",opacity:0.8,backgroundColor:parseInt("000000",16),color:parseInt("ffffff",16),textAlign:"center",fontFamily:"Arial,sans-serif",padding:"0 5px",fontSize:14}}};h.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,q);h.jwAddEventListener(a.api.events.JWPLAYER_MEDIA_MUTE,q);h.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,P);h.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_ITEM,q);h.jwAddEventListener(a.api.events.JWPLAYER_ERROR,r);Q();function Q(){W.display=G("div","display");W.display_text=G("div","display_text");W.display.appendChild(W.display_text);W.display_image=G("img","display_image");W.display_image.onerror=function(Y){_hide(W.display_image)};W.display_image.onload=B;W.display_icon=G("div","display_icon");W.display_iconBackground=G("div","display_iconBackground");W.display.appendChild(W.display_image);W.display_iconBackground.appendChild(W.display_icon);W.display.appendChild(W.display_iconBackground);f();setTimeout((function(){o=true;if(X.icons.toString()=="true"){J()}}),1)}this.getDisplayElement=function(){return W.display};this.resize=function(Z,Y){if(h.jwGetFullscreen()&&_utils.isMobile()){return}_css(W.display,{width:Z,height:Y});_css(W.display_text,{width:(Z-10),top:((Y-_utils.getBoundingClientRect(W.display_text).height)/2)});_css(W.display_iconBackground,{top:((Y-h.skin.getSkinElement("display","background").height)/2),left:((Z-h.skin.getSkinElement("display","background").width)/2)});if(e!=Z||w!=Y){e=Z;w=Y;d=undefined;J()}if(!h.jwGetFullscreen()){y=Z;R=Y}c();q({})};this.show=function(){if(g){g=false;t(h.jwGetState())}};this.hide=function(){if(!g){F();g=true}};function B(Y){z=W.display_image.naturalWidth;T=W.display_image.naturalHeight;c();if(h.jwGetState()==a.api.events.state.IDLE||h.jwGetPlaylist()[h.jwGetPlaylistIndex()].provider=="sound"){_css(W.display_image,{display:"block",opacity:0});_utils.fadeTo(W.display_image,1,0.1)}C=false}function c(){if(h.jwGetFullscreen()&&h.jwGetStretching()==a.utils.stretching.EXACTFIT){var Y=document.createElement("div");_utils.stretch(a.utils.stretching.UNIFORM,Y,e,w,y,R);_utils.stretch(a.utils.stretching.EXACTFIT,W.display_image,_utils.parseDimension(Y.style.width),_utils.parseDimension(Y.style.height),z,T);_css(W.display_image,{left:Y.style.left,top:Y.style.top})}else{_utils.stretch(h.jwGetStretching(),W.display_image,e,w,z,T)}}function G(Y,aa){var Z=document.createElement(Y);Z.id=h.id+"_jwplayer_"+aa;_css(Z,H[aa].style);return Z}function f(){for(var Y in W){if(_utils.exists(H[Y].click)){W[Y].onclick=H[Y].click}}}function n(Y){if(typeof Y.preventDefault!="undefined"){Y.preventDefault()}else{Y.returnValue=false}if(typeof m=="function"){m(Y);return}else{if(h.jwGetState()!=a.api.events.state.PLAYING){h.jwPlay()}else{h.jwPause()}}}function U(Y){if(E){F();return}W.display_icon.style.backgroundImage=(["url(",h.skin.getSkinElement("display",Y).src,")"]).join("");_css(W.display_icon,{width:h.skin.getSkinElement("display",Y).width,height:h.skin.getSkinElement("display",Y).height,top:(h.skin.getSkinElement("display","background").height-h.skin.getSkinElement("display",Y).height)/2,left:(h.skin.getSkinElement("display","background").width-h.skin.getSkinElement("display",Y).width)/2});b();if(_utils.exists(h.skin.getSkinElement("display",Y+"Over"))){W.display_icon.onmouseover=function(Z){W.display_icon.style.backgroundImage=["url(",h.skin.getSkinElement("display",Y+"Over").src,")"].join("")};W.display_icon.onmouseout=function(Z){W.display_icon.style.backgroundImage=["url(",h.skin.getSkinElement("display",Y).src,")"].join("")}}else{W.display_icon.onmouseover=null;W.display_icon.onmouseout=null}}function F(){if(X.icons.toString()=="true"){_hide(W.display_icon);_hide(W.display_iconBackground);S()}}function b(){if(!g&&X.icons.toString()=="true"){_show(W.display_icon);_show(W.display_iconBackground);J()}}function r(Y){E=true;F();W.display_text.innerHTML=Y.message;_show(W.display_text);W.display_text.style.top=((w-_utils.getBoundingClientRect(W.display_text).height)/2)+"px"}function I(){V=false;W.display_image.style.display="none"}function P(){v=""}function q(Y){if((Y.type==a.api.events.JWPLAYER_PLAYER_STATE||Y.type==a.api.events.JWPLAYER_PLAYLIST_ITEM)&&E){E=false;_hide(W.display_text)}var Z=h.jwGetState();if(Z==v){return}v=Z;if(D>=0){clearTimeout(D)}if(O||h.jwGetState()==a.api.events.state.PLAYING||h.jwGetState()==a.api.events.state.PAUSED){t(h.jwGetState())}else{D=setTimeout(l(h.jwGetState()),500)}}function l(Y){return(function(){t(Y)})}function t(Y){if(_utils.exists(M)){clearInterval(M);M=null;_utils.animations.rotate(W.display_icon,0)}switch(Y){case a.api.events.state.BUFFERING:if(_utils.isIPod()){I();F()}else{if(h.jwGetPlaylist()[h.jwGetPlaylistIndex()].provider=="sound"){x()}u=0;M=setInterval(function(){u+=N;_utils.animations.rotate(W.display_icon,u%360)},s);U("bufferIcon");O=true}break;case a.api.events.state.PAUSED:if(!_utils.isIPod()){if(h.jwGetPlaylist()[h.jwGetPlaylistIndex()].provider!="sound"){_css(W.display_image,{background:"transparent no-repeat center center"})}U("playIcon");O=true}break;case a.api.events.state.IDLE:if(h.jwGetPlaylist()[h.jwGetPlaylistIndex()]&&h.jwGetPlaylist()[h.jwGetPlaylistIndex()].image){x()}else{I()}U("playIcon");O=true;break;default:if(h.jwGetPlaylist()[h.jwGetPlaylistIndex()]&&h.jwGetPlaylist()[h.jwGetPlaylistIndex()].provider=="sound"){if(_utils.isIPod()){I();O=false}else{x()}}else{I();O=false}if(h.jwGetMute()&&X.showmute){U("muteIcon")}else{F()}break}D=-1}function x(){if(h.jwGetPlaylist()[h.jwGetPlaylistIndex()]){var Y=h.jwGetPlaylist()[h.jwGetPlaylistIndex()].image;if(Y){if(Y!=p){p=Y;C=true;W.display_image.src=_utils.getAbsolutePath(Y)}else{if(!(C||V)){V=true;W.display_image.style.opacity=0;W.display_image.style.display="block";_utils.fadeTo(W.display_image,1,0.1)}}}}}function A(Y){return function(){if(!o){return}if(!g&&d!=Y){d=Y;L.sendEvent(Y,{component:"display",boundingRect:_utils.getDimensions(W.display_iconBackground)})}}}var J=A(a.api.events.JWPLAYER_COMPONENT_SHOW);var S=A(a.api.events.JWPLAYER_COMPONENT_HIDE);this.setAlternateClickHandler=function(Y){m=Y};this.revertAlternateClickHandler=function(){m=undefined};return this}})(jwplayer);(function(a){var c=a.utils;var b=c.css;a.html5.dock=function(w,D){function x(){return{align:a.html5.view.positions.RIGHT}}var n=c.extend({},x(),D);if(n.align=="FALSE"){return}var j={};var A=[];var k;var F;var f=false;var C=false;var g={x:0,y:0,width:0,height:0};var z;var o;var y;var m=new a.html5.eventdispatcher();c.extend(this,m);var r=document.createElement("div");r.id=w.id+"_jwplayer_dock";r.style.opacity=1;p();w.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,q);this.getDisplayElement=function(){return r};this.setButton=function(K,H,I,J){if(!H&&j[K]){c.arrays.remove(A,K);r.removeChild(j[K].div);delete j[K]}else{if(H){if(!j[K]){j[K]={}}j[K].handler=H;j[K].outGraphic=I;j[K].overGraphic=J;if(!j[K].div){A.push(K);j[K].div=document.createElement("div");j[K].div.style.position="absolute";r.appendChild(j[K].div);j[K].div.appendChild(document.createElement("div"));j[K].div.childNodes[0].style.position="relative";j[K].div.childNodes[0].style.width="100%";j[K].div.childNodes[0].style.height="100%";j[K].div.childNodes[0].style.zIndex=10;j[K].div.childNodes[0].style.cursor="pointer";j[K].div.appendChild(document.createElement("img"));j[K].div.childNodes[1].style.position="absolute";j[K].div.childNodes[1].style.left=0;j[K].div.childNodes[1].style.top=0;if(w.skin.getSkinElement("dock","button")){j[K].div.childNodes[1].src=w.skin.getSkinElement("dock","button").src}j[K].div.childNodes[1].style.zIndex=9;j[K].div.childNodes[1].style.cursor="pointer";j[K].div.onmouseover=function(){if(j[K].overGraphic){j[K].div.childNodes[0].style.background=h(j[K].overGraphic)}if(w.skin.getSkinElement("dock","buttonOver")){j[K].div.childNodes[1].src=w.skin.getSkinElement("dock","buttonOver").src}};j[K].div.onmouseout=function(){if(j[K].outGraphic){j[K].div.childNodes[0].style.background=h(j[K].outGraphic)}if(w.skin.getSkinElement("dock","button")){j[K].div.childNodes[1].src=w.skin.getSkinElement("dock","button").src}};if(w.skin.getSkinElement("dock","button")){j[K].div.childNodes[1].src=w.skin.getSkinElement("dock","button").src}}if(j[K].outGraphic){j[K].div.childNodes[0].style.background=h(j[K].outGraphic)}else{if(j[K].overGraphic){j[K].div.childNodes[0].style.background=h(j[K].overGraphic)}}if(H){j[K].div.onclick=function(L){L.preventDefault();a(w.id).callback(K);if(j[K].overGraphic){j[K].div.childNodes[0].style.background=h(j[K].overGraphic)}if(w.skin.getSkinElement("dock","button")){j[K].div.childNodes[1].src=w.skin.getSkinElement("dock","button").src}}}}}l(k,F)};function h(H){return"url("+H+") no-repeat center center"}function t(H){}function l(H,T){p();if(A.length>0){var I=10;var S=I;var P=-1;var Q=w.skin.getSkinElement("dock","button").height;var O=w.skin.getSkinElement("dock","button").width;var M=H-O-I;var R,L;if(n.align==a.html5.view.positions.LEFT){P=1;M=I}for(var J=0;J<A.length;J++){var U=Math.floor(S/T);if((S+Q+I)>((U+1)*T)){S=((U+1)*T)+I;U=Math.floor(S/T)}var K=j[A[J]].div;K.style.top=(S%T)+"px";K.style.left=(M+(w.skin.getSkinElement("dock","button").width+I)*U*P)+"px";var N={x:c.parseDimension(K.style.left),y:c.parseDimension(K.style.top),width:O,height:Q};if(!R||(N.x<=R.x&&N.y<=R.y)){R=N}if(!L||(N.x>=L.x&&N.y>=L.y)){L=N}K.style.width=O+"px";K.style.height=Q+"px";S+=w.skin.getSkinElement("dock","button").height+I}g={x:R.x,y:R.y,width:L.x-R.x+L.width,height:R.y-L.y+L.height}}if(C!=w.jwGetFullscreen()||k!=H||F!=T){k=H;F=T;C=w.jwGetFullscreen();z=undefined;setTimeout(s,1)}}function d(H){return function(){if(!f&&z!=H&&A.length>0){z=H;m.sendEvent(H,{component:"dock",boundingRect:g})}}}function q(H){if(c.isMobile()){if(H.newstate==a.api.events.state.IDLE){v()}else{e()}}else{B()}}function B(H){if(f){return}clearTimeout(y);if(D.position==a.html5.view.positions.OVER||w.jwGetFullscreen()){switch(w.jwGetState()){case a.api.events.state.PAUSED:case a.api.events.state.IDLE:if(r&&r.style.opacity<1&&(!D.idlehide||c.exists(H))){E()}if(D.idlehide){y=setTimeout(function(){u()},2000)}break;default:if(c.exists(H)){E()}y=setTimeout(function(){u()},2000);break}}else{E()}}var s=d(a.api.events.JWPLAYER_COMPONENT_SHOW);var G=d(a.api.events.JWPLAYER_COMPONENT_HIDE);this.resize=l;var v=function(){b(r,{display:"block"});if(f){f=false;s()}};var e=function(){b(r,{display:"none"});if(!f){G();f=true}};function u(){if(!f){G();if(r.style.opacity==1){c.cancelAnimation(r);c.fadeTo(r,0,0.1,1,0)}}}function E(){if(!f){s();if(r.style.opacity==0){c.cancelAnimation(r);c.fadeTo(r,1,0.1,0,0)}}}function p(){try{o=document.getElementById(w.id);o.addEventListener("mousemove",B)}catch(H){c.log("Could not add mouse listeners to dock: "+H)}}this.hide=e;this.show=v;return this}})(jwplayer);(function(a){a.html5.eventdispatcher=function(d,b){var c=new a.events.eventdispatcher(b);a.utils.extend(this,c);this.sendEvent=function(e,f){if(!a.utils.exists(f)){f={}}a.utils.extend(f,{id:d,version:a.version,type:e});c.sendEvent(e,f)}}})(jwplayer);(function(a){var b=a.utils;a.html5.instream=function(y,m,x,z){var t={controlbarseekable:"always",controlbarpausable:true,controlbarstoppable:true,playlistclickable:true};var v,A,C=y,E=m,j=x,w=z,r,H,o,G,e,f,g,l,q,h=false,k,d,n=this;this.load=function(M,K){c();h=true;A=b.extend(t,K);v=a.html5.playlistitem(M);F();d=document.createElement("div");d.id=n.id+"_instream_container";w.detachMedia();r=g.getDisplayElement();f=E.playlist[E.item];e=C.jwGetState();if(e==a.api.events.state.BUFFERING||e==a.api.events.state.PLAYING){r.pause()}H=r.src?r.src:r.currentSrc;o=r.innerHTML;G=r.currentTime;q=new a.html5.display(n,b.extend({},E.plugins.config.display));q.setAlternateClickHandler(function(N){if(_fakemodel.state==a.api.events.state.PAUSED){n.jwInstreamPlay()}else{D(a.api.events.JWPLAYER_INSTREAM_CLICK,N)}});d.appendChild(q.getDisplayElement());if(!b.isMobile()){l=new a.html5.controlbar(n,b.extend({},E.plugins.config.controlbar,{}));if(E.plugins.config.controlbar.position==a.html5.view.positions.OVER){d.appendChild(l.getDisplayElement())}else{var L=E.plugins.object.controlbar.getDisplayElement().parentNode;L.appendChild(l.getDisplayElement())}}j.setupInstream(d,r);p();g.load(v)};this.jwInstreamDestroy=function(K){if(!h){return}h=false;if(e!=a.api.events.state.IDLE){g.load(f,false);g.stop(false)}else{g.stop(true)}g.detachMedia();j.destroyInstream();if(l){try{l.getDisplayElement().parentNode.removeChild(l.getDisplayElement())}catch(L){}}D(a.api.events.JWPLAYER_INSTREAM_DESTROYED,{reason:(K?"complete":"destroyed")},true);w.attachMedia();if(e==a.api.events.state.BUFFERING||e==a.api.events.state.PLAYING){r.play();if(E.playlist[E.item]==f){E.getMedia().seek(G)}}return};this.jwInstreamAddEventListener=function(K,L){k.addEventListener(K,L)};this.jwInstreamRemoveEventListener=function(K,L){k.removeEventListener(K,L)};this.jwInstreamPlay=function(){if(!h){return}g.play(true)};this.jwInstreamPause=function(){if(!h){return}g.pause(true)};this.jwInstreamSeek=function(K){if(!h){return}g.seek(K)};this.jwInstreamGetState=function(){if(!h){return undefined}return _fakemodel.state};this.jwInstreamGetPosition=function(){if(!h){return undefined}return _fakemodel.position};this.jwInstreamGetDuration=function(){if(!h){return undefined}return _fakemodel.duration};this.playlistClickable=function(){return(!h||A.playlistclickable.toString().toLowerCase()=="true")};function s(){_fakemodel=new a.html5.model(this,E.getMedia()?E.getMedia().getDisplayElement():E.container,E);k=new a.html5.eventdispatcher();C.jwAddEventListener(a.api.events.JWPLAYER_RESIZE,p);C.jwAddEventListener(a.api.events.JWPLAYER_FULLSCREEN,p)}function c(){_fakemodel.setMute(E.mute);_fakemodel.setVolume(E.volume)}function F(){if(!g){g=new a.html5.mediavideo(_fakemodel,E.getMedia()?E.getMedia().getDisplayElement():E.container);g.addGlobalListener(I);g.addEventListener(a.api.events.JWPLAYER_MEDIA_META,J);g.addEventListener(a.api.events.JWPLAYER_MEDIA_COMPLETE,u);g.addEventListener(a.api.events.JWPLAYER_MEDIA_BUFFER_FULL,B)}g.attachMedia()}function I(K){if(h){D(K.type,K)}}function B(K){if(h){g.play()}}function u(K){if(h){setTimeout(function(){n.jwInstreamDestroy(true)},10)}}function J(K){if(K.metadata.width&&K.metadata.height){j.resizeMedia()}}function D(K,L,M){if(h||M){k.sendEvent(K,L)}}function p(){var K=E.plugins.object.display.getDisplayElement().style;if(l){var L=E.plugins.object.controlbar.getDisplayElement().style;l.resize(b.parseDimension(K.width),b.parseDimension(K.height));_css(l.getDisplayElement(),b.extend({},L,{zIndex:1001,opacity:1}))}if(q){q.resize(b.parseDimension(K.width),b.parseDimension(K.height));_css(q.getDisplayElement(),b.extend({},K,{zIndex:1000}))}if(j){j.resizeMedia()}}this.jwPlay=function(K){if(A.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPlay()}};this.jwPause=function(K){if(A.controlbarpausable.toString().toLowerCase()=="true"){this.jwInstreamPause()}};this.jwStop=function(){if(A.controlbarstoppable.toString().toLowerCase()=="true"){this.jwInstreamDestroy();C.jwStop()}};this.jwSeek=function(K){switch(A.controlbarseekable.toLowerCase()){case"always":this.jwInstreamSeek(K);break;case"backwards":if(_fakemodel.position>K){this.jwInstreamSeek(K)}break}};this.jwGetPosition=function(){};this.jwGetDuration=function(){};this.jwGetWidth=C.jwGetWidth;this.jwGetHeight=C.jwGetHeight;this.jwGetFullscreen=C.jwGetFullscreen;this.jwSetFullscreen=C.jwSetFullscreen;this.jwGetVolume=function(){return E.volume};this.jwSetVolume=function(K){g.volume(K);C.jwSetVolume(K)};this.jwGetMute=function(){return E.mute};this.jwSetMute=function(K){g.mute(K);C.jwSetMute(K)};this.jwGetState=function(){return _fakemodel.state};this.jwGetPlaylist=function(){return[v]};this.jwGetPlaylistIndex=function(){return 0};this.jwGetStretching=function(){return E.config.stretching};this.jwAddEventListener=function(L,K){k.addEventListener(L,K)};this.jwRemoveEventListener=function(L,K){k.removeEventListener(L,K)};this.skin=C.skin;this.id=C.id+"_instream";s();return this}})(jwplayer);(function(a){var b={prefix:"http://l.longtailvideo.com/html5/",file:"logo.png",link:"http://www.longtailvideo.com/players/jw-flv-player/",linktarget:"_top",margin:8,out:0.5,over:1,timeout:5,hide:true,position:"bottom-left"};_css=a.utils.css;a.html5.logo=function(n,r){var q=n;var u;var d;var t;var h=false;g();function g(){o();q.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,j);c();l()}function o(){if(b.prefix){var v=n.version.split(/\W/).splice(0,2).join("/");if(b.prefix.indexOf(v)<0){b.prefix+=v+"/"}}if(r.position==a.html5.view.positions.OVER){r.position=b.position}try{if(window.location.href.indexOf("https")==0){b.prefix=b.prefix.replace("http://l.longtailvideo.com","https://securel.longtailvideo.com")}}catch(w){}d=a.utils.extend({},b)}function c(){t=document.createElement("img");t.id=q.id+"_jwplayer_logo";t.style.display="none";t.onload=function(v){_css(t,k());p()};if(!d.file){return}if(d.file.indexOf("/")>=0){t.src=d.file}else{t.src=d.prefix+d.file}}if(!d.file){return}this.resize=function(w,v){};this.getDisplayElement=function(){return t};function l(){if(d.link){t.onmouseover=f;t.onmouseout=p;t.onclick=s}else{this.mouseEnabled=false}}function s(v){if(typeof v!="undefined"){v.stopPropagation()}if(!h){return}q.jwPause();q.jwSetFullscreen(false);if(d.link){window.open(d.link,d.linktarget)}return}function p(v){if(d.link&&h){t.style.opacity=d.out}return}function f(v){if(h){t.style.opacity=d.over}return}function k(){var x={textDecoration:"none",position:"absolute",cursor:"pointer"};x.display=(d.hide.toString()=="true"&&!h)?"none":"block";var w=d.position.toLowerCase().split("-");for(var v in w){x[w[v]]=parseInt(d.margin)}return x}function m(){if(d.hide.toString()=="true"){t.style.display="block";t.style.opacity=0;a.utils.fadeTo(t,d.out,0.1,parseFloat(t.style.opacity));u=setTimeout(function(){e()},d.timeout*1000)}h=true}function e(){h=false;if(d.hide.toString()=="true"){a.utils.fadeTo(t,0,0.1,parseFloat(t.style.opacity))}}function j(v){if(v.newstate==a.api.events.state.BUFFERING){clearTimeout(u);m()}}return this}})(jwplayer);(function(b){var d={ended:b.api.events.state.IDLE,playing:b.api.events.state.PLAYING,pause:b.api.events.state.PAUSED,buffering:b.api.events.state.BUFFERING};var f=b.utils;var a=f.isMobile();var g,e;var c={};b.html5.mediavideo=function(k,I){var M={abort:A,canplay:r,canplaythrough:r,durationchange:w,emptied:A,ended:r,error:q,loadeddata:w,loadedmetadata:w,loadstart:r,pause:r,play:A,playing:r,progress:G,ratechange:A,seeked:r,seeking:r,stalled:r,suspend:r,timeupdate:Q,volumechange:n,waiting:r,canshowcurrentframe:A,dataunavailable:A,empty:A,load:j,loadedfirstframe:A,webkitfullscreenchange:m};var E={};var N=new b.html5.eventdispatcher();f.extend(this,N);var l=k,D=I,o,h,F,W,H,P,O=false,v=false,z=false,L,J,T;U();this.load=function(Y,Z){if(typeof Z=="undefined"){Z=true}if(!v){return}W=Y;z=(W.duration>0);l.duration=W.duration;f.empty(o);o.style.display="block";o.style.opacity=1;if(g&&e){o.style.width=g;o.style.height=e;g=_previousHieght=0}T=0;s(Y.levels);if(Y.levels&&Y.levels.length>0){if(Y.levels.length==1||f.isIOS()){o.src=Y.levels[0].file}else{if(o.src){o.removeAttribute("src")}for(var X=0;X<Y.levels.length;X++){var aa=o.ownerDocument.createElement("source");aa.src=Y.levels[X].file;o.appendChild(aa);T++}}}else{o.src=Y.file}o.volume=l.volume/100;o.muted=l.mute;if(a){S()}L=J=F=false;l.buffer=0;if(!f.exists(Y.start)){Y.start=0}P=(Y.start>0)?Y.start:-1;u(b.api.events.JWPLAYER_MEDIA_LOADED);if((!a&&Y.levels.length==1)||!O){o.load()}O=false;if(Z){y(b.api.events.state.BUFFERING);u(b.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:0});C()}if(o.videoWidth>0&&o.videoHeight>0){w()}};this.play=function(){if(!v){return}C();if(J){y(b.api.events.state.PLAYING)}else{o.load();y(b.api.events.state.BUFFERING)}o.play()};this.pause=function(){if(!v){return}o.pause();y(b.api.events.state.PAUSED)};this.seek=function(X){if(!v){return}if(!F&&o.readyState>0){if(!(l.duration<=0||isNaN(l.duration))&&!(l.position<=0||isNaN(l.position))){o.currentTime=X;o.play()}}else{P=X}};var B=this.stop=function(X){if(!v){return}if(!f.exists(X)){X=true}t();if(X){J=false;var Y=navigator.userAgent;if(o.webkitSupportsFullscreen){try{o.webkitExitFullscreen()}catch(Z){}}o.style.opacity=0;x();if(f.isIE()){o.src=""}else{o.removeAttribute("src")}f.empty(o);o.load();O=true}if(f.isIPod()){g=o.style.width;e=o.style.height;o.style.width=0;o.style.height=0}else{if(f.isIPad()){o.style.display="none";try{o.webkitExitFullscreen()}catch(aa){}}}y(b.api.events.state.IDLE)};this.fullscreen=function(X){if(X===true){this.resize("100%","100%")}else{this.resize(l.config.width,l.config.height)}};this.resize=function(Y,X){};this.volume=function(X){if(!a){o.volume=X/100;u(b.api.events.JWPLAYER_MEDIA_VOLUME,{volume:(X/100)})}};this.mute=function(X){if(!a){o.muted=X;u(b.api.events.JWPLAYER_MEDIA_MUTE,{mute:X})}};this.getDisplayElement=function(){return o};this.hasChrome=function(){return a&&(h==b.api.events.state.PLAYING)};this.detachMedia=function(){v=false;return this.getDisplayElement()};this.attachMedia=function(){v=true};this.destroy=function(){if(o&&o.parentNode){t();for(var X in M){o.removeEventListener(X,K(X,M[X]),true)}f.empty(o);D=o.parentNode;o.parentNode.removeChild(o);delete c[l.id];o=null}};function K(Y,X){if(E[Y]){return E[Y]}else{E[Y]=function(Z){if(f.exists(Z.target.parentNode)){X(Z)}};return E[Y]}}function U(){h=b.api.events.state.IDLE;v=true;o=p();o.setAttribute("x-webkit-airplay","allow");if(D.parentNode){o.id=D.id;D.parentNode.replaceChild(o,D)}}function p(){var X=c[l.id];if(!X){if(D.tagName.toLowerCase()=="video"){X=D}else{X=document.createElement("video")}c[l.id]=X;if(!X.id){X.id=D.id}}for(var Y in M){X.addEventListener(Y,K(Y,M[Y]),true)}return X}function y(X){if(X==b.api.events.state.PAUSED&&h==b.api.events.state.IDLE){return}if(a){switch(X){case b.api.events.state.PLAYING:S();break;case b.api.events.state.BUFFERING:case b.api.events.state.PAUSED:x();break}}if(h!=X){var Y=h;l.state=h=X;u(b.api.events.JWPLAYER_PLAYER_STATE,{oldstate:Y,newstate:X})}}function A(X){}function n(X){var Y=Math.round(o.volume*100);u(b.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Y},true);u(b.api.events.JWPLAYER_MEDIA_MUTE,{mute:o.muted},true)}function G(Z){if(!v){return}var Y;if(f.exists(Z)&&Z.lengthComputable&&Z.total){Y=Z.loaded/Z.total*100}else{if(f.exists(o.buffered)&&(o.buffered.length>0)){var X=o.buffered.length-1;if(X>=0){Y=o.buffered.end(X)/o.duration*100}}}if(f.useNativeFullscreen()&&f.exists(o.webkitDisplayingFullscreen)){if(l.fullscreen!=o.webkitDisplayingFullscreen){u(b.api.events.JWPLAYER_FULLSCREEN,{fullscreen:o.webkitDisplayingFullscreen},true)}}if(J===false&&h==b.api.events.state.BUFFERING){u(b.api.events.JWPLAYER_MEDIA_BUFFER_FULL);J=true}if(!L){if(Y==100){L=true}if(f.exists(Y)&&(Y>l.buffer)){l.buffer=Math.round(Y);u(b.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:Math.round(Y)})}}}function Q(Y){if(!v){return}if(f.exists(Y)&&f.exists(Y.target)){if(z>0){if(!isNaN(Y.target.duration)&&(isNaN(l.duration)||l.duration<1)){if(Y.target.duration==Infinity){l.duration=0}else{l.duration=Math.round(Y.target.duration*10)/10}}}if(!F&&o.readyState>0){y(b.api.events.state.PLAYING)}if(h==b.api.events.state.PLAYING){if(o.readyState>0&&(P>-1||!F)){F=true;try{if(o.currentTime!=P&&P>-1){o.currentTime=P;P=-1}}catch(X){}o.volume=l.volume/100;o.muted=l.mute}l.position=l.duration>0?(Math.round(Y.target.currentTime*10)/10):0;u(b.api.events.JWPLAYER_MEDIA_TIME,{position:l.position,duration:l.duration});if(l.position>=l.duration&&(l.position>0||l.duration>0)){R();return}}}G(Y)}function j(X){}function r(X){if(!v){return}if(g&&e){o.style.width=g;o.style.height=e;g=_previousHieght=0}if(d[X.type]){if(X.type=="ended"){R()}else{y(d[X.type])}}}function w(Y){if(!v){return}var X=Math.round(o.duration*10)/10;var Z={height:o.videoHeight,width:o.videoWidth,duration:X};if(!z){if((l.duration<X||isNaN(l.duration))&&o.duration!=Infinity){l.duration=X}}u(b.api.events.JWPLAYER_MEDIA_META,{metadata:Z})}function q(Z){if(!v){return}if(h==b.api.events.state.IDLE){return}var Y="There was an error: ";if((Z.target.error&&Z.target.tagName.toLowerCase()=="video")||Z.target.parentNode.error&&Z.target.parentNode.tagName.toLowerCase()=="video"){var X=!f.exists(Z.target.error)?Z.target.parentNode.error:Z.target.error;switch(X.code){case X.MEDIA_ERR_ABORTED:f.log("User aborted the video playback.");return;case X.MEDIA_ERR_NETWORK:Y="A network error caused the video download to fail part-way: ";break;case X.MEDIA_ERR_DECODE:Y="The video playback was aborted due to a corruption problem or because the video used features your browser did not support: ";break;case X.MEDIA_ERR_SRC_NOT_SUPPORTED:Y="The video could not be loaded, either because the server or network failed or because the format is not supported: ";break;default:Y="An unknown error occurred: ";break}}else{if(Z.target.tagName.toLowerCase()=="source"){T--;if(T>0){return}if(f.userAgentMatch(/firefox/i)){f.log("The video could not be loaded, either because the server or network failed or because the format is not supported.");B(false);return}else{Y="The video could not be loaded, either because the server or network failed or because the format is not supported: "}}else{f.log("An unknown error occurred. Continuing...");return}}B(false);Y+=V();_error=true;u(b.api.events.JWPLAYER_ERROR,{message:Y});return}function V(){var Z="";for(var Y in W.levels){var X=W.levels[Y];var aa=D.ownerDocument.createElement("source");Z+=b.utils.getAbsolutePath(X.file);if(Y<(W.levels.length-1)){Z+=", "}}return Z}function C(){if(!f.exists(H)){H=setInterval(function(){G()},100)}}function t(){clearInterval(H);H=null}function R(){if(h==b.api.events.state.PLAYING){B(false);u(b.api.events.JWPLAYER_MEDIA_BEFORECOMPLETE);u(b.api.events.JWPLAYER_MEDIA_COMPLETE)}}function m(X){if(f.exists(o.webkitDisplayingFullscreen)){if(l.fullscreen&&!o.webkitDisplayingFullscreen){u(b.api.events.JWPLAYER_FULLSCREEN,{fullscreen:false},true)}}}function s(Z){if(Z.length>0&&f.userAgentMatch(/Safari/i)&&!f.userAgentMatch(/Chrome/i)){var X=-1;for(var Y=0;Y<Z.length;Y++){switch(f.extension(Z[Y].file)){case"mp4":if(X<0){X=Y}break;case"webm":Z.splice(Y,1);break}}if(X>0){var aa=Z.splice(X,1)[0];Z.unshift(aa)}}}function S(){setTimeout(function(){o.setAttribute("controls","controls")},100)}function x(){setTimeout(function(){o.removeAttribute("controls")},250)}function u(X,Z,Y){if(v||Y){if(Z){N.sendEvent(X,Z)}else{N.sendEvent(X)}}}}})(jwplayer);(function(a){var c={ended:a.api.events.state.IDLE,playing:a.api.events.state.PLAYING,pause:a.api.events.state.PAUSED,buffering:a.api.events.state.BUFFERING};var b=a.utils.css;a.html5.mediayoutube=function(j,e){var f=new a.html5.eventdispatcher();a.utils.extend(this,f);var l=j;var h=document.getElementById(e.id);var g=a.api.events.state.IDLE;var n,m;function k(p){if(g!=p){var q=g;l.state=p;g=p;f.sendEvent(a.api.events.JWPLAYER_PLAYER_STATE,{oldstate:q,newstate:p})}}this.getDisplayElement=this.detachMedia=function(){return h};this.attachMedia=function(){};this.play=function(){if(g==a.api.events.state.IDLE){f.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:100});f.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER_FULL);k(a.api.events.state.PLAYING)}else{if(g==a.api.events.state.PAUSED){k(a.api.events.state.PLAYING)}}};this.pause=function(){k(a.api.events.state.PAUSED)};this.seek=function(p){};this.stop=function(p){if(!_utils.exists(p)){p=true}l.position=0;k(a.api.events.state.IDLE);if(p){b(h,{display:"none"})}};this.volume=function(p){l.setVolume(p);f.sendEvent(a.api.events.JWPLAYER_MEDIA_VOLUME,{volume:Math.round(p)})};this.mute=function(p){h.muted=p;f.sendEvent(a.api.events.JWPLAYER_MEDIA_MUTE,{mute:p})};this.resize=function(q,p){if(q*p>0&&n){n.width=m.width=q;n.height=m.height=p}};this.fullscreen=function(p){if(p===true){this.resize("100%","100%")}else{this.resize(l.config.width,l.config.height)}};this.load=function(p){o(p);b(n,{display:"block"});k(a.api.events.state.BUFFERING);f.sendEvent(a.api.events.JWPLAYER_MEDIA_BUFFER,{bufferPercent:0});f.sendEvent(a.api.events.JWPLAYER_MEDIA_LOADED);this.play()};this.hasChrome=function(){return(g!=a.api.events.state.IDLE)};function o(v){var s=v.levels[0].file;s=["http://www.youtube.com/v/",d(s),"&hl=en_US&fs=1&autoplay=1"].join("");n=document.createElement("object");n.id=h.id;n.style.position="absolute";var u={movie:s,allowfullscreen:"true",allowscriptaccess:"always"};for(var p in u){var t=document.createElement("param");t.name=p;t.value=u[p];n.appendChild(t)}m=document.createElement("embed");n.appendChild(m);var q={src:s,type:"application/x-shockwave-flash",allowfullscreen:"true",allowscriptaccess:"always",width:n.width,height:n.height};for(var r in q){m.setAttribute(r,q[r])}n.appendChild(m);n.style.zIndex=2147483000;if(h!=n&&h.parentNode){h.parentNode.replaceChild(n,h)}h=n}function d(q){var p=q.split(/\?|\#\!/);var s="";for(var r=0;r<p.length;r++){if(p[r].substr(0,2)=="v="){s=p[r].substr(2)}}if(s==""){if(q.indexOf("/v/")>=0){s=q.substr(q.indexOf("/v/")+3)}else{if(q.indexOf("youtu.be")>=0){s=q.substr(q.indexOf("youtu.be/")+9)}else{s=q}}}if(s.indexOf("?")>-1){s=s.substr(0,s.indexOf("?"))}if(s.indexOf("&")>-1){s=s.substr(0,s.indexOf("&"))}return s}this.embed=m;return this}})(jwplayer);(function(jwplayer){var _configurableStateVariables=["width","height","start","duration","volume","mute","fullscreen","item","plugins","stretching"];var _utils=jwplayer.utils;jwplayer.html5.model=function(api,container,options){var _api=api;var _container=container;var _cookies=_utils.getCookies();var _model={id:_container.id,playlist:[],state:jwplayer.api.events.state.IDLE,position:0,buffer:0,container:_container,config:{width:480,height:320,item:-1,skin:undefined,file:undefined,image:undefined,start:0,duration:0,bufferlength:5,volume:_cookies.volume?_cookies.volume:90,mute:_cookies.mute&&_cookies.mute.toString().toLowerCase()=="true"?true:false,fullscreen:false,repeat:"",stretching:jwplayer.utils.stretching.UNIFORM,autostart:false,debug:undefined,screencolor:undefined}};var _media;var _eventDispatcher=new jwplayer.html5.eventdispatcher();var _components=["display","logo","controlbar","playlist","dock"];jwplayer.utils.extend(_model,_eventDispatcher);for(var option in options){if(typeof options[option]=="string"){var type=/color$/.test(option)?"color":null;options[option]=jwplayer.utils.typechecker(options[option],type)}var config=_model.config;var path=option.split(".");for(var edge in path){if(edge==path.length-1){config[path[edge]]=options[option]}else{if(!jwplayer.utils.exists(config[path[edge]])){config[path[edge]]={}}config=config[path[edge]]}}}for(var index in _configurableStateVariables){var configurableStateVariable=_configurableStateVariables[index];_model[configurableStateVariable]=_model.config[configurableStateVariable]}var pluginorder=_components.concat([]);if(jwplayer.utils.exists(_model.plugins)){if(typeof _model.plugins=="string"){var userplugins=_model.plugins.split(",");for(var userplugin in userplugins){if(typeof userplugins[userplugin]=="string"){pluginorder.push(userplugins[userplugin].replace(/^\s+|\s+$/g,""))}}}}if(jwplayer.utils.isMobile()){pluginorder=["display","logo","dock","playlist"];if(!jwplayer.utils.exists(_model.config.repeat)){_model.config.repeat="list"}}else{if(_model.config.chromeless){pluginorder=["logo","dock","playlist"];if(!jwplayer.utils.exists(_model.config.repeat)){_model.config.repeat="list"}}}_model.plugins={order:pluginorder,config:{},object:{}};if(typeof _model.config.components!="undefined"){for(var component in _model.config.components){_model.plugins.config[component]=_model.config.components[component]}}var playlistVisible=false;for(var pluginIndex in _model.plugins.order){var pluginName=_model.plugins.order[pluginIndex];var pluginConfig=!jwplayer.utils.exists(_model.plugins.config[pluginName])?{}:_model.plugins.config[pluginName];_model.plugins.config[pluginName]=!jwplayer.utils.exists(_model.plugins.config[pluginName])?pluginConfig:jwplayer.utils.extend(_model.plugins.config[pluginName],pluginConfig);if(!jwplayer.utils.exists(_model.plugins.config[pluginName].position)){if(pluginName=="playlist"){_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.NONE}else{_model.plugins.config[pluginName].position=jwplayer.html5.view.positions.OVER}}else{if(pluginName=="playlist"){playlistVisible=true}_model.plugins.config[pluginName].position=_model.plugins.config[pluginName].position.toString().toUpperCase()}}if(_model.plugins.config.controlbar&&playlistVisible){_model.plugins.config.controlbar.hideplaylistcontrols=true}if(typeof _model.plugins.config.dock!="undefined"){if(typeof _model.plugins.config.dock!="object"){var position=_model.plugins.config.dock.toString().toUpperCase();_model.plugins.config.dock={position:position}}if(typeof _model.plugins.config.dock.position!="undefined"){_model.plugins.config.dock.align=_model.plugins.config.dock.position;_model.plugins.config.dock.position=jwplayer.html5.view.positions.OVER}if(typeof _model.plugins.config.dock.idlehide=="undefined"){try{_model.plugins.config.dock.idlehide=_model.plugins.config.controlbar.idlehide}catch(e){}}}function _loadExternal(playlistfile){var loader=new jwplayer.html5.playlistloader();loader.addEventListener(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,function(evt){_model.playlist=new jwplayer.html5.playlist(evt);_loadComplete(true)});loader.addEventListener(jwplayer.api.events.JWPLAYER_ERROR,function(evt){_model.playlist=new jwplayer.html5.playlist({playlist:[]});_loadComplete(false)});loader.load(playlistfile)}function _loadComplete(){if(_model.config.shuffle){_model.item=_getShuffleItem()}else{if(_model.config.item>=_model.playlist.length){_model.config.item=_model.playlist.length-1}else{if(_model.config.item<0){_model.config.item=0}}_model.item=_model.config.item}_model.position=0;_model.duration=_model.playlist.length>0?_model.playlist[_model.item].duration:0;_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:_model.playlist});_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_PLAYLIST_ITEM,{index:_model.item})}_model.loadPlaylist=function(arg){var input;if(typeof arg=="string"){if(arg.indexOf("[")==0||arg.indexOf("{")=="0"){try{input=eval(arg)}catch(err){input=arg}}else{input=arg}}else{input=arg}var config;switch(jwplayer.utils.typeOf(input)){case"object":config=input;break;case"array":config={playlist:input};break;default:config={file:input};break}_model.playlist=new jwplayer.html5.playlist(config);_model.item=_model.config.item>=0?_model.config.item:0;if(!_model.playlist[0].provider&&_model.playlist[0].file){_loadExternal(_model.playlist[0].file)}else{_loadComplete()}};function _getShuffleItem(){var result=null;if(_model.playlist.length>1){while(!jwplayer.utils.exists(result)){result=Math.floor(Math.random()*_model.playlist.length);if(result==_model.item){result=null}}}else{result=0}return result}function forward(evt){switch(evt.type){case jwplayer.api.events.JWPLAYER_MEDIA_LOADED:_container=_media.getDisplayElement();break;case jwplayer.api.events.JWPLAYER_MEDIA_MUTE:this.mute=evt.mute;break;case jwplayer.api.events.JWPLAYER_MEDIA_VOLUME:this.volume=evt.volume;break}_eventDispatcher.sendEvent(evt.type,evt)}var _mediaProviders={};_model.setActiveMediaProvider=function(playlistItem){if(playlistItem.provider=="audio"){playlistItem.provider="sound"}var provider=playlistItem.provider;var current=_media?_media.getDisplayElement():null;if(provider=="sound"||provider=="http"||provider==""){provider="video"}if(!jwplayer.utils.exists(_mediaProviders[provider])){switch(provider){case"video":_media=new jwplayer.html5.mediavideo(_model,current?current:_container);break;case"youtube":_media=new jwplayer.html5.mediayoutube(_model,current?current:_container);break}if(!jwplayer.utils.exists(_media)){return false}_media.addGlobalListener(forward);_mediaProviders[provider]=_media}else{if(_media!=_mediaProviders[provider]){if(_media){_media.stop()}_media=_mediaProviders[provider]}}return true};_model.getMedia=function(){return _media};_model.seek=function(pos){_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_MEDIA_SEEK,{position:_model.position,offset:pos});return _media.seek(pos)};_model.setVolume=function(newVol){_utils.saveCookie("volume",newVol);_model.volume=newVol};_model.setMute=function(state){_utils.saveCookie("mute",state);_model.mute=state};_model.setupPlugins=function(){if(!jwplayer.utils.exists(_model.plugins)||!jwplayer.utils.exists(_model.plugins.order)||_model.plugins.order.length==0){jwplayer.utils.log("No plugins to set up");return _model}for(var i=0;i<_model.plugins.order.length;i++){try{var pluginName=_model.plugins.order[i];if(jwplayer.utils.exists(jwplayer.html5[pluginName])){if(pluginName=="playlist"){_model.plugins.object[pluginName]=new jwplayer.html5.playlistcomponent(_api,_model.plugins.config[pluginName])}else{_model.plugins.object[pluginName]=new jwplayer.html5[pluginName](_api,_model.plugins.config[pluginName])}}else{_model.plugins.order.splice(plugin,plugin+1)}if(typeof _model.plugins.object[pluginName].addGlobalListener=="function"){_model.plugins.object[pluginName].addGlobalListener(forward)}}catch(err){jwplayer.utils.log("Could not setup "+pluginName)}}};return _model}})(jwplayer);(function(a){a.html5.playlist=function(b){var d=[];if(b.playlist&&b.playlist instanceof Array&&b.playlist.length>0){for(var c in b.playlist){if(!isNaN(parseInt(c))){d.push(new a.html5.playlistitem(b.playlist[c]))}}}else{d.push(new a.html5.playlistitem(b))}return d}})(jwplayer);(function(a){var c={size:180,position:a.html5.view.positions.NONE,itemheight:60,thumbs:true,fontcolor:"#000000",overcolor:"",activecolor:"",backgroundcolor:"#f8f8f8",font:"_sans",fontsize:"",fontstyle:"",fontweight:""};var b={_sans:"Arial, Helvetica, sans-serif",_serif:"Times, Times New Roman, serif",_typewriter:"Courier New, Courier, monospace"};_utils=a.utils;_css=_utils.css;_hide=function(d){_css(d,{display:"none"})};_show=function(d){_css(d,{display:"block"})};a.html5.playlistcomponent=function(r,C){var x=r;var e=a.utils.extend({},c,x.skin.getComponentSettings("playlist"),C);if(e.position==a.html5.view.positions.NONE||typeof a.html5.view.positions[e.position]=="undefined"){return}var y;var l;var D;var d;var g;var f;var k=-1;var h={background:undefined,item:undefined,itemOver:undefined,itemImage:undefined,itemActive:undefined};this.getDisplayElement=function(){return y};this.resize=function(G,E){l=G;D=E;if(x.jwGetFullscreen()){_hide(y)}else{var F={display:"block",width:l,height:D};_css(y,F)}};this.show=function(){_show(y)};this.hide=function(){_hide(y)};function j(){y=document.createElement("div");y.id=x.id+"_jwplayer_playlistcomponent";y.style.overflow="hidden";switch(e.position){case a.html5.view.positions.RIGHT:case a.html5.view.positions.LEFT:y.style.width=e.size+"px";break;case a.html5.view.positions.TOP:case a.html5.view.positions.BOTTOM:y.style.height=e.size+"px";break}B();if(h.item){e.itemheight=h.item.height}y.style.backgroundColor="#C6C6C6";x.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,s);x.jwAddEventListener(a.api.events.JWPLAYER_PLAYLIST_ITEM,v);x.jwAddEventListener(a.api.events.JWPLAYER_PLAYER_STATE,m)}function p(){var E=document.createElement("ul");_css(E,{width:y.style.width,minWidth:y.style.width,height:y.style.height,backgroundColor:e.backgroundcolor,backgroundImage:h.background?"url("+h.background.src+")":"",color:e.fontcolor,listStyle:"none",margin:0,padding:0,fontFamily:b[e.font]?b[e.font]:b._sans,fontSize:(e.fontsize?e.fontsize:11)+"px",fontStyle:e.fontstyle,fontWeight:e.fontweight,overflowY:"auto"});return E}function z(E){return function(){var F=f.getElementsByClassName("item")[E];var G=e.fontcolor;var H=h.item?"url("+h.item.src+")":"";if(E==x.jwGetPlaylistIndex()){if(e.activecolor!==""){G=e.activecolor}if(h.itemActive){H="url("+h.itemActive.src+")"}}_css(F,{color:e.overcolor!==""?e.overcolor:G,backgroundImage:h.itemOver?"url("+h.itemOver.src+")":H})}}function o(E){return function(){var F=f.getElementsByClassName("item")[E];var G=e.fontcolor;var H=h.item?"url("+h.item.src+")":"";if(E==x.jwGetPlaylistIndex()){if(e.activecolor!==""){G=e.activecolor}if(h.itemActive){H="url("+h.itemActive.src+")"}}_css(F,{color:G,backgroundImage:H})}}function q(J){var Q=d[J];var P=document.createElement("li");P.className="item";_css(P,{height:e.itemheight,display:"block",cursor:"pointer",backgroundImage:h.item?"url("+h.item.src+")":"",backgroundSize:"100% "+e.itemheight+"px"});P.onmouseover=z(J);P.onmouseout=o(J);var K=document.createElement("div");var G=new Image();var L=0;var M=0;var N=0;if(w()&&(Q.image||Q["playlist.image"]||h.itemImage)){G.className="image";if(h.itemImage){L=(e.itemheight-h.itemImage.height)/2;M=h.itemImage.width;N=h.itemImage.height}else{M=e.itemheight*4/3;N=e.itemheight}_css(K,{height:N,width:M,"float":"left",styleFloat:"left",cssFloat:"left",margin:"0 5px 0 0",background:"black",overflow:"hidden",margin:L+"px",position:"relative"});_css(G,{position:"relative"});K.appendChild(G);G.onload=function(){a.utils.stretch(a.utils.stretching.FILL,G,M,N,this.naturalWidth,this.naturalHeight)};if(Q["playlist.image"]){G.src=Q["playlist.image"]}else{if(Q.image){G.src=Q.image}else{if(h.itemImage){G.src=h.itemImage.src}}}P.appendChild(K)}var F=l-M-L*2;if(D<e.itemheight*d.length){F-=15}var E=document.createElement("div");_css(E,{position:"relative",height:"100%",overflow:"hidden"});var H=document.createElement("span");if(Q.duration>0){H.className="duration";_css(H,{fontSize:(e.fontsize?e.fontsize:11)+"px",fontWeight:(e.fontweight?e.fontweight:"bold"),width:"40px",height:e.fontsize?e.fontsize+10:20,lineHeight:24,"float":"right",styleFloat:"right",cssFloat:"right"});H.innerHTML=_utils.timeFormat(Q.duration);E.appendChild(H)}var O=document.createElement("span");O.className="title";_css(O,{padding:"5px 5px 0 "+(L?0:"5px"),height:e.fontsize?e.fontsize+10:20,lineHeight:e.fontsize?e.fontsize+10:20,overflow:"hidden","float":"left",styleFloat:"left",cssFloat:"left",width:((Q.duration>0)?F-50:F)-10+"px",fontSize:(e.fontsize?e.fontsize:13)+"px",fontWeight:(e.fontweight?e.fontweight:"bold")});O.innerHTML=Q?Q.title:"";E.appendChild(O);if(Q.description){var I=document.createElement("span");I.className="description";_css(I,{display:"block","float":"left",styleFloat:"left",cssFloat:"left",margin:0,paddingLeft:O.style.paddingLeft,paddingRight:O.style.paddingRight,lineHeight:(e.fontsize?e.fontsize+4:16)+"px",overflow:"hidden",position:"relative"});I.innerHTML=Q.description;E.appendChild(I)}P.appendChild(E);return P}function s(F){y.innerHTML="";d=t();if(!d){return}items=[];f=p();for(var G=0;G<d.length;G++){var E=q(G);E.onclick=A(G);f.appendChild(E);items.push(E)}k=x.jwGetPlaylistIndex();o(k)();y.appendChild(f);if(_utils.isIOS()&&window.iScroll){f.style.height=e.itemheight*d.length+"px";var H=new iScroll(y.id)}}function t(){var F=x.jwGetPlaylist();var G=[];for(var E=0;E<F.length;E++){if(!F[E]["ova.hidden"]){G.push(F[E])}}return G}function A(E){return function(){x.jwPlaylistItem(E);x.jwPlay(true)}}function n(){f.scrollTop=x.jwGetPlaylistIndex()*e.itemheight}function w(){return e.thumbs.toString().toLowerCase()=="true"}function v(E){if(k>=0){o(k)();k=E.index}o(E.index)();n()}function m(){if(e.position==a.html5.view.positions.OVER){switch(x.jwGetState()){case a.api.events.state.IDLE:_show(y);break;default:_hide(y);break}}}function B(){for(var E in h){h[E]=u(E)}}function u(E){return x.skin.getSkinElement("playlist",E)}j();return this}})(jwplayer);(function(b){b.html5.playlistitem=function(d){var e={author:"",date:"",description:"",image:"",link:"",mediaid:"",tags:"",title:"",provider:"",file:"",streamer:"",duration:-1,start:0,currentLevel:-1,levels:[]};var c=b.utils.extend({},e,d);if(c.type){c.provider=c.type;delete c.type}if(c.levels.length===0){c.levels[0]=new b.html5.playlistitemlevel(c)}if(!c.provider){c.provider=a(c.levels[0])}else{c.provider=c.provider.toLowerCase()}return c};function a(e){if(b.utils.isYouTube(e.file)){return"youtube"}else{var f=b.utils.extension(e.file);var c;if(f&&b.utils.extensionmap[f]){if(f=="m3u8"){return"video"}c=b.utils.extensionmap[f].html5}else{if(e.type){c=e.type}}if(c){var d=c.split("/")[0];if(d=="audio"){return"sound"}else{if(d=="video"){return d}}}}return""}})(jwplayer);(function(a){a.html5.playlistitemlevel=function(b){var d={file:"",streamer:"",bitrate:0,width:0};for(var c in d){if(a.utils.exists(b[c])){d[c]=b[c]}}return d}})(jwplayer);(function(a){a.html5.playlistloader=function(){var c=new a.html5.eventdispatcher();a.utils.extend(this,c);this.load=function(e){a.utils.ajax(e,d,b)};function d(g){var f=[];try{var f=a.utils.parsers.rssparser.parse(g.responseXML.firstChild);c.sendEvent(a.api.events.JWPLAYER_PLAYLIST_LOADED,{playlist:new a.html5.playlist({playlist:f})})}catch(h){b("Could not parse the playlist")}}function b(e){c.sendEvent(a.api.events.JWPLAYER_ERROR,{message:e?e:"Could not load playlist an unknown reason."})}}})(jwplayer);(function(a){a.html5.skin=function(){var b={};var c=false;this.load=function(d,e){new a.html5.skinloader(d,function(f){c=true;b=f;e()},function(){new a.html5.skinloader("",function(f){c=true;b=f;e()})})};this.getSkinElement=function(d,e){if(c){try{return b[d].elements[e]}catch(f){a.utils.log("No such skin component / element: ",[d,e])}}return null};this.getComponentSettings=function(d){if(c&&b&&b[d]){return b[d].settings}return null};this.getComponentLayout=function(d){if(c){return b[d].layout}return null}}})(jwplayer);(function(a){a.html5.skinloader=function(f,p,k){var o={};var c=p;var l=k;var e=true;var j;var n=f;var s=false;function m(){if(typeof n!="string"||n===""){d(a.html5.defaultSkin().xml)}else{a.utils.ajax(a.utils.getAbsolutePath(n),function(t){try{if(a.utils.exists(t.responseXML)){d(t.responseXML);return}}catch(u){h()}d(a.html5.defaultSkin().xml)},function(t){d(a.html5.defaultSkin().xml)})}}function d(y){var E=y.getElementsByTagName("component");if(E.length===0){return}for(var H=0;H<E.length;H++){var C=E[H].getAttribute("name");var B={settings:{},elements:{},layout:{}};o[C]=B;var G=E[H].getElementsByTagName("elements")[0].getElementsByTagName("element");for(var F=0;F<G.length;F++){b(G[F],C)}var z=E[H].getElementsByTagName("settings")[0];if(z&&z.childNodes.length>0){var K=z.getElementsByTagName("setting");for(var P=0;P<K.length;P++){var Q=K[P].getAttribute("name");var I=K[P].getAttribute("value");var x=/color$/.test(Q)?"color":null;o[C].settings[Q]=a.utils.typechecker(I,x)}}var L=E[H].getElementsByTagName("layout")[0];if(L&&L.childNodes.length>0){var M=L.getElementsByTagName("group");for(var w=0;w<M.length;w++){var A=M[w];o[C].layout[A.getAttribute("position")]={elements:[]};for(var O=0;O<A.attributes.length;O++){var D=A.attributes[O];o[C].layout[A.getAttribute("position")][D.name]=D.value}var N=A.getElementsByTagName("*");for(var v=0;v<N.length;v++){var t=N[v];o[C].layout[A.getAttribute("position")].elements.push({type:t.tagName});for(var u=0;u<t.attributes.length;u++){var J=t.attributes[u];o[C].layout[A.getAttribute("position")].elements[v][J.name]=J.value}if(!a.utils.exists(o[C].layout[A.getAttribute("position")].elements[v].name)){o[C].layout[A.getAttribute("position")].elements[v].name=t.tagName}}}}e=false;r()}}function r(){clearInterval(j);if(!s){j=setInterval(function(){q()},100)}}function b(y,x){var w=new Image();var t=y.getAttribute("name");var v=y.getAttribute("src");var A;if(v.indexOf("data:image/png;base64,")===0){A=v}else{var u=a.utils.getAbsolutePath(n);var z=u.substr(0,u.lastIndexOf("/"));A=[z,x,v].join("/")}o[x].elements[t]={height:0,width:0,src:"",ready:false,image:w};w.onload=function(B){g(w,t,x)};w.onerror=function(B){s=true;r();l()};w.src=A}function h(){for(var u in o){var w=o[u];for(var t in w.elements){var x=w.elements[t];var v=x.image;v.onload=null;v.onerror=null;delete x.image;delete w.elements[t]}delete o[u]}}function q(){for(var t in o){if(t!="properties"){for(var u in o[t].elements){if(!o[t].elements[u].ready){return}}}}if(e===false){clearInterval(j);c(o)}}function g(t,v,u){if(o[u]&&o[u].elements[v]){o[u].elements[v].height=t.height;o[u].elements[v].width=t.width;o[u].elements[v].src=t.src;o[u].elements[v].ready=true;r()}else{a.utils.log("Loaded an image for a missing element: "+u+"."+v)}}m()}})(jwplayer);(function(a){a.html5.api=function(c,p){var n={};var g=document.createElement("div");c.parentNode.replaceChild(g,c);g.id=c.id;n.version=a.version;n.id=g.id;var m=new a.html5.model(n,g,p);var k=new a.html5.view(n,g,m);var l=new a.html5.controller(n,g,m,k);n.skin=new a.html5.skin();n.jwPlay=function(q){if(typeof q=="undefined"){f()}else{if(q.toString().toLowerCase()=="true"){l.play()}else{l.pause()}}};n.jwPause=function(q){if(typeof q=="undefined"){f()}else{if(q.toString().toLowerCase()=="true"){l.pause()}else{l.play()}}};function f(){if(m.state==a.api.events.state.PLAYING||m.state==a.api.events.state.BUFFERING){l.pause()}else{l.play()}}n.jwStop=l.stop;n.jwSeek=l.seek;n.jwPlaylistItem=function(q){if(d){if(d.playlistClickable()){d.jwInstreamDestroy();return l.item(q)}}else{return l.item(q)}};n.jwPlaylistNext=l.next;n.jwPlaylistPrev=l.prev;n.jwResize=l.resize;n.jwLoad=l.load;n.jwDetachMedia=l.detachMedia;n.jwAttachMedia=l.attachMedia;function j(q){return function(){return m[q]}}function e(q,s,r){return function(){var t=m.plugins.object[q];if(t&&t[s]&&typeof t[s]=="function"){t[s].apply(t,r)}}}n.jwGetPlaylistIndex=j("item");n.jwGetPosition=j("position");n.jwGetDuration=j("duration");n.jwGetBuffer=j("buffer");n.jwGetWidth=j("width");n.jwGetHeight=j("height");n.jwGetFullscreen=j("fullscreen");n.jwSetFullscreen=l.setFullscreen;n.jwGetVolume=j("volume");n.jwSetVolume=l.setVolume;n.jwGetMute=j("mute");n.jwSetMute=l.setMute;n.jwGetStretching=function(){return m.stretching.toUpperCase()};n.jwGetState=j("state");n.jwGetVersion=function(){return n.version};n.jwGetPlaylist=function(){return m.playlist};n.jwAddEventListener=l.addEventListener;n.jwRemoveEventListener=l.removeEventListener;n.jwSendEvent=l.sendEvent;n.jwDockSetButton=function(t,q,r,s){if(m.plugins.object.dock&&m.plugins.object.dock.setButton){m.plugins.object.dock.setButton(t,q,r,s)}};n.jwControlbarShow=e("controlbar","show");n.jwControlbarHide=e("controlbar","hide");n.jwDockShow=e("dock","show");n.jwDockHide=e("dock","hide");n.jwDisplayShow=e("display","show");n.jwDisplayHide=e("display","hide");var d;n.jwLoadInstream=function(r,q){if(!d){d=new a.html5.instream(n,m,k,l)}setTimeout(function(){d.load(r,q)},10)};n.jwInstreamDestroy=function(){if(d){d.jwInstreamDestroy()}};n.jwInstreamAddEventListener=o("jwInstreamAddEventListener");n.jwInstreamRemoveEventListener=o("jwInstreamRemoveEventListener");n.jwInstreamGetState=o("jwInstreamGetState");n.jwInstreamGetDuration=o("jwInstreamGetDuration");n.jwInstreamGetPosition=o("jwInstreamGetPosition");n.jwInstreamPlay=o("jwInstreamPlay");n.jwInstreamPause=o("jwInstreamPause");n.jwInstreamSeek=o("jwInstreamSeek");function o(q){return function(){if(d&&typeof d[q]=="function"){return d[q].apply(this,arguments)}else{_utils.log("Could not call instream method - instream API not initialized")}}}n.jwDestroy=function(){l.destroy()};n.jwGetLevel=function(){};n.jwGetBandwidth=function(){};n.jwGetLockState=function(){};n.jwLock=function(){};n.jwUnlock=function(){};function b(){if(m.config.playlistfile){m.addEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,h);m.loadPlaylist(m.config.playlistfile)}else{if(typeof m.config.playlist=="string"){m.addEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,h);m.loadPlaylist(m.config.playlist)}else{m.loadPlaylist(m.config);setTimeout(h,25)}}}function h(q){m.removeEventListener(a.api.events.JWPLAYER_PLAYLIST_LOADED,h);m.setupPlugins();k.setup();var q={id:n.id,version:n.version};l.playerReady(q)}if(m.config.chromeless&&!a.utils.isIOS()){b()}else{n.skin.load(m.config.skin,b)}return n}})(jwplayer)};
|
js/video/jwplayer6.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};jwplayer.version="6.1.2972";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(d){var j=document,g=window,b=navigator,h="undefined",f="string",c="object";var k=d.utils=function(){};k.exists=function(m){switch(typeof(m)){case f:return(m.length>0);break;case c:return(m!==null);case h:return false}return true};k.styleDimension=function(m){return m+(m.toString().indexOf("%")>0?"":"px")};k.getAbsolutePath=function(s,r){if(!k.exists(r)){r=j.location.href}if(!k.exists(s)){return undefined}if(a(s)){return s}var t=r.substring(0,r.indexOf("://")+3);var q=r.substring(t.length,r.indexOf("/",t.length+1));var n;if(s.indexOf("/")===0){n=s.split("/")}else{var o=r.split("?")[0];o=o.substring(t.length+q.length+1,o.lastIndexOf("/"));n=o.split("/").concat(s.split("/"))}var m=[];for(var p=0;p<n.length;p++){if(!n[p]||!k.exists(n[p])||n[p]=="."){continue}else{if(n[p]==".."){m.pop()}else{m.push(n[p])}}}return t+q+"/"+m.join("/")};function a(n){if(!k.exists(n)){return}var o=n.indexOf("://");var m=n.indexOf("?");return(o>0&&(m<0||(m>o)))}k.extend=function(){var m=k.extend["arguments"];if(m.length>1){for(var o=1;o<m.length;o++){for(var n in m[o]){try{if(k.exists(m[o][n])){m[0][n]=m[o][n]}}catch(p){}}}return m[0]}return null};k.log=function(n,m){if(typeof console!=h&&typeof console.log!=h){if(m){console.log(n,m)}else{console.log(n)}}};var e=k.userAgentMatch=function(n){var m=b.userAgent.toLowerCase();return(m.match(n)!==null)};function l(m){return function(){return e(m)}}k.isIE=l(/msie/i);k.isFF=l(/firefox/i);k.isChrome=l(/chrome/i);k.isIOS=l(/iP(hone|ad|od)/i);k.isIPod=l(/iP(hone|od)/i);k.isIPad=l(/iPad/i);k.isAndroid=function(m){if(m){return e(new RegExp("android.*"+m,"i"))}else{return e(/android/i)}};k.isMobile=function(){return k.isIOS()||k.isAndroid()};k.saveCookie=function(m,n){j.cookie="jwplayer."+m+"="+n+"; path=/"};k.getCookies=function(){var p={};var o=j.cookie.split("; ");for(var n=0;n<o.length;n++){var m=o[n].split("=");if(m[0].indexOf("jwplayer.")==0){p[m[0].substring(9,m[0].length)]=m[1]}}return p};k.typeOf=function(n){var m=typeof n;if(m==="object"){if(!n){return"null"}return(n instanceof Array)?"array":m}else{return m}};k.translateEventResponse=function(o,m){var q=k.extend({},m);if(o==d.events.JWPLAYER_FULLSCREEN&&!q.fullscreen){q.fullscreen=q.message=="true"?true:false;delete q.message}else{if(typeof q.data==c){q=k.extend(q,q.data);delete q.data}else{if(typeof q.metadata==c){k.deepReplaceKeyName(q.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var n=["position","duration","offset"];for(var p in n){if(q[n[p]]){q[n[p]]=Math.round(q[n[p]]*1000)/1000}}return q};k.flashVersion=function(){if(k.isAndroid()){return 0}var m=b.plugins,n;if(m!=h){n=m["Shockwave Flash"];if(n){return parseInt(n.description.replace(/\D+(\d+)\..*/,"$1"))}}if(typeof g.ActiveXObject!=h){try{n=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(n){return parseInt(n.GetVariable("$version").split(" ")[1].split(",")[0])}}catch(o){}}return 0};k.getScriptPath=function(o){var m=j.getElementsByTagName("script");for(var n=0;n<m.length;n++){var p=m[n].src;if(p&&p.indexOf(o)>=0){return p.substr(0,p.indexOf(o))}}return""};k.deepReplaceKeyName=function(t,o,m){switch(d.utils.typeOf(t)){case"array":for(var q=0;q<t.length;q++){t[q]=d.utils.deepReplaceKeyName(t[q],o,m)}break;case c:for(var p in t){var s,r;if(o instanceof Array&&m instanceof Array){if(o.length!=m.length){continue}else{s=o;r=m}}else{s=[o];r=[m]}var n=p;for(var q=0;q<s.length;q++){n=n.replace(new RegExp(o[q],"g"),m[q])}t[n]=d.utils.deepReplaceKeyName(t[p],o,m);if(p!=n){delete t[p]}}break}return t};var i=k.pluginPathType={ABSOLUTE:0,RELATIVE:1,CDN:2};k.getPluginPathType=function(n){if(typeof n!=f){return}n=n.split("?")[0];var o=n.indexOf("://");if(o>0){return i.ABSOLUTE}var m=n.indexOf("/");var p=k.extension(n);if(o<0&&m<0&&(!p||!isNaN(p))){return i.CDN}return i.RELATIVE};k.getPluginName=function(m){return m.replace(/^(.*\/)?([^-]*)-?.*\.(swf|js)$/,"$2")};k.getPluginVersion=function(m){return m.replace(/[^-]*-?([^\.]*).*$/,"$1")};k.isYouTube=function(m){return(m.indexOf("youtube.com")>-1||m.indexOf("youtu.be")>-1)};k.isRtmp=function(m,n){return(m.indexOf("rtmp")==0||n=="rtmp")};k.foreach=function(o,n){for(var m in o){if(o.hasOwnProperty(m)){n(m)}}};k.isHTTPS=function(){return(g.location.href.indexOf("https")==0)}})(jwplayer);(function(o){var d="video/",i="audio/",g="image",j="mp4",c="webm",n="ogg",b="aac",k="mp3",l="vorbis",m={mp4:d+j,vorbis:i+n,ogg:d+n,webm:d+c,aac:i+j,mp3:i+"mpeg",hls:"application/vnd.apple.mpegurl"},h={mp4:m[j],f4v:m[j],m4v:m[j],mov:m[j],m4a:m[b],f4a:m[b],aac:m[b],mp3:m[k],ogv:m[n],ogg:m[l],oga:m[l],webm:m[c],m3u8:m.hls},d="video",f={flv:d,f4v:d,mov:d,m4a:d,m4v:d,mp4:d,aac:d,f4a:d,mp3:"sound",smil:"rtmp",m3u8:"hls"};var a=o.extensionmap={};for(var e in h){a[e]={html5:h[e]}}for(e in f){if(!a[e]){a[e]={}}a[e].flash=f[e]}a.types=m;a.mimeType=function(q){for(var p in m){if(m[p]==q){return p}}};a.extType=function(p){return a.mimeType(h[p])}})(jwplayer.utils);(function(b){var a=b.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},c=document;b.scriptloader=function(e){var f=a.NEW,h=jwplayer.events,d=new h.eventdispatcher();b.extend(this,d);this.load=function(){var k=b.scriptloader.loaders[e];if(k&&(k.getStatus()==a.NEW||k.getStatus()==a.LOADING)){k.addEventListener(h.ERROR,g);k.addEventListener(h.COMPLETE,i);return}b.scriptloader.loaders[e]=this;if(f==a.NEW){f=a.LOADING;var j=c.createElement("script");if(j.addEventListener){j.onload=i;j.onerror=g}else{if(j.readyState){j.onreadystatechange=function(){if(j.readyState=="loaded"||j.readyState=="complete"){i()}}}}c.getElementsByTagName("head")[0].appendChild(j);j.src=e}};function g(j){f=a.ERROR;d.sendEvent(h.ERROR)}function i(j){f=a.COMPLETE;d.sendEvent(h.COMPLETE)}this.getStatus=function(){return f}};b.scriptloader.loaders={}})(jwplayer.utils);(function(a){a.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c};a.xmlAttribute=function(b,c){for(var d=0;d<b.attributes.length;d++){if(b.attributes[d].name&&b.attributes[d].name.toLowerCase()==c.toLowerCase()){return b.attributes[d].value.toString()}}return""};a.extension=function(b){if(!b||b.substr(0,4)=="rtmp"){return""}b=b.substring(b.lastIndexOf("/")+1,b.length).split("?")[0].split("#")[0];if(b.lastIndexOf(".")>-1){return b.substr(b.lastIndexOf(".")+1,b.length).toLowerCase()}};a.stringToColor=function(b){b=b.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(b.length==3){b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2)}return parseInt(b,16)}})(jwplayer.utils);(function(a){var c="invalid",b="36QXq4W@GSBV^teR";a.key=function(h){var g,i,e;function f(j){if(!a.exists(j)){j=""}try{j=d(j);var l=j.split("/");g=l[0];if(!g){g="free"}else{if(a.key.valid.indexOf(g)<0){g=c}}i=l[1];if(l[2]&&parseInt(l[2])>0){e=new Date();e.setTime(String(l[2]))}}catch(k){g=c}}function d(j){return a.tea.decrypt(j,b)}this.edition=function(){if(e&&e.getTime()<(new Date()).getTime()){return c}return g};this.token=function(){return i};f(h)};a.key.valid=["free","pro"]})(jwplayer.utils);(function(b){var c=b.tea={};c.encrypt=function(h,w){if(h.length==0){return("")}var x=c.strToLongs(a.encode(h));if(x.length<=1){x[1]=0}var l=c.strToLongs(a.encode(w).slice(0,16)),i=x.length,r=x[i-1],s=x[0],u=2654435769,t,o,f=Math.floor(6+52/i),m=0;while(f-->0){m+=u;o=m>>>2&3;for(var g=0;g<i;g++){s=x[(g+1)%i];t=(r>>>5^s<<2)+(s>>>3^r<<4)^(m^s)+(l[g&3^o]^r);r=x[g]+=t}}var j=c.longsToStr(x);return d.encode(j)};c.decrypt=function(j,w){if(j.length==0){return("")}var x=c.strToLongs(d.decode(j)),l=c.strToLongs(a.encode(w).slice(0,16)),i=x.length,r=x[i-1],s=x[0],u=2654435769,t,o,f=Math.floor(6+52/i),m=f*u;while(m!=0){o=m>>>2&3;for(var h=i-1;h>=0;h--){r=x[h>0?h-1:i-1];t=(r>>>5^s<<2)+(s>>>3^r<<4)^(m^s)+(l[h&3^o]^r);s=x[h]-=t}m-=u}var g=c.longsToStr(x);g=g.replace(/\0+$/,"");return a.decode(g)};c.strToLongs=function(g){var e=new Array(Math.ceil(g.length/4));for(var f=0;f<e.length;f++){e[f]=g.charCodeAt(f*4)+(g.charCodeAt(f*4+1)<<8)+(g.charCodeAt(f*4+2)<<16)+(g.charCodeAt(f*4+3)<<24)}return e};c.longsToStr=function(f){var e=new Array(f.length);for(var g=0;g<f.length;g++){e[g]=String.fromCharCode(f[g]&255,f[g]>>>8&255,f[g]>>>16&255,f[g]>>>24&255)}return e.join("")};var d={};d.code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";d.encode=function(q,s){s=(typeof s=="undefined")?false:s;var j,g,f,u,r,n,m,k,l=[],i="",p,t,o;var h=d.code;t=s?a.encode(q):q;p=t.length%3;if(p>0){while(p++<3){i+="=";t+="\0"}}for(p=0;p<t.length;p+=3){j=t.charCodeAt(p);g=t.charCodeAt(p+1);f=t.charCodeAt(p+2);u=j<<16|g<<8|f;r=u>>18&63;n=u>>12&63;m=u>>6&63;k=u&63;l[p/3]=h.charAt(r)+h.charAt(n)+h.charAt(m)+h.charAt(k)}o=l.join("");o=o.slice(0,o.length-i.length)+i;return o};d.decode=function(p,g){g=(typeof g=="undefined")?false:g;var i,f,e,q,m,k,j,s,l=[],r,o;var h=d.code;o=g?a.decode(p):p;for(var n=0;n<o.length;n+=4){q=h.indexOf(o.charAt(n));m=h.indexOf(o.charAt(n+1));k=h.indexOf(o.charAt(n+2));j=h.indexOf(o.charAt(n+3));s=q<<18|m<<12|k<<6|j;i=s>>>16&255;f=s>>>8&255;e=s&255;l[n/4]=String.fromCharCode(i,f,e);if(j==64){l[n/4]=String.fromCharCode(i,f)}if(k==64){l[n/4]=String.fromCharCode(i)}}r=l.join("");return g?a.decode(r):r};var a={};a.encode=function(e){var f=e.replace(/[\u0080-\u07ff]/g,function(h){var g=h.charCodeAt(0);return String.fromCharCode(192|g>>6,128|g&63)});f=f.replace(/[\u0800-\uffff]/g,function(h){var g=h.charCodeAt(0);return String.fromCharCode(224|g>>12,128|g>>6&63,128|g&63)});return f};a.decode=function(f){var e=f.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(h){var g=((h.charCodeAt(0)&15)<<12)|((h.charCodeAt(1)&63)<<6)|(h.charCodeAt(2)&63);return String.fromCharCode(g)});e=e.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(h){var g=(h.charCodeAt(0)&31)<<6|h.charCodeAt(1)&63;return String.fromCharCode(g)});return e}})(jwplayer.utils);(function(a){a.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_MEDIA_LEVELS:"jwplayerMediaLevels",JWPLAYER_MEDIA_LEVEL_CHANGED:"jwplayerMediaLevelChanged",JWPLAYER_CAPTIONS_CHANGED:"jwplayerCaptionsChanged",JWPLAYER_CAPTIONS_LIST:"jwplayerCaptionsList",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_PLAYLIST_COMPLETE:"jwplayerPlaylistComplete",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_CONTROLS:"jwplayerViewControls",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"}})(jwplayer);(function(a){var b=jwplayer.utils;a.eventdispatcher=function(h,c){var e=h,g=c,f,d;this.resetEventListeners=function(){f={};d=[]};this.resetEventListeners();this.addEventListener=function(i,l,k){try{if(!b.exists(f[i])){f[i]=[]}if(b.typeOf(l)=="string"){l=(new Function("return "+l))()}f[i].push({listener:l,count:k})}catch(j){b.log("error",j)}return false};this.removeEventListener=function(j,l){if(!f[j]){return}try{for(var i=0;i<f[j].length;i++){if(f[j][i].listener.toString()==l.toString()){f[j].splice(i,1);break}}}catch(k){b.log("error",k)}return false};this.addGlobalListener=function(k,j){try{if(b.typeOf(k)=="string"){k=(new Function("return "+k))()}d.push({listener:k,count:j})}catch(i){b.log("error",i)}return false};this.removeGlobalListener=function(k){if(!k){return}try{for(var i=0;i<d.length;i++){if(d[i].listener.toString()==k.toString()){d.splice(i,1);break}}}catch(j){b.log("error",j)}return false};this.sendEvent=function(k,m){if(!b.exists(m)){m={}}b.extend(m,{id:e,version:jwplayer.version,type:k});if(g){b.log(k,m)}if(b.typeOf(f[k])!="undefined"){for(var j=0;j<f[k].length;j++){try{f[k][j].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),f[k][j].listener)}if(f[k][j]){if(f[k][j].count===1){delete f[k][j]}else{if(f[k][j].count>0){f[k][j].count=f[k][j].count-1}}}}}var i;for(i=0;i<d.length;i++){try{d[i].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),d[i].listener)}if(d[i]){if(d[i].count===1){delete d[i]}else{if(d[i].count>0){d[i].count=d[i].count-1}}}}}}})(jwplayer.events);(function(a){var c={},b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,g,f,e){var d=a.utils.getPluginName(h);if(!c[d]){c[d]=new a.plugins.plugin(h)}c[d].registerPlugin(h,g,f,e)}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]};this.getPlugins=function(){return b}}})(jwplayer);(function(b){var a=jwplayer.utils,c=jwplayer.events,d="undefined";b.pluginmodes={FLASH:0,JAVASCRIPT:1,HYBRID:2};b.plugin=function(e){var l=a.loaderstatus.NEW,m,k,f,n;var g=new c.eventdispatcher();a.extend(this,g);function h(){switch(a.getPluginPathType(e)){case a.pluginPathType.ABSOLUTE:return e;case a.pluginPathType.RELATIVE:return a.getAbsolutePath(e,window.location.href)}}function j(o){n=setTimeout(function(){l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE)},1000)}function i(o){l=a.loaderstatus.ERROR;g.sendEvent(c.ERROR)}this.load=function(){if(l==a.loaderstatus.NEW){if(e.lastIndexOf(".swf")>0){m=e;l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE);return}else{if(a.getPluginPathType(e)==a.pluginPathType.CDN){l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE);return}}l=a.loaderstatus.LOADING;var o=new a.scriptloader(h());o.addEventListener(c.COMPLETE,j);o.addEventListener(c.ERROR,i);o.load()}};this.registerPlugin=function(r,q,p,o){if(n){clearTimeout(n);n=undefined}f=q;if(p&&o){m=o;k=p}else{if(typeof p=="string"){m=p}else{if(typeof p=="function"){k=p}else{if(!p&&!o){m=r}}}}l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE)};this.getStatus=function(){return l};this.getPluginName=function(){return a.getPluginName(e)};this.getFlashPath=function(){if(m){switch(a.getPluginPathType(m)){case a.pluginPathType.ABSOLUTE:return m;case a.pluginPathType.RELATIVE:if(e.lastIndexOf(".swf")>0){return a.getAbsolutePath(m,window.location.href)}return a.getAbsolutePath(m,h())}}return null};this.getJS=function(){return k};this.getTarget=function(){return f};this.getPluginmode=function(){if(typeof m!=d&&typeof k!=d){return b.pluginmodes.HYBRID}else{if(typeof m!=d){return b.pluginmodes.FLASH}else{if(typeof k!=d){return b.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(p,o,q){return new k(p,o,q)};this.getURL=function(){return e}}})(jwplayer.plugins);(function(b){var a=b.utils,c=b.events;b.plugins.pluginloader=function(i,h){var o=a.loaderstatus.NEW,g=false,d=false,k=false,l,m=h,e=new c.eventdispatcher();a.extend(this,e);function f(){if(k){e.sendEvent(c.ERROR,{message:l})}else{if(!d){d=true;o=a.loaderstatus.COMPLETE;e.sendEvent(c.COMPLETE)}}}function n(){if(!m){f()}if(!d&&!k){var r=0,q=i.getPlugins();for(var s in m){var t=a.getPluginName(s),w=q[t],v=w.getJS(),u=w.getTarget(),p=w.getStatus();if(p==a.loaderstatus.LOADING||p==a.loaderstatus.NEW){r++}else{if(v&&(!u||parseFloat(u)>parseFloat(b.version))){k=true;l="Incompatible player version";f()}}}if(r==0){f()}}}this.setupPlugins=function(x,s,A){var r={length:0,plugins:{}},v={length:0,plugins:{}},u=i.getPlugins();for(var w in s.plugins){var y=a.getPluginName(w),z=u[y],B=z.getFlashPath(),C=z.getJS(),p=z.getURL();if(B){r.plugins[B]=a.extend({},s.plugins[w]);r.plugins[B].pluginmode=z.getPluginmode();r.length++}try{if(C&&s.plugins&&s.plugins[p]){var q=document.createElement("div");q.id=x.id+"_"+y;q.style.position="absolute";q.style.top=0;q.style.zIndex=v.length+10;v.plugins[y]=z.getNewInstance(x,a.extend({},s.plugins[p]),q);v.length++;x.onReady(A(v.plugins[y],q,true));x.onResize(A(v.plugins[y],q))}}catch(t){console.log("ERROR: Failed to load "+y+".")}}x.plugins=v.plugins;return r};this.load=function(){if(a.exists(h)&&a.typeOf(h)!="object"){n();return}o=a.loaderstatus.LOADING;g=true;for(var q in h){if(a.exists(q)){var r=i.addPlugin(q);r.addEventListener(c.COMPLETE,n);r.addEventListener(c.ERROR,j)}}var p=i.getPlugins();for(q in p){p[q].load()}g=false;n()};var j=this.pluginFailed=function(p){if(!k){k=true;l="File not found";f()}};this.getStatus=function(){return o}}})(jwplayer);(function(a){a.playlist=function(c){var d=[];if(a.utils.typeOf(c)=="array"){for(var b=0;b<c.length;b++){d.push(new a.playlist.item(c[b]))}}else{d.push(new a.playlist.item(c))}return d}})(jwplayer);(function(b){var a=b.item=function(d){var c=jwplayer.utils.extend({},a.defaults,d);if(c.sources.length==0){c.sources=[new b.source(c)]}for(var e=0;e<c.sources.length;e++){c.sources[e]=new b.source(c.sources[e])}return c};a.defaults={description:"",image:"",mediaid:"",title:"",tags:"",duration:-1,sources:[]}})(jwplayer.playlist);(function(d){var b=undefined,a=jwplayer.utils,c={file:b,label:b,bitrate:b,width:b,height:b,type:b};d.source=function(f){var e=a.extend({},c);for(var g in c){if(a.exists(f[g])){e[g]=f[g];delete f[g]}}if(e.type&&e.type.indexOf("/")>0){e.type=a.extensionmap.mimeType(e.type)}return e}})(jwplayer.playlist);(function(b){var a=b.utils,c=b.events,d=document;var e=b.embed=function(u){var q=new e.config(u.config),j,l,h,k=q.width,m=q.height,o="Error loading player: ",i=b.plugins.loadPlugins(u.id,q.plugins);if(q.fallbackDiv){h=q.fallbackDiv;delete q.fallbackDiv}q.id=u.id;l=d.getElementById(u.id);j=d.createElement("div");j.id=l.id;j.style.width=k.toString().indexOf("%")>0?k:(k+"px");j.style.height=m.toString().indexOf("%")>0?m:(m+"px");l.parentNode.replaceChild(j,l);function n(x,w){for(var v in w){if(typeof x[v]=="function"){(x[v]).call(x,w[v])}}}function f(){if(a.typeOf(q.playlist)=="array"&&q.playlist.length<2){if(q.playlist.length==0||!q.playlist[0].sources||q.playlist[0].sources.length==0){s();return}}if(i.getStatus()==a.loaderstatus.COMPLETE){for(var x=0;x<q.modes.length;x++){if(q.modes[x].type&&e[q.modes[x].type]){var v=a.extend({},q),w=new e[q.modes[x].type](j,q.modes[x],v,i,u);if(w.supportsConfig()){w.addEventListener(c.ERROR,g);w.embed();n(u,v.events);return u}}}if(q.fallback){a.log("No suitable players found and fallback enabled");new e.download(j,q,s)}else{a.log("No suitable players found and fallback disabled");r()}}}function r(){j.parentNode.replaceChild(h,j)}function g(v){t(j,o+v.message)}function p(v){t(j,"Could not load plugins: "+v.message)}function s(){t(j,o+"No playable sources found")}function t(v,x){if(!q.fallback){return}var w=v.style;w.backgroundColor="#000";w.color="#FFF";w.width=a.styleDimension(q.width);w.height=a.styleDimension(q.height);w.display="table";w.opacity=1;var z=document.createElement("p"),y=z.style;y.verticalAlign="middle";y.textAlign="center";y.display="table-cell";y.font="15px/20px Arial, Helvetica, sans-serif";z.innerHTML=x.replace(":",":<br>");v.innerHTML="";v.appendChild(z)}b.embed.errorScreen=t;i.addEventListener(c.COMPLETE,f);i.addEventListener(c.ERROR,p);i.load();return u}})(jwplayer);(function(d){var a=d.utils,h=d.embed,b=d.playlist.item,f=undefined;var c=h.config=function(j){var l={fallback:true,height:270,primary:"html5",width:480,base:j.base?j.base:a.getScriptPath("jwplayer.js")},k=a.extend(l,j),i={html5:{type:"html5",src:k.base+"jwplayer.html5.js"},flash:{type:"flash",src:k.base+"jwplayer.flash.swf"}};k.modes=(k.primary=="flash")?[i.flash,i.html5]:[i.html5,i.flash];if(k.listbar){k.playlistsize=k.listbar.size;k.playlistposition=k.listbar.position}e(k);return k};c.addConfig=function(i,j){e(j);return a.extend(i,j)};function e(l){if(!l.playlist){var n={};for(var k in b.defaults){g(l,n,k)}if(!n.sources){if(l.levels){n.sources=l.levels;delete l.levels}else{var j={};g(l,j,"file");g(l,j,"type");n.sources=j.file?[j]:[]}}l.playlist=[n]}else{for(var m=0;m<l.playlist.length;m++){l.playlist[m]=new b(l.playlist[m])}}}function g(k,i,j){if(a.exists(k[j])){i[j]=k[j];delete k[j]}}})(jwplayer);(function(e){var g=e.embed,j=e.utils,i=document,h="pointer",c="none",a="block",f="100%",d="relative",b="absolute";g.download=function(n,y,l){var q=j.extend({},y),u,o=q.width?q.width:480,r=q.height?q.height:320,z,s,k=y.logo?y.logo:{prefix:"http://p.jwpcdn.com/",file:"logo.png",margin:10};function x(){var E,F,D,G,C=q.playlist,J,B,G,H=["mp4","aac","mp3"];if(C&&C.length){J=C[0];B=J.sources;for(G=0;G<B.length;G++){var A=B[G],I=A.type?A.type:j.extensionmap.extType(j.extension(A.file));if(A.file){for(G in H){if(I==H[G]){E=A.file;F=J.image}else{if(j.isYouTube(A.file)){D=A.file}}}if(E||D){continue}}}}else{return}if(E){z=E;s=F;if(k.prefix){if(j.isHTTPS()){k.prefix=k.prefix.replace("http://","https://ssl.")}k.prefix+=e.version.split(/\W/).splice(0,2).join("/")}t();p()}else{if(D){m(D)}else{l()}}}function t(){if(n){u=v("a","display",n);v("div","icon",u);v("div","logo",u);if(z){u.setAttribute("href",j.getAbsolutePath(z))}}}function w(A,C){var D=i.querySelectorAll(A);for(var B=0;B<D.length;B++){for(var E in C){D[B].style[E]=C[E]}}}function p(){var A="#"+n.id+" .jwdownload";n.style.width="";n.style.height="";w(A+"display",{width:j.styleDimension(Math.max(320,o)),height:j.styleDimension(Math.max(180,r)),background:"black center no-repeat "+(s?"url("+s+")":""),backgroundSize:"contain",position:d,border:c,display:a});w(A+"display div",{position:b,width:f,height:f});w(A+"logo",{top:k.margin+"px",right:k.margin+"px",background:"top right no-repeat url("+k.prefix+k.file+")"});w(A+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgNJREFUeNrs28lqwkAYB/CZqNVDDj2r6FN41QeIy8Fe+gj6BL275Q08u9FbT8ZdwVfotSBYEPUkxFOoks4EKiJdaDuTjMn3wWBO0V/+sySR8SNSqVRKIR8qaXHkzlqS9jCfzzWcTCYp9hF5o+59sVjsiRzcegSckFzcjT+ruN80TeSlAjCAAXzdJSGPFXRpAAMYwACGZQkSdhG4WCzehMNhqV6vG6vVSrirKVEw66YoSqDb7cqlUilE8JjHd/y1MQefVzqdDmiaJpfLZWHgXMHn8F6vJ1cqlVAkEsGuAn83J4gAd2RZymQygX6/L1erVQt+9ZPWb+CDwcCC2zXGJaewl/DhcHhK3DVj+KfKZrMWvFarcYNLomAv4aPRSFZVlTlcSPA5fDweW/BoNIqFnKV53JvncjkLns/n/cLdS+92O7RYLLgsKfv9/t8XlDn4eDyiw+HA9Jyz2eyt0+kY2+3WFC5hluej0Ha7zQQq9PPwdDq1Et1sNsx/nFBgCqWJ8oAK1aUptNVqcYWewE4nahfU0YQnk4ntUEfGMIU2m01HoLaCKbTRaDgKtaVLk9tBYaBcE/6Artdr4RZ5TB6/dC+9iIe/WgAMYADDpAUJAxjAAAYwgGFZgoS/AtNNTF7Z2bL0BYPBV3Jw5xFwwWcYxgtBP5OkE8i9G7aWGOOCruvauwADALMLMEbKf4SdAAAAAElFTkSuQmCC)"})}function v(A,D,C){var B=i.createElement(A);if(D){B.className="jwdownload"+D}if(C){C.appendChild(B)}return B}function m(A){var B=v("embed","",n);B.src="http://www.youtube.com/v/"+(/v[=\/](\w*)|\/(\w+)$|^(\w+)$/i).exec(A).slice(1).join("");B.type="application/x-shockwave-flash";B.width=o;B.height=r}x()}})(jwplayer);(function(c){var b=c.utils,d=c.events,a={};var e=c.embed.flash=function(l,m,p,k,n){var h=new c.events.eventdispatcher(),i=b.flashVersion();b.extend(this,h);function q(s,r,t){var u=document.createElement("param");u.setAttribute("name",r);u.setAttribute("value",t);s.appendChild(u)}function o(s,t,r){return function(u){try{if(r){document.getElementById(n.id+"_wrapper").appendChild(t)}var w=document.getElementById(n.id).getPluginConfig("display");if(typeof s.resize=="function"){s.resize(w.width,w.height)}t.style.left=w.x;t.style.top=w.h}catch(v){}}}function j(t){if(!t){return{}}var v={};for(var s in t){var r=t[s];for(var u in r){v[s+"."+u]=r[u]}}return v}function g(u){if(!u){return{}}var x={},w=[];for(var r in u){var t=b.getPluginName(r);var s=u[r];w.push(r);for(var v in s){x[t+"."+v]=s[v]}}x.plugins=w.join(",");return x}this.embed=function(){p.id=n.id;if(i<10){h.sendEvent(d.ERROR,{message:"Flash version must be 10.0 or greater"});return false}var C;var v=b.extend({},p);if(l.id+"_wrapper"==l.parentNode.id){C=document.getElementById(l.id+"_wrapper")}else{C=document.createElement("div");C.id=l.id+"_wrapper";C.style.position="relative";C.style.width=b.styleDimension(v.width);C.style.height=b.styleDimension(v.height);l.parentNode.replaceChild(C,l);C.appendChild(l)}var t=k.setupPlugins(n,v,o);if(t.length>0){b.extend(v,g(t.plugins))}else{delete v.plugins}if(typeof v["dock.position"]!="undefined"){if(v["dock.position"].toString().toLowerCase()=="false"){v.dock=v["dock.position"];delete v["dock.position"]}}var D="#000000",y,u=v.wmode?v.wmode:(v.height&&v.height<=40?"transparent":"opaque"),w=["height","width","modes","events","primary","base","fallback","volume"];for(var z=0;z<w.length;z++){delete v[w[z]]}var B=b.getCookies();for(var s in B){if(typeof(v[s])=="undefined"){v[s]=B[s]}}var r=window.location.pathname.split("/");r.splice(r.length-1,1);r=r.join("/");v.base=r+"/";a[l.id]=v;if(b.isIE()){var A='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" " width="100%" height="100%" id="'+l.id+'" name="'+l.id+'" tabindex=0"">';A+='<param name="movie" value="'+m.src+'">';A+='<param name="allowfullscreen" value="true">';A+='<param name="allowscriptaccess" value="always">';A+='<param name="seamlesstabbing" value="true">';A+='<param name="wmode" value="'+u+'">';A+='<param name="bgcolor" value="'+D+'">';A+="</object>";l.outerHTML=A;y=document.getElementById(l.id)}else{var x=document.createElement("object");x.setAttribute("type","application/x-shockwave-flash");x.setAttribute("data",m.src);x.setAttribute("width","100%");x.setAttribute("height","100%");x.setAttribute("bgcolor",D);x.setAttribute("id",l.id);x.setAttribute("name",l.id);x.setAttribute("tabindex",0);q(x,"allowfullscreen","true");q(x,"allowscriptaccess","always");q(x,"seamlesstabbing","true");q(x,"wmode",u);l.parentNode.replaceChild(x,l);y=x}n.container=y;n.setPlayer(y,"flash")};this.supportsConfig=function(){if(i){if(p){if(b.typeOf(p.playlist)=="string"){return true}try{var t=p.playlist[0],r=t.sources;if(typeof r=="undefined"){return true}else{for(var s=0;s<r.length;s++){if(r[s].file&&f(r[s].file,r[s].type)){return true}}}}catch(u){return false}}else{return true}}return false};function f(r,s){if(b.isYouTube(r)){return true}if(b.isRtmp(r,s)){return true}if(s=="hls"){return true}var t=b.extensionmap[s?s:b.extension(r)];if(!t){return false}return !!(t.flash)}};e.getVars=function(f){return a[f]}})(jwplayer);(function(c){var a=c.utils,b=a.extensionmap,d=c.events;c.embed.html5=function(g,h,o,f,k){var j=this,e=new d.eventdispatcher();a.extend(j,e);function l(q,r,p){return function(s){try{var t=document.querySelector("#"+g.id+" .jwmain");if(p){t.appendChild(r)}if(typeof q.resize=="function"){q.resize(t.clientWidth,t.clientHeight);setTimeout(function(){q.resize(t.clientWidth,t.clientHeight)},400)}r.left=t.style.left;r.top=t.style.top}catch(u){}}}j.embed=function(){if(c.html5){f.setupPlugins(k,o,l);g.innerHTML="";var p=c.utils.extend({},o);delete p.volume;var q=new c.html5.player(p);k.container=document.getElementById(k.id);k.setPlayer(q,"html5")}else{var r=new a.scriptloader(h.src);r.addEventListener(d.ERROR,i);r.addEventListener(d.COMPLETE,j.embed);r.load()}};function i(p){j.sendEvent(p.type,{message:"HTML5 player not found"})}j.supportsConfig=function(){if(!!c.vid.canPlayType){try{if(a.typeOf(o.playlist)=="string"){return true}else{var p=o.playlist[0].sources;for(var r=0;r<p.length;r++){var q=p[r].file,s=p[r].type;if(n(q,s)){return true}}}}catch(t){return false}}return false};function n(p,q){if(navigator.userAgent.match(/BlackBerry/i)!==null){return false}if(a.isAndroid()&&(a.extension(p)=="m3u"||a.extension(p)=="m3u8")){return false}if(a.isRtmp(p,q)){return false}var r=b[q?q:a.extension(p)];if(!r){return false}if(r.flash&&!r.html5){return false}return m(r.html5)}function m(p){var q=c.vid;if(!p){return true}try{if(q.canPlayType(p)){return true}else{return false}}catch(r){return false}}}})(jwplayer);(function(c){var b=c.embed,a=c.utils,d=a.extend(function(k){var j=(a.isHTTPS()?"https://ssl.":"http://")+"p.jwpcdn.com/"+c.version.replace(/(\d+)\.(\d+).*/,"$1/$2/"),g=k.config,e=g.plugins,f=g.analytics,i=j+"jwpsrv.js",h=new c.utils.key(c.key);if(h.edition()=="ads"&&g.advertising){g.plugins[j+g.advertising.client+(g.primary=="flash"?".swf":".js")]=g.advertising}delete g.advertising;g.key=c.key;delete g.analytics;e=e?e:{};e[i]=f?f:{};g.plugins=e;return new b(k)},b);c.embed=d})(jwplayer);(function(d){var c=[],a=d.utils,e=d.events,b=e.state,g=document;var f=d.api=function(t){var x=this,h={},l={},A={},o=[],i=undefined,D=false,p=[],y=undefined,s={},n={};x.container=t;x.id=t.id;x.getBuffer=function(){return w("jwGetBuffer")};x.getContainer=function(){return x.container};x.addButton=function(H,F,G,K){try{n[K]=G;var J="jwplayer('"+x.id+"').callback('"+K+"')";w("jwDockAddButton",H,F,J,K)}catch(I){a.log("Could not add dock button"+I.message)}};x.removeButton=function(F){w("jwDockRemoveButton",F)},x.callback=function(F){if(n[F]){n[F]()}};x.getDuration=function(){return w("jwGetDuration")};x.getFullscreen=function(){return w("jwGetFullscreen")};x.getStretching=function(){return w("jwGetStretching")};x.getHeight=function(){return w("jwGetHeight")};x.getLockState=function(){return w("jwGetLockState")};x.getMeta=function(){return x.getItemMeta()};x.getMute=function(){return w("jwGetMute")};x.getPlaylist=function(){var G=w("jwGetPlaylist");if(x.renderingMode=="flash"){a.deepReplaceKeyName(G,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var F=0;F<G.length;F++){if(!a.exists(G[F].index)){G[F].index=F}}return G};x.getPlaylistItem=function(F){if(!a.exists(F)){F=x.getCurrentItem()}return x.getPlaylist()[F]};x.getPosition=function(){return w("jwGetPosition")};x.getRenderingMode=function(){return x.renderingMode};x.getState=function(){return w("jwGetState")};x.getVolume=function(){return w("jwGetVolume")};x.getWidth=function(){return w("jwGetWidth")};x.setFullscreen=function(F){if(!a.exists(F)){w("jwSetFullscreen",!w("jwGetFullscreen"))}else{w("jwSetFullscreen",F)}return x};x.setStretching=function(F){w("jwSetStretching",F);return x};x.setMute=function(F){if(!a.exists(F)){w("jwSetMute",!w("jwGetMute"))}else{w("jwSetMute",F)}return x};x.lock=function(){return x};x.unlock=function(){return x};x.load=function(F){w("jwLoad",F);return x};x.playlistItem=function(F){w("jwPlaylistItem",parseInt(F));return x};x.playlistPrev=function(){w("jwPlaylistPrev");return x};x.playlistNext=function(){w("jwPlaylistNext");return x};x.resize=function(G,F){if(x.renderingMode!="flash"){w("jwResize",G,F)}else{var H=g.getElementById(x.id+"_wrapper");if(H){H.style.width=a.styleDimension(G);H.style.height=a.styleDimension(F)}}return x};x.play=function(F){if(typeof F=="undefined"){F=x.getState();if(F==b.PLAYING||F==b.BUFFERING){w("jwPause")}else{w("jwPlay")}}else{w("jwPlay",F)}return x};x.pause=function(F){if(typeof F=="undefined"){F=x.getState();if(F==b.PLAYING||F==b.BUFFERING){w("jwPause")}else{w("jwPlay")}}else{w("jwPause",F)}return x};x.stop=function(){w("jwStop");return x};x.seek=function(F){w("jwSeek",F);return x};x.setVolume=function(F){w("jwSetVolume",F);return x};x.loadInstream=function(G,F){y=new f.instream(this,i,G,F);return y};x.getQualityLevels=function(){return w("jwGetQualityLevels")};x.getCurrentQuality=function(){return w("jwGetCurrentQuality")};x.setCurrentQuality=function(F){w("jwSetCurrentQuality",F)};x.getCaptionsList=function(){return w("jwGetCaptionsList")};x.getCurrentCaptions=function(){return w("jwGetCurrentCaptions")};x.setCurrentCaptions=function(F){w("jwSetCurrentCaptions",F)};x.getControls=function(){return w("jwGetControls")};x.getSafeRegion=function(){return w("jwGetSafeRegion")};x.setControls=function(F){w("jwSetControls",F)};x.destroyPlayer=function(){w("jwPlayerDestroy")};var r={onBufferChange:e.JWPLAYER_MEDIA_BUFFER,onBufferFull:e.JWPLAYER_MEDIA_BUFFER_FULL,onError:e.JWPLAYER_ERROR,onFullscreen:e.JWPLAYER_FULLSCREEN,onMeta:e.JWPLAYER_MEDIA_META,onMute:e.JWPLAYER_MEDIA_MUTE,onPlaylist:e.JWPLAYER_PLAYLIST_LOADED,onPlaylistItem:e.JWPLAYER_PLAYLIST_ITEM,onPlaylistComplete:e.JWPLAYER_PLAYLIST_COMPLETE,onReady:e.API_READY,onResize:e.JWPLAYER_RESIZE,onComplete:e.JWPLAYER_MEDIA_COMPLETE,onSeek:e.JWPLAYER_MEDIA_SEEK,onTime:e.JWPLAYER_MEDIA_TIME,onVolume:e.JWPLAYER_MEDIA_VOLUME,onBeforePlay:e.JWPLAYER_MEDIA_BEFOREPLAY,onBeforeComplete:e.JWPLAYER_MEDIA_BEFORECOMPLETE,onDisplayClick:e.JWPLAYER_DISPLAY_CLICK,onControls:e.JWPLAYER_CONTROLS,onQualityLevels:e.JWPLAYER_MEDIA_LEVELS,onQualityChange:e.JWPLAYER_MEDIA_LEVEL_CHANGED,onCaptionsList:e.JWPLAYER_CAPTIONS_LIST,onCaptionsChange:e.JWPLAYER_CAPTIONS_CHANGED};a.foreach(r,function(F){x[F]=C(r[F],z)});var v={onBuffer:b.BUFFERING,onPause:b.PAUSED,onPlay:b.PLAYING,onIdle:b.IDLE};a.foreach(v,function(F){x[F]=C(v[F],q)});function C(F,G){return function(H){return G(F,H)}}x.remove=function(){if(!D){throw"Cannot call remove() before player is ready";return}m(this)};function m(F){p=[];f.destroyPlayer(F.id)}x.setup=function(F){if(d.embed){var G=g.getElementById(x.id);if(G){F.fallbackDiv=G}m(x);var H=d(x.id);H.config=F;return new d.embed(H)}return x};x.registerPlugin=function(I,H,G,F){d.plugins.registerPlugin(I,H,G,F)};x.setPlayer=function(F,G){i=F;x.renderingMode=G};x.detachMedia=function(){if(x.renderingMode=="html5"){return w("jwDetachMedia")}};x.attachMedia=function(){if(x.renderingMode=="html5"){return w("jwAttachMedia")}};function q(F,G){if(!l[F]){l[F]=[];z(e.JWPLAYER_PLAYER_STATE,E(F))}l[F].push(G);return x}function E(F){return function(H){var G=H.newstate,J=H.oldstate;if(G==F){var I=l[G];if(I){for(var K=0;K<I.length;K++){if(typeof I[K]=="function"){I[K].call(this,{oldstate:J,newstate:G})}}}}}}function B(F,G,H){if(!A[F]){A[F]={}}if(!A[F][G]){A[F][G]=[];z(G,k(F,G))}A[F][G].push(H);return x}function k(F,G){return function(I){if(F==I.component){var H=A[F][G];if(H){for(var J=0;J<H.length;J++){if(typeof H[J]=="function"){H[J].call(this,I)}}}}}}function j(F,G){try{F.jwAddEventListener(G,'function(dat) { jwplayer("'+x.id+'").dispatchEvent("'+G+'", dat); }')}catch(H){a.log("Could not add internal listener")}}function z(F,G){if(!h[F]){h[F]=[];if(i&&D){j(i,F)}}h[F].push(G);return x}x.dispatchEvent=function(H){if(h[H]){var G=a.translateEventResponse(H,arguments[1]);for(var F=0;F<h[H].length;F++){if(typeof h[H][F]=="function"){h[H][F].call(this,G)}}}};x.dispatchInstreamEvent=function(F){if(y){y.dispatchEvent(F,arguments)}};function w(){if(D){var H=arguments[0],F=[];for(var G=1;G<arguments.length;G++){F.push(arguments[G])}if(typeof i!="undefined"&&typeof i[H]=="function"){switch(F.length){case 4:return(i[H])(F[0],F[1],F[2],F[3]);case 3:return(i[H])(F[0],F[1],F[2]);case 2:return(i[H])(F[0],F[1]);case 1:return(i[H])(F[0]);default:return(i[H])()}}return null}else{p.push(arguments)}}x.playerReady=function(F){D=true;if(!i){x.setPlayer(g.getElementById(F.id))}x.container=g.getElementById(x.id);a.foreach(h,function(G){j(i,G)});z(e.JWPLAYER_PLAYLIST_ITEM,function(G){s={}});z(e.JWPLAYER_MEDIA_META,function(G){a.extend(s,G.metadata)});x.dispatchEvent(e.API_READY);while(p.length>0){w.apply(this,p.shift())}};x.getItemMeta=function(){return s};x.getCurrentItem=function(){return w("jwGetPlaylistIndex")};function u(H,J,I){var F=[];if(!J){J=0}if(!I){I=H.length-1}for(var G=J;G<=I;G++){F.push(H[G])}return F}return x};f.selectPlayer=function(i){var h;if(!a.exists(i)){i=0}if(i.nodeType){h=i}else{if(typeof i=="string"){h=g.getElementById(i)}}if(h){var j=f.playerById(h.id);if(j){return j}else{return f.addPlayer(new f(h))}}else{if(typeof i=="number"){return c[i]}}return null};f.playerById=function(i){for(var h=0;h<c.length;h++){if(c[h].id==i){return c[h]}}return null};f.addPlayer=function(h){for(var i=0;i<c.length;i++){if(c[i]==h){return h}}c.push(h);return h};f.destroyPlayer=function(j){var i=-1,k;for(var m=0;m<c.length;m++){if(c[m].id==j){i=m;k=c[m];continue}}if(i>=0){var n=k.id,h=g.getElementById(n+(k.renderingMode=="flash"?"_wrapper":""));if(a.clearCss){a.clearCss("#"+n)}if(h){if(k.renderingMode=="html5"){k.destroyPlayer()}var l=g.createElement("div");l.id=n;h.parentNode.replaceChild(l,h)}c.splice(i,1)}return null};d.playerReady=function(i){var h=d.api.playerById(i.id);if(h){h.playerReady(i)}else{d.api.selectPlayer(i.id).playerReady(i)}}})(jwplayer);(function(b){var c=b.events,a=c.state;b.api.instream=function(e,k,o,r){var j=e,d=k,i=o,l=r,g={},q={};function h(){j.callInternal("jwLoadInstream",o,r)}function n(s,t){d.jwInstreamAddEventListener(t,'function(dat) { jwplayer("'+j.id+'").dispatchInstreamEvent("'+t+'", dat); }')}function f(s,t){if(!g[s]){g[s]=[];n(d,s)}g[s].push(t);return this}function p(s,t){if(!q[s]){q[s]=[];f(c.JWPLAYER_PLAYER_STATE,m(s))}q[s].push(t);return this}function m(s){return function(u){var t=u.newstate,w=u.oldstate;if(t==s){var v=q[t];if(v){for(var x=0;x<v.length;x++){if(typeof v[x]=="function"){v[x].call(this,{oldstate:w,newstate:t,type:u.type})}}}}}}this.dispatchEvent=function(v,u){if(g[v]){var t=_utils.translateEventResponse(v,u[1]);for(var s=0;s<g[v].length;s++){if(typeof g[v][s]=="function"){g[v][s].call(this,t)}}}};this.onError=function(s){return f(c.JWPLAYER_ERROR,s)};this.onFullscreen=function(s){return f(c.JWPLAYER_FULLSCREEN,s)};this.onMeta=function(s){return f(c.JWPLAYER_MEDIA_META,s)};this.onMute=function(s){return f(c.JWPLAYER_MEDIA_MUTE,s)};this.onComplete=function(s){return f(c.JWPLAYER_MEDIA_COMPLETE,s)};this.onSeek=function(s){return f(c.JWPLAYER_MEDIA_SEEK,s)};this.onTime=function(s){return f(c.JWPLAYER_MEDIA_TIME,s)};this.onVolume=function(s){return f(c.JWPLAYER_MEDIA_VOLUME,s)};this.onBuffer=function(s){return p(a.BUFFERING,s)};this.onPause=function(s){return p(a.PAUSED,s)};this.onPlay=function(s){return p(a.PLAYING,s)};this.onIdle=function(s){return p(a.IDLE,s)};this.onInstreamClick=function(s){return f(c.JWPLAYER_INSTREAM_CLICK,s)};this.onInstreamDestroyed=function(s){return f(c.JWPLAYER_INSTREAM_DESTROYED,s)};this.play=function(s){d.jwInstreamPlay(s)};this.pause=function(s){d.jwInstreamPause(s)};this.seek=function(s){d.jwInstreamSeek(s)};this.destroy=function(){d.jwInstreamDestroy()};this.getState=function(){return d.jwInstreamGetState()};this.getDuration=function(){return d.jwInstreamGetDuration()};this.getPosition=function(){return d.jwInstreamGetPosition()};h()}})(jwplayer);(function(a){var b=a.api,c=b.selectPlayer;b.selectPlayer=function(d){var e=c(d);if(e){return e}else{return{registerPlugin:function(i,h,g,f){a.plugins.registerPlugin(i,h,g)}}}}})(jwplayer)};
|
js/video/player.swf
ADDED
Binary file
|
js/video/swfobject.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2 |
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3 |
+
*/
|
4 |
+
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|
js/video/swfobject/expressInstall.swf
ADDED
Binary file
|
js/video/swfobject/index.html
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
3 |
+
<head>
|
4 |
+
<title>SWFObject 2 static publishing example page</title>
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
6 |
+
<script type="text/javascript" src="swfobject.js"></script>
|
7 |
+
<script type="text/javascript">
|
8 |
+
swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
|
9 |
+
</script>
|
10 |
+
</head>
|
11 |
+
<body>
|
12 |
+
<div>
|
13 |
+
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120">
|
14 |
+
<param name="movie" value="test.swf" />
|
15 |
+
<!--[if !IE]>-->
|
16 |
+
<object type="application/x-shockwave-flash" data="test.swf" width="300" height="120">
|
17 |
+
<!--<![endif]-->
|
18 |
+
<div>
|
19 |
+
<h1>Alternative content</h1>
|
20 |
+
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
|
21 |
+
</div>
|
22 |
+
<!--[if !IE]>-->
|
23 |
+
</object>
|
24 |
+
<!--<![endif]-->
|
25 |
+
</object>
|
26 |
+
</div>
|
27 |
+
</body>
|
28 |
+
</html>
|
js/video/swfobject/index_dynamic.html
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
3 |
+
<head>
|
4 |
+
<title>SWFObject 2 dynamic publishing example page</title>
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
6 |
+
<script type="text/javascript" src="swfobject.js"></script>
|
7 |
+
<script type="text/javascript">
|
8 |
+
swfobject.embedSWF("test.swf", "myContent", "300", "120", "9.0.0", "expressInstall.swf");
|
9 |
+
</script>
|
10 |
+
</head>
|
11 |
+
<body>
|
12 |
+
<div id="myContent">
|
13 |
+
<h1>Alternative content</h1>
|
14 |
+
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
|
15 |
+
</div>
|
16 |
+
</body>
|
17 |
+
</html>
|
js/video/swfobject/src/expressInstall.as
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
2 |
+
Express Install Copyright (c) 2007-2008 Adobe Systems Incorporated and its licensors. All Rights Reserved.
|
3 |
+
*/
|
4 |
+
|
5 |
+
System.security.allowDomain("fpdownload.macromedia.com");
|
6 |
+
|
7 |
+
var time = 0;
|
8 |
+
var timeOut = 5; // in seconds
|
9 |
+
var delay = 10; // in milliseconds
|
10 |
+
var int_id = setInterval(checkLoaded, delay);
|
11 |
+
var old_si = null;
|
12 |
+
var loaderClip = this.createEmptyMovieClip("loaderClip", 0);
|
13 |
+
var updateSWF = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + Math.random();
|
14 |
+
loaderClip.loadMovie(updateSWF);
|
15 |
+
|
16 |
+
function checkLoaded(){
|
17 |
+
time += delay / 1000;
|
18 |
+
if (time > timeOut) {
|
19 |
+
// updater did not load in time, abort load and force alternative content
|
20 |
+
clearInterval(int_id);
|
21 |
+
loaderClip.unloadMovie();
|
22 |
+
loadTimeOut();
|
23 |
+
}
|
24 |
+
else if (loaderClip.startInstall.toString() == "[type Function]") {
|
25 |
+
// updater has loaded successfully AND has determined that it can do the express install
|
26 |
+
if (old_si == null) {
|
27 |
+
old_si = loaderClip.startInstall;
|
28 |
+
loaderClip.startInstall = function() {
|
29 |
+
clearInterval(int_id);
|
30 |
+
old_si();
|
31 |
+
}
|
32 |
+
loadComplete();
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
function loadTimeOut() {
|
38 |
+
callbackSWFObject();
|
39 |
+
}
|
40 |
+
|
41 |
+
function callbackSWFObject() {
|
42 |
+
getURL("javascript:swfobject.expressInstallCallback();");
|
43 |
+
}
|
44 |
+
|
45 |
+
function loadComplete() {
|
46 |
+
loaderClip.redirectURL = _level0.MMredirectURL;
|
47 |
+
loaderClip.MMplayerType = _level0.MMplayerType;
|
48 |
+
loaderClip.MMdoctitle = _level0.MMdoctitle;
|
49 |
+
loaderClip.startUpdate();
|
50 |
+
}
|
51 |
+
|
52 |
+
function installStatus(statusValue) {
|
53 |
+
switch (statusValue) {
|
54 |
+
case "Download.Complete":
|
55 |
+
// Installation is complete.
|
56 |
+
// In most cases the browser window that this SWF is hosted in will be closed by the installer or otherwise it has to be closed manually by the end user.
|
57 |
+
// The Adobe Flash installer will attempt to reopen the browser window and reload the page containing the SWF.
|
58 |
+
break;
|
59 |
+
case "Download.Cancelled":
|
60 |
+
// The end user chose "NO" when prompted to install the new player.
|
61 |
+
// By default the SWFObject callback function is called to force alternative content.
|
62 |
+
callbackSWFObject();
|
63 |
+
break;
|
64 |
+
case "Download.Failed":
|
65 |
+
// The end user failed to download the installer due to a network failure.
|
66 |
+
// By default the SWFObject callback function is called to force alternative content.
|
67 |
+
callbackSWFObject();
|
68 |
+
break;
|
69 |
+
}
|
70 |
+
}
|
js/video/swfobject/src/expressInstall.fla
ADDED
Binary file
|
js/video/swfobject/src/swfobject.js
ADDED
@@ -0,0 +1,777 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2 |
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3 |
+
*/
|
4 |
+
|
5 |
+
var swfobject = function() {
|
6 |
+
|
7 |
+
var UNDEF = "undefined",
|
8 |
+
OBJECT = "object",
|
9 |
+
SHOCKWAVE_FLASH = "Shockwave Flash",
|
10 |
+
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
|
11 |
+
FLASH_MIME_TYPE = "application/x-shockwave-flash",
|
12 |
+
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
|
13 |
+
ON_READY_STATE_CHANGE = "onreadystatechange",
|
14 |
+
|
15 |
+
win = window,
|
16 |
+
doc = document,
|
17 |
+
nav = navigator,
|
18 |
+
|
19 |
+
plugin = false,
|
20 |
+
domLoadFnArr = [main],
|
21 |
+
regObjArr = [],
|
22 |
+
objIdArr = [],
|
23 |
+
listenersArr = [],
|
24 |
+
storedAltContent,
|
25 |
+
storedAltContentId,
|
26 |
+
storedCallbackFn,
|
27 |
+
storedCallbackObj,
|
28 |
+
isDomLoaded = false,
|
29 |
+
isExpressInstallActive = false,
|
30 |
+
dynamicStylesheet,
|
31 |
+
dynamicStylesheetMedia,
|
32 |
+
autoHideShow = true,
|
33 |
+
|
34 |
+
/* Centralized function for browser feature detection
|
35 |
+
- User agent string detection is only used when no good alternative is possible
|
36 |
+
- Is executed directly for optimal performance
|
37 |
+
*/
|
38 |
+
ua = function() {
|
39 |
+
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
|
40 |
+
u = nav.userAgent.toLowerCase(),
|
41 |
+
p = nav.platform.toLowerCase(),
|
42 |
+
windows = p ? /win/.test(p) : /win/.test(u),
|
43 |
+
mac = p ? /mac/.test(p) : /mac/.test(u),
|
44 |
+
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
45 |
+
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
|
46 |
+
playerVersion = [0,0,0],
|
47 |
+
d = null;
|
48 |
+
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
49 |
+
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
50 |
+
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
|
51 |
+
plugin = true;
|
52 |
+
ie = false; // cascaded feature detection for Internet Explorer
|
53 |
+
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
54 |
+
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
55 |
+
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
56 |
+
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
else if (typeof win.ActiveXObject != UNDEF) {
|
60 |
+
try {
|
61 |
+
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
62 |
+
if (a) { // a will return null when ActiveX is disabled
|
63 |
+
d = a.GetVariable("$version");
|
64 |
+
if (d) {
|
65 |
+
ie = true; // cascaded feature detection for Internet Explorer
|
66 |
+
d = d.split(" ")[1].split(",");
|
67 |
+
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
catch(e) {}
|
72 |
+
}
|
73 |
+
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
|
74 |
+
}(),
|
75 |
+
|
76 |
+
/* Cross-browser onDomLoad
|
77 |
+
- Will fire an event as soon as the DOM of a web page is loaded
|
78 |
+
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
|
79 |
+
- Regular onload serves as fallback
|
80 |
+
*/
|
81 |
+
onDomLoad = function() {
|
82 |
+
if (!ua.w3) { return; }
|
83 |
+
if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
|
84 |
+
callDomLoadFunctions();
|
85 |
+
}
|
86 |
+
if (!isDomLoaded) {
|
87 |
+
if (typeof doc.addEventListener != UNDEF) {
|
88 |
+
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
|
89 |
+
}
|
90 |
+
if (ua.ie && ua.win) {
|
91 |
+
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
|
92 |
+
if (doc.readyState == "complete") {
|
93 |
+
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
|
94 |
+
callDomLoadFunctions();
|
95 |
+
}
|
96 |
+
});
|
97 |
+
if (win == top) { // if not inside an iframe
|
98 |
+
(function(){
|
99 |
+
if (isDomLoaded) { return; }
|
100 |
+
try {
|
101 |
+
doc.documentElement.doScroll("left");
|
102 |
+
}
|
103 |
+
catch(e) {
|
104 |
+
setTimeout(arguments.callee, 0);
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
callDomLoadFunctions();
|
108 |
+
})();
|
109 |
+
}
|
110 |
+
}
|
111 |
+
if (ua.wk) {
|
112 |
+
(function(){
|
113 |
+
if (isDomLoaded) { return; }
|
114 |
+
if (!/loaded|complete/.test(doc.readyState)) {
|
115 |
+
setTimeout(arguments.callee, 0);
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
callDomLoadFunctions();
|
119 |
+
})();
|
120 |
+
}
|
121 |
+
addLoadEvent(callDomLoadFunctions);
|
122 |
+
}
|
123 |
+
}();
|
124 |
+
|
125 |
+
function callDomLoadFunctions() {
|
126 |
+
if (isDomLoaded) { return; }
|
127 |
+
try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
|
128 |
+
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
|
129 |
+
t.parentNode.removeChild(t);
|
130 |
+
}
|
131 |
+
catch (e) { return; }
|
132 |
+
isDomLoaded = true;
|
133 |
+
var dl = domLoadFnArr.length;
|
134 |
+
for (var i = 0; i < dl; i++) {
|
135 |
+
domLoadFnArr[i]();
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
function addDomLoadEvent(fn) {
|
140 |
+
if (isDomLoaded) {
|
141 |
+
fn();
|
142 |
+
}
|
143 |
+
else {
|
144 |
+
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
/* Cross-browser onload
|
149 |
+
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
150 |
+
- Will fire an event as soon as a web page including all of its assets are loaded
|
151 |
+
*/
|
152 |
+
function addLoadEvent(fn) {
|
153 |
+
if (typeof win.addEventListener != UNDEF) {
|
154 |
+
win.addEventListener("load", fn, false);
|
155 |
+
}
|
156 |
+
else if (typeof doc.addEventListener != UNDEF) {
|
157 |
+
doc.addEventListener("load", fn, false);
|
158 |
+
}
|
159 |
+
else if (typeof win.attachEvent != UNDEF) {
|
160 |
+
addListener(win, "onload", fn);
|
161 |
+
}
|
162 |
+
else if (typeof win.onload == "function") {
|
163 |
+
var fnOld = win.onload;
|
164 |
+
win.onload = function() {
|
165 |
+
fnOld();
|
166 |
+
fn();
|
167 |
+
};
|
168 |
+
}
|
169 |
+
else {
|
170 |
+
win.onload = fn;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
/* Main function
|
175 |
+
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
176 |
+
*/
|
177 |
+
function main() {
|
178 |
+
if (plugin) {
|
179 |
+
testPlayerVersion();
|
180 |
+
}
|
181 |
+
else {
|
182 |
+
matchVersions();
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
/* Detect the Flash Player version for non-Internet Explorer browsers
|
187 |
+
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
|
188 |
+
a. Both release and build numbers can be detected
|
189 |
+
b. Avoid wrong descriptions by corrupt installers provided by Adobe
|
190 |
+
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
|
191 |
+
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
|
192 |
+
*/
|
193 |
+
function testPlayerVersion() {
|
194 |
+
var b = doc.getElementsByTagName("body")[0];
|
195 |
+
var o = createElement(OBJECT);
|
196 |
+
o.setAttribute("type", FLASH_MIME_TYPE);
|
197 |
+
var t = b.appendChild(o);
|
198 |
+
if (t) {
|
199 |
+
var counter = 0;
|
200 |
+
(function(){
|
201 |
+
if (typeof t.GetVariable != UNDEF) {
|
202 |
+
var d = t.GetVariable("$version");
|
203 |
+
if (d) {
|
204 |
+
d = d.split(" ")[1].split(",");
|
205 |
+
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
|
206 |
+
}
|
207 |
+
}
|
208 |
+
else if (counter < 10) {
|
209 |
+
counter++;
|
210 |
+
setTimeout(arguments.callee, 10);
|
211 |
+
return;
|
212 |
+
}
|
213 |
+
b.removeChild(o);
|
214 |
+
t = null;
|
215 |
+
matchVersions();
|
216 |
+
})();
|
217 |
+
}
|
218 |
+
else {
|
219 |
+
matchVersions();
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/* Perform Flash Player and SWF version matching; static publishing only
|
224 |
+
*/
|
225 |
+
function matchVersions() {
|
226 |
+
var rl = regObjArr.length;
|
227 |
+
if (rl > 0) {
|
228 |
+
for (var i = 0; i < rl; i++) { // for each registered object element
|
229 |
+
var id = regObjArr[i].id;
|
230 |
+
var cb = regObjArr[i].callbackFn;
|
231 |
+
var cbObj = {success:false, id:id};
|
232 |
+
if (ua.pv[0] > 0) {
|
233 |
+
var obj = getElementById(id);
|
234 |
+
if (obj) {
|
235 |
+
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
|
236 |
+
setVisibility(id, true);
|
237 |
+
if (cb) {
|
238 |
+
cbObj.success = true;
|
239 |
+
cbObj.ref = getObjectById(id);
|
240 |
+
cb(cbObj);
|
241 |
+
}
|
242 |
+
}
|
243 |
+
else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
|
244 |
+
var att = {};
|
245 |
+
att.data = regObjArr[i].expressInstall;
|
246 |
+
att.width = obj.getAttribute("width") || "0";
|
247 |
+
att.height = obj.getAttribute("height") || "0";
|
248 |
+
if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
|
249 |
+
if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
|
250 |
+
// parse HTML object param element's name-value pairs
|
251 |
+
var par = {};
|
252 |
+
var p = obj.getElementsByTagName("param");
|
253 |
+
var pl = p.length;
|
254 |
+
for (var j = 0; j < pl; j++) {
|
255 |
+
if (p[j].getAttribute("name").toLowerCase() != "movie") {
|
256 |
+
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
|
257 |
+
}
|
258 |
+
}
|
259 |
+
showExpressInstall(att, par, id, cb);
|
260 |
+
}
|
261 |
+
else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
|
262 |
+
displayAltContent(obj);
|
263 |
+
if (cb) { cb(cbObj); }
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
|
268 |
+
setVisibility(id, true);
|
269 |
+
if (cb) {
|
270 |
+
var o = getObjectById(id); // test whether there is an HTML object element or not
|
271 |
+
if (o && typeof o.SetVariable != UNDEF) {
|
272 |
+
cbObj.success = true;
|
273 |
+
cbObj.ref = o;
|
274 |
+
}
|
275 |
+
cb(cbObj);
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
function getObjectById(objectIdStr) {
|
283 |
+
var r = null;
|
284 |
+
var o = getElementById(objectIdStr);
|
285 |
+
if (o && o.nodeName == "OBJECT") {
|
286 |
+
if (typeof o.SetVariable != UNDEF) {
|
287 |
+
r = o;
|
288 |
+
}
|
289 |
+
else {
|
290 |
+
var n = o.getElementsByTagName(OBJECT)[0];
|
291 |
+
if (n) {
|
292 |
+
r = n;
|
293 |
+
}
|
294 |
+
}
|
295 |
+
}
|
296 |
+
return r;
|
297 |
+
}
|
298 |
+
|
299 |
+
/* Requirements for Adobe Express Install
|
300 |
+
- only one instance can be active at a time
|
301 |
+
- fp 6.0.65 or higher
|
302 |
+
- Win/Mac OS only
|
303 |
+
- no Webkit engines older than version 312
|
304 |
+
*/
|
305 |
+
function canExpressInstall() {
|
306 |
+
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
|
307 |
+
}
|
308 |
+
|
309 |
+
/* Show the Adobe Express Install dialog
|
310 |
+
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
311 |
+
*/
|
312 |
+
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
|
313 |
+
isExpressInstallActive = true;
|
314 |
+
storedCallbackFn = callbackFn || null;
|
315 |
+
storedCallbackObj = {success:false, id:replaceElemIdStr};
|
316 |
+
var obj = getElementById(replaceElemIdStr);
|
317 |
+
if (obj) {
|
318 |
+
if (obj.nodeName == "OBJECT") { // static publishing
|
319 |
+
storedAltContent = abstractAltContent(obj);
|
320 |
+
storedAltContentId = null;
|
321 |
+
}
|
322 |
+
else { // dynamic publishing
|
323 |
+
storedAltContent = obj;
|
324 |
+
storedAltContentId = replaceElemIdStr;
|
325 |
+
}
|
326 |
+
att.id = EXPRESS_INSTALL_ID;
|
327 |
+
if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
|
328 |
+
if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
|
329 |
+
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
330 |
+
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
|
331 |
+
fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
|
332 |
+
if (typeof par.flashvars != UNDEF) {
|
333 |
+
par.flashvars += "&" + fv;
|
334 |
+
}
|
335 |
+
else {
|
336 |
+
par.flashvars = fv;
|
337 |
+
}
|
338 |
+
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
339 |
+
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
340 |
+
if (ua.ie && ua.win && obj.readyState != 4) {
|
341 |
+
var newObj = createElement("div");
|
342 |
+
replaceElemIdStr += "SWFObjectNew";
|
343 |
+
newObj.setAttribute("id", replaceElemIdStr);
|
344 |
+
obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
345 |
+
obj.style.display = "none";
|
346 |
+
(function(){
|
347 |
+
if (obj.readyState == 4) {
|
348 |
+
obj.parentNode.removeChild(obj);
|
349 |
+
}
|
350 |
+
else {
|
351 |
+
setTimeout(arguments.callee, 10);
|
352 |
+
}
|
353 |
+
})();
|
354 |
+
}
|
355 |
+
createSWF(att, par, replaceElemIdStr);
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
/* Functions to abstract and display alternative content
|
360 |
+
*/
|
361 |
+
function displayAltContent(obj) {
|
362 |
+
if (ua.ie && ua.win && obj.readyState != 4) {
|
363 |
+
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
364 |
+
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
365 |
+
var el = createElement("div");
|
366 |
+
obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
|
367 |
+
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
368 |
+
obj.style.display = "none";
|
369 |
+
(function(){
|
370 |
+
if (obj.readyState == 4) {
|
371 |
+
obj.parentNode.removeChild(obj);
|
372 |
+
}
|
373 |
+
else {
|
374 |
+
setTimeout(arguments.callee, 10);
|
375 |
+
}
|
376 |
+
})();
|
377 |
+
}
|
378 |
+
else {
|
379 |
+
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
function abstractAltContent(obj) {
|
384 |
+
var ac = createElement("div");
|
385 |
+
if (ua.win && ua.ie) {
|
386 |
+
ac.innerHTML = obj.innerHTML;
|
387 |
+
}
|
388 |
+
else {
|
389 |
+
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
390 |
+
if (nestedObj) {
|
391 |
+
var c = nestedObj.childNodes;
|
392 |
+
if (c) {
|
393 |
+
var cl = c.length;
|
394 |
+
for (var i = 0; i < cl; i++) {
|
395 |
+
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
|
396 |
+
ac.appendChild(c[i].cloneNode(true));
|
397 |
+
}
|
398 |
+
}
|
399 |
+
}
|
400 |
+
}
|
401 |
+
}
|
402 |
+
return ac;
|
403 |
+
}
|
404 |
+
|
405 |
+
/* Cross-browser dynamic SWF creation
|
406 |
+
*/
|
407 |
+
function createSWF(attObj, parObj, id) {
|
408 |
+
var r, el = getElementById(id);
|
409 |
+
if (ua.wk && ua.wk < 312) { return r; }
|
410 |
+
if (el) {
|
411 |
+
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
412 |
+
attObj.id = id;
|
413 |
+
}
|
414 |
+
if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
|
415 |
+
var att = "";
|
416 |
+
for (var i in attObj) {
|
417 |
+
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
|
418 |
+
if (i.toLowerCase() == "data") {
|
419 |
+
parObj.movie = attObj[i];
|
420 |
+
}
|
421 |
+
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
422 |
+
att += ' class="' + attObj[i] + '"';
|
423 |
+
}
|
424 |
+
else if (i.toLowerCase() != "classid") {
|
425 |
+
att += ' ' + i + '="' + attObj[i] + '"';
|
426 |
+
}
|
427 |
+
}
|
428 |
+
}
|
429 |
+
var par = "";
|
430 |
+
for (var j in parObj) {
|
431 |
+
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
|
432 |
+
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
433 |
+
}
|
434 |
+
}
|
435 |
+
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
|
436 |
+
objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
|
437 |
+
r = getElementById(attObj.id);
|
438 |
+
}
|
439 |
+
else { // well-behaving browsers
|
440 |
+
var o = createElement(OBJECT);
|
441 |
+
o.setAttribute("type", FLASH_MIME_TYPE);
|
442 |
+
for (var m in attObj) {
|
443 |
+
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
|
444 |
+
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
|
445 |
+
o.setAttribute("class", attObj[m]);
|
446 |
+
}
|
447 |
+
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
|
448 |
+
o.setAttribute(m, attObj[m]);
|
449 |
+
}
|
450 |
+
}
|
451 |
+
}
|
452 |
+
for (var n in parObj) {
|
453 |
+
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
|
454 |
+
createObjParam(o, n, parObj[n]);
|
455 |
+
}
|
456 |
+
}
|
457 |
+
el.parentNode.replaceChild(o, el);
|
458 |
+
r = o;
|
459 |
+
}
|
460 |
+
}
|
461 |
+
return r;
|
462 |
+
}
|
463 |
+
|
464 |
+
function createObjParam(el, pName, pValue) {
|
465 |
+
var p = createElement("param");
|
466 |
+
p.setAttribute("name", pName);
|
467 |
+
p.setAttribute("value", pValue);
|
468 |
+
el.appendChild(p);
|
469 |
+
}
|
470 |
+
|
471 |
+
/* Cross-browser SWF removal
|
472 |
+
- Especially needed to safely and completely remove a SWF in Internet Explorer
|
473 |
+
*/
|
474 |
+
function removeSWF(id) {
|
475 |
+
var obj = getElementById(id);
|
476 |
+
if (obj && obj.nodeName == "OBJECT") {
|
477 |
+
if (ua.ie && ua.win) {
|
478 |
+
obj.style.display = "none";
|
479 |
+
(function(){
|
480 |
+
if (obj.readyState == 4) {
|
481 |
+
removeObjectInIE(id);
|
482 |
+
}
|
483 |
+
else {
|
484 |
+
setTimeout(arguments.callee, 10);
|
485 |
+
}
|
486 |
+
})();
|
487 |
+
}
|
488 |
+
else {
|
489 |
+
obj.parentNode.removeChild(obj);
|
490 |
+
}
|
491 |
+
}
|
492 |
+
}
|
493 |
+
|
494 |
+
function removeObjectInIE(id) {
|
495 |
+
var obj = getElementById(id);
|
496 |
+
if (obj) {
|
497 |
+
for (var i in obj) {
|
498 |
+
if (typeof obj[i] == "function") {
|
499 |
+
obj[i] = null;
|
500 |
+
}
|
501 |
+
}
|
502 |
+
obj.parentNode.removeChild(obj);
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
/* Functions to optimize JavaScript compression
|
507 |
+
*/
|
508 |
+
function getElementById(id) {
|
509 |
+
var el = null;
|
510 |
+
try {
|
511 |
+
el = doc.getElementById(id);
|
512 |
+
}
|
513 |
+
catch (e) {}
|
514 |
+
return el;
|
515 |
+
}
|
516 |
+
|
517 |
+
function createElement(el) {
|
518 |
+
return doc.createElement(el);
|
519 |
+
}
|
520 |
+
|
521 |
+
/* Updated attachEvent function for Internet Explorer
|
522 |
+
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
|
523 |
+
*/
|
524 |
+
function addListener(target, eventType, fn) {
|
525 |
+
target.attachEvent(eventType, fn);
|
526 |
+
listenersArr[listenersArr.length] = [target, eventType, fn];
|
527 |
+
}
|
528 |
+
|
529 |
+
/* Flash Player and SWF content version matching
|
530 |
+
*/
|
531 |
+
function hasPlayerVersion(rv) {
|
532 |
+
var pv = ua.pv, v = rv.split(".");
|
533 |
+
v[0] = parseInt(v[0], 10);
|
534 |
+
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
|
535 |
+
v[2] = parseInt(v[2], 10) || 0;
|
536 |
+
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
|
537 |
+
}
|
538 |
+
|
539 |
+
/* Cross-browser dynamic CSS creation
|
540 |
+
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
541 |
+
*/
|
542 |
+
function createCSS(sel, decl, media, newStyle) {
|
543 |
+
if (ua.ie && ua.mac) { return; }
|
544 |
+
var h = doc.getElementsByTagName("head")[0];
|
545 |
+
if (!h) { return; } // to also support badly authored HTML pages that lack a head element
|
546 |
+
var m = (media && typeof media == "string") ? media : "screen";
|
547 |
+
if (newStyle) {
|
548 |
+
dynamicStylesheet = null;
|
549 |
+
dynamicStylesheetMedia = null;
|
550 |
+
}
|
551 |
+
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
|
552 |
+
// create dynamic stylesheet + get a global reference to it
|
553 |
+
var s = createElement("style");
|
554 |
+
s.setAttribute("type", "text/css");
|
555 |
+
s.setAttribute("media", m);
|
556 |
+
dynamicStylesheet = h.appendChild(s);
|
557 |
+
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
558 |
+
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
|
559 |
+
}
|
560 |
+
dynamicStylesheetMedia = m;
|
561 |
+
}
|
562 |
+
// add style rule
|
563 |
+
if (ua.ie && ua.win) {
|
564 |
+
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
|
565 |
+
dynamicStylesheet.addRule(sel, decl);
|
566 |
+
}
|
567 |
+
}
|
568 |
+
else {
|
569 |
+
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
|
570 |
+
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
571 |
+
}
|
572 |
+
}
|
573 |
+
}
|
574 |
+
|
575 |
+
function setVisibility(id, isVisible) {
|
576 |
+
if (!autoHideShow) { return; }
|
577 |
+
var v = isVisible ? "visible" : "hidden";
|
578 |
+
if (isDomLoaded && getElementById(id)) {
|
579 |
+
getElementById(id).style.visibility = v;
|
580 |
+
}
|
581 |
+
else {
|
582 |
+
createCSS("#" + id, "visibility:" + v);
|
583 |
+
}
|
584 |
+
}
|
585 |
+
|
586 |
+
/* Filter to avoid XSS attacks
|
587 |
+
*/
|
588 |
+
function urlEncodeIfNecessary(s) {
|
589 |
+
var regex = /[\\\"<>\.;]/;
|
590 |
+
var hasBadChars = regex.exec(s) != null;
|
591 |
+
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
|
592 |
+
}
|
593 |
+
|
594 |
+
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
|
595 |
+
*/
|
596 |
+
var cleanup = function() {
|
597 |
+
if (ua.ie && ua.win) {
|
598 |
+
window.attachEvent("onunload", function() {
|
599 |
+
// remove listeners to avoid memory leaks
|
600 |
+
var ll = listenersArr.length;
|
601 |
+
for (var i = 0; i < ll; i++) {
|
602 |
+
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
|
603 |
+
}
|
604 |
+
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
|
605 |
+
var il = objIdArr.length;
|
606 |
+
for (var j = 0; j < il; j++) {
|
607 |
+
removeSWF(objIdArr[j]);
|
608 |
+
}
|
609 |
+
// cleanup library's main closures to avoid memory leaks
|
610 |
+
for (var k in ua) {
|
611 |
+
ua[k] = null;
|
612 |
+
}
|
613 |
+
ua = null;
|
614 |
+
for (var l in swfobject) {
|
615 |
+
swfobject[l] = null;
|
616 |
+
}
|
617 |
+
swfobject = null;
|
618 |
+
});
|
619 |
+
}
|
620 |
+
}();
|
621 |
+
|
622 |
+
return {
|
623 |
+
/* Public API
|
624 |
+
- Reference: http://code.google.com/p/swfobject/wiki/documentation
|
625 |
+
*/
|
626 |
+
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
|
627 |
+
if (ua.w3 && objectIdStr && swfVersionStr) {
|
628 |
+
var regObj = {};
|
629 |
+
regObj.id = objectIdStr;
|
630 |
+
regObj.swfVersion = swfVersionStr;
|
631 |
+
regObj.expressInstall = xiSwfUrlStr;
|
632 |
+
regObj.callbackFn = callbackFn;
|
633 |
+
regObjArr[regObjArr.length] = regObj;
|
634 |
+
setVisibility(objectIdStr, false);
|
635 |
+
}
|
636 |
+
else if (callbackFn) {
|
637 |
+
callbackFn({success:false, id:objectIdStr});
|
638 |
+
}
|
639 |
+
},
|
640 |
+
|
641 |
+
getObjectById: function(objectIdStr) {
|
642 |
+
if (ua.w3) {
|
643 |
+
return getObjectById(objectIdStr);
|
644 |
+
}
|
645 |
+
},
|
646 |
+
|
647 |
+
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
|
648 |
+
var callbackObj = {success:false, id:replaceElemIdStr};
|
649 |
+
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
|
650 |
+
setVisibility(replaceElemIdStr, false);
|
651 |
+
addDomLoadEvent(function() {
|
652 |
+
widthStr += ""; // auto-convert to string
|
653 |
+
heightStr += "";
|
654 |
+
var att = {};
|
655 |
+
if (attObj && typeof attObj === OBJECT) {
|
656 |
+
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
|
657 |
+
att[i] = attObj[i];
|
658 |
+
}
|
659 |
+
}
|
660 |
+
att.data = swfUrlStr;
|
661 |
+
att.width = widthStr;
|
662 |
+
att.height = heightStr;
|
663 |
+
var par = {};
|
664 |
+
if (parObj && typeof parObj === OBJECT) {
|
665 |
+
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
|
666 |
+
par[j] = parObj[j];
|
667 |
+
}
|
668 |
+
}
|
669 |
+
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
|
670 |
+
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
|
671 |
+
if (typeof par.flashvars != UNDEF) {
|
672 |
+
par.flashvars += "&" + k + "=" + flashvarsObj[k];
|
673 |
+
}
|
674 |
+
else {
|
675 |
+
par.flashvars = k + "=" + flashvarsObj[k];
|
676 |
+
}
|
677 |
+
}
|
678 |
+
}
|
679 |
+
if (hasPlayerVersion(swfVersionStr)) { // create SWF
|
680 |
+
var obj = createSWF(att, par, replaceElemIdStr);
|
681 |
+
if (att.id == replaceElemIdStr) {
|
682 |
+
setVisibility(replaceElemIdStr, true);
|
683 |
+
}
|
684 |
+
callbackObj.success = true;
|
685 |
+
callbackObj.ref = obj;
|
686 |
+
}
|
687 |
+
else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
|
688 |
+
att.data = xiSwfUrlStr;
|
689 |
+
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
690 |
+
return;
|
691 |
+
}
|
692 |
+
else { // show alternative content
|
693 |
+
setVisibility(replaceElemIdStr, true);
|
694 |
+
}
|
695 |
+
if (callbackFn) { callbackFn(callbackObj); }
|
696 |
+
});
|
697 |
+
}
|
698 |
+
else if (callbackFn) { callbackFn(callbackObj); }
|
699 |
+
},
|
700 |
+
|
701 |
+
switchOffAutoHideShow: function() {
|
702 |
+
autoHideShow = false;
|
703 |
+
},
|
704 |
+
|
705 |
+
ua: ua,
|
706 |
+
|
707 |
+
getFlashPlayerVersion: function() {
|
708 |
+
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
|
709 |
+
},
|
710 |
+
|
711 |
+
hasFlashPlayerVersion: hasPlayerVersion,
|
712 |
+
|
713 |
+
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
714 |
+
if (ua.w3) {
|
715 |
+
return createSWF(attObj, parObj, replaceElemIdStr);
|
716 |
+
}
|
717 |
+
else {
|
718 |
+
return undefined;
|
719 |
+
}
|
720 |
+
},
|
721 |
+
|
722 |
+
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
|
723 |
+
if (ua.w3 && canExpressInstall()) {
|
724 |
+
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
725 |
+
}
|
726 |
+
},
|
727 |
+
|
728 |
+
removeSWF: function(objElemIdStr) {
|
729 |
+
if (ua.w3) {
|
730 |
+
removeSWF(objElemIdStr);
|
731 |
+
}
|
732 |
+
},
|
733 |
+
|
734 |
+
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
|
735 |
+
if (ua.w3) {
|
736 |
+
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
|
737 |
+
}
|
738 |
+
},
|
739 |
+
|
740 |
+
addDomLoadEvent: addDomLoadEvent,
|
741 |
+
|
742 |
+
addLoadEvent: addLoadEvent,
|
743 |
+
|
744 |
+
getQueryParamValue: function(param) {
|
745 |
+
var q = doc.location.search || doc.location.hash;
|
746 |
+
if (q) {
|
747 |
+
if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
|
748 |
+
if (param == null) {
|
749 |
+
return urlEncodeIfNecessary(q);
|
750 |
+
}
|
751 |
+
var pairs = q.split("&");
|
752 |
+
for (var i = 0; i < pairs.length; i++) {
|
753 |
+
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
754 |
+
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
|
755 |
+
}
|
756 |
+
}
|
757 |
+
}
|
758 |
+
return "";
|
759 |
+
},
|
760 |
+
|
761 |
+
// For internal usage only
|
762 |
+
expressInstallCallback: function() {
|
763 |
+
if (isExpressInstallActive) {
|
764 |
+
var obj = getElementById(EXPRESS_INSTALL_ID);
|
765 |
+
if (obj && storedAltContent) {
|
766 |
+
obj.parentNode.replaceChild(storedAltContent, obj);
|
767 |
+
if (storedAltContentId) {
|
768 |
+
setVisibility(storedAltContentId, true);
|
769 |
+
if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
|
770 |
+
}
|
771 |
+
if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
|
772 |
+
}
|
773 |
+
isExpressInstallActive = false;
|
774 |
+
}
|
775 |
+
}
|
776 |
+
};
|
777 |
+
}();
|
js/video/swfobject/swfobject.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
2 |
+
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
3 |
+
*/
|
4 |
+
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
|
js/video/swfobject/test.swf
ADDED
Binary file
|
js/video/video.js
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
**Video js created on 12-12-2012
|
3 |
+
*/
|
4 |
+
|
5 |
+
function showVideo()
|
6 |
+
{
|
7 |
+
document.getElementById('vid').style.display="block";
|
8 |
+
jwplayer().play(true);
|
9 |
+
}
|
10 |
+
|
11 |
+
function stopVideo(){
|
12 |
+
|
13 |
+
document.getElementById('vid').style.display="none";
|
14 |
+
jwplayer().stop();
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
function showHide(){
|
19 |
+
alert("helooo");
|
20 |
+
}
|
21 |
+
|
22 |
+
|
js/video/video.js~
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
**Video js created on 12-12-2012
|
3 |
+
*/
|
4 |
+
|
5 |
+
function showVideo()
|
6 |
+
{
|
7 |
+
document.getElementById('vid').style.display="block";
|
8 |
+
jwplayer().play(true);
|
9 |
+
}
|
10 |
+
|
11 |
+
function stopVideo(){
|
12 |
+
|
13 |
+
document.getElementById('vid').style.display="none";
|
14 |
+
jwplayer().stop();
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Product_Video_Telemantis</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GPL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Product Video Display</summary>
|
10 |
+
<description>The extension will upload video with product</description>
|
11 |
+
<notes>First Release</notes>
|
12 |
+
<authors><author><name>saurabh chandela</name><user>SAURABHCHANDELA</user><email>saurabh.chandela82@gmail.com</email></author></authors>
|
13 |
+
<date>2013-01-07</date>
|
14 |
+
<time>05:19:42</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Telemantis"><dir name="FileAttributes"><dir name="Block"><dir name="Adminhtml"><dir name="Obsolete"><dir name="Files"><file name="Grid.php" hash="611680090474d5cc8abd82625d6af058"/><file name="Grid.php~" hash="611680090474d5cc8abd82625d6af058"/></dir><file name="Files.php" hash="a147955ea8eac633ebfc405b6a9f58fc"/><file name="Files.php~" hash="a147955ea8eac633ebfc405b6a9f58fc"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><dir name="File"><file name="Size.php" hash="576c63dd24b332c9bc6b5121a2f72a8a"/><file name="Size.php~" hash="576c63dd24b332c9bc6b5121a2f72a8a"/></dir><file name="Timestamp.php" hash="aa34331afa796fdd2a5eb841e72ae527"/><file name="Timestamp.php~" hash="17ebc4a80201a75881acc8d120dbef1b"/></dir><dir name="Renderer"><dir name="File"><file name="Link.php" hash="6667ab78cc83b7bd5b48e8a6528b38f2"/><file name="Link.php~" hash="c86421c1f70976761a8e1591523d2dc2"/><file name="Size.php" hash="9d28404fd21df3dca2db4bcf2e4bcdf0"/><file name="Size.php~" hash="f860ecc9c922e2d8a2e6e2c173315fb1"/></dir><file name="Timestamp.php" hash="58667e78a6e32dfe1a4bcc7e7994785b"/><file name="Timestamp.php~" hash="418066eb3447b5ad0c83daeccb0865d4"/></dir></dir></dir></dir></dir><dir name="Form"><dir name="Element"><file name="File.php" hash="ae41494e9f4709b913981cf51defa72c"/><file name="File.php~" hash="ae41494e9f4709b913981cf51defa72c"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><dir name="Attributes"><file name="Configuration.php" hash="383df2d31ea8aabb7400f9e555d5601c"/><file name="Configuration.php~" hash="383df2d31ea8aabb7400f9e555d5601c"/></dir><dir name="Select"><file name="Abstract.php" hash="4faed85b3cd70aa7d844fa409d7eb20a"/><file name="Abstract.php~" hash="4faed85b3cd70aa7d844fa409d7eb20a"/><file name="Attribute.php" hash="079e2f90407982932a3efed3459b1365"/><file name="Attribute.php~" hash="079e2f90407982932a3efed3459b1365"/><file name="Boolean.php" hash="646e00ba9873b0489cd5ad79d3029c1f"/><file name="Boolean.php~" hash="646e00ba9873b0489cd5ad79d3029c1f"/><dir name="Exceptions"><dir name="Handling"><file name="Mode.php" hash="8380a7b8a283f6a6dec3e4e56fa9ef0d"/><file name="Mode.php~" hash="8380a7b8a283f6a6dec3e4e56fa9ef0d"/></dir></dir><dir name="File"><dir name="Save"><file name="Moment.php" hash="1317f5b161c2b0e204e3c1c5fa54cfc9"/><file name="Moment.php~" hash="1317f5b161c2b0e204e3c1c5fa54cfc9"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Config.php" hash="3f7cb13be9acdc61cf1e9f260d6a2d95"/><file name="Config.php~" hash="3f7cb13be9acdc61cf1e9f260d6a2d95"/><file name="Data.php" hash="1dc6a8d957a1a5f1794f5b4a756b55a4"/><file name="Data.php~" hash="1dc6a8d957a1a5f1794f5b4a756b55a4"/></dir><dir name="Model"><dir name="Attribute"><dir name="Backend"><file name="File.php" hash="711c4808310aeb84538ee233a711d0f9"/><file name="File.php~" hash="711c4808310aeb84538ee233a711d0f9"/></dir><dir name="Frontend"><file name="File.php" hash="1e7c111a6b8245245cea411d0731eea1"/><file name="File.php~" hash="46ec9725061b6cdd4ecf38f01643129f"/></dir></dir><file name="Observer.php" hash="9fa44499d7d9464625ab254bf0616821"/><file name="Observer.php~" hash="9fa44499d7d9464625ab254bf0616821"/><dir name="Obsolete"><dir name="Files"><file name="Collection.php" hash="69617a8b9f08ca6851497ae8f9ee2f1c"/><file name="Collection.php~" hash="69617a8b9f08ca6851497ae8f9ee2f1c"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Serialized"><dir name="Attributes"><file name="Configuration.php" hash="da5344d18407d777a358409daa1dbfa3"/><file name="Configuration.php~" hash="da5344d18407d777a358409daa1dbfa3"/></dir></dir></dir><dir name="Source"><dir name="Exceptions"><dir name="Handling"><file name="Mode.php" hash="20780c65ceb0a58b9e44303f2ef51930"/><file name="Mode.php~" hash="20780c65ceb0a58b9e44303f2ef51930"/></dir></dir><dir name="File"><dir name="Save"><file name="Moment.php" hash="1a0bfe67e97c1a2365726ff9ea4db2f9"/><file name="Moment.php~" hash="1a0bfe67e97c1a2365726ff9ea4db2f9"/></dir></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Obsolete"><file name="FilesController.php" hash="a7746e7f54986831f0ec88e636b2c5e5"/><file name="FilesController.php~" hash="a7746e7f54986831f0ec88e636b2c5e5"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="72396d596595dc64e45b49b93c84e57b"/><file name="adminhtml.xml~" hash="72396d596595dc64e45b49b93c84e57b"/><file name="config.xml" hash="0cd95f0a6451f78a55249ad499d167dc"/><file name="config.xml~" hash="0cd95f0a6451f78a55249ad499d167dc"/><file name="system.xml" hash="ec3488f34d5f00c220425628a6b3bed5"/><file name="system.xml~" hash="ec3488f34d5f00c220425628a6b3bed5"/></dir></dir><dir name="Video"><dir name="Block"><file name="Video.php" hash="f679dcd3ea979d85c6b28df87cf2283e"/></dir><dir name="Helper"><file name="Data.php" hash="9bb17ee7038d4ebfba011d85b1f46339"/><file name="Data.php~" hash="9bb17ee7038d4ebfba011d85b1f46339"/></dir><dir name="Model"><file name="Source.php" hash="375fdb50a9afd53422d27f3489358feb"/><file name="Source.php~" hash="375fdb50a9afd53422d27f3489358feb"/></dir><dir name="etc"><file name="config.xml" hash="be033b9d3a08aa7cc2bd543803b866f1"/><file name="config.xml~" hash="7907a505815e23540d5b7f904f49449f"/><file name="system.xml" hash="1805ea89a3d328a99d0469dcc5b92b78"/><file name="system.xml~" hash="a321a0a6399e4bc37a06baa48c300b69"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Telemantis_FileAttributes.xml" hash="8fcd8e7b00eb2a11c5370a76b3ee81ec"/><file name="Telemantis_Video.xml" hash="5e1fa577a3f8f4cca0e616f135e74514"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="tl"><file name="fileattributes.xml" hash="af6853c9a82bf2c8cdb6129e0cd6bced"/></dir></dir><dir name="template"><dir name="tl"><dir name="fileattributes"><dir name="system"><dir name="config"><dir name="form"><dir name="field"><file name="array.phtml" hash="4637301d11452e8bd4a4dfab4eca9fa4"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="video.xml" hash="127b3da2e8661dde68a72a6fd58a0149"/></dir><dir name="template"><dir name="video"><file name="media.phtml" hash="b1e74abf1a200dbf1c27a9b81827dd9a"/><file name="media.phtml~" hash="5778bfbb3bc53cc05e8c99c600ed2b3f"/><file name="video.phtml" hash="e1822bd44fcafc39771b74e6d39c8ee9"/><file name="video.phtml~" hash="287024d3e19a18e9d620b5b1663dae5d"/></dir></dir></dir></dir></dir></target><target name="mage"><dir><dir name="js"><dir name="tl"><dir name="fileattributes"><file name="script.js" hash="bb0a77e56c5446a1c70fbf03dab64ec9"/><file name="script.js~" hash="bb0a77e56c5446a1c70fbf03dab64ec9"/></dir></dir><dir name="video"><file name="jwplayer.flash.swf" hash="9b336052a8ca19aa406fdd30a28c04d0"/><file name="jwplayer.html5.js" hash="c5f880a3d9f1b0d106e5d9e090681d73"/><file name="jwplayer.js" hash="f2e4bc8b769ed24786dcff21882a12ff"/><file name="jwplayer6.js" hash="6634e24ad2014aff53b27215b1ed458f"/><file name="player.swf" hash="33055923f9fbd07e0cb1a27f8e5515d0"/><dir name="swfobject"><file name="expressInstall.swf" hash="7b65fbfaec8b2955090389af60646e8b"/><file name="index.html" hash="5ed99c28f63253c3a8529ab49f6b25f8"/><file name="index_dynamic.html" hash="018ddc19507f6ceb3f0a76d7ba37530d"/><dir name="src"><file name="expressInstall.as" hash="5d0f71dc2364c52e9f1ed903a6503595"/><file name="expressInstall.fla" hash="163d79428dd2d7a3e74e8a5bb555ac19"/><file name="swfobject.js" hash="8c2ec4bc2c9a39bc3f4ff92223077cf6"/></dir><file name="swfobject.js" hash="892a543f3abb54e8ec1ada55be3b0649"/><file name="test.swf" hash="3eb74853d8a8d780653c66f27123b60d"/></dir><file name="swfobject.js" hash="892a543f3abb54e8ec1ada55be3b0649"/><file name="video.js" hash="e174d21ce04aa8387bcf4133104f599c"/><file name="video.js~" hash="ae0533fa5df1c009ca6c9348aa74335c"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="video"><file name="video.css" hash="6f2b6e4a0fbc047e6e37f6464454324b"/><file name="video.css~" hash="6f2b6e4a0fbc047e6e37f6464454324b"/></dir></dir><dir name="images"><dir name="video"><file name="Skyvideoicon.png" hash="44946242f790855fade1efdab66c784d"/><file name="close.jpg" hash="20f746bdf5cb36783f7fb3b00382fb15"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="tl"><dir name="fileattributes"><dir name="images"><file name="ico_compact.png" hash="742e838e65411707a2585babbc94d620"/><file name="ico_unpack.png" hash="98f87b65d6009f901ccd654a333c1742"/></dir><file name="styles.css" hash="ed546c6989a509291d6e44f3b3169605"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/adminhtml/default/default/tl/fileattributes/images/ico_compact.png
ADDED
Binary file
|
skin/adminhtml/default/default/tl/fileattributes/images/ico_unpack.png
ADDED
Binary file
|
skin/adminhtml/default/default/tl/fileattributes/styles.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.blfa-file-configuration-table th { font-weight:bold; }
|
2 |
+
.blfa-file-configuration-table td { padding-left:6px; }
|
skin/frontend/default/default/css/video/video.css
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/*
|
3 |
+
Video.css created by saurabh chandela
|
4 |
+
Date-12-12-2012
|
5 |
+
|
6 |
+
*/
|
7 |
+
.video{display: none;left: 254px;position: absolute;top: 197px;z-index:100000}
|
8 |
+
.video a{cursor: pointer;float: right;height:18px}
|
9 |
+
#container_wrapper{float:left;clear:both;}
|
10 |
+
.video_anchor{float: left;text-align: center;width: 100%;}
|
11 |
+
.a_container{float: right;height:18px;width:100%;}
|
12 |
+
|
skin/frontend/default/default/css/video/video.css~
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
/*
|
3 |
+
Video.css created by saurabh chandela
|
4 |
+
Date-12-12-2012
|
5 |
+
|
6 |
+
*/
|
7 |
+
.video{display: none;left: 254px;position: absolute;top: 197px;z-index:100000}
|
8 |
+
.video a{cursor: pointer;float: right;height:18px}
|
9 |
+
#container_wrapper{float:left;clear:both;}
|
10 |
+
.video_anchor{float: left;text-align: center;width: 100%;}
|
11 |
+
.a_container{float: right;height:18px;width:100%;}
|
12 |
+
|
skin/frontend/default/default/images/video/Skyvideoicon.png
ADDED
Binary file
|
skin/frontend/default/default/images/video/close.jpg
ADDED
Binary file
|