Version Notes
Version 1.1.1:
* Ordering From Stockinthechannel Rather than Alphabetical
Download this release
Release Info
Developer | stockinchannel |
Extension | Sinch_Tonerconfigurator |
Version | 1.1.1 |
Comparing to | |
See all releases |
Version 1.1.1
- app/code/local/Sinch/Tonerconfigurator/Block/Configurator.php +35 -0
- app/code/local/Sinch/Tonerconfigurator/Block/Configuratordropdowns.php +13 -0
- app/code/local/Sinch/Tonerconfigurator/Helper/Category.php +26 -0
- app/code/local/Sinch/Tonerconfigurator/Helper/Data.php +5 -0
- app/code/local/Sinch/Tonerconfigurator/Model/Category.php +34 -0
- app/code/local/Sinch/Tonerconfigurator/controllers/AjaxController.php +38 -0
- app/code/local/Sinch/Tonerconfigurator/etc/config.xml +79 -0
- app/code/local/Sinch/Tonerconfigurator/etc/widget.xml +76 -0
- app/code/local/Sinch/Tonerconfigurator/sql/mysql4-install-0.1.0.php +9 -0
- app/design/frontend/default/default/layout/tonerconfigurator.xml +10 -0
- app/design/frontend/default/default/template/tonerconfigurator/configurator.phtml +15 -0
- app/design/frontend/default/default/template/tonerconfigurator/configuratordropdowns.phtml +16 -0
- app/design/frontend/default/default/template/tonerconfigurator/configuratorscript.phtml +108 -0
- app/etc/modules/Sinch_Tonerconfigurator.xml +10 -0
- package.xml +19 -0
- skin/frontend/default/default/css/tonerconfigurator/custom.css +0 -0
- skin/frontend/default/default/css/tonerconfigurator/default-noback.css +71 -0
- skin/frontend/default/default/css/tonerconfigurator/default.css +87 -0
- skin/frontend/default/default/css/tonerconfigurator/inline-noback.css +85 -0
- skin/frontend/default/default/css/tonerconfigurator/inline.css +94 -0
- skin/frontend/default/default/js/tonerconfigurator/spin.js +1 -0
app/code/local/Sinch/Tonerconfigurator/Block/Configurator.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sinch_Tonerconfigurator_Block_Configurator extends Mage_Core_Block_Template implements Mage_Widget_Block_Interface
|
3 |
+
{
|
4 |
+
public $TonerConfiguratorTitles;
|
5 |
+
|
6 |
+
protected $_templates;
|
7 |
+
|
8 |
+
protected function _toHtml(){
|
9 |
+
//$this->setTemplate($this->_templates['configurator']);
|
10 |
+
return parent::_toHtml();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function setConfiguratorTemplate($template, $type)
|
14 |
+
{
|
15 |
+
$this->_templates[$type] = $template;
|
16 |
+
return $this;
|
17 |
+
}
|
18 |
+
|
19 |
+
public function __construct()
|
20 |
+
{
|
21 |
+
$this->TonerConfiguratorTitles = Mage::getSingleton('tonerconfigurator/category')->getTonerConfiguratorTitles();
|
22 |
+
parent::__construct();
|
23 |
+
$this->setTemplate('tonerconfigurator/configurator.phtml');
|
24 |
+
}
|
25 |
+
|
26 |
+
public function getMaxLevel(){
|
27 |
+
return (Mage::getStoreConfig('tonerconfigurator/options/category_depth')+1);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getRootCat(){
|
31 |
+
return Mage::getSingleton('tonerconfigurator/category')->getRootCat();
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
?>
|
app/code/local/Sinch/Tonerconfigurator/Block/Configuratordropdowns.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sinch_Tonerconfigurator_Block_Configuratordropdowns extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public $TonerConfiguratorTitles;
|
5 |
+
|
6 |
+
protected $_templates;
|
7 |
+
|
8 |
+
public function __construct(){
|
9 |
+
parent::__construct();
|
10 |
+
$this->setTemplate('tonerconfigurator/configurator.phtml');
|
11 |
+
}
|
12 |
+
}
|
13 |
+
?>
|
app/code/local/Sinch/Tonerconfigurator/Helper/Category.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sinch_Tonerconfigurator_Helper_Category extends Mage_Catalog_Helper_Category
|
3 |
+
{
|
4 |
+
|
5 |
+
public function canShow($category)
|
6 |
+
{
|
7 |
+
if (is_int($category)) {
|
8 |
+
$category = Mage::getModel('catalog/category')->load($category);
|
9 |
+
}
|
10 |
+
|
11 |
+
if (!$category->getId()) {
|
12 |
+
return false;
|
13 |
+
}
|
14 |
+
|
15 |
+
if (!$category->getIsActive()) {
|
16 |
+
return false;
|
17 |
+
}
|
18 |
+
if (!$category->isInRootCategoryList()) {
|
19 |
+
// return false;
|
20 |
+
}
|
21 |
+
|
22 |
+
return true;
|
23 |
+
}
|
24 |
+
|
25 |
+
}
|
26 |
+
?>
|
app/code/local/Sinch/Tonerconfigurator/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sinch_Tonerconfigurator_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
+
|
4 |
+
}
|
5 |
+
?>
|
app/code/local/Sinch/Tonerconfigurator/Model/Category.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sinch_Tonerconfigurator_Model_Category {
|
3 |
+
|
4 |
+
public function showResults($catId){
|
5 |
+
$url = Mage::getModel("catalog/category")->load($catId)->getUrl();
|
6 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect($url);
|
7 |
+
}
|
8 |
+
public function getTonerConfiguratorTitles(){
|
9 |
+
$titles = Mage::getStoreConfig( 'tonerconfigurator/options/titles' );
|
10 |
+
return $titles;
|
11 |
+
}
|
12 |
+
public function isRootCategory($catid){
|
13 |
+
return $catid == $this->getRootCat();
|
14 |
+
}
|
15 |
+
public function getRootSubcatColl(){
|
16 |
+
static $col;
|
17 |
+
if(!$col){
|
18 |
+
$col = Mage::getModel('catalog/category')->getCollection();
|
19 |
+
$col->addAttributeToSelect('*');
|
20 |
+
$col->addFieldToFilter('parent_id', $this->getRootCat());
|
21 |
+
$col->addAttributeToSort('name', 'ASC');
|
22 |
+
}
|
23 |
+
return $col;
|
24 |
+
}
|
25 |
+
public function getRootCat(){
|
26 |
+
static $rootCat;
|
27 |
+
if(!$rootCat){
|
28 |
+
$rootCat = Mage::getStoreConfig("tonerconfigurator/options/root_id");
|
29 |
+
}
|
30 |
+
return $rootCat;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
?>
|
app/code/local/Sinch/Tonerconfigurator/controllers/AjaxController.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sinch_Tonerconfigurator_AjaxController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function loadDropdownAction(){
|
5 |
+
$this->getResponse()->setHeader('Content-type', 'application/json');
|
6 |
+
$catid = $this->getRequest()->getParam('catid', null);
|
7 |
+
$lastlevel = $this->getRequest()->getParam('lastlevel', 0);
|
8 |
+
if(!$catid){
|
9 |
+
$this->getResponse()->setBody("{ success: false, subcategories: [] }");
|
10 |
+
return;
|
11 |
+
}
|
12 |
+
$category = Mage::getModel('catalog/category')->load($catid);
|
13 |
+
if(!$category->hasChildren()){
|
14 |
+
$this->getResponse()->setBody("{ success: false, subcategories: [] }");
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
$children = $category->getChildrenCategories();
|
18 |
+
$response = array();
|
19 |
+
$response['success'] = false;
|
20 |
+
$response['subcategories'] = array();
|
21 |
+
foreach($children as $child){
|
22 |
+
$childArray = array();
|
23 |
+
$childArray['name'] = $child->getName();
|
24 |
+
if($lastlevel){
|
25 |
+
$childArray['URL'] = $child->getUrl();
|
26 |
+
}else {
|
27 |
+
$childArray['id'] = $child->getId();
|
28 |
+
}
|
29 |
+
$response['subcategories'][] = $childArray;
|
30 |
+
}
|
31 |
+
if(!empty($response['subcategories'])){
|
32 |
+
$response['success'] = true;
|
33 |
+
}
|
34 |
+
$this->getResponse()->setBody(json_encode($response));
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
?>
|
app/code/local/Sinch/Tonerconfigurator/etc/config.xml
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Sinch_Tonerconfigurator>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</Sinch_Tonerconfigurator>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<frontend>
|
10 |
+
<routers>
|
11 |
+
<tonerconfigurator>
|
12 |
+
<use>standard</use>
|
13 |
+
<args>
|
14 |
+
<module>Sinch_Tonerconfigurator</module>
|
15 |
+
<frontName>tonerconfigurator</frontName>
|
16 |
+
</args>
|
17 |
+
</tonerconfigurator>
|
18 |
+
</routers>
|
19 |
+
<!--<layout>
|
20 |
+
<updates>
|
21 |
+
<tonerconfigurator>
|
22 |
+
<file>tonerconfigurator.xml</file>
|
23 |
+
</tonerconfigurator>
|
24 |
+
</updates>
|
25 |
+
</layout>-->
|
26 |
+
</frontend>
|
27 |
+
|
28 |
+
<global>
|
29 |
+
<blocks>
|
30 |
+
<tonerconfigurator>
|
31 |
+
<class>Sinch_Tonerconfigurator_Block</class>
|
32 |
+
</tonerconfigurator>
|
33 |
+
</blocks>
|
34 |
+
<helpers>
|
35 |
+
<tonerconfigurator>
|
36 |
+
<class>Sinch_Tonerconfigurator_Helper</class>
|
37 |
+
</tonerconfigurator>
|
38 |
+
<catalog>
|
39 |
+
<rewrite>
|
40 |
+
<category>Sinch_Tonerconfigurator_Helper_Category</category>
|
41 |
+
</rewrite>
|
42 |
+
</catalog>
|
43 |
+
</helpers>
|
44 |
+
<models>
|
45 |
+
<tonerconfigurator>
|
46 |
+
<class>Sinch_Tonerconfigurator_Model</class>
|
47 |
+
<resourceModel>tonerconfigurator_mysql4</resourceModel>
|
48 |
+
</tonerconfigurator>
|
49 |
+
<tonerconfigurator_mysql4>
|
50 |
+
<class>Sinch_Tonerconfigurator_Model_Mysql4</class>
|
51 |
+
</tonerconfigurator_mysql4>
|
52 |
+
</models>
|
53 |
+
<resources>
|
54 |
+
<tonerconfigurator_write>
|
55 |
+
<connection>
|
56 |
+
<use>core_write</use>
|
57 |
+
</connection>
|
58 |
+
</tonerconfigurator_write>
|
59 |
+
<tonerconfigurator_read>
|
60 |
+
<connection>
|
61 |
+
<use>core_read</use>
|
62 |
+
</connection>
|
63 |
+
</tonerconfigurator_read>
|
64 |
+
</resources>
|
65 |
+
</global>
|
66 |
+
<default>
|
67 |
+
<tonerconfigurator>
|
68 |
+
<options>
|
69 |
+
<root_id>4</root_id>
|
70 |
+
<titles>
|
71 |
+
<title1>Printer Make</title1>
|
72 |
+
<title2>Printer Family</title2>
|
73 |
+
<title3>Printer Model</title3>
|
74 |
+
</titles>
|
75 |
+
<category_depth>2</category_depth>
|
76 |
+
</options>
|
77 |
+
</tonerconfigurator>
|
78 |
+
</default>
|
79 |
+
</config>
|
app/code/local/Sinch/Tonerconfigurator/etc/widget.xml
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<widgets>
|
3 |
+
<tonerconfigurator_configurator type="tonerconfigurator/configurator">
|
4 |
+
<name>StockInTheChannel - Toner Configurator</name>
|
5 |
+
<description type="desc">Adds the StockInTheChannel Toner Configurator - Coded By Nicka101</description>
|
6 |
+
<parameters>
|
7 |
+
<title translate="label">
|
8 |
+
<label>Title</label>
|
9 |
+
<visible>1</visible>
|
10 |
+
<required>1</required>
|
11 |
+
<type>text</type>
|
12 |
+
<value>Toner Configurator</value>
|
13 |
+
</title>
|
14 |
+
<styling translate="label">
|
15 |
+
<label>Style</label>
|
16 |
+
<visible>1</visible>
|
17 |
+
<required>1</required>
|
18 |
+
<type>select</type>
|
19 |
+
<values translate="label">
|
20 |
+
<main>
|
21 |
+
<label>Default Style</label>
|
22 |
+
<value>default</value>
|
23 |
+
</main>
|
24 |
+
<default_noback translate="label">
|
25 |
+
<label>Default - No Background (White Text and Borders)</label>
|
26 |
+
<value>default-noback</value>
|
27 |
+
</default_noback>
|
28 |
+
<inline translate="label">
|
29 |
+
<label>Inline</label>
|
30 |
+
<value>inline</value>
|
31 |
+
</inline>
|
32 |
+
<inline_noback translate="label">
|
33 |
+
<label>Inline - No Background</label>
|
34 |
+
<value>inline-noback</value>
|
35 |
+
</inline_noback>
|
36 |
+
<custom translate="label">
|
37 |
+
<label>Custom (Empty By Default)</label>
|
38 |
+
<value>custom</value>
|
39 |
+
</custom>
|
40 |
+
</values>
|
41 |
+
</styling>
|
42 |
+
<button_based translate="label">
|
43 |
+
<label>Use Button to Submit</label>
|
44 |
+
<visible>1</visible>
|
45 |
+
<required>1</required>
|
46 |
+
<type>select</type>
|
47 |
+
<values translate="label">
|
48 |
+
<yes>
|
49 |
+
<label>Yes</label>
|
50 |
+
<value>1</value>
|
51 |
+
</yes>
|
52 |
+
<no>
|
53 |
+
<label>No</label>
|
54 |
+
<value>0</value>
|
55 |
+
</no>
|
56 |
+
</values>
|
57 |
+
</button_based>
|
58 |
+
<search_text translate="label">
|
59 |
+
<label>Search Text</label>
|
60 |
+
<comment>The Text Used on the Search Button (if it exists)</comment>
|
61 |
+
<visible>1</visible>
|
62 |
+
<required>1</required>
|
63 |
+
<type>text</type>
|
64 |
+
<value>Search</value>
|
65 |
+
</search_text>
|
66 |
+
<loading_text translate="label">
|
67 |
+
<label>Loading Text</label>
|
68 |
+
<comment>The Text Used During AJAX Load</comment>
|
69 |
+
<visible>1</visible>
|
70 |
+
<required>1</required>
|
71 |
+
<type>text</type>
|
72 |
+
<value>Loading Category Information...</value>
|
73 |
+
</loading_text>
|
74 |
+
</parameters>
|
75 |
+
</tonerconfigurator_configurator>
|
76 |
+
</widgets>
|
app/code/local/Sinch/Tonerconfigurator/sql/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
|
4 |
+
$installer->startSetup();
|
5 |
+
|
6 |
+
$installer->run("");
|
7 |
+
|
8 |
+
$installer->endSetup();
|
9 |
+
|
app/design/frontend/default/default/layout/tonerconfigurator.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<!--<tonerconfigurator_index_index>
|
6 |
+
<block type="tonerconfigurator/configurator" name="root">
|
7 |
+
<action method="setConfiguratorTemplate"><template>tonerconfigurator/configurator.phtml</template><type>configurator</type></action>
|
8 |
+
</block>
|
9 |
+
</tonerconfigurator_index_index>-->
|
10 |
+
</layout>
|
app/design/frontend/default/default/template/tonerconfigurator/configurator.phtml
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<link href="<?php echo $this->getSkinUrl('css/tonerconfigurator/' . $this->getData('styling') . '.css', array('_use_rewrite' => true)); ?>" rel="stylesheet">
|
2 |
+
<?php require_once('configuratorscript.phtml'); ?>
|
3 |
+
<div class="toner-configurator">
|
4 |
+
<div class="block-title">
|
5 |
+
<strong><span><?php echo $this->getData('title') ?></span></strong>
|
6 |
+
</div>
|
7 |
+
<div class="loadingmask" style="display: none;">
|
8 |
+
<div class="loader"><div class="spinner"></div><br /><span><?php echo $this->getData('loading_text'); ?></span></div>
|
9 |
+
</div>
|
10 |
+
<div class="block-content">
|
11 |
+
<div class="configurator-dropdowns-div">
|
12 |
+
<?php require('configuratordropdowns.phtml'); ?>
|
13 |
+
</div>
|
14 |
+
</div>
|
15 |
+
</div>
|
app/design/frontend/default/default/template/tonerconfigurator/configuratordropdowns.phtml
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$size = Mage::getStoreConfig("tonerconfigurator/options/category_depth")+1;
|
3 |
+
?>
|
4 |
+
<ul class="configurator-categories">
|
5 |
+
<?php for($level = 1; $level <= $size; $level++): ?>
|
6 |
+
<li class="toner-li-<?php echo $level ?>">
|
7 |
+
<select class="toner-select-<?php echo $level ?>" <?php if(($level == $size) && ($this->getData('button_based')==1)){ echo "onchange=\"changeLastLevel(this.value, $(this).up('.toner-configurator'))\""; } else { echo "onchange=\"changeCategory(" . $level . ", this.value, $(this).up('.toner-configurator'))\""; } ?>> <?php if (isset($this->TonerConfiguratorTitles['title'.($level)])):?>
|
8 |
+
<option value=""><?php echo $this->TonerConfiguratorTitles['title'.$level]?></option>
|
9 |
+
<?php endif; ?>
|
10 |
+
</select>
|
11 |
+
</li>
|
12 |
+
<?php endfor; ?>
|
13 |
+
</ul>
|
14 |
+
<?php if($this->getData('button_based')==1): ?>
|
15 |
+
<button type="button" class="toner-button-submit" disabled onclick="changeCategory(<?php echo $size ?>, $(this).up('.toner-configurator').getElementsByClassName('toner-select-<?php echo $size ?>')[0].options[$(this).up('.toner-configurator').getElementsByClassName('toner-select-<?php echo $size ?>')[0].selectedIndex].value, $(this).up('.toner-configurator'))"><?php echo($this->getData('search_text')) ?></button>
|
16 |
+
<?php endif;?>
|
app/design/frontend/default/default/template/tonerconfigurator/configuratorscript.phtml
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script src="<?php echo $this->getSkinUrl('js/tonerconfigurator/spin.js', array('_use_rewrite' => true)); ?>" type="text/javascript"></script>
|
2 |
+
<script>
|
3 |
+
window.maxtonerlevel = <?php echo $this->getMaxLevel() ?>;
|
4 |
+
function changeCategory(level, val, configurator){
|
5 |
+
if(val == null || val == "")return;
|
6 |
+
var reloadurl = '<?php echo $this->getUrl('tonerconfigurator/ajax/loadDropdown') ?>';
|
7 |
+
if(maxtonerlevel == level){
|
8 |
+
window.location.href = val;
|
9 |
+
}
|
10 |
+
loadMask(true, configurator);
|
11 |
+
var inputs = configurator.getElementsByTagName('select');
|
12 |
+
for (var i = 0; i < inputs.length; i++) {
|
13 |
+
inputs[i].disabled = true;
|
14 |
+
}
|
15 |
+
var newLevel = level+1;
|
16 |
+
reloadurl += 'catid/'+val;
|
17 |
+
if(newLevel == maxtonerlevel){
|
18 |
+
reloadurl += '/lastlevel/1';
|
19 |
+
}
|
20 |
+
new Ajax.Request(reloadurl, {
|
21 |
+
method: 'get',
|
22 |
+
parameters: '',
|
23 |
+
onComplete: function(transport){
|
24 |
+
var newCategories = JSON.parse(transport.responseText);
|
25 |
+
if(!newCategories.success)alert("Somthing Went Wrong");
|
26 |
+
for(var i = level; i < maxtonerlevel; i++){
|
27 |
+
var a = configurator.getElementsByTagName('select')[i];
|
28 |
+
a.innerHTML = "<option selected>" + a.getAttribute("data-tonertitle") + "</option>";
|
29 |
+
}
|
30 |
+
var newSelect = "";
|
31 |
+
for(var i = 0; i < newCategories.subcategories.length; i++){
|
32 |
+
var data = ((newCategories.subcategories[i].id == null) ? newCategories.subcategories[i].URL : newCategories.subcategories[i].id);
|
33 |
+
newSelect += "<option value=\"" + data + "\" >" + newCategories.subcategories[i].name + "</option>";
|
34 |
+
}
|
35 |
+
configurator.getElementsByTagName('select')[level].innerHTML += newSelect;
|
36 |
+
var inputs = configurator.getElementsByTagName('select');
|
37 |
+
for (var i = 0; i < newLevel; i++) {
|
38 |
+
inputs[i].disabled = false;
|
39 |
+
}
|
40 |
+
<?php if($this->getData('button_based')==1): ?>
|
41 |
+
var toner_b = configurator.getElementsByClassName('toner-button-submit')[0];
|
42 |
+
if((newLevel != window.maxtonerlevel) && (toner_b.disabled == false)){
|
43 |
+
toner_b.disabled = true;
|
44 |
+
} else if(newLevel == window.maxtonerlevel){
|
45 |
+
toner_b.disabled = true;
|
46 |
+
}
|
47 |
+
<?php endif; ?>
|
48 |
+
loadMask(false, configurator);
|
49 |
+
},
|
50 |
+
onTimeout: function() { alert('Timeout!'); },
|
51 |
+
onFailure: function() { alert('Something went wrong...') },
|
52 |
+
});
|
53 |
+
}
|
54 |
+
<?php if($this->getData('button_based')==1): ?>
|
55 |
+
function changeLastLevel(option, configurator){
|
56 |
+
var toner_b = configurator.getElementsByClassName('toner-button-submit')[0];
|
57 |
+
if(option == "" && !(toner_b.disabled)){
|
58 |
+
toner_b.disabled = true;
|
59 |
+
} else if(option != "" && toner_b.disabled){
|
60 |
+
toner_b.disabled = false;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
<?php endif; ?>
|
64 |
+
|
65 |
+
function loadMask(show, configurator){
|
66 |
+
var a = configurator.getElementsByClassName('loadingmask')[0];
|
67 |
+
if(show){
|
68 |
+
a.style.display = 'block';
|
69 |
+
a.style.visibility = 'visible';
|
70 |
+
} else {
|
71 |
+
a.style.display = 'none';
|
72 |
+
a.style.visibility = 'hidden';
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
Event.observe(window,"load", function(){
|
77 |
+
var opts = {
|
78 |
+
lines: 17, // The number of lines to draw
|
79 |
+
length: 5, // The length of each line
|
80 |
+
width: 2, // The line thickness
|
81 |
+
radius: 7, // The radius of the inner circle
|
82 |
+
corners: 1, // Corner roundness (0..1)
|
83 |
+
rotate: 0, // The rotation offset
|
84 |
+
direction: 1, // 1: clockwise, -1: counterclockwise
|
85 |
+
color: '#000', // #rgb or #rrggbb
|
86 |
+
speed: 1.2, // Rounds per second
|
87 |
+
trail: 66, // Afterglow percentage
|
88 |
+
shadow: false, // Whether to render a shadow
|
89 |
+
hwaccel: true, // Whether to use hardware acceleration
|
90 |
+
className: 'aspinner', // The CSS class to assign to the spinner
|
91 |
+
zIndex: 2e9, // The z-index (defaults to 2000000000)
|
92 |
+
top: 'auto', // Top position relative to parent in px
|
93 |
+
left: 'auto' // Left position relative to parent in px
|
94 |
+
};
|
95 |
+
var spinners = document.getElementsByClassName('spinner');
|
96 |
+
for(var i = 0; i < spinners.length; i++){
|
97 |
+
var spinner = new Spinner(opts).spin(spinners[i]);
|
98 |
+
}
|
99 |
+
var configurators = document.getElementsByClassName('toner-configurator');
|
100 |
+
for(var i = 0; i < configurators.length; i++){
|
101 |
+
var selects = configurators[i].getElementsByTagName('select');
|
102 |
+
for(var j = 0; j < selects.length; j++){
|
103 |
+
selects[j].setAttribute("data-tonertitle", selects[j].options[0].text);
|
104 |
+
}
|
105 |
+
changeCategory(0, <?php echo $this->getRootCat(); ?>, configurators[i]);
|
106 |
+
}
|
107 |
+
});
|
108 |
+
</script>
|
app/etc/modules/Sinch_Tonerconfigurator.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Sinch_Tonerconfigurator>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>local</codePool>
|
8 |
+
</Sinch_Tonerconfigurator>
|
9 |
+
</modules>
|
10 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Sinch_Tonerconfigurator</name>
|
4 |
+
<version>1.1.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Stockinthechannel.com's Toner Configurator</summary>
|
10 |
+
<description>Toner Configurator for use with Stockinthechannel.com's Toner Feed Export</description>
|
11 |
+
<notes>Version 1.1.1:
|
12 |
+
* Ordering From Stockinthechannel Rather than Alphabetical</notes>
|
13 |
+
<authors><author><name>stockinchannel</name><user>stockinchannel</user><email>support@stockinthechannel.com</email></author><author><name>Nick Anstee</name><user>nicka101</user><email>nick@stockinthechannel.com</email></author></authors>
|
14 |
+
<date>2013-09-12</date>
|
15 |
+
<time>15:45:58</time>
|
16 |
+
<contents><target name="magelocal"><dir name="Sinch"><dir name="Tonerconfigurator"><dir name="Block"><file name="Configurator.php" hash="aa540c9a2bbc7bbdbfa52bd996c40967"/><file name="Configuratordropdowns.php" hash="b71cd48c7afd90c1a85f3379875480c3"/></dir><dir name="Helper"><file name="Category.php" hash="4ae090a183e13b2b6f88669bcb7f00ef"/><file name="Data.php" hash="963744c7c85b3179d7a8287d253c17ac"/></dir><dir name="Model"><file name="Category.php" hash="ca8a3711f4e10fcbb87b45466bf33dc0"/></dir><dir name="controllers"><file name="AjaxController.php" hash="28c86fc1d7ffc8be9d6759f04badb0db"/></dir><dir name="etc"><file name="config.xml" hash="31bfe0b817e5c3a71fda91e864eadc4b"/><file name="widget.xml" hash="806bf5bb71f3016a0b3bc47cc20818b9"/></dir><dir name="sql"><file name="mysql4-install-0.1.0.php" hash="3b052403649a5970bcaf8264ae06cd8e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sinch_Tonerconfigurator.xml" hash="27db1fe889731da93159361df23dcd45"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="tonerconfigurator"><file name="configurator.phtml" hash="8a8863f441cfb008fcb4c0e5673d35ca"/><file name="configuratordropdowns.phtml" hash="a3cf9439915387af3382c65b2422c765"/><file name="configuratorscript.phtml" hash="f35d93f5269425413b92ab45bc0f0c86"/></dir></dir><dir name="layout"><file name="tonerconfigurator.xml" hash="212a8975fa16dea8516740c013e352d1"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="tonerconfigurator"><file name="custom.css" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="default-noback.css" hash="8cc8540b73809ad6d3e41fb263e6afb3"/><file name="default.css" hash="e4244af2f6e0c5341d30824d050fdd5b"/><file name="inline-noback.css" hash="089a41d0fdb9f61ce83c7af7c6766599"/><file name="inline.css" hash="c9586ceccebc9c928df0deaa96fbf31b"/></dir></dir><dir name="js"><dir name="tonerconfigurator"><file name="spin.js" hash="a0a33607d171b0b3a1935e45c6a96de9"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
+
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
+
</package>
|
skin/frontend/default/default/css/tonerconfigurator/custom.css
ADDED
File without changes
|
skin/frontend/default/default/css/tonerconfigurator/default-noback.css
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ul.configurator-categories{
|
2 |
+
list-style-type:none !important;
|
3 |
+
padding:0;
|
4 |
+
margin:0px;
|
5 |
+
width:100%;
|
6 |
+
}
|
7 |
+
ul.configurator-categories > li{
|
8 |
+
margin-left:auto;
|
9 |
+
margin-right:auto;
|
10 |
+
width:100%;
|
11 |
+
}
|
12 |
+
ul.configurator-categories > li > select{
|
13 |
+
/*margin-left:10%;
|
14 |
+
margin-right:10%;*/
|
15 |
+
margin-left:auto;
|
16 |
+
margin-right:auto;
|
17 |
+
min-width:100px;
|
18 |
+
max-width:300px;
|
19 |
+
border:1px solid #fff;
|
20 |
+
}
|
21 |
+
.toner-button-submit {
|
22 |
+
padding:2px 6px;
|
23 |
+
}
|
24 |
+
.toner-configurator {
|
25 |
+
position:relative;
|
26 |
+
max-width:200px;
|
27 |
+
padding: 9px 19px;
|
28 |
+
}
|
29 |
+
.loadingmask {
|
30 |
+
position:absolute;
|
31 |
+
z-index:200;
|
32 |
+
text-align:center;
|
33 |
+
top:35%;
|
34 |
+
left:30px;
|
35 |
+
right:30px;
|
36 |
+
vertical-align:middle;
|
37 |
+
padding: 4px;
|
38 |
+
background-color: #e8e8e8;
|
39 |
+
border: 1px solid #d8d8d8;
|
40 |
+
-webkit-border-radius: 5px;
|
41 |
+
-moz-border-radius: 5px;
|
42 |
+
border-radius: 5px;
|
43 |
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
44 |
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
45 |
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
46 |
+
font-weight:bold;
|
47 |
+
font-size:12px;
|
48 |
+
}
|
49 |
+
.spinner {
|
50 |
+
width:0px;
|
51 |
+
margin-top:15px;
|
52 |
+
margin-left:auto;
|
53 |
+
margin-right:auto;
|
54 |
+
height:15px;
|
55 |
+
}
|
56 |
+
.toner-configurator > .block-title {
|
57 |
+
text-align:center;
|
58 |
+
border-bottom:1px solid #000;
|
59 |
+
color: #fff;
|
60 |
+
}
|
61 |
+
.col-main .toner-configurator > .block-title {
|
62 |
+
font-size:16px;
|
63 |
+
}
|
64 |
+
.configurator-dropdowns-div, .toner-button-submit {
|
65 |
+
margin:0px auto;
|
66 |
+
text-align:center;
|
67 |
+
}
|
68 |
+
.toner-button-submit:disabled {
|
69 |
+
display:none;
|
70 |
+
visibility:hidden;
|
71 |
+
}
|
skin/frontend/default/default/css/tonerconfigurator/default.css
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ul.configurator-categories{
|
2 |
+
list-style-type:none !important;
|
3 |
+
padding:0;
|
4 |
+
margin:5px 0px;
|
5 |
+
width:100%;
|
6 |
+
}
|
7 |
+
ul.configurator-categories > li{
|
8 |
+
margin-left:auto;
|
9 |
+
margin-right:auto;
|
10 |
+
width:100%;
|
11 |
+
}
|
12 |
+
ul.configurator-categories > li > select{
|
13 |
+
margin-top:5px;
|
14 |
+
/*margin-left:10%;
|
15 |
+
margin-right:10%;*/
|
16 |
+
margin-left:auto;
|
17 |
+
margin-right:auto;
|
18 |
+
width:80%;
|
19 |
+
min-width:100px;
|
20 |
+
max-width:300px;
|
21 |
+
border:1px solid #000;
|
22 |
+
}
|
23 |
+
ul.configurator-categories > li:first-child{
|
24 |
+
margin-top:10px;
|
25 |
+
}
|
26 |
+
.toner-button-submit {
|
27 |
+
margin-left:auto;
|
28 |
+
margin-right:auto;
|
29 |
+
padding:5px 10px;
|
30 |
+
}
|
31 |
+
.toner-configurator {
|
32 |
+
position:relative;
|
33 |
+
margin-left:auto;
|
34 |
+
margin-right:auto;
|
35 |
+
max-width:200px;
|
36 |
+
padding: 19px 29px;
|
37 |
+
background-color: #f5f5f5;
|
38 |
+
border: 1px solid #e5e5e5;
|
39 |
+
-webkit-border-radius: 5px;
|
40 |
+
-moz-border-radius: 5px;
|
41 |
+
border-radius: 5px;
|
42 |
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
43 |
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
44 |
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
45 |
+
}
|
46 |
+
.loadingmask {
|
47 |
+
position:absolute;
|
48 |
+
z-index:200;
|
49 |
+
text-align:center;
|
50 |
+
top:35%;
|
51 |
+
left:30px;
|
52 |
+
right:30px;
|
53 |
+
vertical-align:middle;
|
54 |
+
padding: 4px;
|
55 |
+
background-color: #e8e8e8;
|
56 |
+
border: 1px solid #d8d8d8;
|
57 |
+
-webkit-border-radius: 5px;
|
58 |
+
-moz-border-radius: 5px;
|
59 |
+
border-radius: 5px;
|
60 |
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
61 |
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
62 |
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
63 |
+
font-weight:bold;
|
64 |
+
font-size:12px;
|
65 |
+
}
|
66 |
+
.spinner {
|
67 |
+
width:0px;
|
68 |
+
margin-top:15px;
|
69 |
+
margin-left:auto;
|
70 |
+
margin-right:auto;
|
71 |
+
height:15px;
|
72 |
+
}
|
73 |
+
.toner-configurator > .block-title {
|
74 |
+
text-align:center;
|
75 |
+
border-bottom:1px solid rgb(221, 220, 220);
|
76 |
+
}
|
77 |
+
.col-main .toner-configurator > .block-title {
|
78 |
+
font-size:16px;
|
79 |
+
}
|
80 |
+
.configurator-dropdowns-div, .toner-button-submit {
|
81 |
+
margin:0px auto;
|
82 |
+
text-align:center;
|
83 |
+
}
|
84 |
+
.toner-button-submit:disabled {
|
85 |
+
display:none;
|
86 |
+
visibility:hidden;
|
87 |
+
}
|
skin/frontend/default/default/css/tonerconfigurator/inline-noback.css
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ul.configurator-categories{
|
2 |
+
list-style-type:none !important;
|
3 |
+
display:inline;
|
4 |
+
padding:0;
|
5 |
+
margin:5px 0px;
|
6 |
+
width:100%;
|
7 |
+
}
|
8 |
+
ul.configurator-categories > li{
|
9 |
+
display:inline;
|
10 |
+
margin-right:5px;
|
11 |
+
padding-bottom:3px;
|
12 |
+
width:100%;
|
13 |
+
}
|
14 |
+
ul.configurator-categories > li > select{
|
15 |
+
margin-top:5px;
|
16 |
+
/*margin-left:10%;
|
17 |
+
margin-right:10%;*/
|
18 |
+
min-width:100px;
|
19 |
+
max-width:300px;
|
20 |
+
border:1px solid #fff;
|
21 |
+
}
|
22 |
+
.toner-button-submit {
|
23 |
+
margin-left:auto;
|
24 |
+
margin-right:auto;
|
25 |
+
padding:2px 6px;
|
26 |
+
}
|
27 |
+
.toner-configurator {
|
28 |
+
position:relative;
|
29 |
+
margin-left:auto;
|
30 |
+
margin-right:auto;
|
31 |
+
padding: 9px 19px;
|
32 |
+
}
|
33 |
+
.toner-configurator div {
|
34 |
+
display:inline;
|
35 |
+
}
|
36 |
+
.loadingmask {
|
37 |
+
position:absolute;
|
38 |
+
z-index:200;
|
39 |
+
text-align:center;
|
40 |
+
top:0;
|
41 |
+
left:30px;
|
42 |
+
right:30px;
|
43 |
+
vertical-align:middle;
|
44 |
+
padding: 4px;
|
45 |
+
background-color: #e8e8e8;
|
46 |
+
border: 1px solid #d8d8d8;
|
47 |
+
-webkit-border-radius: 5px;
|
48 |
+
-moz-border-radius: 5px;
|
49 |
+
border-radius: 5px;
|
50 |
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
51 |
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
52 |
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
53 |
+
font-weight:bold;
|
54 |
+
font-size:12px;
|
55 |
+
padding-bottom:12px;
|
56 |
+
}
|
57 |
+
.spinner {
|
58 |
+
position:relative;
|
59 |
+
top:12px;
|
60 |
+
width:0px;
|
61 |
+
margin-left:auto;
|
62 |
+
margin-right:auto;
|
63 |
+
bottom:15px;
|
64 |
+
}
|
65 |
+
.loadingmask span {
|
66 |
+
position:relative;
|
67 |
+
top:10px;
|
68 |
+
margin-bottom:15px;
|
69 |
+
}
|
70 |
+
.toner-configurator > .block-title {
|
71 |
+
margin-top:2px;
|
72 |
+
margin-right:5px;
|
73 |
+
color:#fff;
|
74 |
+
}
|
75 |
+
.col-main .toner-configurator > .block-title {
|
76 |
+
font-size:14px;
|
77 |
+
}
|
78 |
+
.configurator-dropdowns-div, .toner-button-submit {
|
79 |
+
margin:0px auto;
|
80 |
+
text-align:center;
|
81 |
+
}
|
82 |
+
.toner-button-submit:disabled {
|
83 |
+
display:none;
|
84 |
+
visibility:hidden;
|
85 |
+
}
|
skin/frontend/default/default/css/tonerconfigurator/inline.css
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ul.configurator-categories{
|
2 |
+
list-style-type:none !important;
|
3 |
+
display:inline;
|
4 |
+
padding:0;
|
5 |
+
margin:5px 0px;
|
6 |
+
width:100%;
|
7 |
+
}
|
8 |
+
ul.configurator-categories > li{
|
9 |
+
display:inline;
|
10 |
+
margin-right:5px;
|
11 |
+
padding-bottom:3px;
|
12 |
+
width:100%;
|
13 |
+
}
|
14 |
+
ul.configurator-categories > li > select{
|
15 |
+
margin-top:5px;
|
16 |
+
/*margin-left:10%;
|
17 |
+
margin-right:10%;*/
|
18 |
+
min-width:100px;
|
19 |
+
max-width:300px;
|
20 |
+
border:1px solid #000;
|
21 |
+
}
|
22 |
+
.toner-button-submit {
|
23 |
+
margin-left:auto;
|
24 |
+
margin-right:auto;
|
25 |
+
padding:2px 6px;
|
26 |
+
}
|
27 |
+
.toner-configurator {
|
28 |
+
position:relative;
|
29 |
+
margin-left:auto;
|
30 |
+
margin-right:auto;
|
31 |
+
max-width:600px;
|
32 |
+
padding: 9px 19px;
|
33 |
+
background-color: #f5f5f5;
|
34 |
+
border: 1px solid #e5e5e5;
|
35 |
+
-webkit-border-radius: 5px;
|
36 |
+
-moz-border-radius: 5px;
|
37 |
+
border-radius: 5px;
|
38 |
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
39 |
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
40 |
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
41 |
+
text-align:left;
|
42 |
+
}
|
43 |
+
.toner-configurator div {
|
44 |
+
display:inline;
|
45 |
+
}
|
46 |
+
.loadingmask {
|
47 |
+
position:absolute;
|
48 |
+
z-index:200;
|
49 |
+
text-align:center;
|
50 |
+
top:0;
|
51 |
+
left:30px;
|
52 |
+
right:30px;
|
53 |
+
vertical-align:middle;
|
54 |
+
padding: 4px;
|
55 |
+
background-color: #e8e8e8;
|
56 |
+
border: 1px solid #d8d8d8;
|
57 |
+
-webkit-border-radius: 5px;
|
58 |
+
-moz-border-radius: 5px;
|
59 |
+
border-radius: 5px;
|
60 |
+
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
61 |
+
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
62 |
+
box-shadow: 0 1px 2px rgba(0,0,0,.05);
|
63 |
+
font-weight:bold;
|
64 |
+
font-size:12px;
|
65 |
+
padding-bottom:12px;
|
66 |
+
}
|
67 |
+
.spinner {
|
68 |
+
position:relative;
|
69 |
+
top:12px;
|
70 |
+
width:0px;
|
71 |
+
margin-left:auto;
|
72 |
+
margin-right:auto;
|
73 |
+
bottom:15px;
|
74 |
+
}
|
75 |
+
.loadingmask span {
|
76 |
+
position:relative;
|
77 |
+
top:10px;
|
78 |
+
margin-bottom:15px;
|
79 |
+
}
|
80 |
+
.toner-configurator > .block-title {
|
81 |
+
margin-top:2px;
|
82 |
+
margin-right:5px;
|
83 |
+
}
|
84 |
+
.col-main .toner-configurator > .block-title {
|
85 |
+
font-size:14px;
|
86 |
+
}
|
87 |
+
.configurator-dropdowns-div, .toner-button-submit {
|
88 |
+
margin:0px auto;
|
89 |
+
text-align:center;
|
90 |
+
}
|
91 |
+
.toner-button-submit:disabled {
|
92 |
+
display:none;
|
93 |
+
visibility:hidden;
|
94 |
+
}
|
skin/frontend/default/default/js/tonerconfigurator/spin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
(function(t,e){if(typeof exports=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else t.Spinner=e()})(this,function(){"use strict";var t=["webkit","Moz","ms","O"],e={},i;function o(t,e){var i=document.createElement(t||"div"),o;for(o in e)i[o]=e[o];return i}function n(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}var r=function(){var t=o("style",{type:"text/css"});n(document.getElementsByTagName("head")[0],t);return t.sheet||t.styleSheet}();function s(t,o,n,s){var a=["opacity",o,~~(t*100),n,s].join("-"),f=.01+n/s*100,l=Math.max(1-(1-t)/o*(100-f),t),d=i.substring(0,i.indexOf("Animation")).toLowerCase(),u=d&&"-"+d+"-"||"";if(!e[a]){r.insertRule("@"+u+"keyframes "+a+"{"+"0%{opacity:"+l+"}"+f+"%{opacity:"+t+"}"+(f+.01)+"%{opacity:1}"+(f+o)%100+"%{opacity:"+t+"}"+"100%{opacity:"+l+"}"+"}",r.cssRules.length);e[a]=1}return a}function a(e,i){var o=e.style,n,r;if(o[i]!==undefined)return i;i=i.charAt(0).toUpperCase()+i.slice(1);for(r=0;r<t.length;r++){n=t[r]+i;if(o[n]!==undefined)return n}}function f(t,e){for(var i in e)t.style[a(t,i)||i]=e[i];return t}function l(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)if(t[o]===undefined)t[o]=i[o]}return t}function d(t){var e={x:t.offsetLeft,y:t.offsetTop};while(t=t.offsetParent)e.x+=t.offsetLeft,e.y+=t.offsetTop;return e}var u={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:1/4,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};function p(t){if(typeof this=="undefined")return new p(t);this.opts=l(t||{},p.defaults,u)}p.defaults={};l(p.prototype,{spin:function(t){this.stop();var e=this,n=e.opts,r=e.el=f(o(0,{className:n.className}),{position:n.position,width:0,zIndex:n.zIndex}),s=n.radius+n.length+n.width,a,l;if(t){t.insertBefore(r,t.firstChild||null);l=d(t);a=d(r);f(r,{left:(n.left=="auto"?l.x-a.x+(t.offsetWidth>>1):parseInt(n.left,10)+s)+"px",top:(n.top=="auto"?l.y-a.y+(t.offsetHeight>>1):parseInt(n.top,10)+s)+"px"})}r.setAttribute("role","progressbar");e.lines(r,e.opts);if(!i){var u=0,p=(n.lines-1)*(1-n.direction)/2,c,h=n.fps,m=h/n.speed,y=(1-n.opacity)/(m*n.trail/100),g=m/n.lines;(function v(){u++;for(var t=0;t<n.lines;t++){c=Math.max(1-(u+(n.lines-t)*g)%m*y,n.opacity);e.opacity(r,t*n.direction+p,c,n)}e.timeout=e.el&&setTimeout(v,~~(1e3/h))})()}return e},stop:function(){var t=this.el;if(t){clearTimeout(this.timeout);if(t.parentNode)t.parentNode.removeChild(t);this.el=undefined}return this},lines:function(t,e){var r=0,a=(e.lines-1)*(1-e.direction)/2,l;function d(t,i){return f(o(),{position:"absolute",width:e.length+e.width+"px",height:e.width+"px",background:t,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/e.lines*r+e.rotate)+"deg) translate("+e.radius+"px"+",0)",borderRadius:(e.corners*e.width>>1)+"px"})}for(;r<e.lines;r++){l=f(o(),{position:"absolute",top:1+~(e.width/2)+"px",transform:e.hwaccel?"translate3d(0,0,0)":"",opacity:e.opacity,animation:i&&s(e.opacity,e.trail,a+r*e.direction,e.lines)+" "+1/e.speed+"s linear infinite"});if(e.shadow)n(l,f(d("#000","0 0 4px "+"#000"),{top:2+"px"}));n(t,n(l,d(e.color,"0 0 1px rgba(0,0,0,.1)")))}return t},opacity:function(t,e,i){if(e<t.childNodes.length)t.childNodes[e].style.opacity=i}});function c(){function t(t,e){return o("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',e)}r.addRule(".spin-vml","behavior:url(#default#VML)");p.prototype.lines=function(e,i){var o=i.length+i.width,r=2*o;function s(){return f(t("group",{coordsize:r+" "+r,coordorigin:-o+" "+-o}),{width:r,height:r})}var a=-(i.width+i.length)*2+"px",l=f(s(),{position:"absolute",top:a,left:a}),d;function u(e,r,a){n(l,n(f(s(),{rotation:360/i.lines*e+"deg",left:~~r}),n(f(t("roundrect",{arcsize:i.corners}),{width:o,height:i.width,left:i.radius,top:-i.width>>1,filter:a}),t("fill",{color:i.color,opacity:i.opacity}),t("stroke",{opacity:0}))))}if(i.shadow)for(d=1;d<=i.lines;d++)u(d,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(d=1;d<=i.lines;d++)u(d);return n(e,l)};p.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0;if(n&&e+o<n.childNodes.length){n=n.childNodes[e+o];n=n&&n.firstChild;n=n&&n.firstChild;if(n)n.opacity=i}}}var h=f(o("group"),{behavior:"url(#default#VML)"});if(!a(h,"transform")&&h.adj)c();else i=a(h,"animation");return p});
|