Version Notes
Picture Perfect 1.2.1 Stable Version
Download this release
Release Info
Developer | Roman |
Extension | pictureperfect-wexo |
Version | 1.2.1 |
Comparing to | |
See all releases |
Version 1.2.1
- app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload.php +35 -0
- app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload/Edit/Tab/form.php +7 -0
- app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload/Edit/form.php +9 -0
- app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload/Grid.php +76 -0
- app/code/local/wexo/Imageupload/Block/Adminhtml/Quotes.php +12 -0
- app/code/local/wexo/Imageupload/Helper/ArrayToXml.php +53 -0
- app/code/local/wexo/Imageupload/Helper/Data.php +5 -0
- app/code/local/wexo/Imageupload/Helper/ImageUpload.php +8 -0
- app/code/local/wexo/Imageupload/Helper/UploadHandler.php +405 -0
- app/code/local/wexo/Imageupload/Model/Mysql.php +51 -0
- app/code/local/wexo/Imageupload/controllers/Adminhtml/ImageuploadController.php +315 -0
- app/code/local/wexo/Imageupload/etc/adminhtml.xml +22 -0
- app/code/local/wexo/Imageupload/etc/config.xml +88 -0
- app/code/local/wexo/Imageupload/sql/imageupload_setup/mysql4-install-0.1.0.php +23 -0
- app/design/adminhtml/default/default/layout/imageupload.xml +8 -0
- app/design/adminhtml/default/default/template/imageupload/imageuploadbackend.phtml +873 -0
- app/etc/modules/Wexo_Imageupload.xml +9 -0
- js/wexo_imageupload/ajaxSearch/ajax-loader.gif +0 -0
- js/wexo_imageupload/ajaxSearch/ajaxSearch.js +129 -0
- js/wexo_imageupload/cors/jquery.postmessage-transport.js +117 -0
- js/wexo_imageupload/cors/jquery.xdr-transport.js +85 -0
- js/wexo_imageupload/date/dateFormat.js +125 -0
- js/wexo_imageupload/from_site/bootstrap-image-gallery.min.js +1 -0
- js/wexo_imageupload/from_site/bootstrap.min.js +1 -0
- js/wexo_imageupload/from_site/canvas-to-blob.min.js +1 -0
- js/wexo_imageupload/from_site/load-image.min.js +1 -0
- js/wexo_imageupload/from_site/tmpl.min.js +1 -0
- js/wexo_imageupload/jquery.fileupload-ip.js +158 -0
- js/wexo_imageupload/jquery.fileupload-ui.js +629 -0
- js/wexo_imageupload/jquery.fileupload.js +859 -0
- js/wexo_imageupload/jquery.iframe-transport.js +165 -0
- js/wexo_imageupload/jquery/jquery.js +6 -0
- js/wexo_imageupload/jquery/noConflict.js +1 -0
- js/wexo_imageupload/locale.js +27 -0
- js/wexo_imageupload/main.js +64 -0
- js/wexo_imageupload/statusLoader.gif +0 -0
- js/wexo_imageupload/templateBorder.gif +0 -0
- js/wexo_imageupload/vendor/jquery.ui.widget.js +282 -0
- media/wexo_uploaded_files/ready_files/info.txt +1 -0
- media/wexo_uploaded_files/thumbnails/your_first_image.jpg +0 -0
- media/wexo_uploaded_files/your_first_image.jpg +0 -0
- package.xml +20 -0
- proxy.php +258 -0
- skin/adminhtml/default/default/wexo_imageupload.css +515 -0
app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload.php
ADDED
@@ -0,0 +1,35 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Block_Adminhtml_Imageupload extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_blockGroup = 'imageupload';
|
7 |
+
$this->_controller = 'adminhtml_imageupload';
|
8 |
+
$this->_headerText = Mage::helper('wexo_imageupload')->__('imageupload');
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getModuleConfig($field,$param)
|
12 |
+
{
|
13 |
+
return Mage::getConfig()->getNode($field)->$param;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getRemoveTheBackGroundTemplate()
|
17 |
+
{
|
18 |
+
$session = Mage::getSingleton('admin/session')->getRemoveTheBackGroundTemplate();
|
19 |
+
$template = '';
|
20 |
+
if($session){
|
21 |
+
$template = $session;
|
22 |
+
}
|
23 |
+
return $template;
|
24 |
+
}
|
25 |
+
public function getRemoveTheBackGroundTemplateId()
|
26 |
+
{
|
27 |
+
$ses = Mage::getSingleton('admin/session')->getRemoveTheBackGroundTemplateId();
|
28 |
+
|
29 |
+
$id = 0;
|
30 |
+
if($ses){
|
31 |
+
$id = $ses;
|
32 |
+
}
|
33 |
+
return $id;
|
34 |
+
}
|
35 |
+
}
|
app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload/Edit/Tab/form.php
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$fieldset->addField('fileinputname', 'file', array(
|
4 |
+
'label' => Mage::helper('pictos')->__('File label'),
|
5 |
+
'required' => false,
|
6 |
+
'name' => 'fileinputname',
|
7 |
+
));
|
app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload/Edit/form.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$form = new Varien_Data_Form(array(
|
4 |
+
'id' => 'edit_form',
|
5 |
+
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
6 |
+
'method' => 'post',
|
7 |
+
'enctype' => 'multipart/form-data'
|
8 |
+
)
|
9 |
+
);
|
app/code/local/wexo/Imageupload/Block/Adminhtml/Imageupload/Grid.php
ADDED
@@ -0,0 +1,76 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Block_Adminhtml_Imageupload_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->setId('quotesGrid');
|
8 |
+
$this->_controller = 'adminhtml_imageupload';
|
9 |
+
$this->setUseAjax(true);
|
10 |
+
|
11 |
+
$this->setDefaultSort('id');
|
12 |
+
$this->setDefaultDir('desc');
|
13 |
+
}
|
14 |
+
|
15 |
+
protected function _prepareCollection()
|
16 |
+
{
|
17 |
+
$collection = Mage::getModel('wexo_imageupload/quote')->getCollection();
|
18 |
+
$this->setCollection($collection);
|
19 |
+
|
20 |
+
return parent::_prepareCollection();
|
21 |
+
}
|
22 |
+
|
23 |
+
protected function _prepareColumns()
|
24 |
+
{
|
25 |
+
$this->addColumn('id', array(
|
26 |
+
'header' => Mage::helper('wexo_imageupload')->__('ID'),
|
27 |
+
'align' => 'right',
|
28 |
+
'width' => '20px',
|
29 |
+
'filter_index' => 'id',
|
30 |
+
'index' => 'id'
|
31 |
+
));
|
32 |
+
|
33 |
+
$this->addColumn('name', array(
|
34 |
+
'header' => Mage::helper('wexo_imageupload')->__('Title'),
|
35 |
+
'align' => 'left',
|
36 |
+
'filter_index' => 'name',
|
37 |
+
'index' => 'name',
|
38 |
+
'type' => 'text',
|
39 |
+
'truncate' => 50,
|
40 |
+
'escape' => true,
|
41 |
+
));
|
42 |
+
|
43 |
+
$this->addColumn('action', array(
|
44 |
+
'header' => Mage::helper('wexo_imageupload')->__('Action'),
|
45 |
+
'width' => '50px',
|
46 |
+
'type' => 'action',
|
47 |
+
'getter' => 'getId',
|
48 |
+
'actions' => array(
|
49 |
+
array(
|
50 |
+
'caption' => Mage::helper('wexo_imageupload')->__('Edit'),
|
51 |
+
'url' => array(
|
52 |
+
'base'=>'*/*/edit',
|
53 |
+
),
|
54 |
+
'field' => 'id'
|
55 |
+
)
|
56 |
+
),
|
57 |
+
'filter' => false,
|
58 |
+
'sortable' => false,
|
59 |
+
'index' => 'id',
|
60 |
+
));
|
61 |
+
|
62 |
+
return parent::_prepareColumns();
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getRowUrl($quotes)
|
66 |
+
{
|
67 |
+
return $this->getUrl('*/*/edit', array(
|
68 |
+
'id' => $quotes->getId(),
|
69 |
+
));
|
70 |
+
}
|
71 |
+
|
72 |
+
public function getGridUrl()
|
73 |
+
{
|
74 |
+
return $this->getUrl('*/*/grid', array('_current'=>true));
|
75 |
+
}
|
76 |
+
}
|
app/code/local/wexo/Imageupload/Block/Adminhtml/Quotes.php
ADDED
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Block_Adminhtml_Quotes extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
//$this->_addButtonLabel = Mage::helper('freaks_quotes')->__('Add New Quote');
|
7 |
+
|
8 |
+
$this->_blockGroup = 'wexo_imageupload';
|
9 |
+
$this->_controller = 'adminhtml_imageupload';
|
10 |
+
$this->_headerText = Mage::helper('wexo_imageupload')->__('Quotes');
|
11 |
+
}
|
12 |
+
}
|
app/code/local/wexo/Imageupload/Helper/ArrayToXml.php
ADDED
@@ -0,0 +1,53 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Helper_ArrayToXml {
|
3 |
+
|
4 |
+
private $writer;
|
5 |
+
private $version = '1.0';
|
6 |
+
private $encoding = 'UTF-8';
|
7 |
+
private $rootName = 'root';
|
8 |
+
|
9 |
+
function __construct()
|
10 |
+
{
|
11 |
+
$this->writer = new XMLWriter();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function convert($data)
|
15 |
+
{
|
16 |
+
$this->writer->openMemory();
|
17 |
+
$this->writer->startDocument($this->version, $this->encoding);
|
18 |
+
$this->writer->startElement($this->rootName);
|
19 |
+
if (is_array($data)) {
|
20 |
+
$this->getXML($data);
|
21 |
+
}
|
22 |
+
$this->writer->endElement();
|
23 |
+
return $this->writer->outputMemory();
|
24 |
+
}
|
25 |
+
public function setVersion($version)
|
26 |
+
{
|
27 |
+
$this->version = $version;
|
28 |
+
}
|
29 |
+
public function setEncoding($encoding)
|
30 |
+
{
|
31 |
+
$this->encoding = $encoding;
|
32 |
+
}
|
33 |
+
public function setRootName($rootName)
|
34 |
+
{
|
35 |
+
$this->rootName = $rootName;
|
36 |
+
}
|
37 |
+
private function getXML($data)
|
38 |
+
{
|
39 |
+
foreach ($data as $key => $val) {
|
40 |
+
if (is_numeric($key)) {
|
41 |
+
$key = 'new_line';
|
42 |
+
}
|
43 |
+
if (is_array($val)) {
|
44 |
+
$this->writer->startElement($key);
|
45 |
+
$this->getXML($val);
|
46 |
+
$this->writer->endElement();
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
$this->writer->writeElement($key, $val);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
app/code/local/wexo/Imageupload/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
5 |
+
|
app/code/local/wexo/Imageupload/Helper/ImageUpload.php
ADDED
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Wexo_Imageupload_Helper_ImageUpload extends Zend_Form
|
4 |
+
{
|
5 |
+
public function __construct($options = null)
|
6 |
+
{
|
7 |
+
}
|
8 |
+
}
|
app/code/local/wexo/Imageupload/Helper/UploadHandler.php
ADDED
@@ -0,0 +1,405 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
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
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* jQuery File Upload Plugin PHP Class 5.9.1
|
4 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
5 |
+
*
|
6 |
+
* Copyright 2010, Sebastian Tschan
|
7 |
+
* https://blueimp.net
|
8 |
+
*
|
9 |
+
* Licensed under the MIT license:
|
10 |
+
* http://www.opensource.org/licenses/MIT
|
11 |
+
*/
|
12 |
+
|
13 |
+
class Wexo_Imageupload_Helper_UploadHandler
|
14 |
+
{
|
15 |
+
protected $options;
|
16 |
+
|
17 |
+
function __construct($options=null) {
|
18 |
+
|
19 |
+
$block = new Wexo_Imageupload_Block_Adminhtml_Imageupload();
|
20 |
+
|
21 |
+
$this->options = array(
|
22 |
+
'script_url' => $this->getFullUrl().'/',
|
23 |
+
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/'.$block->getModuleConfig('uploader','uploaded_files_dir'),
|
24 |
+
'upload_url' => $this->getFullUrl().'/'.$block->getModuleConfig('uploader','uploaded_files_dir'),
|
25 |
+
'param_name' => 'files',
|
26 |
+
// Set the following option to 'POST', if your server does not support
|
27 |
+
// DELETE requests. This is a parameter sent to the client:
|
28 |
+
'delete_type' => 'DELETE',
|
29 |
+
// The php.ini settings upload_max_filesize and post_max_size
|
30 |
+
// take precedence over the following max_file_size setting:
|
31 |
+
'max_file_size' => null,
|
32 |
+
'min_file_size' => 1,
|
33 |
+
'accept_file_types' => '/.+$/i',
|
34 |
+
'max_number_of_files' => null,
|
35 |
+
// Set the following option to false to enable resumable uploads:
|
36 |
+
'discard_aborted_uploads' => true,
|
37 |
+
// Set to true to rotate images based on EXIF meta data, if available:
|
38 |
+
'orient_image' => false,
|
39 |
+
'image_versions' => array(
|
40 |
+
// Uncomment the following version to restrict the size of
|
41 |
+
// uploaded images. You can also add additional versions with
|
42 |
+
// their own upload directories:
|
43 |
+
/*
|
44 |
+
'large' => array(
|
45 |
+
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/files/',
|
46 |
+
'upload_url' => $this->getFullUrl().'/files/',
|
47 |
+
'max_width' => 1920,
|
48 |
+
'max_height' => 1200,
|
49 |
+
'jpeg_quality' => 95
|
50 |
+
),
|
51 |
+
*/
|
52 |
+
'thumbnail' => array(
|
53 |
+
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/'.$block->getModuleConfig('uploader','uploaded_thumbnail_dir'),
|
54 |
+
'upload_url' => $this->getFullUrl().'/'.$block->getModuleConfig('uploader','uploaded_thumbnail_dir'),
|
55 |
+
'max_width' => 80,
|
56 |
+
'max_height' => 80
|
57 |
+
)
|
58 |
+
)
|
59 |
+
);
|
60 |
+
|
61 |
+
if ($options) {
|
62 |
+
$this->options = array_replace_recursive($this->options, $options);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
protected function getFullUrl() {
|
67 |
+
return
|
68 |
+
(isset($_SERVER['HTTPS']) ? 'https://' : 'http://').
|
69 |
+
(isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
|
70 |
+
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
|
71 |
+
(isset($_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] === 443 ||
|
72 |
+
$_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
|
73 |
+
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
|
74 |
+
}
|
75 |
+
|
76 |
+
protected function set_file_delete_url($file) {
|
77 |
+
$file->delete_url = $this->options['script_url']
|
78 |
+
.'?file='.rawurlencode($file->name);
|
79 |
+
$file->delete_type = $this->options['delete_type'];
|
80 |
+
if ($file->delete_type !== 'DELETE') {
|
81 |
+
$file->delete_url .= '&_method=DELETE';
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
protected function get_file_object($file_name) {
|
86 |
+
$file_path = $this->options['upload_dir'].$file_name;
|
87 |
+
if (is_file($file_path) && $file_name[0] !== '.') {
|
88 |
+
$file = new stdClass();
|
89 |
+
$file->name = $file_name;
|
90 |
+
$file->size = filesize($file_path);
|
91 |
+
$file->url = $this->options['upload_url'].rawurlencode($file->name);
|
92 |
+
foreach($this->options['image_versions'] as $version => $options) {
|
93 |
+
if (is_file($options['upload_dir'].$file_name)) {
|
94 |
+
$file->{$version.'_url'} = $options['upload_url']
|
95 |
+
.rawurlencode($file->name);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
$this->set_file_delete_url($file);
|
99 |
+
return $file;
|
100 |
+
}
|
101 |
+
return null;
|
102 |
+
}
|
103 |
+
|
104 |
+
protected function get_file_objects() {
|
105 |
+
return array_values(array_filter(array_map(
|
106 |
+
array($this, 'get_file_object'),
|
107 |
+
scandir($this->options['upload_dir'])
|
108 |
+
)));
|
109 |
+
}
|
110 |
+
|
111 |
+
protected function create_scaled_image($file_name, $options) {
|
112 |
+
$file_path = $this->options['upload_dir'].$file_name;
|
113 |
+
$new_file_path = $options['upload_dir'].$file_name;
|
114 |
+
list($img_width, $img_height) = @getimagesize($file_path);
|
115 |
+
if (!$img_width || !$img_height) {
|
116 |
+
return false;
|
117 |
+
}
|
118 |
+
$scale = min(
|
119 |
+
$options['max_width'] / $img_width,
|
120 |
+
$options['max_height'] / $img_height
|
121 |
+
);
|
122 |
+
if ($scale >= 1) {
|
123 |
+
if ($file_path !== $new_file_path) {
|
124 |
+
return copy($file_path, $new_file_path);
|
125 |
+
}
|
126 |
+
return true;
|
127 |
+
}
|
128 |
+
$new_width = $img_width * $scale;
|
129 |
+
$new_height = $img_height * $scale;
|
130 |
+
$new_img = @imagecreatetruecolor($new_width, $new_height);
|
131 |
+
switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
|
132 |
+
case 'jpg':
|
133 |
+
case 'jpeg':
|
134 |
+
$src_img = @imagecreatefromjpeg($file_path);
|
135 |
+
$write_image = 'imagejpeg';
|
136 |
+
$image_quality = isset($options['jpeg_quality']) ?
|
137 |
+
$options['jpeg_quality'] : 75;
|
138 |
+
break;
|
139 |
+
case 'gif':
|
140 |
+
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
141 |
+
$src_img = @imagecreatefromgif($file_path);
|
142 |
+
$write_image = 'imagegif';
|
143 |
+
$image_quality = null;
|
144 |
+
break;
|
145 |
+
case 'png':
|
146 |
+
@imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));
|
147 |
+
@imagealphablending($new_img, false);
|
148 |
+
@imagesavealpha($new_img, true);
|
149 |
+
$src_img = @imagecreatefrompng($file_path);
|
150 |
+
$write_image = 'imagepng';
|
151 |
+
$image_quality = isset($options['png_quality']) ?
|
152 |
+
$options['png_quality'] : 9;
|
153 |
+
break;
|
154 |
+
default:
|
155 |
+
$src_img = null;
|
156 |
+
}
|
157 |
+
$success = $src_img && @imagecopyresampled(
|
158 |
+
$new_img,
|
159 |
+
$src_img,
|
160 |
+
0, 0, 0, 0,
|
161 |
+
$new_width,
|
162 |
+
$new_height,
|
163 |
+
$img_width,
|
164 |
+
$img_height
|
165 |
+
) && $write_image($new_img, $new_file_path, $image_quality);
|
166 |
+
// Free up memory (imagedestroy does not delete files):
|
167 |
+
@imagedestroy($src_img);
|
168 |
+
@imagedestroy($new_img);
|
169 |
+
return $success;
|
170 |
+
}
|
171 |
+
|
172 |
+
protected function has_error($uploaded_file, $file, $error) {
|
173 |
+
if ($error) {
|
174 |
+
return $error;
|
175 |
+
}
|
176 |
+
if (!preg_match($this->options['accept_file_types'], $file->name)) {
|
177 |
+
return 'acceptFileTypes';
|
178 |
+
}
|
179 |
+
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
|
180 |
+
$file_size = filesize($uploaded_file);
|
181 |
+
} else {
|
182 |
+
$file_size = $_SERVER['CONTENT_LENGTH'];
|
183 |
+
}
|
184 |
+
if ($this->options['max_file_size'] && (
|
185 |
+
$file_size > $this->options['max_file_size'] ||
|
186 |
+
$file->size > $this->options['max_file_size'])
|
187 |
+
) {
|
188 |
+
return 'maxFileSize';
|
189 |
+
}
|
190 |
+
if ($this->options['min_file_size'] &&
|
191 |
+
$file_size < $this->options['min_file_size']) {
|
192 |
+
return 'minFileSize';
|
193 |
+
}
|
194 |
+
if (is_int($this->options['max_number_of_files']) && (
|
195 |
+
count($this->get_file_objects()) >= $this->options['max_number_of_files'])
|
196 |
+
) {
|
197 |
+
return 'maxNumberOfFiles';
|
198 |
+
}
|
199 |
+
return $error;
|
200 |
+
}
|
201 |
+
|
202 |
+
protected function upcount_name_callback($matches) {
|
203 |
+
$index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;
|
204 |
+
$ext = isset($matches[2]) ? $matches[2] : '';
|
205 |
+
return ' ('.$index.')'.$ext;
|
206 |
+
}
|
207 |
+
|
208 |
+
protected function upcount_name($name) {
|
209 |
+
return preg_replace_callback(
|
210 |
+
'/(?:(?: \(([\d]+)\))?(\.[^.]+))?$/',
|
211 |
+
array($this, 'upcount_name_callback'),
|
212 |
+
$name,
|
213 |
+
1
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
protected function trim_file_name($name, $type) {
|
218 |
+
// Remove path information and dots around the filename, to prevent uploading
|
219 |
+
// into different directories or replacing hidden system files.
|
220 |
+
// Also remove control characters and spaces (\x00..\x20) around the filename:
|
221 |
+
$file_name = trim(basename(stripslashes($name)), ".\x00..\x20");
|
222 |
+
// Add missing file extension for known image types:
|
223 |
+
if (strpos($file_name, '.') === false &&
|
224 |
+
preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) {
|
225 |
+
$file_name .= '.'.$matches[1];
|
226 |
+
}
|
227 |
+
if ($this->options['discard_aborted_uploads']) {
|
228 |
+
while(is_file($this->options['upload_dir'].$file_name)) {
|
229 |
+
$file_name = $this->upcount_name($file_name);
|
230 |
+
}
|
231 |
+
}
|
232 |
+
return $file_name;
|
233 |
+
}
|
234 |
+
|
235 |
+
protected function orient_image($file_path) {
|
236 |
+
$exif = exif_read_data($file_path);
|
237 |
+
$orientation = intval(@$exif['Orientation']);
|
238 |
+
if (!in_array($orientation, array(3, 6, 8))) {
|
239 |
+
return false;
|
240 |
+
}
|
241 |
+
$image = @imagecreatefromjpeg($file_path);
|
242 |
+
switch ($orientation) {
|
243 |
+
case 3:
|
244 |
+
$image = @imagerotate($image, 180, 0);
|
245 |
+
break;
|
246 |
+
case 6:
|
247 |
+
$image = @imagerotate($image, 270, 0);
|
248 |
+
break;
|
249 |
+
case 8:
|
250 |
+
$image = @imagerotate($image, 90, 0);
|
251 |
+
break;
|
252 |
+
default:
|
253 |
+
return false;
|
254 |
+
}
|
255 |
+
$success = imagejpeg($image, $file_path);
|
256 |
+
// Free up memory (imagedestroy does not delete files):
|
257 |
+
@imagedestroy($image);
|
258 |
+
return $success;
|
259 |
+
}
|
260 |
+
|
261 |
+
protected function handle_file_upload($uploaded_file, $name, $size, $type, $error) {
|
262 |
+
$file = new stdClass();
|
263 |
+
$file->name = $this->trim_file_name($name, $type);
|
264 |
+
$file->size = intval($size);
|
265 |
+
$file->type = $type;
|
266 |
+
$error = $this->has_error($uploaded_file, $file, $error);
|
267 |
+
if (!$error && $file->name) {
|
268 |
+
$file_path = $this->options['upload_dir'].$file->name;
|
269 |
+
$append_file = !$this->options['discard_aborted_uploads'] &&
|
270 |
+
is_file($file_path) && $file->size > filesize($file_path);
|
271 |
+
clearstatcache();
|
272 |
+
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
|
273 |
+
// multipart/formdata uploads (POST method uploads)
|
274 |
+
if ($append_file) {
|
275 |
+
file_put_contents(
|
276 |
+
$file_path,
|
277 |
+
fopen($uploaded_file, 'r'),
|
278 |
+
FILE_APPEND
|
279 |
+
);
|
280 |
+
} else {
|
281 |
+
move_uploaded_file($uploaded_file, $file_path);
|
282 |
+
}
|
283 |
+
} else {
|
284 |
+
// Non-multipart uploads (PUT method support)
|
285 |
+
file_put_contents(
|
286 |
+
$file_path,
|
287 |
+
fopen('php://input', 'r'),
|
288 |
+
$append_file ? FILE_APPEND : 0
|
289 |
+
);
|
290 |
+
}
|
291 |
+
$file_size = filesize($file_path);
|
292 |
+
if ($file_size === $file->size) {
|
293 |
+
if ($this->options['orient_image']) {
|
294 |
+
$this->orient_image($file_path);
|
295 |
+
}
|
296 |
+
$file->url = $this->options['upload_url'].rawurlencode($file->name);
|
297 |
+
foreach($this->options['image_versions'] as $version => $options) {
|
298 |
+
if ($this->create_scaled_image($file->name, $options)) {
|
299 |
+
if ($this->options['upload_dir'] !== $options['upload_dir']) {
|
300 |
+
$file->{$version.'_url'} = $options['upload_url']
|
301 |
+
.rawurlencode($file->name);
|
302 |
+
} else {
|
303 |
+
clearstatcache();
|
304 |
+
$file_size = filesize($file_path);
|
305 |
+
}
|
306 |
+
}
|
307 |
+
}
|
308 |
+
} else if ($this->options['discard_aborted_uploads']) {
|
309 |
+
unlink($file_path);
|
310 |
+
$file->error = 'abort';
|
311 |
+
}
|
312 |
+
$file->size = $file_size;
|
313 |
+
$this->set_file_delete_url($file);
|
314 |
+
} else {
|
315 |
+
$file->error = $error;
|
316 |
+
}
|
317 |
+
return $file;
|
318 |
+
}
|
319 |
+
|
320 |
+
public function get() {
|
321 |
+
$file_name = isset($_REQUEST['file']) ?
|
322 |
+
basename(stripslashes($_REQUEST['file'])) : null;
|
323 |
+
if ($file_name) {
|
324 |
+
$info = $this->get_file_object($file_name);
|
325 |
+
} else {
|
326 |
+
$info = $this->get_file_objects();
|
327 |
+
}
|
328 |
+
header('Content-type: application/json');
|
329 |
+
echo json_encode($info);
|
330 |
+
}
|
331 |
+
|
332 |
+
public function post() {
|
333 |
+
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
334 |
+
return $this->delete();
|
335 |
+
}
|
336 |
+
$upload = isset($_FILES[$this->options['param_name']]) ?
|
337 |
+
$_FILES[$this->options['param_name']] : null;
|
338 |
+
$info = array();
|
339 |
+
if ($upload && is_array($upload['tmp_name'])) {
|
340 |
+
// param_name is an array identifier like "files[]",
|
341 |
+
// $_FILES is a multi-dimensional array:
|
342 |
+
foreach ($upload['tmp_name'] as $index => $value) {
|
343 |
+
$info[] = $this->handle_file_upload(
|
344 |
+
$upload['tmp_name'][$index],
|
345 |
+
isset($_SERVER['HTTP_X_FILE_NAME']) ?
|
346 |
+
$_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index],
|
347 |
+
isset($_SERVER['HTTP_X_FILE_SIZE']) ?
|
348 |
+
$_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index],
|
349 |
+
isset($_SERVER['HTTP_X_FILE_TYPE']) ?
|
350 |
+
$_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index],
|
351 |
+
$upload['error'][$index]
|
352 |
+
);
|
353 |
+
}
|
354 |
+
} elseif ($upload || isset($_SERVER['HTTP_X_FILE_NAME'])) {
|
355 |
+
// param_name is a single object identifier like "file",
|
356 |
+
// $_FILES is a one-dimensional array:
|
357 |
+
$info[] = $this->handle_file_upload(
|
358 |
+
isset($upload['tmp_name']) ? $upload['tmp_name'] : null,
|
359 |
+
isset($_SERVER['HTTP_X_FILE_NAME']) ?
|
360 |
+
$_SERVER['HTTP_X_FILE_NAME'] : (isset($upload['name']) ?
|
361 |
+
$upload['name'] : null),
|
362 |
+
isset($_SERVER['HTTP_X_FILE_SIZE']) ?
|
363 |
+
$_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ?
|
364 |
+
$upload['size'] : null),
|
365 |
+
isset($_SERVER['HTTP_X_FILE_TYPE']) ?
|
366 |
+
$_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ?
|
367 |
+
$upload['type'] : null),
|
368 |
+
isset($upload['error']) ? $upload['error'] : null
|
369 |
+
);
|
370 |
+
}
|
371 |
+
header('Vary: Accept');
|
372 |
+
$json = json_encode($info);
|
373 |
+
$redirect = isset($_REQUEST['redirect']) ?
|
374 |
+
stripslashes($_REQUEST['redirect']) : null;
|
375 |
+
// if ($redirect) {
|
376 |
+
// header('Location: '.sprintf($redirect, rawurlencode($json)));
|
377 |
+
// return;
|
378 |
+
// }
|
379 |
+
if (isset($_SERVER['HTTP_ACCEPT']) &&
|
380 |
+
(strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {
|
381 |
+
header('Content-type: application/json');
|
382 |
+
} else {
|
383 |
+
header('Content-type: text/plain');
|
384 |
+
}
|
385 |
+
echo $json;
|
386 |
+
}
|
387 |
+
|
388 |
+
public function delete() {
|
389 |
+
$file_name = isset($_REQUEST['file']) ?
|
390 |
+
basename(stripslashes($_REQUEST['file'])) : null;
|
391 |
+
$file_path = $this->options['upload_dir'].$file_name;
|
392 |
+
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
|
393 |
+
if ($success) {
|
394 |
+
foreach($this->options['image_versions'] as $version => $options) {
|
395 |
+
$file = $options['upload_dir'].$file_name;
|
396 |
+
if (is_file($file)) {
|
397 |
+
unlink($file);
|
398 |
+
}
|
399 |
+
}
|
400 |
+
}
|
401 |
+
header('Content-type: application/json');
|
402 |
+
echo json_encode($success);
|
403 |
+
}
|
404 |
+
|
405 |
+
}
|
app/code/local/wexo/Imageupload/Model/Mysql.php
ADDED
@@ -0,0 +1,51 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Model_Mysql extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
const TABLE_NAME = 'wexo_imageupload';
|
5 |
+
|
6 |
+
private $tableNameWithPrefix;
|
7 |
+
|
8 |
+
public function _construct()
|
9 |
+
{
|
10 |
+
parent::_construct();
|
11 |
+
|
12 |
+
$this->tableNameWithPrefix = Mage::getSingleton('core/resource')->getTableName(self::TABLE_NAME);
|
13 |
+
$this->_init($this->tableName,'imageupload_id');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function addImage($product_id,$product_name,$image_url,$ticket,$imageType,$send_time)
|
17 |
+
{
|
18 |
+
$query = "INSERT INTO
|
19 |
+
`".$this->tableNameWithPrefix."`
|
20 |
+
SET
|
21 |
+
`product_id`='{$product_id}',
|
22 |
+
`product_name`='{$product_name}',
|
23 |
+
`image_url`='{$image_url}',
|
24 |
+
`ticket`='{$ticket}',
|
25 |
+
`image_type`='{$imageType}',
|
26 |
+
`send_time`='{$send_time}'
|
27 |
+
";
|
28 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_write');
|
29 |
+
$conn->query($query);
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getAll()
|
33 |
+
{
|
34 |
+
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
35 |
+
$query = 'SELECT * FROM ' .$this->tableNameWithPrefix.' ORDER BY `imageupload_id` ASC';
|
36 |
+
$results = $read->fetchAll($query);
|
37 |
+
|
38 |
+
return $results;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function deleteImageByUrl($imageUrl)
|
42 |
+
{
|
43 |
+
$query = "DELETE FROM
|
44 |
+
`".$this->tableNameWithPrefix."`
|
45 |
+
WHERE
|
46 |
+
`image_url`='{$imageUrl}'
|
47 |
+
";
|
48 |
+
$conn = Mage::getSingleton('core/resource')->getConnection('core_write');
|
49 |
+
$conn->query($query);
|
50 |
+
}
|
51 |
+
}
|
app/code/local/wexo/Imageupload/controllers/Adminhtml/ImageuploadController.php
ADDED
@@ -0,0 +1,315 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Wexo_Imageupload_Adminhtml_ImageuploadController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
const NO_SELECTED_ALIAN = 'no_selected';
|
5 |
+
|
6 |
+
public function indexAction()
|
7 |
+
{
|
8 |
+
$this->_title($this->__('ImageUpload'));
|
9 |
+
$this->loadLayout();
|
10 |
+
$this->_setActiveMenu('wexo_imageupload');
|
11 |
+
$this->_addBreadcrumb(Mage::helper('wexo_imageupload')->__('ImageUpload'), Mage::helper('wexo_imageupload')->__('ImageUpload'));
|
12 |
+
$this->renderLayout();
|
13 |
+
}
|
14 |
+
|
15 |
+
public function uploadAction()
|
16 |
+
{
|
17 |
+
$upload_handler = new Wexo_Imageupload_Helper_UploadHandler();
|
18 |
+
|
19 |
+
header('Pragma: no-cache');
|
20 |
+
header('Cache-Control: no-store, no-cache, must-revalidate');
|
21 |
+
header('Content-Disposition: inline; filename="files.json"');
|
22 |
+
header('X-Content-Type-Options: nosniff');
|
23 |
+
header('Access-Control-Allow-Origin: *');
|
24 |
+
header('Access-Control-Allow-Methods: OPTIONS, HEAD, GET, POST, PUT, DELETE');
|
25 |
+
header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
|
26 |
+
|
27 |
+
header('Accept: application/json');
|
28 |
+
|
29 |
+
switch ($_SERVER['REQUEST_METHOD']) {
|
30 |
+
case 'OPTIONS':
|
31 |
+
break;
|
32 |
+
case 'HEAD':
|
33 |
+
case 'GET':
|
34 |
+
$upload_handler->get();
|
35 |
+
break;
|
36 |
+
case 'POST':
|
37 |
+
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
38 |
+
$upload_handler->delete();
|
39 |
+
} else {
|
40 |
+
$upload_handler->post();
|
41 |
+
}
|
42 |
+
break;
|
43 |
+
case 'DELETE':
|
44 |
+
$upload_handler->delete();
|
45 |
+
break;
|
46 |
+
default:
|
47 |
+
header('HTTP/1.1 405 Method Not Allowed');
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
public function saveTemplateAction()
|
53 |
+
{
|
54 |
+
$templateName = $_REQUEST['templateName'];
|
55 |
+
$templateId = $_REQUEST['templateId'];
|
56 |
+
Mage::getSingleton('admin/session')->setRemoveTheBackGroundTemplate($templateName);
|
57 |
+
Mage::getSingleton('admin/session')->setRemoveTheBackGroundTemplateId($templateId);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function searchProductAction()
|
61 |
+
{
|
62 |
+
if(isset($_REQUEST['search_word'])){
|
63 |
+
$block = new Wexo_Imageupload_Block_Adminhtml_Imageupload();
|
64 |
+
|
65 |
+
$search_word = $_REQUEST['search_word'];
|
66 |
+
$collection = Mage::getModel('catalog/product')->getCollection()
|
67 |
+
->setPage(1, $block->getModuleConfig('design','max_items_for_search_result'))
|
68 |
+
->addFieldToFilter('name',array('like'=>'%'.$search_word.'%'));
|
69 |
+
|
70 |
+
foreach($collection as $p) {
|
71 |
+
echo '<p><a onClick="downloadProductData('.$p['entity_id'].'); return false"
|
72 |
+
class=\'searchResult\'
|
73 |
+
href=#>'.$p['name'].' ('.$p['entity_id'].')</a>
|
74 |
+
</p>';
|
75 |
+
}
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
public function showProductAction()
|
80 |
+
{
|
81 |
+
$productId = $_REQUEST['product_id'];
|
82 |
+
$product = Mage::getModel('catalog/product')
|
83 |
+
->load($productId);
|
84 |
+
|
85 |
+
$status = 'active';
|
86 |
+
if($product->getData('status') == 2){
|
87 |
+
$status = 'unactive';
|
88 |
+
}
|
89 |
+
|
90 |
+
echo '<table class="grid" id="showProduct">';
|
91 |
+
echo '<tr class="headings">';
|
92 |
+
echo '<td>Id</td>';
|
93 |
+
echo '<td>Name</td>';
|
94 |
+
echo '<td>Sku</td>';
|
95 |
+
echo '<td>Price</td>';
|
96 |
+
echo '<td>Qty</td>';
|
97 |
+
echo '<td>Status</td>';
|
98 |
+
echo '</tr>';
|
99 |
+
echo '<tr>';
|
100 |
+
echo '<td id="productId">'.$product->getData('entity_id').'</td>';
|
101 |
+
echo '<td id="productName">'.$product->getData('name').'</td>';
|
102 |
+
echo '<td>'.$product->getData('sku').'</td>';
|
103 |
+
echo '<td>'.round($product->getData('price'),2).'</td>';
|
104 |
+
echo '<td>'.round($product->getStockItem()->getQty(),1).'</td>';
|
105 |
+
echo '<td>'.$status.'</td>';
|
106 |
+
echo '</tr>';
|
107 |
+
echo '</table>';
|
108 |
+
}
|
109 |
+
|
110 |
+
public function saveImageResponseAction()
|
111 |
+
{
|
112 |
+
$r = $_REQUEST;
|
113 |
+
$images = new Wexo_Imageupload_Model_Mysql();
|
114 |
+
$images->addImage(
|
115 |
+
$r['product_id'],
|
116 |
+
$r['product_name'],
|
117 |
+
$r['image_url'],
|
118 |
+
$r['ticket'],
|
119 |
+
$r['image_type'],
|
120 |
+
$r['send_time']
|
121 |
+
);
|
122 |
+
}
|
123 |
+
|
124 |
+
public function getImagesListAction()
|
125 |
+
{
|
126 |
+
$images = new Wexo_Imageupload_Model_Mysql();
|
127 |
+
$imagesList = $images->getAll();
|
128 |
+
|
129 |
+
header('Content-type: application/xml');
|
130 |
+
|
131 |
+
$converter = new Wexo_Imageupload_Helper_ArrayToXml();
|
132 |
+
$xmlStr = $converter->convert($imagesList);
|
133 |
+
|
134 |
+
echo $xmlStr;
|
135 |
+
}
|
136 |
+
|
137 |
+
public function getProductNameByIdAction()
|
138 |
+
{
|
139 |
+
$images = new Wexo_Imageupload_Model_Mysql();
|
140 |
+
$imagesList = $images->getAll();
|
141 |
+
|
142 |
+
header('Content-type: application/xml');
|
143 |
+
|
144 |
+
$converter = new Wexo_Imageupload_Helper_ArrayToXml();
|
145 |
+
$xmlStr = $converter->convert($imagesList);
|
146 |
+
|
147 |
+
echo $xmlStr;
|
148 |
+
}
|
149 |
+
|
150 |
+
public function putImagesOnProductFromStatusPageAction()
|
151 |
+
{
|
152 |
+
$block = new Wexo_Imageupload_Block_Adminhtml_Imageupload();
|
153 |
+
|
154 |
+
$id = $_REQUEST['productId'];
|
155 |
+
$imageUrlOriginal = $_REQUEST['imageUrl'];
|
156 |
+
$imageTypeBefore = $_REQUEST['imageType'];
|
157 |
+
|
158 |
+
switch($imageTypeBefore){
|
159 |
+
case 'base':
|
160 |
+
$imageType = 'image';
|
161 |
+
break;
|
162 |
+
case 'small':
|
163 |
+
$imageType = 'small_image';
|
164 |
+
break;
|
165 |
+
case 'thumbnail':
|
166 |
+
$imageType = 'thumbnail';
|
167 |
+
break;
|
168 |
+
default:
|
169 |
+
$imageType = false;
|
170 |
+
break;
|
171 |
+
}
|
172 |
+
|
173 |
+
$imageName = strrchr($imageUrlOriginal,'/');
|
174 |
+
$imageName = substr($imageName,1); // we need just image's name
|
175 |
+
|
176 |
+
$importDir = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','ready_files_dir').$imageName;
|
177 |
+
|
178 |
+
$url = rawurlencode($imageUrlOriginal);
|
179 |
+
$url = str_replace("%2F", "/", $url);
|
180 |
+
$url = str_replace("%3A", ":", $url);
|
181 |
+
|
182 |
+
$pic = file_get_contents($url);
|
183 |
+
file_put_contents($importDir, $pic);
|
184 |
+
|
185 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
186 |
+
|
187 |
+
$filePathBefore = $importDir;
|
188 |
+
$extension = strrchr($imageName,'.');
|
189 |
+
$productName = str_replace(' ','_',$product->getData('name')); // replace ' ' to '_'
|
190 |
+
|
191 |
+
$filePath = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','ready_files_dir').$productName.$extension;
|
192 |
+
rename($filePathBefore,$filePath);
|
193 |
+
|
194 |
+
$product->addImageToMediaGallery($filePath, $imageType, true, false)
|
195 |
+
->save();
|
196 |
+
|
197 |
+
// delete image and row in DB
|
198 |
+
|
199 |
+
// use config.xml to make it easy to change
|
200 |
+
$imageToDeleteUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$block->getModuleConfig('uploader','uploaded_files_dir').$imageName;
|
201 |
+
$imageToDelete = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','uploaded_files_dir').$imageName;
|
202 |
+
$imageThumbnailToDelete = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','uploaded_thumbnail_dir').$imageName;
|
203 |
+
|
204 |
+
$db = new Wexo_Imageupload_Model_Mysql();
|
205 |
+
$db->deleteImageByUrl($imageToDeleteUrl);
|
206 |
+
unlink($imageToDelete);
|
207 |
+
unlink($imageThumbnailToDelete);
|
208 |
+
}
|
209 |
+
|
210 |
+
public function putImagesOnProductAction()
|
211 |
+
{
|
212 |
+
$id = $_REQUEST['productId'];
|
213 |
+
|
214 |
+
$baseImage = $_REQUEST['base'];
|
215 |
+
$smallImage = $_REQUEST['small'];
|
216 |
+
$thumbnailImage = $_REQUEST['thumbnail'];
|
217 |
+
$imagesToGallery = $_REQUEST['imagesToGallery'];
|
218 |
+
|
219 |
+
$mediaArray = array(
|
220 |
+
'image' => $baseImage,
|
221 |
+
'small_image' => $smallImage,
|
222 |
+
'thumbnail' => $thumbnailImage,
|
223 |
+
);
|
224 |
+
|
225 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
226 |
+
|
227 |
+
// Remove unset images, add image to gallery if exists
|
228 |
+
|
229 |
+
$block = new Wexo_Imageupload_Block_Adminhtml_Imageupload();
|
230 |
+
$importDir = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','uploaded_files_dir');
|
231 |
+
|
232 |
+
foreach($mediaArray as $imageType => $fileName) {
|
233 |
+
$filePathBefore = $importDir.$fileName;
|
234 |
+
$extension = strrchr($fileName,'.');
|
235 |
+
$productName = str_replace(' ','_',$product->getData('name')); // replace ' ' to '_'
|
236 |
+
|
237 |
+
$filePath = $importDir.$productName.$extension;
|
238 |
+
rename($filePathBefore,$filePath);
|
239 |
+
|
240 |
+
if (file_exists($filePath) && $imageType!= self::NO_SELECTED_ALIAN) {
|
241 |
+
$product->addImageToMediaGallery($filePath, $imageType, true, false);
|
242 |
+
|
243 |
+
$imageThumbnailToDelete = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','uploaded_thumbnail_dir').$fileName;
|
244 |
+
unlink($imageThumbnailToDelete);
|
245 |
+
}
|
246 |
+
}
|
247 |
+
if(count($imagesToGallery) > 0){
|
248 |
+
foreach($imagesToGallery as $fileName) {
|
249 |
+
$filePathBefore = $importDir.$fileName;
|
250 |
+
$extension = strrchr($fileName,'.');
|
251 |
+
$productName = str_replace(' ','_',$product->getData('name')); // replace ' ' to '_'
|
252 |
+
|
253 |
+
$filePath = $importDir.$productName.$extension;
|
254 |
+
rename($filePathBefore,$filePath);
|
255 |
+
|
256 |
+
if (file_exists($filePath)) {
|
257 |
+
$product->addImageToMediaGallery($filePath, false, true, false);
|
258 |
+
|
259 |
+
$imageThumbnailToDelete = Mage::getBaseDir().DS.$block->getModuleConfig('uploader','uploaded_thumbnail_dir').$fileName;
|
260 |
+
unlink($imageThumbnailToDelete);
|
261 |
+
}
|
262 |
+
}
|
263 |
+
}
|
264 |
+
|
265 |
+
$product->save();
|
266 |
+
}
|
267 |
+
|
268 |
+
public function changeSettingsAction()
|
269 |
+
{
|
270 |
+
$apiKey = $_REQUEST['api_key'];
|
271 |
+
$apiEmail = $_REQUEST['api_email'];
|
272 |
+
$previewWidth = $_REQUEST['preview_width'];
|
273 |
+
$maxItemsForSearchResult = $_REQUEST['max_items_for_search_result'];
|
274 |
+
|
275 |
+
$block = new Wexo_Imageupload_Block_Adminhtml_Imageupload();
|
276 |
+
|
277 |
+
|
278 |
+
$apiKeyBefore = '<api_key>'.$block->getModuleConfig('api_param','api_key').'</api_key>';
|
279 |
+
$emailBefore = '<email>'.$block->getModuleConfig('api_param','email').'</email>';
|
280 |
+
$previewWidthBefore = '<preview_width>'.$block->getModuleConfig('design','preview_width').'</preview_width>';
|
281 |
+
$maxItemsForSearchResultBefore = '<max_items_for_search_result>'.$block->getModuleConfig('design','max_items_for_search_result').'</max_items_for_search_result>';
|
282 |
+
|
283 |
+
$apiKeyAfter = '<api_key>'.$apiKey.'</api_key>';
|
284 |
+
$emailAfter = '<email>'.$apiEmail.'</email>';
|
285 |
+
$previewWidthAfter = '<preview_width>'.$previewWidth.'</preview_width>';
|
286 |
+
$maxItemsForSearchResultlAfter = '<max_items_for_search_result>'.$maxItemsForSearchResult.'</max_items_for_search_result>';
|
287 |
+
|
288 |
+
Mage::getSingleton('admin/session')->setRemoveTheBackGroundTemplate(null); // clean Session
|
289 |
+
Mage::getSingleton('admin/session')->setRemoveTheBackGroundTemplateId(null);
|
290 |
+
|
291 |
+
$before = Array(
|
292 |
+
$apiKeyBefore,
|
293 |
+
$emailBefore,
|
294 |
+
$previewWidthBefore,
|
295 |
+
$maxItemsForSearchResultBefore,
|
296 |
+
);
|
297 |
+
$after = Array(
|
298 |
+
$apiKeyAfter,
|
299 |
+
$emailAfter,
|
300 |
+
$previewWidthAfter,
|
301 |
+
$maxItemsForSearchResultlAfter,
|
302 |
+
);
|
303 |
+
|
304 |
+
$configPath = Mage::getBaseDir().'\app\code\local\Wexo\Imageupload\etc\config.xml';
|
305 |
+
$file = fopen($configPath, 'r');
|
306 |
+
$content = fread($file, filesize($configPath));
|
307 |
+
fclose($file);
|
308 |
+
|
309 |
+
$file = fopen($configPath, 'w+');
|
310 |
+
fwrite($file, str_replace($before, $after, $content));
|
311 |
+
fclose($file);
|
312 |
+
|
313 |
+
Mage::app('admin', 'store')->cleanCache();
|
314 |
+
}
|
315 |
+
}
|
app/code/local/wexo/Imageupload/etc/adminhtml.xml
ADDED
@@ -0,0 +1,22 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<wexo_imageupload translate="title" module="wexo_imageupload">
|
5 |
+
<title>ImageUpload</title>
|
6 |
+
<sort_order>55</sort_order>
|
7 |
+
<action>adminhtml/imageupload</action>
|
8 |
+
</wexo_imageupload>
|
9 |
+
</menu>
|
10 |
+
<acl>
|
11 |
+
<resources>
|
12 |
+
<all>
|
13 |
+
<children>
|
14 |
+
<wexo_imageupload translate="title" module="wexo_imageupload">
|
15 |
+
<title>ImageUpload</title>
|
16 |
+
<sort_order>0</sort_order>
|
17 |
+
</wexo_imageupload>
|
18 |
+
</children>
|
19 |
+
</all>
|
20 |
+
</resources>
|
21 |
+
</acl>
|
22 |
+
</config>
|
app/code/local/wexo/Imageupload/etc/config.xml
ADDED
@@ -0,0 +1,88 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Wexo_Imageupload>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Wexo_Imageupload>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<layout>
|
10 |
+
<updates>
|
11 |
+
<wexo_imageupload>
|
12 |
+
<file>imageupload.xml</file>
|
13 |
+
</wexo_imageupload>
|
14 |
+
</updates>
|
15 |
+
</layout>
|
16 |
+
</adminhtml>
|
17 |
+
<admin>
|
18 |
+
<routers>
|
19 |
+
<adminhtml>
|
20 |
+
<args>
|
21 |
+
<use>admin</use>
|
22 |
+
<modules>
|
23 |
+
<wexo_imageupload before="Mage_Adminhtml">Wexo_Imageupload_Adminhtml</wexo_imageupload>
|
24 |
+
</modules>
|
25 |
+
</args>
|
26 |
+
</adminhtml>
|
27 |
+
</routers>
|
28 |
+
</admin>
|
29 |
+
<global>
|
30 |
+
<helpers>
|
31 |
+
<wexo_imageupload>
|
32 |
+
<class>Wexo_Imageupload_Helper</class>
|
33 |
+
</wexo_imageupload>
|
34 |
+
</helpers>
|
35 |
+
|
36 |
+
<blocks>
|
37 |
+
<imageupload>
|
38 |
+
<class>Wexo_Imageupload_Block</class>
|
39 |
+
</imageupload>
|
40 |
+
</blocks>
|
41 |
+
|
42 |
+
<models>
|
43 |
+
<imageupload>
|
44 |
+
<class>Wexo_Imageupload_Model</class>
|
45 |
+
<resourceModel>imageupload_mysql4</resourceModel>
|
46 |
+
</imageupload>
|
47 |
+
<imageupload_mysql4>
|
48 |
+
<class>Wexo_Imageupload_Model_Mysql4</class>
|
49 |
+
</imageupload_mysql4>
|
50 |
+
</models>
|
51 |
+
|
52 |
+
<resources>
|
53 |
+
<imageupload_setup>
|
54 |
+
<setup>
|
55 |
+
<module>Wexo_Imageupload</module>
|
56 |
+
</setup>
|
57 |
+
<connection>
|
58 |
+
<use>core_setup</use>
|
59 |
+
</connection>
|
60 |
+
</imageupload_setup>
|
61 |
+
<imageupload_write>
|
62 |
+
<connection>
|
63 |
+
<use>core_write</use>
|
64 |
+
</connection>
|
65 |
+
</imageupload_write>
|
66 |
+
<imageupload_read>
|
67 |
+
<connection>
|
68 |
+
<use>core_read</use>
|
69 |
+
</connection>
|
70 |
+
</imageupload_read>
|
71 |
+
</resources>
|
72 |
+
</global>
|
73 |
+
<api_param>
|
74 |
+
<api_key>dvd</api_key>
|
75 |
+
<email>dv</email>
|
76 |
+
</api_param>
|
77 |
+
<design>
|
78 |
+
<js_dir>/js/wexo_imageupload</js_dir>
|
79 |
+
<preview_width>80px</preview_width>
|
80 |
+
<max_items_for_search_result>7</max_items_for_search_result>
|
81 |
+
</design>
|
82 |
+
<uploader>
|
83 |
+
<uploaded_files_dir>media/wexo_uploaded_files/</uploaded_files_dir>
|
84 |
+
<uploaded_thumbnail_dir>media/wexo_uploaded_files/thumbnails/</uploaded_thumbnail_dir>
|
85 |
+
<uploaded_thumbnail_dir_name>thumbnails/</uploaded_thumbnail_dir_name>
|
86 |
+
<ready_files_dir>media/wexo_uploaded_files/ready_files/</ready_files_dir>
|
87 |
+
</uploader>
|
88 |
+
</config>
|
app/code/local/wexo/Imageupload/sql/imageupload_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$installer->run("
|
7 |
+
|
8 |
+
-- DROP TABLE IF EXISTS {$this->getTable(Wexo_Imageupload_Model_Mysql::TABLE_NAME)};
|
9 |
+
CREATE TABLE {$this->getTable(Wexo_Imageupload_Model_Mysql::TABLE_NAME)} (
|
10 |
+
`imageupload_id` int(11) unsigned NOT NULL auto_increment,
|
11 |
+
`product_id` int(11) NOT NULL,
|
12 |
+
`product_name` varchar(255) NOT NULL default '',
|
13 |
+
`image_url` varchar(255) NOT NULL default '',
|
14 |
+
`ticket` varchar(255) NOT NULL default '',
|
15 |
+
`image_type` varchar(255) NOT NULL default 'default',
|
16 |
+
`send_time` datetime NOT NULL default '0000-00-00 00:00:00',
|
17 |
+
`ready` smallint(6) NOT NULL default '0',
|
18 |
+
PRIMARY KEY (`imageupload_id`)
|
19 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
20 |
+
|
21 |
+
");
|
22 |
+
|
23 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/imageupload.xml
ADDED
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<adminhtml_imageupload_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="imageupload/adminhtml_imageupload" name="imageupload-form" template="imageupload/imageuploadbackend.phtml" />
|
6 |
+
</reference>
|
7 |
+
</adminhtml_imageupload_index>
|
8 |
+
</layout>
|
app/design/adminhtml/default/default/template/imageupload/imageuploadbackend.phtml
ADDED
@@ -0,0 +1,873 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('wexo_imageupload.css'); ?>" media="all">
|
2 |
+
|
3 |
+
<div style="border:1px solid #ccc;" class="entry-edit">
|
4 |
+
<!-- -->
|
5 |
+
<ul class="tabs-horiz" id="diagram_tab">
|
6 |
+
<li>
|
7 |
+
<a class="tab-item-link active" title="Uploader" id="diagram_tab_uploader" href="#" onclick="showUploader(); return false;">Uploader</a>
|
8 |
+
</li>
|
9 |
+
<li>
|
10 |
+
<a class="tab-item-link" title="Status" id="diagram_tab_status" href="#" onclick="showStatuses(); return false;">Status</a>
|
11 |
+
</li>
|
12 |
+
<li>
|
13 |
+
<a class="tab-item-link" title="Settings" id="diagram_tab_settings" href="#" onclick="showSettings(); return false;">Settings</a>
|
14 |
+
</li>
|
15 |
+
</ul>
|
16 |
+
|
17 |
+
<div id="diagram_tab_content">
|
18 |
+
<div style="" id="diagram_tab_uploader_content"><div style="margin:0px 20px 20px 20px;">
|
19 |
+
<div class="wexo_messages" id="uploaderMessage" style="visibility: hidden;"></div>
|
20 |
+
<div id="downloadImages" style="position:absolute;"></div>
|
21 |
+
<form method="get" action="" onsubmit="searchProduct(); return false;" id="myform">
|
22 |
+
<?php $showProductFormKey = Mage::getSingleton('core/session')->getFormKey(); ?>
|
23 |
+
<input name="form_key" type="hidden" value="<?php echo $showProductFormKey; ?>"
|
24 |
+
<table>
|
25 |
+
<tr>
|
26 |
+
<td>
|
27 |
+
<div id="flash"></div>
|
28 |
+
<input autocomplete="off" type="text" name="search" onKeyPress="searchProduct();" id="search_box" class='search_box'
|
29 |
+
onblur="if(this.value=='')this.value='Product Name';"
|
30 |
+
onfocus="if(this.value=='Product Name')this.value=''; "
|
31 |
+
value="Product Name" style="width:250px;"
|
32 |
+
/>
|
33 |
+
</td>
|
34 |
+
<td>
|
35 |
+
<button type="button" value="Search" class="search_button scalable" ><span>Find</span></button>
|
36 |
+
</td>
|
37 |
+
</tr>
|
38 |
+
<tr style="position:relative;">
|
39 |
+
<td>
|
40 |
+
<ol id="insert_search" class="update"></ol>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
</table>
|
44 |
+
</form>
|
45 |
+
|
46 |
+
<!--uses ajax-->
|
47 |
+
<div id="productInfo"></div>
|
48 |
+
|
49 |
+
<div class="grid">
|
50 |
+
<form id="fileupload" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/upload/"); ?>" method="POST" enctype="multipart/form-data">
|
51 |
+
<?php $formKey = Mage::getSingleton('core/session')->getFormKey(); ?>
|
52 |
+
<input name="form_key" type="hidden" value="<?php echo $formKey; ?>">
|
53 |
+
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
|
54 |
+
<div class="row fileupload-buttonbar">
|
55 |
+
<div class="span7">
|
56 |
+
<!-- The fileinput-button span is used to style the file input field as button -->
|
57 |
+
<ul id="fileupload_buttonbar">
|
58 |
+
<li>
|
59 |
+
<span class="btn btn-success fileinput-button">
|
60 |
+
<i class="icon-plus icon-white"></i>
|
61 |
+
<span class="scalableAdd">Add files...</span>
|
62 |
+
<input type="file" name="files[]" multiple>
|
63 |
+
</span>
|
64 |
+
</li>
|
65 |
+
<li>
|
66 |
+
<button type="submit" class="btn btn-primary start">
|
67 |
+
<i class="icon-upload icon-white"></i>
|
68 |
+
<span>Start upload</span>
|
69 |
+
</button>
|
70 |
+
</li>
|
71 |
+
<li>
|
72 |
+
<button type="reset" class="btn btn-warning cancel">
|
73 |
+
<i class="icon-ban-circle icon-white"></i>
|
74 |
+
<span>Cancel upload</span>
|
75 |
+
</button>
|
76 |
+
</li>
|
77 |
+
<li id="selectTemplatesLi">
|
78 |
+
<ul id="selectTemplates">
|
79 |
+
<li>
|
80 |
+
<button type="button" class="btn" onclick="selectRTBGTemplate();" id="selectTemplateButton">
|
81 |
+
<i class="icon-trash icon-white"></i>
|
82 |
+
<span>Select Template
|
83 |
+
<span class="selectedTemplate" id="<?php echo $this->getRemoveTheBackGroundTemplateId(); ?>">
|
84 |
+
<?php if($this->getRemoveTheBackGroundTemplate()): ?>
|
85 |
+
(<?php echo $this->getRemoveTheBackGroundTemplate(); ?>)
|
86 |
+
<?php endif; ?>
|
87 |
+
</span>
|
88 |
+
</span>
|
89 |
+
</button>
|
90 |
+
</li>
|
91 |
+
</ul>
|
92 |
+
</li>
|
93 |
+
</ul>
|
94 |
+
<button onclick="processImages();" value="addToProduct" id="addToProduct" type="button" class="btn btn-danger addToProduct scalable save" style="float:right;">
|
95 |
+
<i class="icon-trash icon-white"></i>
|
96 |
+
<span>
|
97 |
+
<?php if($this->getRemoveTheBackGroundTemplateId()){ ?>
|
98 |
+
Send To RTB
|
99 |
+
<?php }else{ ?>
|
100 |
+
Add To Product
|
101 |
+
<?php } ?>
|
102 |
+
</span>
|
103 |
+
</button>
|
104 |
+
<div id="templates"><!-- api templates --></div>
|
105 |
+
<div class="span5">
|
106 |
+
<!-- The global progress bar -->
|
107 |
+
<div class="progress progress-success progress-striped active fade">
|
108 |
+
<div class="bar" style="width:0%;"></div>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
<button onclick="refreshAllRadio(); return false;" style="width:80px;position:absolute;right:100px;top:51px;" type="button" class="btn btn-primary">
|
112 |
+
<i class="icon-white"></i>
|
113 |
+
<span>Refresh</span>
|
114 |
+
</button>
|
115 |
+
</div>
|
116 |
+
|
117 |
+
</div>
|
118 |
+
<!-- The loading indicator is shown during image processing -->
|
119 |
+
<div class="fileupload-loading"></div>
|
120 |
+
<br>
|
121 |
+
<!-- The table listing the files available for upload/download -->
|
122 |
+
<table class="table table-striped data grid">
|
123 |
+
<thead>
|
124 |
+
<tr class="headings">
|
125 |
+
<th class="a-center">
|
126 |
+
<div class="row fileupload-buttonbar">
|
127 |
+
<div class="span7">
|
128 |
+
<input type="checkbox" onclick="refreshAllRadio();" class="toggle">
|
129 |
+
</div>
|
130 |
+
</th>
|
131 |
+
<th><span class="nobr">Preview</span></th>
|
132 |
+
<th><span class="nobr">File Name</span></th>
|
133 |
+
<th><span class="nobr">Size</span></th>
|
134 |
+
<th><span class="nobr">Progress</span></th>
|
135 |
+
<th class="a-center" width="80"><span class="nobr">Base</span></th>
|
136 |
+
<th class="a-center" width="80"><span class="nobr">Small</span></th>
|
137 |
+
<th class="a-center" width="80"><span class="nobr">Thumbnail</span></th>
|
138 |
+
</tr>
|
139 |
+
</thead>
|
140 |
+
<tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody>
|
141 |
+
</table>
|
142 |
+
</form>
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
</div>
|
147 |
+
|
148 |
+
|
149 |
+
<div class="container"><!-- The file upload form used as target for the file upload widget --></div>
|
150 |
+
<!-- modal-gallery is the modal dialog used for the image gallery -->
|
151 |
+
<div id="modal-gallery" class="modal modal-gallery hide fade">
|
152 |
+
<div class="modal-header">
|
153 |
+
<a class="close" data-dismiss="modal">×</a>
|
154 |
+
<h3 class="modal-title"></h3>
|
155 |
+
</div>
|
156 |
+
<div class="modal-body"><div class="modal-image"></div></div>
|
157 |
+
<div class="modal-footer">
|
158 |
+
<a class="btn btn-primary modal-next">
|
159 |
+
<span>Next</span>
|
160 |
+
<i class="icon-arrow-right icon-white"></i>
|
161 |
+
</a>
|
162 |
+
<a class="btn btn-info modal-prev">
|
163 |
+
<i class="icon-arrow-left icon-white"></i>
|
164 |
+
<span>Previous</span>
|
165 |
+
</a>
|
166 |
+
<a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
|
167 |
+
<i class="icon-play icon-white"></i>
|
168 |
+
<span>Slideshow</span>
|
169 |
+
</a>
|
170 |
+
<a class="btn modal-download" target="_blank">
|
171 |
+
<i class="icon-download"></i>
|
172 |
+
<span>Download</span>
|
173 |
+
</a>
|
174 |
+
</div>
|
175 |
+
</div>
|
176 |
+
</div>
|
177 |
+
</div>
|
178 |
+
<div class="grid" style="display: none;position: relative;" id="diagram_tab_status_content">
|
179 |
+
<div id="downloadStatus" style="position:absolute;top:-16px;right:12px;"></div>
|
180 |
+
|
181 |
+
<form id="putImagesOnProduct" action="<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/putImagesOnProduct/"); ?>" method="POST" enctype="multipart/form-data">
|
182 |
+
<?php $putImagesOnProductFormKey = Mage::getSingleton('core/session')->getFormKey(); ?>
|
183 |
+
<input name="form_key" type="hidden" value="<?php echo $putImagesOnProductFormKey; ?>">
|
184 |
+
<button onclick="putImagesOnProductFromStatusPage(); return false;" value="addToProduct" type="button" class="btn btn-danger" style="margin: 12px;">
|
185 |
+
<i class="icon-trash icon-white"></i>
|
186 |
+
<span>Add To Product</span>
|
187 |
+
</button>
|
188 |
+
</form>
|
189 |
+
|
190 |
+
<table class="table table-striped data grid" style="width:100%;">
|
191 |
+
<thead id="diagram_tab_status_content_head">
|
192 |
+
<tr class="headings">
|
193 |
+
<th class="a-center"></th>
|
194 |
+
<th class="a-center" width="30"<span class="nobr">Id</span></th>
|
195 |
+
<th class="a-center"><span class="nobr">After</span></th>
|
196 |
+
<th class="a-center"><span class="nobr">Before</span></th>
|
197 |
+
<th class="a-center"><span class="nobr">Product Name</span></th>
|
198 |
+
<th class="a-center" width="80"><span class="nobr">Image Type</span></th>
|
199 |
+
<th class="a-center"><span class="nobr">Send Time</span></th>
|
200 |
+
<th class="a-center"><span class="nobr">Status</span></th>
|
201 |
+
<th class="a-center"><span class="nobr">Download</span></th>
|
202 |
+
</tr>
|
203 |
+
</thead>
|
204 |
+
<tbody id="diagram_tab_status_content_body"></tbody>
|
205 |
+
</table>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<div class="grid" style="display: none;position: relative;" id="diagram_tab_settings_content">
|
209 |
+
<form id="changeSettings" action="" method="get">
|
210 |
+
<table>
|
211 |
+
<tr>
|
212 |
+
<td class="rightAlign">Remove The Background Api Key :</td>
|
213 |
+
<td class="leftAlign"><input id="api_key" name="api_key" type="text" value="<?php echo($this->getModuleConfig('api_param','api_key')); ?>" size="50" /></td>
|
214 |
+
</tr>
|
215 |
+
<tr>
|
216 |
+
<td class="rightAlign">Email :</td>
|
217 |
+
<td class="leftAlign"><input id="api_email" name="email" type="text" value="<?php echo($this->getModuleConfig('api_param','email')); ?>" /></td>
|
218 |
+
</tr>
|
219 |
+
<tr>
|
220 |
+
<td class="rightAlign">Preview Width :</td>
|
221 |
+
<td class="leftAlign"><input id="preview_width" name="preview_width" type="text" value="<?php echo($this->getModuleConfig('design','preview_width')); ?>" /></td>
|
222 |
+
</tr>
|
223 |
+
<tr>
|
224 |
+
<td class="rightAlign">Max Items For Search Result :</td>
|
225 |
+
<td class="leftAlign"><input id="max_items_for_search_result" name="max_items_for_search_result" type="text" value="<?php echo($this->getModuleConfig('design','max_items_for_search_result')); ?>" /></td>
|
226 |
+
</tr>
|
227 |
+
<tr>
|
228 |
+
<td class="rightAlign"></td>
|
229 |
+
<td class="rightAlign"><input value="Save" type="button" class="form-button" onclick="changeAPISettings(); return false;"/></td>
|
230 |
+
</tr>
|
231 |
+
</table>
|
232 |
+
</form>
|
233 |
+
</div>
|
234 |
+
</div>
|
235 |
+
</div>
|
236 |
+
|
237 |
+
<!-- The template to display files available for upload -->
|
238 |
+
<script id="template-upload" type="text/x-tmpl">
|
239 |
+
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
240 |
+
<tr class="template-upload in even pointer">
|
241 |
+
<td class="a-center"></td>
|
242 |
+
<td class="preview"><span class="fade"></span></td>
|
243 |
+
<td class="name"><span>{%=file.name%}</span></td>
|
244 |
+
{% if (file.error) { %}
|
245 |
+
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
|
246 |
+
{% } else if (o.files.valid && !i) { %}
|
247 |
+
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
248 |
+
<td>
|
249 |
+
<div class="progress progress-success progress-striped active">
|
250 |
+
<div class="bar" style="width:0%;"></div>
|
251 |
+
</div>
|
252 |
+
</td>
|
253 |
+
<td class="start">{% if (!o.options.autoUpload) { %}
|
254 |
+
<button class="btn btn-primary">
|
255 |
+
<i class="icon-upload icon-white"></i>
|
256 |
+
<span>{%=locale.fileupload.start%}</span>
|
257 |
+
</button>
|
258 |
+
{% } %}</td>
|
259 |
+
{% } else { %}
|
260 |
+
<td colspan="2"></td>
|
261 |
+
{% } %}
|
262 |
+
<td class="cancel">{% if (!i) { %}
|
263 |
+
<button class="btn btn-warning">
|
264 |
+
<i class="icon-ban-circle icon-white"></i>
|
265 |
+
<span>{%=locale.fileupload.cancel%}</span>
|
266 |
+
</button>
|
267 |
+
{% } %}</td>
|
268 |
+
</tr>
|
269 |
+
{% } %}
|
270 |
+
</script>
|
271 |
+
|
272 |
+
<!-- The template to display files available for download -->
|
273 |
+
<script id="template-download" type="text/x-tmpl">
|
274 |
+
{% for (var i=0, file; file=o.files[i]; i++) { %}
|
275 |
+
<tr class="template-download">
|
276 |
+
{% if (file.error) { %}
|
277 |
+
<td></td>
|
278 |
+
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
279 |
+
<td class="name"><span>{%=file.name%}</span></td>
|
280 |
+
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
|
281 |
+
{% } else { %}
|
282 |
+
<td class="delete a-center">
|
283 |
+
<input type="checkbox" onchange="refreshRadio(this);" class="imagesToGallery" name="imagesToGallery" value="{%=file.name%}">
|
284 |
+
</td>
|
285 |
+
<td class="preview">
|
286 |
+
<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
|
287 |
+
</td>
|
288 |
+
<td class="name">
|
289 |
+
<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
|
290 |
+
</td>
|
291 |
+
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
|
292 |
+
<td class="true">Ready</td>
|
293 |
+
<td class="a-center"><input type="radio" onchange="refreshCheckboxes(this);" name="base" value="{%=file.name%}"/></td>
|
294 |
+
<td class="a-center"><input type="radio" onchange="refreshCheckboxes(this);" name="small" value="{%=file.name%}"/></td>
|
295 |
+
<td class="a-center"><input type="radio" onchange="refreshCheckboxes(this);" name="thumbnail" value="{%=file.name%}"/></td>
|
296 |
+
{% } %}
|
297 |
+
</tr>
|
298 |
+
{% } %}
|
299 |
+
</script>
|
300 |
+
|
301 |
+
<?php $jsDir = $this->getModuleConfig('design','js_dir'); ?>
|
302 |
+
|
303 |
+
<!-- Add jquery here to make sure it is safely for other modules -->
|
304 |
+
<script src="<?php echo $jsDir; ?>/jquery/jquery.js"></script>
|
305 |
+
<script src="<?php echo $jsDir; ?>/jquery/noConflict.js"></script>
|
306 |
+
|
307 |
+
<script src="<?php echo $jsDir; ?>/vendor/jquery.ui.widget.js"></script>
|
308 |
+
<!-- The Templates plugin is included to render the upload/download listings -->
|
309 |
+
<script src="<?php echo $jsDir; ?>/from_site/tmpl.min.js"></script>
|
310 |
+
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
|
311 |
+
<script src="<?php echo $jsDir; ?>/from_site/load-image.min.js"></script>
|
312 |
+
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
|
313 |
+
<script src="<?php echo $jsDir; ?>/from_site/canvas-to-blob.min.js"></script>
|
314 |
+
<!-- Bootstrap JS and Bootstrap Image Gallery are not required, but included for the demo -->
|
315 |
+
<script src="<?php echo $jsDir; ?>/from_site/bootstrap.min.js"></script>
|
316 |
+
<script src="<?php echo $jsDir; ?>/from_site/bootstrap-image-gallery.min.js"></script>
|
317 |
+
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
318 |
+
<script src="<?php echo $jsDir; ?>/jquery.iframe-transport.js"></script>
|
319 |
+
<!-- The basic File Upload plugin -->
|
320 |
+
<script src="<?php echo $jsDir; ?>/jquery.fileupload.js"></script>
|
321 |
+
<!-- The File Upload image processing plugin -->
|
322 |
+
<script src="<?php echo $jsDir; ?>/jquery.fileupload-ip.js"></script>
|
323 |
+
<!-- The File Upload user interface plugin -->
|
324 |
+
<script src="<?php echo $jsDir; ?>/jquery.fileupload-ui.js"></script>
|
325 |
+
<!-- The localization script -->
|
326 |
+
<script src="<?php echo $jsDir; ?>/locale.js"></script>
|
327 |
+
<!-- The main application script -->
|
328 |
+
<script src="<?php echo $jsDir; ?>/main.js"></script>
|
329 |
+
<script src="<?php echo $jsDir; ?>/date/dateFormat.js"></script>
|
330 |
+
|
331 |
+
|
332 |
+
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
|
333 |
+
<script src="/js/wexo_imageupload/cors/jquery.xdr-transport.js"></script>
|
334 |
+
|
335 |
+
|
336 |
+
<script src="<?php echo $jsDir; ?>/ajaxSearch/ajaxSearch.js"></script>
|
337 |
+
|
338 |
+
<script type="text/javascript">
|
339 |
+
j(document).ready(function(){
|
340 |
+
downloadTemplatesRTBGApi();
|
341 |
+
});
|
342 |
+
|
343 |
+
function doAlert(text,type){
|
344 |
+
switch(type){
|
345 |
+
case 'error':
|
346 |
+
j("#uploaderMessage").addClass('wexo_messages_error');
|
347 |
+
break;
|
348 |
+
case 'confirm':
|
349 |
+
j("#uploaderMessage").removeClass('wexo_messages_error');
|
350 |
+
break;
|
351 |
+
default:
|
352 |
+
j("#uploaderMessage").removeClass('wexo_messages_error');
|
353 |
+
break;
|
354 |
+
}
|
355 |
+
j('#uploaderMessage').stop();
|
356 |
+
j("#uploaderMessage").show();
|
357 |
+
j("#uploaderMessage").html(text);
|
358 |
+
j("#uploaderMessage").css('opacity','1.0');
|
359 |
+
j("#uploaderMessage").css('visibility','visible');
|
360 |
+
|
361 |
+
j('#uploaderMessage').animate({opacity: 0.0}, 3000);
|
362 |
+
}
|
363 |
+
|
364 |
+
function refreshAllRadio() {
|
365 |
+
j('.grid input:radio').attr('checked', false);
|
366 |
+
}
|
367 |
+
|
368 |
+
function refreshAllRadioAndCheckboxes() {
|
369 |
+
j('.grid input:radio').attr('checked', false);
|
370 |
+
j('.grid input:checkbox').attr('checked', false);
|
371 |
+
}
|
372 |
+
|
373 |
+
function refreshRadio(checkbox) {
|
374 |
+
var val = j(checkbox).val();
|
375 |
+
var checked = j(checkbox).attr('checked');
|
376 |
+
|
377 |
+
j('input[value="'+val+'"]:checked').each(function() {
|
378 |
+
j(this).attr('checked', false);
|
379 |
+
});
|
380 |
+
|
381 |
+
if(checked == 'checked'){
|
382 |
+
j(checkbox).attr('checked', true);
|
383 |
+
}else{
|
384 |
+
j(checkbox).attr('checked', false);
|
385 |
+
}
|
386 |
+
}
|
387 |
+
|
388 |
+
function refreshCheckboxes(radio) {
|
389 |
+
var val = j(radio).val();
|
390 |
+
var checked = j(radio).attr('checked');
|
391 |
+
|
392 |
+
j('input[value="'+val+'"]:checked').each(function() {
|
393 |
+
j(this).attr('checked', false);
|
394 |
+
});
|
395 |
+
|
396 |
+
if(checked == 'checked'){
|
397 |
+
j(radio).attr('checked', true);
|
398 |
+
}else{
|
399 |
+
j(radio).attr('checked', false);
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
function searchProduct() {
|
404 |
+
var search_word = j("#search_box").val();
|
405 |
+
var dataString = 'search_word='+ search_word;
|
406 |
+
|
407 |
+
if(search_word !=''){
|
408 |
+
j.ajax({
|
409 |
+
type: "GET",
|
410 |
+
url: "<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/searchProduct/"); ?>",
|
411 |
+
data: dataString,
|
412 |
+
cache: false,
|
413 |
+
beforeSend: function(html)
|
414 |
+
{
|
415 |
+
j("#flash").show();
|
416 |
+
j("#searchword").show();
|
417 |
+
j(".searchword").html(search_word);
|
418 |
+
j("#flash").html('<img src="<?php echo $jsDir; ?>/ajaxSearch/ajax-loader.gif"/>');
|
419 |
+
},
|
420 |
+
|
421 |
+
success: function(html){
|
422 |
+
j("#insert_search").html('');
|
423 |
+
j("#insert_search").show();
|
424 |
+
j('#insert_search').append('<a class="closeCross" id="closeSearch" href=\'#\'onclick=\"hideSearchList();return false;\">x</a>');
|
425 |
+
if(html != ''){
|
426 |
+
j("#insert_search").append(html);
|
427 |
+
}else{
|
428 |
+
j("#insert_search").append('No result');
|
429 |
+
}
|
430 |
+
j("#flash").hide();
|
431 |
+
}
|
432 |
+
});
|
433 |
+
}
|
434 |
+
return false;
|
435 |
+
}
|
436 |
+
|
437 |
+
function hideSearchList(){
|
438 |
+
j("#insert_search").hide();
|
439 |
+
}
|
440 |
+
|
441 |
+
function downloadProductData(id) {
|
442 |
+
j.post("<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/showProduct/"); ?>",
|
443 |
+
{ form_key: "<?php echo $showProductFormKey; ?>",
|
444 |
+
product_id: id
|
445 |
+
},
|
446 |
+
function (result) {
|
447 |
+
j("#productInfo").css('display','block');
|
448 |
+
j("#productInfo").html('<h4>Selected product:</h4>' + result);
|
449 |
+
j("#insert_search").css('display','none');
|
450 |
+
});
|
451 |
+
}
|
452 |
+
|
453 |
+
function putImagesOnProduct(productId) {
|
454 |
+
var imagesToGallery = new Array();
|
455 |
+
|
456 |
+
var selectedBase = j('input[name=base]:checked', '#fileupload').val();
|
457 |
+
var selectedSmall = j('input[name=small]:checked', '#fileupload').val();
|
458 |
+
var selectedThumbnail = j('input[name=thumbnail]:checked', '#fileupload').val();
|
459 |
+
|
460 |
+
if(!selectedBase) {
|
461 |
+
selectedBase = 'no_selected';
|
462 |
+
}
|
463 |
+
if(!selectedSmall) {
|
464 |
+
selectedSmall = 'no_selected';
|
465 |
+
}
|
466 |
+
if(!selectedThumbnail) {
|
467 |
+
selectedThumbnail = 'no_selected';
|
468 |
+
}
|
469 |
+
|
470 |
+
j("input[class='imagesToGallery']:checked").each(function() {
|
471 |
+
imagesToGallery.push(j(this).val());
|
472 |
+
});
|
473 |
+
|
474 |
+
j.post("<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/putImagesOnProduct/"); ?>",
|
475 |
+
{ form_key: "<?php echo $formKey; ?>",
|
476 |
+
productId: productId,
|
477 |
+
base: selectedBase,
|
478 |
+
small: selectedSmall,
|
479 |
+
thumbnail: selectedThumbnail,
|
480 |
+
imagesToGallery: imagesToGallery
|
481 |
+
},
|
482 |
+
function (result) {
|
483 |
+
window.location.reload();
|
484 |
+
});
|
485 |
+
}
|
486 |
+
|
487 |
+
j(".search_button").click(function(){
|
488 |
+
searchProduct();
|
489 |
+
});
|
490 |
+
|
491 |
+
function changeTemplate(templateName,templateId){
|
492 |
+
j('#closeTemplates').hide();
|
493 |
+
j('.hideLi').slideUp("slow");
|
494 |
+
saveTemplate(templateName,templateId);
|
495 |
+
j('.selectedTemplate').html('('+templateName+')');
|
496 |
+
j('.selectedTemplate').attr('id',templateId);
|
497 |
+
j('#templates').css("display", "none");
|
498 |
+
if(templateId != 0){
|
499 |
+
j('#addToProduct>span').html('Send To RTB');
|
500 |
+
}else{
|
501 |
+
j('#addToProduct>span').html('Add To Product');
|
502 |
+
}
|
503 |
+
}
|
504 |
+
|
505 |
+
function saveTemplate(templateName,templateId){
|
506 |
+
var dataString = 'templateName='+ templateName+'&templateId='+ templateId;
|
507 |
+
|
508 |
+
j.ajax({
|
509 |
+
type: "GET",
|
510 |
+
url: "<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/saveTemplate/"); ?>",
|
511 |
+
cache: false,
|
512 |
+
data: dataString,
|
513 |
+
beforeSend: function(html){},
|
514 |
+
success: function(result){}
|
515 |
+
});
|
516 |
+
}
|
517 |
+
// this part for remove the background API
|
518 |
+
|
519 |
+
function selectRTBGTemplate(){
|
520 |
+
j('#closeTemplates').slideDown("slow");
|
521 |
+
j('.hideLi').slideDown("slow");
|
522 |
+
}
|
523 |
+
|
524 |
+
function hideTemplatesList(){
|
525 |
+
j('.hideLi').slideUp("slow");
|
526 |
+
j('#closeTemplates').hide();
|
527 |
+
}
|
528 |
+
|
529 |
+
function downloadTemplatesRTBGApi(){
|
530 |
+
// j('#selectTemplates').html('');
|
531 |
+
j('#selectTemplates').append('<a class="closeCross" id="closeTemplates" href=\'#\'onclick=\"hideTemplatesList();return false;\">x</a>');
|
532 |
+
j('#selectTemplates').append('<li class=\'hideLi\'><a href=\'#\' id=\'0\' onclick=\"changeTemplate(\'no send\',\'0\');return false;\">no send</a></li>');
|
533 |
+
|
534 |
+
var contactEmail = '<?php echo($this->getModuleConfig('api_param','email')); ?>';
|
535 |
+
var contactAPIkey = '<?php echo($this->getModuleConfig('api_param','api_key')); ?>';
|
536 |
+
var proxy = '/proxy.php?mode=native&url=http://api.removethebackground.com/REST.svc/Templates/';
|
537 |
+
|
538 |
+
|
539 |
+
j.get(proxy+ '?contactEmail=' +contactEmail+ '%26contactAPIkey=' +contactAPIkey,
|
540 |
+
function (xmlResult) {
|
541 |
+
j(xmlResult).find('Template').each(function(){
|
542 |
+
var templateId = j(this).find('TemplateId').text();
|
543 |
+
var templateName = j(this).find('TemplateName').text();
|
544 |
+
|
545 |
+
var link = '<a href=\'#\' id=\''+templateId+'\' onclick=\"changeTemplate(\''+templateName+'\',\''+templateId+'\');return false;\">' +templateName+ '</a>'
|
546 |
+
|
547 |
+
j('#selectTemplates').append('<li class="hideLi">' +link+ '</li>');
|
548 |
+
});
|
549 |
+
});
|
550 |
+
}
|
551 |
+
|
552 |
+
|
553 |
+
function processImages() {
|
554 |
+
var productId = j('#productId').html();
|
555 |
+
var templateId = j('.selectedTemplate').attr('id');
|
556 |
+
|
557 |
+
var selectedBase = j('input[name=base]:checked', '#fileupload').val();
|
558 |
+
var selectedSmall = j('input[name=small]:checked', '#fileupload').val();
|
559 |
+
var selectedThumbnail = j('input[name=thumbnail]:checked', '#fileupload').val();
|
560 |
+
var imagesToGallery = new Array();
|
561 |
+
|
562 |
+
j("input[class='imagesToGallery']:checked").each(function() {
|
563 |
+
imagesToGallery.push(j(this).val());
|
564 |
+
});
|
565 |
+
|
566 |
+
if(productId){
|
567 |
+
if(selectedBase ||
|
568 |
+
selectedSmall ||
|
569 |
+
selectedThumbnail ||
|
570 |
+
imagesToGallery.length > 0
|
571 |
+
){
|
572 |
+
j("#downloadImages").show();
|
573 |
+
j("#downloadImages").html('<img src="<?php echo $jsDir; ?>/statusLoader.gif"/>');
|
574 |
+
switch (templateId) {
|
575 |
+
case '0':
|
576 |
+
putImagesOnProduct(productId);
|
577 |
+
break;
|
578 |
+
default:
|
579 |
+
sendImagesToHanoi();
|
580 |
+
break;
|
581 |
+
}
|
582 |
+
}else{
|
583 |
+
doAlert('No Images','error');
|
584 |
+
}
|
585 |
+
}else{
|
586 |
+
doAlert('Please select product','error');
|
587 |
+
}
|
588 |
+
}
|
589 |
+
|
590 |
+
function sendImagesToHanoi(){
|
591 |
+
var templateId = j('.selectedTemplate').attr('id');
|
592 |
+
|
593 |
+
var now = new Date();
|
594 |
+
var sendTime = now.format("yyyy-mm-dd hh:mm:ss");
|
595 |
+
|
596 |
+
var imagesToHanoi = new Array();
|
597 |
+
|
598 |
+
var uploadedFilesDir = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).$this->getModuleConfig('uploader','uploaded_files_dir'); ?>';
|
599 |
+
|
600 |
+
var selectedBase = j('input[name=base]:checked', '#fileupload').val();
|
601 |
+
var selectedSmall = j('input[name=small]:checked', '#fileupload').val();
|
602 |
+
var selectedThumbnail = j('input[name=thumbnail]:checked', '#fileupload').val();
|
603 |
+
|
604 |
+
if(selectedBase) {
|
605 |
+
var imageUrlBase = uploadedFilesDir + selectedBase;
|
606 |
+
sendImageRTBGIApi(templateId,imageUrlBase,'base',sendTime);
|
607 |
+
}
|
608 |
+
if(selectedSmall) {
|
609 |
+
var imageUrlSmall = uploadedFilesDir + selectedSmall;
|
610 |
+
sendImageRTBGIApi(templateId,imageUrlSmall,'small',sendTime);
|
611 |
+
}
|
612 |
+
if(selectedThumbnail) {
|
613 |
+
var imageUrlThumbnail = uploadedFilesDir + selectedThumbnail;
|
614 |
+
sendImageRTBGIApi(templateId,imageUrlThumbnail,'thumbnail',sendTime);
|
615 |
+
}
|
616 |
+
|
617 |
+
j("input[class='imagesToGallery']:checked").each(function() {
|
618 |
+
var imUrl = uploadedFilesDir + j(this).val();
|
619 |
+
sendImageRTBGIApi(templateId,imUrl,'default',sendTime);
|
620 |
+
});
|
621 |
+
|
622 |
+
doAlert('Images Have Been Sent','confirm');
|
623 |
+
|
624 |
+
j("#productInfo").hide();
|
625 |
+
j("#productInfo").html('');
|
626 |
+
refreshAllRadioAndCheckboxes();
|
627 |
+
j("#downloadImages").hide();
|
628 |
+
}
|
629 |
+
|
630 |
+
function sendImageRTBGIApi(templateId,imageUrl,imageType,sendTime){
|
631 |
+
var productId = j('#productId').html();
|
632 |
+
var product_name = j('#productName').html();
|
633 |
+
var varData = '{"contactEmail": "<?php echo $this->getModuleConfig('api_param','email'); ?>'
|
634 |
+
+ '","contactAPIkey": "<?php echo $this->getModuleConfig('api_param','api_key'); ?>'
|
635 |
+
+ '","developerAPIkey": "<?php echo $this->getModuleConfig('api_param','api_key'); ?>'
|
636 |
+
+ '","templateId": "' + templateId
|
637 |
+
+ '","imageURL": "' + imageUrl
|
638 |
+
+ '","imageURL2": "'
|
639 |
+
+ '","imageURL3": "'
|
640 |
+
+ '","imageURL4": "'
|
641 |
+
+ '","imageURL5": "'
|
642 |
+
+ '","imageURL6": "'
|
643 |
+
+ '","imageRequestedDeliveryTimeInHours": "'
|
644 |
+
+ '","imageCallbackURL": "'
|
645 |
+
+ '"}';
|
646 |
+
|
647 |
+
j.ajax({
|
648 |
+
cache: false,
|
649 |
+
type: "POST", //GET or POST or PUT or DELETE verb
|
650 |
+
url: "/proxy.php?mode=native&url=http://api.removethebackground.com/REST.svc/Image/", // Location of the service
|
651 |
+
data: varData, //Data sent to server
|
652 |
+
contentType: "application/json; charset=utf-8", // content type sent to server
|
653 |
+
dataType: "xml", //Expected data format from server
|
654 |
+
processdata: false, //True or False
|
655 |
+
success: function (xmlResult) {//On Successfull service call
|
656 |
+
var ticket = j(xmlResult).find('ImageTicket').text();
|
657 |
+
saveImageResponse(imageUrl,productId,product_name,ticket,imageType,sendTime);
|
658 |
+
}
|
659 |
+
|
660 |
+
});
|
661 |
+
}
|
662 |
+
|
663 |
+
function saveImageResponse(image_url,product_id,product_name,ticket,image_type,send_time){
|
664 |
+
j.post("<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/saveImageResponse/"); ?>",
|
665 |
+
{ form_key: "<?php echo $formKey; ?>",
|
666 |
+
image_url: image_url,
|
667 |
+
product_id: product_id,
|
668 |
+
product_name: product_name,
|
669 |
+
ticket: ticket,
|
670 |
+
image_type: image_type,
|
671 |
+
send_time: send_time
|
672 |
+
},
|
673 |
+
function (result) {
|
674 |
+
// hothing to do
|
675 |
+
}
|
676 |
+
);
|
677 |
+
}
|
678 |
+
|
679 |
+
<!--Status tab-->
|
680 |
+
|
681 |
+
function showStatuses(){
|
682 |
+
j('#diagram_tab_uploader').removeClass('active');
|
683 |
+
j('#diagram_tab_uploader_content').hide();
|
684 |
+
j('#diagram_tab_settings').removeClass('active');
|
685 |
+
j('#diagram_tab_settings_content').hide();
|
686 |
+
|
687 |
+
j('#diagram_tab_status').addClass('active');
|
688 |
+
j('#diagram_tab_status_content').show();
|
689 |
+
|
690 |
+
getImagesList();
|
691 |
+
}
|
692 |
+
|
693 |
+
function showUploader(){
|
694 |
+
// j('#diagram_tab_status').removeClass('active');
|
695 |
+
// j('#diagram_tab_status_content').hide();
|
696 |
+
// j('#diagram_tab_uploader').addClass('active');
|
697 |
+
// j('#diagram_tab_uploader_content').show();
|
698 |
+
window.location.reload();
|
699 |
+
}
|
700 |
+
function showSettings(){
|
701 |
+
j('#diagram_tab_uploader').removeClass('active');
|
702 |
+
j('#diagram_tab_status').removeClass('active');
|
703 |
+
j('#diagram_tab_uploader_content').hide();
|
704 |
+
j('#diagram_tab_status_content').hide();
|
705 |
+
|
706 |
+
j('#diagram_tab_settings').addClass('active');
|
707 |
+
j('#diagram_tab_settings_content').show();
|
708 |
+
}
|
709 |
+
|
710 |
+
function getImagesList(){
|
711 |
+
j.ajax({
|
712 |
+
cache: false,
|
713 |
+
type: "GET", //GET or POST or PUT or DELETE verb
|
714 |
+
url: "<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/getImagesList/"); ?>", // Location of the service
|
715 |
+
contentType: "application/json; charset=utf-8", // content type sent to server
|
716 |
+
dataType: "xml", //Expected data format from server
|
717 |
+
processdata: false, //True or False
|
718 |
+
beforeSend: function(html)
|
719 |
+
{
|
720 |
+
j("#diagram_tab_status").removeAttr('onclick');
|
721 |
+
j("#downloadStatus").show();
|
722 |
+
j("#diagram_tab_status_content_head").hide();
|
723 |
+
j("#diagram_tab_status_content_body").html('');
|
724 |
+
j("#downloadStatus").html('<img src="<?php echo $jsDir; ?>/statusLoader.gif"/>');
|
725 |
+
},
|
726 |
+
success: function (xmlResult) {//On Successfull service call
|
727 |
+
j("#downloadStatus").hide();
|
728 |
+
j("#diagram_tab_status").attr('onclick','showStatuses(); return false;');
|
729 |
+
j(xmlResult).find('new_line').each(function(){
|
730 |
+
refreshStatuses(this);
|
731 |
+
});
|
732 |
+
}
|
733 |
+
});
|
734 |
+
}
|
735 |
+
|
736 |
+
function refreshStatuses(xml){
|
737 |
+
var imageupload_id = j(xml).find('imageupload_id').text();
|
738 |
+
var image_url = j(xml).find('image_url').text();
|
739 |
+
var product_id = j(xml).find('product_id').text();
|
740 |
+
var product_name = j(xml).find('product_name').text();
|
741 |
+
var ticket = j(xml).find('ticket').text();
|
742 |
+
var image_type = j(xml).find('image_type').text();
|
743 |
+
var send_time = j(xml).find('send_time').text();
|
744 |
+
|
745 |
+
var contactEmail = '<?php echo($this->getModuleConfig('api_param','email')); ?>';
|
746 |
+
var contactAPIkey = '<?php echo($this->getModuleConfig('api_param','api_key')); ?>';
|
747 |
+
|
748 |
+
var imageNameArray = new Array();
|
749 |
+
|
750 |
+
imageNameArray = image_url.split('/');
|
751 |
+
var imageName = imageNameArray[imageNameArray.length-1];
|
752 |
+
var urlWithoutName = image_url.substr(0,image_url.length-imageName.length);
|
753 |
+
var imageThumbNailUrl = urlWithoutName+ '<?php echo($this->getModuleConfig('uploader','uploaded_thumbnail_dir_name')); ?>' +imageName;
|
754 |
+
|
755 |
+
var imageWidth = '<?php echo($this->getModuleConfig('design','preview_width')); ?>';
|
756 |
+
|
757 |
+
var proxy = '/proxy.php?mode=native&url=http://api.removethebackground.com/REST.svc/Image/'+ticket+'/?contactEmail=' +contactEmail+ '%26contactAPIkey=' +contactAPIkey;
|
758 |
+
|
759 |
+
j.get(proxy,
|
760 |
+
function (xmlResult) {
|
761 |
+
var status = j(xmlResult).find('StatusName').text();
|
762 |
+
var link = j(xmlResult).find('FinalImageURL').text();
|
763 |
+
var contentToAdd = '';
|
764 |
+
|
765 |
+
|
766 |
+
if(status == 'Production finished'){
|
767 |
+
contentToAdd = '<tr onmouseover="RowColored(this)" onmouseout="RowUnColored(this)" id=\"'+link+'\">'+
|
768 |
+
'<td class="align_center_middle"><input type="checkbox" onmouseout="hidePriview(this);" onmouseover="showPriview(this);" id=\"'+product_id+'\" class="imagesToProduct" name=\"'+image_type+'\" value=\"'+link+'\"></td>'+
|
769 |
+
'<td class="align_center_middle">'+imageupload_id+'</td>'+
|
770 |
+
'<td class="align_center_middle"><img src=\'' +link+ '\' width=\'' +imageWidth+ '\' /></td>'+
|
771 |
+
'<td class="align_center_middle"><img src=\'' +imageThumbNailUrl+ '\' width=\'' +imageWidth+ '\' /></td>'+
|
772 |
+
'<td class="align_center_middle">'+product_name+'</td>'+
|
773 |
+
'<td class="align_center_middle">'+image_type+'</td>'+
|
774 |
+
'<td class="align_center_middle">'+send_time+'</td>'+
|
775 |
+
'<td class="align_center_middle true">'+status+'</td>'+
|
776 |
+
'<td class="align_center_middle"><a href=\"' +link+ '\">download</a></td>'+
|
777 |
+
'</tr>';
|
778 |
+
}else{
|
779 |
+
contentToAdd = '<tr onmouseover="RowColored(this)" onmouseout="RowUnColored(this)">'+
|
780 |
+
'<td class="align_center_middle"></td>'+
|
781 |
+
'<td class="align_center_middle">'+imageupload_id+'</td>'+
|
782 |
+
'<td class="align_center_middle false">not ready</td>'+
|
783 |
+
'<td class="align_center_middle"><a><img src=\'' +imageThumbNailUrl+ '\' width=\'' +imageWidth+ '\' /></a></td>'+
|
784 |
+
'<td class="align_center_middle">'+product_name+'</td>'+
|
785 |
+
'<td class="align_center_middle">'+image_type+'</td>'+
|
786 |
+
'<td class="align_center_middle">'+send_time+'</td>'+
|
787 |
+
'<td class="align_center_middle false">'+status+'</td>'+
|
788 |
+
'<td class="align_center_middle false">not ready</td>'+
|
789 |
+
'</tr>';
|
790 |
+
}
|
791 |
+
|
792 |
+
j("#diagram_tab_status_content_head").show();
|
793 |
+
j('#diagram_tab_status_content_body').append(contentToAdd);
|
794 |
+
});
|
795 |
+
}
|
796 |
+
|
797 |
+
|
798 |
+
function showPriview(checkbox){
|
799 |
+
var val = j(checkbox).val();
|
800 |
+
j(checkbox).parent('td').append('<div id="imagePrewiew"></div>');
|
801 |
+
j('#imagePrewiew').html('<img width="420px" src=\"' +val+ '\"/>');
|
802 |
+
j('#imagePrewiew').show();
|
803 |
+
}
|
804 |
+
|
805 |
+
function hidePriview(checkbox){
|
806 |
+
j('#imagePrewiew').remove();
|
807 |
+
}
|
808 |
+
|
809 |
+
function putImagesOnProductFromStatusPage(){
|
810 |
+
j("input[class='imagesToProduct']:checked").each(function() {
|
811 |
+
var imageUrl = j(this).val();
|
812 |
+
var productId = j(this).attr('id');
|
813 |
+
var imageType = j(this).attr('name');
|
814 |
+
|
815 |
+
var dataString = 'form_key=<?php echo $putImagesOnProductFormKey; ?>&productId=' +productId+ '&imageType=' +imageType+ '&imageUrl='+imageUrl ;
|
816 |
+
|
817 |
+
j.ajax({
|
818 |
+
type: "POST",
|
819 |
+
url: "<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/putImagesOnProductFromStatusPage/"); ?>",
|
820 |
+
data: dataString,
|
821 |
+
cache: false,
|
822 |
+
beforeSend: function(html)
|
823 |
+
{
|
824 |
+
j("#downloadStatus").show();
|
825 |
+
j("#downloadStatus").html('<img src="<?php echo $jsDir; ?>/statusLoader.gif"/>');
|
826 |
+
},
|
827 |
+
success: function(html){
|
828 |
+
j("#downloadStatus").hide();
|
829 |
+
// alert(html);
|
830 |
+
getImagesList();
|
831 |
+
}
|
832 |
+
});
|
833 |
+
});
|
834 |
+
}
|
835 |
+
|
836 |
+
function RowColored(node){
|
837 |
+
var allTD = node.getElementsByTagName('td');
|
838 |
+
for(i=0; i<allTD.length; i++) {
|
839 |
+
allTD[i].style.backgroundColor = '#E7EFEF';
|
840 |
+
}
|
841 |
+
}
|
842 |
+
|
843 |
+
function RowUnColored(node){
|
844 |
+
var allTD = node.getElementsByTagName('td');
|
845 |
+
for(i=0; i<allTD.length; i++) {
|
846 |
+
allTD[i].style.backgroundColor = '#fff';
|
847 |
+
}
|
848 |
+
}
|
849 |
+
|
850 |
+
<!--Settings tab-->
|
851 |
+
|
852 |
+
function changeAPISettings(){
|
853 |
+
|
854 |
+
var api_key = j('#api_key').val();
|
855 |
+
var api_email = j('#api_email').val();
|
856 |
+
var preview_width = j('#preview_width').val();
|
857 |
+
var max_items_for_search_result = j('#max_items_for_search_result').val();
|
858 |
+
|
859 |
+
var dataString = 'api_key='+ api_key + '&api_email=' + api_email + '&preview_width=' + preview_width + '&max_items_for_search_result=' + max_items_for_search_result;
|
860 |
+
|
861 |
+
j.ajax({
|
862 |
+
type: "GET",
|
863 |
+
url: "<?php echo Mage::helper("adminhtml")->getUrl("adminhtml/imageupload/changeSettings/"); ?>",
|
864 |
+
data: dataString,
|
865 |
+
cache: false,
|
866 |
+
success: function(html){
|
867 |
+
window.location.reload();
|
868 |
+
}
|
869 |
+
});
|
870 |
+
}
|
871 |
+
|
872 |
+
|
873 |
+
</script>
|
app/etc/modules/Wexo_Imageupload.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Wexo_Imageupload>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>local</codePool>
|
7 |
+
</Wexo_Imageupload>
|
8 |
+
</modules>
|
9 |
+
</config>
|
js/wexo_imageupload/ajaxSearch/ajax-loader.gif
ADDED
Binary file
|
js/wexo_imageupload/ajaxSearch/ajaxSearch.js
ADDED
@@ -0,0 +1,129 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
j.fn.liveSearch = function (conf) {
|
2 |
+
var config = j.extend({
|
3 |
+
url: 'http://magentodev.dev.wexo.dk/index.php/admin/imageupload/searchProduct?q=',
|
4 |
+
id: 'j-live-search',
|
5 |
+
duration: 400,
|
6 |
+
typeDelay: 200,
|
7 |
+
loadingClass: 'loading',
|
8 |
+
onSlideUp: function () {},
|
9 |
+
uptadePosition: false
|
10 |
+
}, conf);
|
11 |
+
|
12 |
+
var liveSearch = j('#' + config.id);
|
13 |
+
|
14 |
+
// Create live-search if it doesn't exist
|
15 |
+
if (!liveSearch.length) {
|
16 |
+
liveSearch = j('<div id="' + config.id + '"></div>')
|
17 |
+
.appendTo(document.body)
|
18 |
+
.hide()
|
19 |
+
.slideUp(0);
|
20 |
+
|
21 |
+
// Close live-search when clicking outside it
|
22 |
+
j(document.body).click(function(event) {
|
23 |
+
var clicked = j(event.target);
|
24 |
+
|
25 |
+
if (!(clicked.is('#' + config.id) || clicked.parents('#' + config.id).length || clicked.is('input'))) {
|
26 |
+
liveSearch.slideUp(config.duration, function () {
|
27 |
+
config.onSlideUp();
|
28 |
+
});
|
29 |
+
}
|
30 |
+
});
|
31 |
+
}
|
32 |
+
|
33 |
+
return this.each(function () {
|
34 |
+
var input = j(this).attr('autocomplete', 'off');
|
35 |
+
var liveSearchPaddingBorderHoriz = parseInt(liveSearch.css('paddingLeft'), 10) + parseInt(liveSearch.css('paddingRight'), 10) + parseInt(liveSearch.css('borderLeftWidth'), 10) + parseInt(liveSearch.css('borderRightWidth'), 10);
|
36 |
+
|
37 |
+
// Re calculates live search's position
|
38 |
+
var repositionLiveSearch = function () {
|
39 |
+
var tmpOffset = input.offset();
|
40 |
+
var inputDim = {
|
41 |
+
left: tmpOffset.left,
|
42 |
+
top: tmpOffset.top,
|
43 |
+
width: input.outerWidth(),
|
44 |
+
height: input.outerHeight()
|
45 |
+
};
|
46 |
+
|
47 |
+
inputDim.topPos = inputDim.top + inputDim.height;
|
48 |
+
inputDim.totalWidth = inputDim.width - liveSearchPaddingBorderHoriz;
|
49 |
+
|
50 |
+
liveSearch.css({
|
51 |
+
position: 'absolute',
|
52 |
+
left: inputDim.left + 'px',
|
53 |
+
top: inputDim.topPos + 'px',
|
54 |
+
width: inputDim.totalWidth + 'px'
|
55 |
+
});
|
56 |
+
};
|
57 |
+
|
58 |
+
// Shows live-search for this input
|
59 |
+
var showLiveSearch = function () {
|
60 |
+
// Always reposition the live-search every time it is shown
|
61 |
+
// in case user has resized browser-window or zoomed in or whatever
|
62 |
+
repositionLiveSearch();
|
63 |
+
|
64 |
+
// We need to bind a resize-event every time live search is shown
|
65 |
+
// so it resizes based on the correct input element
|
66 |
+
$(window).unbind('resize', repositionLiveSearch);
|
67 |
+
$(window).bind('resize', repositionLiveSearch);
|
68 |
+
|
69 |
+
liveSearch.slideDown(config.duration);
|
70 |
+
};
|
71 |
+
|
72 |
+
// Hides live-search for this input
|
73 |
+
var hideLiveSearch = function () {
|
74 |
+
liveSearch.slideUp(config.duration, function () {
|
75 |
+
config.onSlideUp();
|
76 |
+
});
|
77 |
+
};
|
78 |
+
|
79 |
+
input
|
80 |
+
// On focus, if the live-search is empty, perform an new search
|
81 |
+
// If not, just slide it down. Only do this if there's something in the input
|
82 |
+
.focus(function () {
|
83 |
+
if (this.value !== '') {
|
84 |
+
// Perform a new search if there are no search results
|
85 |
+
if (liveSearch.html() == '') {
|
86 |
+
this.lastValue = '';
|
87 |
+
input.keyup();
|
88 |
+
}
|
89 |
+
// If there are search results show live search
|
90 |
+
else {
|
91 |
+
// HACK: In case search field changes width onfocus
|
92 |
+
setTimeout(showLiveSearch, 1);
|
93 |
+
}
|
94 |
+
}
|
95 |
+
})
|
96 |
+
// Auto update live-search onkeyup
|
97 |
+
.keyup(function () {
|
98 |
+
// Don't update live-search if it's got the same value as last time
|
99 |
+
if (this.value != this.lastValue) {
|
100 |
+
input.addClass(config.loadingClass);
|
101 |
+
|
102 |
+
var q = this.value;
|
103 |
+
|
104 |
+
// Stop previous ajax-request
|
105 |
+
if (this.timer) {
|
106 |
+
clearTimeout(this.timer);
|
107 |
+
}
|
108 |
+
|
109 |
+
// Start a new ajax-request in X ms
|
110 |
+
this.timer = setTimeout(function () {
|
111 |
+
j.get(config.url + q, function (data) {
|
112 |
+
input.removeClass(config.loadingClass);
|
113 |
+
|
114 |
+
// Show live-search if results and search-term aren't empty
|
115 |
+
if (data.length && q.length) {
|
116 |
+
liveSearch.html(data);
|
117 |
+
showLiveSearch();
|
118 |
+
}
|
119 |
+
else {
|
120 |
+
hideLiveSearch();
|
121 |
+
}
|
122 |
+
});
|
123 |
+
}, config.typeDelay);
|
124 |
+
|
125 |
+
this.lastValue = this.value;
|
126 |
+
}
|
127 |
+
});
|
128 |
+
});
|
129 |
+
};
|
js/wexo_imageupload/cors/jquery.postmessage-transport.js
ADDED
@@ -0,0 +1,117 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery postMessage Transport Plugin 1.1
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2011, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint unparam: true, nomen: true */
|
13 |
+
/*global define, window, document */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define(['jquery'], factory);
|
20 |
+
} else {
|
21 |
+
// Browser globals:
|
22 |
+
factory(window.jQuery);
|
23 |
+
}
|
24 |
+
}(function ($) {
|
25 |
+
'use strict';
|
26 |
+
|
27 |
+
var counter = 0,
|
28 |
+
names = [
|
29 |
+
'accepts',
|
30 |
+
'cache',
|
31 |
+
'contents',
|
32 |
+
'contentType',
|
33 |
+
'crossDomain',
|
34 |
+
'data',
|
35 |
+
'dataType',
|
36 |
+
'headers',
|
37 |
+
'ifModified',
|
38 |
+
'mimeType',
|
39 |
+
'password',
|
40 |
+
'processData',
|
41 |
+
'timeout',
|
42 |
+
'traditional',
|
43 |
+
'type',
|
44 |
+
'url',
|
45 |
+
'username'
|
46 |
+
],
|
47 |
+
convert = function (p) {
|
48 |
+
return p;
|
49 |
+
};
|
50 |
+
|
51 |
+
$.ajaxSetup({
|
52 |
+
converters: {
|
53 |
+
'postmessage text': convert,
|
54 |
+
'postmessage json': convert,
|
55 |
+
'postmessage html': convert
|
56 |
+
}
|
57 |
+
});
|
58 |
+
|
59 |
+
$.ajaxTransport('postmessage', function (options) {
|
60 |
+
if (options.postMessage && window.postMessage) {
|
61 |
+
var iframe,
|
62 |
+
loc = $('<a>').prop('href', options.postMessage)[0],
|
63 |
+
target = loc.protocol + '//' + loc.host,
|
64 |
+
xhrUpload = options.xhr().upload;
|
65 |
+
return {
|
66 |
+
send: function (_, completeCallback) {
|
67 |
+
var message = {
|
68 |
+
id: 'postmessage-transport-' + (counter += 1)
|
69 |
+
},
|
70 |
+
eventName = 'message.' + message.id;
|
71 |
+
iframe = $(
|
72 |
+
'<iframe style="display:none;" src="' +
|
73 |
+
options.postMessage + '" name="' +
|
74 |
+
message.id + '"></iframe>'
|
75 |
+
).bind('load', function () {
|
76 |
+
$.each(names, function (i, name) {
|
77 |
+
message[name] = options[name];
|
78 |
+
});
|
79 |
+
message.dataType = message.dataType.replace('postmessage ', '');
|
80 |
+
$(window).bind(eventName, function (e) {
|
81 |
+
e = e.originalEvent;
|
82 |
+
var data = e.data,
|
83 |
+
ev;
|
84 |
+
if (e.origin === target && data.id === message.id) {
|
85 |
+
if (data.type === 'progress') {
|
86 |
+
ev = document.createEvent('Event');
|
87 |
+
ev.initEvent(data.type, false, true);
|
88 |
+
$.extend(ev, data);
|
89 |
+
xhrUpload.dispatchEvent(ev);
|
90 |
+
} else {
|
91 |
+
completeCallback(
|
92 |
+
data.status,
|
93 |
+
data.statusText,
|
94 |
+
{postmessage: data.result},
|
95 |
+
data.headers
|
96 |
+
);
|
97 |
+
iframe.remove();
|
98 |
+
$(window).unbind(eventName);
|
99 |
+
}
|
100 |
+
}
|
101 |
+
});
|
102 |
+
iframe[0].contentWindow.postMessage(
|
103 |
+
message,
|
104 |
+
target
|
105 |
+
);
|
106 |
+
}).appendTo(document.body);
|
107 |
+
},
|
108 |
+
abort: function () {
|
109 |
+
if (iframe) {
|
110 |
+
iframe.remove();
|
111 |
+
}
|
112 |
+
}
|
113 |
+
};
|
114 |
+
}
|
115 |
+
});
|
116 |
+
|
117 |
+
}));
|
js/wexo_imageupload/cors/jquery.xdr-transport.js
ADDED
@@ -0,0 +1,85 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery XDomainRequest Transport Plugin 1.1.1
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2011, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*
|
11 |
+
* Based on Julian Aubourg's ajaxHooks xdr.js:
|
12 |
+
* https://github.com/jaubourg/ajaxHooks/
|
13 |
+
*/
|
14 |
+
|
15 |
+
/*jslint unparam: true */
|
16 |
+
/*global define, window, XDomainRequest */
|
17 |
+
|
18 |
+
(function (factory) {
|
19 |
+
'use strict';
|
20 |
+
if (typeof define === 'function' && define.amd) {
|
21 |
+
// Register as an anonymous AMD module:
|
22 |
+
define(['jquery'], factory);
|
23 |
+
} else {
|
24 |
+
// Browser globals:
|
25 |
+
factory(window.jQuery);
|
26 |
+
}
|
27 |
+
}(function ($) {
|
28 |
+
'use strict';
|
29 |
+
if (window.XDomainRequest && $.ajaxSettings.xhr().withCredentials === undefined) {
|
30 |
+
$.ajaxTransport(function (s) {
|
31 |
+
if (s.crossDomain && s.async) {
|
32 |
+
if (s.timeout) {
|
33 |
+
s.xdrTimeout = s.timeout;
|
34 |
+
delete s.timeout;
|
35 |
+
}
|
36 |
+
var xdr;
|
37 |
+
return {
|
38 |
+
send: function (headers, completeCallback) {
|
39 |
+
function callback(status, statusText, responses, responseHeaders) {
|
40 |
+
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
|
41 |
+
xdr = null;
|
42 |
+
completeCallback(status, statusText, responses, responseHeaders);
|
43 |
+
}
|
44 |
+
xdr = new XDomainRequest();
|
45 |
+
// XDomainRequest only supports GET and POST:
|
46 |
+
if (s.type === 'DELETE') {
|
47 |
+
s.url = s.url + (/\?/.test(s.url) ? '&' : '?') +
|
48 |
+
'_method=DELETE';
|
49 |
+
s.type = 'POST';
|
50 |
+
} else if (s.type === 'PUT') {
|
51 |
+
s.url = s.url + (/\?/.test(s.url) ? '&' : '?') +
|
52 |
+
'_method=PUT';
|
53 |
+
s.type = 'POST';
|
54 |
+
}
|
55 |
+
xdr.open(s.type, s.url);
|
56 |
+
xdr.onload = function () {
|
57 |
+
callback(
|
58 |
+
200,
|
59 |
+
'OK',
|
60 |
+
{text: xdr.responseText},
|
61 |
+
'Content-Type: ' + xdr.contentType
|
62 |
+
);
|
63 |
+
};
|
64 |
+
xdr.onerror = function () {
|
65 |
+
callback(404, 'Not Found');
|
66 |
+
};
|
67 |
+
if (s.xdrTimeout) {
|
68 |
+
xdr.ontimeout = function () {
|
69 |
+
callback(0, 'timeout');
|
70 |
+
};
|
71 |
+
xdr.timeout = s.xdrTimeout;
|
72 |
+
}
|
73 |
+
xdr.send((s.hasContent && s.data) || null);
|
74 |
+
},
|
75 |
+
abort: function () {
|
76 |
+
if (xdr) {
|
77 |
+
xdr.onerror = $.noop();
|
78 |
+
xdr.abort();
|
79 |
+
}
|
80 |
+
}
|
81 |
+
};
|
82 |
+
}
|
83 |
+
});
|
84 |
+
}
|
85 |
+
}));
|
js/wexo_imageupload/date/dateFormat.js
ADDED
@@ -0,0 +1,125 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* Date Format 1.2.3
|
3 |
+
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
4 |
+
* MIT license
|
5 |
+
*
|
6 |
+
* Includes enhancements by Scott Trenda <scott.trenda.net>
|
7 |
+
* and Kris Kowal <cixar.com/~kris.kowal/>
|
8 |
+
*
|
9 |
+
* Accepts a date, a mask, or a date and a mask.
|
10 |
+
* Returns a formatted version of the given date.
|
11 |
+
* The date defaults to the current date/time.
|
12 |
+
* The mask defaults to dateFormat.masks.default.
|
13 |
+
*/
|
14 |
+
|
15 |
+
var dateFormat = function () {
|
16 |
+
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
|
17 |
+
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
18 |
+
timezoneClip = /[^-+\dA-Z]/g,
|
19 |
+
pad = function (val, len) {
|
20 |
+
val = String(val);
|
21 |
+
len = len || 2;
|
22 |
+
while (val.length < len) val = "0" + val;
|
23 |
+
return val;
|
24 |
+
};
|
25 |
+
|
26 |
+
// Regexes and supporting functions are cached through closure
|
27 |
+
return function (date, mask, utc) {
|
28 |
+
var dF = dateFormat;
|
29 |
+
|
30 |
+
// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
|
31 |
+
if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
|
32 |
+
mask = date;
|
33 |
+
date = undefined;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Passing date through Date applies Date.parse, if necessary
|
37 |
+
date = date ? new Date(date) : new Date;
|
38 |
+
if (isNaN(date)) throw SyntaxError("invalid date");
|
39 |
+
|
40 |
+
mask = String(dF.masks[mask] || mask || dF.masks["default"]);
|
41 |
+
|
42 |
+
// Allow setting the utc argument via the mask
|
43 |
+
if (mask.slice(0, 4) == "UTC:") {
|
44 |
+
mask = mask.slice(4);
|
45 |
+
utc = true;
|
46 |
+
}
|
47 |
+
|
48 |
+
var _ = utc ? "getUTC" : "get",
|
49 |
+
d = date[_ + "Date"](),
|
50 |
+
D = date[_ + "Day"](),
|
51 |
+
m = date[_ + "Month"](),
|
52 |
+
y = date[_ + "FullYear"](),
|
53 |
+
H = date[_ + "Hours"](),
|
54 |
+
M = date[_ + "Minutes"](),
|
55 |
+
s = date[_ + "Seconds"](),
|
56 |
+
L = date[_ + "Milliseconds"](),
|
57 |
+
o = utc ? 0 : date.getTimezoneOffset(),
|
58 |
+
flags = {
|
59 |
+
d: d,
|
60 |
+
dd: pad(d),
|
61 |
+
ddd: dF.i18n.dayNames[D],
|
62 |
+
dddd: dF.i18n.dayNames[D + 7],
|
63 |
+
m: m + 1,
|
64 |
+
mm: pad(m + 1),
|
65 |
+
mmm: dF.i18n.monthNames[m],
|
66 |
+
mmmm: dF.i18n.monthNames[m + 12],
|
67 |
+
yy: String(y).slice(2),
|
68 |
+
yyyy: y,
|
69 |
+
h: H % 12 || 12,
|
70 |
+
hh: pad(H % 12 || 12),
|
71 |
+
H: H,
|
72 |
+
HH: pad(H),
|
73 |
+
M: M,
|
74 |
+
MM: pad(M),
|
75 |
+
s: s,
|
76 |
+
ss: pad(s),
|
77 |
+
l: pad(L, 3),
|
78 |
+
L: pad(L > 99 ? Math.round(L / 10) : L),
|
79 |
+
t: H < 12 ? "a" : "p",
|
80 |
+
tt: H < 12 ? "am" : "pm",
|
81 |
+
T: H < 12 ? "A" : "P",
|
82 |
+
TT: H < 12 ? "AM" : "PM",
|
83 |
+
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
84 |
+
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
|
85 |
+
S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
|
86 |
+
};
|
87 |
+
|
88 |
+
return mask.replace(token, function ($0) {
|
89 |
+
return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
|
90 |
+
});
|
91 |
+
};
|
92 |
+
}();
|
93 |
+
|
94 |
+
// Some common format strings
|
95 |
+
dateFormat.masks = {
|
96 |
+
"default": "ddd mmm dd yyyy HH:MM:ss",
|
97 |
+
shortDate: "m/d/yy",
|
98 |
+
mediumDate: "mmm d, yyyy",
|
99 |
+
longDate: "mmmm d, yyyy",
|
100 |
+
fullDate: "dddd, mmmm d, yyyy",
|
101 |
+
shortTime: "h:MM TT",
|
102 |
+
mediumTime: "h:MM:ss TT",
|
103 |
+
longTime: "h:MM:ss TT Z",
|
104 |
+
isoDate: "yyyy-mm-dd",
|
105 |
+
isoTime: "HH:MM:ss",
|
106 |
+
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
|
107 |
+
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
|
108 |
+
};
|
109 |
+
|
110 |
+
// Internationalization strings
|
111 |
+
dateFormat.i18n = {
|
112 |
+
dayNames: [
|
113 |
+
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
|
114 |
+
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
115 |
+
],
|
116 |
+
monthNames: [
|
117 |
+
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
118 |
+
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
119 |
+
]
|
120 |
+
};
|
121 |
+
|
122 |
+
// For convenience...
|
123 |
+
Date.prototype.format = function (mask, utc) {
|
124 |
+
return dateFormat(this, mask, utc);
|
125 |
+
};
|
js/wexo_imageupload/from_site/bootstrap-image-gallery.min.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
(function(a){"use strict",typeof define=="function"&&define.amd?define(["jquery","./load-image.js","bootstrap"],a):a(window.jQuery,window.loadImage)})(function(a,b){"use strict",a.extend(a.fn.modal.defaults,{delegate:document,selector:null,index:0,href:null,preloadRange:2,offsetWidth:100,offsetHeight:200,canvas:!1,slideshow:0});var c=a.fn.modal.Constructor.prototype.show,d=a.fn.modal.Constructor.prototype.hide;a.extend(a.fn.modal.Constructor.prototype,{initLinks:function(){var b=this,c=this.options,d=c.selector||"a[data-target="+c.target+"]",e=0;a(c.delegate).find(d).each(function(d,f){var g=f.href||a(f).data("href");b.urls[b.urls.length-1]!==g&&(b.urls.push(g),b.titles.push(f.title),g===c.href&&(c.index=e),e+=1)}),this.urls[c.index]||(c.index=0)},startSlideShow:function(){var a=this;this.options.slideshow&&(this._slideShow=window.setTimeout(function(){a.next()},this.options.slideshow))},stopSlideShow:function(){window.clearTimeout(this._slideShow)},toggleSlideShow:function(){var a=this.$element.find(".modal-slideshow");this.options.slideshow?(this.options.slideshow=0,this.stopSlideShow()):(this.options.slideshow=a.data("slideshow")||5e3,this.startSlideShow()),a.find("i").toggleClass("icon-play icon-pause")},preloadImages:function(){var b=this.options,c=b.index+b.preloadRange+1,d,e;for(e=b.index-b.preloadRange;e<c;e+=1)d=this.urls[e],d&&e!==b.index&&a("<img>").prop("src",d)},loadImage:function(){var a=this,c=this.$element,d=this.options.index,e;this.abortLoad(),this.stopSlideShow(),this._loadingTimeout=window.setTimeout(function(){c.addClass("modal-loading")},100),e=c.find(".modal-image").children().removeClass("in"),window.setTimeout(function(){e.remove()},3e3),c.find(".modal-title").text(this.titles[d]),c.find(".modal-download").prop("href",this.urls[d]),this.loadingImage=b(this.urls[d],function(b){window.clearTimeout(a._loadingTimeout),c.removeClass("modal-loading"),a.showImage(b),a.startSlideShow()},a.loadImageOptions),this.preloadImages()},showImage:function(b){var c=this.$element,d=a.support.transition&&c.hasClass("fade"),e=d?c.animate:c.css,f=c.find(".modal-image"),g,h;f.css({width:b.width,height:b.height}),a(window).width()>480&&(d&&(g=c.clone().hide().appendTo(document.body)),e.call(c.stop(),{"margin-top":-((g||c).outerHeight()/2),"margin-left":-((g||c).outerWidth()/2)}),g&&g.remove()),f.append(b),h=b.offsetWidth,a(b).addClass("in")},abortLoad:function(){this.loadingImage&&(this.loadingImage.onload=this.loadingImage.onerror=null),window.clearTimeout(this._loadingTimeout)},prev:function(){var a=this.options;a.index-=1,a.index<0&&(a.index=this.urls.length-1),this.loadImage()},next:function(){var a=this.options;a.index+=1,a.index>this.urls.length-1&&(a.index=0),this.loadImage()},keyHandler:function(a){switch(a.which){case 37:case 38:a.preventDefault(),this.prev();break;case 39:case 40:a.preventDefault(),this.next()}},wheelHandler:function(a){a.preventDefault(),a=a.originalEvent,this._wheelCounter=this._wheelCounter||0,this._wheelCounter+=a.wheelDelta||a.detail||0;if(a.wheelDelta&&this._wheelCounter>=120||!a.wheelDelta&&this._wheelCounter<0)this.prev(),this._wheelCounter=0;else if(a.wheelDelta&&this._wheelCounter<=-120||!a.wheelDelta&&this._wheelCounter>0)this.next(),this._wheelCounter=0},initGalleryEvents:function(){var b=this,c=this.$element;c.find(".modal-image").on("click.modal-gallery",function(a){a.altKey?b.prev(a):b.next(a)}),c.find(".modal-prev").on("click.modal-gallery",function(a){b.prev(a)}),c.find(".modal-next").on("click.modal-gallery",function(a){b.next(a)}),c.find(".modal-slideshow").on("click.modal-gallery",function(a){b.toggleSlideShow(a)}),a(document).on("keydown.modal-gallery",function(a){b.keyHandler(a)}).on("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery",function(a){b.wheelHandler(a)})},destroyGalleryEvents:function(){var b=this.$element;this.abortLoad(),this.stopSlideShow(),b.find(".modal-image, .modal-prev, .modal-next, .modal-slideshow").off("click.modal-gallery"),a(document).off("keydown.modal-gallery").off("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery")},show:function(){if(!this.isShown&&this.$element.hasClass("modal-gallery")){var b=this.$element,d=this.options,e=a(window).width(),f=a(window).height();this.urls=[],this.titles=[],b.hasClass("modal-fullscreen")?this.loadImageOptions={minWidth:e,minHeight:f,maxWidth:e,maxHeight:f,canvas:d.canvas}:this.loadImageOptions={maxWidth:e-d.offsetWidth,maxHeight:f-d.offsetHeight,canvas:d.canvas},e>480&&b.css({"margin-top":-(b.outerHeight()/2),"margin-left":-(b.outerWidth()/2)}),this.initGalleryEvents(),this.initLinks(),this.urls.length&&this.loadImage()}c.apply(this,arguments)},hide:function(){this.isShown&&this.$element.hasClass("modal-gallery")&&(this.options.delegate=document,this.options.href=null,this.destroyGalleryEvents()),d.apply(this,arguments)}}),a(function(){a(document.body).on("click.modal-gallery.data-api",'[data-toggle="modal-gallery"]',function(b){var c=a(this),d=c.data(),e=a(d.target),f=e.data("modal"),g;f||(d=a.extend(e.data(),d)),d.selector||(d.selector="a[rel=gallery]"),g=a(b.target).closest(d.selector),g.length&&e.length&&(b.preventDefault(),d.href=g.prop("href")||g.data("href"),d.delegate=g[0]!==this?this:document,f&&a.extend(f.options,d),e.modal(d))})})});
|
js/wexo_imageupload/from_site/bootstrap.min.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=a.extend({},a.fn.modal.defaults,c),this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this;if(this.isShown)return;a("body").addClass("modal-open"),this.isShown=!0,this.$element.trigger("show"),g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");!b.$element.parent().length&&b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();if(!this.isShown)return;var e=this;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.trigger("hide").removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=typeof c=="object"&&c;e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.show?c.show():(c.hoverState="in",setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show))},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.hide?c.hide():(c.hoverState="out",setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide))},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip();a.find(".tooltip-inner").html(this.getTitle()),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,delay:0,selector:!1,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var b=this.tip(),c=this.getTitle(),d=this.getContent();b.find(".popover-title")[a.type(c)=="object"?"append":"html"](c),b.find(".popover-content > *")[a.type(d)=="object"?"append":"html"](d),b.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body").on("click.scroll.data-api",this.selector,d),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var b=a(this).attr("href");return/^#\w/.test(b)&&a(b).length?b:null}),this.offsets=a.map(this.targets,function(b){return a(b).position().top})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.offsets,c=this.targets,d=this.activeTarget,e;for(e=b.length;e--;)d!=c[e]&&a>=b[e]&&(!b[e+1]||a<=b[e+1])&&this.activate(c[e])},activate:function(a){var b;this.activeTarget=a,this.$body.find(this.selector).parent(".active").removeClass("active"),b=this.$body.find(this.selector+'[href="'+a+'"]').parent("li").addClass("active"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],b.trigger({type:"show",relatedTarget:e}),f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(a),this.hide()},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){if(c.matcher(a))return a}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){return a.replace(new RegExp("("+this.query+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){a.stopPropagation(),a.preventDefault();switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:this.hide();break;default:this.lookup()}},keypress:function(a){a.stopPropagation();if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}},blur:function(a){var b=this;a.stopPropagation(),a.preventDefault(),setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery);
|
js/wexo_imageupload/from_site/canvas-to-blob.min.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
(function(a){"use strict";var b=window.MozBlobBuilder||window.WebKitBlobBuilder||window.BlobBuilder,c=/^image\/(jpeg|png)$/,d=function(a,e,f){f=f||{};if(a.toBlob)return a.toBlob(e,f.type),!0;if(a.mozGetAsFile){var g=f.name;return e(a.mozGetAsFile(c.test(f.type)&&g||(g&&g.replace(/\..+$/,"")||"blob")+".png",f.type)),!0}return a.toDataURL&&b&&window.atob&&window.ArrayBuffer&&window.Uint8Array?(e(d.dataURItoBlob(a.toDataURL(f.type))),!0):!1};d.dataURItoBlob=function(a){var c,d,e,f,g,h;a.split(",")[0].indexOf("base64")>=0?c=atob(a.split(",")[1]):c=decodeURIComponent(a.split(",")[1]),d=new ArrayBuffer(c.length),e=new Uint8Array(d);for(f=0;f<c.length;f+=1)e[f]=c.charCodeAt(f);return g=new b,g.append(d),h=a.split(",")[0].split(":")[1].split(";")[0],g.getBlob(h)},typeof define!="undefined"&&define.amd?define(function(){return d}):a.canvasToBlob=d})(this);
|
js/wexo_imageupload/from_site/load-image.min.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
(function(a){"use strict";var b=function(a,c,d){var e=document.createElement("img"),f,g;return e.onerror=c,e.onload=function(){g&&b.revokeObjectURL(g),c(b.scale(e,d))},window.Blob&&a instanceof Blob||window.File&&a instanceof File?f=g=b.createObjectURL(a):f=a,f?(e.src=f,e):b.readFile(a,function(a){e.src=a})},c=window.createObjectURL&&window||window.URL&&URL||window.webkitURL&&webkitURL;b.scale=function(a,b){b=b||{};var c=document.createElement("canvas"),d=Math.max((b.minWidth||a.width)/a.width,(b.minHeight||a.height)/a.height);return d>1&&(a.width=parseInt(a.width*d,10),a.height=parseInt(a.height*d,10)),d=Math.min((b.maxWidth||a.width)/a.width,(b.maxHeight||a.height)/a.height),d<1&&(a.width=parseInt(a.width*d,10),a.height=parseInt(a.height*d,10)),!b.canvas||!c.getContext?a:(c.width=a.width,c.height=a.height,c.getContext("2d").drawImage(a,0,0,a.width,a.height),c)},b.createObjectURL=function(a){return c?c.createObjectURL(a):!1},b.revokeObjectURL=function(a){return c?c.revokeObjectURL(a):!1},b.readFile=function(a,b){if(window.FileReader&&FileReader.prototype.readAsDataURL){var c=new FileReader;return c.onload=function(a){b(a.target.result)},c.readAsDataURL(a),c}return!1},typeof define!="undefined"&&define.amd?define(function(){return b}):a.loadImage=b})(this);
|
js/wexo_imageupload/from_site/tmpl.min.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
(function(a){"use strict";var b=function(a,c){var d=/[^\w\-\.:]/.test(a)?new Function(b.arg+",tmpl","var _e=tmpl.encode"+b.helper+",_s='"+a.replace(b.regexp,b.func)+"';return _s;"):b.cache[a]=b.cache[a]||b(b.load(a));return c?d(c,b):function(a){return d(a,b)}};b.cache={},b.load=function(a){return document.getElementById(a).innerHTML},b.regexp=/([\s'\\])(?![^%]*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,b.func=function(a,b,c,d,e,f){if(b)return{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[a]||"\\"+a;if(c)return c==="="?"'+_e("+d+")+'":"'+("+d+"||'')+'";if(e)return"';";if(f)return"_s+='"},b.encReg=/[<>&"'\x00]/g,b.encMap={"<":"<",">":">","&":"&",'"':""","'":"'"},b.encode=function(a){return String(a||"").replace(b.encReg,function(a){return b.encMap[a]||""})},b.arg="o",b.helper=",print=function(s,e){_s+=e&&(s||'')||_e(s);},include=function(s,d){_s+=tmpl(s,d);}",typeof define=="function"&&define.amd?define(function(){return b}):a.tmpl=b})(this);
|
js/wexo_imageupload/jquery.fileupload-ip.js
ADDED
@@ -0,0 +1,158 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery File Upload Image Processing Plugin 1.0.3
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2012, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint nomen: true, unparam: true, regexp: true */
|
13 |
+
/*global define, window, document */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define([
|
20 |
+
'jquery',
|
21 |
+
'load-image',
|
22 |
+
'canvas-to-blob',
|
23 |
+
'./jquery.fileupload.js'
|
24 |
+
], factory);
|
25 |
+
} else {
|
26 |
+
// Browser globals:
|
27 |
+
factory(
|
28 |
+
window.jQuery,
|
29 |
+
window.loadImage,
|
30 |
+
window.canvasToBlob
|
31 |
+
);
|
32 |
+
}
|
33 |
+
}(function (j, loadImage, canvasToBlob) {
|
34 |
+
'use strict';
|
35 |
+
|
36 |
+
// The File Upload IP version extends the basic fileupload widget
|
37 |
+
// with image processing functionality:
|
38 |
+
j.widget('blueimpIP.fileupload', j.blueimp.fileupload, {
|
39 |
+
|
40 |
+
options: {
|
41 |
+
// The regular expression to define which image files are to be
|
42 |
+
// resized, given that the browser supports the operation:
|
43 |
+
resizeSourceFileTypes: /^image\/(gif|jpeg|png)$/,
|
44 |
+
// The maximum file size of images that are to be resized:
|
45 |
+
resizeSourceMaxFileSize: 20000000, // 20MB
|
46 |
+
// The maximum width of the resized images:
|
47 |
+
resizeMaxWidth: undefined,
|
48 |
+
// The maximum height of the resized images:
|
49 |
+
resizeMaxHeight: undefined,
|
50 |
+
// The minimum width of the resized images:
|
51 |
+
resizeMinWidth: undefined,
|
52 |
+
// The minimum height of the resized images:
|
53 |
+
resizeMinHeight: undefined,
|
54 |
+
|
55 |
+
// The add callback is invoked as soon as files are added to the fileupload
|
56 |
+
// widget (via file input selection, drag & drop or add API call).
|
57 |
+
// See the basic file upload widget for more information:
|
58 |
+
add: function (e, data) {
|
59 |
+
j(this).fileupload('resize', data).done(function () {
|
60 |
+
data.submit();
|
61 |
+
});
|
62 |
+
}
|
63 |
+
},
|
64 |
+
|
65 |
+
// Resizes the image file at the given index and stores the created blob
|
66 |
+
// at the original position of the files list, returns a Promise object:
|
67 |
+
_resizeImage: function (files, index) {
|
68 |
+
var that = this,
|
69 |
+
options = this.options,
|
70 |
+
file = files[index],
|
71 |
+
deferred = j.Deferred(),
|
72 |
+
canvas,
|
73 |
+
blob;
|
74 |
+
loadImage(
|
75 |
+
file,
|
76 |
+
function (img) {
|
77 |
+
var width = img.width,
|
78 |
+
height = img.height;
|
79 |
+
canvas = loadImage.scale(img, {
|
80 |
+
maxWidth: options.resizeMaxWidth,
|
81 |
+
maxHeight: options.resizeMaxHeight,
|
82 |
+
minWidth: options.resizeMinWidth,
|
83 |
+
minHeight: options.resizeMinHeight,
|
84 |
+
canvas: true
|
85 |
+
});
|
86 |
+
if (width !== canvas.width || height !== canvas.height) {
|
87 |
+
canvasToBlob(canvas, function (blob) {
|
88 |
+
if (!blob.name) {
|
89 |
+
if (file.type === blob.type) {
|
90 |
+
blob.name = file.name;
|
91 |
+
} else if (file.name) {
|
92 |
+
blob.name = file.name.replace(
|
93 |
+
/\..+$/,
|
94 |
+
'.' + blob.type.substr(6)
|
95 |
+
);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
files[index] = blob;
|
99 |
+
deferred.resolveWith(that);
|
100 |
+
}, file);
|
101 |
+
} else {
|
102 |
+
deferred.resolveWith(that);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
);
|
106 |
+
return deferred.promise();
|
107 |
+
},
|
108 |
+
|
109 |
+
// Resizes the images given as files property of the data parameter,
|
110 |
+
// returns a Promise object that allows to bind a done handler, which
|
111 |
+
// will be invoked after processing all images is done:
|
112 |
+
resize: function (data) {
|
113 |
+
var that = this,
|
114 |
+
options = j.extend({}, this.options, data),
|
115 |
+
resizeAll = j.type(options.resizeSourceMaxFileSize) !== 'number';
|
116 |
+
j.each(data.files, function (index, file) {
|
117 |
+
if (that._resizeSupport &&
|
118 |
+
(options.resizeMaxWidth || options.resizeMaxHeight ||
|
119 |
+
options.resizeMinWidth || options.resizeMinHeight) &&
|
120 |
+
(resizeAll || file.size < options.resizeSourceMaxFileSize) &&
|
121 |
+
options.resizeSourceFileTypes.test(file.type)) {
|
122 |
+
that._processing += 1;
|
123 |
+
if (that._processing === 1) {
|
124 |
+
that.element.addClass('fileupload-processing');
|
125 |
+
}
|
126 |
+
that._processingQueue = that._processingQueue.pipe(function () {
|
127 |
+
var deferred = j.Deferred();
|
128 |
+
that._resizeImage(
|
129 |
+
data.files,
|
130 |
+
index
|
131 |
+
).done(function () {
|
132 |
+
that._processing -= 1;
|
133 |
+
if (that._processing === 0) {
|
134 |
+
that.element
|
135 |
+
.removeClass('fileupload-processing');
|
136 |
+
}
|
137 |
+
deferred.resolveWith(that);
|
138 |
+
});
|
139 |
+
return deferred.promise();
|
140 |
+
});
|
141 |
+
}
|
142 |
+
});
|
143 |
+
return this._processingQueue;
|
144 |
+
},
|
145 |
+
|
146 |
+
_create: function () {
|
147 |
+
j.blueimp.fileupload.prototype._create.call(this);
|
148 |
+
this._processing = 0;
|
149 |
+
this._processingQueue = j.Deferred().resolveWith(this).promise();
|
150 |
+
this._resizeSupport = canvasToBlob && canvasToBlob(
|
151 |
+
document.createElement('canvas'),
|
152 |
+
j.noop
|
153 |
+
);
|
154 |
+
}
|
155 |
+
|
156 |
+
});
|
157 |
+
|
158 |
+
}));
|
js/wexo_imageupload/jquery.fileupload-ui.js
ADDED
@@ -0,0 +1,629 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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Upload User Interface Plugin 6.6.1
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2010, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint nomen: true, unparam: true, regexp: true */
|
13 |
+
/*global define, window, document, URL, webkitURL, FileReader */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define([
|
20 |
+
'jquery',
|
21 |
+
'tmpl',
|
22 |
+
'load-image',
|
23 |
+
'./jquery.fileupload-ip.js'
|
24 |
+
], factory);
|
25 |
+
} else {
|
26 |
+
// Browser globals:
|
27 |
+
factory(
|
28 |
+
window.jQuery,
|
29 |
+
window.tmpl,
|
30 |
+
window.loadImage
|
31 |
+
);
|
32 |
+
}
|
33 |
+
}(function (j, tmpl, loadImage) {
|
34 |
+
'use strict';
|
35 |
+
|
36 |
+
// The UI version extends the IP (image processing) version or the basic
|
37 |
+
// file upload widget and adds complete user interface interaction:
|
38 |
+
var parentWidget = (j.blueimpIP || j.blueimp).fileupload;
|
39 |
+
j.widget('blueimpUI.fileupload', parentWidget, {
|
40 |
+
|
41 |
+
options: {
|
42 |
+
// By default, files added to the widget are uploaded as soon
|
43 |
+
// as the user clicks on the start buttons. To enable automatic
|
44 |
+
// uploads, set the following option to true:
|
45 |
+
autoUpload: false,
|
46 |
+
// The following option limits the number of files that are
|
47 |
+
// allowed to be uploaded using this widget:
|
48 |
+
maxNumberOfFiles: undefined,
|
49 |
+
// The maximum allowed file size:
|
50 |
+
maxFileSize: undefined,
|
51 |
+
// The minimum allowed file size:
|
52 |
+
minFileSize: undefined,
|
53 |
+
// The regular expression for allowed file types, matches
|
54 |
+
// against either file type or file name:
|
55 |
+
acceptFileTypes: /.+j/i,
|
56 |
+
// The regular expression to define for which files a preview
|
57 |
+
// image is shown, matched against the file type:
|
58 |
+
previewSourceFileTypes: /^image\/(gif|jpeg|png)$/,
|
59 |
+
// The maximum file size of images that are to be displayed as preview:
|
60 |
+
previewSourceMaxFileSize: 5000000, // 5MB
|
61 |
+
// The maximum width of the preview images:
|
62 |
+
previewMaxWidth: 80,
|
63 |
+
// The maximum height of the preview images:
|
64 |
+
previewMaxHeight: 80,
|
65 |
+
// By default, preview images are displayed as canvas elements
|
66 |
+
// if supported by the browser. Set the following option to false
|
67 |
+
// to always display preview images as img elements:
|
68 |
+
previewAsCanvas: true,
|
69 |
+
// The ID of the upload template:
|
70 |
+
uploadTemplateId: 'template-upload',
|
71 |
+
// The ID of the download template:
|
72 |
+
downloadTemplateId: 'template-download',
|
73 |
+
// The expected data type of the upload response, sets the dataType
|
74 |
+
// option of the j.ajax upload requests:
|
75 |
+
dataType: 'json',
|
76 |
+
|
77 |
+
// The add callback is invoked as soon as files are added to the fileupload
|
78 |
+
// widget (via file input selection, drag & drop or add API call).
|
79 |
+
// See the basic file upload widget for more information:
|
80 |
+
add: function (e, data) {
|
81 |
+
var that = j(this).data('fileupload'),
|
82 |
+
options = that.options,
|
83 |
+
files = data.files;
|
84 |
+
that._adjustMaxNumberOfFiles(-files.length);
|
85 |
+
data.isAdjusted = true;
|
86 |
+
j(this).fileupload('resize', data).done(data, function () {
|
87 |
+
data.files.valid = data.isValidated = that._validate(files);
|
88 |
+
data.context = that._renderUpload(files)
|
89 |
+
.appendTo(options.filesContainer)
|
90 |
+
.data('data', data);
|
91 |
+
that._renderPreviews(files, data.context);
|
92 |
+
that._forceReflow(data.context);
|
93 |
+
that._transition(data.context).done(
|
94 |
+
function () {
|
95 |
+
if ((that._trigger('added', e, data) !== false) &&
|
96 |
+
(options.autoUpload || data.autoUpload) &&
|
97 |
+
data.autoUpload !== false && data.isValidated) {
|
98 |
+
data.submit();
|
99 |
+
}
|
100 |
+
}
|
101 |
+
);
|
102 |
+
});
|
103 |
+
},
|
104 |
+
// Callback for the start of each file upload request:
|
105 |
+
send: function (e, data) {
|
106 |
+
var that = j(this).data('fileupload');
|
107 |
+
if (!data.isValidated) {
|
108 |
+
if (!data.isAdjusted) {
|
109 |
+
that._adjustMaxNumberOfFiles(-data.files.length);
|
110 |
+
}
|
111 |
+
if (!that._validate(data.files)) {
|
112 |
+
return false;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
if (data.context && data.dataType &&
|
116 |
+
data.dataType.substr(0, 6) === 'iframe') {
|
117 |
+
// Iframe Transport does not support progress events.
|
118 |
+
// In lack of an indeterminate progress bar, we set
|
119 |
+
// the progress to 100%, showing the full animated bar:
|
120 |
+
data.context
|
121 |
+
.find('.progress').addClass(
|
122 |
+
!j.support.transition && 'progress-animated'
|
123 |
+
)
|
124 |
+
.find('.bar').css(
|
125 |
+
'width',
|
126 |
+
parseInt(100, 10) + '%'
|
127 |
+
);
|
128 |
+
}
|
129 |
+
return that._trigger('sent', e, data);
|
130 |
+
},
|
131 |
+
// Callback for successful uploads:
|
132 |
+
done: function (e, data) {
|
133 |
+
var that = j(this).data('fileupload'),
|
134 |
+
template,
|
135 |
+
preview;
|
136 |
+
if (data.context) {
|
137 |
+
data.context.each(function (index) {
|
138 |
+
var file = (j.isArray(data.result) &&
|
139 |
+
data.result[index]) || {error: 'emptyResult'};
|
140 |
+
if (file.error) {
|
141 |
+
that._adjustMaxNumberOfFiles(1);
|
142 |
+
}
|
143 |
+
that._transition(j(this)).done(
|
144 |
+
function () {
|
145 |
+
var node = j(this);
|
146 |
+
template = that._renderDownload([file])
|
147 |
+
.css('height', node.height())
|
148 |
+
.replaceAll(node);
|
149 |
+
that._forceReflow(template);
|
150 |
+
that._transition(template).done(
|
151 |
+
function () {
|
152 |
+
data.context = j(this);
|
153 |
+
that._trigger('completed', e, data);
|
154 |
+
}
|
155 |
+
);
|
156 |
+
}
|
157 |
+
);
|
158 |
+
});
|
159 |
+
} else {
|
160 |
+
template = that._renderDownload(data.result)
|
161 |
+
.appendTo(that.options.filesContainer);
|
162 |
+
that._forceReflow(template);
|
163 |
+
that._transition(template).done(
|
164 |
+
function () {
|
165 |
+
data.context = j(this);
|
166 |
+
that._trigger('completed', e, data);
|
167 |
+
}
|
168 |
+
);
|
169 |
+
}
|
170 |
+
},
|
171 |
+
// Callback for failed (abort or error) uploads:
|
172 |
+
fail: function (e, data) {
|
173 |
+
var that = j(this).data('fileupload'),
|
174 |
+
template;
|
175 |
+
that._adjustMaxNumberOfFiles(data.files.length);
|
176 |
+
if (data.context) {
|
177 |
+
data.context.each(function (index) {
|
178 |
+
if (data.errorThrown !== 'abort') {
|
179 |
+
var file = data.files[index];
|
180 |
+
file.error = file.error || data.errorThrown ||
|
181 |
+
true;
|
182 |
+
that._transition(j(this)).done(
|
183 |
+
function () {
|
184 |
+
var node = j(this);
|
185 |
+
template = that._renderDownload([file])
|
186 |
+
.replaceAll(node);
|
187 |
+
that._forceReflow(template);
|
188 |
+
that._transition(template).done(
|
189 |
+
function () {
|
190 |
+
data.context = j(this);
|
191 |
+
that._trigger('failed', e, data);
|
192 |
+
}
|
193 |
+
);
|
194 |
+
}
|
195 |
+
);
|
196 |
+
} else {
|
197 |
+
that._transition(j(this)).done(
|
198 |
+
function () {
|
199 |
+
j(this).remove();
|
200 |
+
that._trigger('failed', e, data);
|
201 |
+
}
|
202 |
+
);
|
203 |
+
}
|
204 |
+
});
|
205 |
+
} else if (data.errorThrown !== 'abort') {
|
206 |
+
that._adjustMaxNumberOfFiles(-data.files.length);
|
207 |
+
data.context = that._renderUpload(data.files)
|
208 |
+
.appendTo(that.options.filesContainer)
|
209 |
+
.data('data', data);
|
210 |
+
that._forceReflow(data.context);
|
211 |
+
that._transition(data.context).done(
|
212 |
+
function () {
|
213 |
+
data.context = j(this);
|
214 |
+
that._trigger('failed', e, data);
|
215 |
+
}
|
216 |
+
);
|
217 |
+
} else {
|
218 |
+
that._trigger('failed', e, data);
|
219 |
+
}
|
220 |
+
},
|
221 |
+
// Callback for upload progress events:
|
222 |
+
progress: function (e, data) {
|
223 |
+
if (data.context) {
|
224 |
+
data.context.find('.progress .bar').css(
|
225 |
+
'width',
|
226 |
+
parseInt(data.loaded / data.total * 100, 10) + '%'
|
227 |
+
);
|
228 |
+
}
|
229 |
+
},
|
230 |
+
// Callback for global upload progress events:
|
231 |
+
progressall: function (e, data) {
|
232 |
+
j(this).find('.fileupload-buttonbar .progress .bar').css(
|
233 |
+
'width',
|
234 |
+
parseInt(data.loaded / data.total * 100, 10) + '%'
|
235 |
+
);
|
236 |
+
},
|
237 |
+
// Callback for uploads start, equivalent to the global ajaxStart event:
|
238 |
+
start: function (e) {
|
239 |
+
var that = j(this).data('fileupload');
|
240 |
+
that._transition(j(this).find('.fileupload-buttonbar .progress')).done(
|
241 |
+
function () {
|
242 |
+
that._trigger('started', e);
|
243 |
+
}
|
244 |
+
);
|
245 |
+
},
|
246 |
+
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
247 |
+
stop: function (e) {
|
248 |
+
var that = j(this).data('fileupload');
|
249 |
+
that._transition(j(this).find('.fileupload-buttonbar .progress')).done(
|
250 |
+
function () {
|
251 |
+
j(this).find('.bar').css('width', '0%');
|
252 |
+
that._trigger('stopped', e);
|
253 |
+
}
|
254 |
+
);
|
255 |
+
},
|
256 |
+
// Callback for file deletion:
|
257 |
+
destroy: function (e, data) {
|
258 |
+
var that = j(this).data('fileupload');
|
259 |
+
if (data.url) {
|
260 |
+
j.ajax(data);
|
261 |
+
}
|
262 |
+
that._adjustMaxNumberOfFiles(1);
|
263 |
+
that._transition(data.context).done(
|
264 |
+
function () {
|
265 |
+
j(this).remove();
|
266 |
+
that._trigger('destroyed', e, data);
|
267 |
+
}
|
268 |
+
);
|
269 |
+
}
|
270 |
+
},
|
271 |
+
|
272 |
+
// Link handler, that allows to download files
|
273 |
+
// by drag & drop of the links to the desktop:
|
274 |
+
_enableDragToDesktop: function () {
|
275 |
+
var link = j(this),
|
276 |
+
url = link.prop('href'),
|
277 |
+
name = link.prop('download'),
|
278 |
+
type = 'application/octet-stream';
|
279 |
+
link.bind('dragstart', function (e) {
|
280 |
+
try {
|
281 |
+
e.originalEvent.dataTransfer.setData(
|
282 |
+
'DownloadURL',
|
283 |
+
[type, name, url].join(':')
|
284 |
+
);
|
285 |
+
} catch (err) {}
|
286 |
+
});
|
287 |
+
},
|
288 |
+
|
289 |
+
_adjustMaxNumberOfFiles: function (operand) {
|
290 |
+
if (typeof this.options.maxNumberOfFiles === 'number') {
|
291 |
+
this.options.maxNumberOfFiles += operand;
|
292 |
+
if (this.options.maxNumberOfFiles < 1) {
|
293 |
+
this._disableFileInputButton();
|
294 |
+
} else {
|
295 |
+
this._enableFileInputButton();
|
296 |
+
}
|
297 |
+
}
|
298 |
+
},
|
299 |
+
|
300 |
+
_formatFileSize: function (bytes) {
|
301 |
+
if (typeof bytes !== 'number') {
|
302 |
+
return '';
|
303 |
+
}
|
304 |
+
if (bytes >= 1000000000) {
|
305 |
+
return (bytes / 1000000000).toFixed(2) + ' GB';
|
306 |
+
}
|
307 |
+
if (bytes >= 1000000) {
|
308 |
+
return (bytes / 1000000).toFixed(2) + ' MB';
|
309 |
+
}
|
310 |
+
return (bytes / 1000).toFixed(2) + ' KB';
|
311 |
+
},
|
312 |
+
|
313 |
+
_hasError: function (file) {
|
314 |
+
if (file.error) {
|
315 |
+
return file.error;
|
316 |
+
}
|
317 |
+
// The number of added files is subtracted from
|
318 |
+
// maxNumberOfFiles before validation, so we check if
|
319 |
+
// maxNumberOfFiles is below 0 (instead of below 1):
|
320 |
+
if (this.options.maxNumberOfFiles < 0) {
|
321 |
+
return 'maxNumberOfFiles';
|
322 |
+
}
|
323 |
+
// Files are accepted if either the file type or the file name
|
324 |
+
// matches against the acceptFileTypes regular expression, as
|
325 |
+
// only browsers with support for the File API report the type:
|
326 |
+
if (!(this.options.acceptFileTypes.test(file.type) ||
|
327 |
+
this.options.acceptFileTypes.test(file.name))) {
|
328 |
+
return 'acceptFileTypes';
|
329 |
+
}
|
330 |
+
if (this.options.maxFileSize &&
|
331 |
+
file.size > this.options.maxFileSize) {
|
332 |
+
return 'maxFileSize';
|
333 |
+
}
|
334 |
+
if (typeof file.size === 'number' &&
|
335 |
+
file.size < this.options.minFileSize) {
|
336 |
+
return 'minFileSize';
|
337 |
+
}
|
338 |
+
return null;
|
339 |
+
},
|
340 |
+
|
341 |
+
_validate: function (files) {
|
342 |
+
var that = this,
|
343 |
+
valid = !!files.length;
|
344 |
+
j.each(files, function (index, file) {
|
345 |
+
file.error = that._hasError(file);
|
346 |
+
if (file.error) {
|
347 |
+
valid = false;
|
348 |
+
}
|
349 |
+
});
|
350 |
+
return valid;
|
351 |
+
},
|
352 |
+
|
353 |
+
_renderTemplate: function (func, files) {
|
354 |
+
if (!func) {
|
355 |
+
return j();
|
356 |
+
}
|
357 |
+
var result = func({
|
358 |
+
files: files,
|
359 |
+
formatFileSize: this._formatFileSize,
|
360 |
+
options: this.options
|
361 |
+
});
|
362 |
+
if (result instanceof j) {
|
363 |
+
return result;
|
364 |
+
}
|
365 |
+
return j(this.options.templatesContainer).html(result).children();
|
366 |
+
},
|
367 |
+
|
368 |
+
_renderPreview: function (file, node) {
|
369 |
+
var that = this,
|
370 |
+
options = this.options,
|
371 |
+
deferred = j.Deferred();
|
372 |
+
return ((loadImage && loadImage(
|
373 |
+
file,
|
374 |
+
function (img) {
|
375 |
+
node.append(img);
|
376 |
+
that._forceReflow(node);
|
377 |
+
that._transition(node).done(function () {
|
378 |
+
deferred.resolveWith(node);
|
379 |
+
});
|
380 |
+
},
|
381 |
+
{
|
382 |
+
maxWidth: options.previewMaxWidth,
|
383 |
+
maxHeight: options.previewMaxHeight,
|
384 |
+
canvas: options.previewAsCanvas
|
385 |
+
}
|
386 |
+
)) || deferred.resolveWith(node)) && deferred;
|
387 |
+
},
|
388 |
+
|
389 |
+
_renderPreviews: function (files, nodes) {
|
390 |
+
var that = this,
|
391 |
+
options = this.options;
|
392 |
+
nodes.find('.preview span').each(function (index, element) {
|
393 |
+
var file = files[index];
|
394 |
+
if (options.previewSourceFileTypes.test(file.type) &&
|
395 |
+
(j.type(options.previewSourceMaxFileSize) !== 'number' ||
|
396 |
+
file.size < options.previewSourceMaxFileSize)) {
|
397 |
+
that._processingQueue = that._processingQueue.pipe(function () {
|
398 |
+
var deferred = j.Deferred();
|
399 |
+
that._renderPreview(file, j(element)).done(
|
400 |
+
function () {
|
401 |
+
deferred.resolveWith(that);
|
402 |
+
}
|
403 |
+
);
|
404 |
+
return deferred.promise();
|
405 |
+
});
|
406 |
+
}
|
407 |
+
});
|
408 |
+
return this._processingQueue;
|
409 |
+
},
|
410 |
+
|
411 |
+
_renderUpload: function (files) {
|
412 |
+
return this._renderTemplate(
|
413 |
+
this.options.uploadTemplate,
|
414 |
+
files
|
415 |
+
);
|
416 |
+
},
|
417 |
+
|
418 |
+
_renderDownload: function (files) {
|
419 |
+
return this._renderTemplate(
|
420 |
+
this.options.downloadTemplate,
|
421 |
+
files
|
422 |
+
).find('a[download]').each(this._enableDragToDesktop).end();
|
423 |
+
},
|
424 |
+
|
425 |
+
_startHandler: function (e) {
|
426 |
+
e.preventDefault();
|
427 |
+
var button = j(this),
|
428 |
+
template = button.closest('.template-upload'),
|
429 |
+
data = template.data('data');
|
430 |
+
if (data && data.submit && !data.jqXHR && data.submit()) {
|
431 |
+
button.prop('disabled', true);
|
432 |
+
}
|
433 |
+
},
|
434 |
+
|
435 |
+
_cancelHandler: function (e) {
|
436 |
+
e.preventDefault();
|
437 |
+
var template = j(this).closest('.template-upload'),
|
438 |
+
data = template.data('data') || {};
|
439 |
+
if (!data.jqXHR) {
|
440 |
+
data.errorThrown = 'abort';
|
441 |
+
e.data.fileupload._trigger('fail', e, data);
|
442 |
+
} else {
|
443 |
+
data.jqXHR.abort();
|
444 |
+
}
|
445 |
+
},
|
446 |
+
|
447 |
+
_deleteHandler: function (e) {
|
448 |
+
e.preventDefault();
|
449 |
+
var button = j(this);
|
450 |
+
e.data.fileupload._trigger('destroy', e, {
|
451 |
+
context: button.closest('.template-download'),
|
452 |
+
url: button.attr('data-url'),
|
453 |
+
type: button.attr('data-type') || 'DELETE',
|
454 |
+
dataType: e.data.fileupload.options.dataType
|
455 |
+
});
|
456 |
+
},
|
457 |
+
|
458 |
+
_forceReflow: function (node) {
|
459 |
+
this._reflow = j.support.transition &&
|
460 |
+
node.length && node[0].offsetWidth;
|
461 |
+
},
|
462 |
+
|
463 |
+
_transition: function (node) {
|
464 |
+
var that = this,
|
465 |
+
deferred = j.Deferred();
|
466 |
+
if (j.support.transition && node.hasClass('fade')) {
|
467 |
+
node.bind(
|
468 |
+
j.support.transition.end,
|
469 |
+
function (e) {
|
470 |
+
// Make sure we don't respond to other transitions events
|
471 |
+
// in the container element, e.g. from button elements:
|
472 |
+
if (e.target === node[0]) {
|
473 |
+
node.unbind(j.support.transition.end);
|
474 |
+
deferred.resolveWith(node);
|
475 |
+
}
|
476 |
+
}
|
477 |
+
).toggleClass('in');
|
478 |
+
} else {
|
479 |
+
node.toggleClass('in');
|
480 |
+
deferred.resolveWith(node);
|
481 |
+
}
|
482 |
+
return deferred;
|
483 |
+
},
|
484 |
+
|
485 |
+
_initButtonBarEventHandlers: function () {
|
486 |
+
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
|
487 |
+
filesList = this.options.filesContainer,
|
488 |
+
ns = this.options.namespace;
|
489 |
+
fileUploadButtonBar.find('.start')
|
490 |
+
.bind('click.' + ns, function (e) {
|
491 |
+
e.preventDefault();
|
492 |
+
filesList.find('.start button').click();
|
493 |
+
});
|
494 |
+
fileUploadButtonBar.find('.cancel')
|
495 |
+
.bind('click.' + ns, function (e) {
|
496 |
+
e.preventDefault();
|
497 |
+
filesList.find('.cancel button').click();
|
498 |
+
});
|
499 |
+
fileUploadButtonBar.find('.delete')
|
500 |
+
.bind('click.' + ns, function (e) {
|
501 |
+
e.preventDefault();
|
502 |
+
filesList.find('.delete input:checked')
|
503 |
+
.siblings('button').click();
|
504 |
+
fileUploadButtonBar.find('.toggle')
|
505 |
+
.prop('checked', false);
|
506 |
+
});
|
507 |
+
fileUploadButtonBar.find('.toggle')
|
508 |
+
.bind('change.' + ns, function (e) {
|
509 |
+
filesList.find('.delete input').prop(
|
510 |
+
'checked',
|
511 |
+
j(this).is(':checked')
|
512 |
+
);
|
513 |
+
});
|
514 |
+
},
|
515 |
+
|
516 |
+
_destroyButtonBarEventHandlers: function () {
|
517 |
+
this.element.find('.fileupload-buttonbar button')
|
518 |
+
.unbind('click.' + this.options.namespace);
|
519 |
+
this.element.find('.fileupload-buttonbar .toggle')
|
520 |
+
.unbind('change.' + this.options.namespace);
|
521 |
+
},
|
522 |
+
|
523 |
+
_initEventHandlers: function () {
|
524 |
+
parentWidget.prototype._initEventHandlers.call(this);
|
525 |
+
var eventData = {fileupload: this};
|
526 |
+
this.options.filesContainer
|
527 |
+
.delegate(
|
528 |
+
'.start button',
|
529 |
+
'click.' + this.options.namespace,
|
530 |
+
eventData,
|
531 |
+
this._startHandler
|
532 |
+
)
|
533 |
+
.delegate(
|
534 |
+
'.cancel button',
|
535 |
+
'click.' + this.options.namespace,
|
536 |
+
eventData,
|
537 |
+
this._cancelHandler
|
538 |
+
)
|
539 |
+
.delegate(
|
540 |
+
'.delete button',
|
541 |
+
'click.' + this.options.namespace,
|
542 |
+
eventData,
|
543 |
+
this._deleteHandler
|
544 |
+
);
|
545 |
+
this._initButtonBarEventHandlers();
|
546 |
+
},
|
547 |
+
|
548 |
+
_destroyEventHandlers: function () {
|
549 |
+
var options = this.options;
|
550 |
+
this._destroyButtonBarEventHandlers();
|
551 |
+
options.filesContainer
|
552 |
+
.undelegate('.start button', 'click.' + options.namespace)
|
553 |
+
.undelegate('.cancel button', 'click.' + options.namespace)
|
554 |
+
.undelegate('.delete button', 'click.' + options.namespace);
|
555 |
+
parentWidget.prototype._destroyEventHandlers.call(this);
|
556 |
+
},
|
557 |
+
|
558 |
+
_enableFileInputButton: function () {
|
559 |
+
this.element.find('.fileinput-button input')
|
560 |
+
.prop('disabled', false)
|
561 |
+
.parent().removeClass('disabled');
|
562 |
+
},
|
563 |
+
|
564 |
+
_disableFileInputButton: function () {
|
565 |
+
this.element.find('.fileinput-button input')
|
566 |
+
.prop('disabled', true)
|
567 |
+
.parent().addClass('disabled');
|
568 |
+
},
|
569 |
+
|
570 |
+
_initTemplates: function () {
|
571 |
+
var options = this.options;
|
572 |
+
options.templatesContainer = document.createElement(
|
573 |
+
options.filesContainer.prop('nodeName')
|
574 |
+
);
|
575 |
+
if (tmpl) {
|
576 |
+
if (options.uploadTemplateId) {
|
577 |
+
options.uploadTemplate = tmpl(options.uploadTemplateId);
|
578 |
+
}
|
579 |
+
if (options.downloadTemplateId) {
|
580 |
+
options.downloadTemplate = tmpl(options.downloadTemplateId);
|
581 |
+
}
|
582 |
+
}
|
583 |
+
},
|
584 |
+
|
585 |
+
_initFilesContainer: function () {
|
586 |
+
var options = this.options;
|
587 |
+
if (options.filesContainer === undefined) {
|
588 |
+
options.filesContainer = this.element.find('.files');
|
589 |
+
} else if (!(options.filesContainer instanceof j)) {
|
590 |
+
options.filesContainer = j(options.filesContainer);
|
591 |
+
}
|
592 |
+
},
|
593 |
+
|
594 |
+
_initSpecialOptions: function () {
|
595 |
+
parentWidget.prototype._initSpecialOptions.call(this);
|
596 |
+
this._initFilesContainer();
|
597 |
+
this._initTemplates();
|
598 |
+
},
|
599 |
+
|
600 |
+
_create: function () {
|
601 |
+
parentWidget.prototype._create.call(this);
|
602 |
+
this._refreshOptionsList.push(
|
603 |
+
'filesContainer',
|
604 |
+
'uploadTemplateId',
|
605 |
+
'downloadTemplateId'
|
606 |
+
);
|
607 |
+
if (!j.blueimpIP) {
|
608 |
+
this._processingQueue = j.Deferred().resolveWith(this).promise();
|
609 |
+
this.resize = function () {
|
610 |
+
return this._processingQueue;
|
611 |
+
};
|
612 |
+
}
|
613 |
+
},
|
614 |
+
|
615 |
+
enable: function () {
|
616 |
+
parentWidget.prototype.enable.call(this);
|
617 |
+
this.element.find('input, button').prop('disabled', false);
|
618 |
+
this._enableFileInputButton();
|
619 |
+
},
|
620 |
+
|
621 |
+
disable: function () {
|
622 |
+
this.element.find('input, button').prop('disabled', true);
|
623 |
+
this._disableFileInputButton();
|
624 |
+
parentWidget.prototype.disable.call(this);
|
625 |
+
}
|
626 |
+
|
627 |
+
});
|
628 |
+
|
629 |
+
}));
|
js/wexo_imageupload/jquery.fileupload.js
ADDED
@@ -0,0 +1,859 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery File Upload Plugin 5.8.1
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2010, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint nomen: true, unparam: true, regexp: true */
|
13 |
+
/*global define, window, document, XMLHttpRequestUpload, Blob, File, FormData, location */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define([
|
20 |
+
'jquery',
|
21 |
+
'jquery.ui.widget'
|
22 |
+
], factory);
|
23 |
+
} else {
|
24 |
+
// Browser globals:
|
25 |
+
factory(window.jQuery);
|
26 |
+
}
|
27 |
+
}(function (j) {
|
28 |
+
'use strict';
|
29 |
+
|
30 |
+
// The fileupload widget listens for change events on file input fields defined
|
31 |
+
// via fileInput setting and paste or drop events of the given dropZone.
|
32 |
+
// In addition to the default jQuery Widget methods, the fileupload widget
|
33 |
+
// exposes the "add" and "send" methods, to add or directly send files using
|
34 |
+
// the fileupload API.
|
35 |
+
// By default, files added via file input selection, paste, drag & drop or
|
36 |
+
// "add" method are uploaded immediately, but it is possible to override
|
37 |
+
// the "add" callback option to queue file uploads.
|
38 |
+
j.widget('blueimp.fileupload', {
|
39 |
+
|
40 |
+
options: {
|
41 |
+
// The namespace used for event handler binding on the dropZone and
|
42 |
+
// fileInput collections.
|
43 |
+
// If not set, the name of the widget ("fileupload") is used.
|
44 |
+
namespace: undefined,
|
45 |
+
// The drop target collection, by the default the complete document.
|
46 |
+
// Set to null or an empty collection to disable drag & drop support:
|
47 |
+
dropZone: j(document),
|
48 |
+
// The file input field collection, that is listened for change events.
|
49 |
+
// If undefined, it is set to the file input fields inside
|
50 |
+
// of the widget element on plugin initialization.
|
51 |
+
// Set to null or an empty collection to disable the change listener.
|
52 |
+
fileInput: undefined,
|
53 |
+
// By default, the file input field is replaced with a clone after
|
54 |
+
// each input field change event. This is required for iframe transport
|
55 |
+
// queues and allows change events to be fired for the same file
|
56 |
+
// selection, but can be disabled by setting the following option to false:
|
57 |
+
replaceFileInput: true,
|
58 |
+
// The parameter name for the file form data (the request argument name).
|
59 |
+
// If undefined or empty, the name property of the file input field is
|
60 |
+
// used, or "files[]" if the file input name property is also empty:
|
61 |
+
paramName: undefined,
|
62 |
+
// By default, each file of a selection is uploaded using an individual
|
63 |
+
// request for XHR type uploads. Set to false to upload file
|
64 |
+
// selections in one request each:
|
65 |
+
singleFileUploads: true,
|
66 |
+
// To limit the number of files uploaded with one XHR request,
|
67 |
+
// set the following option to an integer greater than 0:
|
68 |
+
limitMultiFileUploads: undefined,
|
69 |
+
// Set the following option to true to issue all file upload requests
|
70 |
+
// in a sequential order:
|
71 |
+
sequentialUploads: false,
|
72 |
+
// To limit the number of concurrent uploads,
|
73 |
+
// set the following option to an integer greater than 0:
|
74 |
+
limitConcurrentUploads: undefined,
|
75 |
+
// Set the following option to true to force iframe transport uploads:
|
76 |
+
forceIframeTransport: false,
|
77 |
+
// Set the following option to the location of a redirect url on the
|
78 |
+
// origin server, for cross-domain iframe transport uploads:
|
79 |
+
redirect: undefined,
|
80 |
+
// The parameter name for the redirect url, sent as part of the form
|
81 |
+
// data and set to 'redirect' if this option is empty:
|
82 |
+
redirectParamName: undefined,
|
83 |
+
// Set the following option to the location of a postMessage window,
|
84 |
+
// to enable postMessage transport uploads:
|
85 |
+
postMessage: undefined,
|
86 |
+
// By default, XHR file uploads are sent as multipart/form-data.
|
87 |
+
// The iframe transport is always using multipart/form-data.
|
88 |
+
// Set to false to enable non-multipart XHR uploads:
|
89 |
+
multipart: true,
|
90 |
+
// To upload large files in smaller chunks, set the following option
|
91 |
+
// to a preferred maximum chunk size. If set to 0, null or undefined,
|
92 |
+
// or the browser does not support the required Blob API, files will
|
93 |
+
// be uploaded as a whole.
|
94 |
+
maxChunkSize: undefined,
|
95 |
+
// When a non-multipart upload or a chunked multipart upload has been
|
96 |
+
// aborted, this option can be used to resume the upload by setting
|
97 |
+
// it to the size of the already uploaded bytes. This option is most
|
98 |
+
// useful when modifying the options object inside of the "add" or
|
99 |
+
// "send" callbacks, as the options are cloned for each file upload.
|
100 |
+
uploadedBytes: undefined,
|
101 |
+
// By default, failed (abort or error) file uploads are removed from the
|
102 |
+
// global progress calculation. Set the following option to false to
|
103 |
+
// prevent recalculating the global progress data:
|
104 |
+
recalculateProgress: true,
|
105 |
+
|
106 |
+
// Additional form data to be sent along with the file uploads can be set
|
107 |
+
// using this option, which accepts an array of objects with name and
|
108 |
+
// value properties, a function returning such an array, a FormData
|
109 |
+
// object (for XHR file uploads), or a simple object.
|
110 |
+
// The form of the first fileInput is given as parameter to the function:
|
111 |
+
formData: function (form) {
|
112 |
+
return form.serializeArray();
|
113 |
+
},
|
114 |
+
|
115 |
+
// The add callback is invoked as soon as files are added to the fileupload
|
116 |
+
// widget (via file input selection, drag & drop, paste or add API call).
|
117 |
+
// If the singleFileUploads option is enabled, this callback will be
|
118 |
+
// called once for each file in the selection for XHR file uplaods, else
|
119 |
+
// once for each file selection.
|
120 |
+
// The upload starts when the submit method is invoked on the data parameter.
|
121 |
+
// The data object contains a files property holding the added files
|
122 |
+
// and allows to override plugin options as well as define ajax settings.
|
123 |
+
// Listeners for this callback can also be bound the following way:
|
124 |
+
// .bind('fileuploadadd', func);
|
125 |
+
// data.submit() returns a Promise object and allows to attach additional
|
126 |
+
// handlers using jQuery's Deferred callbacks:
|
127 |
+
// data.submit().done(func).fail(func).always(func);
|
128 |
+
add: function (e, data) {
|
129 |
+
data.submit();
|
130 |
+
},
|
131 |
+
|
132 |
+
// Other callbacks:
|
133 |
+
// Callback for the submit event of each file upload:
|
134 |
+
// submit: function (e, data) {}, // .bind('fileuploadsubmit', func);
|
135 |
+
// Callback for the start of each file upload request:
|
136 |
+
// send: function (e, data) {}, // .bind('fileuploadsend', func);
|
137 |
+
// Callback for successful uploads:
|
138 |
+
// done: function (e, data) {}, // .bind('fileuploaddone', func);
|
139 |
+
// Callback for failed (abort or error) uploads:
|
140 |
+
// fail: function (e, data) {}, // .bind('fileuploadfail', func);
|
141 |
+
// Callback for completed (success, abort or error) requests:
|
142 |
+
// always: function (e, data) {}, // .bind('fileuploadalways', func);
|
143 |
+
// Callback for upload progress events:
|
144 |
+
// progress: function (e, data) {}, // .bind('fileuploadprogress', func);
|
145 |
+
// Callback for global upload progress events:
|
146 |
+
// progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);
|
147 |
+
// Callback for uploads start, equivalent to the global ajaxStart event:
|
148 |
+
// start: function (e) {}, // .bind('fileuploadstart', func);
|
149 |
+
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
150 |
+
// stop: function (e) {}, // .bind('fileuploadstop', func);
|
151 |
+
// Callback for change events of the fileInput collection:
|
152 |
+
// change: function (e, data) {}, // .bind('fileuploadchange', func);
|
153 |
+
// Callback for paste events to the dropZone collection:
|
154 |
+
// paste: function (e, data) {}, // .bind('fileuploadpaste', func);
|
155 |
+
// Callback for drop events of the dropZone collection:
|
156 |
+
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
|
157 |
+
// Callback for dragover events of the dropZone collection:
|
158 |
+
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
|
159 |
+
|
160 |
+
// The plugin options are used as settings object for the ajax calls.
|
161 |
+
// The following are jQuery ajax settings required for the file uploads:
|
162 |
+
processData: false,
|
163 |
+
contentType: false,
|
164 |
+
cache: false
|
165 |
+
},
|
166 |
+
|
167 |
+
// A list of options that require a refresh after assigning a new value:
|
168 |
+
_refreshOptionsList: ['namespace', 'dropZone', 'fileInput'],
|
169 |
+
|
170 |
+
_isXHRUpload: function (options) {
|
171 |
+
var undef = 'undefined';
|
172 |
+
return !options.forceIframeTransport &&
|
173 |
+
typeof XMLHttpRequestUpload !== undef && typeof File !== undef &&
|
174 |
+
(!options.multipart || typeof FormData !== undef);
|
175 |
+
},
|
176 |
+
|
177 |
+
_getFormData: function (options) {
|
178 |
+
var formData;
|
179 |
+
if (typeof options.formData === 'function') {
|
180 |
+
return options.formData(options.form);
|
181 |
+
} else if (j.isArray(options.formData)) {
|
182 |
+
return options.formData;
|
183 |
+
} else if (options.formData) {
|
184 |
+
formData = [];
|
185 |
+
j.each(options.formData, function (name, value) {
|
186 |
+
formData.push({name: name, value: value});
|
187 |
+
});
|
188 |
+
return formData;
|
189 |
+
}
|
190 |
+
return [];
|
191 |
+
},
|
192 |
+
|
193 |
+
_getTotal: function (files) {
|
194 |
+
var total = 0;
|
195 |
+
j.each(files, function (index, file) {
|
196 |
+
total += file.size || 1;
|
197 |
+
});
|
198 |
+
return total;
|
199 |
+
},
|
200 |
+
|
201 |
+
_onProgress: function (e, data) {
|
202 |
+
if (e.lengthComputable) {
|
203 |
+
var total = data.total || this._getTotal(data.files),
|
204 |
+
loaded = parseInt(
|
205 |
+
e.loaded / e.total * (data.chunkSize || total),
|
206 |
+
10
|
207 |
+
) + (data.uploadedBytes || 0);
|
208 |
+
this._loaded += loaded - (data.loaded || data.uploadedBytes || 0);
|
209 |
+
data.lengthComputable = true;
|
210 |
+
data.loaded = loaded;
|
211 |
+
data.total = total;
|
212 |
+
// Trigger a custom progress event with a total data property set
|
213 |
+
// to the file size(s) of the current upload and a loaded data
|
214 |
+
// property calculated accordingly:
|
215 |
+
this._trigger('progress', e, data);
|
216 |
+
// Trigger a global progress event for all current file uploads,
|
217 |
+
// including ajax calls queued for sequential file uploads:
|
218 |
+
this._trigger('progressall', e, {
|
219 |
+
lengthComputable: true,
|
220 |
+
loaded: this._loaded,
|
221 |
+
total: this._total
|
222 |
+
});
|
223 |
+
}
|
224 |
+
},
|
225 |
+
|
226 |
+
_initProgressListener: function (options) {
|
227 |
+
var that = this,
|
228 |
+
xhr = options.xhr ? options.xhr() : j.ajaxSettings.xhr();
|
229 |
+
// Accesss to the native XHR object is required to add event listeners
|
230 |
+
// for the upload progress event:
|
231 |
+
if (xhr.upload) {
|
232 |
+
j(xhr.upload).bind('progress', function (e) {
|
233 |
+
var oe = e.originalEvent;
|
234 |
+
// Make sure the progress event properties get copied over:
|
235 |
+
e.lengthComputable = oe.lengthComputable;
|
236 |
+
e.loaded = oe.loaded;
|
237 |
+
e.total = oe.total;
|
238 |
+
that._onProgress(e, options);
|
239 |
+
});
|
240 |
+
options.xhr = function () {
|
241 |
+
return xhr;
|
242 |
+
};
|
243 |
+
}
|
244 |
+
},
|
245 |
+
|
246 |
+
_initXHRData: function (options) {
|
247 |
+
var formData,
|
248 |
+
file = options.files[0];
|
249 |
+
if (!options.multipart || options.blob) {
|
250 |
+
// For non-multipart uploads and chunked uploads,
|
251 |
+
// file meta data is not part of the request body,
|
252 |
+
// so we transmit this data as part of the HTTP headers.
|
253 |
+
// For cross domain requests, these headers must be allowed
|
254 |
+
// via Access-Control-Allow-Headers or removed using
|
255 |
+
// the beforeSend callback:
|
256 |
+
options.headers = j.extend(options.headers, {
|
257 |
+
'X-File-Name': file.name,
|
258 |
+
'X-File-Type': file.type,
|
259 |
+
'X-File-Size': file.size
|
260 |
+
});
|
261 |
+
if (!options.blob) {
|
262 |
+
// Non-chunked non-multipart upload:
|
263 |
+
options.contentType = file.type;
|
264 |
+
options.data = file;
|
265 |
+
} else if (!options.multipart) {
|
266 |
+
// Chunked non-multipart upload:
|
267 |
+
options.contentType = 'application/octet-stream';
|
268 |
+
options.data = options.blob;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
if (options.multipart && typeof FormData !== 'undefined') {
|
272 |
+
if (options.postMessage) {
|
273 |
+
// window.postMessage does not allow sending FormData
|
274 |
+
// objects, so we just add the File/Blob objects to
|
275 |
+
// the formData array and let the postMessage window
|
276 |
+
// create the FormData object out of this array:
|
277 |
+
formData = this._getFormData(options);
|
278 |
+
if (options.blob) {
|
279 |
+
formData.push({
|
280 |
+
name: options.paramName,
|
281 |
+
value: options.blob
|
282 |
+
});
|
283 |
+
} else {
|
284 |
+
j.each(options.files, function (index, file) {
|
285 |
+
formData.push({
|
286 |
+
name: options.paramName,
|
287 |
+
value: file
|
288 |
+
});
|
289 |
+
});
|
290 |
+
}
|
291 |
+
} else {
|
292 |
+
if (options.formData instanceof FormData) {
|
293 |
+
formData = options.formData;
|
294 |
+
} else {
|
295 |
+
formData = new FormData();
|
296 |
+
j.each(this._getFormData(options), function (index, field) {
|
297 |
+
formData.append(field.name, field.value);
|
298 |
+
});
|
299 |
+
}
|
300 |
+
if (options.blob) {
|
301 |
+
formData.append(options.paramName, options.blob, file.name);
|
302 |
+
} else {
|
303 |
+
j.each(options.files, function (index, file) {
|
304 |
+
// File objects are also Blob instances.
|
305 |
+
// This check allows the tests to run with
|
306 |
+
// dummy objects:
|
307 |
+
if (file instanceof Blob) {
|
308 |
+
formData.append(options.paramName, file, file.name);
|
309 |
+
}
|
310 |
+
});
|
311 |
+
}
|
312 |
+
}
|
313 |
+
options.data = formData;
|
314 |
+
}
|
315 |
+
// Blob reference is not needed anymore, free memory:
|
316 |
+
options.blob = null;
|
317 |
+
},
|
318 |
+
|
319 |
+
_initIframeSettings: function (options) {
|
320 |
+
// Setting the dataType to iframe enables the iframe transport:
|
321 |
+
options.dataType = 'iframe ' + (options.dataType || '');
|
322 |
+
// The iframe transport accepts a serialized array as form data:
|
323 |
+
options.formData = this._getFormData(options);
|
324 |
+
// Add redirect url to form data on cross-domain uploads:
|
325 |
+
if (options.redirect && j('<a></a>').prop('href', options.url)
|
326 |
+
.prop('host') !== location.host) {
|
327 |
+
options.formData.push({
|
328 |
+
name: options.redirectParamName || 'redirect',
|
329 |
+
value: options.redirect
|
330 |
+
});
|
331 |
+
}
|
332 |
+
},
|
333 |
+
|
334 |
+
_initDataSettings: function (options) {
|
335 |
+
if (this._isXHRUpload(options)) {
|
336 |
+
if (!this._chunkedUpload(options, true)) {
|
337 |
+
if (!options.data) {
|
338 |
+
this._initXHRData(options);
|
339 |
+
}
|
340 |
+
this._initProgressListener(options);
|
341 |
+
}
|
342 |
+
if (options.postMessage) {
|
343 |
+
// Setting the dataType to postmessage enables the
|
344 |
+
// postMessage transport:
|
345 |
+
options.dataType = 'postmessage ' + (options.dataType || '');
|
346 |
+
}
|
347 |
+
} else {
|
348 |
+
this._initIframeSettings(options, 'iframe');
|
349 |
+
}
|
350 |
+
},
|
351 |
+
|
352 |
+
_initFormSettings: function (options) {
|
353 |
+
// Retrieve missing options from the input field and the
|
354 |
+
// associated form, if available:
|
355 |
+
if (!options.form || !options.form.length) {
|
356 |
+
options.form = j(options.fileInput.prop('form'));
|
357 |
+
}
|
358 |
+
if (!options.paramName) {
|
359 |
+
options.paramName = options.fileInput.prop('name') ||
|
360 |
+
'files[]';
|
361 |
+
}
|
362 |
+
if (!options.url) {
|
363 |
+
options.url = options.form.prop('action') || location.href;
|
364 |
+
}
|
365 |
+
// The HTTP request method must be "POST" or "PUT":
|
366 |
+
options.type = (options.type || options.form.prop('method') || '')
|
367 |
+
.toUpperCase();
|
368 |
+
if (options.type !== 'POST' && options.type !== 'PUT') {
|
369 |
+
options.type = 'POST';
|
370 |
+
}
|
371 |
+
},
|
372 |
+
|
373 |
+
_getAJAXSettings: function (data) {
|
374 |
+
var options = j.extend({}, this.options, data);
|
375 |
+
this._initFormSettings(options);
|
376 |
+
this._initDataSettings(options);
|
377 |
+
return options;
|
378 |
+
},
|
379 |
+
|
380 |
+
// Maps jqXHR callbacks to the equivalent
|
381 |
+
// methods of the given Promise object:
|
382 |
+
_enhancePromise: function (promise) {
|
383 |
+
promise.success = promise.done;
|
384 |
+
promise.error = promise.fail;
|
385 |
+
promise.complete = promise.always;
|
386 |
+
return promise;
|
387 |
+
},
|
388 |
+
|
389 |
+
// Creates and returns a Promise object enhanced with
|
390 |
+
// the jqXHR methods abort, success, error and complete:
|
391 |
+
_getXHRPromise: function (resolveOrReject, context, args) {
|
392 |
+
var dfd = j.Deferred(),
|
393 |
+
promise = dfd.promise();
|
394 |
+
context = context || this.options.context || promise;
|
395 |
+
if (resolveOrReject === true) {
|
396 |
+
dfd.resolveWith(context, args);
|
397 |
+
} else if (resolveOrReject === false) {
|
398 |
+
dfd.rejectWith(context, args);
|
399 |
+
}
|
400 |
+
promise.abort = dfd.promise;
|
401 |
+
return this._enhancePromise(promise);
|
402 |
+
},
|
403 |
+
|
404 |
+
// Uploads a file in multiple, sequential requests
|
405 |
+
// by splitting the file up in multiple blob chunks.
|
406 |
+
// If the second parameter is true, only tests if the file
|
407 |
+
// should be uploaded in chunks, but does not invoke any
|
408 |
+
// upload requests:
|
409 |
+
_chunkedUpload: function (options, testOnly) {
|
410 |
+
var that = this,
|
411 |
+
file = options.files[0],
|
412 |
+
fs = file.size,
|
413 |
+
ub = options.uploadedBytes = options.uploadedBytes || 0,
|
414 |
+
mcs = options.maxChunkSize || fs,
|
415 |
+
// Use the Blob methods with the slice implementation
|
416 |
+
// according to the W3C Blob API specification:
|
417 |
+
slice = file.webkitSlice || file.mozSlice || file.slice,
|
418 |
+
upload,
|
419 |
+
n,
|
420 |
+
jqXHR,
|
421 |
+
pipe;
|
422 |
+
if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) ||
|
423 |
+
options.data) {
|
424 |
+
return false;
|
425 |
+
}
|
426 |
+
if (testOnly) {
|
427 |
+
return true;
|
428 |
+
}
|
429 |
+
if (ub >= fs) {
|
430 |
+
file.error = 'uploadedBytes';
|
431 |
+
return this._getXHRPromise(
|
432 |
+
false,
|
433 |
+
options.context,
|
434 |
+
[null, 'error', file.error]
|
435 |
+
);
|
436 |
+
}
|
437 |
+
// n is the number of blobs to upload,
|
438 |
+
// calculated via filesize, uploaded bytes and max chunk size:
|
439 |
+
n = Math.ceil((fs - ub) / mcs);
|
440 |
+
// The chunk upload method accepting the chunk number as parameter:
|
441 |
+
upload = function (i) {
|
442 |
+
if (!i) {
|
443 |
+
return that._getXHRPromise(true, options.context);
|
444 |
+
}
|
445 |
+
// Upload the blobs in sequential order:
|
446 |
+
return upload(i -= 1).pipe(function () {
|
447 |
+
// Clone the options object for each chunk upload:
|
448 |
+
var o = j.extend({}, options);
|
449 |
+
o.blob = slice.call(
|
450 |
+
file,
|
451 |
+
ub + i * mcs,
|
452 |
+
ub + (i + 1) * mcs
|
453 |
+
);
|
454 |
+
// Store the current chunk size, as the blob itself
|
455 |
+
// will be dereferenced after data processing:
|
456 |
+
o.chunkSize = o.blob.size;
|
457 |
+
// Process the upload data (the blob and potential form data):
|
458 |
+
that._initXHRData(o);
|
459 |
+
// Add progress listeners for this chunk upload:
|
460 |
+
that._initProgressListener(o);
|
461 |
+
jqXHR = (j.ajax(o) || that._getXHRPromise(false, o.context))
|
462 |
+
.done(function () {
|
463 |
+
// Create a progress event if upload is done and
|
464 |
+
// no progress event has been invoked for this chunk:
|
465 |
+
if (!o.loaded) {
|
466 |
+
that._onProgress(j.Event('progress', {
|
467 |
+
lengthComputable: true,
|
468 |
+
loaded: o.chunkSize,
|
469 |
+
total: o.chunkSize
|
470 |
+
}), o);
|
471 |
+
}
|
472 |
+
options.uploadedBytes = o.uploadedBytes +=
|
473 |
+
o.chunkSize;
|
474 |
+
});
|
475 |
+
return jqXHR;
|
476 |
+
});
|
477 |
+
};
|
478 |
+
// Return the piped Promise object, enhanced with an abort method,
|
479 |
+
// which is delegated to the jqXHR object of the current upload,
|
480 |
+
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
481 |
+
pipe = upload(n);
|
482 |
+
pipe.abort = function () {
|
483 |
+
return jqXHR.abort();
|
484 |
+
};
|
485 |
+
return this._enhancePromise(pipe);
|
486 |
+
},
|
487 |
+
|
488 |
+
_beforeSend: function (e, data) {
|
489 |
+
if (this._active === 0) {
|
490 |
+
// the start callback is triggered when an upload starts
|
491 |
+
// and no other uploads are currently running,
|
492 |
+
// equivalent to the global ajaxStart event:
|
493 |
+
this._trigger('start');
|
494 |
+
}
|
495 |
+
this._active += 1;
|
496 |
+
// Initialize the global progress values:
|
497 |
+
this._loaded += data.uploadedBytes || 0;
|
498 |
+
this._total += this._getTotal(data.files);
|
499 |
+
},
|
500 |
+
|
501 |
+
_onDone: function (result, textStatus, jqXHR, options) {
|
502 |
+
if (!this._isXHRUpload(options)) {
|
503 |
+
// Create a progress event for each iframe load:
|
504 |
+
this._onProgress(j.Event('progress', {
|
505 |
+
lengthComputable: true,
|
506 |
+
loaded: 1,
|
507 |
+
total: 1
|
508 |
+
}), options);
|
509 |
+
}
|
510 |
+
options.result = result;
|
511 |
+
options.textStatus = textStatus;
|
512 |
+
options.jqXHR = jqXHR;
|
513 |
+
this._trigger('done', null, options);
|
514 |
+
},
|
515 |
+
|
516 |
+
_onFail: function (jqXHR, textStatus, errorThrown, options) {
|
517 |
+
options.jqXHR = jqXHR;
|
518 |
+
options.textStatus = textStatus;
|
519 |
+
options.errorThrown = errorThrown;
|
520 |
+
this._trigger('fail', null, options);
|
521 |
+
if (options.recalculateProgress) {
|
522 |
+
// Remove the failed (error or abort) file upload from
|
523 |
+
// the global progress calculation:
|
524 |
+
this._loaded -= options.loaded || options.uploadedBytes || 0;
|
525 |
+
this._total -= options.total || this._getTotal(options.files);
|
526 |
+
}
|
527 |
+
},
|
528 |
+
|
529 |
+
_onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {
|
530 |
+
this._active -= 1;
|
531 |
+
options.textStatus = textStatus;
|
532 |
+
if (jqXHRorError && jqXHRorError.always) {
|
533 |
+
options.jqXHR = jqXHRorError;
|
534 |
+
options.result = jqXHRorResult;
|
535 |
+
} else {
|
536 |
+
options.jqXHR = jqXHRorResult;
|
537 |
+
options.errorThrown = jqXHRorError;
|
538 |
+
}
|
539 |
+
this._trigger('always', null, options);
|
540 |
+
if (this._active === 0) {
|
541 |
+
// The stop callback is triggered when all uploads have
|
542 |
+
// been completed, equivalent to the global ajaxStop event:
|
543 |
+
this._trigger('stop');
|
544 |
+
// Reset the global progress values:
|
545 |
+
this._loaded = this._total = 0;
|
546 |
+
}
|
547 |
+
},
|
548 |
+
|
549 |
+
_onSend: function (e, data) {
|
550 |
+
var that = this,
|
551 |
+
jqXHR,
|
552 |
+
slot,
|
553 |
+
pipe,
|
554 |
+
options = that._getAJAXSettings(data),
|
555 |
+
send = function (resolve, args) {
|
556 |
+
that._sending += 1;
|
557 |
+
jqXHR = jqXHR || (
|
558 |
+
(resolve !== false &&
|
559 |
+
that._trigger('send', e, options) !== false &&
|
560 |
+
(that._chunkedUpload(options) || j.ajax(options))) ||
|
561 |
+
that._getXHRPromise(false, options.context, args)
|
562 |
+
).done(function (result, textStatus, jqXHR) {
|
563 |
+
that._onDone(result, textStatus, jqXHR, options);
|
564 |
+
}).fail(function (jqXHR, textStatus, errorThrown) {
|
565 |
+
that._onFail(jqXHR, textStatus, errorThrown, options);
|
566 |
+
}).always(function (jqXHRorResult, textStatus, jqXHRorError) {
|
567 |
+
that._sending -= 1;
|
568 |
+
that._onAlways(
|
569 |
+
jqXHRorResult,
|
570 |
+
textStatus,
|
571 |
+
jqXHRorError,
|
572 |
+
options
|
573 |
+
);
|
574 |
+
if (options.limitConcurrentUploads &&
|
575 |
+
options.limitConcurrentUploads > that._sending) {
|
576 |
+
// Start the next queued upload,
|
577 |
+
// that has not been aborted:
|
578 |
+
var nextSlot = that._slots.shift();
|
579 |
+
while (nextSlot) {
|
580 |
+
if (!nextSlot.isRejected()) {
|
581 |
+
nextSlot.resolve();
|
582 |
+
break;
|
583 |
+
}
|
584 |
+
nextSlot = that._slots.shift();
|
585 |
+
}
|
586 |
+
}
|
587 |
+
});
|
588 |
+
return jqXHR;
|
589 |
+
};
|
590 |
+
this._beforeSend(e, options);
|
591 |
+
if (this.options.sequentialUploads ||
|
592 |
+
(this.options.limitConcurrentUploads &&
|
593 |
+
this.options.limitConcurrentUploads <= this._sending)) {
|
594 |
+
if (this.options.limitConcurrentUploads > 1) {
|
595 |
+
slot = j.Deferred();
|
596 |
+
this._slots.push(slot);
|
597 |
+
pipe = slot.pipe(send);
|
598 |
+
} else {
|
599 |
+
pipe = (this._sequence = this._sequence.pipe(send, send));
|
600 |
+
}
|
601 |
+
// Return the piped Promise object, enhanced with an abort method,
|
602 |
+
// which is delegated to the jqXHR object of the current upload,
|
603 |
+
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
604 |
+
pipe.abort = function () {
|
605 |
+
var args = [undefined, 'abort', 'abort'];
|
606 |
+
if (!jqXHR) {
|
607 |
+
if (slot) {
|
608 |
+
slot.rejectWith(args);
|
609 |
+
}
|
610 |
+
return send(false, args);
|
611 |
+
}
|
612 |
+
return jqXHR.abort();
|
613 |
+
};
|
614 |
+
return this._enhancePromise(pipe);
|
615 |
+
}
|
616 |
+
return send();
|
617 |
+
},
|
618 |
+
|
619 |
+
_onAdd: function (e, data) {
|
620 |
+
var that = this,
|
621 |
+
result = true,
|
622 |
+
options = j.extend({}, this.options, data),
|
623 |
+
limit = options.limitMultiFileUploads,
|
624 |
+
fileSet,
|
625 |
+
i;
|
626 |
+
if (!(options.singleFileUploads || limit) ||
|
627 |
+
!this._isXHRUpload(options)) {
|
628 |
+
fileSet = [data.files];
|
629 |
+
} else if (!options.singleFileUploads && limit) {
|
630 |
+
fileSet = [];
|
631 |
+
for (i = 0; i < data.files.length; i += limit) {
|
632 |
+
fileSet.push(data.files.slice(i, i + limit));
|
633 |
+
}
|
634 |
+
}
|
635 |
+
data.originalFiles = data.files;
|
636 |
+
j.each(fileSet || data.files, function (index, element) {
|
637 |
+
var files = fileSet ? element : [element],
|
638 |
+
newData = j.extend({}, data, {files: files});
|
639 |
+
newData.submit = function () {
|
640 |
+
newData.jqXHR = this.jqXHR =
|
641 |
+
(that._trigger('submit', e, this) !== false) &&
|
642 |
+
that._onSend(e, this);
|
643 |
+
return this.jqXHR;
|
644 |
+
};
|
645 |
+
return (result = that._trigger('add', e, newData));
|
646 |
+
});
|
647 |
+
return result;
|
648 |
+
},
|
649 |
+
|
650 |
+
// File Normalization for Gecko 1.9.1 (Firefox 3.5) support:
|
651 |
+
_normalizeFile: function (index, file) {
|
652 |
+
if (file.name === undefined && file.size === undefined) {
|
653 |
+
file.name = file.fileName;
|
654 |
+
file.size = file.fileSize;
|
655 |
+
}
|
656 |
+
},
|
657 |
+
|
658 |
+
_replaceFileInput: function (input) {
|
659 |
+
var inputClone = input.clone(true);
|
660 |
+
j('<form></form>').append(inputClone)[0].reset();
|
661 |
+
// Detaching allows to insert the fileInput on another form
|
662 |
+
// without loosing the file input value:
|
663 |
+
input.after(inputClone).detach();
|
664 |
+
// Avoid memory leaks with the detached file input:
|
665 |
+
j.cleanData(input.unbind('remove'));
|
666 |
+
// Replace the original file input element in the fileInput
|
667 |
+
// collection with the clone, which has been copied including
|
668 |
+
// event handlers:
|
669 |
+
this.options.fileInput = this.options.fileInput.map(function (i, el) {
|
670 |
+
if (el === input[0]) {
|
671 |
+
return inputClone[0];
|
672 |
+
}
|
673 |
+
return el;
|
674 |
+
});
|
675 |
+
// If the widget has been initialized on the file input itself,
|
676 |
+
// override this.element with the file input clone:
|
677 |
+
if (input[0] === this.element[0]) {
|
678 |
+
this.element = inputClone;
|
679 |
+
}
|
680 |
+
},
|
681 |
+
|
682 |
+
_onChange: function (e) {
|
683 |
+
var that = e.data.fileupload,
|
684 |
+
data = {
|
685 |
+
files: j.each(j.makeArray(e.target.files), that._normalizeFile),
|
686 |
+
fileInput: j(e.target),
|
687 |
+
form: j(e.target.form)
|
688 |
+
};
|
689 |
+
if (!data.files.length) {
|
690 |
+
// If the files property is not available, the browser does not
|
691 |
+
// support the File API and we add a pseudo File object with
|
692 |
+
// the input value as name with path information removed:
|
693 |
+
data.files = [{name: e.target.value.replace(/^.*\\/, '')}];
|
694 |
+
}
|
695 |
+
if (that.options.replaceFileInput) {
|
696 |
+
that._replaceFileInput(data.fileInput);
|
697 |
+
}
|
698 |
+
if (that._trigger('change', e, data) === false ||
|
699 |
+
that._onAdd(e, data) === false) {
|
700 |
+
return false;
|
701 |
+
}
|
702 |
+
},
|
703 |
+
|
704 |
+
_onPaste: function (e) {
|
705 |
+
var that = e.data.fileupload,
|
706 |
+
cbd = e.originalEvent.clipboardData,
|
707 |
+
items = (cbd && cbd.items) || [],
|
708 |
+
data = {files: []};
|
709 |
+
j.each(items, function (index, item) {
|
710 |
+
var file = item.getAsFile && item.getAsFile();
|
711 |
+
if (file) {
|
712 |
+
data.files.push(file);
|
713 |
+
}
|
714 |
+
});
|
715 |
+
if (that._trigger('paste', e, data) === false ||
|
716 |
+
that._onAdd(e, data) === false) {
|
717 |
+
return false;
|
718 |
+
}
|
719 |
+
},
|
720 |
+
|
721 |
+
_onDrop: function (e) {
|
722 |
+
var that = e.data.fileupload,
|
723 |
+
dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer,
|
724 |
+
data = {
|
725 |
+
files: j.each(
|
726 |
+
j.makeArray(dataTransfer && dataTransfer.files),
|
727 |
+
that._normalizeFile
|
728 |
+
)
|
729 |
+
};
|
730 |
+
if (that._trigger('drop', e, data) === false ||
|
731 |
+
that._onAdd(e, data) === false) {
|
732 |
+
return false;
|
733 |
+
}
|
734 |
+
e.preventDefault();
|
735 |
+
},
|
736 |
+
|
737 |
+
_onDragOver: function (e) {
|
738 |
+
var that = e.data.fileupload,
|
739 |
+
dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer;
|
740 |
+
if (that._trigger('dragover', e) === false) {
|
741 |
+
return false;
|
742 |
+
}
|
743 |
+
if (dataTransfer) {
|
744 |
+
dataTransfer.dropEffect = dataTransfer.effectAllowed = 'copy';
|
745 |
+
}
|
746 |
+
e.preventDefault();
|
747 |
+
},
|
748 |
+
|
749 |
+
_initEventHandlers: function () {
|
750 |
+
var ns = this.options.namespace;
|
751 |
+
this.options.dropZone
|
752 |
+
.bind('dragover.' + ns, {fileupload: this}, this._onDragOver)
|
753 |
+
.bind('drop.' + ns, {fileupload: this}, this._onDrop)
|
754 |
+
.bind('paste.' + ns, {fileupload: this}, this._onPaste);
|
755 |
+
this.options.fileInput
|
756 |
+
.bind('change.' + ns, {fileupload: this}, this._onChange);
|
757 |
+
},
|
758 |
+
|
759 |
+
_destroyEventHandlers: function () {
|
760 |
+
var ns = this.options.namespace;
|
761 |
+
this.options.dropZone
|
762 |
+
.unbind('dragover.' + ns, this._onDragOver)
|
763 |
+
.unbind('drop.' + ns, this._onDrop)
|
764 |
+
.unbind('paste.' + ns, this._onPaste);
|
765 |
+
this.options.fileInput
|
766 |
+
.unbind('change.' + ns, this._onChange);
|
767 |
+
},
|
768 |
+
|
769 |
+
_setOption: function (key, value) {
|
770 |
+
var refresh = j.inArray(key, this._refreshOptionsList) !== -1;
|
771 |
+
if (refresh) {
|
772 |
+
this._destroyEventHandlers();
|
773 |
+
}
|
774 |
+
j.Widget.prototype._setOption.call(this, key, value);
|
775 |
+
if (refresh) {
|
776 |
+
this._initSpecialOptions();
|
777 |
+
this._initEventHandlers();
|
778 |
+
}
|
779 |
+
},
|
780 |
+
|
781 |
+
_initSpecialOptions: function () {
|
782 |
+
var options = this.options;
|
783 |
+
if (options.fileInput === undefined) {
|
784 |
+
options.fileInput = this.element.is('input:file') ?
|
785 |
+
this.element : this.element.find('input:file');
|
786 |
+
} else if (!(options.fileInput instanceof j)) {
|
787 |
+
options.fileInput = j(options.fileInput);
|
788 |
+
}
|
789 |
+
if (!(options.dropZone instanceof j)) {
|
790 |
+
options.dropZone = j(options.dropZone);
|
791 |
+
}
|
792 |
+
},
|
793 |
+
|
794 |
+
_create: function () {
|
795 |
+
var options = this.options,
|
796 |
+
dataOpts = j.extend({}, this.element.data());
|
797 |
+
dataOpts[this.widgetName] = undefined;
|
798 |
+
j.extend(options, dataOpts);
|
799 |
+
options.namespace = options.namespace || this.widgetName;
|
800 |
+
this._initSpecialOptions();
|
801 |
+
this._slots = [];
|
802 |
+
this._sequence = this._getXHRPromise(true);
|
803 |
+
this._sending = this._active = this._loaded = this._total = 0;
|
804 |
+
this._initEventHandlers();
|
805 |
+
},
|
806 |
+
|
807 |
+
destroy: function () {
|
808 |
+
this._destroyEventHandlers();
|
809 |
+
j.Widget.prototype.destroy.call(this);
|
810 |
+
},
|
811 |
+
|
812 |
+
enable: function () {
|
813 |
+
j.Widget.prototype.enable.call(this);
|
814 |
+
this._initEventHandlers();
|
815 |
+
},
|
816 |
+
|
817 |
+
disable: function () {
|
818 |
+
this._destroyEventHandlers();
|
819 |
+
j.Widget.prototype.disable.call(this);
|
820 |
+
},
|
821 |
+
|
822 |
+
// This method is exposed to the widget API and allows adding files
|
823 |
+
// using the fileupload API. The data parameter accepts an object which
|
824 |
+
// must have a files property and can contain additional options:
|
825 |
+
// .fileupload('add', {files: filesList});
|
826 |
+
add: function (data) {
|
827 |
+
if (!data || this.options.disabled) {
|
828 |
+
return;
|
829 |
+
}
|
830 |
+
data.files = j.each(j.makeArray(data.files), this._normalizeFile);
|
831 |
+
this._onAdd(null, data);
|
832 |
+
},
|
833 |
+
|
834 |
+
// This method is exposed to the widget API and allows sending files
|
835 |
+
// using the fileupload API. The data parameter accepts an object which
|
836 |
+
// must have a files property and can contain additional options:
|
837 |
+
// .fileupload('send', {files: filesList});
|
838 |
+
// The method returns a Promise object for the file upload call.
|
839 |
+
send: function (data) {
|
840 |
+
if (!data) data = {};
|
841 |
+
|
842 |
+
// [Prepare necessary parameters before upload:]
|
843 |
+
data.form = j("form");
|
844 |
+
data.context = this.element.find(".template-upload"); // [needed to show succeeded and failed files in the UI.]
|
845 |
+
data.fileInput = j(); // [fileInputs collection is necessaty for IE (will be filled below).]
|
846 |
+
data.files = []; // [files to upload.]
|
847 |
+
|
848 |
+
// [Collect all the selected files to upload:]
|
849 |
+
this.element.find(".template-upload").each(function() {
|
850 |
+
var curData = j(this).data('data');
|
851 |
+
data.fileInput = data.fileInput.add(curData.fileInput);
|
852 |
+
data.files = data.files.concat(curData.files);
|
853 |
+
});
|
854 |
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
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery Iframe Transport Plugin 1.3
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2011, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint unparam: true, nomen: true */
|
13 |
+
/*global define, window, document */
|
14 |
+
|
15 |
+
(function (factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define(['jquery'], factory);
|
20 |
+
} else {
|
21 |
+
// Browser globals:
|
22 |
+
factory(window.jQuery);
|
23 |
+
}
|
24 |
+
}(function (j) {
|
25 |
+
'use strict';
|
26 |
+
|
27 |
+
// Helper variable to create unique names for the transport iframes:
|
28 |
+
var counter = 0;
|
29 |
+
|
30 |
+
// The iframe transport accepts three additional options:
|
31 |
+
// options.fileInput: a jQuery collection of file input fields
|
32 |
+
// options.paramName: the parameter name for the file form data,
|
33 |
+
// overrides the name property of the file input field(s)
|
34 |
+
// options.formData: an array of objects with name and value properties,
|
35 |
+
// equivalent to the return data of .serializeArray(), e.g.:
|
36 |
+
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
37 |
+
j.ajaxTransport('iframe', function (options) {
|
38 |
+
if (options.async && (options.type === 'POST' || options.type === 'GET')) {
|
39 |
+
var form,
|
40 |
+
iframe;
|
41 |
+
return {
|
42 |
+
send: function (_, completeCallback) {
|
43 |
+
form = j('<form style="display:none;"></form>');
|
44 |
+
// javascript:false as initial iframe src
|
45 |
+
// prevents warning popups on HTTPS in IE6.
|
46 |
+
// IE versions below IE8 cannot set the name property of
|
47 |
+
// elements that have already been added to the DOM,
|
48 |
+
// so we set the name along with the iframe HTML markup:
|
49 |
+
iframe = j(
|
50 |
+
'<iframe src="javascript:false;" name="iframe-transport-' +
|
51 |
+
(counter += 1) + '"></iframe>'
|
52 |
+
).bind('load', function () {
|
53 |
+
var fileInputClones;
|
54 |
+
iframe
|
55 |
+
.unbind('load')
|
56 |
+
.bind('load', function () {
|
57 |
+
var response;
|
58 |
+
// Wrap in a try/catch block to catch exceptions thrown
|
59 |
+
// when trying to access cross-domain iframe contents:
|
60 |
+
try {
|
61 |
+
response = iframe.contents();
|
62 |
+
// Google Chrome and Firefox do not throw an
|
63 |
+
// exception when calling iframe.contents() on
|
64 |
+
// cross-domain requests, so we unify the response:
|
65 |
+
if (!response.length || !response[0].firstChild) {
|
66 |
+
throw new Error();
|
67 |
+
}
|
68 |
+
} catch (e) {
|
69 |
+
response = undefined;
|
70 |
+
}
|
71 |
+
// The complete callback returns the
|
72 |
+
// iframe content document as response object:
|
73 |
+
completeCallback(
|
74 |
+
200,
|
75 |
+
'success',
|
76 |
+
{'iframe': response}
|
77 |
+
);
|
78 |
+
// Fix for IE endless progress bar activity bug
|
79 |
+
// (happens on form submits to iframe targets):
|
80 |
+
j('<iframe src="javascript:false;"></iframe>')
|
81 |
+
.appendTo(form);
|
82 |
+
form.remove();
|
83 |
+
});
|
84 |
+
form
|
85 |
+
.prop('target', iframe.prop('name'))
|
86 |
+
.prop('action', options.url)
|
87 |
+
.prop('method', options.type);
|
88 |
+
if (options.formData) {
|
89 |
+
j.each(options.formData, function (index, field) {
|
90 |
+
j('<input type="hidden"/>')
|
91 |
+
.prop('name', field.name)
|
92 |
+
.val(field.value)
|
93 |
+
.appendTo(form);
|
94 |
+
});
|
95 |
+
}
|
96 |
+
if (options.fileInput && options.fileInput.length &&
|
97 |
+
options.type === 'POST') {
|
98 |
+
fileInputClones = options.fileInput.clone();
|
99 |
+
// Insert a clone for each file input field:
|
100 |
+
options.fileInput.after(function (index) {
|
101 |
+
return fileInputClones[index];
|
102 |
+
});
|
103 |
+
if (options.paramName) {
|
104 |
+
options.fileInput.each(function () {
|
105 |
+
j(this).prop('name', options.paramName);
|
106 |
+
});
|
107 |
+
}
|
108 |
+
// Appending the file input fields to the hidden form
|
109 |
+
// removes them from their original location:
|
110 |
+
form
|
111 |
+
.append(options.fileInput)
|
112 |
+
.prop('enctype', 'multipart/form-data')
|
113 |
+
// enctype must be set as encoding for IE:
|
114 |
+
.prop('encoding', 'multipart/form-data');
|
115 |
+
}
|
116 |
+
form.submit();
|
117 |
+
// Insert the file input fields at their original location
|
118 |
+
// by replacing the clones with the originals:
|
119 |
+
if (fileInputClones && fileInputClones.length) {
|
120 |
+
options.fileInput.each(function (index, input) {
|
121 |
+
var clone = j(fileInputClones[index]);
|
122 |
+
j(input).prop('name', clone.prop('name'));
|
123 |
+
clone.replaceWith(input);
|
124 |
+
});
|
125 |
+
}
|
126 |
+
});
|
127 |
+
form.append(iframe).appendTo(document.body);
|
128 |
+
},
|
129 |
+
abort: function () {
|
130 |
+
if (iframe) {
|
131 |
+
// javascript:false as iframe src aborts the request
|
132 |
+
// and prevents warning popups on HTTPS in IE6.
|
133 |
+
// concat is used to avoid the "Script URL" JSLint error:
|
134 |
+
iframe
|
135 |
+
.unbind('load')
|
136 |
+
.prop('src', 'javascript'.concat(':false;'));
|
137 |
+
}
|
138 |
+
if (form) {
|
139 |
+
form.remove();
|
140 |
+
}
|
141 |
+
}
|
142 |
+
};
|
143 |
+
}
|
144 |
+
});
|
145 |
+
|
146 |
+
// The iframe transport returns the iframe content document as response.
|
147 |
+
// The following adds converters from iframe to text, json, html, and script:
|
148 |
+
j.ajaxSetup({
|
149 |
+
converters: {
|
150 |
+
'iframe text': function (iframe) {
|
151 |
+
return j(iframe[0].body).text();
|
152 |
+
},
|
153 |
+
'iframe json': function (iframe) {
|
154 |
+
return j.parseJSON(j(iframe[0].body).text());
|
155 |
+
},
|
156 |
+
'iframe html': function (iframe) {
|
157 |
+
return j(iframe[0].body).html();
|
158 |
+
},
|
159 |
+
'iframe script': function (iframe) {
|
160 |
+
return j.globalEval(j(iframe[0].body).text());
|
161 |
+
}
|
162 |
+
}
|
163 |
+
});
|
164 |
+
|
165 |
+
}));
|
js/wexo_imageupload/jquery/jquery.js
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
2 |
+
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
|
3 |
+
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
|
4 |
+
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
5 |
+
|
6 |
+
|
js/wexo_imageupload/jquery/noConflict.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
var j = jQuery.noConflict();
|
js/wexo_imageupload/locale.js
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery File Upload Plugin Localization Example 6.5
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2012, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
window.locale = {
|
13 |
+
"fileupload": {
|
14 |
+
"errors": {
|
15 |
+
"maxFileSize": "File is too big",
|
16 |
+
"minFileSize": "File is too small",
|
17 |
+
"acceptFileTypes": "Filetype not allowed",
|
18 |
+
"maxNumberOfFiles": "Max number of files exceeded",
|
19 |
+
"uploadedBytes": "Uploaded bytes exceed file size",
|
20 |
+
"emptyResult": "Empty file upload result"
|
21 |
+
},
|
22 |
+
"error": "Error",
|
23 |
+
"start": "Start",
|
24 |
+
"cancel": "Cancel",
|
25 |
+
"destroy": "Delete"
|
26 |
+
}
|
27 |
+
};
|
js/wexo_imageupload/main.js
ADDED
@@ -0,0 +1,64 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery File Upload Plugin JS Example 6.5
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2010, Sebastian Tschan
|
6 |
+
* https://blueimp.net
|
7 |
+
*
|
8 |
+
* Licensed under the MIT license:
|
9 |
+
* http://www.opensource.org/licenses/MIT
|
10 |
+
*/
|
11 |
+
|
12 |
+
/*jslint nomen: true, unparam: true, regexp: true */
|
13 |
+
/*global j, window, document */
|
14 |
+
|
15 |
+
j(function () {
|
16 |
+
'use strict';
|
17 |
+
|
18 |
+
// Initialize the jQuery File Upload widget:
|
19 |
+
j('#fileupload').fileupload();
|
20 |
+
|
21 |
+
// Enable iframe cross-domain access via redirect option:
|
22 |
+
j('#fileupload').fileupload(
|
23 |
+
'option',
|
24 |
+
'redirect',
|
25 |
+
window.location.href.replace(
|
26 |
+
/\/[^\/]*$/,
|
27 |
+
'/cors/result.html?%s'
|
28 |
+
)
|
29 |
+
);
|
30 |
+
|
31 |
+
if (window.location.hostname === 'blueimp.github.com') {
|
32 |
+
// Demo settings:
|
33 |
+
j('#fileupload').fileupload('option', {
|
34 |
+
url: '//jquery-file-upload.appspot.com/',
|
35 |
+
maxFileSize: 5000000,
|
36 |
+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
37 |
+
resizeMaxWidth: 1920,
|
38 |
+
resizeMaxHeight: 1200
|
39 |
+
});
|
40 |
+
// Upload server status check for browsers with CORS support:
|
41 |
+
if (j.ajaxSettings.xhr().withCredentials !== undefined) {
|
42 |
+
j.ajax({
|
43 |
+
url: '//jquery-file-upload.appspot.com/',
|
44 |
+
type: 'HEAD'
|
45 |
+
}).fail(function () {
|
46 |
+
j('<span class="alert alert-error"/>')
|
47 |
+
.text('Upload server currently unavailable - ' +
|
48 |
+
new Date())
|
49 |
+
.appendTo('#fileupload');
|
50 |
+
});
|
51 |
+
}
|
52 |
+
} else {
|
53 |
+
// Load existing files:
|
54 |
+
j('#fileupload').each(function () {
|
55 |
+
var that = this;
|
56 |
+
j.getJSON(this.action, function (result) {
|
57 |
+
if (result && result.length) {
|
58 |
+
j(that).fileupload('option', 'done')
|
59 |
+
.call(that, null, {result: result});
|
60 |
+
}
|
61 |
+
});
|
62 |
+
});
|
63 |
+
}
|
64 |
+
});
|
js/wexo_imageupload/statusLoader.gif
ADDED
Binary file
|
js/wexo_imageupload/templateBorder.gif
ADDED
Binary file
|
js/wexo_imageupload/vendor/jquery.ui.widget.js
ADDED
@@ -0,0 +1,282 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
/*
|
2 |
+
* jQuery UI Widget 1.8.18+amd
|
3 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
4 |
+
*
|
5 |
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
6 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
7 |
+
* http://jquery.org/license
|
8 |
+
*
|
9 |
+
* http://docs.jquery.com/UI/Widget
|
10 |
+
*/
|
11 |
+
|
12 |
+
(function (factory) {
|
13 |
+
if (typeof define === "function" && define.amd) {
|
14 |
+
// Register as an anonymous AMD module:
|
15 |
+
define(["jquery"], factory);
|
16 |
+
} else {
|
17 |
+
// Browser globals:
|
18 |
+
factory(jQuery);
|
19 |
+
}
|
20 |
+
}(function( j, undefined ) {
|
21 |
+
|
22 |
+
// jQuery 1.4+
|
23 |
+
if ( j.cleanData ) {
|
24 |
+
var _cleanData = j.cleanData;
|
25 |
+
j.cleanData = function( elems ) {
|
26 |
+
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
27 |
+
try {
|
28 |
+
j( elem ).triggerHandler( "remove" );
|
29 |
+
// http://bugs.jquery.com/ticket/8235
|
30 |
+
} catch( e ) {}
|
31 |
+
}
|
32 |
+
_cleanData( elems );
|
33 |
+
};
|
34 |
+
} else {
|
35 |
+
var _remove = j.fn.remove;
|
36 |
+
j.fn.remove = function( selector, keepData ) {
|
37 |
+
return this.each(function() {
|
38 |
+
if ( !keepData ) {
|
39 |
+
if ( !selector || j.filter( selector, [ this ] ).length ) {
|
40 |
+
j( "*", this ).add( [ this ] ).each(function() {
|
41 |
+
try {
|
42 |
+
j( this ).triggerHandler( "remove" );
|
43 |
+
// http://bugs.jquery.com/ticket/8235
|
44 |
+
} catch( e ) {}
|
45 |
+
});
|
46 |
+
}
|
47 |
+
}
|
48 |
+
return _remove.call( j(this), selector, keepData );
|
49 |
+
});
|
50 |
+
};
|
51 |
+
}
|
52 |
+
|
53 |
+
j.widget = function( name, base, prototype ) {
|
54 |
+
var namespace = name.split( "." )[ 0 ],
|
55 |
+
fullName;
|
56 |
+
name = name.split( "." )[ 1 ];
|
57 |
+
fullName = namespace + "-" + name;
|
58 |
+
|
59 |
+
if ( !prototype ) {
|
60 |
+
prototype = base;
|
61 |
+
base = j.Widget;
|
62 |
+
}
|
63 |
+
|
64 |
+
// create selector for plugin
|
65 |
+
j.expr[ ":" ][ fullName ] = function( elem ) {
|
66 |
+
return !!j.data( elem, name );
|
67 |
+
};
|
68 |
+
|
69 |
+
j[ namespace ] = j[ namespace ] || {};
|
70 |
+
j[ namespace ][ name ] = function( options, element ) {
|
71 |
+
// allow instantiation without initializing for simple inheritance
|
72 |
+
if ( arguments.length ) {
|
73 |
+
this._createWidget( options, element );
|
74 |
+
}
|
75 |
+
};
|
76 |
+
|
77 |
+
var basePrototype = new base();
|
78 |
+
// we need to make the options hash a property directly on the new instance
|
79 |
+
// otherwise we'll modify the options hash on the prototype that we're
|
80 |
+
// inheriting from
|
81 |
+
// j.each( basePrototype, function( key, val ) {
|
82 |
+
// if ( j.isPlainObject(val) ) {
|
83 |
+
// basePrototype[ key ] = j.extend( {}, val );
|
84 |
+
// }
|
85 |
+
// });
|
86 |
+
basePrototype.options = j.extend( true, {}, basePrototype.options );
|
87 |
+
j[ namespace ][ name ].prototype = j.extend( true, basePrototype, {
|
88 |
+
namespace: namespace,
|
89 |
+
widgetName: name,
|
90 |
+
widgetEventPrefix: j[ namespace ][ name ].prototype.widgetEventPrefix || name,
|
91 |
+
widgetBaseClass: fullName
|
92 |
+
}, prototype );
|
93 |
+
|
94 |
+
j.widget.bridge( name, j[ namespace ][ name ] );
|
95 |
+
};
|
96 |
+
|
97 |
+
j.widget.bridge = function( name, object ) {
|
98 |
+
j.fn[ name ] = function( options ) {
|
99 |
+
var isMethodCall = typeof options === "string",
|
100 |
+
args = Array.prototype.slice.call( arguments, 1 ),
|
101 |
+
returnValue = this;
|
102 |
+
|
103 |
+
// allow multiple hashes to be passed on init
|
104 |
+
options = !isMethodCall && args.length ?
|
105 |
+
j.extend.apply( null, [ true, options ].concat(args) ) :
|
106 |
+
options;
|
107 |
+
|
108 |
+
// prevent calls to internal methods
|
109 |
+
if ( isMethodCall && options.charAt( 0 ) === "_" ) {
|
110 |
+
return returnValue;
|
111 |
+
}
|
112 |
+
|
113 |
+
if ( isMethodCall ) {
|
114 |
+
this.each(function() {
|
115 |
+
var instance = j.data( this, name ),
|
116 |
+
methodValue = instance && j.isFunction( instance[options] ) ?
|
117 |
+
instance[ options ].apply( instance, args ) :
|
118 |
+
instance;
|
119 |
+
// TODO: add this back in 1.9 and use j.error() (see #5972)
|
120 |
+
// if ( !instance ) {
|
121 |
+
// throw "cannot call methods on " + name + " prior to initialization; " +
|
122 |
+
// "attempted to call method '" + options + "'";
|
123 |
+
// }
|
124 |
+
// if ( !j.isFunction( instance[options] ) ) {
|
125 |
+
// throw "no such method '" + options + "' for " + name + " widget instance";
|
126 |
+
// }
|
127 |
+
// var methodValue = instance[ options ].apply( instance, args );
|
128 |
+
if ( methodValue !== instance && methodValue !== undefined ) {
|
129 |
+
returnValue = methodValue;
|
130 |
+
return false;
|
131 |
+
}
|
132 |
+
});
|
133 |
+
} else {
|
134 |
+
this.each(function() {
|
135 |
+
var instance = j.data( this, name );
|
136 |
+
if ( instance ) {
|
137 |
+
instance.option( options || {} )._init();
|
138 |
+
} else {
|
139 |
+
j.data( this, name, new object( options, this ) );
|
140 |
+
}
|
141 |
+
});
|
142 |
+
}
|
143 |
+
|
144 |
+
return returnValue;
|
145 |
+
};
|
146 |
+
};
|
147 |
+
|
148 |
+
j.Widget = function( options, element ) {
|
149 |
+
// allow instantiation without initializing for simple inheritance
|
150 |
+
if ( arguments.length ) {
|
151 |
+
this._createWidget( options, element );
|
152 |
+
}
|
153 |
+
};
|
154 |
+
|
155 |
+
j.Widget.prototype = {
|
156 |
+
widgetName: "widget",
|
157 |
+
widgetEventPrefix: "",
|
158 |
+
options: {
|
159 |
+
disabled: false
|
160 |
+
},
|
161 |
+
_createWidget: function( options, element ) {
|
162 |
+
// j.widget.bridge stores the plugin instance, but we do it anyway
|
163 |
+
// so that it's stored even before the _create function runs
|
164 |
+
j.data( element, this.widgetName, this );
|
165 |
+
this.element = j( element );
|
166 |
+
this.options = j.extend( true, {},
|
167 |
+
this.options,
|
168 |
+
this._getCreateOptions(),
|
169 |
+
options );
|
170 |
+
|
171 |
+
var self = this;
|
172 |
+
this.element.bind( "remove." + this.widgetName, function() {
|
173 |
+
self.destroy();
|
174 |
+
});
|
175 |
+
|
176 |
+
this._create();
|
177 |
+
this._trigger( "create" );
|
178 |
+
this._init();
|
179 |
+
},
|
180 |
+
_getCreateOptions: function() {
|
181 |
+
return j.metadata && j.metadata.get( this.element[0] )[ this.widgetName ];
|
182 |
+
},
|
183 |
+
_create: function() {},
|
184 |
+
_init: function() {},
|
185 |
+
|
186 |
+
destroy: function() {
|
187 |
+
this.element
|
188 |
+
.unbind( "." + this.widgetName )
|
189 |
+
.removeData( this.widgetName );
|
190 |
+
this.widget()
|
191 |
+
.unbind( "." + this.widgetName )
|
192 |
+
.removeAttr( "aria-disabled" )
|
193 |
+
.removeClass(
|
194 |
+
this.widgetBaseClass + "-disabled " +
|
195 |
+
"ui-state-disabled" );
|
196 |
+
},
|
197 |
+
|
198 |
+
widget: function() {
|
199 |
+
return this.element;
|
200 |
+
},
|
201 |
+
|
202 |
+
option: function( key, value ) {
|
203 |
+
var options = key;
|
204 |
+
|
205 |
+
if ( arguments.length === 0 ) {
|
206 |
+
// don't return a reference to the internal hash
|
207 |
+
return j.extend( {}, this.options );
|
208 |
+
}
|
209 |
+
|
210 |
+
if (typeof key === "string" ) {
|
211 |
+
if ( value === undefined ) {
|
212 |
+
return this.options[ key ];
|
213 |
+
}
|
214 |
+
options = {};
|
215 |
+
options[ key ] = value;
|
216 |
+
}
|
217 |
+
|
218 |
+
this._setOptions( options );
|
219 |
+
|
220 |
+
return this;
|
221 |
+
},
|
222 |
+
_setOptions: function( options ) {
|
223 |
+
var self = this;
|
224 |
+
j.each( options, function( key, value ) {
|
225 |
+
self._setOption( key, value );
|
226 |
+
});
|
227 |
+
|
228 |
+
return this;
|
229 |
+
},
|
230 |
+
_setOption: function( key, value ) {
|
231 |
+
this.options[ key ] = value;
|
232 |
+
|
233 |
+
if ( key === "disabled" ) {
|
234 |
+
this.widget()
|
235 |
+
[ value ? "addClass" : "removeClass"](
|
236 |
+
this.widgetBaseClass + "-disabled" + " " +
|
237 |
+
"ui-state-disabled" )
|
238 |
+
.attr( "aria-disabled", value );
|
239 |
+
}
|
240 |
+
|
241 |
+
return this;
|
242 |
+
},
|
243 |
+
|
244 |
+
enable: function() {
|
245 |
+
return this._setOption( "disabled", false );
|
246 |
+
},
|
247 |
+
disable: function() {
|
248 |
+
return this._setOption( "disabled", true );
|
249 |
+
},
|
250 |
+
|
251 |
+
_trigger: function( type, event, data ) {
|
252 |
+
var prop, orig,
|
253 |
+
callback = this.options[ type ];
|
254 |
+
|
255 |
+
data = data || {};
|
256 |
+
event = j.Event( event );
|
257 |
+
event.type = ( type === this.widgetEventPrefix ?
|
258 |
+
type :
|
259 |
+
this.widgetEventPrefix + type ).toLowerCase();
|
260 |
+
// the original event may come from any element
|
261 |
+
// so we need to reset the target on the new event
|
262 |
+
event.target = this.element[ 0 ];
|
263 |
+
|
264 |
+
// copy original event properties over to the new event
|
265 |
+
orig = event.originalEvent;
|
266 |
+
if ( orig ) {
|
267 |
+
for ( prop in orig ) {
|
268 |
+
if ( !( prop in event ) ) {
|
269 |
+
event[ prop ] = orig[ prop ];
|
270 |
+
}
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
this.element.trigger( event, data );
|
275 |
+
|
276 |
+
return !( j.isFunction(callback) &&
|
277 |
+
callback.call( this.element[0], event, data ) === false ||
|
278 |
+
event.isDefaultPrevented() );
|
279 |
+
}
|
280 |
+
};
|
281 |
+
|
282 |
+
}));
|
media/wexo_uploaded_files/ready_files/info.txt
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
We use this file to transfer images from Remove the Background Api to your Server
|
media/wexo_uploaded_files/thumbnails/your_first_image.jpg
ADDED
Binary file
|
media/wexo_uploaded_files/your_first_image.jpg
ADDED
Binary file
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>pictureperfect-wexo</name>
|
4 |
+
<version>1.2.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.wexo.dk/magento-module-license">WEXO Module License</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This module makes the process of managing product images faster and easier. And best of all - it is free!</summary>
|
10 |
+
<description>Are you tired of time consuming and monotonous image uploading? Here is the solution! This module will make the life easier for Magento web shop owners by dividing your workload and make the process of managing product images faster and easier. And best of all - it is free!
|
11 |
+

|
12 |
+
If you would like to save even more time, then you can integrate the module with Remove the Background™ which is indeed a user friendly, labor saving and compatible solution for improving product images. </description>
|
13 |
+
<notes>Picture Perfect 1.2.1 Stable Version</notes>
|
14 |
+
<authors><author><name>Roman</name><user>Wufer</user><email>grisk55@mail.ru</email></author></authors>
|
15 |
+
<date>2012-04-11</date>
|
16 |
+
<time>10:51:13</time>
|
17 |
+
<contents><target name="mage"><dir name="."><dir name="app"><dir name="code"><dir name="local"><dir name="wexo"><dir name="Imageupload"><dir name="Block"><dir name="Adminhtml"><dir name="Imageupload"><dir name="Edit"><dir name="Tab"><file name="form.php" hash="181535799edd11987675c2115c6886b4"/></dir><file name="form.php" hash="940a6de59796d49b358177339e8f7cfe"/></dir><file name="Grid.php" hash="f3037360970024826f50f0957267785b"/></dir><file name="Imageupload.php" hash="702c943e61847fa9a643770abbb62052"/><file name="Quotes.php" hash="eab0b654ff8421b1d674c1278b90dea6"/></dir></dir><dir name="Helper"><file name="ArrayToXml.php" hash="6d7640b898efd16566df87e0f575aae8"/><file name="Data.php" hash="0b2371e152a39e9b36ac5e97e23fe49f"/><file name="ImageUpload.php" hash="2871bce2c7a0fce01c16543de2ddde2d"/><file name="UploadHandler.php" hash="f5e1931968c1c8954624bb43d3adec68"/></dir><dir name="Model"><file name="Mysql.php" hash="a4c087425622d2f2cb67a6be41400828"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ImageuploadController.php" hash="d0b228f6859319cfa1093be72a9bd5f0"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="17403c50e227df61ffd8457e3ed4c516"/><file name="config.xml" hash="725b65bb14edc223f0a81cfd9b091c70"/></dir><dir name="sql"><dir name="imageupload_setup"><file name="mysql4-install-0.1.0.php" hash="bd94ca51cb6b5a1a72188a4400cc0c64"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="imageupload.xml" hash="96f9ae2ba9a17c04cd07712a9215e5fa"/></dir><dir name="template"><dir name="imageupload"><file name="imageuploadbackend.phtml" hash="ed227948838ca0099762c65755059b0c"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Wexo_Imageupload.xml" hash="da493fbe90cbbe44983502c37f7c131b"/></dir></dir></dir><dir name="media"><dir name="wexo_uploaded_files"><dir name="ready_files"><file name="info.txt" hash="b0556599fb86ecd822b26fe54d7c2615"/></dir><dir name="thumbnails"><file name="your_first_image.jpg" hash="4be9da359495feb2a4288c079c18921c"/></dir><file name="your_first_image.jpg" hash="7098a45cf1eb9ab6559a2532b8f80b50"/></dir></dir><dir name="skin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="wexo_imageupload.css" hash="8b2206642976af8c1aef7bea1a4a1401"/></dir></dir></dir></dir><dir name="js"><dir name="wexo_imageupload"><dir name="ajaxSearch"><file name="ajax-loader.gif" hash="5a54ac225b025dfa0c045c0eacb972cb"/><file name="ajaxSearch.js" hash="5556b9385b6825b01e03d089afa2563f"/></dir><dir name="cors"><file name="jquery.postmessage-transport.js" hash="11fe256b13a09546f7280198d8e98239"/><file name="jquery.xdr-transport.js" hash="faaba6cc2d368480b13fb99d4556b3eb"/></dir><dir name="date"><file name="dateFormat.js" hash="0ada36cb8bcc98c00dcf1eb79bb3f5eb"/></dir><dir name="from_site"><file name="bootstrap-image-gallery.min.js" hash="c37476e80032d0535d90904cf0475d71"/><file name="bootstrap.min.js" hash="65aa619d80ebcdd8435134a3fdf80b8b"/><file name="canvas-to-blob.min.js" hash="4d3b7b16282b97e1f6ed534aa95d69ae"/><file name="load-image.min.js" hash="c7770cc767dbf0120e859528cdef5df1"/><file name="tmpl.min.js" hash="411df7e2bc659d35015f7fdb7432b331"/></dir><dir name="jquery"><file name="jquery.js" hash="ab2e5a64325fbe4f9f09e174048e089d"/><file name="noConflict.js" hash="c91887792716c192e4942fde5f2ec848"/></dir><file name="jquery.fileupload-ip.js" hash="6ef236c9b095fab9199bc0a610474822"/><file name="jquery.fileupload-ui.js" hash="aa2b6323dd1a0b8e5a1b445166e22d95"/><file name="jquery.fileupload.js" hash="968bdc259b6e16002c086ad72002c10f"/><file name="jquery.iframe-transport.js" hash="a66b4d498adb22c8cf324b89c6870a97"/><file name="locale.js" hash="a7773b6a053fb90d7c1a284f8d83a352"/><file name="main.js" hash="119fc089d344de035be04fa653ada655"/><file name="statusLoader.gif" hash="e2bfb20cfa7417dcc901d4d42520e1cc"/><file name="templateBorder.gif" hash="dce00ddad351e72e83bc87274cbaa54a"/><dir name="vendor"><file name="jquery.ui.widget.js" hash="93126e5fb3ab5375bf76aeea2dd9d07b"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="."><file name="proxy.php" hash="947842cef54a3f534225deaee8f6ebd5"/></dir></target></contents>
|
18 |
+
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.3.1</min><max>5.4.0</max></php><package><name></name><channel>connect.magentocommerce.com/core</channel><min></min><max></max></package></required></dependencies>
|
20 |
+
</package>
|
proxy.php
ADDED
@@ -0,0 +1,258 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?PHP
|
2 |
+
|
3 |
+
// Script: Simple PHP Proxy: Get external HTML, JSON and more!
|
4 |
+
//
|
5 |
+
// *Version: 1.6, Last updated: 1/24/2009*
|
6 |
+
//
|
7 |
+
// Project Home - http://benalman.com/projects/php-simple-proxy/
|
8 |
+
// GitHub - http://github.com/cowboy/php-simple-proxy/
|
9 |
+
// Source - http://github.com/cowboy/php-simple-proxy/raw/master/ba-simple-proxy.php
|
10 |
+
//
|
11 |
+
// About: License
|
12 |
+
//
|
13 |
+
// Copyright (c) 2010 "Cowboy" Ben Alman,
|
14 |
+
// Dual licensed under the MIT and GPL licenses.
|
15 |
+
// http://benalman.com/about/license/
|
16 |
+
//
|
17 |
+
// About: Examples
|
18 |
+
//
|
19 |
+
// This working example, complete with fully commented code, illustrates one way
|
20 |
+
// in which this PHP script can be used.
|
21 |
+
//
|
22 |
+
// Simple - http://benalman.com/code/projects/php-simple-proxy/examples/simple/
|
23 |
+
//
|
24 |
+
// About: Release History
|
25 |
+
//
|
26 |
+
// 1.6 - (1/24/2009) Now defaults to JSON mode, which can now be changed to
|
27 |
+
// native mode by specifying ?mode=native. Native and JSONP modes are
|
28 |
+
// disabled by default because of possible XSS vulnerability issues, but
|
29 |
+
// are configurable in the PHP script along with a url validation regex.
|
30 |
+
// 1.5 - (12/27/2009) Initial release
|
31 |
+
//
|
32 |
+
// Topic: GET Parameters
|
33 |
+
//
|
34 |
+
// Certain GET (query string) parameters may be passed into ba-simple-proxy.php
|
35 |
+
// to control its behavior, this is a list of these parameters.
|
36 |
+
//
|
37 |
+
// url - The remote URL resource to fetch. Any GET parameters to be passed
|
38 |
+
// through to the remote URL resource must be urlencoded in this parameter.
|
39 |
+
// mode - If mode=native, the response will be sent using the same content
|
40 |
+
// type and headers that the remote URL resource returned. If omitted, the
|
41 |
+
// response will be JSON (or JSONP). <Native requests> and <JSONP requests>
|
42 |
+
// are disabled by default, see <Configuration Options> for more information.
|
43 |
+
// callback - If specified, the response JSON will be wrapped in this named
|
44 |
+
// function call. This parameter and <JSONP requests> are disabled by
|
45 |
+
// default, see <Configuration Options> for more information.
|
46 |
+
// user_agent - This value will be sent to the remote URL request as the
|
47 |
+
// `User-Agent:` HTTP request header. If omitted, the browser user agent
|
48 |
+
// will be passed through.
|
49 |
+
// send_cookies - If send_cookies=1, all cookies will be forwarded through to
|
50 |
+
// the remote URL request.
|
51 |
+
// send_session - If send_session=1 and send_cookies=1, the SID cookie will be
|
52 |
+
// forwarded through to the remote URL request.
|
53 |
+
// full_headers - If a JSON request and full_headers=1, the JSON response will
|
54 |
+
// contain detailed header information.
|
55 |
+
// full_status - If a JSON request and full_status=1, the JSON response will
|
56 |
+
// contain detailed cURL status information, otherwise it will just contain
|
57 |
+
// the `http_code` property.
|
58 |
+
//
|
59 |
+
// Topic: POST Parameters
|
60 |
+
//
|
61 |
+
// All POST parameters are automatically passed through to the remote URL
|
62 |
+
// request.
|
63 |
+
//
|
64 |
+
// Topic: JSON requests
|
65 |
+
//
|
66 |
+
// This request will return the contents of the specified url in JSON format.
|
67 |
+
//
|
68 |
+
// Request:
|
69 |
+
//
|
70 |
+
// > ba-simple-proxy.php?url=http://example.com/
|
71 |
+
//
|
72 |
+
// Response:
|
73 |
+
//
|
74 |
+
// > { "contents": "<html>...</html>", "headers": {...}, "status": {...} }
|
75 |
+
//
|
76 |
+
// JSON object properties:
|
77 |
+
//
|
78 |
+
// contents - (String) The contents of the remote URL resource.
|
79 |
+
// headers - (Object) A hash of HTTP headers returned by the remote URL
|
80 |
+
// resource.
|
81 |
+
// status - (Object) A hash of status codes returned by cURL.
|
82 |
+
//
|
83 |
+
// Topic: JSONP requests
|
84 |
+
//
|
85 |
+
// This request will return the contents of the specified url in JSONP format
|
86 |
+
// (but only if $enable_jsonp is enabled in the PHP script).
|
87 |
+
//
|
88 |
+
// Request:
|
89 |
+
//
|
90 |
+
// > ba-simple-proxy.php?url=http://example.com/&callback=foo
|
91 |
+
//
|
92 |
+
// Response:
|
93 |
+
//
|
94 |
+
// > foo({ "contents": "<html>...</html>", "headers": {...}, "status": {...} })
|
95 |
+
//
|
96 |
+
// JSON object properties:
|
97 |
+
//
|
98 |
+
// contents - (String) The contents of the remote URL resource.
|
99 |
+
// headers - (Object) A hash of HTTP headers returned by the remote URL
|
100 |
+
// resource.
|
101 |
+
// status - (Object) A hash of status codes returned by cURL.
|
102 |
+
//
|
103 |
+
// Topic: Native requests
|
104 |
+
//
|
105 |
+
// This request will return the contents of the specified url in the format it
|
106 |
+
// was received in, including the same content-type and other headers (but only
|
107 |
+
// if $enable_native is enabled in the PHP script).
|
108 |
+
//
|
109 |
+
// Request:
|
110 |
+
//
|
111 |
+
// > ba-simple-proxy.php?url=http://example.com/&mode=native
|
112 |
+
//
|
113 |
+
// Response:
|
114 |
+
//
|
115 |
+
// > <html>...</html>
|
116 |
+
//
|
117 |
+
// Topic: Notes
|
118 |
+
//
|
119 |
+
// * Assumes magic_quotes_gpc = Off in php.ini
|
120 |
+
//
|
121 |
+
// Topic: Configuration Options
|
122 |
+
//
|
123 |
+
// These variables can be manually edited in the PHP file if necessary.
|
124 |
+
//
|
125 |
+
// $enable_jsonp - Only enable <JSONP requests> if you really need to. If you
|
126 |
+
// install this script on the same server as the page you're calling it
|
127 |
+
// from, plain JSON will work. Defaults to false.
|
128 |
+
// $enable_native - You can enable <Native requests>, but you should only do
|
129 |
+
// this if you also whitelist specific URLs using $valid_url_regex, to avoid
|
130 |
+
// possible XSS vulnerabilities. Defaults to false.
|
131 |
+
// $valid_url_regex - This regex is matched against the url parameter to
|
132 |
+
// ensure that it is valid. This setting only needs to be used if either
|
133 |
+
// $enable_jsonp or $enable_native are enabled. Defaults to '/.*/' which
|
134 |
+
// validates all URLs.
|
135 |
+
//
|
136 |
+
// ############################################################################
|
137 |
+
|
138 |
+
// Change these configuration options if needed, see above descriptions for info.
|
139 |
+
$enable_jsonp = false;
|
140 |
+
$enable_native = true;
|
141 |
+
$valid_url_regex = '/.*/';
|
142 |
+
|
143 |
+
// ############################################################################
|
144 |
+
|
145 |
+
$url = $_GET['url'];
|
146 |
+
|
147 |
+
if ( !$url ) {
|
148 |
+
|
149 |
+
// Passed url not specified.
|
150 |
+
$contents = 'ERROR: url not specified';
|
151 |
+
$status = array( 'http_code' => 'ERROR' );
|
152 |
+
|
153 |
+
} else if ( !preg_match( $valid_url_regex, $url ) ) {
|
154 |
+
|
155 |
+
// Passed url doesn't match $valid_url_regex.
|
156 |
+
$contents = 'ERROR: invalid url';
|
157 |
+
$status = array( 'http_code' => 'ERROR' );
|
158 |
+
|
159 |
+
} else {
|
160 |
+
|
161 |
+
$ch = curl_init( $url );
|
162 |
+
|
163 |
+
if ( strtolower($_SERVER['REQUEST_METHOD']) == 'post' ) {
|
164 |
+
curl_setopt( $ch, CURLOPT_POST, true );
|
165 |
+
$data = file_get_contents('php://input');
|
166 |
+
// application/json
|
167 |
+
curl_setopt($ch,CURLOPT_HTTPHEADER,array ("Content-Type: application/json"));
|
168 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( $_GET['send_cookies'] ) {
|
172 |
+
$cookie = array();
|
173 |
+
foreach ( $_COOKIE as $key => $value ) {
|
174 |
+
$cookie[] = $key . '=' . $value;
|
175 |
+
}
|
176 |
+
if ( $_GET['send_session'] ) {
|
177 |
+
$cookie[] = SID;
|
178 |
+
}
|
179 |
+
$cookie = implode( '; ', $cookie );
|
180 |
+
|
181 |
+
curl_setopt( $ch, CURLOPT_COOKIE, $cookie );
|
182 |
+
}
|
183 |
+
|
184 |
+
//curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
|
185 |
+
curl_setopt( $ch, CURLOPT_HEADER, true );
|
186 |
+
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
187 |
+
|
188 |
+
curl_setopt( $ch, CURLOPT_USERAGENT, $_GET['user_agent'] ? $_GET['user_agent'] : $_SERVER['HTTP_USER_AGENT'] );
|
189 |
+
|
190 |
+
list( $header, $contents ) = preg_split( '/([\r\n][\r\n])\\1/', curl_exec( $ch ), 2 );
|
191 |
+
|
192 |
+
$status = curl_getinfo( $ch );
|
193 |
+
|
194 |
+
curl_close( $ch );
|
195 |
+
}
|
196 |
+
|
197 |
+
// Split header text into an array.
|
198 |
+
$header_text = preg_split( '/[\r\n]+/', $header );
|
199 |
+
|
200 |
+
if ( $_GET['mode'] == 'native' ) {
|
201 |
+
if ( !$enable_native ) {
|
202 |
+
$contents = 'ERROR: invalid mode';
|
203 |
+
$status = array( 'http_code' => 'ERROR' );
|
204 |
+
}
|
205 |
+
|
206 |
+
// Propagate headers to response.
|
207 |
+
foreach ( $header_text as $header ) {
|
208 |
+
if ( preg_match( '/^(?:Content-Type|Content-Language|Set-Cookie):/i', $header ) ) {
|
209 |
+
header( $header );
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
print $contents;
|
214 |
+
|
215 |
+
} else {
|
216 |
+
|
217 |
+
// $data will be serialized into JSON data.
|
218 |
+
$data = array();
|
219 |
+
|
220 |
+
// Propagate all HTTP headers into the JSON data object.
|
221 |
+
if ( $_GET['full_headers'] ) {
|
222 |
+
$data['headers'] = array();
|
223 |
+
|
224 |
+
foreach ( $header_text as $header ) {
|
225 |
+
preg_match( '/^(.+?):\s+(.*)$/', $header, $matches );
|
226 |
+
if ( $matches ) {
|
227 |
+
$data['headers'][ $matches[1] ] = $matches[2];
|
228 |
+
}
|
229 |
+
}
|
230 |
+
}
|
231 |
+
|
232 |
+
// Propagate all cURL request / response info to the JSON data object.
|
233 |
+
if ( $_GET['full_status'] ) {
|
234 |
+
$data['status'] = $status;
|
235 |
+
} else {
|
236 |
+
$data['status'] = array();
|
237 |
+
$data['status']['http_code'] = $status['http_code'];
|
238 |
+
}
|
239 |
+
|
240 |
+
// Set the JSON data object contents, decoding it from JSON if possible.
|
241 |
+
$decoded_json = json_decode( $contents );
|
242 |
+
$data['contents'] = $decoded_json ? $decoded_json : $contents;
|
243 |
+
|
244 |
+
// Generate appropriate content-type header.
|
245 |
+
$is_xhr = strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
|
246 |
+
header( 'Content-type: application/' . ( $is_xhr ? 'json' : 'x-javascript' ) );
|
247 |
+
|
248 |
+
// Get JSONP callback.
|
249 |
+
$jsonp_callback = $enable_jsonp && isset($_GET['callback']) ? $_GET['callback'] : null;
|
250 |
+
|
251 |
+
// Generate JSON/JSONP string
|
252 |
+
$json = json_encode( $data );
|
253 |
+
|
254 |
+
print $jsonp_callback ? "$jsonp_callback($json)" : $json;
|
255 |
+
|
256 |
+
}
|
257 |
+
|
258 |
+
?>
|
skin/adminhtml/default/default/wexo_imageupload.css
ADDED
@@ -0,0 +1,515 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
@charset 'UTF-8';
|
2 |
+
/*
|
3 |
+
* jQuery File Upload UI Plugin CSS 6.2.1
|
4 |
+
* https://github.com/blueimp/jQuery-File-Upload
|
5 |
+
*
|
6 |
+
* Copyright 2010, Sebastian Tschan
|
7 |
+
* https://blueimp.net
|
8 |
+
*
|
9 |
+
* Licensed under the MIT license:
|
10 |
+
* http://www.opensource.org/licenses/MIT
|
11 |
+
*/
|
12 |
+
|
13 |
+
.fileinput-button {
|
14 |
+
position: relative;
|
15 |
+
overflow: hidden;
|
16 |
+
float: left;
|
17 |
+
margin-right: 4px;
|
18 |
+
}
|
19 |
+
.fileinput-button input {
|
20 |
+
position: absolute;
|
21 |
+
top: 0;
|
22 |
+
right: 0;
|
23 |
+
margin: 0;
|
24 |
+
border: solid transparent;
|
25 |
+
border-width: 0 0 100px 200px;
|
26 |
+
opacity: 0;
|
27 |
+
filter: alpha(opacity=0);
|
28 |
+
-moz-transform: translate(-300px, 0) scale(4);
|
29 |
+
direction: ltr;
|
30 |
+
cursor: pointer;
|
31 |
+
background-color: #FCAF81;
|
32 |
+
background-image: url("images/cancel_btn_bg.gif");
|
33 |
+
border-color: #D24403 #A92000 #A92000 #D24403;
|
34 |
+
color: #FFFFFF;
|
35 |
+
}
|
36 |
+
.fileupload-buttonbar .btn,
|
37 |
+
.fileupload-buttonbar .toggle {
|
38 |
+
}
|
39 |
+
.files .progress {
|
40 |
+
width: 200px;
|
41 |
+
}
|
42 |
+
.progress-animated .bar {
|
43 |
+
background: url(../img/progressbar.gif) !important;
|
44 |
+
filter: none;
|
45 |
+
}
|
46 |
+
.fileupload-loading {
|
47 |
+
position: absolute;
|
48 |
+
left: 50%;
|
49 |
+
width: 128px;
|
50 |
+
height: 128px;
|
51 |
+
background: url(../img/loading.gif) center no-repeat;
|
52 |
+
display: none;
|
53 |
+
}
|
54 |
+
.fileupload-processing .fileupload-loading {
|
55 |
+
display: block;
|
56 |
+
}
|
57 |
+
|
58 |
+
/* Fix for IE 6: */
|
59 |
+
*html .fileinput-button {
|
60 |
+
line-height: 22px;
|
61 |
+
margin: 1px -3px 0 0;
|
62 |
+
}
|
63 |
+
|
64 |
+
/* Fix for IE 7: */
|
65 |
+
*+html .fileinput-button {
|
66 |
+
margin: 1px 0 0 0;
|
67 |
+
}
|
68 |
+
|
69 |
+
#addFiles{
|
70 |
+
background: url("images/btn_bg.gif") repeat-x scroll 0 100% #FFAC47;
|
71 |
+
border-color: #ED6502 #A04300 #A04300 #ED6502;
|
72 |
+
border-style: solid;
|
73 |
+
border-width: 1px;
|
74 |
+
color: #FFFFFF;
|
75 |
+
cursor: pointer;
|
76 |
+
font: bold 12px arial,helvetica,sans-serif;
|
77 |
+
/*padding: 0 7px 1px;*/
|
78 |
+
text-align: center !important;
|
79 |
+
white-space: nowrap;
|
80 |
+
height: 19px;
|
81 |
+
padding: 0 7px 1px;
|
82 |
+
display: block;
|
83 |
+
line-height: 19px;
|
84 |
+
}
|
85 |
+
|
86 |
+
#fileupload_buttonbar>li{
|
87 |
+
float: left;
|
88 |
+
margin: 0 2px;
|
89 |
+
position: relative;
|
90 |
+
}
|
91 |
+
|
92 |
+
.hideLi{
|
93 |
+
display: none;
|
94 |
+
background: url("images/nav2_link_bg.gif") repeat-x scroll 0 100% white;
|
95 |
+
padding: 5px 15px;
|
96 |
+
}
|
97 |
+
|
98 |
+
#selectTemplatesLi{
|
99 |
+
right: 0px;
|
100 |
+
}
|
101 |
+
|
102 |
+
.selectTemplates{
|
103 |
+
float: left;
|
104 |
+
}
|
105 |
+
#selectTemplates{
|
106 |
+
position: absolute;
|
107 |
+
z-index: 15;
|
108 |
+
}
|
109 |
+
|
110 |
+
#selectTemplates li{
|
111 |
+
}
|
112 |
+
|
113 |
+
#selectTemplateButton{
|
114 |
+
min-width: 205px;
|
115 |
+
}
|
116 |
+
|
117 |
+
#imagePrewiew{
|
118 |
+
border: 1px solid grey;
|
119 |
+
width: 428px;
|
120 |
+
height: auto;
|
121 |
+
position: absolute;
|
122 |
+
display: none;
|
123 |
+
padding: 4px;
|
124 |
+
background: #DADFE0;
|
125 |
+
left: 505px;
|
126 |
+
}
|
127 |
+
|
128 |
+
#selectTemplatesLi a {
|
129 |
+
font: bold 12px arial,helvetica,sans-serif;
|
130 |
+
text-decoration:none;
|
131 |
+
}
|
132 |
+
|
133 |
+
#closeTemplates{
|
134 |
+
display: none;
|
135 |
+
}
|
136 |
+
.closeCross{
|
137 |
+
float:right;
|
138 |
+
text-decoration:none;
|
139 |
+
font-size:15px;font-weight:bold;
|
140 |
+
line-height:15px;
|
141 |
+
color:#000000;
|
142 |
+
text-shadow:0 1px 0 #ffffff;
|
143 |
+
opacity:0.2;
|
144 |
+
filter:alpha(opacity=20);
|
145 |
+
}
|
146 |
+
.closeCross:hover{
|
147 |
+
color:#000000;
|
148 |
+
text-decoration:none;
|
149 |
+
opacity:0.4;
|
150 |
+
filter:alpha(opacity=40);
|
151 |
+
cursor:pointer;}
|
152 |
+
|
153 |
+
.content-header-uploader {
|
154 |
+
border-bottom: 4px solid #DFDFDF;
|
155 |
+
margin-bottom: 18px;
|
156 |
+
padding-bottom: 0.25em;
|
157 |
+
}
|
158 |
+
.head-dashboard-uploader {
|
159 |
+
color: #EB5E00;
|
160 |
+
float: left;
|
161 |
+
font-size: 1.25em;
|
162 |
+
line-height: 1.2em;
|
163 |
+
margin: 0.3em 0.5em 0 0;
|
164 |
+
}
|
165 |
+
.uploader-cpanel {
|
166 |
+
margin: 10px 0;
|
167 |
+
}
|
168 |
+
.uploader-cpanel tr td {
|
169 |
+
padding: 4px 20px 0 0;
|
170 |
+
}
|
171 |
+
.progress {
|
172 |
+
background-color: #F7F7F7;
|
173 |
+
background-image: -moz-linear-gradient(center top , #F5F5F5, #F9F9F9);
|
174 |
+
background-repeat: repeat-x;
|
175 |
+
border-radius: 4px 4px 4px 4px;
|
176 |
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
|
177 |
+
height: 18px;
|
178 |
+
margin-bottom: 18px;
|
179 |
+
overflow: hidden;
|
180 |
+
}
|
181 |
+
.progress .bar {
|
182 |
+
-moz-box-sizing: border-box;
|
183 |
+
-moz-transition: width 0.6s ease 0s;
|
184 |
+
background-color: #0E90D2;
|
185 |
+
background-image: -moz-linear-gradient(center top , #149BDF, #0480BE);
|
186 |
+
background-repeat: repeat-x;
|
187 |
+
box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15) inset;
|
188 |
+
color: #FFFFFF;
|
189 |
+
font-size: 12px;
|
190 |
+
height: 18px;
|
191 |
+
text-align: center;
|
192 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
193 |
+
width: 0;
|
194 |
+
}
|
195 |
+
.progress-striped .bar {
|
196 |
+
background-color: #62C462;
|
197 |
+
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
198 |
+
background-size: 40px 40px;
|
199 |
+
}
|
200 |
+
.progress.active .bar {
|
201 |
+
-moz-animation: 2s linear 0s normal none infinite progress-bar-stripes;
|
202 |
+
}
|
203 |
+
.progress-danger .bar {
|
204 |
+
background-color: #DD514C;
|
205 |
+
background-image: -moz-linear-gradient(center top , #EE5F5B, #C43C35);
|
206 |
+
background-repeat: repeat-x;
|
207 |
+
}
|
208 |
+
.progress-danger.progress-striped .bar {
|
209 |
+
background-color: #EE5F5B;
|
210 |
+
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
211 |
+
}
|
212 |
+
.progress-success .bar {
|
213 |
+
background-color: #5EB95E;
|
214 |
+
background-image: -moz-linear-gradient(center top , #62C462, #57A957);
|
215 |
+
background-repeat: repeat-x;
|
216 |
+
}
|
217 |
+
.progress-success.progress-striped .bar {
|
218 |
+
background-color: #62C462;
|
219 |
+
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
220 |
+
}
|
221 |
+
.progress-info .bar {
|
222 |
+
background-color: #4BB1CF;
|
223 |
+
background-image: -moz-linear-gradient(center top , #5BC0DE, #339BB9);
|
224 |
+
background-repeat: repeat-x;
|
225 |
+
}
|
226 |
+
.progress-info.progress-striped .bar {
|
227 |
+
background-color: #5BC0DE;
|
228 |
+
background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
|
229 |
+
}
|
230 |
+
#templtes-popup li {
|
231 |
+
position: relative;
|
232 |
+
text-align: left;
|
233 |
+
}
|
234 |
+
#templtes-popup li.over {
|
235 |
+
z-index: 99;
|
236 |
+
}
|
237 |
+
#templtes-popup li.active {
|
238 |
+
list-style-type: none;
|
239 |
+
z-index: 100;
|
240 |
+
}
|
241 |
+
#templtes-popup a, #templtes-popup a:hover {
|
242 |
+
display: block;
|
243 |
+
text-decoration: none;
|
244 |
+
}
|
245 |
+
#templtes-popup span {
|
246 |
+
display: block;
|
247 |
+
}
|
248 |
+
#templtes-popup a {
|
249 |
+
line-height: 1.3em;
|
250 |
+
}
|
251 |
+
#templtes-popup li {
|
252 |
+
background: url("images/nav1_sep.gif") no-repeat scroll 100% 0 transparent;
|
253 |
+
float: left;
|
254 |
+
}
|
255 |
+
#templtes-popup li.active em {
|
256 |
+
background: url("images/nav1_active.gif") no-repeat scroll 100% 0 transparent;
|
257 |
+
display: block;
|
258 |
+
height: 27px;
|
259 |
+
position: absolute;
|
260 |
+
right: -1px;
|
261 |
+
top: 0;
|
262 |
+
width: 3px;
|
263 |
+
}
|
264 |
+
#templtes-popup li.over a {
|
265 |
+
color: #D6E2E5;
|
266 |
+
}
|
267 |
+
#templtes-popup ul li, #templtes-popup ul li.active {
|
268 |
+
background: none repeat scroll 0 0 transparent;
|
269 |
+
float: none;
|
270 |
+
height: auto;
|
271 |
+
margin: 0;
|
272 |
+
}
|
273 |
+
#templtes-popup ul a, #templtes-popup ul a:hover {
|
274 |
+
float: none;
|
275 |
+
line-height: 1.3em;
|
276 |
+
padding: 0;
|
277 |
+
}
|
278 |
+
#templtes-popup ul li.over a, #templtes-popup ul li.over a:hover, #templtes-popup ul a, #templtes-popup li.active li {
|
279 |
+
font-weight: normal;
|
280 |
+
}
|
281 |
+
#templtes-popup ul {
|
282 |
+
left: -10000px;
|
283 |
+
padding-bottom: 3px;
|
284 |
+
position: absolute;
|
285 |
+
top: 22px;
|
286 |
+
width: 189px;
|
287 |
+
}
|
288 |
+
#templtes-popup ul ul {
|
289 |
+
background: url("images/nav3_bg.png") no-repeat scroll 0 0 transparent;
|
290 |
+
border-top: 0 none;
|
291 |
+
left: 100px;
|
292 |
+
padding-top: 2px;
|
293 |
+
top: 13px;
|
294 |
+
}
|
295 |
+
#templtes-popup li.over ul {
|
296 |
+
left: -1px;
|
297 |
+
}
|
298 |
+
#templtes-popup li.over ul ul {
|
299 |
+
left: -10000px;
|
300 |
+
}
|
301 |
+
#templtes-popup li.over ul li.over ul {
|
302 |
+
left: 100px;
|
303 |
+
}
|
304 |
+
#templtes-popup ul li {
|
305 |
+
background: url("images/nav2_li_bg.png") repeat-y scroll 0 0 transparent;
|
306 |
+
padding: 0 2px;
|
307 |
+
}
|
308 |
+
#templtes-popup ul li a {
|
309 |
+
background: none repeat scroll 0 0 #E3ECEE;
|
310 |
+
}
|
311 |
+
#templtes-popup ul li a:hover {
|
312 |
+
background: none repeat scroll 0 0 #D0DFE2;
|
313 |
+
}
|
314 |
+
#templtes-popup li.over ul a, #templtes-popup ul li.active a, #templtes-popup ul li a, #templtes-popup ul li a:hover {
|
315 |
+
color: #2F2F2F;
|
316 |
+
}
|
317 |
+
#templtes-popup ul span, #templtes-popup ul li.last li span {
|
318 |
+
background: url("images/nav2_link_bg.gif") repeat-x scroll 0 100% transparent;
|
319 |
+
padding: 5px 15px;
|
320 |
+
}
|
321 |
+
#templtes-popup ul li.last span, #templtes-popup ul li.last li.last span {
|
322 |
+
background: none repeat scroll 0 0 transparent;
|
323 |
+
}
|
324 |
+
#templtes-popup ul li.last {
|
325 |
+
background: url("images/nav2_last_li_bg.png") no-repeat scroll 0 100% transparent;
|
326 |
+
padding-bottom: 3px;
|
327 |
+
}
|
328 |
+
#templtes-popup ul li.parent a, #templtes-popup ul li.parent li.parent a {
|
329 |
+
background-image: url("images/nav2_parent_arrow.gif");
|
330 |
+
background-position: 100% 100%;
|
331 |
+
background-repeat: no-repeat;
|
332 |
+
}
|
333 |
+
#templtes-popup ul li.parent li a, #templtes-popup ul li.parent li.parent li a {
|
334 |
+
background-image: none;
|
335 |
+
}
|
336 |
+
#templtes-popup li.parent a, #templtes-popup li.parent li.parent a, #templtes-popup li.parent li.parent li.parent a {
|
337 |
+
cursor: default;
|
338 |
+
}
|
339 |
+
#templtes-popup li.parent li a, #templtes-popup li.parent li.parent li a, #templtes-popup li.parent li.parent li.parent li a {
|
340 |
+
cursor: pointer;
|
341 |
+
}
|
342 |
+
#templtes-popup ul ul ul {
|
343 |
+
left: -10000px;
|
344 |
+
}
|
345 |
+
#templtes-popup li.over ul li.over ul ul {
|
346 |
+
left: -10000px;
|
347 |
+
}
|
348 |
+
#templtes-popup li.over ul li.over ul li.over ul {
|
349 |
+
left: 100px;
|
350 |
+
}
|
351 |
+
|
352 |
+
.dropdown{position:relative;}
|
353 |
+
.dropdown-toggle{*margin-bottom:-3px;}
|
354 |
+
.dropdown-toggle:active,.open .dropdown-toggle{outline:0;}
|
355 |
+
.caret{display:inline-block;width:0;height:0;text-indent:-99999px;*text-indent:0;vertical-align:top;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000000;opacity:0.3;filter:alpha(opacity=30);content:"\2193";}
|
356 |
+
.dropdown .caret{margin-top:8px;margin-left:2px;}
|
357 |
+
.dropdown:hover .caret,.open.dropdown .caret{opacity:1;filter:alpha(opacity=100);}
|
358 |
+
.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;max-width:220px;_width:160px;padding:4px 0;margin:0;list-style:none;background-color:#ffffff;border-color:#ccc;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:1px;-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;}.dropdown-menu.bottom-up{top:auto;bottom:100%;margin-bottom:2px;}
|
359 |
+
.dropdown-menu .divider{height:1px;margin:5px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;}
|
360 |
+
.dropdown-menu a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:18px;color:#555555;white-space:nowrap;}
|
361 |
+
.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;background-color:#0088cc;}
|
362 |
+
.dropdown.open{*z-index:1000;}.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);}
|
363 |
+
.dropdown.open .dropdown-menu{display:block;}
|
364 |
+
.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
365 |
+
.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}
|
366 |
+
.fade{clear:both;-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;}
|
367 |
+
.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;}
|
368 |
+
.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;opacity:0.4;filter:alpha(opacity=40);cursor:pointer;}
|
369 |
+
.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;}
|
370 |
+
.nav .open .caret,.nav .open.active .caret,.nav .open a:hover .caret{border-top-color:#ffffff;opacity:1;filter:alpha(opacity=100);}
|
371 |
+
.navbar .nav .active .caret{opacity:1;filter:alpha(opacity=100);}
|
372 |
+
.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;}
|
373 |
+
.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);}
|
374 |
+
.modal{position:fixed;top:50%;left:50%;z-index:1050;max-height:500px;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;}
|
375 |
+
.modal.fade.in{top:50%;}
|
376 |
+
.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;}
|
377 |
+
.modal-body{padding:15px;}
|
378 |
+
.modal-footer{padding:14px 15px 15px;margin-bottom:0;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";}
|
379 |
+
.modal-footer:after{clear:both;}
|
380 |
+
.modal-footer .btn{float:right;margin-left:5px;margin-bottom:0;}
|
381 |
+
.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);}
|
382 |
+
.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;}
|
383 |
+
.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);}
|
384 |
+
.pull-left{float:left;}
|
385 |
+
.hide{display:none;}
|
386 |
+
.show{display:block;}
|
387 |
+
.invisible{visibility:hidden;}
|
388 |
+
.progress .bar{width:0%;height:18px;color:#ffffff;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-ms-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(top, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-ms-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;}
|
389 |
+
.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;}
|
390 |
+
.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;}
|
391 |
+
.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);}
|
392 |
+
.progress-danger.progress-striped .bar{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
393 |
+
.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);}
|
394 |
+
.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
395 |
+
.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);}
|
396 |
+
.progress-info.progress-striped .bar{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
|
397 |
+
|
398 |
+
.scalableAdd {
|
399 |
+
background: url("images/btn_bg.gif") repeat-x scroll 0 100% #FFAC47;
|
400 |
+
border-color: #ED6502 #A04300 #A04300 #ED6502;
|
401 |
+
border-style: solid;
|
402 |
+
border-width: 1px;
|
403 |
+
color: #FFFFFF;
|
404 |
+
cursor: pointer;
|
405 |
+
font: bold 12px arial,helvetica,sans-serif;
|
406 |
+
padding: 0 7px;
|
407 |
+
text-align: center !important;
|
408 |
+
white-space: nowrap;
|
409 |
+
display: block;
|
410 |
+
height: 19px;
|
411 |
+
line-height: 19px;
|
412 |
+
}
|
413 |
+
|
414 |
+
#myform{
|
415 |
+
margin: 26px auto;
|
416 |
+
width: 440px;
|
417 |
+
display: block;
|
418 |
+
position: relative;
|
419 |
+
}
|
420 |
+
|
421 |
+
#insert_search{
|
422 |
+
width: 242px;
|
423 |
+
display: block;
|
424 |
+
border: 1px solid #F0F0F0;
|
425 |
+
border-top: none;
|
426 |
+
display: none;
|
427 |
+
padding: 4px;
|
428 |
+
position: absolute;
|
429 |
+
z-index: 99;
|
430 |
+
background-color: white;
|
431 |
+
}
|
432 |
+
|
433 |
+
.searchResult{
|
434 |
+
text-decoration: none;
|
435 |
+
}
|
436 |
+
|
437 |
+
#flash{
|
438 |
+
width: 44px;
|
439 |
+
position: absolute;
|
440 |
+
left: -18px;
|
441 |
+
}
|
442 |
+
|
443 |
+
#productInfo{
|
444 |
+
display: none;
|
445 |
+
padding: 4px;
|
446 |
+
margin: 0 0 10px 15px;
|
447 |
+
border: 1px solid #F0F0F0;
|
448 |
+
width: 548px;
|
449 |
+
}
|
450 |
+
|
451 |
+
#showProduct{
|
452 |
+
width: 100%;
|
453 |
+
}
|
454 |
+
|
455 |
+
#addToProduct{
|
456 |
+
position: absolute;
|
457 |
+
top: 0px;
|
458 |
+
right: 30px;
|
459 |
+
}
|
460 |
+
|
461 |
+
.grid{
|
462 |
+
position: relative;
|
463 |
+
}
|
464 |
+
|
465 |
+
.align_center_middle{
|
466 |
+
text-align: center !important;
|
467 |
+
vertical-align: middle;
|
468 |
+
}
|
469 |
+
|
470 |
+
.true{
|
471 |
+
color:#7DC231;
|
472 |
+
}
|
473 |
+
.false{
|
474 |
+
color:#F66;
|
475 |
+
}
|
476 |
+
|
477 |
+
#diagram_tab_settings_content{
|
478 |
+
padding: 10px;
|
479 |
+
}
|
480 |
+
|
481 |
+
#diagram_tab_settings_content table{
|
482 |
+
width: 545px;
|
483 |
+
border: none;
|
484 |
+
}
|
485 |
+
|
486 |
+
#diagram_tab_settings_content table td{
|
487 |
+
border: none;
|
488 |
+
}
|
489 |
+
|
490 |
+
#diagram_tab_settings_content .leftAlign{
|
491 |
+
text-align: left;
|
492 |
+
}
|
493 |
+
|
494 |
+
#diagram_tab_settings_content .rightAlign{
|
495 |
+
text-align: right;
|
496 |
+
}
|
497 |
+
|
498 |
+
.wexo_messages{
|
499 |
+
visibility: hidden;
|
500 |
+
font-size: 0.95em !important;
|
501 |
+
font-weight: bold !important;
|
502 |
+
min-height: 23px !important;
|
503 |
+
padding: 8px 8px 2px 32px !important;
|
504 |
+
background: url("images/success_msg_icon.gif") no-repeat scroll 10px 10px #EFF5EA !important;
|
505 |
+
border: 1px solid #95A486 !important;
|
506 |
+
color: #3D6611 !important;
|
507 |
+
}
|
508 |
+
|
509 |
+
.wexo_messages_error{
|
510 |
+
background: url("images/error_msg_icon.gif") no-repeat scroll 10px 10px #FAEBE7 !important;
|
511 |
+
border: 1px solid #F16048 !important;
|
512 |
+
color: #DF280A !important;
|
513 |
+
}
|
514 |
+
|
515 |
+
|