Version Notes
v0.1.4 - Initial Release
Download this release
Release Info
Developer | Kash Corp. |
Extension | kash_gateway |
Version | 0.1.4 |
Comparing to | |
See all releases |
Code changes from version 0.1.1 to 0.1.4
- app/code/local/Kash/Gateway/Model/Checkout.php +0 -12
- app/code/local/Kash/Gateway/Model/Observer.php +0 -22
- app/code/local/Kash/Gateway/controllers/BbController.php +1 -0
- app/code/local/Kash/Gateway/etc/config.xml +1 -10
- app/code/local/Kash/Gateway/etc/system.xml +0 -1
- app/design/frontend/base/default/layout/kash/gateway.xml +16 -0
- app/design/frontend/base/default/template/kash/payment/mark.phtml +23 -0
- package.xml +6 -6
- skin/frontend/base/default/css/kash/lightwindow.css +393 -0
- skin/frontend/base/default/js/kash/lightwindow.js +1918 -0
app/code/local/Kash/Gateway/Model/Checkout.php
CHANGED
@@ -275,18 +275,6 @@ class Kash_Gateway_Model_Checkout
|
|
275 |
return;
|
276 |
}
|
277 |
|
278 |
-
switch ($order->getState()) {
|
279 |
-
// even after placement payment can disallow to authorize/capture, but will wait until bank transfers money
|
280 |
-
case Mage_Sales_Model_Order::STATE_PENDING_PAYMENT:
|
281 |
-
// TODO
|
282 |
-
break;
|
283 |
-
// regular placement, when everything is ok
|
284 |
-
case Mage_Sales_Model_Order::STATE_PROCESSING:
|
285 |
-
case Mage_Sales_Model_Order::STATE_COMPLETE:
|
286 |
-
case Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW:
|
287 |
-
$order->queueNewOrderEmail();
|
288 |
-
break;
|
289 |
-
}
|
290 |
$this->_order = $order;
|
291 |
}
|
292 |
|
275 |
return;
|
276 |
}
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
$this->_order = $order;
|
279 |
}
|
280 |
|
app/code/local/Kash/Gateway/Model/Observer.php
CHANGED
@@ -42,27 +42,5 @@ class Kash_Gateway_Model_Observer extends Varien_Object
|
|
42 |
}
|
43 |
}
|
44 |
|
45 |
-
/**
|
46 |
-
* Add payment data to info block
|
47 |
-
*
|
48 |
-
* @param Varien_Object $observer
|
49 |
-
* @return Mage_Centinel_Model_Observer
|
50 |
-
*/
|
51 |
-
public function paymentInfoBlockPrepareSpecificInformation($observer)
|
52 |
-
{
|
53 |
-
if ($observer->getEvent()->getBlock()->getIsSecureMode()) {
|
54 |
-
return;
|
55 |
-
}
|
56 |
-
|
57 |
-
$order = $observer->getEvent()->getPayment()->getOrder();
|
58 |
-
$discountAmount = abs($order->getDiscountAmount());
|
59 |
-
$subtotal = $order->getSubtotal();
|
60 |
-
|
61 |
-
$percent = round($discountAmount * 100 / $subtotal, 2);
|
62 |
-
$transport = $observer->getEvent()->getTransport();
|
63 |
-
$transport->setData('Gateway percent', $percent . '%');
|
64 |
-
|
65 |
-
return $this;
|
66 |
-
}
|
67 |
}
|
68 |
|
42 |
}
|
43 |
}
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
app/code/local/Kash/Gateway/controllers/BbController.php
CHANGED
@@ -282,6 +282,7 @@ class Kash_Gateway_BbController extends Mage_Core_Controller_Front_Action
|
|
282 |
$invoice->getOrder()->setCustomerNoteNotify(false);
|
283 |
$invoice->getOrder()->setIsInProcess(true);
|
284 |
$order->addStatusHistoryComment('Automatically INVOICED by Kash Gateway.', false);
|
|
|
285 |
|
286 |
$transactionSave = Mage::getModel('core/resource_transaction')
|
287 |
->addObject($invoice)
|
282 |
$invoice->getOrder()->setCustomerNoteNotify(false);
|
283 |
$invoice->getOrder()->setIsInProcess(true);
|
284 |
$order->addStatusHistoryComment('Automatically INVOICED by Kash Gateway.', false);
|
285 |
+
$order->sendNewOrderEmail();
|
286 |
|
287 |
$transactionSave = Mage::getModel('core/resource_transaction')
|
288 |
->addObject($invoice)
|
app/code/local/Kash/Gateway/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Kash_Gateway>
|
5 |
-
<version>0.1.
|
6 |
</Kash_Gateway>
|
7 |
</modules>
|
8 |
<global>
|
@@ -67,15 +67,6 @@
|
|
67 |
</kash_gateway>
|
68 |
</observers>
|
69 |
</core_collection_abstract_load_before>
|
70 |
-
<payment_info_block_prepare_specific_information>
|
71 |
-
<observers>
|
72 |
-
<kash_gateway>
|
73 |
-
<type>model</type>
|
74 |
-
<class>kash_gateway/observer</class>
|
75 |
-
<method>paymentInfoBlockPrepareSpecificInformation</method>
|
76 |
-
</kash_gateway>
|
77 |
-
</observers>
|
78 |
-
</payment_info_block_prepare_specific_information>
|
79 |
</events>
|
80 |
</adminhtml>
|
81 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Kash_Gateway>
|
5 |
+
<version>0.1.4</version>
|
6 |
</Kash_Gateway>
|
7 |
</modules>
|
8 |
<global>
|
67 |
</kash_gateway>
|
68 |
</observers>
|
69 |
</core_collection_abstract_load_before>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
</events>
|
71 |
</adminhtml>
|
72 |
|
app/code/local/Kash/Gateway/etc/system.xml
CHANGED
@@ -66,7 +66,6 @@
|
|
66 |
<show_in_default>1</show_in_default>
|
67 |
<show_in_website>1</show_in_website>
|
68 |
<show_in_store>1</show_in_store>
|
69 |
-
<comment>Add a payment gateway with "Redirect URL" of https://offsite-gateway-sim.herokuapp.com/</comment>
|
70 |
</post_url>
|
71 |
<skip_order_review_step translate="label comment">
|
72 |
<label>Order Review Step</label>
|
66 |
<show_in_default>1</show_in_default>
|
67 |
<show_in_website>1</show_in_website>
|
68 |
<show_in_store>1</show_in_store>
|
|
|
69 |
</post_url>
|
70 |
<skip_order_review_step translate="label comment">
|
71 |
<label>Order Review Step</label>
|
app/design/frontend/base/default/layout/kash/gateway.xml
CHANGED
@@ -4,6 +4,22 @@
|
|
4 |
<reference name="before_body_end">
|
5 |
<block type="core/template" template="kash/js.phtml" before="-"/>
|
6 |
</reference>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
</default>
|
8 |
|
9 |
<kash_gateway_bb_start>
|
4 |
<reference name="before_body_end">
|
5 |
<block type="core/template" template="kash/js.phtml" before="-"/>
|
6 |
</reference>
|
7 |
+
|
8 |
+
<reference name="head">
|
9 |
+
<action method="addItem">
|
10 |
+
<type>skin_css</type>
|
11 |
+
<name>css/kash/start.css</name>
|
12 |
+
</action>
|
13 |
+
<action method="addItem">
|
14 |
+
<type>skin_css</type>
|
15 |
+
<name>css/kash/lightwindow.css</name>
|
16 |
+
</action>
|
17 |
+
<action method="addItem">
|
18 |
+
<type>skin_js</type>
|
19 |
+
<name>js/kash/lightwindow.js</name>
|
20 |
+
</action>
|
21 |
+
</reference>
|
22 |
+
|
23 |
</default>
|
24 |
|
25 |
<kash_gateway_bb_start>
|
app/design/frontend/base/default/template/kash/payment/mark.phtml
CHANGED
@@ -4,4 +4,27 @@
|
|
4 |
*/
|
5 |
?>
|
6 |
<?php echo $this->getMessage() ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
*/
|
5 |
?>
|
6 |
<?php echo $this->getMessage() ?>
|
7 |
+
<br />
|
8 |
+
<a id="kash_direct_debit_link"
|
9 |
+
href="//www.withkash.com/what-is-direct-debit"
|
10 |
+
title="What is Direct Debit"
|
11 |
+
style="float:none;margin:0px 0px;">
|
12 |
+
What is Direct Debit?
|
13 |
+
</a>
|
14 |
+
<script>
|
15 |
+
function getDimensions() {
|
16 |
+
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
17 |
+
var width = parseInt(Math.max(document.documentElement.clientWidth, window.innerWidth || 0));
|
18 |
+
var height = parseInt(Math.max(document.documentElement.clientHeight, window.innerHeight || 0));
|
19 |
|
20 |
+
if (userAgent.match(/iPad|iPhone|iPod|Android/i)) {
|
21 |
+
return [width, height];
|
22 |
+
}
|
23 |
+
return [width*2/3, height*2/3]
|
24 |
+
}
|
25 |
+
|
26 |
+
document.getElementById("kash_direct_debit_link").setAttribute("class", "lightwindow");
|
27 |
+
document.getElementById("kash_direct_debit_link").setAttribute("params", "lightwindow_loading_animation=false,lightwindow_width="+getDimensions()[0]+",lightwindow_height="+getDimensions()[1]);
|
28 |
+
|
29 |
+
|
30 |
+
</script>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>kash_gateway</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
@@ -12,11 +12,11 @@
|
|
12 |
Kash does this by offering customers the option to pay using their bank account. For customers that don't want to use their bank account to pay, they'll have the option of using credit card instead. You can choose to either charge the credit card processing fee to the customer, or pay for the fee yourself like you do currently.
|
13 |

|
14 |
You will need a Kash account in order to use this gateway. Please contact info@withkash.com for any questions.</description>
|
15 |
-
<notes>v0.1.
|
16 |
-
<authors><author><name>Kash Corp.</name><user>
|
17 |
-
<date>2015-
|
18 |
-
<time>
|
19 |
-
<contents><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="kash"><file name="start.css" hash="d310d178769035d366ebb2caff9bd4a3"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kash_Gateway.xml" hash="03365c54da611a023ea2a12c6404c455"/></dir></target><target name="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.4.45</min><max>5.6.15</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>kash_gateway</name>
|
4 |
+
<version>0.1.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
12 |
Kash does this by offering customers the option to pay using their bank account. For customers that don't want to use their bank account to pay, they'll have the option of using credit card instead. You can choose to either charge the credit card processing fee to the customer, or pay for the fee yourself like you do currently.
|
13 |

