Skip to content

Commit 3ac26a3

Browse files
committed
Import existing package.
1 parent 9484cbb commit 3ac26a3

File tree

11 files changed

+2883
-110
lines changed

11 files changed

+2883
-110
lines changed

.gitignore

-107
This file was deleted.

README.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
Magento-CalendarView
2-
====================
1+
CalendarView
2+
============
3+
4+
The default date fields for product custom options use a very bad choice of javascript popup. It is over eight years old, has numerous unfixed bugs, is no longer maintained by it's author and is just plain ugly.
5+
6+
This extension replaces that redundent popup with a newer alternative from CalendarView.org which is not only actively maintained but is also easier to use, easier to skin, more reliable and much, much prettier. It is built on the Prototype JS library like the rest of Magento which saves a HTTP request and over 30KB, helping your pages to be smaller and faster for the customer. No extra library is needed, not even jQuery!
7+
8+
Usage
9+
-----
10+
11+
The only configuration needed is in **System > Configuration > Catalog > Date & Time Custom Options > Use Javascript Calendar,** the same as with the old calendar. This extension does not introduce any new options, it just works.
12+
13+
Theming
14+
-------
15+
16+
Skinning is much improved. Just copy `/skin/frontend/base/default/css/calendarview.css` to your theme and edit.
17+
18+
JavaScript source files have been placed in `skin` directory to allow for easier modification. As an example this extension now comes with French and German versions in the appropriate `default/french` and `default/german` skins.
319

4-
Replace the default date picker with a modern, lightweight alternative.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the Open Software License (OSL 3.0)
6+
* that is bundled with this package in the file LICENSE.txt.
7+
* It is also available through the world-wide-web at this URL:
8+
* http://opensource.org/licenses/osl-3.0.php
9+
*
10+
*
11+
* @category Design
12+
* @package Clockworkgeek_CalendarView
13+
* @author Daniel Deady <[email protected]>
14+
* @copyright Copyright (c) 2010, Daniel Deady
15+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16+
*/
17+
18+
class Clockworkgeek_CalendarView_Block_Html_Date extends Mage_Core_Block_Html_Date
19+
{
20+
21+
protected function _toHtml()
22+
{
23+
$html = '<input type="text" name="' . $this->getName() . '" id="' . $this->getId() . '" ';
24+
$html .= 'value="'.$this->getValue().'" class="'.$this->getClass().'" '.$this->getExtraParams().'/> ';
25+
26+
$html .= '<img src="' . $this->getImage() . '" alt="' . $this->helper('core')->__('Select Date') . '" class="v-middle" ';
27+
$html .= 'title="' . $this->helper('core')->__('Select Date') . '" id="' . $this->getId() . '_trig" />';
28+
29+
$helper = Mage::helper('calendarview');
30+
$script = "Calendar.setup({dateField: '{$this->getId()}', triggerElement: '{$this->getId()}_trig', dateFormat: '{$helper->getDateFieldsOrder()}'});";
31+
$html .= Mage::helper('core/js')->getScript($script);
32+
33+
return $html;
34+
}
35+
36+
}
37+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the Open Software License (OSL 3.0)
6+
* that is bundled with this package in the file LICENSE.txt.
7+
* It is also available through the world-wide-web at this URL:
8+
* http://opensource.org/licenses/osl-3.0.php
9+
*
10+
*
11+
* @category Design
12+
* @package Clockworkgeek_CalendarView
13+
* @author Daniel Deady <[email protected]>
14+
* @copyright Copyright (c) 2010, Daniel Deady
15+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16+
*/
17+
18+
class Clockworkgeek_CalendarView_Helper_Data extends Mage_Core_Helper_Data
19+
{
20+
21+
public function getDateFieldsOrder()
22+
{
23+
$text = Mage::getStoreConfig('catalog/custom_options/date_fields_order');
24+
$text = str_replace(
25+
array(',', 'd', 'm', 'y'),
26+
array('/', '%d', '%m', '%Y'),
27+
$text);
28+
return $text;
29+
}
30+
31+
}
32+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* NOTICE OF LICENSE
5+
*
6+
* This source file is subject to the Open Software License (OSL 3.0)
7+
* that is bundled with this package in the file LICENSE.txt.
8+
* It is also available through the world-wide-web at this URL:
9+
* http://opensource.org/licenses/osl-3.0.php
10+
*
11+
*
12+
* @category Design
13+
* @package Clockworkgeek_CalendarView
14+
* @author Daniel Deady <[email protected]>
15+
* @copyright Copyright (c) 2010, Daniel Deady
16+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17+
-->
18+
<config>
19+
20+
<modules>
21+
<Clockworkgeek_CalendarView>
22+
<version>0.3.0</version>
23+
</Clockworkgeek_CalendarView>
24+
</modules>
25+
26+
<global>
27+
<blocks>
28+
<calendarview>
29+
<class>Clockworkgeek_CalendarView_Block</class>
30+
</calendarview>
31+
<core>
32+
<rewrite>
33+
<html_date>Clockworkgeek_CalendarView_Block_Html_Date</html_date>
34+
</rewrite>
35+
</core>
36+
</blocks>
37+
<helpers>
38+
<calendarview>
39+
<class>Clockworkgeek_CalendarView_Helper</class>
40+
</calendarview>
41+
</helpers>
42+
</global>
43+
44+
<frontend>
45+
<layout>
46+
<updates>
47+
<calendarview>
48+
<file>calendarview.xml</file>
49+
</calendarview>
50+
</updates>
51+
</layout>
52+
</frontend>
53+
54+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* NOTICE OF LICENSE
5+
*
6+
* This source file is subject to the Open Software License (OSL 3.0)
7+
* that is bundled with this package in the file LICENSE.txt.
8+
* It is also available through the world-wide-web at this URL:
9+
* http://opensource.org/licenses/osl-3.0.php
10+
*
11+
*
12+
* @category Design
13+
* @package Clockworkgeek_CalendarView
14+
* @author Daniel Deady <[email protected]>
15+
* @copyright Copyright (c) 2010, Daniel Deady
16+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17+
-->
18+
<config>
19+
<modules>
20+
<Clockworkgeek_CalendarView>
21+
<active>true</active>
22+
<codePool>community</codePool>
23+
<depends>
24+
<Mage_Catalog />
25+
</depends>
26+
</Clockworkgeek_CalendarView>
27+
</modules>
28+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
2+
div.calendar
3+
{
4+
font-size: smaller;
5+
color: #000;
6+
z-index: 100;
7+
}
8+
9+
div.calendar.popup
10+
{
11+
margin-left: -40px;
12+
margin-top: -100px;
13+
}
14+
15+
div.calendar table
16+
{
17+
background-color: #eee;
18+
border: 1px solid #aaa;
19+
border-collapse: collapse;
20+
}
21+
22+
div.calendar thead {
23+
background-color: white;
24+
}
25+
26+
div.calendar td,
27+
div.calendar th
28+
{
29+
padding: 3px;
30+
text-align: center;
31+
}
32+
33+
div.calendar td.title
34+
{
35+
font-weight: bold;
36+
}
37+
38+
div.calendar th
39+
{
40+
background: #ddd;
41+
border-bottom: 1px solid #ccc;
42+
border-top: 1px solid #ccc;
43+
font-weight: bold;
44+
color: #555;
45+
}
46+
47+
div.calendar tr.days td {
48+
width: 2em;
49+
color: #555;
50+
text-align: center;
51+
cursor: pointer;
52+
}
53+
54+
div.calendar tr.days td:hover,
55+
div.calendar td.button:hover
56+
{
57+
background-color: #34ABFA;
58+
cursor: pointer;
59+
}
60+
61+
div.calendar tr.days td:active
62+
div.calendar td.button:active
63+
{
64+
background-color: #cde;
65+
}
66+
67+
div.calendar tr.days td.selected
68+
{
69+
font-weight: bold;
70+
background-color: #fff;
71+
color: #000;
72+
}
73+
74+
div.calendar tr.days td.today
75+
{
76+
font-weight: bold;
77+
color: #D50000;
78+
}
79+
80+
div.calendar tr.days td.otherDay
81+
{
82+
color: #bbb;
83+
}

0 commit comments

Comments
 (0)