|
14 |
You will need a Kash account in order to use this gateway. Please contact info@withkash.com for any questions.</description>
|
15 |
+
<notes>v0.1.4 - Initial Release</notes>
|
16 |
+
<authors><author><name>Kash Corp.</name><user>kash_corp</user><email>info@withkash.com</email></author></authors>
|
17 |
+
<date>2015-12-02</date>
|
18 |
+
<time>20:42:30</time>
|
19 |
+
<contents><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="kash"><file name="lightwindow.css" hash="1addd9e2971e76af24c5eadf67fafc60"/><file name="start.css" hash="d310d178769035d366ebb2caff9bd4a3"/><file name="._lightwindow.css" hash="6bac7309b1e370cf137d882ba90d6510"/></dir></dir><dir name="js"><dir name="kash"><file name="lightwindow.js" hash="a63e1ae37ef7f727c97ffa0f4f0292d7"/><file name="._lightwindow.js" hash="6bac7309b1e370cf137d882ba90d6510"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kash_Gateway.xml" hash="03365c54da611a023ea2a12c6404c455"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="kash"><file name="gateway.xml" hash="62ce90320a5d09cc8334e512c3cda3b3"/></dir></dir><dir name="template"><dir name="kash"><file name="container.phtml" hash="9dafeab90d16b221ab8684990ef62ec3"/><file name="form.phtml" hash="0b4b05f427474b08d1c52cfc09fc3485"/><file name="js.phtml" hash="3a1b1a96fd25b4035f41dbe95633f229"/><dir name="payment"><file name="mark.phtml" hash="96ac85ef2f73ec0953dee53cd3d7d0a7"/><file name="redirect.phtml" hash="9cd530bec26cc5f76ab01cfb57095c32"/><dir name="review"><file name="details.phtml" hash="ff2ad65893e66920a4cc8b098dc397c1"/></dir><file name="review.phtml" hash="ef1d435a2bc0e9daff56594a715bed1a"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="kash"><dir name="info"><file name="default.phtml" hash="79bcf1003e40c03ec35c383ec4ca5236"/></dir></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Kash"><dir name="Gateway"><dir name="Block"><dir name="Adminhtml"><file name="Info.php" hash="186ac575a69755543d649d2174f43474"/><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="757f5028ff98d3c375cf3345675d55b7"/></dir></dir></dir><dir name="Form"><file name="Bb.php" hash="2516cb64469800cfc450710250317d72"/></dir><dir name="Review"><file name="Details.php" hash="9a077c6688f913bd4f9fee74fad68b7e"/></dir><file name="Review.php" hash="a2a24914d577262188c491898c77307e"/></dir><dir name="Helper"><file name="Checkout.php" hash="89863d74391a81e7336073a8c9634ce8"/><file name="Data.php" hash="cc0eb77c1be47e1d4e846033cc2aed9a"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="99ed019c3e8e13caf90fa248e608c9ea"/><file name="Bb.php" hash="f1605310d4042b4704577fe2925c2a86"/></dir><file name="Cart.php" hash="ced06fca31abf3fbe20e3e2eb430cfea"/><file name="Checkout.php" hash="bed98494d4bb1d93b6e6758555d98450"/><file name="Config.php" hash="5299275ecc589f56c9bc9c9123e39405"/><dir name="Method"><file name="Bb.php" hash="6cd0683fa597d31d830ae7787b0284cd"/></dir><file name="Observer.php" hash="eede09fb15543e8a535820612104e520"/><file name="Session.php" hash="1778fbe493d2ceb81d8a20b58a21ce3c"/></dir><dir name="controllers"><file name="BbController.php" hash="3ab8fcfabbc52474eb7f161fc91c5986"/></dir><dir name="data"><dir name="kash_gateway_setup"><file name="data-install-0.0.1.php" hash="5fe91e15bc5e6269eadcc50f8991250a"/><file name="data-upgrade-0.0.1-0.0.2.php" hash="632331f77e2238438e1bddfe4c2b82bf"/></dir></dir><dir name="etc"><file name="config.xml" hash="9538e1037a44f4280726f537f0a9d3e5"/><file name="system.xml" hash="3667ceed76bc0a905af96e7b4adbf2b0"/></dir><dir name="sql"><dir name="kash_gateway_setup"><file name="install-0.0.1.php" hash="9ecb52ba48345cdbee9ce0fd92d2aff9"/></dir></dir></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.4.45</min><max>5.6.15</max></php></required></dependencies>
|
22 |
</package>
|
skin/frontend/base/default/css/kash/lightwindow.css
ADDED
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#lightwindow_overlay {
|
2 |
+
/* REQUIRED */
|
3 |
+
display: none;
|
4 |
+
visibility: hidden;
|
5 |
+
position: absolute;
|
6 |
+
top: 0;
|
7 |
+
left: 0;
|
8 |
+
width: 100%;
|
9 |
+
height: 100px;
|
10 |
+
z-index: 500;
|
11 |
+
/* REQUIRED */
|
12 |
+
}
|
13 |
+
|
14 |
+
#lightwindow {
|
15 |
+
/* REQUIRED */
|
16 |
+
/* Of Note - The height and width of this element are set to 0px */
|
17 |
+
display: none;
|
18 |
+
visibility: hidden;
|
19 |
+
position: absolute;
|
20 |
+
z-index: 999;
|
21 |
+
line-height: 0px;
|
22 |
+
/* REQUIRED */
|
23 |
+
|
24 |
+
/* otherwise conflicts with magento css */
|
25 |
+
-webkit-box-sizing: content-box;
|
26 |
+
-moz-box-sizing: content-box;
|
27 |
+
box-sizing: content-box;
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
#lightwindow_container {
|
32 |
+
/* REQUIRED */
|
33 |
+
display: none;
|
34 |
+
visibility: hidden;
|
35 |
+
position: absolute;
|
36 |
+
/* REQUIRED */
|
37 |
+
padding: 0 0 0 0;
|
38 |
+
margin: 0 0 0 0;
|
39 |
+
|
40 |
+
/* otherwise conflicts with magento css */
|
41 |
+
-webkit-box-sizing: content-box;
|
42 |
+
-moz-box-sizing: content-box;
|
43 |
+
box-sizing: content-box;
|
44 |
+
}
|
45 |
+
|
46 |
+
/* IE6 needs this or it messes with our positioning */
|
47 |
+
* html #lightwindow_container {
|
48 |
+
overflow: hidden;
|
49 |
+
}
|
50 |
+
|
51 |
+
#lightwindow_contents {
|
52 |
+
overflow: hidden;
|
53 |
+
z-index: 0;
|
54 |
+
position: relative;
|
55 |
+
border: 10px solid #ffffff;
|
56 |
+
background-color: #ffffff;
|
57 |
+
/* otherwise conflicts with magento css */
|
58 |
+
-webkit-box-sizing: content-box;
|
59 |
+
-moz-box-sizing: content-box;
|
60 |
+
box-sizing: content-box;
|
61 |
+
}
|
62 |
+
|
63 |
+
#lightwindow_loading {
|
64 |
+
/* REQUIRED */
|
65 |
+
height: 100%;
|
66 |
+
width: 100%;
|
67 |
+
top: 0px;
|
68 |
+
left: 0px;
|
69 |
+
z-index: 9999;
|
70 |
+
position: absolute;
|
71 |
+
/* REQUIRED */
|
72 |
+
background-color: #f0f0f0;
|
73 |
+
padding: 10px;
|
74 |
+
}
|
75 |
+
|
76 |
+
#lightwindow_loading_shim {
|
77 |
+
display: none;
|
78 |
+
left: 0px;
|
79 |
+
position: absolute;
|
80 |
+
top: 0px;
|
81 |
+
width: 100%;
|
82 |
+
height: 100%;
|
83 |
+
}
|
84 |
+
|
85 |
+
#lightwindow_loading span {
|
86 |
+
font-size: 12px;
|
87 |
+
line-height: 32px;
|
88 |
+
color: #444444;
|
89 |
+
float: left;
|
90 |
+
padding: 0 10px 0 0;
|
91 |
+
}
|
92 |
+
|
93 |
+
#lightwindow_loading span a,
|
94 |
+
#lightwindow_loading span a:link,
|
95 |
+
#lightwindow_loading span a:visited {
|
96 |
+
color: #09F;
|
97 |
+
text-decoration: none;
|
98 |
+
cursor: pointer;
|
99 |
+
}
|
100 |
+
|
101 |
+
#lightwindow_loading span a:hover,
|
102 |
+
#lightwindow_loading span a:active {
|
103 |
+
text-decoration: underline;
|
104 |
+
}
|
105 |
+
|
106 |
+
|
107 |
+
#lightwindow_loading img {
|
108 |
+
float: left;
|
109 |
+
margin: 0 10px 0 0;
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
/*-----------------------------------------------------------------------------------------------
|
114 |
+
I liked the Navigation so much from http://www.huddletogether.com/projects/lightbox2/
|
115 |
+
I mean let's face it, it works really well and is very easy to figure out.
|
116 |
+
-----------------------------------------------------------------------------------------------*/
|
117 |
+
|
118 |
+
#lightwindow_navigation {
|
119 |
+
/* REQUIRED */
|
120 |
+
position: absolute;
|
121 |
+
top: 0px;
|
122 |
+
left: 0px;
|
123 |
+
display: none;
|
124 |
+
/* REQUIRED */
|
125 |
+
}
|
126 |
+
/* We need to shim the navigation for IE, though its more of a sub-floor */
|
127 |
+
#lightwindow_navigation_shim {
|
128 |
+
/* REQUIRED */
|
129 |
+
display: none;
|
130 |
+
left: 0px;
|
131 |
+
position: absolute;
|
132 |
+
top: 0px;
|
133 |
+
width: 100%;
|
134 |
+
height: 100%;
|
135 |
+
/* REQUIRED */
|
136 |
+
}
|
137 |
+
|
138 |
+
#lightwindow_navigation a,
|
139 |
+
#lightwindow_navigation a:link,
|
140 |
+
#lightwindow_navigation a:visited,
|
141 |
+
#lightwindow_navigation a:hover,
|
142 |
+
#lightwindow_navigation a:active {
|
143 |
+
/* REQUIRED */
|
144 |
+
outline: none;
|
145 |
+
/* REQUIRED */
|
146 |
+
}
|
147 |
+
|
148 |
+
#lightwindow_previous,
|
149 |
+
#lightwindow_next {
|
150 |
+
width: 49%;
|
151 |
+
height: 100%;
|
152 |
+
background: transparent url(../images/blank.gif) no-repeat; /* Trick IE into showing hover */
|
153 |
+
display: block;
|
154 |
+
}
|
155 |
+
|
156 |
+
#lightwindow_previous {
|
157 |
+
float: left;
|
158 |
+
left: 0px;
|
159 |
+
}
|
160 |
+
|
161 |
+
#lightwindow_next {
|
162 |
+
float: right;
|
163 |
+
right: 0px;
|
164 |
+
}
|
165 |
+
|
166 |
+
#lightwindow_previous:hover,
|
167 |
+
#lightwindow_previous:active {
|
168 |
+
background: url(../images/prevlabel.gif) left 15% no-repeat;
|
169 |
+
}
|
170 |
+
|
171 |
+
#lightwindow_next:hover,
|
172 |
+
#lightwindow_next:active {
|
173 |
+
background: url(../images/nextlabel.gif) right 15% no-repeat;
|
174 |
+
}
|
175 |
+
|
176 |
+
#lightwindow_previous_title,
|
177 |
+
#lightwindow_next_title {
|
178 |
+
display: none;
|
179 |
+
}
|
180 |
+
|
181 |
+
#lightwindow_galleries {
|
182 |
+
width: 100%;
|
183 |
+
position: absolute;
|
184 |
+
z-index: 50;
|
185 |
+
display: none;
|
186 |
+
overflow: hidden;
|
187 |
+
margin: 0 0 0 10px;
|
188 |
+
bottom: 0px;
|
189 |
+
left: 0px;
|
190 |
+
}
|
191 |
+
|
192 |
+
#lightwindow_galleries_tab_container {
|
193 |
+
width: 100%;
|
194 |
+
height: 0px;
|
195 |
+
overflow: hidden;
|
196 |
+
}
|
197 |
+
|
198 |
+
a#lightwindow_galleries_tab,
|
199 |
+
a:link#lightwindow_galleries_tab,
|
200 |
+
a:visited#lightwindow_galleries_tab {
|
201 |
+
display: block;
|
202 |
+
height: 20px;
|
203 |
+
width: 77px;
|
204 |
+
float: right;
|
205 |
+
line-height: 22px;
|
206 |
+
color: #ffffff;
|
207 |
+
text-decoration: none;
|
208 |
+
font-weight: bold;
|
209 |
+
cursor: pointer;
|
210 |
+
font-size: 11px;
|
211 |
+
color: #ffffbe;
|
212 |
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNrszzERACAMALEH/25qEBcMvcRBTjUtcFtCRERERERERERERERERERERERERERERERERERERERERERERERE5I8nwABEjQEXuO95jAAAAABJRU5ErkJggg==) repeat 0 0 transparent;
|
213 |
+
/*background: url(../images/black-70.png) repeat 0 0 transparent; */
|
214 |
+
}
|
215 |
+
|
216 |
+
* html a#lightwindow_galleries_tab,
|
217 |
+
* html a:link#lightwindow_galleries_tab,
|
218 |
+
* html a:visited#lightwindow_galleries_tab {
|
219 |
+
background: none;
|
220 |
+
background-color: #000000;
|
221 |
+
opacity: .70;
|
222 |
+
filter: alpha(opacity=70);
|
223 |
+
}
|
224 |
+
|
225 |
+
a:hover#lightwindow_galleries_tab,
|
226 |
+
a:active#lightwindow_galleries_tab {
|
227 |
+
color: #ffffbe;
|
228 |
+
|
229 |
+
}
|
230 |
+
|
231 |
+
#lightwindow_galleries_tab_span {
|
232 |
+
display: block;
|
233 |
+
height: 20px;
|
234 |
+
width: 63px;
|
235 |
+
padding: 0 7px 0 7px;
|
236 |
+
}
|
237 |
+
|
238 |
+
#lightwindow_galleries_tab .up {
|
239 |
+
background: url(../images/arrow-up.gif) no-repeat 60px 5px transparent;
|
240 |
+
}
|
241 |
+
|
242 |
+
#lightwindow_galleries_tab .down {
|
243 |
+
background: url(../images/arrow-down.gif) no-repeat 60px 6px transparent;
|
244 |
+
}
|
245 |
+
|
246 |
+
#lightwindow_galleries_list {
|
247 |
+
/*background: url(../images/black-70.png) repeat 0 0 transparent;*/
|
248 |
+
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNrszzERACAMALEH/25qEBcMvcRBTjUtcFtCRERERERERERERERERERERERERERERERERERERERERERERERE5I8nwABEjQEXuO95jAAAAABJRU5ErkJggg==) repeat 0 0 transparent;
|
249 |
+
overflow: hidden;
|
250 |
+
height: 0px;
|
251 |
+
}
|
252 |
+
|
253 |
+
* html #lightwindow_galleries_list {
|
254 |
+
background: none;
|
255 |
+
background-color: #000000;
|
256 |
+
opacity: .70;
|
257 |
+
filter: alpha(opacity=70);
|
258 |
+
}
|
259 |
+
|
260 |
+
.lightwindow_galleries_list {
|
261 |
+
width: 200px;
|
262 |
+
float: left;
|
263 |
+
margin: 0 0 10px 0;
|
264 |
+
padding: 10px;
|
265 |
+
}
|
266 |
+
|
267 |
+
.lightwindow_galleries_list h1 {
|
268 |
+
color: #09F;
|
269 |
+
text-decoration: none;
|
270 |
+
font-weight: bold;
|
271 |
+
cursor: pointer;
|
272 |
+
padding: 10px 0 5px 0;
|
273 |
+
font-size: 16px;
|
274 |
+
}
|
275 |
+
|
276 |
+
.lightwindow_galleries_list li {
|
277 |
+
margin: 5px 0 5px 0;
|
278 |
+
list-style-type: none;
|
279 |
+
}
|
280 |
+
|
281 |
+
.lightwindow_galleries_list a,
|
282 |
+
.lightwindow_galleries_list a:link,
|
283 |
+
.lightwindow_galleries_list a:visited {
|
284 |
+
display: block;
|
285 |
+
line-height: 22px;
|
286 |
+
color: #ffffff;
|
287 |
+
text-decoration: none;
|
288 |
+
font-weight: bold;
|
289 |
+
cursor: pointer;
|
290 |
+
padding: 0 0 0 10px;
|
291 |
+
font-size: 11px;
|
292 |
+
}
|
293 |
+
|
294 |
+
.lightwindow_galleries_list a:hover,
|
295 |
+
.lightwindow_galleries_list a:active {
|
296 |
+
background: #000000;
|
297 |
+
color: #ffffbe;
|
298 |
+
border-left: 3px solid #ffffbe;
|
299 |
+
padding: 0 0 0 7px;
|
300 |
+
}
|
301 |
+
|
302 |
+
#lightwindow_data {
|
303 |
+
/* REQUIRED */
|
304 |
+
position: absolute;
|
305 |
+
/* REQUIRED */
|
306 |
+
}
|
307 |
+
|
308 |
+
#lightwindow_data_slide {
|
309 |
+
/* REQUIRED */
|
310 |
+
position: relative;
|
311 |
+
/* REQUIRED */
|
312 |
+
}
|
313 |
+
|
314 |
+
#lightwindow_data_slide_inner {
|
315 |
+
background-color: #ffffff;
|
316 |
+
padding: 0 10px 10px 10px;
|
317 |
+
}
|
318 |
+
|
319 |
+
#lightwindow_data_caption {
|
320 |
+
padding: 10px 0 0 0;
|
321 |
+
color: #666666;
|
322 |
+
line-height: 25px;
|
323 |
+
background-color: #ffffff;
|
324 |
+
clear: both;
|
325 |
+
}
|
326 |
+
|
327 |
+
#lightwindow_data_details {
|
328 |
+
background-color: #f0f0f0;
|
329 |
+
padding: 0 10px 0 10px;
|
330 |
+
height: 20px;
|
331 |
+
}
|
332 |
+
|
333 |
+
#lightwindow_data_author_container {
|
334 |
+
width: 40%;
|
335 |
+
text-align: right;
|
336 |
+
color: #666666;
|
337 |
+
font-style: italic;
|
338 |
+
font-size: 10px;
|
339 |
+
line-height: 20px;
|
340 |
+
float: right;
|
341 |
+
overflow: hidden;
|
342 |
+
}
|
343 |
+
|
344 |
+
#lightwindow_data_gallery_container {
|
345 |
+
font-size: 10px;
|
346 |
+
width: 40%;
|
347 |
+
text-align: left;
|
348 |
+
color: #666666;
|
349 |
+
line-height: 20px;
|
350 |
+
float: left;
|
351 |
+
overflow: hidden;
|
352 |
+
}
|
353 |
+
|
354 |
+
#lightwindow_title_bar {
|
355 |
+
height: 25px;
|
356 |
+
overflow: hidden;
|
357 |
+
}
|
358 |
+
|
359 |
+
#lightwindow_title_bar_title {
|
360 |
+
color: #ffffbe;
|
361 |
+
font-size: 14px;
|
362 |
+
line-height: 25px;
|
363 |
+
text-align: left;
|
364 |
+
float: left;
|
365 |
+
}
|
366 |
+
|
367 |
+
a#lightwindow_title_bar_close_link,
|
368 |
+
a:link#lightwindow_title_bar_close_link,
|
369 |
+
a:visited#lightwindow_title_bar_close_link {
|
370 |
+
float: right;
|
371 |
+
text-align: right;
|
372 |
+
cursor: pointer;
|
373 |
+
color: #ffffbe;
|
374 |
+
line-height: 25px;
|
375 |
+
padding: 0;
|
376 |
+
margin: 0;
|
377 |
+
}
|
378 |
+
|
379 |
+
a:hover#lightwindow_title_bar_close_link,
|
380 |
+
a:active#lightwindow_title_bar_close_link {
|
381 |
+
color: #ffffff;
|
382 |
+
}
|
383 |
+
|
384 |
+
/*-----------------------------------------------------------------------------------------------
|
385 |
+
Theme styling stuff
|
386 |
+
-----------------------------------------------------------------------------------------------*/
|
387 |
+
|
388 |
+
#lightwindow p {
|
389 |
+
color: #000000;
|
390 |
+
padding-right: 10px;
|
391 |
+
}
|
392 |
+
|
393 |
+
|
skin/frontend/base/default/js/kash/lightwindow.js
ADDED
@@ -0,0 +1,1918 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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js v2.0
|
2 |
+
//
|
3 |
+
// Copyright (c) 2007 stickmanlabs
|
4 |
+
// Author: Kevin P Miller | http://www.stickmanlabs.com
|
5 |
+
//
|
6 |
+
// LightWindow is freely distributable under the terms of an MIT-style license.
|
7 |
+
//
|
8 |
+
// I don't care what you think about the file size...
|
9 |
+
// Be a pro:
|
10 |
+
// http://www.thinkvitamin.com/features/webapps/serving-javascript-fast
|
11 |
+
// http://rakaz.nl/item/make_your_pages_load_faster_by_combining_and_compressing_javascript_and_css_files
|
12 |
+
//
|
13 |
+
|
14 |
+
/*-----------------------------------------------------------------------------------------------*/
|
15 |
+
|
16 |
+
if(typeof Effect == 'undefined')
|
17 |
+
throw("lightwindow.js requires including script.aculo.us' effects.js library!");
|
18 |
+
|
19 |
+
// This will stop image flickering in IE6 when elements with images are moved
|
20 |
+
try {
|
21 |
+
document.execCommand("BackgroundImageCache", false, true);
|
22 |
+
} catch(e) {}
|
23 |
+
|
24 |
+
var lightwindow = Class.create();
|
25 |
+
lightwindow.prototype = {
|
26 |
+
//
|
27 |
+
// Setup Variables
|
28 |
+
//
|
29 |
+
element : null,
|
30 |
+
contentToFetch : null,
|
31 |
+
windowActive : false,
|
32 |
+
dataEffects : [],
|
33 |
+
dimensions : {
|
34 |
+
cruft : null,
|
35 |
+
container : null,
|
36 |
+
viewport : {
|
37 |
+
height : null,
|
38 |
+
width : null,
|
39 |
+
offsetTop : null,
|
40 |
+
offsetLeft : null
|
41 |
+
}
|
42 |
+
},
|
43 |
+
pagePosition : {
|
44 |
+
x : 0,
|
45 |
+
y : 0
|
46 |
+
},
|
47 |
+
pageDimensions : {
|
48 |
+
width : null,
|
49 |
+
height : null
|
50 |
+
},
|
51 |
+
preloadImage : [],
|
52 |
+
preloadedImage : [],
|
53 |
+
galleries : [],
|
54 |
+
resizeTo : {
|
55 |
+
height : null,
|
56 |
+
heightPercent : null,
|
57 |
+
width : null,
|
58 |
+
widthPercent : null,
|
59 |
+
fixedTop : null,
|
60 |
+
fixedLeft : null
|
61 |
+
},
|
62 |
+
scrollbarOffset : 18,
|
63 |
+
navigationObservers : {
|
64 |
+
previous : null,
|
65 |
+
next : null
|
66 |
+
},
|
67 |
+
containerChange : {
|
68 |
+
height : 0,
|
69 |
+
width : 0
|
70 |
+
},
|
71 |
+
activeGallery : false,
|
72 |
+
galleryLocation : {
|
73 |
+
current : 0,
|
74 |
+
total : 0
|
75 |
+
},
|
76 |
+
//
|
77 |
+
// Initialize the lightwindow.
|
78 |
+
//
|
79 |
+
initialize : function(options) {
|
80 |
+
this.options = Object.extend({
|
81 |
+
resizeSpeed : 8,
|
82 |
+
contentOffset : {
|
83 |
+
height : 20,
|
84 |
+
width : 20
|
85 |
+
},
|
86 |
+
dimensions : {
|
87 |
+
image : {height : 250, width : 250},
|
88 |
+
page : {height : 250, width : 250},
|
89 |
+
inline : {height : 250, width : 250},
|
90 |
+
media : {height : 250, width : 250},
|
91 |
+
external : {height : 250, width : 250},
|
92 |
+
titleHeight : 25
|
93 |
+
},
|
94 |
+
classNames : {
|
95 |
+
standard : 'lightwindow',
|
96 |
+
action : 'lightwindow_action'
|
97 |
+
},
|
98 |
+
fileTypes : {
|
99 |
+
page : ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php4', 'php3', 'php', 'php5', 'phtml', 'rhtml', 'shtml', 'txt', 'vbs', 'rb'],
|
100 |
+
media : ['aif', 'aiff', 'asf', 'avi', 'divx', 'm1v', 'm2a', 'm2v', 'm3u', 'mid', 'midi', 'mov', 'moov', 'movie', 'mp2', 'mp3', 'mpa', 'mpa', 'mpe', 'mpeg', 'mpg', 'mpg', 'mpga', 'pps', 'qt', 'rm', 'ram', 'swf', 'viv', 'vivo', 'wav'],
|
101 |
+
image : ['bmp', 'gif', 'jpg', 'png', 'tiff']
|
102 |
+
},
|
103 |
+
mimeTypes : {
|
104 |
+
avi : 'video/avi',
|
105 |
+
aif : 'audio/aiff',
|
106 |
+
aiff : 'audio/aiff',
|
107 |
+
gif : 'image/gif',
|
108 |
+
bmp : 'image/bmp',
|
109 |
+
jpeg : 'image/jpeg',
|
110 |
+
m1v : 'video/mpeg',
|
111 |
+
m2a : 'audio/mpeg',
|
112 |
+
m2v : 'video/mpeg',
|
113 |
+
m3u : 'audio/x-mpequrl',
|
114 |
+
mid : 'audio/x-midi',
|
115 |
+
midi : 'audio/x-midi',
|
116 |
+
mjpg : 'video/x-motion-jpeg',
|
117 |
+
moov : 'video/quicktime',
|
118 |
+
mov : 'video/quicktime',
|
119 |
+
movie : 'video/x-sgi-movie',
|
120 |
+
mp2 : 'audio/mpeg',
|
121 |
+
mp3 : 'audio/mpeg3',
|
122 |
+
mpa : 'audio/mpeg',
|
123 |
+
mpa : 'video/mpeg',
|
124 |
+
mpe : 'video/mpeg',
|
125 |
+
mpeg : 'video/mpeg',
|
126 |
+
mpg : 'audio/mpeg',
|
127 |
+
mpg : 'video/mpeg',
|
128 |
+
mpga : 'audio/mpeg',
|
129 |
+
pdf : 'application/pdf',
|
130 |
+
png : 'image/png',
|
131 |
+
pps : 'application/mspowerpoint',
|
132 |
+
qt : 'video/quicktime',
|
133 |
+
ram : 'audio/x-pn-realaudio-plugin',
|
134 |
+
rm : 'application/vnd.rn-realmedia',
|
135 |
+
swf : 'application/x-shockwave-flash',
|
136 |
+
tiff : 'image/tiff',
|
137 |
+
viv : 'video/vivo',
|
138 |
+
vivo : 'video/vivo',
|
139 |
+
wav : 'audio/wav',
|
140 |
+
wmv : 'application/x-mplayer2'
|
141 |
+
},
|
142 |
+
classids : {
|
143 |
+
mov : 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
144 |
+
swf : 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
|
145 |
+
wmv : 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'
|
146 |
+
},
|
147 |
+
codebases : {
|
148 |
+
mov : 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
|
149 |
+
swf : 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0',
|
150 |
+
wmv : 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715'
|
151 |
+
},
|
152 |
+
viewportPadding : 10,
|
153 |
+
EOLASFix : 'swf,wmv,fla,flv',
|
154 |
+
overlay : {
|
155 |
+
opacity : 0.7,
|
156 |
+
image : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAiSURBVHja7MExAQAAAMKg9U9tCF+gAAAAAAAAAPhNAAEGAB1+AAHr9+viAAAAAElFTkSuQmCC',
|
157 |
+
presetImage : 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhJREFUeNrszzERACAMALEH/25qEBcMvcRBTjUtcFtCRERERERERERERERERERERERERERERERERERERERERERERERE5I8nwABEjQEXuO95jAAAAABJRU5ErkJggg=='
|
158 |
+
},
|
159 |
+
skin : {
|
160 |
+
main : '<div id="lightwindow_container" >'+
|
161 |
+
'<div id="lightwindow_title_bar" >'+
|
162 |
+
'<div id="lightwindow_title_bar_inner" >'+
|
163 |
+
'<span id="lightwindow_title_bar_title"></span>'+
|
164 |
+
'<a id="lightwindow_title_bar_close_link" >close</a>'+
|
165 |
+
'</div>'+
|
166 |
+
'</div>'+
|
167 |
+
'<div id="lightwindow_stage" >'+
|
168 |
+
'<div id="lightwindow_contents" >'+
|
169 |
+
'</div>'+
|
170 |
+
'<div id="lightwindow_navigation" >'+
|
171 |
+
'<a href="#" id="lightwindow_previous" >'+
|
172 |
+
'<span id="lightwindow_previous_title"></span>'+
|
173 |
+
'</a>'+
|
174 |
+
'<a href="#" id="lightwindow_next" >'+
|
175 |
+
'<span id="lightwindow_next_title"></span>'+
|
176 |
+
'</a>'+
|
177 |
+
'<iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe>'+
|
178 |
+
'</div>'+
|
179 |
+
'<div id="lightwindow_galleries">'+
|
180 |
+
'<div id="lightwindow_galleries_tab_container" >'+
|
181 |
+
'<a href="#" id="lightwindow_galleries_tab" >'+
|
182 |
+
'<span id="lightwindow_galleries_tab_span" class="up" >Galleries</span>'+
|
183 |
+
'</a>'+
|
184 |
+
'</div>'+
|
185 |
+
'<div id="lightwindow_galleries_list" >'+
|
186 |
+
'</div>'+
|
187 |
+
'</div>'+
|
188 |
+
'</div>'+
|
189 |
+
'<div id="lightwindow_data_slide" >'+
|
190 |
+
'<div id="lightwindow_data_slide_inner" >'+
|
191 |
+
'<div id="lightwindow_data_details" >'+
|
192 |
+
'<div id="lightwindow_data_gallery_container" >'+
|
193 |
+
'<span id="lightwindow_data_gallery_current"></span>'+
|
194 |
+
' of '+
|
195 |
+
'<span id="lightwindow_data_gallery_total"></span>'+
|
196 |
+
'</div>'+
|
197 |
+
'<div id="lightwindow_data_author_container" >'+
|
198 |
+
'by <span id="lightwindow_data_author"></span>'+
|
199 |
+
'</div>'+
|
200 |
+
'</div>'+
|
201 |
+
'<div id="lightwindow_data_caption" >'+
|
202 |
+
'</div>'+
|
203 |
+
'</div>'+
|
204 |
+
'</div>'+
|
205 |
+
'</div>',
|
206 |
+
loading : '<div id="lightwindow_loading" >'+
|
207 |
+
'<img src="data:image/gif;base64,R0lGODlhHwAfAPUAAPDw8AAAANvb28bGxrGxsaSkpJmZmc/Pz62trZGRkdfX18zMzKCgoJeXl6ampsDAwOjo6J6ensjIyNnZ2TMzMyMjI0tLS7m5uWlpaYmJiVFRUezs7GJiYkJCQru7u+rq6kRERC8vLwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAA==" alt="loading" />'+
|
208 |
+
'<span>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></span>'+
|
209 |
+
'<iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe>'+
|
210 |
+
'</div>',
|
211 |
+
iframe : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+
|
212 |
+
'<html xmlns="http://www.w3.org/1999/xhtml">'+
|
213 |
+
'<body>'+
|
214 |
+
'{body_replace}'+
|
215 |
+
'</body>'+
|
216 |
+
'</html>',
|
217 |
+
gallery : {
|
218 |
+
top : '<div class="lightwindow_galleries_list">'+
|
219 |
+
'<h1>{gallery_title_replace}</h1>'+
|
220 |
+
'<ul>',
|
221 |
+
middle : '<li>'+
|
222 |
+
'{gallery_link_replace}'+
|
223 |
+
'</li>',
|
224 |
+
bottom : '</ul>'+
|
225 |
+
'</div>'
|
226 |
+
}
|
227 |
+
},
|
228 |
+
formMethod : 'get',
|
229 |
+
hideFlash : false,
|
230 |
+
hideGalleryTab : false,
|
231 |
+
showTitleBar : true,
|
232 |
+
animationHandler : false,
|
233 |
+
navigationHandler : false,
|
234 |
+
transitionHandler : false,
|
235 |
+
finalAnimationHandler : false,
|
236 |
+
formHandler : false,
|
237 |
+
galleryAnimationHandler : false,
|
238 |
+
showGalleryCount : true
|
239 |
+
}, options || {});
|
240 |
+
this.duration = ((11-this.options.resizeSpeed)*0.15);
|
241 |
+
this._setupLinks();
|
242 |
+
this._getScroll();
|
243 |
+
this._getPageDimensions();
|
244 |
+
this._browserDimensions();
|
245 |
+
this._addLightWindowMarkup(false);
|
246 |
+
this._setupDimensions();
|
247 |
+
this.buildGalleryList();
|
248 |
+
},
|
249 |
+
//
|
250 |
+
// Activate the lightwindow.
|
251 |
+
//
|
252 |
+
activate : function(e, link){
|
253 |
+
// Clear out the window Contents
|
254 |
+
this._clearWindowContents(true);
|
255 |
+
|
256 |
+
// Add back in out loading panel
|
257 |
+
this._addLoadingWindowMarkup();
|
258 |
+
|
259 |
+
// Setup the element properties
|
260 |
+
this._setupWindowElements(link);
|
261 |
+
|
262 |
+
// Setup everything
|
263 |
+
this._getScroll();
|
264 |
+
this._browserDimensions();
|
265 |
+
this._setupDimensions();
|
266 |
+
this._toggleTroubleElements('hidden', false);
|
267 |
+
this._displayLightWindow('block', 'hidden');
|
268 |
+
this._setStatus(true);
|
269 |
+
this._monitorKeyboard(true);
|
270 |
+
this._prepareIE(true);
|
271 |
+
this._loadWindow();
|
272 |
+
},
|
273 |
+
//
|
274 |
+
// Turn off the window
|
275 |
+
//
|
276 |
+
deactivate : function(){
|
277 |
+
// The window is not active
|
278 |
+
this.windowActive = false;
|
279 |
+
|
280 |
+
// There is no longer a gallery active
|
281 |
+
this.activeGallery = false;
|
282 |
+
if (!this.options.hideGalleryTab) {
|
283 |
+
this._handleGalleryAnimation(false);
|
284 |
+
}
|
285 |
+
|
286 |
+
// Kill the animation
|
287 |
+
this.animating = false;
|
288 |
+
|
289 |
+
// Clear our element
|
290 |
+
this.element = null;
|
291 |
+
|
292 |
+
// hide the window.
|
293 |
+
this._displayLightWindow('none', 'visible');
|
294 |
+
|
295 |
+
// Clear out the window Contents
|
296 |
+
this._clearWindowContents(false);
|
297 |
+
|
298 |
+
// Stop all animation
|
299 |
+
var queue = Effect.Queues.get('lightwindowAnimation').each(function(e){e.cancel();});
|
300 |
+
|
301 |
+
// Undo the setup
|
302 |
+
this._prepareIE(false);
|
303 |
+
this._setupDimensions();
|
304 |
+
this._toggleTroubleElements('visible', false);
|
305 |
+
this._monitorKeyboard(false);
|
306 |
+
},
|
307 |
+
//
|
308 |
+
// Initialize specific window
|
309 |
+
//
|
310 |
+
createWindow : function(element, attributes) {
|
311 |
+
this._processLink($(element));
|
312 |
+
},
|
313 |
+
//
|
314 |
+
// Open a Window from a hash of attributes
|
315 |
+
//
|
316 |
+
activateWindow : function(options) {
|
317 |
+
this.element = Object.extend({
|
318 |
+
href : null,
|
319 |
+
title : null,
|
320 |
+
author : null,
|
321 |
+
caption : null,
|
322 |
+
rel : null,
|
323 |
+
top : null,
|
324 |
+
left : null,
|
325 |
+
type : null,
|
326 |
+
showImages : null,
|
327 |
+
height : null,
|
328 |
+
width : null,
|
329 |
+
loadingAnimation : null,
|
330 |
+
iframeEmbed : null,
|
331 |
+
form : null
|
332 |
+
}, options || {});
|
333 |
+
|
334 |
+
// Set the window type
|
335 |
+
this.contentToFetch = this.element.href;
|
336 |
+
this.windowType = this.element.type ? this.element.type : this._fileType(this.element.href);
|
337 |
+
|
338 |
+
// Clear out the window Contents
|
339 |
+
this._clearWindowContents(true);
|
340 |
+
|
341 |
+
// Add back in out loading panel
|
342 |
+
this._addLoadingWindowMarkup();
|
343 |
+
|
344 |
+
// Setup everything
|
345 |
+
this._getScroll();
|
346 |
+
this._browserDimensions();
|
347 |
+
this._setupDimensions();
|
348 |
+
this._toggleTroubleElements('hidden', false);
|
349 |
+
this._displayLightWindow('block', 'hidden');
|
350 |
+
this._setStatus(true);
|
351 |
+
this._monitorKeyboard(true);
|
352 |
+
this._prepareIE(true);
|
353 |
+
this._loadWindow();
|
354 |
+
},
|
355 |
+
//
|
356 |
+
// Fire off our Form handler
|
357 |
+
//
|
358 |
+
submitForm : function(e) {
|
359 |
+
if (this.options.formHandler) {
|
360 |
+
this.options.formHandler(e);
|
361 |
+
} else {
|
362 |
+
this._defaultFormHandler(e);
|
363 |
+
}
|
364 |
+
},
|
365 |
+
//
|
366 |
+
// Reload the window with another location
|
367 |
+
//
|
368 |
+
openWindow : function(element) {
|
369 |
+
var element = $(element);
|
370 |
+
|
371 |
+
// The window is active
|
372 |
+
this.windowActive = true;
|
373 |
+
|
374 |
+
// Clear out the window Contents
|
375 |
+
this._clearWindowContents(true);
|
376 |
+
|
377 |
+
// Add back in out loading panel
|
378 |
+
this._addLoadingWindowMarkup();
|
379 |
+
|
380 |
+
// Setup the element properties
|
381 |
+
this._setupWindowElements(element);
|
382 |
+
|
383 |
+
this._setStatus(true);
|
384 |
+
this._handleTransition();
|
385 |
+
},
|
386 |
+
//
|
387 |
+
// Navigate the window
|
388 |
+
//
|
389 |
+
navigateWindow : function(direction) {
|
390 |
+
this._handleNavigation(false);
|
391 |
+
if (direction == 'previous') {
|
392 |
+
this.openWindow(this.navigationObservers.previous);
|
393 |
+
} else if (direction == 'next'){
|
394 |
+
this.openWindow(this.navigationObservers.next);
|
395 |
+
}
|
396 |
+
},
|
397 |
+
//
|
398 |
+
// Build the Gallery List and Load it
|
399 |
+
//
|
400 |
+
buildGalleryList : function() {
|
401 |
+
var output = '';
|
402 |
+
var galleryLink;
|
403 |
+
for (i in this.galleries) {
|
404 |
+
if (typeof this.galleries[i] == 'object') {
|
405 |
+
output += (this.options.skin.gallery.top).replace('{gallery_title_replace}', unescape(i));
|
406 |
+
for (j in this.galleries[i]) {
|
407 |
+
if (typeof this.galleries[i][j] == 'object') {
|
408 |
+
galleryLink = '<a href="#" id="lightwindow_gallery_'+i+'_'+j+'" >'+unescape(j)+'</a>';
|
409 |
+
output += (this.options.skin.gallery.middle).replace('{gallery_link_replace}', galleryLink);
|
410 |
+
}
|
411 |
+
}
|
412 |
+
output += this.options.skin.gallery.bottom;
|
413 |
+
}
|
414 |
+
}
|
415 |
+
new Insertion.Top('lightwindow_galleries_list', output);
|
416 |
+
|
417 |
+
// Attach Events
|
418 |
+
for (i in this.galleries) {
|
419 |
+
if (typeof this.galleries[i] == 'object') {
|
420 |
+
for (j in this.galleries[i]) {
|
421 |
+
if (typeof this.galleries[i][j] == 'object') {
|
422 |
+
Event.observe($('lightwindow_gallery_'+i+'_'+j), 'click', this.openWindow.bind(this, this.galleries[i][j][0]), false);
|
423 |
+
$('lightwindow_gallery_'+i+'_'+j).onclick = function() {return false;};
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
}
|
428 |
+
},
|
429 |
+
//
|
430 |
+
// Set Links Up
|
431 |
+
//
|
432 |
+
_setupLinks : function() {
|
433 |
+
var links = $$('.'+this.options.classNames.standard);
|
434 |
+
links.each(function(link) {
|
435 |
+
this._processLink(link);
|
436 |
+
}.bind(this));
|
437 |
+
},
|
438 |
+
//
|
439 |
+
// Process a Link
|
440 |
+
//
|
441 |
+
_processLink : function(link) {
|
442 |
+
if ((this._fileType(link.getAttribute('href')) == 'image' || this._fileType(link.getAttribute('href')) == 'media')) {
|
443 |
+
if (gallery = this._getGalleryInfo(link.rel)) {
|
444 |
+
if (!this.galleries[gallery[0]]) {
|
445 |
+
this.galleries[gallery[0]] = new Array();
|
446 |
+
}
|
447 |
+
if (!this.galleries[gallery[0]][gallery[1]]) {
|
448 |
+
this.galleries[gallery[0]][gallery[1]] = new Array();
|
449 |
+
}
|
450 |
+
this.galleries[gallery[0]][gallery[1]].push(link);
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
// Take care of our inline content
|
455 |
+
var url = link.getAttribute('href');
|
456 |
+
if (url.indexOf('?') > -1) {
|
457 |
+
url = url.substring(0, url.indexOf('?'));
|
458 |
+
}
|
459 |
+
|
460 |
+
var container = url.substring(url.indexOf('#')+1);
|
461 |
+
if($(container)) {
|
462 |
+
$(container).setStyle({
|
463 |
+
display : 'none'
|
464 |
+
});
|
465 |
+
}
|
466 |
+
|
467 |
+
Event.observe(link, 'click', this.activate.bindAsEventListener(this, link), false);
|
468 |
+
link.onclick = function() {return false;};
|
469 |
+
},
|
470 |
+
//
|
471 |
+
// Setup our actions
|
472 |
+
//
|
473 |
+
_setupActions : function() {
|
474 |
+
var links = $$('#lightwindow_container .'+this.options.classNames.action);
|
475 |
+
links.each(function(link) {
|
476 |
+
Event.observe(link, 'click', this[link.getAttribute('rel')].bindAsEventListener(this, link), false);
|
477 |
+
link.onclick = function() {return false;};
|
478 |
+
}.bind(this));
|
479 |
+
},
|
480 |
+
//
|
481 |
+
// Add the markup to the page.
|
482 |
+
//
|
483 |
+
_addLightWindowMarkup : function(rebuild) {
|
484 |
+
var overlay = Element.extend(document.createElement('div'));
|
485 |
+
overlay.setAttribute('id', 'lightwindow_overlay');
|
486 |
+
// FF Mac has a problem with putting Flash above a layer without a 100% opacity background, so we need to use a pre-made
|
487 |
+
if (Prototype.Browser.Gecko) {
|
488 |
+
overlay.setStyle({
|
489 |
+
backgroundImage: 'url('+this.options.overlay.presetImage+')',
|
490 |
+
backgroundRepeat: 'repeat',
|
491 |
+
height: this.pageDimensions.height+'px'
|
492 |
+
});
|
493 |
+
} else {
|
494 |
+
overlay.setStyle({
|
495 |
+
opacity: this.options.overlay.opacity,
|
496 |
+
backgroundImage: 'url('+this.options.overlay.image+')',
|
497 |
+
backgroundRepeat: 'repeat',
|
498 |
+
height: this.pageDimensions.height+'px'
|
499 |
+
});
|
500 |
+
}
|
501 |
+
|
502 |
+
var lw = document.createElement('div');
|
503 |
+
lw.setAttribute('id', 'lightwindow');
|
504 |
+
lw.innerHTML = this.options.skin.main;
|
505 |
+
|
506 |
+
var body = document.getElementsByTagName('body')[0];
|
507 |
+
body.appendChild(overlay);
|
508 |
+
body.appendChild(lw);
|
509 |
+
|
510 |
+
if ($('lightwindow_title_bar_close_link')) {
|
511 |
+
Event.observe('lightwindow_title_bar_close_link', 'click', this.deactivate.bindAsEventListener(this));
|
512 |
+
$('lightwindow_title_bar_close_link').onclick = function() {return false;};
|
513 |
+
}
|
514 |
+
|
515 |
+
Event.observe($('lightwindow_previous'), 'click', this.navigateWindow.bind(this, 'previous'), false);
|
516 |
+
$('lightwindow_previous').onclick = function() {return false;};
|
517 |
+
Event.observe($('lightwindow_next'), 'click', this.navigateWindow.bind(this, 'next'), false);
|
518 |
+
$('lightwindow_next').onclick = function() {return false;};
|
519 |
+
|
520 |
+
if (!this.options.hideGalleryTab) {
|
521 |
+
Event.observe($('lightwindow_galleries_tab'), 'click', this._handleGalleryAnimation.bind(this, true), false);
|
522 |
+
$('lightwindow_galleries_tab').onclick = function() {return false;};
|
523 |
+
}
|
524 |
+
|
525 |
+
// Because we use position absolute, kill the scroll Wheel on animations
|
526 |
+
if (Prototype.Browser.IE) {
|
527 |
+
Event.observe(document, 'mousewheel', this._stopScrolling.bindAsEventListener(this), false);
|
528 |
+
} else {
|
529 |
+
Event.observe(window, 'DOMMouseScroll', this._stopScrolling.bindAsEventListener(this), false);
|
530 |
+
}
|
531 |
+
|
532 |
+
Event.observe(overlay, 'click', this.deactivate.bindAsEventListener(this), false);
|
533 |
+
overlay.onclick = function() {return false;};
|
534 |
+
},
|
535 |
+
//
|
536 |
+
// Add loading window markup
|
537 |
+
//
|
538 |
+
_addLoadingWindowMarkup : function() {
|
539 |
+
$('lightwindow_contents').innerHTML += this.options.skin.loading;
|
540 |
+
},
|
541 |
+
//
|
542 |
+
// Setup the window elements
|
543 |
+
//
|
544 |
+
_setupWindowElements : function(link) {
|
545 |
+
this.element = link;
|
546 |
+
this.element.title = null ? '' : link.getAttribute('title');
|
547 |
+
this.element.author = null ? '' : link.getAttribute('author');
|
548 |
+
this.element.caption = null ? '' : link.getAttribute('caption');
|
549 |
+
this.element.rel = null ? '' : link.getAttribute('rel');
|
550 |
+
this.element.params = null ? '' : link.getAttribute('params');
|
551 |
+
|
552 |
+
// Set the window type
|
553 |
+
this.contentToFetch = this.element.href;
|
554 |
+
this.windowType = this._getParameter('lightwindow_type') ? this._getParameter('lightwindow_type') : this._fileType(this.contentToFetch);
|
555 |
+
},
|
556 |
+
//
|
557 |
+
// Clear the window contents out
|
558 |
+
//
|
559 |
+
_clearWindowContents : function(contents) {
|
560 |
+
// If there is an iframe, its got to go
|
561 |
+
if ($('lightwindow_iframe')) {
|
562 |
+
Element.remove($('lightwindow_iframe'));
|
563 |
+
}
|
564 |
+
|
565 |
+
// Stop playing an object if its still around
|
566 |
+
if ($('lightwindow_media_primary')) {
|
567 |
+
try {
|
568 |
+
$('lightwindow_media_primary').Stop();
|
569 |
+
} catch(e) {}
|
570 |
+
Element.remove($('lightwindow_media_primary'));
|
571 |
+
}
|
572 |
+
|
573 |
+
// Stop playing an object if its still around
|
574 |
+
if ($('lightwindow_media_secondary')) {
|
575 |
+
try {
|
576 |
+
$('lightwindow_media_secondary').Stop();
|
577 |
+
} catch(e) {}
|
578 |
+
Element.remove($('lightwindow_media_secondary'));
|
579 |
+
}
|
580 |
+
|
581 |
+
this.activeGallery = false;
|
582 |
+
this._handleNavigation(this.activeGallery);
|
583 |
+
|
584 |
+
if (contents) {
|
585 |
+
// Empty the contents
|
586 |
+
$('lightwindow_contents').innerHTML = '';
|
587 |
+
|
588 |
+
// Reset the scroll bars
|
589 |
+
$('lightwindow_contents').setStyle({
|
590 |
+
overflow: 'hidden'
|
591 |
+
});
|
592 |
+
|
593 |
+
if (!this.windowActive) {
|
594 |
+
$('lightwindow_data_slide_inner').setStyle({
|
595 |
+
display: 'none'
|
596 |
+
});
|
597 |
+
|
598 |
+
$('lightwindow_title_bar_title').innerHTML = '';
|
599 |
+
}
|
600 |
+
|
601 |
+
// Because of browser differences and to maintain flexible captions we need to reset this height at close
|
602 |
+
$('lightwindow_data_slide').setStyle({
|
603 |
+
height: 'auto'
|
604 |
+
});
|
605 |
+
}
|
606 |
+
|
607 |
+
this.resizeTo.height = null;
|
608 |
+
this.resizeTo.width = null;
|
609 |
+
},
|
610 |
+
//
|
611 |
+
// Set the status of our animation to keep things from getting clunky
|
612 |
+
//
|
613 |
+
_setStatus : function(status) {
|
614 |
+
this.animating = status;
|
615 |
+
if (status) {
|
616 |
+
Element.show('lightwindow_loading');
|
617 |
+
}
|
618 |
+
if (!(/MSIE 6./i.test(navigator.userAgent))) {
|
619 |
+
this._fixedWindow(status);
|
620 |
+
}
|
621 |
+
},
|
622 |
+
//
|
623 |
+
// Make this window Fixed
|
624 |
+
//
|
625 |
+
_fixedWindow : function(status) {
|
626 |
+
if (status) {
|
627 |
+
if (this.windowActive) {
|
628 |
+
this._getScroll();
|
629 |
+
$('lightwindow').setStyle({
|
630 |
+
position: 'absolute',
|
631 |
+
top: parseFloat($('lightwindow').getStyle('top'))+this.pagePosition.y+'px',
|
632 |
+
left: parseFloat($('lightwindow').getStyle('left'))+this.pagePosition.x+'px'
|
633 |
+
});
|
634 |
+
} else {
|
635 |
+
$('lightwindow').setStyle({
|
636 |
+
position: 'absolute'
|
637 |
+
});
|
638 |
+
}
|
639 |
+
} else {
|
640 |
+
if (this.windowActive) {
|
641 |
+
this._getScroll();
|
642 |
+
$('lightwindow').setStyle({
|
643 |
+
position: 'fixed',
|
644 |
+
top: parseFloat($('lightwindow').getStyle('top'))-this.pagePosition.y+'px',
|
645 |
+
left: parseFloat($('lightwindow').getStyle('left'))-this.pagePosition.x+'px'
|
646 |
+
});
|
647 |
+
} else {
|
648 |
+
if ($('lightwindow_iframe')) {
|
649 |
+
// Ideally here we would set a 50% value for top and left, but Safari rears it ugly head again and we need to do it by pixels
|
650 |
+
this._browserDimensions();
|
651 |
+
}
|
652 |
+
$('lightwindow').setStyle({
|
653 |
+
position: 'fixed',
|
654 |
+
top: (parseFloat(this._getParameter('lightwindow_top')) ? parseFloat(this._getParameter('lightwindow_top'))+'px' : this.dimensions.viewport.height/2+'px'),
|
655 |
+
left: (parseFloat(this._getParameter('lightwindow_left')) ? parseFloat(this._getParameter('lightwindow_left'))+'px' : this.dimensions.viewport.width/2+'px')
|
656 |
+
});
|
657 |
+
}
|
658 |
+
}
|
659 |
+
},
|
660 |
+
//
|
661 |
+
// Prepare the window for IE.
|
662 |
+
//
|
663 |
+
_prepareIE : function(setup) {
|
664 |
+
if (Prototype.Browser.IE) {
|
665 |
+
var height, overflowX, overflowY;
|
666 |
+
if (setup) {
|
667 |
+
var height = '100%';
|
668 |
+
} else {
|
669 |
+
var height = 'auto';
|
670 |
+
}
|
671 |
+
var body = document.getElementsByTagName('body')[0];
|
672 |
+
var html = document.getElementsByTagName('html')[0];
|
673 |
+
html.style.height = body.style.height = height;
|
674 |
+
}
|
675 |
+
},
|
676 |
+
_stopScrolling : function(e) {
|
677 |
+
if (this.animating) {
|
678 |
+
if (e.preventDefault) {
|
679 |
+
e.preventDefault();
|
680 |
+
}
|
681 |
+
e.returnValue = false;
|
682 |
+
}
|
683 |
+
},
|
684 |
+
//
|
685 |
+
// Get the scroll for the page.
|
686 |
+
//
|
687 |
+
_getScroll : function(){
|
688 |
+
if(typeof(window.pageYOffset) == 'number') {
|
689 |
+
this.pagePosition.x = window.pageXOffset;
|
690 |
+
this.pagePosition.y = window.pageYOffset;
|
691 |
+
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
692 |
+
this.pagePosition.x = document.body.scrollLeft;
|
693 |
+
this.pagePosition.y = document.body.scrollTop;
|
694 |
+
} else if(document.documentElement) {
|
695 |
+
this.pagePosition.x = document.documentElement.scrollLeft;
|
696 |
+
this.pagePosition.y = document.documentElement.scrollTop;
|
697 |
+
}
|
698 |
+
},
|
699 |
+
//
|
700 |
+
// Reset the scroll.
|
701 |
+
//
|
702 |
+
_setScroll : function(x, y) {
|
703 |
+
document.documentElement.scrollLeft = x;
|
704 |
+
document.documentElement.scrollTop = y;
|
705 |
+
},
|
706 |
+
//
|
707 |
+
// Hide Selects from the page because of IE.
|
708 |
+
// We could use iframe shims instead here but why add all the extra markup for one browser when this is much easier and cleaner
|
709 |
+
//
|
710 |
+
_toggleTroubleElements : function(visibility, content){
|
711 |
+
|
712 |
+
if (content) {
|
713 |
+
var selects = $('lightwindow_contents').getElementsByTagName('select');
|
714 |
+
} else {
|
715 |
+
var selects = document.getElementsByTagName('select');
|
716 |
+
}
|
717 |
+
|
718 |
+
for(var i = 0; i < selects.length; i++) {
|
719 |
+
selects[i].style.visibility = visibility;
|
720 |
+
}
|
721 |
+
|
722 |
+
if (!content) {
|
723 |
+
if (this.options.hideFlash){
|
724 |
+
var objects = document.getElementsByTagName('object');
|
725 |
+
for (i = 0; i != objects.length; i++) {
|
726 |
+
objects[i].style.visibility = visibility;
|
727 |
+
}
|
728 |
+
var embeds = document.getElementsByTagName('embed');
|
729 |
+
for (i = 0; i != embeds.length; i++) {
|
730 |
+
embeds[i].style.visibility = visibility;
|
731 |
+
}
|
732 |
+
}
|
733 |
+
var iframes = document.getElementsByTagName('iframe');
|
734 |
+
for (i = 0; i != iframes.length; i++) {
|
735 |
+
iframes[i].style.visibility = visibility;
|
736 |
+
}
|
737 |
+
}
|
738 |
+
},
|
739 |
+
//
|
740 |
+
// Get the actual page size
|
741 |
+
//
|
742 |
+
_getPageDimensions : function() {
|
743 |
+
var xScroll, yScroll;
|
744 |
+
if (window.innerHeight && window.scrollMaxY) {
|
745 |
+
xScroll = document.body.scrollWidth;
|
746 |
+
yScroll = window.innerHeight + window.scrollMaxY;
|
747 |
+
} else if (document.body.scrollHeight > document.body.offsetHeight){
|
748 |
+
xScroll = document.body.scrollWidth;
|
749 |
+
yScroll = document.body.scrollHeight;
|
750 |
+
} else {
|
751 |
+
xScroll = document.body.offsetWidth;
|
752 |
+
yScroll = document.body.offsetHeight;
|
753 |
+
}
|
754 |
+
|
755 |
+
var windowWidth, windowHeight;
|
756 |
+
if (self.innerHeight) {
|
757 |
+
windowWidth = self.innerWidth;
|
758 |
+
windowHeight = self.innerHeight;
|
759 |
+
} else if (document.documentElement && document.documentElement.clientHeight) {
|
760 |
+
windowWidth = document.documentElement.clientWidth;
|
761 |
+
windowHeight = document.documentElement.clientHeight;
|
762 |
+
} else if (document.body) {
|
763 |
+
windowWidth = document.body.clientWidth;
|
764 |
+
windowHeight = document.body.clientHeight;
|
765 |
+
}
|
766 |
+
|
767 |
+
if(yScroll < windowHeight){
|
768 |
+
this.pageDimensions.height = windowHeight;
|
769 |
+
} else {
|
770 |
+
this.pageDimensions.height = yScroll;
|
771 |
+
}
|
772 |
+
|
773 |
+
if(xScroll < windowWidth){
|
774 |
+
this.pageDimensions.width = windowWidth;
|
775 |
+
} else {
|
776 |
+
this.pageDimensions.width = xScroll;
|
777 |
+
}
|
778 |
+
},
|
779 |
+
//
|
780 |
+
// Display the lightWindow.
|
781 |
+
//
|
782 |
+
_displayLightWindow : function(display, visibility) {
|
783 |
+
$('lightwindow_overlay').style.display = $('lightwindow').style.display = $('lightwindow_container').style.display = display;
|
784 |
+
$('lightwindow_overlay').style.visibility = $('lightwindow').style.visibility = $('lightwindow_container').style.visibility = visibility;
|
785 |
+
},
|
786 |
+
//
|
787 |
+
// Setup Dimensions of lightwindow.
|
788 |
+
|
789 |
+
//
|
790 |
+
_setupDimensions : function() {
|
791 |
+
|
792 |
+
var originalHeight, originalWidth;
|
793 |
+
switch (this.windowType) {
|
794 |
+
case 'page' :
|
795 |
+
originalHeight = this.options.dimensions.page.height;
|
796 |
+
originalWidth = this.options.dimensions.page.width;
|
797 |
+
break;
|
798 |
+
|
799 |
+
case 'image' :
|
800 |
+
originalHeight = this.options.dimensions.image.height;
|
801 |
+
originalWidth = this.options.dimensions.image.width;
|
802 |
+
break;
|
803 |
+
|
804 |
+
case 'media' :
|
805 |
+
originalHeight = this.options.dimensions.media.height;
|
806 |
+
originalWidth = this.options.dimensions.media.width;
|
807 |
+
break;
|
808 |
+
|
809 |
+
case 'external' :
|
810 |
+
originalHeight = this.options.dimensions.external.height;
|
811 |
+
originalWidth = this.options.dimensions.external.width;
|
812 |
+
break;
|
813 |
+
|
814 |
+
case 'inline' :
|
815 |
+
originalHeight = this.options.dimensions.inline.height;
|
816 |
+
originalWidth = this.options.dimensions.inline.width;
|
817 |
+
break;
|
818 |
+
|
819 |
+
default :
|
820 |
+
originalHeight = this.options.dimensions.page.height;
|
821 |
+
originalWidth = this.options.dimensions.page.width;
|
822 |
+
break;
|
823 |
+
|
824 |
+
}
|
825 |
+
|
826 |
+
var offsetHeight = this._getParameter('lightwindow_top') ? parseFloat(this._getParameter('lightwindow_top'))+this.pagePosition.y : this.dimensions.viewport.height/2+this.pagePosition.y;
|
827 |
+
var offsetWidth = this._getParameter('lightwindow_left') ? parseFloat(this._getParameter('lightwindow_left'))+this.pagePosition.x : this.dimensions.viewport.width/2+this.pagePosition.x;
|
828 |
+
|
829 |
+
// So if a theme has say shadowed edges, they should be consistant and take care of in the contentOffset
|
830 |
+
$('lightwindow').setStyle({
|
831 |
+
top: offsetHeight+'px',
|
832 |
+
left: offsetWidth+'px'
|
833 |
+
});
|
834 |
+
$('lightwindow_container').setStyle({
|
835 |
+
height: originalHeight+'px',
|
836 |
+
width: originalWidth+'px',
|
837 |
+
left: -(originalWidth/2)+'px',
|
838 |
+
top: -(originalHeight/2)+'px'
|
839 |
+
});
|
840 |
+
$('lightwindow_contents').setStyle({
|
841 |
+
height: originalHeight+'px',
|
842 |
+
width: originalWidth+'px'
|
843 |
+
});
|
844 |
+
},
|
845 |
+
//
|
846 |
+
// Get the type of file.
|
847 |
+
//
|
848 |
+
_fileType : function(url) {
|
849 |
+
var image = new RegExp("[^\.]\.("+this.options.fileTypes.image.join('|')+")\s*$", "i");
|
850 |
+
if (image.test(url)) return 'image';
|
851 |
+
if (url.indexOf('#') > -1 && (document.domain == this._getDomain(url))) return 'inline';
|
852 |
+
if (url.indexOf('?') > -1) url = url.substring(0, url.indexOf('?'));
|
853 |
+
var type = 'unknown';
|
854 |
+
var page = new RegExp("[^\.]\.("+this.options.fileTypes.page.join('|')+")\s*$", "i");
|
855 |
+
var media = new RegExp("[^\.]\.("+this.options.fileTypes.media.join('|')+")\s*$", "i");
|
856 |
+
if (document.domain != this._getDomain(url)) type = 'external';
|
857 |
+
if (media.test(url)) type = 'media';
|
858 |
+
if (type == 'external' || type == 'media') return type;
|
859 |
+
if (page.test(url) || url.substr((url.length-1), url.length) == '/') type = 'page';
|
860 |
+
return type;
|
861 |
+
},
|
862 |
+
//
|
863 |
+
// Get file Extension
|
864 |
+
//
|
865 |
+
_fileExtension : function(url) {
|
866 |
+
if (url.indexOf('?') > -1) {
|
867 |
+
url = url.substring(0, url.indexOf('?'));
|
868 |
+
}
|
869 |
+
var extenstion = '';
|
870 |
+
for (var x = (url.length-1); x > -1; x--) {
|
871 |
+
if (url.charAt(x) == '.') {
|
872 |
+
return extenstion;
|
873 |
+
}
|
874 |
+
extenstion = url.charAt(x)+extenstion;
|
875 |
+
}
|
876 |
+
},
|
877 |
+
//
|
878 |
+
// Monitor the keyboard while this lightwindow is up
|
879 |
+
//
|
880 |
+
_monitorKeyboard : function(status) {
|
881 |
+
if (status) document.onkeydown = this._eventKeypress.bind(this);
|
882 |
+
else document.onkeydown = '';
|
883 |
+
},
|
884 |
+
//
|
885 |
+
// Perform keyboard actions
|
886 |
+
//
|
887 |
+
_eventKeypress : function(e) {
|
888 |
+
if (e == null) {
|
889 |
+
var keycode = event.keyCode;
|
890 |
+
} else {
|
891 |
+
var keycode = e.which;
|
892 |
+
}
|
893 |
+
|
894 |
+
switch (keycode) {
|
895 |
+
case 27:
|
896 |
+
this.deactivate();
|
897 |
+
break;
|
898 |
+
|
899 |
+
case 13:
|
900 |
+
return;
|
901 |
+
|
902 |
+
default:
|
903 |
+
break;
|
904 |
+
}
|
905 |
+
|
906 |
+
// Gotta stop those quick fingers
|
907 |
+
if (this.animating) {
|
908 |
+
return false;
|
909 |
+
}
|
910 |
+
|
911 |
+
switch (String.fromCharCode(keycode).toLowerCase()) {
|
912 |
+
case 'p':
|
913 |
+
if (this.navigationObservers.previous) {
|
914 |
+
this.navigateWindow('previous');
|
915 |
+
}
|
916 |
+
break;
|
917 |
+
|
918 |
+
case 'n':
|
919 |
+
if (this.navigationObservers.next) {
|
920 |
+
this.navigateWindow('next');
|
921 |
+
}
|
922 |
+
break;
|
923 |
+
|
924 |
+
default:
|
925 |
+
break;
|
926 |
+
}
|
927 |
+
},
|
928 |
+
//
|
929 |
+
// Get Gallery Information
|
930 |
+
//
|
931 |
+
_getGalleryInfo : function(rel) {
|
932 |
+
if (!rel) return false;
|
933 |
+
if (rel.indexOf('[') > -1) {
|
934 |
+
return new Array(escape(rel.substring(0, rel.indexOf('['))), escape(rel.substring(rel.indexOf('[')+1, rel.indexOf(']'))));
|
935 |
+
} else {
|
936 |
+
return false;
|
937 |
+
}
|
938 |
+
},
|
939 |
+
//
|
940 |
+
// Get the domain from a string.
|
941 |
+
//
|
942 |
+
_getDomain : function(url) {
|
943 |
+
var leadSlashes = url.indexOf('//');
|
944 |
+
var domainStart = leadSlashes+2;
|
945 |
+
var withoutResource = url.substring(domainStart, url.length);
|
946 |
+
var nextSlash = withoutResource.indexOf('/');
|
947 |
+
var domain = withoutResource.substring(0, nextSlash);
|
948 |
+
if (domain.indexOf(':') > -1){
|
949 |
+
var portColon = domain.indexOf(':');
|
950 |
+
domain = domain.substring(0, portColon);
|
951 |
+
}
|
952 |
+
return domain;
|
953 |
+
},
|
954 |
+
//
|
955 |
+
// Get the value from the params attribute string.
|
956 |
+
//
|
957 |
+
_getParameter : function(parameter, parameters) {
|
958 |
+
if (!this.element) return false;
|
959 |
+
if (parameter == 'lightwindow_top' && this.element.top) {
|
960 |
+
return unescape(this.element.top);
|
961 |
+
} else if (parameter == 'lightwindow_left' && this.element.left) {
|
962 |
+
return unescape(this.element.left);
|
963 |
+
} else if (parameter == 'lightwindow_type' && this.element.type) {
|
964 |
+
return unescape(this.element.type);
|
965 |
+
} else if (parameter == 'lightwindow_show_images' && this.element.showImages) {
|
966 |
+
return unescape(this.element.showImages);
|
967 |
+
} else if (parameter == 'lightwindow_height' && this.element.height) {
|
968 |
+
return unescape(this.element.height);
|
969 |
+
} else if (parameter == 'lightwindow_width' && this.element.width) {
|
970 |
+
return unescape(this.element.width);
|
971 |
+
} else if (parameter == 'lightwindow_loading_animation' && this.element.loadingAnimation) {
|
972 |
+
return unescape(this.element.loadingAnimation);
|
973 |
+
} else if (parameter == 'lightwindow_iframe_embed' && this.element.iframeEmbed) {
|
974 |
+
return unescape(this.element.iframeEmbed);
|
975 |
+
} else if (parameter == 'lightwindow_form' && this.element.form) {
|
976 |
+
return unescape(this.element.form);
|
977 |
+
} else {
|
978 |
+
if (!parameters) {
|
979 |
+
if (this.element.params) parameters = this.element.params;
|
980 |
+
else return;
|
981 |
+
}
|
982 |
+
var value;
|
983 |
+
var parameterArray = parameters.split(',');
|
984 |
+
var compareString = parameter+'=';
|
985 |
+
var compareLength = compareString.length;
|
986 |
+
for (var i = 0; i < parameterArray.length; i++) {
|
987 |
+
if (parameterArray[i].substr(0, compareLength) == compareString) {
|
988 |
+
var currentParameter = parameterArray[i].split('=');
|
989 |
+
value = currentParameter[1];
|
990 |
+
break;
|
991 |
+
}
|
992 |
+
}
|
993 |
+
if (!value) return false;
|
994 |
+
else return unescape(value);
|
995 |
+
}
|
996 |
+
},
|
997 |
+
//
|
998 |
+
// Get the Browser Viewport Dimensions
|
999 |
+
//
|
1000 |
+
_browserDimensions : function() {
|
1001 |
+
if (Prototype.Browser.IE) {
|
1002 |
+
this.dimensions.viewport.height = document.documentElement.clientHeight;
|
1003 |
+
this.dimensions.viewport.width = document.documentElement.clientWidth;
|
1004 |
+
} else {
|
1005 |
+
this.dimensions.viewport.height = window.innerHeight;
|
1006 |
+
this.dimensions.viewport.width = document.width || document.body.offsetWidth;
|
1007 |
+
}
|
1008 |
+
},
|
1009 |
+
//
|
1010 |
+
// Get the scrollbar offset, I don't like this method but there is really no other way I can find.
|
1011 |
+
//
|
1012 |
+
_getScrollerWidth : function() {
|
1013 |
+
var scrollDiv = Element.extend(document.createElement('div'));
|
1014 |
+
scrollDiv.setAttribute('id', 'lightwindow_scroll_div');
|
1015 |
+
scrollDiv.setStyle({
|
1016 |
+
position: 'absolute',
|
1017 |
+
top: '-10000px',
|
1018 |
+
left: '-10000px',
|
1019 |
+
width: '100px',
|
1020 |
+
height: '100px',
|
1021 |
+
overflow: 'hidden'
|
1022 |
+
});
|
1023 |
+
|
1024 |
+
|
1025 |
+
|
1026 |
+
var contentDiv = Element.extend(document.createElement('div'));
|
1027 |
+
contentDiv.setAttribute('id', 'lightwindow_content_scroll_div');
|
1028 |
+
contentDiv.setStyle({
|
1029 |
+
width: '100%',
|
1030 |
+
height: '200px'
|
1031 |
+
});
|
1032 |
+
|
1033 |
+
scrollDiv.appendChild(contentDiv);
|
1034 |
+
|
1035 |
+
var body = document.getElementsByTagName('body')[0];
|
1036 |
+
body.appendChild(scrollDiv);
|
1037 |
+
|
1038 |
+
var noScroll = $('lightwindow_content_scroll_div').offsetWidth;
|
1039 |
+
scrollDiv.style.overflow = 'auto';
|
1040 |
+
var withScroll = $('lightwindow_content_scroll_div').offsetWidth;
|
1041 |
+
|
1042 |
+
Element.remove($('lightwindow_scroll_div'));
|
1043 |
+
|
1044 |
+
this.scrollbarOffset = noScroll-withScroll;
|
1045 |
+
},
|
1046 |
+
|
1047 |
+
|
1048 |
+
//
|
1049 |
+
// Add a param to an object dynamically created
|
1050 |
+
//
|
1051 |
+
_addParamToObject : function(name, value, object, id) {
|
1052 |
+
var param = document.createElement('param');
|
1053 |
+
param.setAttribute('value', value);
|
1054 |
+
param.setAttribute('name', name);
|
1055 |
+
if (id) {
|
1056 |
+
param.setAttribute('id', id);
|
1057 |
+
}
|
1058 |
+
object.appendChild(param);
|
1059 |
+
return object;
|
1060 |
+
},
|
1061 |
+
//
|
1062 |
+
// Get the outer HTML of an object CROSS BROWSER
|
1063 |
+
//
|
1064 |
+
_outerHTML : function(object) {
|
1065 |
+
if (Prototype.Browser.IE) {
|
1066 |
+
return object.outerHTML;
|
1067 |
+
} else {
|
1068 |
+
var clone = object.cloneNode(true);
|
1069 |
+
var cloneDiv = document.createElement('div');
|
1070 |
+
cloneDiv.appendChild(clone);
|
1071 |
+
return cloneDiv.innerHTML;
|
1072 |
+
}
|
1073 |
+
},
|
1074 |
+
//
|
1075 |
+
// Convert an object to markup
|
1076 |
+
//
|
1077 |
+
_convertToMarkup : function(object, closeTag) {
|
1078 |
+
var markup = this._outerHTML(object).replace('</'+closeTag+'>', '');
|
1079 |
+
if (Prototype.Browser.IE) {
|
1080 |
+
for (var i = 0; i < object.childNodes.length; i++){
|
1081 |
+
markup += this._outerHTML(object.childNodes[i]);
|
1082 |
+
}
|
1083 |
+
markup += '</'+closeTag+'>';
|
1084 |
+
}
|
1085 |
+
return markup;
|
1086 |
+
},
|
1087 |
+
//
|
1088 |
+
// Depending what type of browser it is we have to append the object differently... DAMN YOU IE!!
|
1089 |
+
//
|
1090 |
+
_appendObject : function(object, closeTag, appendTo) {
|
1091 |
+
if (Prototype.Browser.IE) {
|
1092 |
+
appendTo.innerHTML += this._convertToMarkup(object, closeTag);
|
1093 |
+
|
1094 |
+
// Fix the Eolas activate thing but only for specified media, for example doing this to a quicktime film breaks it.
|
1095 |
+
if (this.options.EOLASFix.indexOf(this._fileType(this.element.href)) > -1) {
|
1096 |
+
var objectElements = document.getElementsByTagName('object');
|
1097 |
+
for (var i = 0; i < objectElements.length; i++) {
|
1098 |
+
if (objectElements[i].getAttribute("data")) objectElements[i].removeAttribute('data');
|
1099 |
+
objectElements[i].outerHTML = objectElements[i].outerHTML;
|
1100 |
+
objectElements[i].style.visibility = "visible";
|
1101 |
+
}
|
1102 |
+
}
|
1103 |
+
} else {
|
1104 |
+
appendTo.appendChild(object);
|
1105 |
+
}
|
1106 |
+
},
|
1107 |
+
//
|
1108 |
+
// Add in iframe
|
1109 |
+
//
|
1110 |
+
_appendIframe : function(scroll) {
|
1111 |
+
var iframe = document.createElement('iframe');
|
1112 |
+
iframe.setAttribute('id', 'lightwindow_iframe');
|
1113 |
+
iframe.setAttribute('name', 'lightwindow_iframe');
|
1114 |
+
iframe.setAttribute('src', 'about:blank');
|
1115 |
+
iframe.setAttribute('height', '100%');
|
1116 |
+
iframe.setAttribute('width', '100%');
|
1117 |
+
iframe.setAttribute('frameborder', '0');
|
1118 |
+
iframe.setAttribute('marginwidth', '0');
|
1119 |
+
iframe.setAttribute('marginheight', '0');
|
1120 |
+
iframe.setAttribute('scrolling', scroll);
|
1121 |
+
|
1122 |
+
this._appendObject(iframe, 'iframe', $('lightwindow_contents'));
|
1123 |
+
},
|
1124 |
+
//
|
1125 |
+
// Write Content to the iframe using the skin
|
1126 |
+
//
|
1127 |
+
_writeToIframe : function(content) {
|
1128 |
+
var template = this.options.skin.iframe;
|
1129 |
+
template = template.replace('{body_replace}', content);
|
1130 |
+
if ($('lightwindow_iframe').contentWindow){
|
1131 |
+
$('lightwindow_iframe').contentWindow.document.open();
|
1132 |
+
$('lightwindow_iframe').contentWindow.document.write(template);
|
1133 |
+
$('lightwindow_iframe').contentWindow.document.close();
|
1134 |
+
} else {
|
1135 |
+
$('lightwindow_iframe').contentDocument.open();
|
1136 |
+
$('lightwindow_iframe').contentDocument.write(template);
|
1137 |
+
$('lightwindow_iframe').contentDocument.close();
|
1138 |
+
}
|
1139 |
+
},
|
1140 |
+
//
|
1141 |
+
// Load the window Information
|
1142 |
+
//
|
1143 |
+
_loadWindow : function() {
|
1144 |
+
switch (this.windowType) {
|
1145 |
+
case 'image' :
|
1146 |
+
|
1147 |
+
var current = 0;
|
1148 |
+
var images = [];
|
1149 |
+
this.checkImage = [];
|
1150 |
+
this.resizeTo.height = this.resizeTo.width = 0;
|
1151 |
+
this.imageCount = this._getParameter('lightwindow_show_images') ? parseInt(this._getParameter('lightwindow_show_images')) : 1;
|
1152 |
+
|
1153 |
+
// If there is a gallery get it
|
1154 |
+
if (gallery = this._getGalleryInfo(this.element.rel)) {
|
1155 |
+
for (current = 0; current < this.galleries[gallery[0]][gallery[1]].length; current++) {
|
1156 |
+
if (this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][current].href) > -1) {
|
1157 |
+
break;
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
if (this.galleries[gallery[0]][gallery[1]][current-this.imageCount]) {
|
1161 |
+
this.navigationObservers.previous = this.galleries[gallery[0]][gallery[1]][current-this.imageCount];
|
1162 |
+
} else {
|
1163 |
+
this.navigationObservers.previous = false;
|
1164 |
+
}
|
1165 |
+
if (this.galleries[gallery[0]][gallery[1]][current+this.imageCount]) {
|
1166 |
+
this.navigationObservers.next = this.galleries[gallery[0]][gallery[1]][current+this.imageCount];
|
1167 |
+
} else {
|
1168 |
+
this.navigationObservers.next = false;
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
this.activeGallery = true;
|
1172 |
+
} else {
|
1173 |
+
this.navigationObservers.previous = false;
|
1174 |
+
this.navigationObservers.next = false;
|
1175 |
+
|
1176 |
+
this.activeGallery = false;
|
1177 |
+
}
|
1178 |
+
|
1179 |
+
for (var i = current; i < (current+this.imageCount); i++) {
|
1180 |
+
|
1181 |
+
if (gallery && this.galleries[gallery[0]][gallery[1]][i]) {
|
1182 |
+
this.contentToFetch = this.galleries[gallery[0]][gallery[1]][i].href;
|
1183 |
+
|
1184 |
+
this.galleryLocation = {current: (i+1)/this.imageCount, total: (this.galleries[gallery[0]][gallery[1]].length)/this.imageCount};
|
1185 |
+
|
1186 |
+
if (!this.galleries[gallery[0]][gallery[1]][i+this.imageCount]) {
|
1187 |
+
$('lightwindow_next').setStyle({
|
1188 |
+
display: 'none'
|
1189 |
+
});
|
1190 |
+
} else {
|
1191 |
+
$('lightwindow_next').setStyle({
|
1192 |
+
display: 'block'
|
1193 |
+
});
|
1194 |
+
$('lightwindow_next_title').innerHTML = this.galleries[gallery[0]][gallery[1]][i+this.imageCount].title;
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
if (!this.galleries[gallery[0]][gallery[1]][i-this.imageCount]) {
|
1198 |
+
$('lightwindow_previous').setStyle({
|
1199 |
+
display: 'none'
|
1200 |
+
});
|
1201 |
+
} else {
|
1202 |
+
$('lightwindow_previous').setStyle({
|
1203 |
+
display: 'block'
|
1204 |
+
});
|
1205 |
+
$('lightwindow_previous_title').innerHTML = this.galleries[gallery[0]][gallery[1]][i-this.imageCount].title;
|
1206 |
+
}
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
images[i] = document.createElement('img');
|
1210 |
+
images[i].setAttribute('id', 'lightwindow_image_'+i);
|
1211 |
+
images[i].setAttribute('border', '0');
|
1212 |
+
images[i].setAttribute('src', this.contentToFetch);
|
1213 |
+
$('lightwindow_contents').appendChild(images[i]);
|
1214 |
+
|
1215 |
+
// We have to do this instead of .onload
|
1216 |
+
this.checkImage[i] = new PeriodicalExecuter(function(i) {
|
1217 |
+
if (!(typeof $('lightwindow_image_'+i).naturalWidth != "undefined" && $('lightwindow_image_'+i).naturalWidth == 0)) {
|
1218 |
+
|
1219 |
+
this.checkImage[i].stop();
|
1220 |
+
|
1221 |
+
var imageHeight = $('lightwindow_image_'+i).getHeight();
|
1222 |
+
if (imageHeight > this.resizeTo.height) {
|
1223 |
+
this.resizeTo.height = imageHeight;
|
1224 |
+
}
|
1225 |
+
this.resizeTo.width += $('lightwindow_image_'+i).getWidth();
|
1226 |
+
this.imageCount--;
|
1227 |
+
|
1228 |
+
$('lightwindow_image_'+i).setStyle({
|
1229 |
+
height: '100%'
|
1230 |
+
});
|
1231 |
+
|
1232 |
+
if (this.imageCount == 0) {
|
1233 |
+
this._processWindow();
|
1234 |
+
}
|
1235 |
+
}
|
1236 |
+
|
1237 |
+
}.bind(this, i), 1);
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
|
1241 |
+
break;
|
1242 |
+
|
1243 |
+
case 'media' :
|
1244 |
+
|
1245 |
+
var current = 0;
|
1246 |
+
this.resizeTo.height = this.resizeTo.width = 0;
|
1247 |
+
|
1248 |
+
// If there is a gallery get it
|
1249 |
+
if (gallery = this._getGalleryInfo(this.element.rel)) {
|
1250 |
+
for (current = 0; current < this.galleries[gallery[0]][gallery[1]].length; current++) {
|
1251 |
+
if (this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][current].href) > -1) {
|
1252 |
+
break;
|
1253 |
+
}
|
1254 |
+
}
|
1255 |
+
|
1256 |
+
if (this.galleries[gallery[0]][gallery[1]][current-1]) {
|
1257 |
+
this.navigationObservers.previous = this.galleries[gallery[0]][gallery[1]][current-1];
|
1258 |
+
} else {
|
1259 |
+
this.navigationObservers.previous = false;
|
1260 |
+
}
|
1261 |
+
if (this.galleries[gallery[0]][gallery[1]][current+1]) {
|
1262 |
+
this.navigationObservers.next = this.galleries[gallery[0]][gallery[1]][current+1];
|
1263 |
+
} else {
|
1264 |
+
this.navigationObservers.next = false;
|
1265 |
+
}
|
1266 |
+
|
1267 |
+
this.activeGallery = true;
|
1268 |
+
} else {
|
1269 |
+
this.navigationObservers.previous = false;
|
1270 |
+
this.navigationObservers.next = false;
|
1271 |
+
|
1272 |
+
this.activeGallery = false;
|
1273 |
+
}
|
1274 |
+
|
1275 |
+
|
1276 |
+
if (gallery && this.galleries[gallery[0]][gallery[1]][current]) {
|
1277 |
+
this.contentToFetch = this.galleries[gallery[0]][gallery[1]][current].href;
|
1278 |
+
|
1279 |
+
this.galleryLocation = {current: current+1, total: this.galleries[gallery[0]][gallery[1]].length};
|
1280 |
+
|
1281 |
+
if (!this.galleries[gallery[0]][gallery[1]][current+1]) {
|
1282 |
+
$('lightwindow_next').setStyle({
|
1283 |
+
display: 'none'
|
1284 |
+
});
|
1285 |
+
} else {
|
1286 |
+
$('lightwindow_next').setStyle({
|
1287 |
+
display: 'block'
|
1288 |
+
});
|
1289 |
+
$('lightwindow_next_title').innerHTML = this.galleries[gallery[0]][gallery[1]][current+1].title;
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
if (!this.galleries[gallery[0]][gallery[1]][current-1]) {
|
1293 |
+
$('lightwindow_previous').setStyle({
|
1294 |
+
display: 'none'
|
1295 |
+
});
|
1296 |
+
} else {
|
1297 |
+
$('lightwindow_previous').setStyle({
|
1298 |
+
display: 'block'
|
1299 |
+
});
|
1300 |
+
$('lightwindow_previous_title').innerHTML = this.galleries[gallery[0]][gallery[1]][current-1].title;
|
1301 |
+
}
|
1302 |
+
}
|
1303 |
+
|
1304 |
+
if (this._getParameter('lightwindow_iframe_embed')) {
|
1305 |
+
this.resizeTo.height = this.dimensions.viewport.height;
|
1306 |
+
this.resizeTo.width = this.dimensions.viewport.width;
|
1307 |
+
} else {
|
1308 |
+
this.resizeTo.height = this._getParameter('lightwindow_height');
|
1309 |
+
this.resizeTo.width = this._getParameter('lightwindow_width');
|
1310 |
+
}
|
1311 |
+
|
1312 |
+
this._processWindow();
|
1313 |
+
|
1314 |
+
break;
|
1315 |
+
|
1316 |
+
case 'external' :
|
1317 |
+
|
1318 |
+
this._appendIframe('auto');
|
1319 |
+
|
1320 |
+
this.resizeTo.height = this.dimensions.viewport.height;
|
1321 |
+
this.resizeTo.width = this.dimensions.viewport.width;
|
1322 |
+
this._processWindow();
|
1323 |
+
|
1324 |
+
break;
|
1325 |
+
|
1326 |
+
case 'page' :
|
1327 |
+
|
1328 |
+
var newAJAX = new Ajax.Request(
|
1329 |
+
this.contentToFetch, {
|
1330 |
+
method: 'get',
|
1331 |
+
parameters: '',
|
1332 |
+
onComplete: function(response) {
|
1333 |
+
$('lightwindow_contents').innerHTML += response.responseText;
|
1334 |
+
this.resizeTo.height = $('lightwindow_contents').scrollHeight+(this.options.contentOffset.height);
|
1335 |
+
this.resizeTo.width = $('lightwindow_contents').scrollWidth+(this.options.contentOffset.width);
|
1336 |
+
this._processWindow();
|
1337 |
+
}.bind(this)
|
1338 |
+
}
|
1339 |
+
);
|
1340 |
+
|
1341 |
+
break;
|
1342 |
+
|
1343 |
+
case 'inline' :
|
1344 |
+
|
1345 |
+
var content = this.contentToFetch;
|
1346 |
+
if (content.indexOf('?') > -1) {
|
1347 |
+
content = content.substring(0, content.indexOf('?'));
|
1348 |
+
}
|
1349 |
+
content = content.substring(content.indexOf('#')+1);
|
1350 |
+
|
1351 |
+
new Insertion.Top($('lightwindow_contents'), $(content).innerHTML);
|
1352 |
+
|
1353 |
+
this.resizeTo.height = $('lightwindow_contents').scrollHeight+(this.options.contentOffset.height);
|
1354 |
+
this.resizeTo.width = $('lightwindow_contents').scrollWidth+(this.options.contentOffset.width);
|
1355 |
+
|
1356 |
+
this._toggleTroubleElements('hidden', true);
|
1357 |
+
this._processWindow();
|
1358 |
+
|
1359 |
+
break;
|
1360 |
+
|
1361 |
+
default :
|
1362 |
+
throw("Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch);
|
1363 |
+
break;
|
1364 |
+
}
|
1365 |
+
},
|
1366 |
+
//
|
1367 |
+
// Resize the Window to fit the viewport if necessary
|
1368 |
+
//
|
1369 |
+
_resizeWindowToFit : function() {
|
1370 |
+
if (this.resizeTo.height+this.dimensions.cruft.height > this.dimensions.viewport.height) {
|
1371 |
+
var heightRatio = this.resizeTo.height/this.resizeTo.width;
|
1372 |
+
this.resizeTo.height = this.dimensions.viewport.height-this.dimensions.cruft.height-(2*this.options.viewportPadding);
|
1373 |
+
// We only care about ratio's with this window type
|
1374 |
+
if (this.windowType == 'image' || (this.windowType == 'media' && !this._getParameter('lightwindow_iframe_embed'))) {
|
1375 |
+
this.resizeTo.width = this.resizeTo.height/heightRatio;
|
1376 |
+
$('lightwindow_data_slide_inner').setStyle({
|
1377 |
+
width: this.resizeTo.width+'px'
|
1378 |
+
});
|
1379 |
+
}
|
1380 |
+
}
|
1381 |
+
if (this.resizeTo.width+this.dimensions.cruft.width > this.dimensions.viewport.width) {
|
1382 |
+
var widthRatio = this.resizeTo.width/this.resizeTo.height;
|
1383 |
+
this.resizeTo.width = this.dimensions.viewport.width-2*this.dimensions.cruft.width-(2*this.options.viewportPadding);
|
1384 |
+
// We only care about ratio's with this window type
|
1385 |
+
if (this.windowType == 'image' || (this.windowType == 'media' && !this._getParameter('lightwindow_iframe_embed'))) {
|
1386 |
+
this.resizeTo.height = this.resizeTo.width/widthRatio;
|
1387 |
+
$('lightwindow_data_slide_inner').setStyle({
|
1388 |
+
height: this.resizeTo.height+'px'
|
1389 |
+
});
|
1390 |
+
}
|
1391 |
+
}
|
1392 |
+
|
1393 |
+
},
|
1394 |
+
//
|
1395 |
+
// Set the Window to a preset size
|
1396 |
+
//
|
1397 |
+
_presetWindowSize : function() {
|
1398 |
+
if (this._getParameter('lightwindow_height')) {
|
1399 |
+
this.resizeTo.height = parseFloat(this._getParameter('lightwindow_height'));
|
1400 |
+
}
|
1401 |
+
if (this._getParameter('lightwindow_width')) {
|
1402 |
+
this.resizeTo.width = parseFloat(this._getParameter('lightwindow_width'));
|
1403 |
+
}
|
1404 |
+
},
|
1405 |
+
//
|
1406 |
+
// Process the Window
|
1407 |
+
//
|
1408 |
+
_processWindow : function() {
|
1409 |
+
// Clean out our effects
|
1410 |
+
this.dimensions.dataEffects = [];
|
1411 |
+
|
1412 |
+
// Set up the data-slide if we have caption information
|
1413 |
+
if (this.element.caption || this.element.author || (this.activeGallery && this.options.showGalleryCount)) {
|
1414 |
+
if (this.element.caption) {
|
1415 |
+
$('lightwindow_data_caption').innerHTML = this.element.caption;
|
1416 |
+
$('lightwindow_data_caption').setStyle({
|
1417 |
+
display: 'block'
|
1418 |
+
});
|
1419 |
+
} else {
|
1420 |
+
$('lightwindow_data_caption').setStyle({
|
1421 |
+
display: 'none'
|
1422 |
+
});
|
1423 |
+
}
|
1424 |
+
if (this.element.author) {
|
1425 |
+
$('lightwindow_data_author').innerHTML = this.element.author;
|
1426 |
+
$('lightwindow_data_author_container').setStyle({
|
1427 |
+
display: 'block'
|
1428 |
+
});
|
1429 |
+
} else {
|
1430 |
+
$('lightwindow_data_author_container').setStyle({
|
1431 |
+
display: 'none'
|
1432 |
+
});
|
1433 |
+
}
|
1434 |
+
if (this.activeGallery && this.options.showGalleryCount) {
|
1435 |
+
$('lightwindow_data_gallery_current').innerHTML = this.galleryLocation.current;
|
1436 |
+
$('lightwindow_data_gallery_total').innerHTML = this.galleryLocation.total;
|
1437 |
+
$('lightwindow_data_gallery_container').setStyle({
|
1438 |
+
display: 'block'
|
1439 |
+
});
|
1440 |
+
} else {
|
1441 |
+
$('lightwindow_data_gallery_container').setStyle({
|
1442 |
+
display: 'none'
|
1443 |
+
});
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
$('lightwindow_data_slide_inner').setStyle({
|
1447 |
+
width: this.resizeTo.width+'px',
|
1448 |
+
height: 'auto',
|
1449 |
+
visibility: 'visible',
|
1450 |
+
display: 'block'
|
1451 |
+
});
|
1452 |
+
$('lightwindow_data_slide').setStyle({
|
1453 |
+
height: $('lightwindow_data_slide').getHeight()+'px',
|
1454 |
+
width: '1px',
|
1455 |
+
overflow: 'hidden',
|
1456 |
+
display: 'block'
|
1457 |
+
});
|
1458 |
+
} else {
|
1459 |
+
$('lightwindow_data_slide').setStyle({
|
1460 |
+
display: 'none',
|
1461 |
+
width: 'auto'
|
1462 |
+
});
|
1463 |
+
$('lightwindow_data_slide_inner').setStyle({
|
1464 |
+
display: 'none',
|
1465 |
+
visibility: 'hidden',
|
1466 |
+
width: this.resizeTo.width+'px',
|
1467 |
+
height: '0px'
|
1468 |
+
});
|
1469 |
+
}
|
1470 |
+
|
1471 |
+
if (this.element.title != 'null') {
|
1472 |
+
$('lightwindow_title_bar_title').innerHTML = this.element.title;
|
1473 |
+
} else {
|
1474 |
+
$('lightwindow_title_bar_title').innerHTML = '';
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
var originalContainerDimensions = {height: $('lightwindow_container').getHeight(), width: $('lightwindow_container').getWidth()};
|
1478 |
+
// Position the window
|
1479 |
+
$('lightwindow_container').setStyle({
|
1480 |
+
height: 'auto',
|
1481 |
+
// We need to set the width to a px not auto as opera has problems with it
|
1482 |
+
width: $('lightwindow_container').getWidth()+this.options.contentOffset.width-(this.windowActive ? this.options.contentOffset.width : 0)+'px'
|
1483 |
+
});
|
1484 |
+
var newContainerDimensions = {height: $('lightwindow_container').getHeight(), width: $('lightwindow_container').getWidth()};
|
1485 |
+
|
1486 |
+
// We need to record the container dimension changes
|
1487 |
+
this.containerChange = {height: originalContainerDimensions.height-newContainerDimensions.height, width: originalContainerDimensions.width-newContainerDimensions.width};
|
1488 |
+
|
1489 |
+
// Get out general dimensions
|
1490 |
+
this.dimensions.container = {height: $('lightwindow_container').getHeight(), width: $('lightwindow_container').getWidth()};
|
1491 |
+
this.dimensions.cruft = {height: this.dimensions.container.height-$('lightwindow_contents').getHeight()+this.options.contentOffset.height, width: this.dimensions.container.width-$('lightwindow_contents').getWidth()+this.options.contentOffset.width};
|
1492 |
+
|
1493 |
+
// Set Sizes if we need too
|
1494 |
+
this._presetWindowSize();
|
1495 |
+
this._resizeWindowToFit(); // Even if the window is preset we still don't want it to go outside of the viewport
|
1496 |
+
|
1497 |
+
if (!this.windowActive) {
|
1498 |
+
// Position the window
|
1499 |
+
$('lightwindow_container').setStyle({
|
1500 |
+
left: -(this.dimensions.container.width/2)+'px',
|
1501 |
+
top: -(this.dimensions.container.height/2)+'px'
|
1502 |
+
});
|
1503 |
+
}
|
1504 |
+
$('lightwindow_container').setStyle({
|
1505 |
+
height: this.dimensions.container.height+'px',
|
1506 |
+
width: this.dimensions.container.width+'px'
|
1507 |
+
});
|
1508 |
+
|
1509 |
+
// We are ready, lets show this puppy off!
|
1510 |
+
this._displayLightWindow('block', 'visible');
|
1511 |
+
this._animateLightWindow();
|
1512 |
+
},
|
1513 |
+
//
|
1514 |
+
// Fire off our animation handler
|
1515 |
+
//
|
1516 |
+
_animateLightWindow : function() {
|
1517 |
+
if (this.options.animationHandler) {
|
1518 |
+
this.options.animationHandler().bind(this);
|
1519 |
+
} else {
|
1520 |
+
this._defaultAnimationHandler();
|
1521 |
+
}
|
1522 |
+
},
|
1523 |
+
//
|
1524 |
+
// Fire off our transition handler
|
1525 |
+
//
|
1526 |
+
_handleNavigation : function(display) {
|
1527 |
+
if (this.options.navigationHandler) {
|
1528 |
+
this.options.navigationHandler().bind(this, display);
|
1529 |
+
} else {
|
1530 |
+
this._defaultDisplayNavigation(display);
|
1531 |
+
}
|
1532 |
+
},
|
1533 |
+
//
|
1534 |
+
// Fire off our transition handler
|
1535 |
+
//
|
1536 |
+
_handleTransition : function() {
|
1537 |
+
if (this.options.transitionHandler) {
|
1538 |
+
this.options.transitionHandler().bind(this);
|
1539 |
+
} else {
|
1540 |
+
this._defaultTransitionHandler();
|
1541 |
+
}
|
1542 |
+
},
|
1543 |
+
//
|
1544 |
+
// Handle the finish of the window animation
|
1545 |
+
//
|
1546 |
+
_handleFinalWindowAnimation : function(delay) {
|
1547 |
+
if (this.options.finalAnimationHandler) {
|
1548 |
+
this.options.finalAnimationHandler().bind(this, delay);
|
1549 |
+
} else {
|
1550 |
+
this._defaultfinalWindowAnimationHandler(delay);
|
1551 |
+
}
|
1552 |
+
},
|
1553 |
+
//
|
1554 |
+
// Handle the gallery Animation
|
1555 |
+
//
|
1556 |
+
_handleGalleryAnimation : function(list) {
|
1557 |
+
if (this.options.galleryAnimationHandler) {
|
1558 |
+
this.options.galleryAnimationHandler().bind(this, list);
|
1559 |
+
} else {
|
1560 |
+
this._defaultGalleryAnimationHandler(list);
|
1561 |
+
}
|
1562 |
+
},
|
1563 |
+
//
|
1564 |
+
// Display the navigation
|
1565 |
+
//
|
1566 |
+
_defaultDisplayNavigation : function(display) {
|
1567 |
+
if (display) {
|
1568 |
+
$('lightwindow_navigation').setStyle({
|
1569 |
+
display: 'block',
|
1570 |
+
height: $('lightwindow_contents').getHeight()+'px',
|
1571 |
+
width: '100%',
|
1572 |
+
marginTop: this.options.dimensions.titleHeight+'px'
|
1573 |
+
});
|
1574 |
+
} else {
|
1575 |
+
$('lightwindow_navigation').setStyle({
|
1576 |
+
display: 'none',
|
1577 |
+
height: 'auto',
|
1578 |
+
width: 'auto'
|
1579 |
+
});
|
1580 |
+
}
|
1581 |
+
},
|
1582 |
+
//
|
1583 |
+
// This is the default animation handler for LightWindow
|
1584 |
+
//
|
1585 |
+
_defaultAnimationHandler : function() {
|
1586 |
+
// Now that we have figures out the cruft lets make the caption go away and add its effects
|
1587 |
+
if (this.element.caption || this.element.author || (this.activeGallery && this.options.showGalleryCount)) {
|
1588 |
+
$('lightwindow_data_slide').setStyle({
|
1589 |
+
display: 'none',
|
1590 |
+
width: 'auto'
|
1591 |
+
});
|
1592 |
+
this.dimensions.dataEffects.push(
|
1593 |
+
new Effect.SlideDown('lightwindow_data_slide', {sync: true}),
|
1594 |
+
new Effect.Appear('lightwindow_data_slide', {sync: true, from: 0.0, to: 1.0})
|
1595 |
+
);
|
1596 |
+
}
|
1597 |
+
|
1598 |
+
// Set up the Title if we have one
|
1599 |
+
$('lightwindow_title_bar_inner').setStyle({
|
1600 |
+
height: '0px',
|
1601 |
+
marginTop: this.options.dimensions.titleHeight+'px'
|
1602 |
+
});
|
1603 |
+
|
1604 |
+
// We always want the title bar as well
|
1605 |
+
this.dimensions.dataEffects.push(
|
1606 |
+
new Effect.Morph('lightwindow_title_bar_inner', {sync: true, style: {height: this.options.dimensions.titleHeight+'px', marginTop: '0px'}}),
|
1607 |
+
new Effect.Appear('lightwindow_title_bar_inner', {sync: true, from: 0.0, to: 1.0})
|
1608 |
+
);
|
1609 |
+
|
1610 |
+
if (!this.options.hideGalleryTab) {
|
1611 |
+
this._handleGalleryAnimation(false);
|
1612 |
+
if ($('lightwindow_galleries_tab_container').getHeight() == 0) {
|
1613 |
+
this.dimensions.dataEffects.push(
|
1614 |
+
new Effect.Morph('lightwindow_galleries_tab_container', {sync: true, style: {height: '20px', marginTop: '0px'}})
|
1615 |
+
);
|
1616 |
+
$('lightwindow_galleries').setStyle({
|
1617 |
+
width: '0px'
|
1618 |
+
});
|
1619 |
+
}
|
1620 |
+
}
|
1621 |
+
|
1622 |
+
var resized = false;
|
1623 |
+
var ratio = this.dimensions.container.width-$('lightwindow_contents').getWidth()+this.resizeTo.width+this.options.contentOffset.width;
|
1624 |
+
if (ratio != $('lightwindow_container').getWidth()) {
|
1625 |
+
new Effect.Parallel([
|
1626 |
+
new Effect.Scale('lightwindow_contents', 100*(this.resizeTo.width/$('lightwindow_contents').getWidth()), {scaleFrom: 100*($('lightwindow_contents').getWidth()/($('lightwindow_contents').getWidth()+(this.options.contentOffset.width))), sync: true, scaleY: false, scaleContent: false}),
|
1627 |
+
new Effect.Scale('lightwindow_container', 100*(ratio/(this.dimensions.container.width)), {sync: true, scaleY: false, scaleFromCenter: true, scaleContent: false})
|
1628 |
+
], {
|
1629 |
+
duration: this.duration,
|
1630 |
+
delay: 0.25,
|
1631 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1632 |
+
}
|
1633 |
+
);
|
1634 |
+
}
|
1635 |
+
|
1636 |
+
ratio = this.dimensions.container.height-$('lightwindow_contents').getHeight()+this.resizeTo.height+this.options.contentOffset.height;
|
1637 |
+
if (ratio != $('lightwindow_container').getHeight()) {
|
1638 |
+
new Effect.Parallel([
|
1639 |
+
new Effect.Scale('lightwindow_contents', 100*(this.resizeTo.height/$('lightwindow_contents').getHeight()), {scaleFrom: 100*($('lightwindow_contents').getHeight()/($('lightwindow_contents').getHeight()+(this.options.contentOffset.height))), sync: true, scaleX: false, scaleContent: false}),
|
1640 |
+
new Effect.Scale('lightwindow_container', 100*(ratio/(this.dimensions.container.height)), {sync: true, scaleX: false, scaleFromCenter: true, scaleContent: false})
|
1641 |
+
], {
|
1642 |
+
duration: this.duration,
|
1643 |
+
afterFinish: function() {
|
1644 |
+
if (this.dimensions.dataEffects.length > 0) {
|
1645 |
+
if (!this.options.hideGalleryTab) {
|
1646 |
+
$('lightwindow_galleries').setStyle({
|
1647 |
+
width: this.resizeTo.width+'px'
|
1648 |
+
});
|
1649 |
+
}
|
1650 |
+
new Effect.Parallel(this.dimensions.dataEffects, {
|
1651 |
+
duration: this.duration,
|
1652 |
+
afterFinish: function() {
|
1653 |
+
this._finishWindow();
|
1654 |
+
}.bind(this),
|
1655 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1656 |
+
}
|
1657 |
+
);
|
1658 |
+
}
|
1659 |
+
}.bind(this),
|
1660 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1661 |
+
}
|
1662 |
+
);
|
1663 |
+
resized = true;
|
1664 |
+
}
|
1665 |
+
|
1666 |
+
// We need to do our data effect since there was no resizing
|
1667 |
+
if (!resized && this.dimensions.dataEffects.length > 0) {
|
1668 |
+
new Effect.Parallel(this.dimensions.dataEffects, {
|
1669 |
+
duration: this.duration,
|
1670 |
+
beforeStart: function() {
|
1671 |
+
if (!this.options.hideGalleryTab) {
|
1672 |
+
$('lightwindow_galleries').setStyle({
|
1673 |
+
width: this.resizeTo.width+'px'
|
1674 |
+
});
|
1675 |
+
}
|
1676 |
+
if (this.containerChange.height != 0 || this.containerChange.width != 0) {
|
1677 |
+
new Effect.MoveBy('lightwindow_container', this.containerChange.height, this.containerChange.width, {transition: Effect.Transitions.sinoidal});
|
1678 |
+
}
|
1679 |
+
}.bind(this),
|
1680 |
+
afterFinish: function() {
|
1681 |
+
this._finishWindow();
|
1682 |
+
}.bind(this),
|
1683 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1684 |
+
}
|
1685 |
+
);
|
1686 |
+
}
|
1687 |
+
|
1688 |
+
},
|
1689 |
+
//
|
1690 |
+
// Finish up Window Animation
|
1691 |
+
//
|
1692 |
+
_defaultfinalWindowAnimationHandler : function(delay) {
|
1693 |
+
if (this.windowType == 'media' || this._getParameter('lightwindow_loading_animation')) {
|
1694 |
+
// Because of major flickering with the overlay we just hide it in this case
|
1695 |
+
Element.hide('lightwindow_loading');
|
1696 |
+
this._handleNavigation(this.activeGallery);
|
1697 |
+
this._setStatus(false);
|
1698 |
+
} else {
|
1699 |
+
Effect.Fade('lightwindow_loading', {
|
1700 |
+
duration: 0.75,
|
1701 |
+
delay: 1.0,
|
1702 |
+
afterFinish: function() {
|
1703 |
+
// Just in case we need some scroll goodness (this also avoids the swiss cheese effect)
|
1704 |
+
if (this.windowType != 'image' && this.windowType != 'media' && this.windowType != 'external') {
|
1705 |
+
$('lightwindow_contents').setStyle({
|
1706 |
+
overflow: 'auto'
|
1707 |
+
});
|
1708 |
+
}
|
1709 |
+
this._handleNavigation(this.activeGallery);
|
1710 |
+
this._defaultGalleryAnimationHandler();
|
1711 |
+
this._setStatus(false);
|
1712 |
+
}.bind(this),
|
1713 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1714 |
+
});
|
1715 |
+
}
|
1716 |
+
},
|
1717 |
+
//
|
1718 |
+
// Handle the gallery Animation
|
1719 |
+
//
|
1720 |
+
_defaultGalleryAnimationHandler : function(list) {
|
1721 |
+
if (this.activeGallery) {
|
1722 |
+
$('lightwindow_galleries').setStyle({
|
1723 |
+
display: 'block',
|
1724 |
+
marginBottom: $('lightwindow_data_slide').getHeight()+this.options.contentOffset.height/2+'px'
|
1725 |
+
});
|
1726 |
+
$('lightwindow_navigation').setStyle({
|
1727 |
+
height: $('lightwindow_contents').getHeight()-20+'px'
|
1728 |
+
});
|
1729 |
+
} else {
|
1730 |
+
$('lightwindow_galleries').setStyle({
|
1731 |
+
display: 'none'
|
1732 |
+
});
|
1733 |
+
$('lightwindow_galleries_tab_container').setStyle({
|
1734 |
+
height: '0px',
|
1735 |
+
marginTop: '20px'
|
1736 |
+
});
|
1737 |
+
$('lightwindow_galleries_list').setStyle({
|
1738 |
+
height: '0px'
|
1739 |
+
});
|
1740 |
+
return false;
|
1741 |
+
}
|
1742 |
+
|
1743 |
+
if (list) {
|
1744 |
+
if ($('lightwindow_galleries_list').getHeight() == 0) {
|
1745 |
+
var height = $('lightwindow_contents').getHeight()*0.80;
|
1746 |
+
$('lightwindow_galleries_tab_span').className = 'down';
|
1747 |
+
} else {
|
1748 |
+
var height = 0;
|
1749 |
+
$('lightwindow_galleries_tab_span').className = 'up';
|
1750 |
+
}
|
1751 |
+
|
1752 |
+
new Effect.Morph('lightwindow_galleries_list', {
|
1753 |
+
duration: this.duration,
|
1754 |
+
transition: Effect.Transitions.sinoidal,
|
1755 |
+
style: {height: height+'px'},
|
1756 |
+
beforeStart: function() {
|
1757 |
+
$('lightwindow_galleries_list').setStyle({
|
1758 |
+
overflow: 'hidden'
|
1759 |
+
});
|
1760 |
+
},
|
1761 |
+
afterFinish: function() {
|
1762 |
+
$('lightwindow_galleries_list').setStyle({
|
1763 |
+
overflow: 'auto'
|
1764 |
+
});
|
1765 |
+
},
|
1766 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1767 |
+
});
|
1768 |
+
}
|
1769 |
+
|
1770 |
+
|
1771 |
+
},
|
1772 |
+
//
|
1773 |
+
// Default Transition Handler
|
1774 |
+
//
|
1775 |
+
_defaultTransitionHandler : function() {
|
1776 |
+
// Clean out our effects
|
1777 |
+
this.dimensions.dataEffects = [];
|
1778 |
+
|
1779 |
+
// Now that we have figures out the cruft lets make the caption go away and add its effects
|
1780 |
+
if ($('lightwindow_data_slide').getStyle('display') != 'none') {
|
1781 |
+
this.dimensions.dataEffects.push(
|
1782 |
+
new Effect.SlideUp('lightwindow_data_slide', {sync: true}),
|
1783 |
+
new Effect.Fade('lightwindow_data_slide', {sync: true, from: 1.0, to: 0.0})
|
1784 |
+
);
|
1785 |
+
}
|
1786 |
+
|
1787 |
+
if (!this.options.hideGalleryTab) {
|
1788 |
+
if ($('lightwindow_galleries').getHeight() != 0 && !this.options.hideGalleryTab) {
|
1789 |
+
this.dimensions.dataEffects.push(
|
1790 |
+
new Effect.Morph('lightwindow_galleries_tab_container', {sync: true, style: {height: '0px', marginTop: '20px'}})
|
1791 |
+
);
|
1792 |
+
}
|
1793 |
+
|
1794 |
+
if ($('lightwindow_galleries_list').getHeight() != 0) {
|
1795 |
+
$('lightwindow_galleries_tab_span').className = 'up';
|
1796 |
+
this.dimensions.dataEffects.push(
|
1797 |
+
new Effect.Morph('lightwindow_galleries_list', {
|
1798 |
+
sync: true,
|
1799 |
+
style: {height: '0px'},
|
1800 |
+
transition: Effect.Transitions.sinoidal,
|
1801 |
+
beforeStart: function() {
|
1802 |
+
$('lightwindow_galleries_list').setStyle({
|
1803 |
+
overflow: 'hidden'
|
1804 |
+
});
|
1805 |
+
},
|
1806 |
+
afterFinish: function() {
|
1807 |
+
$('lightwindow_galleries_list').setStyle({
|
1808 |
+
overflow: 'auto'
|
1809 |
+
});
|
1810 |
+
}
|
1811 |
+
})
|
1812 |
+
);
|
1813 |
+
}
|
1814 |
+
}
|
1815 |
+
|
1816 |
+
// We always want the title bar as well
|
1817 |
+
this.dimensions.dataEffects.push(
|
1818 |
+
new Effect.Morph('lightwindow_title_bar_inner', {sync: true, style: {height: '0px', marginTop: this.options.dimensions.titleHeight+'px'}}),
|
1819 |
+
new Effect.Fade('lightwindow_title_bar_inner', {sync: true, from: 1.0, to: 0.0})
|
1820 |
+
);
|
1821 |
+
|
1822 |
+
new Effect.Parallel(this.dimensions.dataEffects, {
|
1823 |
+
duration: this.duration,
|
1824 |
+
afterFinish: function() {
|
1825 |
+
this._loadWindow();
|
1826 |
+
}.bind(this),
|
1827 |
+
queue: {position: 'end', scope: 'lightwindowAnimation'}
|
1828 |
+
}
|
1829 |
+
);
|
1830 |
+
},
|
1831 |
+
//
|
1832 |
+
// Default Form handler for LightWindow
|
1833 |
+
//
|
1834 |
+
_defaultFormHandler : function(e) {
|
1835 |
+
var element = Event.element(e).parentNode;
|
1836 |
+
var parameterString = Form.serialize(this._getParameter('lightwindow_form', element.getAttribute('params')));
|
1837 |
+
if (this.options.formMethod == 'post') {
|
1838 |
+
var newAJAX = new Ajax.Request(element.href, {
|
1839 |
+
method: 'post',
|
1840 |
+
postBody: parameterString,
|
1841 |
+
onComplete: this.openWindow.bind(this, element)
|
1842 |
+
});
|
1843 |
+
} else if (this.options.formMethod == 'get') {
|
1844 |
+
var newAJAX = new Ajax.Request(element.href, {
|
1845 |
+
method: 'get',
|
1846 |
+
parameters: parameterString,
|
1847 |
+
onComplete: this.openWindow.bind(this, element)
|
1848 |
+
});
|
1849 |
+
}
|
1850 |
+
},
|
1851 |
+
//
|
1852 |
+
// Wrap everything up
|
1853 |
+
//
|
1854 |
+
_finishWindow : function() {
|
1855 |
+
if (this.windowType == 'external') {
|
1856 |
+
// We set the externals source here because it allows for a much smoother animation
|
1857 |
+
$('lightwindow_iframe').setAttribute('src', this.element.href);
|
1858 |
+
this._handleFinalWindowAnimation(1);
|
1859 |
+
} else if (this.windowType == 'media') {
|
1860 |
+
|
1861 |
+
var outerObject = document.createElement('object');
|
1862 |
+
outerObject.setAttribute('classid', this.options.classids[this._fileExtension(this.contentToFetch)]);
|
1863 |
+
outerObject.setAttribute('codebase', this.options.codebases[this._fileExtension(this.contentToFetch)]);
|
1864 |
+
outerObject.setAttribute('id', 'lightwindow_media_primary');
|
1865 |
+
outerObject.setAttribute('name', 'lightwindow_media_primary');
|
1866 |
+
outerObject.setAttribute('width', this.resizeTo.width);
|
1867 |
+
outerObject.setAttribute('height', this.resizeTo.height);
|
1868 |
+
outerObject = this._addParamToObject('movie', this.contentToFetch, outerObject);
|
1869 |
+
outerObject = this._addParamToObject('src', this.contentToFetch, outerObject);
|
1870 |
+
outerObject = this._addParamToObject('controller', 'true', outerObject);
|
1871 |
+
outerObject = this._addParamToObject('wmode', 'transparent', outerObject);
|
1872 |
+
outerObject = this._addParamToObject('cache', 'false', outerObject);
|
1873 |
+
outerObject = this._addParamToObject('quality', 'high', outerObject);
|
1874 |
+
|
1875 |
+
if (!Prototype.Browser.IE) {
|
1876 |
+
var innerObject = document.createElement('object');
|
1877 |
+
innerObject.setAttribute('type', this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);
|
1878 |
+
innerObject.setAttribute('data', this.contentToFetch);
|
1879 |
+
innerObject.setAttribute('id', 'lightwindow_media_secondary');
|
1880 |
+
innerObject.setAttribute('name', 'lightwindow_media_secondary');
|
1881 |
+
innerObject.setAttribute('width', this.resizeTo.width);
|
1882 |
+
innerObject.setAttribute('height', this.resizeTo.height);
|
1883 |
+
innerObject = this._addParamToObject('controller', 'true', innerObject);
|
1884 |
+
innerObject = this._addParamToObject('wmode', 'transparent', innerObject);
|
1885 |
+
innerObject = this._addParamToObject('cache', 'false', innerObject);
|
1886 |
+
innerObject = this._addParamToObject('quality', 'high', innerObject);
|
1887 |
+
|
1888 |
+
outerObject.appendChild(innerObject);
|
1889 |
+
}
|
1890 |
+
|
1891 |
+
if (this._getParameter('lightwindow_iframe_embed')) {
|
1892 |
+
this._appendIframe('no');
|
1893 |
+
this._writeToIframe(this._convertToMarkup(outerObject, 'object'));
|
1894 |
+
} else {
|
1895 |
+
this._appendObject(outerObject, 'object', $('lightwindow_contents'));
|
1896 |
+
}
|
1897 |
+
|
1898 |
+
this._handleFinalWindowAnimation(0);
|
1899 |
+
} else {
|
1900 |
+
this._handleFinalWindowAnimation(0);
|
1901 |
+
}
|
1902 |
+
|
1903 |
+
// Initialize any actions
|
1904 |
+
this._setupActions();
|
1905 |
+
}
|
1906 |
+
}
|
1907 |
+
|
1908 |
+
/*-----------------------------------------------------------------------------------------------*/
|
1909 |
+
|
1910 |
+
Event.observe(window, 'load', lightwindowInit, false);
|
1911 |
+
|
1912 |
+
//
|
1913 |
+
// Set up all of our links
|
1914 |
+
//
|
1915 |
+
var myLightWindow = null;
|
1916 |
+
function lightwindowInit() {
|
1917 |
+
myLightWindow = new lightwindow();
|
1918 |
+
}
|