diff --git a/Examples/Ajax/MooToolsExample/.classpath b/Examples/Ajax/MooToolsExample/.classpath new file mode 100644 index 00000000000..ff18e5cf09c --- /dev/null +++ b/Examples/Ajax/MooToolsExample/.classpath @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Ajax/MooToolsExample/.project b/Examples/Ajax/MooToolsExample/.project new file mode 100644 index 00000000000..c76e8cf72ce --- /dev/null +++ b/Examples/Ajax/MooToolsExample/.project @@ -0,0 +1,23 @@ + + + MooToolsExample + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.objectstyle.wolips.incrementalbuilder + + + + + + org.eclipse.jdt.core.javanature + org.objectstyle.wolips.incrementalapplicationnature + + diff --git a/Examples/Ajax/MooToolsExample/.settings/org.eclipse.core.resources.prefs b/Examples/Ajax/MooToolsExample/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..a6a0fefecb6 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//Components=UTF-8 diff --git a/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.html b/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.html new file mode 100644 index 00000000000..0679d14ef06 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.html @@ -0,0 +1,6 @@ + +

Project Wonder's Ajax Framework with MooTools

+

The purpose of this framework is to replace the ProtoType/Scriptaculous javascript used in Wonder's Ajax Framework with the MooTools JavaScript library.

+

Please use the navigation to the left to see the current collection of components.

+

This code is available on Wonder's Github

+
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.wod b/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.wod new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.woo b/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/HomePage.wo/HomePage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.html new file mode 100644 index 00000000000..9494db748bb --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.html @@ -0,0 +1,74 @@ + + + +
+
+

Ajax Submit Button

+
+

+ This page tests submitting a form via an AjaxSubmitButton. +

+
+
+
+
+
+ +

The Highlight Form

+ + + +

The Slide In/Out Form

+ + + +

The Morph Form

+ + + +

The Spinner Form

+ + + +
+ +
+
+

Wife's Name

+ + + +

Kid's Name

+ + + +

Dog's Name

+ + + +

Cat's Name

+ + + +
+
+
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.wod new file mode 100644 index 00000000000..24f2d7793dc --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.wod @@ -0,0 +1,57 @@ +HighlighSubmitButton : MTAjaxSubmitButton { + action = updateNames; + afterEffect = "highlight"; + class = "btn btn-primary"; + updateContainerID = "WifeNameUpdateContainer"; + value = "Update Wife's Name"; +} + +HighlightAjaxUpdateContainer : MTAjaxUpdateContainer { + id = "WifeNameUpdateContainer"; +} + +MorphButton : MTAjaxSubmitButton { + action = updateNames; + class = "btn btn-primary"; + beforeEffect = "morph"; + beforeEffectStart = "darkened"; + effect = "morph"; + effectDuration = "long"; + effectStart = "plain"; + updateContainerID = "DogNameUpdateContainer"; + value = "Update Dog's Name"; +} + +MorphUpdateContainer : MTAjaxUpdateContainer { + id = "DogNameUpdateContainer"; +} + +SlideInOutButton : MTAjaxSubmitButton { + action = updateNames; + class = "btn btn-primary"; + beforeEffect = "slide"; + beforeEffectDuration = "long"; + beforeEffectProperty = "out"; + beforeEffectTransition = "Fx.Transitions.Bounce.easeOut"; + effect = "slide"; + effectDuration = "long"; + effectProperty = "in"; + updateContainerID = "KidNameUpdateContainer"; + value = "Update Kid's Name"; +} + +SlideInOutUpdateContainer : MTAjaxUpdateContainer { + id = "KidNameUpdateContainer"; +} + +SpinnerButton : MTAjaxSubmitButton { + action = updateNamesSlowly; + class = "btn btn-primary"; + useSpinner = true; + updateContainerID = "SpinnerContainer"; + value = "Update Cat's Name"; +} + +SpinnerUpdateContainer : MTAjaxUpdateContainer { + id = "SpinnerContainer"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTASBTestPage.wo/MTASBTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.html new file mode 100644 index 00000000000..13e37c92d5f --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.html @@ -0,0 +1,8 @@ + +

Ajax Update Container - Periodical Update Functionality

+
+

This demonstrates applying the frequency binding (4s) to the MTAjaxUpdateContainer

+ + + +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.wod new file mode 100644 index 00000000000..8463320e667 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.wod @@ -0,0 +1,6 @@ +MTAUC : MTAjaxUpdateContainer { + action = updateTime; + frequency = 4; + id = "MTPeriodicalUpdateContainer"; + onSuccess = "$('MTPeriodicalUpdateContainer').highlight();"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAUCPeriodicalTestPage.wo/MTAUCPeriodicalTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.html new file mode 100644 index 00000000000..3c70c1712bd --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.html @@ -0,0 +1,48 @@ + + + + +

Ajax Update Link - Various Examples of Ajax Update Link

+
+

These examples demonstrate AUL and the differences between Scriptaculous Effects and Various MooTools Fx

+

Check out the MooTools demo effects and documentation.

+ + + +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.wod new file mode 100644 index 00000000000..f61c8304c40 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.wod @@ -0,0 +1,90 @@ +ConfirmMTAUC : MTAjaxUpdateContainer { + id = "ConfirmMTAUC"; +} + +ConfirmMTAUL : MTAjaxUpdateLink { + action = updateTime; + effect = "highlight"; + updateContainerID = "ConfirmMTAUC"; + onClickBefore = "confirm('Update Time?')"; +} + +HighlighMTAUC : MTAjaxUpdateContainer { + id = "HighlightAUC"; +} + +HighlightMTAUL : MTAjaxUpdateLink { + action = updateTime; + effect = "highlight"; + updateContainerID = "HighlightAUC"; +} + +MorphMTAUC : MTAjaxUpdateContainer { + class = "redBackground"; + id = "MorphMTAUC"; + +} + +MorphMTAUL : MTAjaxUpdateLink { + action = updateTime; + beforeEffect = "morph"; + beforeEffectDuration = "long"; + beforeEffectStart = "greenBackground"; + effect = "morph"; + effectDuration = "long"; + effectStart = "redBackground"; + updateContainerID = "MorphMTAUC"; +} + +SimpleMTAUC : MTAjaxUpdateContainer { + id = "SimpleMTAUC"; +} + +SimpleMTAUL : MTAjaxUpdateLink { + action = updateTime; + updateContainerID = "SimpleMTAUC"; +} + +SlideMTAUC : MTAjaxUpdateContainer { + id = "SlideMTAUC"; +} + +SlideMTAUL : MTAjaxUpdateLink { + action = updateTime; + beforeEffect = "slide"; + beforeEffectDuration = "long"; + beforeEffectProperty = "out"; + effect = "slide"; + effectDuration = "long"; + effectProperty = "in"; + effectSlideMode = "horizontal"; + updateContainerID = "SlideMTAUC"; +} + +SpinnerMTAUC : MTAjaxUpdateContainer { + id = "SpinnerMTAUC"; +} + +SpinnerMTAUL : MTAjaxUpdateLink { + action = updateTimeSlow; + useSpinner = true; + spinnerTarget = "links"; + spinnerOptions = "{ containerPosition: { position: 'center', offset: { y: -100 } }}"; + updateContainerID = "SpinnerMTAUC"; +} + +TweenMTAUC : MTAjaxUpdateContainer { + id = "TweenMTAUC"; +} + +TweenMTAUL : MTAjaxUpdateLink { + action = updateTime; + beforeEffect = "tween"; + beforeEffectProperty = "opacity"; + beforeEffectStart = "1, 0"; + afterEffect = "tween"; + afterEffectDuration = "long"; + afterEffectProperty = "opacity"; + afterEffectStart = "1"; + updateContainerID = "TweenMTAUC"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAULTestPage.wo/MTAULTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.html new file mode 100644 index 00000000000..1c6eddba4bc --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.html @@ -0,0 +1,69 @@ + + + + + +

MooTools Accordion

+
+

+ A basic accordion. +

+ + +
+ Project WONDER is a collection of frameworks and tools for the WebObjects application server. It aims to fill some of the gaps + left in the packaged product, as well as add some useful and powerful utilities for WebObjects developers. Amongst a host of + other things, we provides a rich set of tools and additions for use in WebObjects and EOF and many extensions and enhancements + to WebObjects' DirectToWeb functionality. +

+ Project WONDER is a collection of frameworks and tools for the WebObjects application server. It aims to fill some of the gaps + left in the packaged product, as well as add some useful and powerful utilities for WebObjects developers. Amongst a host of + other things, we provides a rich set of tools and additions for use in WebObjects and EOF and many extensions and enhancements + to WebObjects' DirectToWeb functionality. +

+ Project WONDER is a collection of frameworks and tools for the WebObjects application server. It aims to fill some of the gaps + left in the packaged product, as well as add some useful and powerful utilities for WebObjects developers. Amongst a host of + other things, we provides a rich set of tools and additions for use in WebObjects and EOF and many extensions and enhancements + to WebObjects' DirectToWeb functionality. +

+ Project WONDER is a collection of frameworks and tools for the WebObjects application server. It aims to fill some of the gaps + left in the packaged product, as well as add some useful and powerful utilities for WebObjects developers. Amongst a host of + other things, we provides a rich set of tools and additions for use in WebObjects and EOF and many extensions and enhancements + to WebObjects' DirectToWeb functionality. +

+
+ + Project WONDER is a collection of frameworks and tools for the WebObjects application server. It aims to fill some of the gaps + left in the packaged product, as well as add some useful and powerful utilities for WebObjects developers. Amongst a host of + other things, we provides a rich set of tools and additions for use in WebObjects and EOF and many extensions and enhancements + to WebObjects' DirectToWeb functionality. + + + This is the third tab. + + + This is the fourth tab. + +
+ +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.wod new file mode 100644 index 00000000000..7de04ea4861 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.wod @@ -0,0 +1,23 @@ +Accordion : MTAccordionContainer { + fixedHeight = "200"; + onActive = "AccordionStateChange.onActive"; + onBackground = "AccordionStateChange.onBackground"; + elementClassName = "els"; + togglerClassName = "togs"; +} + +Tab1 : MTAccordionComponent { + label = "Tab 1"; +} + +Tab2 : MTAccordionComponent { + label = "Tab 2"; +} + +Tab3 : MTAccordionComponent { + label = "Tab 3"; +} + +Tab4 : MTAccordionComponent { + label = "Tab 4"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAccordionTestPage.wo/MTAccordionTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.html new file mode 100644 index 00000000000..34fa918d992 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.html @@ -0,0 +1,19 @@ + + +
+

Ajax Draggable - Drag & Drop Example.

+
+ +
+ + This is draggable #1, Item (I move around freely) + +
Drop Items Here
+
Drop Items Here
+
+ +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.wod new file mode 100644 index 00000000000..47643464962 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.wod @@ -0,0 +1,23 @@ +DraggableExample1 : MTAjaxDraggable { + class = "alert alert-success"; + droppables = ".droppable"; + draggableObject = o1; + droppedDraggableID = droppedDraggableID; + droppedObject = droppedObject; + droppedArea = droppedArea; + action = droppedDraggable1; + ghost = true; + updateContainerID = "statusMessage"; + elementName = "div"; + onDrop = "function(draggable, droppable) { droppable.removeClass('alert-error'); droppable.addClass('alert-info'); $('statusMessage').highlight(); } "; + onEnter = "function(draggable, droppable) { droppable.removeClass('alert-info'); droppable.addClass('alert-error'); } "; + onLeave = "function(draggable, droppable) { droppable.removeClass('alert-error'); droppable.addClass('alert-info'); } "; +} + +FirstItem : WOString { + value = o1; +} + +StatusMessage : MTAjaxUpdateContainer { + id = "statusMessage"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxDragDropTestPage.wo/MTAjaxDragDropTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.html new file mode 100644 index 00000000000..0eb75d39149 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.html @@ -0,0 +1,46 @@ + + + +

Various Modal Container Tests

+
+

Simple No Ajax Modal Container

+ +

Some Text Content

+
+
+

Modal container with internal href

+ +
+

Ajax Modal Container

+

See example. You may need to stylize the content like this to get your buttons and form elements placed nicely. See bindings autoWrapContent, showFooter, showTitle.

+ + + + +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.wod new file mode 100644 index 00000000000..a61315d4028 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.wod @@ -0,0 +1,47 @@ +ContentBox : MTAjaxModalContainer { + label = "Click me to Show"; + title = "Some Title"; +} + +InteralHrefBox : MTAjaxModalContainer { + href = "/"; + showFooter = false; + label = "Click me to show"; + showTitle = true; + title = "Loading from an Internal Href"; +} + +RepetitionBox: MTAjaxModalContainer { + ajax = true; + autoWrapContent = false; + id = wordID; + label = "edit"; + showFooter = false; + showTitle = false; + varName = wordID; +} + + +RepetitionWordName : WOString { + value = repetitionWord.name; +} + +WordsContainer : MTAjaxUpdateContainer { + id = "repetitionContainer"; +} + +WordsRepetition : WORepetition { + list = words; + item = repetitionWord; +} + +WordNameField : WOTextField { + value = repetitionWord.name; +} + +WordSubmitButton : MTAjaxSubmitButton { + class = "dismiss btn btn-primary"; + updateContainerID = "repetitionContainer"; + value = "Save"; +} + diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxModalContainerTestPage.wo/MTAjaxModalContainerTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.html new file mode 100644 index 00000000000..3e872d8d369 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.html @@ -0,0 +1,23 @@ + +

Ajax Observe Field - Dependent PopUp List Example

+
+

+ AjaxUpdateContainer has an optional 'observeFieldID' binding. You can set this binding to the id of the element to observe. When the element changes, + the observed value will be sent back to the server (as a "partial form submission"), and the AjaxUpdateContainer will be updated. This feature + requires that you use the ERExtensions framework (due to required changes to WOForm). With partial form submission, only the + observed field's value is submitted back to the server so that you can attempt to avoid validation failures that might occur + if the entire form was submitted. +

+
+ This can be used to create dependent PopUpButtons like in the following example: +
+ + + + + + + + + +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.wod new file mode 100644 index 00000000000..a6ae3b0486c --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.wod @@ -0,0 +1,33 @@ +ColorObserveField : MTAjaxObserveField { + observeFieldID = "PrimaryColorID"; + updateContainerID = "SecondaryColorDiv"; + fullSubmit = false; + useSpinner = true; + spinnerOptions = "{ containerPosition: { position: 'leftCenter' }}"; +} + +DependentListForm : WOForm { + action = doStuff; + multipleSubmit = true; +} + +PrimaryColorField : WOPopUpButton { + id = "PrimaryColorID"; + list = primaryColors; + item = primaryColor; + selection = selectedPrimaryColor; + noSelectionString = "No Color Selected"; +} + +SecondaryColorField : WOPopUpButton { + id = "SecondaryColors"; + list = secondaryColors; + item = secondaryColor; + selection = selectedSecondaryColor; + noSelectionString = "No secondary Color Selected"; +} + +SecondaryColorUpdateComponent : MTAjaxUpdateContainer { + id = "SecondaryColorDiv"; +} + diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxObserveFieldTestPage.wo/MTAjaxObserveFieldTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.html new file mode 100644 index 00000000000..294c65c1182 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.html @@ -0,0 +1,22 @@ + +

Sortable List Test

+
+

+ Port from the original. +

+ + +
+
+ +
+
+ + Stored order: +

+ +
+
+

+
+
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.wod new file mode 100644 index 00000000000..2e6588cd59e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.wod @@ -0,0 +1,28 @@ +ASB : MTAjaxSubmitButton { + action = saveChanges; + class = "btn btn-primary"; + updateContainerID = "UpdateContainer"; + spinnerOptions = "{ containerPosition: { position: 'leftCenter' }}"; + useSpinner = true; + value = "Update List" +} + +SortableListA : MTAjaxSortableList { + action = saveChanges; + clone = "true"; + id = "exampleListA"; + listClass = "unstyled"; + listElementName = "ul"; + listItemElementName = "li"; + list = listA; + item = repetitionListItemA; + listItemIDKeyPath = "id"; + opacity = "0.8"; + updateContainerID = "UpdateContainer"; + var = "MySortables"; +} + +ListItemNameA : WOImage { + class = "thumbnail"; + src = repetitionListItemA.url; +} diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxSortablesTestPage.wo/MTAjaxSortablesTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.html new file mode 100644 index 00000000000..14a8c0a1b6e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.html @@ -0,0 +1,53 @@ + + + +
+ + + This is tab # 1. + + + This is inline content on the same page as the panel and tabs are declared.
+ It does not refresh when the tab is selected:
+ +

+ Form Value A: +
+ + This is inline content on the same page as the panel and tabs are declared.
+ This tab refreshs when the tab is selected, the time will change:
+ +

+ Form Value B: +
+ + This tab is simply not visible and is not rendered in the HTML.
+ + + + +
+
+ +

The selected tab is saved in the session, so if you come back to this page, the last tab selected will be remembered. If you have the + Slow Loading Context tab selected and go away and come back, this page will load slowly.

+

The form values should be preserved across all tab changes and repeated clicking of save.

+ + +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.wod new file mode 100644 index 00000000000..62f3c6a107b --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.wod @@ -0,0 +1,59 @@ +Form: WOForm { + multipleSubmit = true; +} + +FormValueA: WOTextField { + value = formValueA; +} + +FormValueB: WOTextField { + value = formValueB; +} + +SubmitButton: WOSubmitButton { + action = save; + class = "btn"; + value = "Save"; +} + +TabbedPanel : MTAjaxTabbedPanel { + class = "nav nav-tabs"; + id = "tabbedPanel"; + busyDiv = "busyDiv"; + onLoad = "alert('Tabbed Panel onLoad event')"; +} + +Tab1 : MTAjaxTabbedPanelTab { + id = "panel1"; + name = "Slow Loading Content"; + isSelected = isSlowLoadingContentSelected; +} + +Tab2: MTAjaxTabbedPanelTab { + id = "panel2"; + name = "Inline Content"; + isSelected = isInlineContentSelected; +} + +Tab3: MTAjaxTabbedPanelTab { + id = "panel3"; + name = "Refreshing Content"; + isSelected = isRefreshingContentSelected; + refreshOnSelect = true; + onLoad = "alert('Refreshing Content tab onLoad event')"; +} + +Tab4: MTAjaxTabbedPanelTab { + name = "Invisible"; + isVisible = false; + isSelected = true; // or false, it does not have any effect +} + +CurrentTime: WOString { + value = now; +} + +BusyImage : WOImage { + framework = "Ajax"; + filename = "wait30.gif"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxTabbedPanelTestPage.wo/MTAjaxTabbedPanelTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.html b/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.html new file mode 100644 index 00000000000..6df444e2dee --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.html @@ -0,0 +1,45 @@ + + +

Test Ajax Tree

+
+

+ Port from the original. The only difference is that we use MT versions of AUL and AUC. +

+
+
+ +
+ two-line label +
+
+
+
+ + + +
+
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.wod b/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.wod new file mode 100644 index 00000000000..63bdf05e191 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.wod @@ -0,0 +1,18 @@ +AjaxTree : MTAjaxTree { + id = "exampleTree"; + class = "nav nav-list"; + root = rootTreeNode; + item = treeNode; + delegate = delegate; + rootExpanded = true; +} + +TreeNodeAction : MTAjaxUpdateLink { + action = nodeSelected; + string = treeNode.toString; //VALID + updateContainerID = "workarea"; +} + +Workarea : MTAjaxUpdateContainer { + id = "workarea"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.woo b/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTAjaxTreeExamplePage.wo/MTAjaxTreeExamplePage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.html new file mode 100644 index 00000000000..12ea7127e96 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.html @@ -0,0 +1,39 @@ + +

AjaxFileUpload

+
+ This AjaxFileUpload does not bind to anything, so its file is just immediately deleted. It allows all of the same binding options + as WOFileUpload. This demo has a maximum file upload size of 2M (change this in Properties if you want to try a local file upload). +

+


+

+ I changed the progress bar's HTML around a little bit to make it easier to style. + Instead of a table it now uses a layout like this: +

+			<div class = "value of binding progressBarContainerClass" >
+				<div class = "bar" style = "calculated width percentage"></div>
+			</div>
+		
+

+

There is also a new binding for "linkClass" that allows you to stylize the upload button

+
+ + +

+ + Your upload succeeded. + + + Your upload was canceled. + + + Your upload failed: + +

+
+
+

+

+ Here's a progress bar attached to a thread that is just incrementing the progress value. + +

+
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.wod new file mode 100644 index 00000000000..3351fc9e1e8 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.wod @@ -0,0 +1,41 @@ +FinishedImage : WOResourceURL { + filename = "img/progress-bar.gif"; +} + +UnfinishedImage : WOResourceURL { + filename = "img/progress-remainder.gif"; +} + +CanceledConditional : WOConditional { + condition = uploadProgress.canceled; +} + +FailedConditional : WOConditional { + condition = uploadProgress.failed; +} + +SucceededConditional : WOConditional { + condition = uploadProgress.succeeded; +} + +UploadDoneConditional : WOConditional { + condition = uploadProgress.done; +} + +AjaxFileUpload : MTAjaxFileUpload { + allowCancel = true; + formClass = "well form-inline"; + linkClass = "btn btn-warning"; + uploadProgress = uploadProgress; + finishedAction = uploadFinished; +} + +AjaxProgress : MTAjaxProgressBar { + progress = progress; + progressBarContainerClass = "progress progress-info progress-striped active"; + finishedFunction = "alert('Done!')"; +} + +FailureMessage : WOString { + value = uploadProgress.failure.message; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTFileUploadTestPage.wo/MTFileUploadTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.html new file mode 100644 index 00000000000..bfc645983ad --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.html @@ -0,0 +1,26 @@ + +

Date Picker Test

+

+ Original can be found here: http://www.monkeyphysics.com/mootools/script/2/datepicker + Nice thing about this one is you just set the dateformat like you would with a regular wotextfield. +

+

+ Warning I ported this script to MooTools 1.4. It should work but if you come across any issues please let me know. +

+
+
+
+ +
+ +
+ +
+
+

Selected Date

+ + + +
+
+
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.wod new file mode 100644 index 00000000000..136bedc654e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.wod @@ -0,0 +1,27 @@ +ASB : MTAjaxSubmitButton { + action = updateTime; + class = "btn btn-primary"; + beforeEffect = "slide"; + beforeEffectDuration = "long"; + beforeEffectProperty = "out"; + beforeEffectTransition = "Fx.Transitions.Bounce.easeOut"; + effect = "slide"; + effectDuration = "long"; + effectProperty = "in"; + updateContainerID = "AUC"; + value = "Update Time"; +} + +AUC : MTAjaxUpdateContainer { + id = "AUC"; +} + +DatePicker : MTJSDatePicker { + dateformat = "%Y-%m-%d"; + pickerClass = "datepicker_dashboard"; + onClose = "function() {console.log('close'); }"; + onSelect = "function() {console.log('select'); }"; + onShow = "function() {console.log('show');}"; + useDefaultCSS = "false"; + value = today; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTJSDatePickerTestPage.wo/MTJSDatePickerTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.html b/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.html new file mode 100644 index 00000000000..f1eb4b54b46 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.html @@ -0,0 +1,41 @@ + + + + +

JavaScript Slider Example

+
+
+
+ +
+
+ + +
+
+ + +
\ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.wod b/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.wod new file mode 100644 index 00000000000..0252ff8291e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.wod @@ -0,0 +1,11 @@ +Slider : MTJSSlider { + elementClass = "element"; + knobClass = "knob"; + id = "slider"; + mode = "vertical"; + observer = "SliderValue"; + onChange = "function(pos) { $('SliderValue').value = pos; }"; + range = "[1, 50]"; + value = sliderValue; + wheel = true; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.woo b/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/MTJSSliderTestPage.wo/MTJSSliderTestPage.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/Main.api b/Examples/Ajax/MooToolsExample/Components/Main.api new file mode 100644 index 00000000000..12535ad8d04 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/Main.api @@ -0,0 +1,5 @@ + + + + + diff --git a/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.html b/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.html new file mode 100644 index 00000000000..38ac5dd0976 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.html @@ -0,0 +1,77 @@ + + + + <wo name = "PageTitle" /> + + + + +
+
+
+ +
+
+ +
+
+
+ + diff --git a/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.wod b/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.wod new file mode 100644 index 00000000000..b2870e09935 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.wod @@ -0,0 +1,3 @@ +PageTitle : WOString { + value = pageTitle; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.woo b/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.woo new file mode 100644 index 00000000000..1f6e847c167 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Components/Main.wo/Main.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Resources/Properties b/Examples/Ajax/MooToolsExample/Resources/Properties new file mode 100644 index 00000000000..7fac8817a35 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Resources/Properties @@ -0,0 +1,68 @@ +# OGNL +ognl.helperFunctions=true +ognl.inlineBindings=true + +# Misc +er.extensions.stackTrace.cleanup=true + +# EOF +er.extensions.ERXEC.safeLocking=true +er.extensions.ERXEC.useSharedEditingContext=false +er.extensions.ERXEnterpriseObject.applyRestrictingQualifierOnInsert=true +er.extensions.ERXEnterpriseObject.updateInverseRelationships=true +#dbConnectURLGLOBAL= +#dbConnectUserGLOBAL= +#dbConnectPasswordGLOBAL= + +# Migrations +#er.migration.migrateAtStartup=true +#er.migration.createTablesIfNecessary=true +#er.migration.modelNames=YourModel + +# Misc Components +#er.extensions.ERXWOForm.multipleSubmitDefault=true +#er.extensions.ERXWORepetition.checkHashCodes=true +#er.extensions.ERXWORepetition.raiseOnUnmatchedObject=true +#er.extensions.ERXWORepetition.eoSupport=true +#er.component.clickToOpen=true +#wolips.password=wo + +# ERJavaMail +er.javamail.centralize=true +er.javamail.adminEmail=admin@yourhost.com +er.javamail.debugEnabled=false +er.javamail.smtpHost=your.smtpserver.com +er.javamail.smtpAuth=false +er.javamail.smtpUser= +er.javamail.smtpPassword= + +# Log4j Configuration +log4j.loggerFactory=er.extensions.logging.ERXLogger$Factory +log4j.rootCategory=INFO,A1 +log4j.appender.A1=er.extensions.logging.ERXConsoleAppender +log4j.appender.A1.layout=er.extensions.logging.ERXPatternLayout +log4j.appender.A1.layout.ConversionPattern=%d{MMM dd HH:mm:ss} %$[%#] %-5p %c %x - %m%n + +# Log4j Categories +# Here are a few log4j sub-categories that are interesting. +# Don't forget that in developement mode this file will get reloaded +# everytime it changes, so if you say want to turn adaptor debugging +# on in the middle of the app simply set the below category to debug. +# Very handy. +# Base Category +log4j.logger.er=INFO + +# ERExtensions +# Transaction - Switching this to debug will start the sql ouputting. +log4j.logger.er.transaction.adaptor.EOAdaptorDebugEnabled=DEBUG + +# Fixes - Turning this on will show all the models that are loaded +log4j.logger.er.extensions.fixes.ERSharedEOLoader=INFO + +er.extensions.ERXNSLogLog4jBridge=INFO +#log4j.logger.er.eo.ERXGenericRecord=DEBUG +#log4j.logger.er.validation.ERXEntityClassDescription=DEBUG +#log4j.logger.er.default.ERXEntityClassDescription=DEBUG +log4j.logger.er.extensions.ERXDatabaseContextDelegate=WARN +log4j.logger.er.extensions.ERXConfigurationManager=INFO +#log4j.logger.er.extensions.ERXApplication.RequestHandling=DEBUG diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/Application.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/Application.java new file mode 100644 index 00000000000..67fae999d77 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/Application.java @@ -0,0 +1,16 @@ +package er.ajax.mootools.example.app; + +import er.extensions.appserver.ERXApplication; + +public class Application extends ERXApplication { + public static void main(String[] argv) { + ERXApplication.main(argv, Application.class); + } + + public Application() { + ERXApplication.log.info("Welcome to " + name() + " !"); + /* ** put your initialization code in here ** */ + setAllowsConcurrentRequestHandling(true); + setDefaultRequestHandler(requestHandlerForKey(directActionRequestHandlerKey())); + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/DirectAction.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/DirectAction.java new file mode 100644 index 00000000000..2a3fa66f2a0 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/DirectAction.java @@ -0,0 +1,19 @@ +package er.ajax.mootools.example.app; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WORequest; + +import er.ajax.mootools.example.components.HomePage; +import er.extensions.appserver.ERXDirectAction; + + +public class DirectAction extends ERXDirectAction { + public DirectAction(WORequest request) { + super(request); + } + + @Override + public WOActionResults defaultAction() { + return pageWithName(HomePage.class); + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/PageAction.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/PageAction.java new file mode 100644 index 00000000000..7f13deb1a64 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/PageAction.java @@ -0,0 +1,19 @@ +package er.ajax.mootools.example.app; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WORequest; + +import er.extensions.appserver.ERXDirectAction; + +public class PageAction extends ERXDirectAction { + + public PageAction(WORequest request) { + super(request); + } + + @Override + public WOActionResults performActionNamed(String actionName) { + return pageWithName(actionName); + } + +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/Session.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/Session.java new file mode 100644 index 00000000000..85cdc537b9e --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/app/Session.java @@ -0,0 +1,11 @@ +package er.ajax.mootools.example.app; + +import er.extensions.appserver.ERXSession; + +public class Session extends ERXSession { + private static final long serialVersionUID = 1L; + + public String selectedTab = "InlineContent"; + public Session() { + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Comment.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Comment.java new file mode 100644 index 00000000000..e0bed1ef07d --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Comment.java @@ -0,0 +1,16 @@ +package er.ajax.mootools.example.components; + +public class Comment { + private String _text; + + public Comment() { + } + + public void setText(String text) { + _text = text; + } + + public String text() { + return _text; + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Company.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Company.java new file mode 100644 index 00000000000..255d8f28c17 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Company.java @@ -0,0 +1,7 @@ +package er.ajax.mootools.example.components; + +import org.apache.log4j.Logger; + +public class Company extends _Company { + private static Logger log = Logger.getLogger(Company.class); +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/ComplexPerson.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/ComplexPerson.java new file mode 100644 index 00000000000..14a1fc1075d --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/ComplexPerson.java @@ -0,0 +1,63 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.foundation.NSArray; +import com.webobjects.foundation.NSMutableArray; + +public class ComplexPerson extends SimplePerson { + + private ComplexPerson _spouse; + private NSMutableArray _children = new NSMutableArray(); + + public ComplexPerson(String name, int age) { + super(name, age); + } + + public ComplexPerson() { + } + + public boolean simpleEquals(ComplexPerson person) { + return super.equals(person); + } + + @Override + public boolean equals(Object obj) { + boolean equals = (obj instanceof ComplexPerson); + if (equals) { + ComplexPerson other = (ComplexPerson)obj; + equals = simpleEquals(other); + if (equals) { + if (_spouse == null) { + equals = (other._spouse == null); + } + else { + equals = _spouse.simpleEquals(other._spouse); + } + } + if (equals) { + equals = (_children.count() == other._children.count()); + } + if (equals) { + for (int i = 0; i < _children.count(); i ++) { + equals &= _children.objectAtIndex(i).simpleEquals(other._children.objectAtIndex(i)); + } + } + } + return equals; + } + + public ComplexPerson getSpouse() { + return _spouse; + } + + public void setSpouse(ComplexPerson spouse) { + _spouse = spouse; + } + + public NSArray getChildren() { + return _children; + } + + public void setChildren(NSArray children) { + _children = children != null ? children.mutableClone() : null; + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Employee.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Employee.java new file mode 100644 index 00000000000..9503e5fbb56 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Employee.java @@ -0,0 +1,7 @@ +package er.ajax.mootools.example.components; + +import org.apache.log4j.Logger; + +public class Employee extends _Employee { + private static Logger log = Logger.getLogger(Employee.class); +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/ExampleDataFactory.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/ExampleDataFactory.java new file mode 100644 index 00000000000..09a86bea64d --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/ExampleDataFactory.java @@ -0,0 +1,139 @@ +package er.ajax.mootools.example.components; + +import java.io.File; +import java.io.IOException; +import java.util.Random; + +import com.webobjects.eocontrol.EOEditingContext; +import com.webobjects.eocontrol.EOSortOrdering; +import com.webobjects.foundation.NSArray; +import com.webobjects.foundation.NSMutableArray; + +import er.extensions.components.ERXLoremIpsumGenerator; +import er.extensions.foundation.ERXFileUtilities; + +public class ExampleDataFactory { + + private static NSMutableArray _exampleData; + + public static NSMutableArray randomWords(int count) { + NSMutableArray words = new NSMutableArray(); + Random rand = new Random(); + for (int i = 0; i < count; i++) { + String s = ""; + int max = 6 + rand.nextInt(6); + for (int j = 0; j < max; j++) { + int c = rand.nextInt(26); + s += Character.toString((char) ('A' + c)); + } + Word example = new Word(s); + words.addObject(example); + } + return words; + } + + public static synchronized NSArray someWords(int count) { + NSArray allWords = allWords(); + NSMutableArray someWords = new NSMutableArray(); + for (int i = 0; i < count; i ++) { + someWords.addObject(allWords.objectAtIndex((int)(Math.random() * allWords.count()))); + } + return someWords; + } + + public static synchronized NSArray allWords() { + // some sample data. if we don't find the file, just create random strings + if (_exampleData == null) { + _exampleData = new NSMutableArray(); + File f = new File("/usr/share/dict/words"); + if (f.exists()) { + try { + String words = ERXFileUtilities.stringFromFile(f); + String splitWords[] = words.split("\\n"); + for (int i = 0; i < splitWords.length; i++) { + String word = splitWords[i]; + // we don't want all words, that just takes too long + if (word.length() > 0 && ((i % 20) == 0)) { + Word example = new Word(word); + _exampleData.addObject(example); + } + } + } + catch (IOException e) { + System.out.println("ExampleUtils.exampleValues: Can't read " + f + ": " + e); + } + } + if (_exampleData.count() == 0) { + _exampleData.addObjectsFromArray(ExampleDataFactory.randomWords(1000)); + } + EOSortOrdering.sortArrayUsingKeyOrderArray(_exampleData, new NSArray(EOSortOrdering.sortOrderingWithKey("name", EOSortOrdering.CompareAscending))); + + } + return _exampleData.immutableClone(); + } + + public static NSMutableArray products(int count) { + NSMutableArray products = new NSMutableArray(); + for (int i = 0; i < count; i++) { + String title = ERXLoremIpsumGenerator.words(1, 5); + String summary = ERXLoremIpsumGenerator.paragraph(); + Product product = new Product(title, summary); + products.addObject(product); + } + return products; + } + + public static NSMutableArray family() { + NSMutableArray people = new NSMutableArray(); + ComplexPerson mike = new ComplexPerson("Mike", 29); + ComplexPerson kirsten = new ComplexPerson("Kirsten", 29); + ComplexPerson andrew = new ComplexPerson("Andrew", 2); + mike.setSpouse(kirsten); + kirsten.setSpouse(mike); + mike.setChildren(new NSArray(andrew)); + kirsten.setChildren(new NSArray(andrew)); + people.add(mike); + people.add(kirsten); + people.add(andrew); + return people; + } + + public static NSArray companies(EOEditingContext editingContext) { + NSArray companies = Company.fetchAllCompanies(editingContext); + if (companies.count() == 0) { + Company.createCompany(editingContext, "Company 1"); + Company.createCompany(editingContext, "Company 2"); + Company.createCompany(editingContext, "Company 3"); + Company.createCompany(editingContext, "Company 4"); + editingContext.saveChanges(); + companies = Company.fetchAllCompanies(editingContext); + } + return companies; + } + + public static NSMutableArray comments(int count) { + NSMutableArray comments = new NSMutableArray(); + for (int i = 1; i < count; i++) { + Comment comment = new Comment(); + comment.setText("This is comment #" + i); + comments.addObject(comment); + } + return comments; + } + + public static NSMutableArray values(String prefix, int count) { + NSMutableArray values = new NSMutableArray(); + for (int i = 0; i < count; i++) { + values.addObject(prefix + i); + } + return values; + } + + public static NSMutableArray items(String idSuffix, String prefix, int count) { + NSMutableArray items = new NSMutableArray(); + for (int i = 0; i < count; i++) { + items.addObject(new Item(String.valueOf(i) + idSuffix, prefix + i)); + } + return items; + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/HomePage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/HomePage.java new file mode 100644 index 00000000000..219abf4bae9 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/HomePage.java @@ -0,0 +1,13 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOContext; + +public class HomePage extends Main { + public HomePage(WOContext context) { + super(context); + } + + public String pageTitle() { + return "MooTools meets Project Wonder's Ajax Framework version 3"; + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/InfiniteTreeNode.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/InfiniteTreeNode.java new file mode 100644 index 00000000000..43dbd96d471 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/InfiniteTreeNode.java @@ -0,0 +1,58 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.foundation.NSArray; +import com.webobjects.foundation.NSMutableArray; + +import er.ajax.AjaxTreeModel; + +public class InfiniteTreeNode { + private Object _parentTreeNode; + private NSMutableArray _children; + private String _name; + private int _depth; + + public InfiniteTreeNode(Object parentTreeNode, String name, int depth) { + _parentTreeNode = parentTreeNode; + _name = name; + _depth = depth; + } + + public synchronized NSArray childrenTreeNodes() { + if (_children == null && _depth < 2) { + _children = new NSMutableArray(); + for (int i = 0; i < 5; i++) { + _children.addObject(new InfiniteTreeNode(this, _name + " Child " + i, _depth + 1)); + } + } + return _children; + } + + public Object parentTreeNode() { + return _parentTreeNode; + } + + @Override + public String toString() { + return _name; + } + + public static class Delegate implements AjaxTreeModel.Delegate { + public NSArray childrenTreeNodes(Object node) { + InfiniteTreeNode treeNode = (InfiniteTreeNode) node; + return treeNode.childrenTreeNodes(); + } + + public boolean isLeaf(Object node) { + InfiniteTreeNode treeNode = (InfiniteTreeNode) node; + return treeNode.childrenTreeNodes() == null; + } + + public Object parentTreeNode(Object node) { + InfiniteTreeNode treeNode = (InfiniteTreeNode) node; + if (treeNode == null) { + return null; + } + return treeNode.parentTreeNode(); + } + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Item.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Item.java new file mode 100644 index 00000000000..facbed25a6f --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Item.java @@ -0,0 +1,24 @@ +package er.ajax.mootools.example.components; + +public class Item { + private String _id; + private String _name; + + public Item(String id, String name) { + _id = id; + _name = name; + } + + public String name() { + return _name; + } + + public String id() { + return _id; + } + + @Override +public String toString() { + return "[Item: id = " + _id + "]"; + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTASBTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTASBTestPage.java new file mode 100644 index 00000000000..a9441a09818 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTASBTestPage.java @@ -0,0 +1,33 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; + +public class MTASBTestPage extends Main { + + public String _wifeName = "Honey"; + public String _kidName = "Gisele"; + public String _dogName = "Astro Nut"; + public String _catName = "Brazil Nut"; + + public MTASBTestPage(WOContext context) { + super(context); + } + + + public WOComponent updateNames() { + return null; + } + + public WOComponent updateNamesSlowly() { + + setTask(new Task()); + task().start(); + do { + System.out.println(task().getStatus()); + } while(! task().getStatus().equals("Finished")); + + return null; + } + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAUCPeriodicalTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAUCPeriodicalTestPage.java new file mode 100644 index 00000000000..0092e64ff86 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAUCPeriodicalTestPage.java @@ -0,0 +1,29 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSTimestamp; + +public class MTAUCPeriodicalTestPage extends Main { + + public NSTimestamp _now; + + public MTAUCPeriodicalTestPage(WOContext context) { + super(context); + _updateTime(); + } + + private void _updateTime() { + _now = new NSTimestamp(); + } + + public WOActionResults updateTime() { + _updateTime(); + return null; + } + + public String pageTitle() { + return "This demonstrates applying the frequency binding (4s) to the MTAjaxUpdateContainer"; + } + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAULTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAULTestPage.java new file mode 100644 index 00000000000..abf855606a9 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAULTestPage.java @@ -0,0 +1,34 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSTimestamp; + +public class MTAULTestPage extends Main { + + public NSTimestamp _now; + + public MTAULTestPage(WOContext context) { + super(context); + _updateTime(); + } + + public void _updateTime() { + _now = new NSTimestamp(); + } + + public WOActionResults updateTime() { + _updateTime(); + return null; + } + + public WOActionResults updateTimeSlow() { + setTask(new Task()); + task().start(); + do { + System.out.println(task().getStatus()); + } while(! task().getStatus().equals("Finished")); + return updateTime(); + } + +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAccordionTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAccordionTestPage.java new file mode 100644 index 00000000000..88083cbaa86 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAccordionTestPage.java @@ -0,0 +1,9 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOContext; + +public class MTAccordionTestPage extends Main { + public MTAccordionTestPage(WOContext context) { + super(context); + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxDragDropTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxDragDropTestPage.java new file mode 100644 index 00000000000..fbbce6b9a8f --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxDragDropTestPage.java @@ -0,0 +1,52 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSMutableArray; + +public class MTAjaxDragDropTestPage extends Main { + + public Object o1 = "Object 0"; + public String droppedDraggableID; + public String droppedArea; + public NSMutableArray objects = new NSMutableArray(); + public Object item; + public Object droppedObject; + + public String statusMessage; + + public MTAjaxDragDropTestPage(WOContext context) { + super(context); + for (int i = 1; i < 10; i++) { + objects.addObject("Object " + i); + } + statusMessage = "Drag one of the green draggable items onto one of the blue droppable items."; + } + + + public String draggableExample2() { + String id = "draggableExample_" + context().elementID().replace('.', '_'); + return id; + } + + public WOActionResults droppedDraggable1() { + statusMessage = "DragAndDropExample.droppedDraggableID: draggable ID '" + droppedObject + + "' dropped onto : " + droppedArea; + /* + setTask(new Task()); + task().start(); + do { + System.out.println(task().getStatus()); + } while(! task().getStatus().equals("Finished")); + */ + return null; + } + + public WOActionResults droppedDraggable2() { + System.out.println("DragAndDropExample.droppedDraggableID: draggable ID '" + droppedDraggableID + + "' dropped onto 2: " + droppedObject); + System.out.println("DragAndDropExample.droppedDraggable2: draggable object = " + droppedObject); + return null; + } + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxModalContainerTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxModalContainerTestPage.java new file mode 100644 index 00000000000..ffa4eec84da --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxModalContainerTestPage.java @@ -0,0 +1,26 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSArray; + +import er.extensions.foundation.ERXStringUtilities; + +public class MTAjaxModalContainerTestPage extends Main { + + public NSArray _words; + public Word _repetitionWord; + + public MTAjaxModalContainerTestPage(WOContext context) { + super(context); + _words = ExampleDataFactory.randomWords(10); + } + + public String wordID() { + return ERXStringUtilities.safeIdentifierName(String.valueOf(_words.indexOf(_repetitionWord))); + } + + public String onSuccessFunction() { + return wordID() + ".hide().destroy();"; + } + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxObserveFieldTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxObserveFieldTestPage.java new file mode 100644 index 00000000000..8d2f62dd0d0 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxObserveFieldTestPage.java @@ -0,0 +1,53 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSArray; + +public class MTAjaxObserveFieldTestPage extends Main { + + public String primaryColor, selectedPrimaryColor, secondaryColor, selectedSecondaryColor; + private NSArray _secondaryColors; + + public MTAjaxObserveFieldTestPage(WOContext context) { + super(context); + } + + public WOActionResults doStuff() { + wasteTime(); + return null; + } + + public NSArray primaryColors() { + return new NSArray(new String[] { + "Red", "Yellow", "Green" + }); + } + + public NSArray secondaryColors() { + + int index = selectedPrimaryColor != null ? primaryColors().indexOf(selectedPrimaryColor) : -1; + switch (index) { + case 0: + setSecondaryColors(new NSArray(new String[] { "light red", "red", "dark red"})); + break; + case 1: + setSecondaryColors(new NSArray(new String[] { "light yellow", "yellow", "dark yellow" })); + break; + case 2: + setSecondaryColors(new NSArray(new String[] { "light green", "green", "dark green" })); + break; + default: + _secondaryColors = null; + } + + return _secondaryColors; + + } + + public void setSecondaryColors(NSArray secondaryColors) { + wasteTime(); + _secondaryColors = secondaryColors; + } + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxSortablesTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxSortablesTestPage.java new file mode 100644 index 00000000000..64349252959 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxSortablesTestPage.java @@ -0,0 +1,67 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOResourceManager; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +public class MTAjaxSortablesTestPage extends Main { + + private NSMutableArray> _listA; + + public MTAjaxSortablesTestPage(WOContext context) { + super(context); + _listA = new NSMutableArray>(); + NSMutableDictionary red = new NSMutableDictionary(); + red.takeValueForKey(redSquareSrc(), "url"); + red.takeValueForKey("Red", "title"); + red.takeValueForKey(1, "id"); + _listA.addObject(red); + NSMutableDictionary yellow = new NSMutableDictionary(); + yellow.takeValueForKey(yellowSquareSrc(), "url"); + yellow.takeValueForKey("Yellow", "title"); + yellow.takeValueForKey(2, "id"); + _listA.addObject(yellow); + NSMutableDictionary green = new NSMutableDictionary(); + green.takeValueForKey(greenSquareSrc(), "url"); + green.takeValueForKey("Green", "title"); + green.takeValueForKey(3, "id"); + _listA.addObject(green); + + } + + + public String redSquareSrc() { + WOResourceManager rm = application().resourceManager(); + return rm.urlForResourceNamed("img/Red_Thumb.png", "app", null, context().request()); + } + + public String yellowSquareSrc() { + WOResourceManager rm = application().resourceManager(); + return rm.urlForResourceNamed("img/Yellow_Thumb.png", "app", null, context().request()); + } + + public String greenSquareSrc() { + WOResourceManager rm = application().resourceManager(); + return rm.urlForResourceNamed("img/Green_Thumb.png", "app", null, context().request()); + } + + public NSMutableArray> listA() { + return _listA; + } + + public WOActionResults orderChanged() { + System.out.println("Hello?"); + return null; + } + + public NSDictionary repetitionListItemA; + + public WOActionResults saveChanges() { + return null; + } + + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxTabbedPanelTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxTabbedPanelTestPage.java new file mode 100644 index 00000000000..aaf3122853b --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxTabbedPanelTestPage.java @@ -0,0 +1,59 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSTimestamp; + +import er.ajax.mootools.example.app.Session; + +public class MTAjaxTabbedPanelTestPage extends Main { + + public String formValueA; + public String formValueB; + public String formValueC; + + public MTAjaxTabbedPanelTestPage(WOContext context) { + super(context); + } + + public boolean isSlowLoadingContentSelected() { + System.out.println(theSession().selectedTab); + return "SlowLoadingContent".equals(theSession().selectedTab); + } + + public void setIsSlowLoadingContentSelected(boolean isSelected) { + if (isSelected) theSession().selectedTab = "SlowLoadingContent"; + } + + public boolean isInlineContentSelected() { + return "InlineContent".equals(theSession().selectedTab); + } + + public void setIsInlineContentSelected(boolean isSelected) { + if (isSelected) theSession().selectedTab = "InlineContent"; + } + + public boolean isRefreshingContentSelected() { + return "RefreshingContent".equals(theSession().selectedTab); + } + + public void setIsRefreshingContentSelected(boolean isSelected) { + if (isSelected) theSession().selectedTab = "RefreshingContent"; + } + + public Session theSession() { + return (Session)session(); + } + + public NSTimestamp now() { + return new NSTimestamp(); + } + + public WOComponent save() { + System.out.println("formValueA " + formValueA); + System.out.println("formValueB " + formValueB); + System.out.println("formValueB " + formValueC); + return context().page(); + } + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxTreeExamplePage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxTreeExamplePage.java new file mode 100644 index 00000000000..dddeef8d7c7 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTAjaxTreeExamplePage.java @@ -0,0 +1,41 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; + +public class MTAjaxTreeExamplePage extends Main { + + public Object _rootTreeNode; + public Object _rootTreeNode2; + private Object _treeNode; + private Object _delegate; + public String selectedNode; + + public MTAjaxTreeExamplePage(WOContext context) { + super(context); + _rootTreeNode = new InfiniteTreeNode(null, "Root", 0); + _rootTreeNode2 = new InfiniteTreeNode(null, "Root2", 0); + } + + public void setTreeNode(Object treeNode) { + _treeNode = treeNode; + } + + public Object getTreeNode() { + return _treeNode; + } + + public WOActionResults nodeSelected() { + selectedNode = _treeNode.toString(); + System.out.println("AjaxTreeExample.nodeSelected: selected " + _treeNode); + return null; + } + + public Object delegate() { + if (_delegate == null) { + _delegate = new InfiniteTreeNode.Delegate(); + } + return _delegate; + + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTFileUploadTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTFileUploadTestPage.java new file mode 100644 index 00000000000..ea0ea07072d --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTFileUploadTestPage.java @@ -0,0 +1,52 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.foundation.NSData; + +import er.ajax.AjaxProgress; +import er.ajax.AjaxUploadProgress; + +public class MTFileUploadTestPage extends Main { + + public NSData _data; + public AjaxUploadProgress _uploadProgress; + public AjaxProgress _progress; + + public MTFileUploadTestPage(WOContext context) { + super(context); + _progress = new AjaxProgress(100); + Thread progressThread = new Thread(new Runnable() { + + public void run() { + // TODO Auto-generated method stub + for(int i = 0; i < _progress.maximum(); i++) { + _progress.setValue(i); + _progress.setStatus("Performing operation #" + i + " ..."); + try { + Thread.sleep(100); + } catch (Throwable t) { + + } + } + _progress.setDone(true); + } + + }); + + progressThread.start(); + + } + + public long now() { + return System.currentTimeMillis(); + } + + public WOActionResults uploadFinished() { + System.out.println("FileUploadExample.uploadFinished: FINISHED!"); + if (_data != null) { + System.out.println("FileUploadExample.uploadFinished: Data Size = " + _data.length()); + } + return null; + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTJSDatePickerTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTJSDatePickerTestPage.java new file mode 100644 index 00000000000..db2449e7ac1 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTJSDatePickerTestPage.java @@ -0,0 +1,33 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSTimestamp; + +import er.ajax.mootools.MTAjaxUtils; + +public class MTJSDatePickerTestPage extends Main { + + public NSTimestamp _today; + + public MTJSDatePickerTestPage(WOContext context) { + super(context); + _updateTime(); + } + + public void appendToResponse(WOResponse response, WOContext context) { + super.appendToResponse(response, context); + MTAjaxUtils.addStylesheetResourceInHead(context, response, "app", "datepicker_dashboard/datepicker_dashboard.css"); + } + + private void _updateTime() { + _today = new NSTimestamp(); + } + + public WOActionResults updateTime() { + return null; + } + + +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTJSSliderTestPage.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTJSSliderTestPage.java new file mode 100644 index 00000000000..b34de074042 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/MTJSSliderTestPage.java @@ -0,0 +1,25 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOContext; + +public class MTJSSliderTestPage extends Main { + private int sliderValue; + + public MTJSSliderTestPage(WOContext context) { + super(context); + } + + /** + * @return the sliderValue + */ + public int sliderValue() { + return sliderValue; + } + + /** + * @param sliderValue the sliderValue to set + */ + public void setSliderValue(int sliderValue) { + this.sliderValue = sliderValue; + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Main.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Main.java new file mode 100644 index 00000000000..cf9348ab14d --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Main.java @@ -0,0 +1,62 @@ +package er.ajax.mootools.example.components; + +import com.webobjects.appserver.WOContext; + +import er.extensions.components.ERXComponent; + +public class Main extends ERXComponent { + + public String _pageTitle; + private Task _task; + + public Main(WOContext context) { + super(context); + } + + public void setTask(Task task) { + this._task = task; + } + + public Task task() { + return _task; + } + + public static class Task extends Thread { + int stage = 0; + String status = "Idle"; + + @Override + public void run() { + + try { + setStatus("Starting up"); + while (stage < 3) { + sleep(1000); + stage++; + setStatus("Currently at stage: " + stage); + } + setStatus("Finished"); + } + catch (InterruptedException e) { + status = "Interrupted"; + } + } + + private void setStatus(String value) { + status = value; + } + + public String getStatus() { + return status; + } + } + + public void wasteTime() { + setTask(new Task()); + task().start(); + do { + System.out.println(task().getStatus()); + } while(! task().getStatus().equals("Finished")); + } + +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Product.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Product.java new file mode 100644 index 00000000000..23cda40fbaa --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Product.java @@ -0,0 +1,28 @@ +package er.ajax.mootools.example.components; +public class Product { + private String _title; + private String _summary; + + public Product(String title, String summary) { + _title = title; + _summary = summary; + } + + public String title() { + return _title; + } + + public String summary() { + return _summary; + } + + public String partialSummary() { + int length = Math.min(30, _summary.length()); + return _summary.substring(0, 30) + " ..."; + } + + @Override + public String toString() { + return "[Product: " + _title + "]"; + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/SimplePerson.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/SimplePerson.java new file mode 100644 index 00000000000..6a618b1e5f1 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/SimplePerson.java @@ -0,0 +1,41 @@ +package er.ajax.mootools.example.components; + +public class SimplePerson { + private String _name; + private int _age; + + public SimplePerson(String name, int age) { + _name = name; + _age = age; + } + + public SimplePerson() { + + } + + public String getName() { + return _name; + } + + public void setName(String name) { + _name = name; + } + + public int getAge() { + return _age; + } + + public void setAge(int age) { + _age = age; + } + + @Override + public int hashCode() { + return _name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof SimplePerson && ((SimplePerson)obj)._name.equals(_name); + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Word.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Word.java new file mode 100644 index 00000000000..b5ba9b7549a --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/Word.java @@ -0,0 +1,20 @@ +package er.ajax.mootools.example.components; + +/** + * Just some example data. + */ + +public class Word { + public String name; + public int value; + + public Word(String name) { + this.name = name; + this.value = name.length(); + } + + @Override + public String toString() { + return "<" + name + ": " + value + ">"; + } +} \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/_Company.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/_Company.java new file mode 100644 index 00000000000..2560b8f5cfa --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/_Company.java @@ -0,0 +1,215 @@ +// $LastChangedRevision: 4733 $ DO NOT EDIT. Make changes to Company.java instead. +package er.ajax.mootools.example.components; + +import java.util.Enumeration; +import java.util.NoSuchElementException; + +import org.apache.log4j.Logger; + +import com.webobjects.eoaccess.EOUtilities; +import com.webobjects.eocontrol.EOAndQualifier; +import com.webobjects.eocontrol.EOClassDescription; +import com.webobjects.eocontrol.EOEditingContext; +import com.webobjects.eocontrol.EOEnterpriseObject; +import com.webobjects.eocontrol.EOFetchSpecification; +import com.webobjects.eocontrol.EOKeyValueQualifier; +import com.webobjects.eocontrol.EOQualifier; +import com.webobjects.eocontrol.EOSortOrdering; +import com.webobjects.foundation.NSArray; +import com.webobjects.foundation.NSMutableArray; + +import er.extensions.eof.ERXGenericRecord; +import er.extensions.eof.ERXKey; + +@SuppressWarnings("all") +public abstract class _Company extends ERXGenericRecord { + public static final String ENTITY_NAME = "Company"; + + // Attribute Keys + public static final ERXKey NAME = new ERXKey("name"); + // Relationship Keys + public static final ERXKey EMPLOYEES = new ERXKey("employees"); + + // Attributes + public static final String NAME_KEY = NAME.key(); + // Relationships + public static final String EMPLOYEES_KEY = EMPLOYEES.key(); + + private static Logger LOG = Logger.getLogger(_Company.class); + + public Company localInstanceIn(EOEditingContext editingContext) { + Company localInstance = (Company)EOUtilities.localInstanceOfObject(editingContext, this); + if (localInstance == null) { + throw new IllegalStateException("You attempted to localInstance " + this + ", which has not yet committed."); + } + return localInstance; + } + + public String name() { + return (String) storedValueForKey("name"); + } + + public void setName(String value) { + if (_Company.LOG.isDebugEnabled()) { + _Company.LOG.debug( "updating name from " + name() + " to " + value); + } + takeStoredValueForKey(value, "name"); + } + + public NSArray employees() { + return (NSArray)storedValueForKey("employees"); + } + + public NSArray employees(EOQualifier qualifier) { + return employees(qualifier, null, false); + } + + public NSArray employees(EOQualifier qualifier, boolean fetch) { + return employees(qualifier, null, fetch); + } + + public NSArray employees(EOQualifier qualifier, NSArray sortOrderings, boolean fetch) { + NSArray results; + if (fetch) { + EOQualifier fullQualifier; + EOQualifier inverseQualifier = new EOKeyValueQualifier(er.ajax.mootools.example.components.Employee.COMPANY_KEY, EOQualifier.QualifierOperatorEqual, this); + + if (qualifier == null) { + fullQualifier = inverseQualifier; + } + else { + NSMutableArray qualifiers = new NSMutableArray(); + qualifiers.addObject(qualifier); + qualifiers.addObject(inverseQualifier); + fullQualifier = new EOAndQualifier(qualifiers); + } + + results = er.ajax.mootools.example.components.Employee.fetchEmployees(editingContext(), fullQualifier, sortOrderings); + } + else { + results = employees(); + if (qualifier != null) { + results = (NSArray)EOQualifier.filteredArrayWithQualifier(results, qualifier); + } + if (sortOrderings != null) { + results = (NSArray)EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings); + } + } + return results; + } + + public void addToEmployees(er.ajax.mootools.example.components.Employee object) { + includeObjectIntoPropertyWithKey(object, "employees"); + } + + public void removeFromEmployees(er.ajax.mootools.example.components.Employee object) { + excludeObjectFromPropertyWithKey(object, "employees"); + } + + public void addToEmployeesRelationship(er.ajax.mootools.example.components.Employee object) { + if (_Company.LOG.isDebugEnabled()) { + _Company.LOG.debug("adding " + object + " to employees relationship"); + } + if (er.extensions.eof.ERXGenericRecord.InverseRelationshipUpdater.updateInverseRelationships()) { + addToEmployees(object); + } + else { + addObjectToBothSidesOfRelationshipWithKey(object, "employees"); + } + } + + public void removeFromEmployeesRelationship(er.ajax.mootools.example.components.Employee object) { + if (_Company.LOG.isDebugEnabled()) { + _Company.LOG.debug("removing " + object + " from employees relationship"); + } + if (er.extensions.eof.ERXGenericRecord.InverseRelationshipUpdater.updateInverseRelationships()) { + removeFromEmployees(object); + } + else { + removeObjectFromBothSidesOfRelationshipWithKey(object, "employees"); + } + } + + public er.ajax.mootools.example.components.Employee createEmployeesRelationship() { + EOClassDescription eoClassDesc = EOClassDescription.classDescriptionForEntityName("Employee"); + EOEnterpriseObject eo = eoClassDesc.createInstanceWithEditingContext(editingContext(), null); + editingContext().insertObject(eo); + addObjectToBothSidesOfRelationshipWithKey(eo, "employees"); + return (er.ajax.mootools.example.components.Employee) eo; + } + + public void deleteEmployeesRelationship(er.ajax.mootools.example.components.Employee object) { + removeObjectFromBothSidesOfRelationshipWithKey(object, "employees"); + editingContext().deleteObject(object); + } + + public void deleteAllEmployeesRelationships() { + Enumeration objects = employees().immutableClone().objectEnumerator(); + while (objects.hasMoreElements()) { + deleteEmployeesRelationship((er.ajax.mootools.example.components.Employee)objects.nextElement()); + } + } + + + public static Company createCompany(EOEditingContext editingContext, String name +) { + Company eo = (Company) EOUtilities.createAndInsertInstance(editingContext, _Company.ENTITY_NAME); + eo.setName(name); + return eo; + } + + public static NSArray fetchAllCompanies(EOEditingContext editingContext) { + return _Company.fetchAllCompanies(editingContext, null); + } + + public static NSArray fetchAllCompanies(EOEditingContext editingContext, NSArray sortOrderings) { + return _Company.fetchCompanies(editingContext, null, sortOrderings); + } + + public static NSArray fetchCompanies(EOEditingContext editingContext, EOQualifier qualifier, NSArray sortOrderings) { + EOFetchSpecification fetchSpec = new EOFetchSpecification(_Company.ENTITY_NAME, qualifier, sortOrderings); + fetchSpec.setIsDeep(true); + NSArray eoObjects = (NSArray)editingContext.objectsWithFetchSpecification(fetchSpec); + return eoObjects; + } + + public static Company fetchCompany(EOEditingContext editingContext, String keyName, Object value) { + return _Company.fetchCompany(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value)); + } + + public static Company fetchCompany(EOEditingContext editingContext, EOQualifier qualifier) { + NSArray eoObjects = _Company.fetchCompanies(editingContext, qualifier, null); + Company eoObject; + int count = eoObjects.count(); + if (count == 0) { + eoObject = null; + } + else if (count == 1) { + eoObject = (Company)eoObjects.objectAtIndex(0); + } + else { + throw new IllegalStateException("There was more than one Company that matched the qualifier '" + qualifier + "'."); + } + return eoObject; + } + + public static Company fetchRequiredCompany(EOEditingContext editingContext, String keyName, Object value) { + return _Company.fetchRequiredCompany(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value)); + } + + public static Company fetchRequiredCompany(EOEditingContext editingContext, EOQualifier qualifier) { + Company eoObject = _Company.fetchCompany(editingContext, qualifier); + if (eoObject == null) { + throw new NoSuchElementException("There was no Company that matched the qualifier '" + qualifier + "'."); + } + return eoObject; + } + + public static Company localInstanceIn(EOEditingContext editingContext, Company eo) { + Company localInstance = (eo == null) ? null : (Company)EOUtilities.localInstanceOfObject(editingContext, eo); + if (localInstance == null && eo != null) { + throw new IllegalStateException("You attempted to localInstance " + eo + ", which has not yet committed."); + } + return localInstance; + } +} diff --git a/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/_Employee.java b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/_Employee.java new file mode 100644 index 00000000000..fd0a617f7eb --- /dev/null +++ b/Examples/Ajax/MooToolsExample/Sources/er/ajax/mootools/example/components/_Employee.java @@ -0,0 +1,157 @@ +// $LastChangedRevision: 4733 $ DO NOT EDIT. Make changes to Employee.java instead. +package er.ajax.mootools.example.components; + +import java.util.NoSuchElementException; + +import org.apache.log4j.Logger; + +import com.webobjects.eoaccess.EOUtilities; +import com.webobjects.eocontrol.EOEditingContext; +import com.webobjects.eocontrol.EOFetchSpecification; +import com.webobjects.eocontrol.EOKeyValueQualifier; +import com.webobjects.eocontrol.EOQualifier; +import com.webobjects.eocontrol.EOSortOrdering; +import com.webobjects.foundation.NSArray; + +import er.extensions.eof.ERXGenericRecord; +import er.extensions.eof.ERXKey; + +@SuppressWarnings("all") +public abstract class _Employee extends ERXGenericRecord { + public static final String ENTITY_NAME = "Employee"; + + // Attribute Keys + public static final ERXKey FIRST_NAME = new ERXKey("firstName"); + public static final ERXKey LAST_NAME = new ERXKey("lastName"); + // Relationship Keys + public static final ERXKey COMPANY = new ERXKey("company"); + + // Attributes + public static final String FIRST_NAME_KEY = FIRST_NAME.key(); + public static final String LAST_NAME_KEY = LAST_NAME.key(); + // Relationships + public static final String COMPANY_KEY = COMPANY.key(); + + private static Logger LOG = Logger.getLogger(_Employee.class); + + public Employee localInstanceIn(EOEditingContext editingContext) { + Employee localInstance = (Employee)EOUtilities.localInstanceOfObject(editingContext, this); + if (localInstance == null) { + throw new IllegalStateException("You attempted to localInstance " + this + ", which has not yet committed."); + } + return localInstance; + } + + public String firstName() { + return (String) storedValueForKey("firstName"); + } + + public void setFirstName(String value) { + if (_Employee.LOG.isDebugEnabled()) { + _Employee.LOG.debug( "updating firstName from " + firstName() + " to " + value); + } + takeStoredValueForKey(value, "firstName"); + } + + public String lastName() { + return (String) storedValueForKey("lastName"); + } + + public void setLastName(String value) { + if (_Employee.LOG.isDebugEnabled()) { + _Employee.LOG.debug( "updating lastName from " + lastName() + " to " + value); + } + takeStoredValueForKey(value, "lastName"); + } + + public Company company() { + return (Company)storedValueForKey("company"); + } + + public void setCompany(er.ajax.mootools.example.components.Company value) { + takeStoredValueForKey(value, "company"); + } + + public void setCompanyRelationship(er.ajax.mootools.example.components.Company value) { + if (_Employee.LOG.isDebugEnabled()) { + _Employee.LOG.debug("updating company from " + company() + " to " + value); + } + if (er.extensions.eof.ERXGenericRecord.InverseRelationshipUpdater.updateInverseRelationships()) { + setCompany(value); + } + else if (value == null) { + er.ajax.mootools.example.components.Company oldValue = company(); + if (oldValue != null) { + removeObjectFromBothSidesOfRelationshipWithKey(oldValue, "company"); + } + } else { + addObjectToBothSidesOfRelationshipWithKey(value, "company"); + } + } + + + public static Employee createEmployee(EOEditingContext editingContext, String firstName +, String lastName +, er.ajax.mootools.example.components.Company company) { + Employee eo = (Employee) EOUtilities.createAndInsertInstance(editingContext, _Employee.ENTITY_NAME); + eo.setFirstName(firstName); + eo.setLastName(lastName); + eo.setCompanyRelationship(company); + return eo; + } + + public static NSArray fetchAllEmployees(EOEditingContext editingContext) { + return _Employee.fetchAllEmployees(editingContext, null); + } + + public static NSArray fetchAllEmployees(EOEditingContext editingContext, NSArray sortOrderings) { + return _Employee.fetchEmployees(editingContext, null, sortOrderings); + } + + public static NSArray fetchEmployees(EOEditingContext editingContext, EOQualifier qualifier, NSArray sortOrderings) { + EOFetchSpecification fetchSpec = new EOFetchSpecification(_Employee.ENTITY_NAME, qualifier, sortOrderings); + fetchSpec.setIsDeep(true); + NSArray eoObjects = (NSArray)editingContext.objectsWithFetchSpecification(fetchSpec); + return eoObjects; + } + + public static Employee fetchEmployee(EOEditingContext editingContext, String keyName, Object value) { + return _Employee.fetchEmployee(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value)); + } + + public static Employee fetchEmployee(EOEditingContext editingContext, EOQualifier qualifier) { + NSArray eoObjects = _Employee.fetchEmployees(editingContext, qualifier, null); + Employee eoObject; + int count = eoObjects.count(); + if (count == 0) { + eoObject = null; + } + else if (count == 1) { + eoObject = (Employee)eoObjects.objectAtIndex(0); + } + else { + throw new IllegalStateException("There was more than one Employee that matched the qualifier '" + qualifier + "'."); + } + return eoObject; + } + + public static Employee fetchRequiredEmployee(EOEditingContext editingContext, String keyName, Object value) { + return _Employee.fetchRequiredEmployee(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value)); + } + + public static Employee fetchRequiredEmployee(EOEditingContext editingContext, EOQualifier qualifier) { + Employee eoObject = _Employee.fetchEmployee(editingContext, qualifier); + if (eoObject == null) { + throw new NoSuchElementException("There was no Employee that matched the qualifier '" + qualifier + "'."); + } + return eoObject; + } + + public static Employee localInstanceIn(EOEditingContext editingContext, Employee eo) { + Employee localInstance = (eo == null) ? null : (Employee)EOUtilities.localInstanceOfObject(editingContext, eo); + if (localInstance == null && eo != null) { + throw new IllegalStateException("You attempted to localInstance " + eo + ", which has not yet committed."); + } + return localInstance; + } +} diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap-responsive.css b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap-responsive.css new file mode 100644 index 00000000000..4b032cdb558 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap-responsive.css @@ -0,0 +1,567 @@ +/*! + * Bootstrap Responsive v2.0.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.hidden { + display: none; + visibility: hidden; +} +@media (max-width: 480px) { + .nav-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 18px; + } + input[class*="span"], + select[class*="span"], + textarea[class*="span"], + .uneditable-input { + display: block; + width: 100%; + height: 28px; + /* Make inputs at least the height of their button counterpart */ + + /* Makes inputs behave like true block-level elements */ + + -webkit-box-sizing: border-box; + /* Older Webkit */ + + -moz-box-sizing: border-box; + /* Older FF */ + + -ms-box-sizing: border-box; + /* IE8 */ + + box-sizing: border-box; + /* CSS3 spec*/ + + } + .input-prepend input[class*="span"], .input-append input[class*="span"] { + width: auto; + } + input[type="checkbox"], input[type="radio"] { + border: 1px solid #ccc; + } + .form-horizontal .control-group > label { + float: none; + width: auto; + padding-top: 0; + text-align: left; + } + .form-horizontal .controls { + margin-left: 0; + } + .form-horizontal .control-list { + padding-top: 0; + } + .form-horizontal .form-actions { + padding-left: 10px; + padding-right: 10px; + } + .modal { + position: absolute; + top: 10px; + left: 10px; + right: 10px; + width: auto; + margin: 0; + } + .modal.fade.in { + top: auto; + } + .modal-header .close { + padding: 10px; + margin: -10px; + } + .carousel-caption { + position: static; + } +} +@media (max-width: 768px) { + .container { + width: auto; + padding: 0 20px; + } + .row-fluid { + width: 100%; + } + .row { + margin-left: 0; + } + .row > [class*="span"], .row-fluid > [class*="span"] { + float: none; + display: block; + width: auto; + margin: 0; + } +} +@media (min-width: 768px) and (max-width: 980px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, .row:after { + display: table; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + margin-left: 20px; + } + .span1 { + width: 42px; + } + .span2 { + width: 104px; + } + .span3 { + width: 166px; + } + .span4 { + width: 228px; + } + .span5 { + width: 290px; + } + .span6 { + width: 352px; + } + .span7 { + width: 414px; + } + .span8 { + width: 476px; + } + .span9 { + width: 538px; + } + .span10 { + width: 600px; + } + .span11 { + width: 662px; + } + .span12, .container { + width: 724px; + } + .offset1 { + margin-left: 82px; + } + .offset2 { + margin-left: 144px; + } + .offset3 { + margin-left: 206px; + } + .offset4 { + margin-left: 268px; + } + .offset5 { + margin-left: 330px; + } + .offset6 { + margin-left: 392px; + } + .offset7 { + margin-left: 454px; + } + .offset8 { + margin-left: 516px; + } + .offset9 { + margin-left: 578px; + } + .offset10 { + margin-left: 640px; + } + .offset11 { + margin-left: 702px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, .row-fluid:after { + display: table; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid > [class*="span"] { + float: left; + margin-left: 2.762430939%; + } + .row-fluid > [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .span1 { + width: 5.801104972%; + } + .row-fluid .span2 { + width: 14.364640883%; + } + .row-fluid .span3 { + width: 22.928176794%; + } + .row-fluid .span4 { + width: 31.491712705%; + } + .row-fluid .span5 { + width: 40.055248616%; + } + .row-fluid .span6 { + width: 48.618784527%; + } + .row-fluid .span7 { + width: 57.182320438000005%; + } + .row-fluid .span8 { + width: 65.74585634900001%; + } + .row-fluid .span9 { + width: 74.30939226%; + } + .row-fluid .span10 { + width: 82.87292817100001%; + } + .row-fluid .span11 { + width: 91.436464082%; + } + .row-fluid .span12 { + width: 99.999999993%; + } + input.span1, textarea.span1, .uneditable-input.span1 { + width: 32px; + } + input.span2, textarea.span2, .uneditable-input.span2 { + width: 94px; + } + input.span3, textarea.span3, .uneditable-input.span3 { + width: 156px; + } + input.span4, textarea.span4, .uneditable-input.span4 { + width: 218px; + } + input.span5, textarea.span5, .uneditable-input.span5 { + width: 280px; + } + input.span6, textarea.span6, .uneditable-input.span6 { + width: 342px; + } + input.span7, textarea.span7, .uneditable-input.span7 { + width: 404px; + } + input.span8, textarea.span8, .uneditable-input.span8 { + width: 466px; + } + input.span9, textarea.span9, .uneditable-input.span9 { + width: 528px; + } + input.span10, textarea.span10, .uneditable-input.span10 { + width: 590px; + } + input.span11, textarea.span11, .uneditable-input.span11 { + width: 652px; + } + input.span12, textarea.span12, .uneditable-input.span12 { + width: 714px; + } +} +@media (max-width: 980px) { + body { + padding-top: 0; + } + .navbar-fixed-top { + position: static; + margin-bottom: 18px; + } + .navbar-fixed-top .navbar-inner { + padding: 5px; + } + .navbar .container { + width: auto; + padding: 0; + } + .navbar .brand { + padding-left: 10px; + padding-right: 10px; + margin: 0 0 0 -5px; + } + .navbar .nav-collapse { + clear: left; + } + .navbar .nav { + float: none; + margin: 0 0 9px; + } + .navbar .nav > li { + float: none; + } + .navbar .nav > li > a { + margin-bottom: 2px; + } + .navbar .nav > .divider-vertical { + display: none; + } + .navbar .nav > li > a, .navbar .dropdown-menu a { + padding: 6px 15px; + font-weight: bold; + color: #999999; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + .navbar .dropdown-menu li + li a { + margin-bottom: 2px; + } + .navbar .nav > li > a:hover, .navbar .dropdown-menu a:hover { + background-color: #222222; + } + .navbar .dropdown-menu { + position: static; + top: auto; + left: auto; + float: none; + display: block; + max-width: none; + margin: 0 15px; + padding: 0; + background-color: transparent; + border: none; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + .navbar .dropdown-menu:before, .navbar .dropdown-menu:after { + display: none; + } + .navbar .dropdown-menu .divider { + display: none; + } + .navbar-form, .navbar-search { + float: none; + padding: 9px 15px; + margin: 9px 0; + border-top: 1px solid #222222; + border-bottom: 1px solid #222222; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + } + .navbar .nav.pull-right { + float: none; + margin-left: 0; + } + .navbar-static .navbar-inner { + padding-left: 10px; + padding-right: 10px; + } + .btn-navbar { + display: block; + } + .nav-collapse { + overflow: hidden; + height: 0; + } +} +@media (min-width: 980px) { + .nav-collapse.collapse { + height: auto !important; + } +} +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, .row:after { + display: table; + content: ""; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + margin-left: 30px; + } + .span1 { + width: 70px; + } + .span2 { + width: 170px; + } + .span3 { + width: 270px; + } + .span4 { + width: 370px; + } + .span5 { + width: 470px; + } + .span6 { + width: 570px; + } + .span7 { + width: 670px; + } + .span8 { + width: 770px; + } + .span9 { + width: 870px; + } + .span10 { + width: 970px; + } + .span11 { + width: 1070px; + } + .span12, .container { + width: 1170px; + } + .offset1 { + margin-left: 130px; + } + .offset2 { + margin-left: 230px; + } + .offset3 { + margin-left: 330px; + } + .offset4 { + margin-left: 430px; + } + .offset5 { + margin-left: 530px; + } + .offset6 { + margin-left: 630px; + } + .offset7 { + margin-left: 730px; + } + .offset8 { + margin-left: 830px; + } + .offset9 { + margin-left: 930px; + } + .offset10 { + margin-left: 1030px; + } + .offset11 { + margin-left: 1130px; + } + .row-fluid { + width: 100%; + *zoom: 1; + } + .row-fluid:before, .row-fluid:after { + display: table; + content: ""; + } + .row-fluid:after { + clear: both; + } + .row-fluid > [class*="span"] { + float: left; + margin-left: 2.564102564%; + } + .row-fluid > [class*="span"]:first-child { + margin-left: 0; + } + .row-fluid .span1 { + width: 5.982905983%; + } + .row-fluid .span2 { + width: 14.529914530000001%; + } + .row-fluid .span3 { + width: 23.076923077%; + } + .row-fluid .span4 { + width: 31.623931624%; + } + .row-fluid .span5 { + width: 40.170940171000005%; + } + .row-fluid .span6 { + width: 48.717948718%; + } + .row-fluid .span7 { + width: 57.264957265%; + } + .row-fluid .span8 { + width: 65.81196581200001%; + } + .row-fluid .span9 { + width: 74.358974359%; + } + .row-fluid .span10 { + width: 82.905982906%; + } + .row-fluid .span11 { + width: 91.45299145300001%; + } + .row-fluid .span12 { + width: 100%; + } + input.span1, textarea.span1, .uneditable-input.span1 { + width: 60px; + } + input.span2, textarea.span2, .uneditable-input.span2 { + width: 160px; + } + input.span3, textarea.span3, .uneditable-input.span3 { + width: 260px; + } + input.span4, textarea.span4, .uneditable-input.span4 { + width: 360px; + } + input.span5, textarea.span5, .uneditable-input.span5 { + width: 460px; + } + input.span6, textarea.span6, .uneditable-input.span6 { + width: 560px; + } + input.span7, textarea.span7, .uneditable-input.span7 { + width: 660px; + } + input.span8, textarea.span8, .uneditable-input.span8 { + width: 760px; + } + input.span9, textarea.span9, .uneditable-input.span9 { + width: 860px; + } + input.span10, textarea.span10, .uneditable-input.span10 { + width: 960px; + } + input.span11, textarea.span11, .uneditable-input.span11 { + width: 1060px; + } + input.span12, textarea.span12, .uneditable-input.span12 { + width: 1160px; + } + .thumbnails { + margin-left: -30px; + } + .thumbnails > li { + margin-left: 30px; + } +} diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap-responsive.min.css b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap-responsive.min.css new file mode 100644 index 00000000000..bc3f2ab71a8 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap-responsive.min.css @@ -0,0 +1,3 @@ + +.hidden{display:none;visibility:hidden;} +@media (max-width:480px){.nav-collapse{-webkit-transform:translate3d(0, 0, 0);} .page-header h1 small{display:block;line-height:18px;} input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} .input-prepend input[class*="span"],.input-append input[class*="span"]{width:auto;} input[type="checkbox"],input[type="radio"]{border:1px solid #ccc;} .form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left;} .form-horizontal .controls{margin-left:0;} .form-horizontal .control-list{padding-top:0;} .form-horizontal .form-actions{padding-left:10px;padding-right:10px;} .modal{position:absolute;top:10px;left:10px;right:10px;width:auto;margin:0;}.modal.fade.in{top:auto;} .modal-header .close{padding:10px;margin:-10px;} .carousel-caption{position:static;}}@media (max-width:768px){.container{width:auto;padding:0 20px;} .row-fluid{width:100%;} .row{margin-left:0;} .row>[class*="span"],.row-fluid>[class*="span"]{float:none;display:block;width:auto;margin:0;}}@media (min-width:768px) and (max-width:980px){.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} .row:after{clear:both;} [class*="span"]{float:left;margin-left:20px;} .span1{width:42px;} .span2{width:104px;} .span3{width:166px;} .span4{width:228px;} .span5{width:290px;} .span6{width:352px;} .span7{width:414px;} .span8{width:476px;} .span9{width:538px;} .span10{width:600px;} .span11{width:662px;} .span12,.container{width:724px;} .offset1{margin-left:82px;} .offset2{margin-left:144px;} .offset3{margin-left:206px;} .offset4{margin-left:268px;} .offset5{margin-left:330px;} .offset6{margin-left:392px;} .offset7{margin-left:454px;} .offset8{margin-left:516px;} .offset9{margin-left:578px;} .offset10{margin-left:640px;} .offset11{margin-left:702px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} .row-fluid:after{clear:both;} .row-fluid>[class*="span"]{float:left;margin-left:2.762430939%;} .row-fluid>[class*="span"]:first-child{margin-left:0;} .row-fluid .span1{width:5.801104972%;} .row-fluid .span2{width:14.364640883%;} .row-fluid .span3{width:22.928176794%;} .row-fluid .span4{width:31.491712705%;} .row-fluid .span5{width:40.055248616%;} .row-fluid .span6{width:48.618784527%;} .row-fluid .span7{width:57.182320438000005%;} .row-fluid .span8{width:65.74585634900001%;} .row-fluid .span9{width:74.30939226%;} .row-fluid .span10{width:82.87292817100001%;} .row-fluid .span11{width:91.436464082%;} .row-fluid .span12{width:99.999999993%;} input.span1,textarea.span1,.uneditable-input.span1{width:32px;} input.span2,textarea.span2,.uneditable-input.span2{width:94px;} input.span3,textarea.span3,.uneditable-input.span3{width:156px;} input.span4,textarea.span4,.uneditable-input.span4{width:218px;} input.span5,textarea.span5,.uneditable-input.span5{width:280px;} input.span6,textarea.span6,.uneditable-input.span6{width:342px;} input.span7,textarea.span7,.uneditable-input.span7{width:404px;} input.span8,textarea.span8,.uneditable-input.span8{width:466px;} input.span9,textarea.span9,.uneditable-input.span9{width:528px;} input.span10,textarea.span10,.uneditable-input.span10{width:590px;} input.span11,textarea.span11,.uneditable-input.span11{width:652px;} input.span12,textarea.span12,.uneditable-input.span12{width:714px;}}@media (max-width:980px){body{padding-top:0;} .navbar-fixed-top{position:static;margin-bottom:18px;} .navbar-fixed-top .navbar-inner{padding:5px;} .navbar .container{width:auto;padding:0;} .navbar .brand{padding-left:10px;padding-right:10px;margin:0 0 0 -5px;} .navbar .nav-collapse{clear:left;} .navbar .nav{float:none;margin:0 0 9px;} .navbar .nav>li{float:none;} .navbar .nav>li>a{margin-bottom:2px;} .navbar .nav>.divider-vertical{display:none;} .navbar .nav>li>a,.navbar .dropdown-menu a{padding:6px 15px;font-weight:bold;color:#999999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} .navbar .dropdown-menu li+li a{margin-bottom:2px;} .navbar .nav>li>a:hover,.navbar .dropdown-menu a:hover{background-color:#222222;} .navbar .dropdown-menu{position:static;top:auto;left:auto;float:none;display:block;max-width:none;margin:0 15px;padding:0;background-color:transparent;border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .navbar .dropdown-menu:before,.navbar .dropdown-menu:after{display:none;} .navbar .dropdown-menu .divider{display:none;} .navbar-form,.navbar-search{float:none;padding:9px 15px;margin:9px 0;border-top:1px solid #222222;border-bottom:1px solid #222222;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.1);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.1);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.1);} .navbar .nav.pull-right{float:none;margin-left:0;} .navbar-static .navbar-inner{padding-left:10px;padding-right:10px;} .btn-navbar{display:block;} .nav-collapse{overflow:hidden;height:0;}}@media (min-width:980px){.nav-collapse.collapse{height:auto !important;}}@media (min-width:1200px){.row{margin-left:-30px;*zoom:1;}.row:before,.row:after{display:table;content:"";} .row:after{clear:both;} [class*="span"]{float:left;margin-left:30px;} .span1{width:70px;} .span2{width:170px;} .span3{width:270px;} .span4{width:370px;} .span5{width:470px;} .span6{width:570px;} .span7{width:670px;} .span8{width:770px;} .span9{width:870px;} .span10{width:970px;} .span11{width:1070px;} .span12,.container{width:1170px;} .offset1{margin-left:130px;} .offset2{margin-left:230px;} .offset3{margin-left:330px;} .offset4{margin-left:430px;} .offset5{margin-left:530px;} .offset6{margin-left:630px;} .offset7{margin-left:730px;} .offset8{margin-left:830px;} .offset9{margin-left:930px;} .offset10{margin-left:1030px;} .offset11{margin-left:1130px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} .row-fluid:after{clear:both;} .row-fluid>[class*="span"]{float:left;margin-left:2.564102564%;} .row-fluid>[class*="span"]:first-child{margin-left:0;} .row-fluid .span1{width:5.982905983%;} .row-fluid .span2{width:14.529914530000001%;} .row-fluid .span3{width:23.076923077%;} .row-fluid .span4{width:31.623931624%;} .row-fluid .span5{width:40.170940171000005%;} .row-fluid .span6{width:48.717948718%;} .row-fluid .span7{width:57.264957265%;} .row-fluid .span8{width:65.81196581200001%;} .row-fluid .span9{width:74.358974359%;} .row-fluid .span10{width:82.905982906%;} .row-fluid .span11{width:91.45299145300001%;} .row-fluid .span12{width:100%;} input.span1,textarea.span1,.uneditable-input.span1{width:60px;} input.span2,textarea.span2,.uneditable-input.span2{width:160px;} input.span3,textarea.span3,.uneditable-input.span3{width:260px;} input.span4,textarea.span4,.uneditable-input.span4{width:360px;} input.span5,textarea.span5,.uneditable-input.span5{width:460px;} input.span6,textarea.span6,.uneditable-input.span6{width:560px;} input.span7,textarea.span7,.uneditable-input.span7{width:660px;} input.span8,textarea.span8,.uneditable-input.span8{width:760px;} input.span9,textarea.span9,.uneditable-input.span9{width:860px;} input.span10,textarea.span10,.uneditable-input.span10{width:960px;} input.span11,textarea.span11,.uneditable-input.span11{width:1060px;} input.span12,textarea.span12,.uneditable-input.span12{width:1160px;} .thumbnails{margin-left:-30px;} .thumbnails>li{margin-left:30px;}} diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap.css b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap.css new file mode 100644 index 00000000000..a90e31930bc --- /dev/null +++ b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap.css @@ -0,0 +1,3365 @@ +/*! + * Bootstrap v2.0.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section { + display: block; +} +audio, canvas, video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; +} +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +a:hover, a:active { + outline: 0; +} +sub, sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + max-width: 100%; + height: auto; + border: 0; + -ms-interpolation-mode: bicubic; +} +button, +input, +select, +textarea { + margin: 0; + font-size: 100%; + vertical-align: middle; +} +button, input { + *overflow: visible; + line-height: normal; +} +button::-moz-focus-inner, input::-moz-focus-inner { + padding: 0; + border: 0; +} +button, +input[type="button"], +input[type="reset"], +input[type="submit"] { + cursor: pointer; + -webkit-appearance: button; +} +input[type="search"] { + -webkit-appearance: textfield; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} +textarea { + overflow: auto; + vertical-align: top; +} +body { + margin: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 18px; + color: #333333; + background-color: #ffffff; +} +a { + color: #0088cc; + text-decoration: none; +} +a:hover { + color: #005580; + text-decoration: underline; +} +.row { + margin-left: -20px; + *zoom: 1; +} +.row:before, .row:after { + display: table; + content: ""; +} +.row:after { + clear: both; +} +[class*="span"] { + float: left; + margin-left: 20px; +} +.span1 { + width: 60px; +} +.span2 { + width: 140px; +} +.span3 { + width: 220px; +} +.span4 { + width: 300px; +} +.span5 { + width: 380px; +} +.span6 { + width: 460px; +} +.span7 { + width: 540px; +} +.span8 { + width: 620px; +} +.span9 { + width: 700px; +} +.span10 { + width: 780px; +} +.span11 { + width: 860px; +} +.span12, .container { + width: 940px; +} +.offset1 { + margin-left: 100px; +} +.offset2 { + margin-left: 180px; +} +.offset3 { + margin-left: 260px; +} +.offset4 { + margin-left: 340px; +} +.offset5 { + margin-left: 420px; +} +.offset6 { + margin-left: 500px; +} +.offset7 { + margin-left: 580px; +} +.offset8 { + margin-left: 660px; +} +.offset9 { + margin-left: 740px; +} +.offset10 { + margin-left: 820px; +} +.offset11 { + margin-left: 900px; +} +.row-fluid { + width: 100%; + *zoom: 1; +} +.row-fluid:before, .row-fluid:after { + display: table; + content: ""; +} +.row-fluid:after { + clear: both; +} +.row-fluid > [class*="span"] { + float: left; + margin-left: 2.127659574%; +} +.row-fluid > [class*="span"]:first-child { + margin-left: 0; +} +.row-fluid .span1 { + width: 6.382978723%; +} +.row-fluid .span2 { + width: 14.89361702%; +} +.row-fluid .span3 { + width: 23.404255317%; +} +.row-fluid .span4 { + width: 31.914893614%; +} +.row-fluid .span5 { + width: 40.425531911%; +} +.row-fluid .span6 { + width: 48.93617020799999%; +} +.row-fluid .span7 { + width: 57.446808505%; +} +.row-fluid .span8 { + width: 65.95744680199999%; +} +.row-fluid .span9 { + width: 74.468085099%; +} +.row-fluid .span10 { + width: 82.97872339599999%; +} +.row-fluid .span11 { + width: 91.489361693%; +} +.row-fluid .span12 { + width: 99.99999998999999%; +} +.container { + width: 940px; + margin-left: auto; + margin-right: auto; + *zoom: 1; +} +.container:before, .container:after { + display: table; + content: ""; +} +.container:after { + clear: both; +} +.container-fluid { + padding-left: 20px; + padding-right: 20px; + *zoom: 1; +} +.container-fluid:before, .container-fluid:after { + display: table; + content: ""; +} +.container-fluid:after { + clear: both; +} +p { + margin: 0 0 9px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 18px; +} +p small { + font-size: 11px; + color: #999999; +} +.lead { + margin-bottom: 18px; + font-size: 20px; + font-weight: 200; + line-height: 27px; +} +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + font-weight: bold; + color: #333333; + text-rendering: optimizelegibility; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small { + font-weight: normal; + color: #999999; +} +h1 { + font-size: 30px; + line-height: 36px; +} +h1 small { + font-size: 18px; +} +h2 { + font-size: 24px; + line-height: 36px; +} +h2 small { + font-size: 18px; +} +h3 { + line-height: 27px; + font-size: 18px; +} +h3 small { + font-size: 14px; +} +h4, h5, h6 { + line-height: 18px; +} +h4 { + font-size: 14px; +} +h4 small { + font-size: 12px; +} +h5 { + font-size: 12px; +} +h6 { + font-size: 11px; + color: #999999; + text-transform: uppercase; +} +.page-header { + padding-bottom: 17px; + margin: 18px 0; + border-bottom: 1px solid #eeeeee; +} +.page-header h1 { + line-height: 1; +} +ul, ol { + padding: 0; + margin: 0 0 9px 25px; +} +ul ul, +ul ol, +ol ol, +ol ul { + margin-bottom: 0; +} +ul { + list-style: disc; +} +ol { + list-style: decimal; +} +li { + line-height: 18px; +} +ul.unstyled { + margin-left: 0; + list-style: none; +} +dl { + margin-bottom: 18px; +} +dt, dd { + line-height: 18px; +} +dt { + font-weight: bold; +} +dd { + margin-left: 9px; +} +hr { + margin: 18px 0; + border: 0; + border-top: 1px solid #e5e5e5; + border-bottom: 1px solid #ffffff; +} +strong { + font-weight: bold; +} +em { + font-style: italic; +} +.muted { + color: #999999; +} +abbr { + font-size: 90%; + text-transform: uppercase; + border-bottom: 1px dotted #ddd; + cursor: help; +} +blockquote { + padding: 0 0 0 15px; + margin: 0 0 18px; + border-left: 5px solid #eeeeee; +} +blockquote p { + margin-bottom: 0; + font-size: 16px; + font-weight: 300; + line-height: 22.5px; +} +blockquote small { + display: block; + line-height: 18px; + color: #999999; +} +blockquote small:before { + content: '\2014 \00A0'; +} +blockquote.pull-right { + float: right; + padding-left: 0; + padding-right: 15px; + border-left: 0; + border-right: 5px solid #eeeeee; +} +blockquote.pull-right p, blockquote.pull-right small { + text-align: right; +} +q:before, +q:after, +blockquote:before, +blockquote:after { + content: ""; +} +address { + display: block; + margin-bottom: 18px; + line-height: 18px; + font-style: normal; +} +small { + font-size: 100%; +} +cite { + font-style: normal; +} +code, pre { + padding: 0 3px 2px; + font-family: Menlo, Monaco, "Courier New", monospace; + font-size: 12px; + color: #333333; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +code { + padding: 3px 4px; + color: #d14; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; +} +pre { + display: block; + padding: 8.5px; + margin: 0 0 9px; + font-size: 12px; + line-height: 18px; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + white-space: pre; + white-space: pre-wrap; + word-break: break-all; +} +pre.prettyprint { + margin-bottom: 18px; +} +pre code { + padding: 0; + background-color: transparent; +} +form { + margin: 0 0 18px; +} +fieldset { + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 27px; + font-size: 19.5px; + line-height: 36px; + color: #333333; + border: 0; + border-bottom: 1px solid #eee; +} +label, +input, +button, +select, +textarea { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 18px; +} +label { + display: block; + margin-bottom: 5px; + color: #333333; +} +input, +textarea, +select, +.uneditable-input { + display: inline-block; + width: 210px; + height: 18px; + padding: 4px; + margin-bottom: 9px; + font-size: 13px; + line-height: 18px; + color: #555555; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.uneditable-textarea { + width: auto; + height: auto; +} +label input, label textarea, label select { + display: block; +} +input[type="image"], input[type="checkbox"], input[type="radio"] { + width: auto; + height: auto; + padding: 0; + margin: 3px 0; + *margin-top: 0; + /* IE7 */ + + line-height: normal; + border: 0; + cursor: pointer; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +input[type="file"] { + padding: initial; + line-height: initial; + border: initial; + background-color: #ffffff; + background-color: initial; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +input[type="button"], input[type="reset"], input[type="submit"] { + width: auto; + height: auto; +} +select, input[type="file"] { + height: 28px; + /* In IE7, the height of the select element cannot be changed by height, only font-size */ + + *margin-top: 4px; + /* For IE7, add top margin to align select with labels */ + + line-height: 28px; +} +select { + width: 220px; + background-color: #ffffff; +} +select[multiple], select[size] { + height: auto; +} +input[type="image"] { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +textarea { + height: auto; +} +input[type="hidden"] { + display: none; +} +.radio, .checkbox { + padding-left: 18px; +} +.radio input[type="radio"], .checkbox input[type="checkbox"] { + float: left; + margin-left: -18px; +} +.controls > .radio:first-child, .controls > .checkbox:first-child { + padding-top: 5px; +} +.radio.inline, .checkbox.inline { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; +} +.radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { + margin-left: 10px; +} +.controls > .radio.inline:first-child, .controls > .checkbox.inline:first-child { + padding-top: 0; +} +input, textarea { + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; +} +input:focus, textarea:focus { + border-color: rgba(82, 168, 236, 0.8); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); + outline: 0; + outline: thin dotted \9; + /* IE6-8 */ + +} +input[type="file"]:focus, input[type="checkbox"]:focus, select:focus { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.input-mini { + width: 60px; +} +.input-small { + width: 90px; +} +.input-medium { + width: 150px; +} +.input-large { + width: 210px; +} +.input-xlarge { + width: 270px; +} +.input-xxlarge { + width: 530px; +} +input[class*="span"], +select[class*="span"], +textarea[class*="span"], +.uneditable-input { + float: none; + margin-left: 0; +} +input.span1, textarea.span1, .uneditable-input.span1 { + width: 50px; +} +input.span2, textarea.span2, .uneditable-input.span2 { + width: 130px; +} +input.span3, textarea.span3, .uneditable-input.span3 { + width: 210px; +} +input.span4, textarea.span4, .uneditable-input.span4 { + width: 290px; +} +input.span5, textarea.span5, .uneditable-input.span5 { + width: 370px; +} +input.span6, textarea.span6, .uneditable-input.span6 { + width: 450px; +} +input.span7, textarea.span7, .uneditable-input.span7 { + width: 530px; +} +input.span8, textarea.span8, .uneditable-input.span8 { + width: 610px; +} +input.span9, textarea.span9, .uneditable-input.span9 { + width: 690px; +} +input.span10, textarea.span10, .uneditable-input.span10 { + width: 770px; +} +input.span11, textarea.span11, .uneditable-input.span11 { + width: 850px; +} +input.span12, textarea.span12, .uneditable-input.span12 { + width: 930px; +} +input[disabled], +select[disabled], +textarea[disabled], +input[readonly], +select[readonly], +textarea[readonly] { + background-color: #f5f5f5; + border-color: #ddd; + cursor: not-allowed; +} +.control-group.warning > label, .control-group.warning .help-block, .control-group.warning .help-inline { + color: #c09853; +} +.control-group.warning input, .control-group.warning select, .control-group.warning textarea { + color: #c09853; + border-color: #c09853; +} +.control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { + border-color: #a47e3c; + -webkit-box-shadow: 0 0 6px #dbc59e; + -moz-box-shadow: 0 0 6px #dbc59e; + box-shadow: 0 0 6px #dbc59e; +} +.control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { + color: #c09853; + background-color: #fcf8e3; + border-color: #c09853; +} +.control-group.error > label, .control-group.error .help-block, .control-group.error .help-inline { + color: #b94a48; +} +.control-group.error input, .control-group.error select, .control-group.error textarea { + color: #b94a48; + border-color: #b94a48; +} +.control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { + border-color: #953b39; + -webkit-box-shadow: 0 0 6px #d59392; + -moz-box-shadow: 0 0 6px #d59392; + box-shadow: 0 0 6px #d59392; +} +.control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { + color: #b94a48; + background-color: #f2dede; + border-color: #b94a48; +} +.control-group.success > label, .control-group.success .help-block, .control-group.success .help-inline { + color: #468847; +} +.control-group.success input, .control-group.success select, .control-group.success textarea { + color: #468847; + border-color: #468847; +} +.control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { + border-color: #356635; + -webkit-box-shadow: 0 0 6px #7aba7b; + -moz-box-shadow: 0 0 6px #7aba7b; + box-shadow: 0 0 6px #7aba7b; +} +.control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { + color: #468847; + background-color: #dff0d8; + border-color: #468847; +} +input:focus:required:invalid, textarea:focus:required:invalid, select:focus:required:invalid { + color: #b94a48; + border-color: #ee5f5b; +} +input:focus:required:invalid:focus, textarea:focus:required:invalid:focus, select:focus:required:invalid:focus { + border-color: #e9322d; + -webkit-box-shadow: 0 0 6px #f8b9b7; + -moz-box-shadow: 0 0 6px #f8b9b7; + box-shadow: 0 0 6px #f8b9b7; +} +.form-actions { + padding: 17px 20px 18px; + margin-top: 18px; + margin-bottom: 18px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; +} +.uneditable-input { + display: block; + background-color: #ffffff; + border-color: #eee; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); + cursor: not-allowed; +} +:-moz-placeholder { + color: #999999; +} +::-webkit-input-placeholder { + color: #999999; +} +.help-block { + margin-top: 5px; + margin-bottom: 0; + color: #999999; +} +.help-inline { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-bottom: 9px; + vertical-align: middle; + padding-left: 5px; +} +.input-prepend, .input-append { + margin-bottom: 5px; + *zoom: 1; +} +.input-prepend:before, +.input-append:before, +.input-prepend:after, +.input-append:after { + display: table; + content: ""; +} +.input-prepend:after, .input-append:after { + clear: both; +} +.input-prepend input, +.input-append input, +.input-prepend .uneditable-input, +.input-append .uneditable-input { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-prepend input:focus, +.input-append input:focus, +.input-prepend .uneditable-input:focus, +.input-append .uneditable-input:focus { + position: relative; + z-index: 2; +} +.input-prepend .uneditable-input, .input-append .uneditable-input { + border-left-color: #ccc; +} +.input-prepend .add-on, .input-append .add-on { + float: left; + display: block; + width: auto; + min-width: 16px; + height: 18px; + margin-right: -1px; + padding: 4px 5px; + font-weight: normal; + line-height: 18px; + color: #999999; + text-align: center; + text-shadow: 0 1px 0 #ffffff; + background-color: #f5f5f5; + border: 1px solid #ccc; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-prepend .active, .input-append .active { + background-color: #a9dba9; + border-color: #46a546; +} +.input-prepend .add-on { + *margin-top: 1px; + /* IE6-7 */ + +} +.input-append input, .input-append .uneditable-input { + float: left; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.input-append .uneditable-input { + border-right-color: #ccc; +} +.input-append .add-on { + margin-right: 0; + margin-left: -1px; + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.input-append input:first-child { + *margin-left: -160px; +} +.input-append input:first-child + .add-on { + *margin-left: -21px; +} +.search-query { + padding-left: 14px; + padding-right: 14px; + margin-bottom: 0; + -webkit-border-radius: 14px; + -moz-border-radius: 14px; + border-radius: 14px; +} +.form-search input, +.form-inline input, +.form-horizontal input, +.form-search textarea, +.form-inline textarea, +.form-horizontal textarea, +.form-search select, +.form-inline select, +.form-horizontal select, +.form-search .help-inline, +.form-inline .help-inline, +.form-horizontal .help-inline, +.form-search .uneditable-input, +.form-inline .uneditable-input, +.form-horizontal .uneditable-input { + display: inline-block; + margin-bottom: 0; +} +.form-search label, +.form-inline label, +.form-search .input-append, +.form-inline .input-append, +.form-search .input-prepend, +.form-inline .input-prepend { + display: inline-block; +} +.form-search .input-append .add-on, +.form-inline .input-prepend .add-on, +.form-search .input-append .add-on, +.form-inline .input-prepend .add-on { + vertical-align: middle; +} +.control-group { + margin-bottom: 9px; +} +.form-horizontal legend + .control-group { + margin-top: 18px; + -webkit-margin-top-collapse: separate; +} +.form-horizontal .control-group { + margin-bottom: 18px; + *zoom: 1; +} +.form-horizontal .control-group:before, .form-horizontal .control-group:after { + display: table; + content: ""; +} +.form-horizontal .control-group:after { + clear: both; +} +.form-horizontal .control-group > label { + float: left; + width: 140px; + padding-top: 5px; + text-align: right; +} +.form-horizontal .controls { + margin-left: 160px; +} +.form-horizontal .form-actions { + padding-left: 160px; +} +table { + max-width: 100%; + border-collapse: collapse; + border-spacing: 0; +} +.table { + width: 100%; + margin-bottom: 18px; +} +.table th, .table td { + padding: 8px; + line-height: 18px; + text-align: left; + border-top: 1px solid #ddd; +} +.table th { + font-weight: bold; + vertical-align: bottom; +} +.table td { + vertical-align: top; +} +.table thead:first-child tr th, .table thead:first-child tr td { + border-top: 0; +} +.table tbody + tbody { + border-top: 2px solid #ddd; +} +.table-condensed th, .table-condensed td { + padding: 4px 5px; +} +.table-bordered { + border: 1px solid #ddd; + border-collapse: separate; + *border-collapse: collapsed; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.table-bordered th + th, +.table-bordered td + td, +.table-bordered th + td, +.table-bordered td + th { + border-left: 1px solid #ddd; +} +.table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { + border-top: 0; +} +.table-bordered thead:first-child tr:first-child th:first-child, .table-bordered tbody:first-child tr:first-child td:first-child { + -webkit-border-radius: 4px 0 0 0; + -moz-border-radius: 4px 0 0 0; + border-radius: 4px 0 0 0; +} +.table-bordered thead:first-child tr:first-child th:last-child, .table-bordered tbody:first-child tr:first-child td:last-child { + -webkit-border-radius: 0 4px 0 0; + -moz-border-radius: 0 4px 0 0; + border-radius: 0 4px 0 0; +} +.table-bordered thead:last-child tr:last-child th:first-child, .table-bordered tbody:last-child tr:last-child td:first-child { + -webkit-border-radius: 0 0 0 4px; + -moz-border-radius: 0 0 0 4px; + border-radius: 0 0 0 4px; +} +.table-bordered thead:last-child tr:last-child th:last-child, .table-bordered tbody:last-child tr:last-child td:last-child { + -webkit-border-radius: 0 0 4px 0; + -moz-border-radius: 0 0 4px 0; + border-radius: 0 0 4px 0; +} +.table-striped tbody tr:nth-child(odd) td, .table-striped tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} +table .span1 { + float: none; + width: 44px; + margin-left: 0; +} +table .span2 { + float: none; + width: 124px; + margin-left: 0; +} +table .span3 { + float: none; + width: 204px; + margin-left: 0; +} +table .span4 { + float: none; + width: 284px; + margin-left: 0; +} +table .span5 { + float: none; + width: 364px; + margin-left: 0; +} +table .span6 { + float: none; + width: 444px; + margin-left: 0; +} +table .span7 { + float: none; + width: 524px; + margin-left: 0; +} +table .span8 { + float: none; + width: 604px; + margin-left: 0; +} +table .span9 { + float: none; + width: 684px; + margin-left: 0; +} +table .span10 { + float: none; + width: 764px; + margin-left: 0; +} +table .span11 { + float: none; + width: 844px; + margin-left: 0; +} +table .span12 { + float: none; + width: 924px; + margin-left: 0; +} +[class^="icon-"] { + display: inline-block; + width: 14px; + height: 14px; + vertical-align: text-top; + background-image: url(../img/glyphicons-halflings.png); + background-position: 14px 14px; + background-repeat: no-repeat; + *margin-right: .3em; +} +[class^="icon-"]:last-child { + *margin-left: 0; +} +.icon-white { + background-image: url(../img/glyphicons-halflings-white.png); +} +.icon-glass { + background-position: 0 0; +} +.icon-music { + background-position: -24px 0; +} +.icon-search { + background-position: -48px 0; +} +.icon-envelope { + background-position: -72px 0; +} +.icon-heart { + background-position: -96px 0; +} +.icon-star { + background-position: -120px 0; +} +.icon-star-empty { + background-position: -144px 0; +} +.icon-user { + background-position: -168px 0; +} +.icon-film { + background-position: -192px 0; +} +.icon-th-large { + background-position: -216px 0; +} +.icon-th { + background-position: -240px 0; +} +.icon-th-list { + background-position: -264px 0; +} +.icon-ok { + background-position: -288px 0; +} +.icon-remove { + background-position: -312px 0; +} +.icon-zoom-in { + background-position: -336px 0; +} +.icon-zoom-out { + background-position: -360px 0; +} +.icon-off { + background-position: -384px 0; +} +.icon-signal { + background-position: -408px 0; +} +.icon-cog { + background-position: -432px 0; +} +.icon-trash { + background-position: -456px 0; +} +.icon-home { + background-position: 0 -24px; +} +.icon-file { + background-position: -24px -24px; +} +.icon-time { + background-position: -48px -24px; +} +.icon-road { + background-position: -72px -24px; +} +.icon-download-alt { + background-position: -96px -24px; +} +.icon-download { + background-position: -120px -24px; +} +.icon-upload { + background-position: -144px -24px; +} +.icon-inbox { + background-position: -168px -24px; +} +.icon-play-circle { + background-position: -192px -24px; +} +.icon-repeat { + background-position: -216px -24px; +} +.icon-refresh { + background-position: -240px -24px; +} +.icon-list-alt { + background-position: -264px -24px; +} +.icon-lock { + background-position: -287px -24px; +} +.icon-flag { + background-position: -312px -24px; +} +.icon-headphones { + background-position: -336px -24px; +} +.icon-volume-off { + background-position: -360px -24px; +} +.icon-volume-down { + background-position: -384px -24px; +} +.icon-volume-up { + background-position: -408px -24px; +} +.icon-qrcode { + background-position: -432px -24px; +} +.icon-barcode { + background-position: -456px -24px; +} +.icon-tag { + background-position: 0 -48px; +} +.icon-tags { + background-position: -25px -48px; +} +.icon-book { + background-position: -48px -48px; +} +.icon-bookmark { + background-position: -72px -48px; +} +.icon-print { + background-position: -96px -48px; +} +.icon-camera { + background-position: -120px -48px; +} +.icon-font { + background-position: -144px -48px; +} +.icon-bold { + background-position: -167px -48px; +} +.icon-italic { + background-position: -192px -48px; +} +.icon-text-height { + background-position: -216px -48px; +} +.icon-text-width { + background-position: -240px -48px; +} +.icon-align-left { + background-position: -264px -48px; +} +.icon-align-center { + background-position: -288px -48px; +} +.icon-align-right { + background-position: -312px -48px; +} +.icon-align-justify { + background-position: -336px -48px; +} +.icon-list { + background-position: -360px -48px; +} +.icon-indent-left { + background-position: -384px -48px; +} +.icon-indent-right { + background-position: -408px -48px; +} +.icon-facetime-video { + background-position: -432px -48px; +} +.icon-picture { + background-position: -456px -48px; +} +.icon-pencil { + background-position: 0 -72px; +} +.icon-map-marker { + background-position: -24px -72px; +} +.icon-adjust { + background-position: -48px -72px; +} +.icon-tint { + background-position: -72px -72px; +} +.icon-edit { + background-position: -96px -72px; +} +.icon-share { + background-position: -120px -72px; +} +.icon-check { + background-position: -144px -72px; +} +.icon-move { + background-position: -168px -72px; +} +.icon-step-backward { + background-position: -192px -72px; +} +.icon-fast-backward { + background-position: -216px -72px; +} +.icon-backward { + background-position: -240px -72px; +} +.icon-play { + background-position: -264px -72px; +} +.icon-pause { + background-position: -288px -72px; +} +.icon-stop { + background-position: -312px -72px; +} +.icon-forward { + background-position: -336px -72px; +} +.icon-fast-forward { + background-position: -360px -72px; +} +.icon-step-forward { + background-position: -384px -72px; +} +.icon-eject { + background-position: -408px -72px; +} +.icon-chevron-left { + background-position: -432px -72px; +} +.icon-chevron-right { + background-position: -456px -72px; +} +.icon-plus-sign { + background-position: 0 -96px; +} +.icon-minus-sign { + background-position: -24px -96px; +} +.icon-remove-sign { + background-position: -48px -96px; +} +.icon-ok-sign { + background-position: -72px -96px; +} +.icon-question-sign { + background-position: -96px -96px; +} +.icon-info-sign { + background-position: -120px -96px; +} +.icon-screenshot { + background-position: -144px -96px; +} +.icon-remove-circle { + background-position: -168px -96px; +} +.icon-ok-circle { + background-position: -192px -96px; +} +.icon-ban-circle { + background-position: -216px -96px; +} +.icon-arrow-left { + background-position: -240px -96px; +} +.icon-arrow-right { + background-position: -264px -96px; +} +.icon-arrow-up { + background-position: -289px -96px; +} +.icon-arrow-down { + background-position: -312px -96px; +} +.icon-share-alt { + background-position: -336px -96px; +} +.icon-resize-full { + background-position: -360px -96px; +} +.icon-resize-small { + background-position: -384px -96px; +} +.icon-plus { + background-position: -408px -96px; +} +.icon-minus { + background-position: -433px -96px; +} +.icon-asterisk { + background-position: -456px -96px; +} +.icon-exclamation-sign { + background-position: 0 -120px; +} +.icon-gift { + background-position: -24px -120px; +} +.icon-leaf { + background-position: -48px -120px; +} +.icon-fire { + background-position: -72px -120px; +} +.icon-eye-open { + background-position: -96px -120px; +} +.icon-eye-close { + background-position: -120px -120px; +} +.icon-warning-sign { + background-position: -144px -120px; +} +.icon-plane { + background-position: -168px -120px; +} +.icon-calendar { + background-position: -192px -120px; +} +.icon-random { + background-position: -216px -120px; +} +.icon-comment { + background-position: -240px -120px; +} +.icon-magnet { + background-position: -264px -120px; +} +.icon-chevron-up { + background-position: -288px -120px; +} +.icon-chevron-down { + background-position: -313px -119px; +} +.icon-retweet { + background-position: -336px -120px; +} +.icon-shopping-cart { + background-position: -360px -120px; +} +.icon-folder-close { + background-position: -384px -120px; +} +.icon-folder-open { + background-position: -408px -120px; +} +.icon-resize-vertical { + background-position: -432px -119px; +} +.icon-resize-horizontal { + background-position: -456px -118px; +} +.dropdown { + position: relative; +} +.dropdown-toggle { + *margin-bottom: -3px; +} +.dropdown-toggle:active, .open .dropdown-toggle { + outline: 0; +} +.caret { + display: inline-block; + width: 0; + height: 0; + text-indent: -99999px; + *text-indent: 0; + vertical-align: top; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #000000; + opacity: 0.3; + filter: alpha(opacity=30); + content: "\2193"; +} +.dropdown .caret { + margin-top: 8px; + margin-left: 2px; +} +.dropdown:hover .caret, .open.dropdown .caret { + opacity: 1; + filter: alpha(opacity=100); +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + float: left; + display: none; + min-width: 160px; + max-width: 220px; + _width: 160px; + padding: 4px 0; + margin: 0; + list-style: none; + background-color: #ffffff; + border-color: #ccc; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 1px; + -webkit-border-radius: 0 0 5px 5px; + -moz-border-radius: 0 0 5px 5px; + border-radius: 0 0 5px 5px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + *border-right-width: 2px; + *border-bottom-width: 2px; +} +.dropdown-menu.bottom-up { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +.dropdown-menu .divider { + height: 1px; + margin: 5px 1px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; + *width: 100%; + *margin: -5px 0 5px; +} +.dropdown-menu a { + display: block; + padding: 3px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #555555; + white-space: nowrap; +} +.dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #0088cc; +} +.dropdown.open { + *z-index: 1000; +} +.dropdown.open .dropdown-toggle { + color: #ffffff; + background: #ccc; + background: rgba(0, 0, 0, 0.3); +} +.dropdown.open .dropdown-menu { + display: block; +} +.typeahead { + margin-top: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #eee; + border: 1px solid rgba(0, 0, 0, 0.05); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.fade { + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -ms-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; + opacity: 0; +} +.fade.in { + opacity: 1; +} +.collapse { + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -ms-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; + position: relative; + overflow: hidden; + height: 0; +} +.collapse.in { + height: auto; +} +.close { + float: right; + font-size: 20px; + font-weight: bold; + line-height: 18px; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover { + color: #000000; + text-decoration: none; + opacity: 0.4; + filter: alpha(opacity=40); + cursor: pointer; +} +.btn { + display: inline-block; + padding: 4px 10px 4px; + font-size: 13px; + line-height: 18px; + color: #333333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #fafafa; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + border: 1px solid #ccc; + border-bottom-color: #bbb; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + cursor: pointer; + *margin-left: .3em; +} +.btn:first-child { + *margin-left: 0; +} +.btn:hover { + color: #333333; + text-decoration: none; + background-color: #e6e6e6; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -ms-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} +.btn:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn.active, .btn:active { + background-image: none; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + background-color: #e6e6e6; + background-color: #d9d9d9 \9; + color: rgba(0, 0, 0, 0.5); + outline: 0; +} +.btn.disabled, .btn[disabled] { + cursor: default; + background-image: none; + background-color: #e6e6e6; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} +.btn-large { + padding: 9px 14px; + font-size: 15px; + line-height: normal; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.btn-large .icon { + margin-top: 1px; +} +.btn-small { + padding: 5px 9px; + font-size: 11px; + line-height: 16px; +} +.btn-small .icon { + margin-top: -1px; +} +.btn-primary, +.btn-primary:hover, +.btn-warning, +.btn-warning:hover, +.btn-danger, +.btn-danger:hover, +.btn-success, +.btn-success:hover, +.btn-info, +.btn-info:hover { + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + color: #ffffff; +} +.btn-primary.active, +.btn-warning.active, +.btn-danger.active, +.btn-success.active, +.btn-info.active { + color: rgba(255, 255, 255, 0.75); +} +.btn-primary { + background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -ms-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(top, #0088cc, #0044cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-primary:hover, +.btn-primary:active, +.btn-primary.active, +.btn-primary.disabled, +.btn-primary[disabled] { + background-color: #0044cc; +} +.btn-primary:active, .btn-primary.active { + background-color: #003399 \9; +} +.btn-warning { + background-color: #faa732; + background-image: -moz-linear-gradient(top, #fbb450, #f89406); + background-image: -ms-linear-gradient(top, #fbb450, #f89406); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); + background-image: -webkit-linear-gradient(top, #fbb450, #f89406); + background-image: -o-linear-gradient(top, #fbb450, #f89406); + background-image: linear-gradient(top, #fbb450, #f89406); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); + border-color: #f89406 #f89406 #ad6704; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-warning:hover, +.btn-warning:active, +.btn-warning.active, +.btn-warning.disabled, +.btn-warning[disabled] { + background-color: #f89406; +} +.btn-warning:active, .btn-warning.active { + background-color: #c67605 \9; +} +.btn-danger { + background-color: #da4f49; + background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); + background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); + background-image: linear-gradient(top, #ee5f5b, #bd362f); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0); + border-color: #bd362f #bd362f #802420; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-danger:hover, +.btn-danger:active, +.btn-danger.active, +.btn-danger.disabled, +.btn-danger[disabled] { + background-color: #bd362f; +} +.btn-danger:active, .btn-danger.active { + background-color: #942a25 \9; +} +.btn-success { + background-color: #5bb75b; + background-image: -moz-linear-gradient(top, #62c462, #51a351); + background-image: -ms-linear-gradient(top, #62c462, #51a351); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); + background-image: -webkit-linear-gradient(top, #62c462, #51a351); + background-image: -o-linear-gradient(top, #62c462, #51a351); + background-image: linear-gradient(top, #62c462, #51a351); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0); + border-color: #51a351 #51a351 #387038; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-success:hover, +.btn-success:active, +.btn-success.active, +.btn-success.disabled, +.btn-success[disabled] { + background-color: #51a351; +} +.btn-success:active, .btn-success.active { + background-color: #408140 \9; +} +.btn-info { + background-color: #49afcd; + background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); + background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); + background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); + background-image: linear-gradient(top, #5bc0de, #2f96b4); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0); + border-color: #2f96b4 #2f96b4 #1f6377; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.btn-info:hover, +.btn-info:active, +.btn-info.active, +.btn-info.disabled, +.btn-info[disabled] { + background-color: #2f96b4; +} +.btn-info:active, .btn-info.active { + background-color: #24748c \9; +} +button.btn, input[type="submit"].btn { + *padding-top: 2px; + *padding-bottom: 2px; +} +button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { + padding: 0; + border: 0; +} +button.btn.large, input[type="submit"].btn.large { + *padding-top: 7px; + *padding-bottom: 7px; +} +button.btn.small, input[type="submit"].btn.small { + *padding-top: 3px; + *padding-bottom: 3px; +} +.btn-group { + position: relative; + *zoom: 1; + *margin-left: .3em; +} +.btn-group:before, .btn-group:after { + display: table; + content: ""; +} +.btn-group:after { + clear: both; +} +.btn-group:first-child { + *margin-left: 0; +} +.btn-group + .btn-group { + margin-left: 5px; +} +.btn-toolbar { + margin-top: 9px; + margin-bottom: 9px; +} +.btn-toolbar .btn-group { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; +} +.btn-group .btn { + position: relative; + float: left; + margin-left: -1px; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.btn-group .btn:first-child { + margin-left: 0; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.btn-group .btn:last-child, .btn-group .dropdown-toggle { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; +} +.btn-group .btn.large:first-child { + margin-left: 0; + -webkit-border-top-left-radius: 6px; + -moz-border-radius-topleft: 6px; + border-top-left-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -moz-border-radius-bottomleft: 6px; + border-bottom-left-radius: 6px; +} +.btn-group .btn.large:last-child, .btn-group .large.dropdown-toggle { + -webkit-border-top-right-radius: 6px; + -moz-border-radius-topright: 6px; + border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + -moz-border-radius-bottomright: 6px; + border-bottom-right-radius: 6px; +} +.btn-group .btn:hover, +.btn-group .btn:focus, +.btn-group .btn:active, +.btn-group .btn.active { + z-index: 2; +} +.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; + -webkit-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.125), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + *padding-top: 5px; + *padding-bottom: 5px; +} +.btn-group.open { + *z-index: 1000; +} +.btn-group.open .dropdown-menu { + display: block; + margin-top: 1px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.btn-group.open .dropdown-toggle { + background-image: none; + -webkit-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} +.btn .caret { + margin-top: 7px; + margin-left: 0; +} +.btn:hover .caret, .open.btn-group .caret { + opacity: 1; + filter: alpha(opacity=100); +} +.btn-primary .caret, +.btn-danger .caret, +.btn-info .caret, +.btn-success .caret { + border-top-color: #ffffff; + opacity: 0.75; + filter: alpha(opacity=75); +} +.btn-small .caret { + margin-top: 4px; +} +.alert { + padding: 8px 35px 8px 14px; + margin-bottom: 18px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: #fcf8e3; + border: 1px solid #fbeed5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.alert, .alert-heading { + color: #c09853; +} +.alert .close { + position: relative; + top: -2px; + right: -21px; + line-height: 18px; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success, .alert-success .alert-heading { + color: #468847; +} +.alert-danger, .alert-error { + background-color: #f2dede; + border-color: #eed3d7; +} +.alert-danger, +.alert-error, +.alert-danger .alert-heading, +.alert-error .alert-heading { + color: #b94a48; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info, .alert-info .alert-heading { + color: #3a87ad; +} +.alert-block { + padding-top: 14px; + padding-bottom: 14px; +} +.alert-block > p, .alert-block > ul { + margin-bottom: 0; +} +.alert-block p + p { + margin-top: 5px; +} +.nav { + margin-left: 0; + margin-bottom: 18px; + list-style: none; +} +.nav > li > a { + display: block; +} +.nav > li > a:hover { + text-decoration: none; + background-color: #eeeeee; +} +.nav-list { + padding-left: 14px; + padding-right: 14px; + margin-bottom: 0; +} +.nav-list > li > a, .nav-list .nav-header { + display: block; + padding: 3px 15px; + margin-left: -15px; + margin-right: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} +.nav-list .nav-header { + font-size: 11px; + font-weight: bold; + line-height: 18px; + color: #999999; + text-transform: uppercase; +} +.nav-list > li + .nav-header { + margin-top: 9px; +} +.nav-list .active > a, .nav-list .active > a:hover { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; +} +.nav-list [class^="icon-"] { + margin-right: 2px; +} +.nav-tabs, .nav-pills { + *zoom: 1; +} +.nav-tabs:before, +.nav-pills:before, +.nav-tabs:after, +.nav-pills:after { + display: table; + content: ""; +} +.nav-tabs:after, .nav-pills:after { + clear: both; +} +.nav-tabs > li, .nav-pills > li { + float: left; +} +.nav-tabs > li > a, .nav-pills > li > a { + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + margin-bottom: -1px; +} +.nav-tabs > li > a { + padding-top: 9px; + padding-bottom: 9px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > .active > a, .nav-tabs > .active > a:hover { + color: #555555; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-pills > li > a { + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.nav-pills .active > a, .nav-pills .active > a:hover { + color: #ffffff; + background-color: #0088cc; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li > a { + margin-right: 0; +} +.nav-tabs.nav-stacked { + border-bottom: 0; +} +.nav-tabs.nav-stacked > li > a { + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.nav-tabs.nav-stacked > li:first-child > a { + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.nav-tabs.nav-stacked > li:last-child > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.nav-tabs.nav-stacked > li > a:hover { + border-color: #ddd; + z-index: 2; +} +.nav-pills.nav-stacked > li > a { + margin-bottom: 3px; +} +.nav-pills.nav-stacked > li:last-child > a { + margin-bottom: 1px; +} +.nav-tabs .dropdown-menu, .nav-pills .dropdown-menu { + margin-top: 1px; + border-width: 1px; +} +.nav-pills .dropdown-menu { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.nav-tabs .dropdown-toggle .caret, .nav-pills .dropdown-toggle .caret { + border-top-color: #0088cc; + margin-top: 6px; +} +.nav-tabs .dropdown-toggle:hover .caret, .nav-pills .dropdown-toggle:hover .caret { + border-top-color: #005580; +} +.nav-tabs .active .dropdown-toggle .caret, .nav-pills .active .dropdown-toggle .caret { + border-top-color: #333333; +} +.nav > .dropdown.active > a:hover { + color: #000000; + cursor: pointer; +} +.nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > .open.active > a:hover { + color: #ffffff; + background-color: #999999; + border-color: #999999; +} +.nav .open .caret, .nav .open.active .caret, .nav .open a:hover .caret { + border-top-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); +} +.tabs-stacked .open > a:hover { + border-color: #999999; +} +.tabbable { + *zoom: 1; +} +.tabbable:before, .tabbable:after { + display: table; + content: ""; +} +.tabbable:after { + clear: both; +} +.tabs-below .nav-tabs, .tabs-right .nav-tabs, .tabs-left .nav-tabs { + border-bottom: 0; +} +.tab-content > .tab-pane, .pill-content > .pill-pane { + display: none; +} +.tab-content > .active, .pill-content > .active { + display: block; +} +.tabs-below .nav-tabs { + border-top: 1px solid #ddd; +} +.tabs-below .nav-tabs > li { + margin-top: -1px; + margin-bottom: 0; +} +.tabs-below .nav-tabs > li > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.tabs-below .nav-tabs > li > a:hover { + border-bottom-color: transparent; + border-top-color: #ddd; +} +.tabs-below .nav-tabs .active > a, .tabs-below .nav-tabs .active > a:hover { + border-color: transparent #ddd #ddd #ddd; +} +.tabs-left .nav-tabs > li, .tabs-right .nav-tabs > li { + float: none; +} +.tabs-left .nav-tabs > li > a, .tabs-right .nav-tabs > li > a { + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; +} +.tabs-left .nav-tabs { + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; +} +.tabs-left .nav-tabs > li > a { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.tabs-left .nav-tabs > li > a:hover { + border-color: #eeeeee #dddddd #eeeeee #eeeeee; +} +.tabs-left .nav-tabs .active > a, .tabs-left .nav-tabs .active > a:hover { + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; +} +.tabs-right .nav-tabs { + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; +} +.tabs-right .nav-tabs > li > a { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.tabs-right .nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #eeeeee #dddddd; +} +.tabs-right .nav-tabs .active > a, .tabs-right .nav-tabs .active > a:hover { + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; +} +.navbar { + overflow: visible; + margin-bottom: 18px; +} +.navbar-inner { + padding-left: 20px; + padding-right: 20px; + background-color: #2c2c2c; + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); +} +.btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-left: 5px; + margin-right: 5px; + background-color: #2c2c2c; + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + border-color: #222222 #222222 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} +.btn-navbar:hover, +.btn-navbar:active, +.btn-navbar.active, +.btn-navbar.disabled, +.btn-navbar[disabled] { + background-color: #222222; +} +.btn-navbar:active, .btn-navbar.active { + background-color: #080808 \9; +} +.btn-navbar .icon-bar { + display: block; + width: 18px; + height: 2px; + background-color: #f5f5f5; + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); +} +.btn-navbar .icon-bar + .icon-bar { + margin-top: 3px; +} +.nav-collapse.collapse { + height: auto; +} +.navbar .brand:hover { + text-decoration: none; +} +.navbar .brand { + float: left; + display: block; + padding: 8px 20px 12px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + line-height: 1; + color: #ffffff; +} +.navbar .navbar-text { + margin-bottom: 0; + line-height: 40px; + color: #999999; +} +.navbar .navbar-text a:hover { + color: #ffffff; + background-color: transparent; +} +.navbar .btn, .navbar .btn-group { + margin-top: 5px; +} +.navbar .btn-group .btn { + margin-top: 0; +} +.navbar-form { + margin-bottom: 0; + *zoom: 1; +} +.navbar-form:before, .navbar-form:after { + display: table; + content: ""; +} +.navbar-form:after { + clear: both; +} +.navbar-form input, .navbar-form select { + display: inline-block; + margin-top: 5px; + margin-bottom: 0; +} +.navbar-form .radio, .navbar-form .checkbox { + margin-top: 5px; +} +.navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { + margin-top: 3px; +} +.navbar-search { + position: relative; + float: left; + margin-top: 6px; + margin-bottom: 0; +} +.navbar-search .search-query { + padding: 4px 9px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1; + color: #ffffff; + color: rgba(255, 255, 255, 0.75); + background: #666; + background: rgba(255, 255, 255, 0.3); + border: 1px solid #111; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.15); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.15); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.15); + -webkit-transition: none; + -moz-transition: none; + -ms-transition: none; + -o-transition: none; + transition: none; +} +.navbar-search .search-query :-moz-placeholder { + color: #eeeeee; +} +.navbar-search .search-query::-webkit-input-placeholder { + color: #eeeeee; +} +.navbar-search .search-query:hover { + color: #ffffff; + background-color: #999999; + background-color: rgba(255, 255, 255, 0.5); +} +.navbar-search .search-query:focus, .navbar-search .search-query.focused { + padding: 5px 10px; + color: #333333; + text-shadow: 0 1px 0 #ffffff; + background-color: #ffffff; + border: 0; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + outline: 0; +} +.navbar-fixed-top { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; +} +.navbar-fixed-top .navbar-inner { + padding-left: 0; + padding-right: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.navbar .nav { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} +.navbar .nav.pull-right { + float: right; +} +.navbar .nav > li { + display: block; + float: left; +} +.navbar .nav > li > a { + float: none; + padding: 10px 10px 11px; + line-height: 19px; + color: #999999; + text-decoration: none; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +.navbar .nav > li > a:hover { + background-color: transparent; + color: #ffffff; + text-decoration: none; +} +.navbar .nav .active > a, .navbar .nav .active > a:hover { + color: #ffffff; + text-decoration: none; + background-color: #222222; + background-color: rgba(0, 0, 0, 0.5); +} +.navbar .divider-vertical { + height: 40px; + width: 1px; + margin: 0 9px; + overflow: hidden; + background-color: #222222; + border-right: 1px solid #333333; +} +.navbar .nav.pull-right { + margin-left: 10px; + margin-right: 0; +} +.navbar .dropdown-menu { + margin-top: 1px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.navbar .dropdown-menu:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; + top: -7px; + left: 9px; +} +.navbar .dropdown-menu:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + position: absolute; + top: -6px; + left: 10px; +} +.navbar .nav .dropdown-toggle .caret, .navbar .nav .open.dropdown .caret { + border-top-color: #ffffff; +} +.navbar .nav .active .caret { + opacity: 1; + filter: alpha(opacity=100); +} +.navbar .nav .open > .dropdown-toggle, .navbar .nav .active > .dropdown-toggle, .navbar .nav .open.active > .dropdown-toggle { + background-color: transparent; +} +.navbar .nav .active > .dropdown-toggle:hover { + color: #ffffff; +} +.navbar .nav.pull-right .dropdown-menu { + left: auto; + right: 0; +} +.navbar .nav.pull-right .dropdown-menu:before { + left: auto; + right: 12px; +} +.navbar .nav.pull-right .dropdown-menu:after { + left: auto; + right: 13px; +} +.breadcrumb { + padding: 7px 14px; + margin: 0 0 18px; + background-color: #fbfbfb; + background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5)); + background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); + background-image: linear-gradient(top, #ffffff, #f5f5f5); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); + border: 1px solid #ddd; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} +.breadcrumb li { + display: inline; + text-shadow: 0 1px 0 #ffffff; +} +.breadcrumb .divider { + padding: 0 5px; + color: #999999; +} +.breadcrumb .active a { + color: #333333; +} +.pagination { + height: 36px; + margin: 18px 0; +} +.pagination ul { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + margin-left: 0; + margin-bottom: 0; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); +} +.pagination li { + display: inline; +} +.pagination a { + float: left; + padding: 0 14px; + line-height: 34px; + text-decoration: none; + border: 1px solid #ddd; + border-left-width: 0; +} +.pagination a:hover, .pagination .active a { + background-color: #f5f5f5; +} +.pagination .active a { + color: #999999; + cursor: default; +} +.pagination .disabled a, .pagination .disabled a:hover { + color: #999999; + background-color: transparent; + cursor: default; +} +.pagination li:first-child a { + border-left-width: 1px; + -webkit-border-radius: 3px 0 0 3px; + -moz-border-radius: 3px 0 0 3px; + border-radius: 3px 0 0 3px; +} +.pagination li:last-child a { + -webkit-border-radius: 0 3px 3px 0; + -moz-border-radius: 0 3px 3px 0; + border-radius: 0 3px 3px 0; +} +.pagination-centered { + text-align: center; +} +.pagination-right { + text-align: right; +} +.pager { + margin-left: 0; + margin-bottom: 18px; + list-style: none; + text-align: center; + *zoom: 1; +} +.pager:before, .pager:after { + display: table; + content: ""; +} +.pager:after { + clear: both; +} +.pager li { + display: inline; +} +.pager a { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; +} +.pager a:hover { + text-decoration: none; + background-color: #f5f5f5; +} +.pager .next a { + float: right; +} +.pager .previous a { + float: left; +} +.modal-open .dropdown-menu { + z-index: 2050; +} +.modal-open .dropdown.open { + *z-index: 2050; +} +.modal-open .popover { + z-index: 2060; +} +.modal-open .tooltip { + z-index: 2070; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; +} +.modal-backdrop, .modal-backdrop.fade.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.modal { + position: fixed; + top: 50%; + left: 50%; + z-index: 1050; + max-height: 500px; + overflow: auto; + width: 560px; + margin: -250px 0 0 -280px; + background-color: #ffffff; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, 0.3); + *border: 1px solid #999; + /* IE6-7 */ + + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.modal.fade { + -webkit-transition: opacity .3s linear, top .3s ease-out; + -moz-transition: opacity .3s linear, top .3s ease-out; + -ms-transition: opacity .3s linear, top .3s ease-out; + -o-transition: opacity .3s linear, top .3s ease-out; + transition: opacity .3s linear, top .3s ease-out; + top: -25%; +} +.modal.fade.in { + top: 50%; +} +.modal-header { + padding: 9px 15px; + border-bottom: 1px solid #eee; +} +.modal-header .close { + margin-top: 2px; +} +.modal-body { + padding: 15px; +} +.modal-footer { + padding: 14px 15px 15px; + margin-bottom: 0; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; + *zoom: 1; +} +.modal-footer:before, .modal-footer:after { + display: table; + content: ""; +} +.modal-footer:after { + clear: both; +} +.modal-footer .btn { + float: right; + margin-left: 5px; + margin-bottom: 0; +} +.tooltip { + position: absolute; + z-index: 1020; + display: block; + visibility: visible; + padding: 5px; + font-size: 11px; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.8; + filter: alpha(opacity=80); +} +.tooltip.top { + margin-top: -2px; +} +.tooltip.right { + margin-left: 2px; +} +.tooltip.bottom { + margin-top: 2px; +} +.tooltip.left { + margin-left: -2px; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + padding: 5px; +} +.popover.top { + margin-top: -5px; +} +.popover.right { + margin-left: 5px; +} +.popover.bottom { + margin-top: 5px; +} +.popover.left { + margin-left: -5px; +} +.popover.top .arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid #000000; +} +.popover.right .arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-right: 5px solid #000000; +} +.popover.bottom .arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-bottom: 5px solid #000000; +} +.popover.left .arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-top: 5px solid transparent; + border-bottom: 5px solid transparent; + border-left: 5px solid #000000; +} +.popover .arrow { + position: absolute; + width: 0; + height: 0; +} +.popover-inner { + padding: 3px; + width: 280px; + overflow: hidden; + background: #000000; + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); +} +.popover-title { + padding: 9px 15px; + line-height: 1; + background-color: #f5f5f5; + border-bottom: 1px solid #eee; + -webkit-border-radius: 3px 3px 0 0; + -moz-border-radius: 3px 3px 0 0; + border-radius: 3px 3px 0 0; +} +.popover-content { + padding: 14px; + background-color: #ffffff; + -webkit-border-radius: 0 0 3px 3px; + -moz-border-radius: 0 0 3px 3px; + border-radius: 0 0 3px 3px; + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.popover-content p, .popover-content ul, .popover-content ol { + margin-bottom: 0; +} +.thumbnails { + margin-left: -20px; + list-style: none; + *zoom: 1; +} +.thumbnails:before, .thumbnails:after { + display: table; + content: ""; +} +.thumbnails:after { + clear: both; +} +.thumbnails > li { + float: left; + margin: 0 0 18px 20px; +} +.thumbnail { + display: block; + padding: 4px; + line-height: 1; + border: 1px solid #ddd; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); +} +a.thumbnail:hover { + border-color: #0088cc; + -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); +} +.thumbnail > img { + display: block; + max-width: 100%; + margin-left: auto; + margin-right: auto; +} +.thumbnail .caption { + padding: 9px; +} +.label { + padding: 1px 3px 2px; + font-size: 9.75px; + font-weight: bold; + color: #ffffff; + text-transform: uppercase; + background-color: #999999; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.label-important { + background-color: #b94a48; +} +.label-warning { + background-color: #f89406; +} +.label-success { + background-color: #468847; +} +.label-info { + background-color: #3a87ad; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +@-moz-keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 0 0; + } + to { + background-position: 40px 0; + } +} +.progress { + overflow: hidden; + height: 18px; + margin-bottom: 18px; + background-color: #f7f7f7; + background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); + background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); + background-image: linear-gradient(top, #f5f5f5, #f9f9f9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0); + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.progress .bar { + width: 0%; + height: 18px; + color: #ffffff; + font-size: 12px; + text-align: center; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #0e90d2; + background-image: -moz-linear-gradient(top, #149bdf, #0480be); + background-image: -ms-linear-gradient(top, #149bdf, #0480be); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); + background-image: -webkit-linear-gradient(top, #149bdf, #0480be); + background-image: -o-linear-gradient(top, #149bdf, #0480be); + background-image: linear-gradient(top, #149bdf, #0480be); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0); + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transition: width 0.6s ease; + -moz-transition: width 0.6s ease; + -ms-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .bar { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + -moz-background-size: 40px 40px; + -o-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -moz-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-danger .bar { + background-color: #dd514c; + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(top, #ee5f5b, #c43c35); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); +} +.progress-danger.progress-striped .bar { + background-color: #ee5f5b; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-success .bar { + background-color: #5eb95e; + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -ms-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(top, #62c462, #57a957); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); +} +.progress-success.progress-striped .bar { + background-color: #62c462; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-info .bar { + background-color: #4bb1cf; + background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); + background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); + background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); + background-image: -o-linear-gradient(top, #5bc0de, #339bb9); + background-image: linear-gradient(top, #5bc0de, #339bb9); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); +} +.progress-info.progress-striped .bar { + background-color: #5bc0de; + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.accordion { + margin-bottom: 18px; +} +.accordion-group { + margin-bottom: 2px; + border: 1px solid #e5e5e5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.accordion-heading { + border-bottom: 0; +} +.accordion-heading .accordion-toggle { + display: block; + padding: 8px 15px; +} +.accordion-inner { + padding: 9px 15px; + border-top: 1px solid #e5e5e5; +} +.carousel { + position: relative; + margin-bottom: 18px; + line-height: 1; +} +.carousel-inner { + overflow: hidden; + width: 100%; + position: relative; +} +.carousel .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -moz-transition: 0.6s ease-in-out left; + -ms-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel .item > img { + display: block; + line-height: 1; +} +.carousel .active, .carousel .next, .carousel .prev { + display: block; +} +.carousel .active { + left: 0; +} +.carousel .next, .carousel .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel .next { + left: 100%; +} +.carousel .prev { + left: -100%; +} +.carousel .next.left, .carousel .prev.right { + left: 0; +} +.carousel .active.left { + left: -100%; +} +.carousel .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 40%; + left: 15px; + width: 40px; + height: 40px; + margin-top: -20px; + font-size: 60px; + font-weight: 100; + line-height: 30px; + color: #ffffff; + text-align: center; + background: #222222; + border: 3px solid #ffffff; + -webkit-border-radius: 23px; + -moz-border-radius: 23px; + border-radius: 23px; + opacity: 0.5; + filter: alpha(opacity=50); +} +.carousel-control.right { + left: auto; + right: 15px; +} +.carousel-control:hover { + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-caption { + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: 10px 15px 5px; + background: #333333; + background: rgba(0, 0, 0, 0.75); +} +.carousel-caption h4, .carousel-caption p { + color: #ffffff; +} +.hero-unit { + padding: 60px; + margin-bottom: 30px; + background-color: #f5f5f5; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.hero-unit h1 { + margin-bottom: 0; + font-size: 60px; + line-height: 1; + letter-spacing: -1px; +} +.hero-unit p { + font-size: 18px; + font-weight: 200; + line-height: 27px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.hide { + display: none; +} +.show { + display: block; +} +.invisible { + visibility: hidden; +} diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap.min.css b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap.min.css new file mode 100644 index 00000000000..b01f92e6ecb --- /dev/null +++ b/Examples/Ajax/MooToolsExample/WebServerResources/css/bootstrap.min.css @@ -0,0 +1,610 @@ +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:hover,a:active{outline:0;} +sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{max-width:100%;height:auto;border:0;-ms-interpolation-mode:bicubic;} +button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} +button,input{*overflow:visible;line-height:normal;} +button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;} +a{color:#0088cc;text-decoration:none;} +a:hover{color:#005580;text-decoration:underline;} +.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} +.row:after{clear:both;} +[class*="span"]{float:left;margin-left:20px;} +.span1{width:60px;} +.span2{width:140px;} +.span3{width:220px;} +.span4{width:300px;} +.span5{width:380px;} +.span6{width:460px;} +.span7{width:540px;} +.span8{width:620px;} +.span9{width:700px;} +.span10{width:780px;} +.span11{width:860px;} +.span12,.container{width:940px;} +.offset1{margin-left:100px;} +.offset2{margin-left:180px;} +.offset3{margin-left:260px;} +.offset4{margin-left:340px;} +.offset5{margin-left:420px;} +.offset6{margin-left:500px;} +.offset7{margin-left:580px;} +.offset8{margin-left:660px;} +.offset9{margin-left:740px;} +.offset10{margin-left:820px;} +.offset11{margin-left:900px;} +.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} +.row-fluid:after{clear:both;} +.row-fluid>[class*="span"]{float:left;margin-left:2.127659574%;} +.row-fluid>[class*="span"]:first-child{margin-left:0;} +.row-fluid .span1{width:6.382978723%;} +.row-fluid .span2{width:14.89361702%;} +.row-fluid .span3{width:23.404255317%;} +.row-fluid .span4{width:31.914893614%;} +.row-fluid .span5{width:40.425531911%;} +.row-fluid .span6{width:48.93617020799999%;} +.row-fluid .span7{width:57.446808505%;} +.row-fluid .span8{width:65.95744680199999%;} +.row-fluid .span9{width:74.468085099%;} +.row-fluid .span10{width:82.97872339599999%;} +.row-fluid .span11{width:91.489361693%;} +.row-fluid .span12{width:99.99999998999999%;} +.container{width:940px;margin-left:auto;margin-right:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";} +.container:after{clear:both;} +.container-fluid{padding-left:20px;padding-right:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";} +.container-fluid:after{clear:both;} +p{margin:0 0 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p small{font-size:11px;color:#999999;} +.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;} +h1,h2,h3,h4,h5,h6{margin:0;font-weight:bold;color:#333333;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;} +h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;} +h3{line-height:27px;font-size:18px;}h3 small{font-size:14px;} +h4,h5,h6{line-height:18px;} +h4{font-size:14px;}h4 small{font-size:12px;} +h5{font-size:12px;} +h6{font-size:11px;color:#999999;text-transform:uppercase;} +.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;} +.page-header h1{line-height:1;} +ul,ol{padding:0;margin:0 0 9px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +ul{list-style:disc;} +ol{list-style:decimal;} +li{line-height:18px;} +ul.unstyled{margin-left:0;list-style:none;} +dl{margin-bottom:18px;} +dt,dd{line-height:18px;} +dt{font-weight:bold;} +dd{margin-left:9px;} +hr{margin:18px 0;border:0;border-top:1px solid #e5e5e5;border-bottom:1px solid #ffffff;} +strong{font-weight:bold;} +em{font-style:italic;} +.muted{color:#999999;} +abbr{font-size:90%;text-transform:uppercase;border-bottom:1px dotted #ddd;cursor:help;} +blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;} +blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} +blockquote.pull-right{float:right;padding-left:0;padding-right:15px;border-left:0;border-right:5px solid #eeeeee;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +address{display:block;margin-bottom:18px;line-height:18px;font-style:normal;} +small{font-size:100%;} +cite{font-style:normal;} +code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{padding:3px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} +pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12px;line-height:18px;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;white-space:pre;white-space:pre-wrap;word-break:break-all;}pre.prettyprint{margin-bottom:18px;} +pre code{padding:0;background-color:transparent;} +form{margin:0 0 18px;} +fieldset{padding:0;margin:0;border:0;} +legend{display:block;width:100%;padding:0;margin-bottom:27px;font-size:19.5px;line-height:36px;color:#333333;border:0;border-bottom:1px solid #eee;} +label,input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:18px;} +label{display:block;margin-bottom:5px;color:#333333;} +input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555555;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.uneditable-textarea{width:auto;height:auto;} +label input,label textarea,label select{display:block;} +input[type="image"],input[type="checkbox"],input[type="radio"]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;border:0;cursor:pointer;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +input[type="file"]{padding:initial;line-height:initial;border:initial;background-color:#ffffff;background-color:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +input[type="button"],input[type="reset"],input[type="submit"]{width:auto;height:auto;} +select,input[type="file"]{height:28px;*margin-top:4px;line-height:28px;} +select{width:220px;background-color:#ffffff;} +select[multiple],select[size]{height:auto;} +input[type="image"]{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +textarea{height:auto;} +input[type="hidden"]{display:none;} +.radio,.checkbox{padding-left:18px;} +.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;} +.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;} +.radio.inline,.checkbox.inline{display:inline-block;margin-bottom:0;vertical-align:middle;} +.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;} +.controls>.radio.inline:first-child,.controls>.checkbox.inline:first-child{padding-top:0;} +input,textarea{-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;} +input:focus,textarea:focus{border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);outline:0;outline:thin dotted \9;} +input[type="file"]:focus,input[type="checkbox"]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.input-mini{width:60px;} +.input-small{width:90px;} +.input-medium{width:150px;} +.input-large{width:210px;} +.input-xlarge{width:270px;} +.input-xxlarge{width:530px;} +input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{float:none;margin-left:0;} +input.span1,textarea.span1,.uneditable-input.span1{width:50px;} +input.span2,textarea.span2,.uneditable-input.span2{width:130px;} +input.span3,textarea.span3,.uneditable-input.span3{width:210px;} +input.span4,textarea.span4,.uneditable-input.span4{width:290px;} +input.span5,textarea.span5,.uneditable-input.span5{width:370px;} +input.span6,textarea.span6,.uneditable-input.span6{width:450px;} +input.span7,textarea.span7,.uneditable-input.span7{width:530px;} +input.span8,textarea.span8,.uneditable-input.span8{width:610px;} +input.span9,textarea.span9,.uneditable-input.span9{width:690px;} +input.span10,textarea.span10,.uneditable-input.span10{width:770px;} +input.span11,textarea.span11,.uneditable-input.span11{width:850px;} +input.span12,textarea.span12,.uneditable-input.span12{width:930px;} +input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#f5f5f5;border-color:#ddd;cursor:not-allowed;} +.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;} +.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:0 0 6px #dbc59e;-moz-box-shadow:0 0 6px #dbc59e;box-shadow:0 0 6px #dbc59e;} +.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;} +.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;} +.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:0 0 6px #d59392;-moz-box-shadow:0 0 6px #d59392;box-shadow:0 0 6px #d59392;} +.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;} +.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;} +.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:0 0 6px #7aba7b;-moz-box-shadow:0 0 6px #7aba7b;box-shadow:0 0 6px #7aba7b;} +.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;} +input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} +.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#f5f5f5;border-top:1px solid #ddd;} +.uneditable-input{display:block;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} +:-moz-placeholder{color:#999999;} +::-webkit-input-placeholder{color:#999999;} +.help-block{margin-top:5px;margin-bottom:0;color:#999999;} +.help-inline{display:inline-block;*display:inline;*zoom:1;margin-bottom:9px;vertical-align:middle;padding-left:5px;} +.input-prepend,.input-append{margin-bottom:5px;*zoom:1;}.input-prepend:before,.input-append:before,.input-prepend:after,.input-append:after{display:table;content:"";} +.input-prepend:after,.input-append:after{clear:both;} +.input-prepend input,.input-append input,.input-prepend .uneditable-input,.input-append .uneditable-input{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus{position:relative;z-index:2;} +.input-prepend .uneditable-input,.input-append .uneditable-input{border-left-color:#ccc;} +.input-prepend .add-on,.input-append .add-on{float:left;display:block;width:auto;min-width:16px;height:18px;margin-right:-1px;padding:4px 5px;font-weight:normal;line-height:18px;color:#999999;text-align:center;text-shadow:0 1px 0 #ffffff;background-color:#f5f5f5;border:1px solid #ccc;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend .active,.input-append .active{background-color:#a9dba9;border-color:#46a546;} +.input-prepend .add-on{*margin-top:1px;} +.input-append input,.input-append .uneditable-input{float:left;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-append .uneditable-input{border-right-color:#ccc;} +.input-append .add-on{margin-right:0;margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.input-append input:first-child{*margin-left:-160px;}.input-append input:first-child+.add-on{*margin-left:-21px;} +.search-query{padding-left:14px;padding-right:14px;margin-bottom:0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;} +.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input{display:inline-block;margin-bottom:0;} +.form-search label,.form-inline label,.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{display:inline-block;} +.form-search .input-append .add-on,.form-inline .input-prepend .add-on,.form-search .input-append .add-on,.form-inline .input-prepend .add-on{vertical-align:middle;} +.control-group{margin-bottom:9px;} +.form-horizontal legend+.control-group{margin-top:18px;-webkit-margin-top-collapse:separate;} +.form-horizontal .control-group{margin-bottom:18px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";} +.form-horizontal .control-group:after{clear:both;} +.form-horizontal .control-group>label{float:left;width:140px;padding-top:5px;text-align:right;} +.form-horizontal .controls{margin-left:160px;} +.form-horizontal .form-actions{padding-left:160px;} +table{max-width:100%;border-collapse:collapse;border-spacing:0;} +.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;border-top:1px solid #ddd;} +.table th{font-weight:bold;vertical-align:bottom;} +.table td{vertical-align:top;} +.table thead:first-child tr th,.table thead:first-child tr td{border-top:0;} +.table tbody+tbody{border-top:2px solid #ddd;} +.table-condensed th,.table-condensed td{padding:4px 5px;} +.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapsed;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th+th,.table-bordered td+td,.table-bordered th+td,.table-bordered td+th{border-left:1px solid #ddd;} +.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} +.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;} +.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;} +.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;} +.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;} +.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +table .span1{float:none;width:44px;margin-left:0;} +table .span2{float:none;width:124px;margin-left:0;} +table .span3{float:none;width:204px;margin-left:0;} +table .span4{float:none;width:284px;margin-left:0;} +table .span5{float:none;width:364px;margin-left:0;} +table .span6{float:none;width:444px;margin-left:0;} +table .span7{float:none;width:524px;margin-left:0;} +table .span8{float:none;width:604px;margin-left:0;} +table .span9{float:none;width:684px;margin-left:0;} +table .span10{float:none;width:764px;margin-left:0;} +table .span11{float:none;width:844px;margin-left:0;} +table .span12{float:none;width:924px;margin-left:0;} +[class^="icon-"]{display:inline-block;width:14px;height:14px;vertical-align:text-top;background-image:url(../img/glyphicons-halflings.png);background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child{*margin-left:0;} +.icon-white{background-image:url(../img/glyphicons-halflings-white.png);} +.icon-glass{background-position:0 0;} +.icon-music{background-position:-24px 0;} +.icon-search{background-position:-48px 0;} +.icon-envelope{background-position:-72px 0;} +.icon-heart{background-position:-96px 0;} +.icon-star{background-position:-120px 0;} +.icon-star-empty{background-position:-144px 0;} +.icon-user{background-position:-168px 0;} +.icon-film{background-position:-192px 0;} +.icon-th-large{background-position:-216px 0;} +.icon-th{background-position:-240px 0;} +.icon-th-list{background-position:-264px 0;} +.icon-ok{background-position:-288px 0;} +.icon-remove{background-position:-312px 0;} +.icon-zoom-in{background-position:-336px 0;} +.icon-zoom-out{background-position:-360px 0;} +.icon-off{background-position:-384px 0;} +.icon-signal{background-position:-408px 0;} +.icon-cog{background-position:-432px 0;} +.icon-trash{background-position:-456px 0;} +.icon-home{background-position:0 -24px;} +.icon-file{background-position:-24px -24px;} +.icon-time{background-position:-48px -24px;} +.icon-road{background-position:-72px -24px;} +.icon-download-alt{background-position:-96px -24px;} +.icon-download{background-position:-120px -24px;} +.icon-upload{background-position:-144px -24px;} +.icon-inbox{background-position:-168px -24px;} +.icon-play-circle{background-position:-192px -24px;} +.icon-repeat{background-position:-216px -24px;} +.icon-refresh{background-position:-240px -24px;} +.icon-list-alt{background-position:-264px -24px;} +.icon-lock{background-position:-287px -24px;} +.icon-flag{background-position:-312px -24px;} +.icon-headphones{background-position:-336px -24px;} +.icon-volume-off{background-position:-360px -24px;} +.icon-volume-down{background-position:-384px -24px;} +.icon-volume-up{background-position:-408px -24px;} +.icon-qrcode{background-position:-432px -24px;} +.icon-barcode{background-position:-456px -24px;} +.icon-tag{background-position:0 -48px;} +.icon-tags{background-position:-25px -48px;} +.icon-book{background-position:-48px -48px;} +.icon-bookmark{background-position:-72px -48px;} +.icon-print{background-position:-96px -48px;} +.icon-camera{background-position:-120px -48px;} +.icon-font{background-position:-144px -48px;} +.icon-bold{background-position:-167px -48px;} +.icon-italic{background-position:-192px -48px;} +.icon-text-height{background-position:-216px -48px;} +.icon-text-width{background-position:-240px -48px;} +.icon-align-left{background-position:-264px -48px;} +.icon-align-center{background-position:-288px -48px;} +.icon-align-right{background-position:-312px -48px;} +.icon-align-justify{background-position:-336px -48px;} +.icon-list{background-position:-360px -48px;} +.icon-indent-left{background-position:-384px -48px;} +.icon-indent-right{background-position:-408px -48px;} +.icon-facetime-video{background-position:-432px -48px;} +.icon-picture{background-position:-456px -48px;} +.icon-pencil{background-position:0 -72px;} +.icon-map-marker{background-position:-24px -72px;} +.icon-adjust{background-position:-48px -72px;} +.icon-tint{background-position:-72px -72px;} +.icon-edit{background-position:-96px -72px;} +.icon-share{background-position:-120px -72px;} +.icon-check{background-position:-144px -72px;} +.icon-move{background-position:-168px -72px;} +.icon-step-backward{background-position:-192px -72px;} +.icon-fast-backward{background-position:-216px -72px;} +.icon-backward{background-position:-240px -72px;} +.icon-play{background-position:-264px -72px;} +.icon-pause{background-position:-288px -72px;} +.icon-stop{background-position:-312px -72px;} +.icon-forward{background-position:-336px -72px;} +.icon-fast-forward{background-position:-360px -72px;} +.icon-step-forward{background-position:-384px -72px;} +.icon-eject{background-position:-408px -72px;} +.icon-chevron-left{background-position:-432px -72px;} +.icon-chevron-right{background-position:-456px -72px;} +.icon-plus-sign{background-position:0 -96px;} +.icon-minus-sign{background-position:-24px -96px;} +.icon-remove-sign{background-position:-48px -96px;} +.icon-ok-sign{background-position:-72px -96px;} +.icon-question-sign{background-position:-96px -96px;} +.icon-info-sign{background-position:-120px -96px;} +.icon-screenshot{background-position:-144px -96px;} +.icon-remove-circle{background-position:-168px -96px;} +.icon-ok-circle{background-position:-192px -96px;} +.icon-ban-circle{background-position:-216px -96px;} +.icon-arrow-left{background-position:-240px -96px;} +.icon-arrow-right{background-position:-264px -96px;} +.icon-arrow-up{background-position:-289px -96px;} +.icon-arrow-down{background-position:-312px -96px;} +.icon-share-alt{background-position:-336px -96px;} +.icon-resize-full{background-position:-360px -96px;} +.icon-resize-small{background-position:-384px -96px;} +.icon-plus{background-position:-408px -96px;} +.icon-minus{background-position:-433px -96px;} +.icon-asterisk{background-position:-456px -96px;} +.icon-exclamation-sign{background-position:0 -120px;} +.icon-gift{background-position:-24px -120px;} +.icon-leaf{background-position:-48px -120px;} +.icon-fire{background-position:-72px -120px;} +.icon-eye-open{background-position:-96px -120px;} +.icon-eye-close{background-position:-120px -120px;} +.icon-warning-sign{background-position:-144px -120px;} +.icon-plane{background-position:-168px -120px;} +.icon-calendar{background-position:-192px -120px;} +.icon-random{background-position:-216px -120px;} +.icon-comment{background-position:-240px -120px;} +.icon-magnet{background-position:-264px -120px;} +.icon-chevron-up{background-position:-288px -120px;} +.icon-chevron-down{background-position:-313px -119px;} +.icon-retweet{background-position:-336px -120px;} +.icon-shopping-cart{background-position:-360px -120px;} +.icon-folder-close{background-position:-384px -120px;} +.icon-folder-open{background-position:-408px -120px;} +.icon-resize-vertical{background-position:-432px -119px;} +.icon-resize-horizontal{background-position:-456px -118px;} +.dropdown{position:relative;} +.dropdown-toggle{*margin-bottom:-3px;} +.dropdown-toggle:active,.open .dropdown-toggle{outline:0;} +.caret{display:inline-block;width:0;height:0;text-indent:-99999px;*text-indent:0;vertical-align:top;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000000;opacity:0.3;filter:alpha(opacity=30);content:"\2193";} +.dropdown .caret{margin-top:8px;margin-left:2px;} +.dropdown:hover .caret,.open.dropdown .caret{opacity:1;filter:alpha(opacity=100);} +.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;max-width:220px;_width:160px;padding:4px 0;margin:0;list-style:none;background-color:#ffffff;border-color:#ccc;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:1px;-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;}.dropdown-menu.bottom-up{top:auto;bottom:100%;margin-bottom:2px;} +.dropdown-menu .divider{height:1px;margin:5px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;} +.dropdown-menu a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:18px;color:#555555;white-space:nowrap;} +.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;background-color:#0088cc;} +.dropdown.open{*z-index:1000;}.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);} +.dropdown.open .dropdown-menu{display:block;} +.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} +.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;} +.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;} +.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;opacity:0.4;filter:alpha(opacity=40);cursor:pointer;} +.btn{display:inline-block;padding:4px 10px 4px;font-size:13px;line-height:18px;color:#333333;text-align:center;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);background-color:#fafafa;background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);background-image:-ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:-o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-image:linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border:1px solid #ccc;border-bottom-color:#bbb;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);cursor:pointer;*margin-left:.3em;}.btn:first-child{*margin-left:0;} +.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-ms-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} +.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.btn.active,.btn:active{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);background-color:#e6e6e6;background-color:#d9d9d9 \9;color:rgba(0, 0, 0, 0.5);outline:0;} +.btn.disabled,.btn[disabled]{cursor:default;background-image:none;background-color:#e6e6e6;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn-large{padding:9px 14px;font-size:15px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-large .icon{margin-top:1px;} +.btn-small{padding:5px 9px;font-size:11px;line-height:16px;} +.btn-small .icon{margin-top:-1px;} +.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover{text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);color:#ffffff;} +.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active{color:rgba(255, 255, 255, 0.75);} +.btn-primary{background-color:#006dcc;background-image:-moz-linear-gradient(top, #0088cc, #0044cc);background-image:-ms-linear-gradient(top, #0088cc, #0044cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));background-image:-webkit-linear-gradient(top, #0088cc, #0044cc);background-image:-o-linear-gradient(top, #0088cc, #0044cc);background-image:linear-gradient(top, #0088cc, #0044cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);border-color:#0044cc #0044cc #002a80;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{background-color:#0044cc;} +.btn-primary:active,.btn-primary.active{background-color:#003399 \9;} +.btn-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;} +.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;} +.btn-danger{background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;} +.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} +.btn-success{background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-ms-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(top, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{background-color:#51a351;} +.btn-success:active,.btn-success.active{background-color:#408140 \9;} +.btn-info{background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-ms-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(top, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{background-color:#2f96b4;} +.btn-info:active,.btn-info.active{background-color:#24748c \9;} +button.btn,input[type="submit"].btn{*padding-top:2px;*padding-bottom:2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} +button.btn.large,input[type="submit"].btn.large{*padding-top:7px;*padding-bottom:7px;} +button.btn.small,input[type="submit"].btn.small{*padding-top:3px;*padding-bottom:3px;} +.btn-group{position:relative;*zoom:1;*margin-left:.3em;}.btn-group:before,.btn-group:after{display:table;content:"";} +.btn-group:after{clear:both;} +.btn-group:first-child{*margin-left:0;} +.btn-group+.btn-group{margin-left:5px;} +.btn-toolbar{margin-top:9px;margin-bottom:9px;}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1;} +.btn-group .btn{position:relative;float:left;margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.btn-group .btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} +.btn-group .btn:last-child,.btn-group .dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} +.btn-group .btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} +.btn-group .btn.large:last-child,.btn-group .large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} +.btn-group .btn:hover,.btn-group .btn:focus,.btn-group .btn:active,.btn-group .btn.active{z-index:2;} +.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} +.btn-group .dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);*padding-top:5px;*padding-bottom:5px;} +.btn-group.open{*z-index:1000;}.btn-group.open .dropdown-menu{display:block;margin-top:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);} +.btn .caret{margin-top:7px;margin-left:0;} +.btn:hover .caret,.open.btn-group .caret{opacity:1;filter:alpha(opacity=100);} +.btn-primary .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret{border-top-color:#ffffff;opacity:0.75;filter:alpha(opacity=75);} +.btn-small .caret{margin-top:4px;} +.alert{padding:8px 35px 8px 14px;margin-bottom:18px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.alert,.alert-heading{color:#c09853;} +.alert .close{position:relative;top:-2px;right:-21px;line-height:18px;} +.alert-success{background-color:#dff0d8;border-color:#d6e9c6;} +.alert-success,.alert-success .alert-heading{color:#468847;} +.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;} +.alert-danger,.alert-error,.alert-danger .alert-heading,.alert-error .alert-heading{color:#b94a48;} +.alert-info{background-color:#d9edf7;border-color:#bce8f1;} +.alert-info,.alert-info .alert-heading{color:#3a87ad;} +.alert-block{padding-top:14px;padding-bottom:14px;} +.alert-block>p,.alert-block>ul{margin-bottom:0;} +.alert-block p+p{margin-top:5px;} +.nav{margin-left:0;margin-bottom:18px;list-style:none;} +.nav>li>a{display:block;} +.nav>li>a:hover{text-decoration:none;background-color:#eeeeee;} +.nav-list{padding-left:14px;padding-right:14px;margin-bottom:0;} +.nav-list>li>a,.nav-list .nav-header{display:block;padding:3px 15px;margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} +.nav-list .nav-header{font-size:11px;font-weight:bold;line-height:18px;color:#999999;text-transform:uppercase;} +.nav-list>li+.nav-header{margin-top:9px;} +.nav-list .active>a,.nav-list .active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;} +.nav-list [class^="icon-"]{margin-right:2px;} +.nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";} +.nav-tabs:after,.nav-pills:after{clear:both;} +.nav-tabs>li,.nav-pills>li{float:left;} +.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;} +.nav-tabs{border-bottom:1px solid #ddd;} +.nav-tabs>li{margin-bottom:-1px;} +.nav-tabs>li>a{padding-top:9px;padding-bottom:9px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;} +.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} +.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.nav-pills .active>a,.nav-pills .active>a:hover{color:#ffffff;background-color:#0088cc;} +.nav-stacked>li{float:none;} +.nav-stacked>li>a{margin-right:0;} +.nav-tabs.nav-stacked{border-bottom:0;} +.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;} +.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;} +.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;} +.nav-pills.nav-stacked>li>a{margin-bottom:3px;} +.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;} +.nav-tabs .dropdown-menu,.nav-pills .dropdown-menu{margin-top:1px;border-width:1px;} +.nav-pills .dropdown-menu{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret{border-top-color:#0088cc;margin-top:6px;} +.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret{border-top-color:#005580;} +.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret{border-top-color:#333333;} +.nav>.dropdown.active>a:hover{color:#000000;cursor:pointer;} +.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;} +.nav .open .caret,.nav .open.active .caret,.nav .open a:hover .caret{border-top-color:#ffffff;opacity:1;filter:alpha(opacity=100);} +.tabs-stacked .open>a:hover{border-color:#999999;} +.tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";} +.tabbable:after{clear:both;} +.tabs-below .nav-tabs,.tabs-right .nav-tabs,.tabs-left .nav-tabs{border-bottom:0;} +.tab-content>.tab-pane,.pill-content>.pill-pane{display:none;} +.tab-content>.active,.pill-content>.active{display:block;} +.tabs-below .nav-tabs{border-top:1px solid #ddd;} +.tabs-below .nav-tabs>li{margin-top:-1px;margin-bottom:0;} +.tabs-below .nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below .nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;} +.tabs-below .nav-tabs .active>a,.tabs-below .nav-tabs .active>a:hover{border-color:transparent #ddd #ddd #ddd;} +.tabs-left .nav-tabs>li,.tabs-right .nav-tabs>li{float:none;} +.tabs-left .nav-tabs>li>a,.tabs-right .nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;} +.tabs-left .nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;} +.tabs-left .nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} +.tabs-left .nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;} +.tabs-left .nav-tabs .active>a,.tabs-left .nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;} +.tabs-right .nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;} +.tabs-right .nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} +.tabs-right .nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;} +.tabs-right .nav-tabs .active>a,.tabs-right .nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;} +.navbar{overflow:visible;margin-bottom:18px;} +.navbar-inner{padding-left:20px;padding-right:20px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);} +.btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);}.btn-navbar:hover,.btn-navbar:active,.btn-navbar.active,.btn-navbar.disabled,.btn-navbar[disabled]{background-color:#222222;} +.btn-navbar:active,.btn-navbar.active{background-color:#080808 \9;} +.btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);} +.btn-navbar .icon-bar+.icon-bar{margin-top:3px;} +.nav-collapse.collapse{height:auto;} +.navbar .brand:hover{text-decoration:none;} +.navbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;font-size:20px;font-weight:200;line-height:1;color:#ffffff;} +.navbar .navbar-text{margin-bottom:0;line-height:40px;color:#999999;}.navbar .navbar-text a:hover{color:#ffffff;background-color:transparent;} +.navbar .btn,.navbar .btn-group{margin-top:5px;} +.navbar .btn-group .btn{margin-top:0;} +.navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";} +.navbar-form:after{clear:both;} +.navbar-form input,.navbar-form select{display:inline-block;margin-top:5px;margin-bottom:0;} +.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;} +.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;} +.navbar-search{position:relative;float:left;margin-top:6px;margin-bottom:0;}.navbar-search .search-query{padding:4px 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;color:#ffffff;color:rgba(255, 255, 255, 0.75);background:#666;background:rgba(255, 255, 255, 0.3);border:1px solid #111;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.navbar-search .search-query :-moz-placeholder{color:#eeeeee;} +.navbar-search .search-query::-webkit-input-placeholder{color:#eeeeee;} +.navbar-search .search-query:hover{color:#ffffff;background-color:#999999;background-color:rgba(255, 255, 255, 0.5);} +.navbar-search .search-query:focus,.navbar-search .search-query.focused{padding:5px 10px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;} +.navbar-fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030;} +.navbar-fixed-top .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;} +.navbar .nav.pull-right{float:right;} +.navbar .nav>li{display:block;float:left;} +.navbar .nav>li>a{float:none;padding:10px 10px 11px;line-height:19px;color:#999999;text-decoration:none;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);} +.navbar .nav>li>a:hover{background-color:transparent;color:#ffffff;text-decoration:none;} +.navbar .nav .active>a,.navbar .nav .active>a:hover{color:#ffffff;text-decoration:none;background-color:#222222;background-color:rgba(0, 0, 0, 0.5);} +.navbar .divider-vertical{height:40px;width:1px;margin:0 9px;overflow:hidden;background-color:#222222;border-right:1px solid #333333;} +.navbar .nav.pull-right{margin-left:10px;margin-right:0;} +.navbar .dropdown-menu{margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.navbar .dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;} +.navbar .dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;} +.navbar .nav .dropdown-toggle .caret,.navbar .nav .open.dropdown .caret{border-top-color:#ffffff;} +.navbar .nav .active .caret{opacity:1;filter:alpha(opacity=100);} +.navbar .nav .open>.dropdown-toggle,.navbar .nav .active>.dropdown-toggle,.navbar .nav .open.active>.dropdown-toggle{background-color:transparent;} +.navbar .nav .active>.dropdown-toggle:hover{color:#ffffff;} +.navbar .nav.pull-right .dropdown-menu{left:auto;right:0;}.navbar .nav.pull-right .dropdown-menu:before{left:auto;right:12px;} +.navbar .nav.pull-right .dropdown-menu:after{left:auto;right:13px;} +.breadcrumb{padding:7px 14px;margin:0 0 18px;background-color:#fbfbfb;background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline;text-shadow:0 1px 0 #ffffff;} +.breadcrumb .divider{padding:0 5px;color:#999999;} +.breadcrumb .active a{color:#333333;} +.pagination{height:36px;margin:18px 0;} +.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} +.pagination li{display:inline;} +.pagination a{float:left;padding:0 14px;line-height:34px;text-decoration:none;border:1px solid #ddd;border-left-width:0;} +.pagination a:hover,.pagination .active a{background-color:#f5f5f5;} +.pagination .active a{color:#999999;cursor:default;} +.pagination .disabled a,.pagination .disabled a:hover{color:#999999;background-color:transparent;cursor:default;} +.pagination li:first-child a{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.pagination li:last-child a{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.pagination-centered{text-align:center;} +.pagination-right{text-align:right;} +.pager{margin-left:0;margin-bottom:18px;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";} +.pager:after{clear:both;} +.pager li{display:inline;} +.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} +.pager a:hover{text-decoration:none;background-color:#f5f5f5;} +.pager .next a{float:right;} +.pager .previous a{float:left;} +.modal-open .dropdown-menu{z-index:2050;} +.modal-open .dropdown.open{*z-index:2050;} +.modal-open .popover{z-index:2060;} +.modal-open .tooltip{z-index:2070;} +.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;} +.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);} +.modal{position:fixed;top:50%;left:50%;z-index:1050;max-height:500px;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;} +.modal.fade.in{top:50%;} +.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;} +.modal-body{padding:15px;} +.modal-footer{padding:14px 15px 15px;margin-bottom:0;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";} +.modal-footer:after{clear:both;} +.modal-footer .btn{float:right;margin-left:5px;margin-bottom:0;} +.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} +.tooltip.top{margin-top:-2px;} +.tooltip.right{margin-left:2px;} +.tooltip.bottom{margin-top:2px;} +.tooltip.left{margin-left:-2px;} +.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.tooltip-arrow{position:absolute;width:0;height:0;} +.popover{position:absolute;top:0;left:0;z-index:1010;display:none;padding:5px;}.popover.top{margin-top:-5px;} +.popover.right{margin-left:5px;} +.popover.bottom{margin-top:5px;} +.popover.left{margin-left:-5px;} +.popover.top .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.popover.bottom .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.popover .arrow{position:absolute;width:0;height:0;} +.popover-inner{padding:3px;width:280px;overflow:hidden;background:#000000;background:rgba(0, 0, 0, 0.8);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);} +.popover-title{padding:9px 15px;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;} +.popover-content{padding:14px;background-color:#ffffff;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0;} +.thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";} +.thumbnails:after{clear:both;} +.thumbnails>li{float:left;margin:0 0 18px 20px;} +.thumbnail{display:block;padding:4px;line-height:1;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);} +a.thumbnail:hover{border-color:#0088cc;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);} +.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;} +.thumbnail .caption{padding:9px;} +.label{padding:1px 3px 2px;font-size:9.75px;font-weight:bold;color:#ffffff;text-transform:uppercase;background-color:#999999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.label-important{background-color:#b94a48;} +.label-warning{background-color:#f89406;} +.label-success{background-color:#468847;} +.label-info{background-color:#3a87ad;} +@-webkit-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}.progress{overflow:hidden;height:18px;margin-bottom:18px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-ms-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(top, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.progress .bar{width:0%;height:18px;color:#ffffff;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-ms-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(top, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-ms-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;} +.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;} +.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;} +.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);} +.progress-danger.progress-striped .bar{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);} +.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);} +.progress-info.progress-striped .bar{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.accordion{margin-bottom:18px;} +.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.accordion-heading{border-bottom:0;} +.accordion-heading .accordion-toggle{display:block;padding:8px 15px;} +.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;} +.carousel{position:relative;margin-bottom:18px;line-height:1;} +.carousel-inner{overflow:hidden;width:100%;position:relative;} +.carousel .item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-ms-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;} +.carousel .item>img{display:block;line-height:1;} +.carousel .active,.carousel .next,.carousel .prev{display:block;} +.carousel .active{left:0;} +.carousel .next,.carousel .prev{position:absolute;top:0;width:100%;} +.carousel .next{left:100%;} +.carousel .prev{left:-100%;} +.carousel .next.left,.carousel .prev.right{left:0;} +.carousel .active.left{left:-100%;} +.carousel .active.right{left:100%;} +.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;} +.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);} +.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:10px 15px 5px;background:#333333;background:rgba(0, 0, 0, 0.75);} +.carousel-caption h4,.carousel-caption p{color:#ffffff;} +.hero-unit{padding:60px;margin-bottom:30px;background-color:#f5f5f5;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;} +.hero-unit p{font-size:18px;font-weight:200;line-height:27px;} +.pull-right{float:right;} +.pull-left{float:left;} +.hide{display:none;} +.show{display:block;} +.invisible{visibility:hidden;} diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/buttons.png b/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/buttons.png new file mode 100644 index 00000000000..66e24e37c6c Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/buttons.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/datepicker_dashboard.css b/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/datepicker_dashboard.css new file mode 100644 index 00000000000..3b8f06f0acf --- /dev/null +++ b/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/datepicker_dashboard.css @@ -0,0 +1,245 @@ +.datepicker_dashboard { + position: absolute; + font-size: 10px; + font-family: "Lucida Grande", LucidaGrande, "Lucida Sans", Geneva, Verdana, sans-serif; + color: #fff; + line-height: normal; + width: 172px; + height: 135px; + padding: 14px; + background: url(frame.png) no-repeat; +} + +/* header +********************************************************/ +.datepicker_dashboard .header { + position: relative; + height: 15px; + margin-bottom: 5px; + padding-top: 1px; +} + +.datepicker_dashboard .header .title { + text-align: center; + margin: 2px 18px 0 18px; +} + +.datepicker_dashboard .header .titleText { + color: #ccff00; +} + +.datepicker_dashboard .header .previous, +.datepicker_dashboard .header .next, +.datepicker_dashboard .header .closeButton { + position: absolute; + cursor: pointer; + text-indent: -40px; + overflow: hidden; + width: 12px; + height: 12px; + top: 2px; + background-image: url(buttons.png); + background-position: left top; + background-repeat: no-repeat; +} + +.datepicker_dashboard .header .previous { + left: 4px; +} +.datepicker_dashboard .header .previous:hover { + background-position: left bottom; +} +.datepicker_dashboard .header .next { + right: 4px; + background-position: -13px top; +} +.datepicker_dashboard .header .next:hover { + background-position: -13px bottom; +} +.datepicker_dashboard .header .closeButton { + display: none; + right: 0px; + top: 0px; + background-position: right top; +} +.datepicker_dashboard .header .closeButton:hover { + background-position: right bottom; +} + +/* body +********************************************************/ +.datepicker_dashboard .body { + position: relative; + top: 0px; + left: 2px; + width: 168px; + height: 112px; + overflow: hidden; +} + +/* time +********************************************************/ +.datepicker_dashboard .time { + position: relative; + width: 100%; + height: 100%; +} + +.datepicker_dashboard .time .hour, +.datepicker_dashboard .time .separator, +.datepicker_dashboard .time .minutes { + background: #333; + border: 0px; + width: 50px; + font-size: 32px; + color: #fff; + position: absolute; + top: 10px; + text-align: center; + padding: 2px; +} + +.datepicker_dashboard .time .hour { + left: 15px; +} +.datepicker_dashboard .time .separator { + background: transparent; + width: 10px; + left: 76px; +} + +.datepicker_dashboard .time .minutes { + left: 95px; +} +.datepicker_dashboard .time .ok { + position: absolute; + top: 65px; + height: 32px; + width: 136px; + left: 15px; + font-size: 20px; +} + +/* days-grid +********************************************************/ +.datepicker_dashboard .days .day { + float: left; + text-align: center; + overflow: hidden; + width: 23px; + padding-top: 1px; + height: 14px; + margin: 0 1px 1px 0; +} +.datepicker_dashboard .days .titles { + height: 15px; + margin-bottom: 2px; + text-transform: uppercase; + color: #aaa; +} +.datepicker_dashboard .days .day0 { + margin-right: 0; +} + +.datepicker_dashboard .days .week5 .day { + margin-bottom: 0; +} + +/* days-colors +********************************************************/ +.datepicker_dashboard .days .week .day { + cursor: pointer; +} +.datepicker_dashboard .days .week .day:hover { + color: #ccff00; +} + +.datepicker_dashboard .days .otherMonth { + color: #444444; +} + +.datepicker_dashboard .days .selected { + color: #ccff00; +} + +/* months-grid +********************************************************/ +.datepicker_dashboard .months .month { + float: left; + cursor: pointer; + text-align: center; + padding-top: 6px; + width: 55px; + overflow: hidden; + height: 21px; + margin: 0 1px 1px 0; +} + +.datepicker_dashboard .months .month3, +.datepicker_dashboard .months .month6, +.datepicker_dashboard .months .month9, +.datepicker_dashboard .months .month12 { + margin-right: 0; +} + +.datepicker_dashboard .months .month10, +.datepicker_dashboard .months .month11, +.datepicker_dashboard .months .month12 { + margin-bottom: 0; +} + +/* months-colors +********************************************************/ +.datepicker_dashboard .months .month:hover { + color: #ccff00; +} + +.datepicker_dashboard .months .selected { + color: #ccff00; +} + +/* years-grid +********************************************************/ +.datepicker_dashboard .years .year { + float: left; + cursor: pointer; + text-align: center; + padding-top: 6px; + width: 32px; + overflow: hidden; + height: 21px; + margin: 0 1px 1px 0; +} + +.datepicker_dashboard .years .year4, +.datepicker_dashboard .years .year9, +.datepicker_dashboard .years .year14, +.datepicker_dashboard .years .year19 { + margin-right: 0; +} + +.datepicker_dashboard .years .year15, +.datepicker_dashboard .years .year16, +.datepicker_dashboard .years .year17, +.datepicker_dashboard .years .year18, +.datepicker_dashboard .years .year19 { + margin-bottom: 0; +} + +/* years-colors +********************************************************/ +.datepicker_dashboard .years .year:hover { + color: #ccff00; +} + +.datepicker_dashboard .years .selected { + color: #ccff00 +} + +/* global +********************************************************/ +.datepicker_dashboard .unavailable { + color: #533 !important; + cursor: default !important; + text-decoration: line-through; +} diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/frame.png b/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/frame.png new file mode 100644 index 00000000000..04244e52f2d Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/datepicker_dashboard/frame.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/Green_Thumb.png b/Examples/Ajax/MooToolsExample/WebServerResources/img/Green_Thumb.png new file mode 100644 index 00000000000..27a314c8a31 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/Green_Thumb.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/Red_Thumb.png b/Examples/Ajax/MooToolsExample/WebServerResources/img/Red_Thumb.png new file mode 100644 index 00000000000..1706fc6e615 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/Red_Thumb.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/Yellow_Thumb.png b/Examples/Ajax/MooToolsExample/WebServerResources/img/Yellow_Thumb.png new file mode 100644 index 00000000000..663d6932a09 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/Yellow_Thumb.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/glyphicons-halflings-white.png b/Examples/Ajax/MooToolsExample/WebServerResources/img/glyphicons-halflings-white.png new file mode 100644 index 00000000000..a20760bfde5 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/glyphicons-halflings-white.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/glyphicons-halflings.png b/Examples/Ajax/MooToolsExample/WebServerResources/img/glyphicons-halflings.png new file mode 100644 index 00000000000..92d4445dfd0 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/glyphicons-halflings.png differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/progress-bar.gif b/Examples/Ajax/MooToolsExample/WebServerResources/img/progress-bar.gif new file mode 100644 index 00000000000..91bc2fedc11 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/progress-bar.gif differ diff --git a/Examples/Ajax/MooToolsExample/WebServerResources/img/progress-remainder.gif b/Examples/Ajax/MooToolsExample/WebServerResources/img/progress-remainder.gif new file mode 100644 index 00000000000..4b6356ed202 Binary files /dev/null and b/Examples/Ajax/MooToolsExample/WebServerResources/img/progress-remainder.gif differ diff --git a/Examples/Ajax/MooToolsExample/build.properties b/Examples/Ajax/MooToolsExample/build.properties new file mode 100644 index 00000000000..fcfec55a8bc --- /dev/null +++ b/Examples/Ajax/MooToolsExample/build.properties @@ -0,0 +1,14 @@ +#Wed Feb 08 12:10:36 HST 2012 +classes.dir=bin +component.inlineBindingPrefix=$ +component.inlineBindingSuffix= +component.wellFormedTemplateRequired=false +customInfoPListContent= +embed.Local=true +embed.System=true +principalClass=er.ajax.mootools.example.app.Application +project.name=MooToolsExample +project.name.lowercase=mootoolsexample +project.type=application +webXML=false +webXML_CustomContent= diff --git a/Examples/Ajax/MooToolsExample/build.xml b/Examples/Ajax/MooToolsExample/build.xml new file mode 100644 index 00000000000..6b043de9d4f --- /dev/null +++ b/Examples/Ajax/MooToolsExample/build.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/Ajax/MooToolsExample/woproject/classes.exclude.patternset b/Examples/Ajax/MooToolsExample/woproject/classes.exclude.patternset new file mode 100644 index 00000000000..56fb545fa67 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/woproject/classes.exclude.patternset @@ -0,0 +1 @@ +build.properties diff --git a/Examples/Ajax/MooToolsExample/woproject/classes.include.patternset b/Examples/Ajax/MooToolsExample/woproject/classes.include.patternset new file mode 100644 index 00000000000..3179091db39 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/woproject/classes.include.patternset @@ -0,0 +1,2 @@ +**/*.class +*.properties diff --git a/Examples/Ajax/MooToolsExample/woproject/resources.exclude.patternset b/Examples/Ajax/MooToolsExample/woproject/resources.exclude.patternset new file mode 100644 index 00000000000..905050dfb73 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/woproject/resources.exclude.patternset @@ -0,0 +1,3 @@ +**/*.eomodeld~/ +**/*.woa/** +**/*.framework/** diff --git a/Examples/Ajax/MooToolsExample/woproject/resources.include.patternset b/Examples/Ajax/MooToolsExample/woproject/resources.include.patternset new file mode 100644 index 00000000000..611978755e2 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/woproject/resources.include.patternset @@ -0,0 +1,3 @@ +Components/**/*.wo/**/* +Components/**/*.api +Resources/**/* \ No newline at end of file diff --git a/Examples/Ajax/MooToolsExample/woproject/wsresources.exclude.patternset b/Examples/Ajax/MooToolsExample/woproject/wsresources.exclude.patternset new file mode 100644 index 00000000000..9435a512320 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/woproject/wsresources.exclude.patternset @@ -0,0 +1,3 @@ +**/*.woa/** +**/*.framework/** +**/*.eomodeld~/** diff --git a/Examples/Ajax/MooToolsExample/woproject/wsresources.include.patternset b/Examples/Ajax/MooToolsExample/woproject/wsresources.include.patternset new file mode 100644 index 00000000000..234cdc88bb7 --- /dev/null +++ b/Examples/Ajax/MooToolsExample/woproject/wsresources.include.patternset @@ -0,0 +1 @@ +WebServerResources/**/* diff --git a/Frameworks/Ajax/MooTools/.classpath b/Frameworks/Ajax/MooTools/.classpath new file mode 100644 index 00000000000..6f63db6ed92 --- /dev/null +++ b/Frameworks/Ajax/MooTools/.classpath @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/.project b/Frameworks/Ajax/MooTools/.project new file mode 100644 index 00000000000..60d27b5039e --- /dev/null +++ b/Frameworks/Ajax/MooTools/.project @@ -0,0 +1,23 @@ + + + MooTools + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.objectstyle.wolips.incrementalbuilder + + + + + + org.eclipse.jdt.core.javanature + org.objectstyle.wolips.incrementalframeworknature + + diff --git a/Frameworks/Ajax/MooTools/.settings/org.eclipse.core.resources.prefs b/Frameworks/Ajax/MooTools/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..a6a0fefecb6 --- /dev/null +++ b/Frameworks/Ajax/MooTools/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//Components=UTF-8 diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.html b/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.html new file mode 100644 index 00000000000..e62419cd959 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.wod b/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.wod new file mode 100644 index 00000000000..b8d5a8f0a67 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.wod @@ -0,0 +1,9 @@ +ElementsContainer : WOGenericContainer { + class = "elements"; + elementName = "div"; +} + +TogglerContainer : WOGenericContainer { + class = "togglers"; + elementName = "div"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.woo b/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionComponent.wo/MTAccordionComponent.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.api b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.api new file mode 100644 index 00000000000..3264d1b6cea --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.api @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.html b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.html new file mode 100644 index 00000000000..e4bfe014f23 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.html @@ -0,0 +1,8 @@ + + + + + window.addEvent('domready', function() { + new Fx.Accordion($$('# .togglers'), $$('# .elements'), ); + }); + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.wod b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.wod new file mode 100644 index 00000000000..36050d9f1fd --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.wod @@ -0,0 +1,12 @@ +AccordionContainerID : WOString { + value = accordionID; +} + +AccordionDiv : WOGenericContainer { + elementName = "div"; + id = accordionID; +} + +AjaxOptions : AjaxOptions { + options = createAjaxOptions; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.woo b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAccordionContainer.wo/MTAccordionContainer.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.api b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.api new file mode 100644 index 00000000000..d39100c81a4 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.api @@ -0,0 +1,4 @@ + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.html b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.html new file mode 100644 index 00000000000..c58bc20b1d2 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.html @@ -0,0 +1,6 @@ + + + window.addEvent('domready', function() { + var = new MTAD(, ); + }); + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.wod b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.wod new file mode 100644 index 00000000000..dff8f272ab3 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.wod @@ -0,0 +1,25 @@ +DraggableContainer : WOGenericContainer { + elementName = elementName; + id = id; + class = ^class; + style = ^style; + draggableID = draggableID; +} + +Content : WOComponentContent { +} + +AjaxOptions : AjaxOptions { + id = quotedID; + actionUrl = quotedActionUrl; + contextID = quotedContextID; + draggableKeyName = quotedDraggableKeyName; + elementID = quotedElementID; + form = form; + options = createAjaxOptions; + submit = submit; +} + +ID : WOString { + value = variableName; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.woo b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxDraggable.wo/MTAjaxDraggable.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.api b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.api new file mode 100644 index 00000000000..2192d1a556a --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.api @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.html b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.html new file mode 100644 index 00000000000..4f009f095c0 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.html @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.wod b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.wod new file mode 100644 index 00000000000..42290ec1571 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.wod @@ -0,0 +1,79 @@ +HiddenFrame : WOIFrame { + name = uploadFrameName; + src = srcUrl; + width = "0"; + height = "0"; + style = "border: none;"; + border = "0"; +} + +UploadForm : WOForm { + class = ^formClass; + multipleSubmit = false; + enctype = "multipart/form-data"; + target = uploadFrameName; + href = uploadUrl; + name = uploadFormID; +} + +HiddenID : WOGenericElement { + elementName = "input"; + type = "hidden"; + name = "id"; + value = id; +} + +HiddenWOSID : WOGenericElement { + elementName = "input"; + type = "hidden"; + name = "wosid"; + value = session.sessionID; +} + +UploadField : WOGenericElement { + elementName = "input"; + type = "file"; + name = "uploadedFile"; + class = ^class; + id = ^id; + style = ^style; +} + +UploadAction : MTAjaxUpdateLink { + updateContainerID = progressBarID; + action = startUpload; + button = true; + class = ^linkClass; + functionName = ^uploadFunctionName; + value = uploadLabel; + disabled = false; +} + +UploadProgressBar : MTAjaxProgressBar { + id = progressBarID; + progressID = id; + progress = uploadProgress; + started = uploadStarted; + succeededAction = uploadSucceeded; + startedFunction = ^startedFunction; + finishedFunction = ^finishedFunction; + succeededFunction = ^succeededFunction; + failedAction = uploadFailed; + failedFunction = ^failedFunction; + canceledAction = uploadCanceled; + canceledFunction = ^canceledFunction; + displayValue = bytesReadSize; + displayMaximum = streamLengthSize; + allowCancel = ^allowCancel; + visibleBeforeStart = progressBarBeforeStart; + visibleAfterDone = progressBarAfterDone; + cancelText = cancelText; + cancelingText = cancelingText; + startingText = startingText; + refreshTime = ^refreshTime; + progressOfText = ^progressOfText; + progressBarContainerClass = ^progressBarContainerClass; +} + +Contents : WOComponentContent { +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.woo b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxFileUpload.wo/MTAjaxFileUpload.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxModalContainer.api b/Frameworks/Ajax/MooTools/Components/MTAjaxModalContainer.api new file mode 100644 index 00000000000..564ecfb7ce1 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxModalContainer.api @@ -0,0 +1,4 @@ + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxObserveField.api b/Frameworks/Ajax/MooTools/Components/MTAjaxObserveField.api new file mode 100644 index 00000000000..fb7e890e392 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxObserveField.api @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.api b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.api new file mode 100644 index 00000000000..694883c172f --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.api @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.html b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.html new file mode 100644 index 00000000000..eacc3c0c212 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + , + + ( ) + + + + + + + + + + + + + + setTimeout("Update()", ); + + + + + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.wod b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.wod new file mode 100644 index 00000000000..da16fe46da5 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.wod @@ -0,0 +1,145 @@ +ProgressUpdateContainer : MTAjaxUpdateContainer { + id = id; + action = refreshing; +} + +HasStatusConditional : WOConditional { + condition = progress.status; +} + +Status : WOString { + value = progress.status; +} + +ID : WOString { + value = id; +} + +ProgressBarVisible : WOConditional { + condition = progressBarVisible; +} + +AllowCancelConditional : WOConditional { + condition = ^allowCancel; +} + +ProcedureStartedConditional : WOConditional { + condition = started; +} + +NotDoneConditional : WOConditional { + condition = done; + negate = true; +} + +DoneConditional : WOConditional { + condition = done; +} + +CancelAction : MTAjaxUpdateLink { + updateContainerID = id; + action = cancel; + class = "cancelAction"; + disabled = done; +} + +Finished : WOGenericContainer { + elementName = "td"; + width = percentage; + class = finishedClass; +} + +Unfinished : WOGenericContainer { + elementName = "td"; + class = "percentageUnfinished"; +} + +Value : WOString { + value = displayValue; +} + +Maximum : WOString { + value = displayMaximum; +} + +CancelText : WOString { + value = cancelText; +} + +StartedFunction : WOString { + value = ^startedFunction; +} + +FinishedFunction : WOString { + value = ^finishedFunction; +} + +CanceledConditional : WOConditional { + condition = progress.canceled; +} + +CancelingText : WOString { + value = cancelingText; +} + +NotCanceledConditional : WOConditional { + condition = progress.canceled; + negate = true; +} + +FailedConditional : WOConditional { + condition = progress.failed; +} + +SucceededConditional : WOConditional { + condition = progress.succeeded; +} + +CanceledFunction : WOString { + value = ^canceledFunction; +} + +FailedFunction : WOString { + value = ^failedFunction; +} + +SucceededFunction : WOString { + value = ^succeededFunction; +} + +ProgressNotStartedConditional : WOConditional { + condition = progress.started; + negate = true; +} + +StartingText : WOString { + value = startingText; +} + +ProgressStartedConditional : WOConditional { + condition = progress.started; +} + +ProgressNotDoneConditional : WOConditional { + condition = progress.done; + negate = true; +} + +FireStartedJavascriptEventsConditional : WOConditional { + condition = fireStartedJavascriptEvent; +} + +FireFinishedJavascriptEventsConditional : WOConditional { + condition = fireFinishedJavascriptEvents; +} + +Contents : WOComponentContent { +} + +RefreshTime : WOString { + value = refreshTime; +} + +ProgressOfText : WOString { + value = progressOfText; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.woo b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxProgressBar.wo/MTAjaxProgressBar.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.html b/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.html new file mode 100644 index 00000000000..b400d3cfb7b --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.html @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.wod b/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.wod new file mode 100644 index 00000000000..222c6564824 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.wod @@ -0,0 +1,35 @@ +AjaxOptions : AjaxOptions { + options = createAjaxOptions; + onComplete = onComplete; +} + +ContainerID : WOString { + value = id; +} + +Content : WOComponentContent { + +} + +ListContainer : WOGenericContainer { + elementName = listElementName; + id = id; + class = ^listClass; + style = ^listStyle; +} + +ListItemContainer : WOGenericContainer { + elementName = listItemElementName; + id = listItemID; + class = ^listItemClass; + style = ^listItemStyle; +} + +ListRepetition : WORepetition { + list = ^list; + item = ^item; +} + +SortableVariableName : WOString { + value = var; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.woo b/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxSortableList.wo/MTAjaxSortableList.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxSubmitButton.api b/Frameworks/Ajax/MooTools/Components/MTAjaxSubmitButton.api new file mode 100644 index 00000000000..006f0bc6319 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxSubmitButton.api @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxTabbedPanel.api b/Frameworks/Ajax/MooTools/Components/MTAjaxTabbedPanel.api new file mode 100644 index 00000000000..4d957684e8a --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxTabbedPanel.api @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxTabbedPanelTab.api b/Frameworks/Ajax/MooTools/Components/MTAjaxTabbedPanelTab.api new file mode 100644 index 00000000000..f6b87ee4a18 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxTabbedPanelTab.api @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.html b/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.html new file mode 100644 index 00000000000..327bef7c775 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.wod b/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.wod new file mode 100644 index 00000000000..7f28c52d8b2 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.wod @@ -0,0 +1,96 @@ +CloseULLI : WOString { + value = ""; + escapeHTML = false; +} + +CloseLI : WOString { + value = ""; + escapeHTML = false; +} + +OpenUL : WOString { + value = "
    "; + escapeHTML = false; +} + +NodeItem : WOString { + value = nodeItem; + escapeHTML = false; +} + +ContainerID : WOString { + value = id; +} + +ToggleFunctionName : WOString { + value = toggleFunctionName; +} + +CloseCountRepetition : WORepetition { + count = closeCount; +} + +TreeNodeRepetition : WORepetition { + list = nodes; + item = item; +} + +CollapsedImage : WOImage { + filename = collapsedImage; + framework = collapsedImageFramework; + class = "nodeControl"; +} + +ExpandedImage : WOImage { + filename = expandedImage; + framework = expandedImageFramework; + class = "nodeControl"; +} + +LeafImage : WOImage { + filename = leafImage; + framework = leafImageFramework; + class = "nodeControl"; +} + +IsCollapsedConditional : WOConditional { + condition = expanded; + negate = true; +} + +IsExpandedConditional : WOConditional { + condition = expanded; +} + +IsLeafConditional : WOConditional { + condition = leaf; +} + +IsNotLeafConditional : WOConditional { + condition = leaf; + negate = true; +} + +CollapseAction : MTAjaxUpdateLink { + action = collapse; + updateContainerID = id; + function = toggleFunctionName; + class = imageLinkClass; +} + +ExpandAction : MTAjaxUpdateLink { + action = expand; + updateContainerID = ^id; + function = toggleFunctionName; + class = imageLinkClass; +} + +TreeNodeRenderer : WOComponentContent { +} + +TreeNodeUpdater : MTAjaxUpdateContainer { + id = ^id; + class = ^class; + elementName = "ul"; + skipFunction = false; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.woo b/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxTree.wo/MTAjaxTree.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxUpdateContainer.api b/Frameworks/Ajax/MooTools/Components/MTAjaxUpdateContainer.api new file mode 100644 index 00000000000..ed108140287 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxUpdateContainer.api @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTAjaxUpdateLink.api b/Frameworks/Ajax/MooTools/Components/MTAjaxUpdateLink.api new file mode 100644 index 00000000000..9d6bfc4e7e5 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTAjaxUpdateLink.api @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.api b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.api new file mode 100644 index 00000000000..a8db7d95416 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.api @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.html b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.html new file mode 100644 index 00000000000..0d0868b542c --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.html @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.wod b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.wod new file mode 100644 index 00000000000..de488791b2c --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.wod @@ -0,0 +1,14 @@ +AjaxOptions : AjaxOptions { + options = createAjaxOptions; +} + +DateInput : WOTextField { + value = ^value; + id = ^id; + class = classes; + dateformat = ^dateformat; + style = ^style; + size = ^size; + maxlength = ^maxlength; + name = ^name; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.woo b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.woo new file mode 100644 index 00000000000..a076a051a7e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTJSDatePicker.wo/MTJSDatePicker.woo @@ -0,0 +1,4 @@ +{ + "WebObjects Release" = "WebObjects 5.0"; + encoding = "UTF-8"; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Components/MTJSSlider.api b/Frameworks/Ajax/MooTools/Components/MTJSSlider.api new file mode 100644 index 00000000000..c7dd1d28a46 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Components/MTJSSlider.api @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/Resources/Properties b/Frameworks/Ajax/MooTools/Resources/Properties new file mode 100644 index 00000000000..35826a5c1d1 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Resources/Properties @@ -0,0 +1 @@ +er.ajax.AjaxFileRequestHandler.maxUploadSize=2000000 \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAccordionComponent.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAccordionComponent.java new file mode 100644 index 00000000000..c76567da733 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAccordionComponent.java @@ -0,0 +1,40 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; + +import er.ajax.AjaxComponent; + +public class MTAccordionComponent extends AjaxComponent { + + public MTAccordionComponent(WOContext context) { + super(context); + } + + public boolean isStateless() { + return true; + } + + public boolean synchronizesVariablesWithBindings() { + return false; + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + return null; + } + + public String label() { + return (String) valueForBinding("label"); + } + + @Override + protected void addRequiredWebResources(WOResponse res) { + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAccordionContainer.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAccordionContainer.java new file mode 100644 index 00000000000..54b1b1632a1 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAccordionContainer.java @@ -0,0 +1,99 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxComponent; +import er.ajax.AjaxOption; +import er.extensions.appserver.ERXWOContext; + +/** + * + * A DHTML accordion based on the Accordion Component found in MooTools: http://mootools.net/docs/more/Fx/Fx.Accordion + * The class name of the container that contains the label is always "toggler" and the class name of the container that holds the + * content is "elements". If anyone has a suggestion on how to set this programatically please email me at jlmiller@kahalawai.com + * + * @binding display - (integer: defaults to 0) The index of the element to show at start (with a transition). To force all elements to be closed by default, pass in -1. + * @binding show - (integer: defaults to 0) The index of the element to be shown initially. + * @binding trigger - (string: defaults to 'click') The event that triggers a change in element display. + * @binding height - (boolean: defaults to true) If set to true, a height transition effect will take place when switching between displayed elements. + * @binding width - (boolean: defaults to false) If set to true, it will add a width transition to the accordion when switching between displayed elements. Warning: CSS mastery is required to make this work! + * @binding opacity - (boolean: defaults to true) If set to true, an opacity transition effect will take place when switching between displayed elements. + * @binding fixedHeight - (boolean: defaults to false) If set to true, displayed elements will have a fixed height. + * @binding fixedWidth - (boolean: defaults to false) If set to true, displayed elements will have a fixed width. + * @binding alwaysHide - (boolean: defaults to false) If set to true, it will be possible to close all displayable elements. Otherwise, one will remain open at all time. + * @binding initialDisplayFx - (boolean; defaults to true) If set to false, the initial item displayed will not display with an effect but will just be shown immediately. + * @binding resetHeight - (boolean; defaults to true) If set to false, the height of an opened accordion section will be set to an absolute pixel size. + * @binding onActive - (function: signature = function(toggler, element) {}) a method that is called on the container that is opened. + * @binding onBackground - (function: signature = function(toggler, element) {}) a method that is called on the container that is closed. + * + */ + +public class MTAccordionContainer extends AjaxComponent { + + private String _accordionID; + + public MTAccordionContainer(WOContext context) { + super(context); + } + + public String accordionID() { + + if(_accordionID == null) { + _accordionID = (String) valueForBinding("id", ERXWOContext.safeIdentifierName(context(), true) + "Accordion"); + } + + return _accordionID; + + } + + public boolean isStateless() { + return true; + } + + public String elementClassName() { + return valueForStringBinding("elementClassName", "elements"); + } + + public String togglerClassName() { + return valueForStringBinding("togglerClassName", "toggler"); + } + + @SuppressWarnings({"unchecked","rawtypes"}) + public NSDictionary createAjaxOptions() { + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("display", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("show", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("trigger", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("height", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("width", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("opacity", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("fixedHeight", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("fixedWidth", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("alwaysHide", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("initialDisplayFx", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("resetHeight", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("onActive", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onBackground", AjaxOption.SCRIPT)); + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); + return options; + } + + @Override + protected void addRequiredWebResources(WOResponse res) { + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + // TODO Auto-generated method stub + return null; + } +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxDraggable.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxDraggable.java new file mode 100644 index 00000000000..9f05cd139c4 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxDraggable.java @@ -0,0 +1,329 @@ +package er.ajax.mootools; + +import java.util.HashMap; +import java.util.Map; +import java.util.WeakHashMap; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxComponent; +import er.ajax.AjaxOption; +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXWOContext; +import er.extensions.components.ERXComponentUtilities; + +/* + * AjaxDraggable makes HTML elements draggable. Use in conjunction with + * {@link AjaxDroppable}. * @binding onBeforeStart - Executed before the Drag instance attaches the events. Receives the dragged element as an argument. + * @binding onStart - Executed when the user starts to drag (on mousedown). Receives the dragged element as an argument. + * @binding onSnap - Executed when the user has dragged past the snap option. Receives the dragged element as an argument. + * @binding onDrag - Executed on every step of the drag. Receives the dragged element and the event as arguments. + * @binding onComplete - Executed when the user completes the drag. Receives the dragged element and the event as arguments. + * @binding onCancel - Executed when the user has cancelled the drag. Receives the dragged element as an argument. + * @binding onDrop- Executed when the element drops. Passes as argument the element and the element dropped on and the event. If dropped on nothing, the second argument is null. + * @binding onLeave - Executed when the element leaves one of the droppables. + * @binding onEnter - Executed when the element enters one of the droppables. + * Options + * + * @binding grid - (integer: defaults to false) Distance in pixels for snap-to-grid dragging. + * @binding handle - (element: defaults to the element passed in) The Element to act as the handle for the draggable element. + * @binding invert - (boolean: defaults to false) Whether or not to invert the values reported on start and drag. + * @binding limit - (object: defaults to false) An object with x and y dimensions used to limit the movement of the Element. + * @binding modifiers - (object: defaults to {'x': 'left', 'y': 'top'}) An object with x and y properties used to indicate the CSS modifiers (i.e. 'left'). + * @binding style - (boolean: defaults to true) Whether or not to set the modifier as a style property of the element. + * @binding snap - (integer: defaults to 6) The distance to drag before the Element starts to respond to the drag. + * @binding unit - (string: defaults to 'px') A string indicating the CSS unit to append to all integer values. + * @binding preventDefault - (boolean: defaults to false) Calls preventDefault on the event while dragging. See Event:preventDefault + * @binding stopPropagation - (boolean: defaults to false) Prevents the event from "bubbling" up in the DOM tree. See Event:stopPropagation + * @binding container - (element) If an Element is passed, drag will be limited to the passed Element's size and position. + * @binding droppables - String that contains the class names of the droppable elements. + * @binding precalculate - (boolean; defaults to false) If true, the class will calculate the locations and dimensions of the droppables which will increase performance. If the droppables are likely to change shape, size, or location it is best to leave this as false. + * @binding includeMargins - (boolean; defaults to true) This option only applies when the container option is set. If true (the default) the margins are included in the calculations for the bounding box of the draggable item. This means that if you have a margin on your draggable then the border of the draggable can never touch the edge of the container. Setting it to false ignores this margin. + * @binding checkDroppables - (boolean; defaults to true) Checks against the droppables on drag if true. + * @binding useSpinner (boolean) use the Spinner class with this request + * @binding defaultSpinnerClass inclue the default spinner css class in the headers - if false provide your own. + * @binding spinnerOptions - (object) the options object for the Spinner class + * @binding spinnerTarget - (mixed) a string of the id for an Element or an Element reference to use instead of the one specifed in the update option. This is useful if you want to overlay a different area (or, say, the parent of the one being updated). + * + */ + + + +public class MTAjaxDraggable extends AjaxComponent { + + private static final String COMPONENT_DRAGGABLES_MAP_KEY = "AjaxComponentDraggablesMap"; + private String _id; + private String _variableName; + private String _draggableIDKeyName; + private String _actionUrl; + private String _elementID; + private String _droppedArea; + + public MTAjaxDraggable(WOContext context) { + super(context); + } + + public void reset() { + _id = null; + super.reset(); + } + + public void awake() { + super.awake(); + _draggableIDKeyName = safeElementID() + "_draggableID"; + } + + public boolean isStateless() { + return Boolean.TRUE; + } + + public boolean synchronizesVariablesWithBindings() { + return Boolean.FALSE; + } + + @SuppressWarnings("rawtypes") + public static Object draggableObjectForPage(WOComponent page, String draggableID) { + Object droppedObject = null; + Map componentDraggablesMap = (Map)page.context().session().objectForKey(MTAjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); + if(componentDraggablesMap != null) { + Map draggablesMap = (Map)componentDraggablesMap.get(page); + if(draggablesMap != null) { + droppedObject = draggablesMap.get(draggableID); + } + } + return droppedObject; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public void appendToResponse(WOResponse response, WOContext context) { + + _actionUrl = AjaxUtils.ajaxComponentActionUrl(context()); + _elementID = context.elementID(); + if(canGetValueForBinding("draggableObject")) { + Object draggableObject = valueForBinding("draggableObject"); + WOComponent page = context().page(); + Map componentDraggablesMap = (Map)context.session().objectForKey(MTAjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); + if(componentDraggablesMap == null) { + componentDraggablesMap = new WeakHashMap(); + context.session().setObjectForKey(componentDraggablesMap, MTAjaxDraggable.COMPONENT_DRAGGABLES_MAP_KEY); + } + Map draggablesMap = (Map)componentDraggablesMap.get(page); + if(draggablesMap == null) { + draggablesMap = new HashMap(); + componentDraggablesMap.put(page, draggablesMap); + } + String id = draggableID(); + if(draggableObject == null) { + draggablesMap.remove(id); + } else { + draggablesMap.put(id, draggableObject); + } + } + super.appendToResponse(response, context); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public NSDictionary createAjaxOptions() { + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + + // PROTOTYPE OPTIONS + ajaxOptionsArray.addObject(new AjaxOption("grid", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("handle", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("invert", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("limit", AjaxOption.DICTIONARY)); + ajaxOptionsArray.addObject(new AjaxOption("modifiers", AjaxOption.DICTIONARY)); + ajaxOptionsArray.addObject(new AjaxOption("snap", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("style", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("unit", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("preventDefault", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("stopPropagation", AjaxOption.BOOLEAN)); + + ajaxOptionsArray.addObject(new AjaxOption("container", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("droppables", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("precalculate", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("includeMargins", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("checkDroppables", AjaxOption.BOOLEAN)); + + ajaxOptionsArray.addObject(new AjaxOption("onBeforeStart", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onStart", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onSnap", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onCancel", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onDrag", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onDrop", AjaxOption.SCRIPT)); + + ajaxOptionsArray.addObject(new AjaxOption("onEnter", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onLeave", AjaxOption.SCRIPT)); + + ajaxOptionsArray.addObject(new AjaxOption("ghost", Boolean.FALSE, AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY)); + + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); + + return options; + + } + + public String draggableID() { + String draggableID; + if(canGetValueForBinding("draggableID")) { + draggableID = (String)valueForBinding("draggableID"); + } else { + draggableID = id(); + } + return draggableID; + } + + public String id() { + if(_id == null) { + if(canGetValueForBinding("id") && valueForBinding("id") != null) { + _id = (String) valueForBinding("id"); + } else { + _id = safeElementID(); + if(canSetValueForBinding("id")) { + setValueForBinding(_id, "id"); + } + } + } + return _id; + } + + public String variableName() { + if(_variableName == null) { + _variableName = (String)valueForStringBinding("variableName", "mtAD" + ERXWOContext.safeIdentifierName(context(), true)); + } + return _variableName; + } + + public boolean ghost() { + return (Boolean)valueForBinding("ghost", Boolean.FALSE); + } + + public String quotedID() { + return AjaxUtils.quote(id()); + } + + public String quotedContextID() { + return AjaxUtils.quote(context().contextID()); + } + + public String quotedElementID() { + return AjaxUtils.quote(_elementID); + } + + public String elementName() { + return (String)valueForBinding("elementName", "div"); + } + + public String updateContainerID() { + return (String) valueForBinding("updateContainerID"); + } + + public String quotedUpdateContainerID() { + return AjaxUtils.quote(updateContainerID()); + } + + public String quotedActionUrl() { + boolean submit = ERXComponentUtilities.booleanValueForBinding(this, "submit", false); + String actionUrl = (submit && updateContainerID() == null) ? null : _actionUrl; + return actionUrl != null ? AjaxUtils.quote(_actionUrl) : null; + } + + public String quotedDraggableKeyName() { + return AjaxUtils.quote(_draggableIDKeyName); + } + + public boolean submit() { + return ERXComponentUtilities.booleanValueForBinding(this, "submit", false); + } + + public String form() { + return (String) valueForBinding("formName"); + } + + /* + @SuppressWarnings("unused") + public String onDrop() { + + boolean submit = ERXComponentUtilities.booleanValueForBinding(this, "submit", false); + + String contextID = AjaxUtils.quote(context().contextID()); + String elementID = AjaxUtils.quote(_elementID); + String droppableElementID = AjaxUtils.quote((String)valueForBinding("id")); + String draggableKeyName = AjaxUtils.quote(_draggableIDKeyName); + String updateContainerID = AjaxUtils.quote((String) valueForBinding("updateContainerID")); + String actionUrl = (submit && updateContainerID == null) ? null : AjaxUtils.quote(_actionUrl); + String form = (String) valueForBinding("formName"); + + if(submit) { + if(form == null) { + form = ERXWOForm.formName(context(), null); + if(form == null) { + throw new IllegalArgumentException("If submit is true, you must provide either a formName or your containing form must have a name."); + } + } + form = "document." + form; + } + + return "function(element, droppable) { if(droppable) { element.destroy(); MTAUL.update("+updateContainerID+", { updateUrl: " + actionUrl + "}, " + contextID + " + '.' + " + elementID + ", null); }}"; + } + */ + + @Override + protected void addRequiredWebResources(WOResponse res) { + + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + Boolean useSpinner = booleanValueForBinding("useSpinner", false); + if(useSpinner) { + Boolean useDefaultSpinnerClass = booleanValueForBinding("defaultSpinnerClass", true); + if(useDefaultSpinnerClass) { + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", "scripts/plugins/spinner/spinner.css"); + } + } + + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + + MTAjaxUpdateContainer.setUpdateContainerID(request, (String) valueForBinding("updateContainerID")); + String droppedDraggableID = request.stringFormValueForKey(_draggableIDKeyName); + _droppedArea = request.stringFormValueForKey("dropAreaID"); + + if (canSetValueForBinding("droppedDraggableID")) { + setValueForBinding(droppedDraggableID, "droppedDraggableID"); + } + + if (canSetValueForBinding("droppedObject")) { + WOComponent page = context.page(); + Object droppedObject = MTAjaxDraggable.draggableObjectForPage(page, droppedDraggableID); + setValueForBinding(droppedObject, "droppedObject"); + } + + if(canSetValueForBinding("droppedArea")) { + setValueForBinding(_droppedArea, "droppedArea"); + } + + if (canGetValueForBinding("action")) { + WOActionResults results = (WOActionResults) valueForBinding("action"); + if (results != null) { + System.out.println("MTAjaxDroppable.handleRequest: Not quite sure what to do with non-null results yet ..."); + } + } + return null; + } + + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxFileUpload.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxFileUpload.java new file mode 100644 index 00000000000..5eb0916d875 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxFileUpload.java @@ -0,0 +1,390 @@ +package er.ajax.mootools; + +import java.io.File; +import java.io.FileInputStream; +import java.io.OutputStream; +import java.text.NumberFormat; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOApplication; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSData; + +import er.ajax.AjaxFileUpload; +import er.ajax.AjaxFileUploadRequestHandler; +import er.ajax.AjaxResponse; +import er.ajax.AjaxUploadProgress; +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXRequest; +import er.extensions.appserver.ERXWOContext; +import er.extensions.components.ERXComponentUtilities; +import er.extensions.formatters.ERXUnitAwareDecimalFormat; +import er.extensions.foundation.ERXFileUtilities; + +/** + * AjaxFileUpload provides an Ajax wrapper around the file upload process. This works pretty differently than + * WOFileUpload. The AjaxFileUpload component itself provides its own form and autosubmits when the user selects a file + * to upload. The upload runs in a hidden iframe, with Ajax updates occurring in the main window. When the final ajax + * update occurs after the completion of the upload, the appropriate actions fire. This means that if the user navigates + * away during the upload, no completion/failure/etc notifications will occur. + * + * @binding cancelText the text to display for the cancel link + * @binding cancelingText the text to display when the progress is being canceled + * @binding startingText the text to display when the progress is starting + * @binding startedFunction the javascript function to execute when the progress is started + * @binding canceledFunction the javascript function to execute when the upload is canceled + * @binding succeededFunction the javascript function to execute when the upload succeeds + * @binding failedFunction the javascript function to execute when the upload fails + * @binding finishedFunction the javascript function to execute when the upload finishes (succeeded, failed, or + * canceled) + * @binding finishedAction the action to fire when the upload finishes (cancel, failed, or succeeded) + * @binding canceledAction the action to fire when the upload is canceled + * @binding succeededAction the action to fire when the upload succeeded + * @binding failedAction the action to fire when the upload fails + * @binding data the NSData that will be bound with the contents of the upload + * @binding inputStream will be bound to an input stream on the contents of the upload + * @binding outputStream the output stream to write the contents of the upload to + * @binding streamToFilePath the path to write the upload to, can be a directory + * @binding finalFilePath the final file path of the upload (when streamToFilePath is set or keepTempFile = true) + * @binding filePath the name of the uploaded file + * @binding allowCancel if true, the cancel link is visible + * @binding progressBarBeforeStart if true, the progress bar is visible before the upload is started + * @binding progressBarAfterDone if true, the progress bar is visible after the upload is done + * @binding refreshTime the number of milliseconds to wait between refreshes + * @binding keepTempFile if true, don't delete the temp file that AjaxFileUpload creates + * @binding uploadLabel the label to display on the Upload button ("Upload" by default) + * @binding uploadFunctionName the upload button will instead be a function with the given name + * @binding progressOfText the text to display for the word "of" in the "[size] of [totalsize]" string during upload + * @binding mimeType set from the content-type of the upload header if available + * @binding class the class attribute of the file input + * @binding style the style attribute of the file input + * @binding id the id attribute of the file input + * @binding onFileSelected optional JS code that is called when the file selection changes. To auto-start the upload when + * a file is selected, set uploadFunctionName to e.g. "startUpload" and onFileSelected to "startUpload()" + * @binding uploadProgress access to the underlying AjaxUploadProgress object + * + * @author mschrag + */ + + +public class MTAjaxFileUpload extends WOComponent { + + private static boolean _requestHandlerRegistered = false; + + private String _id; + protected boolean _uploadStarted; + protected AjaxUploadProgress _progress; + protected boolean _triggerUploadStart; + private String _requestHandlerKey; + + + public MTAjaxFileUpload(WOContext context) { + super(context); + _requestHandlerKey = AjaxFileUploadRequestHandler.REQUEST_HANDLER_KEY; + if (!_requestHandlerRegistered) { + synchronized (AjaxFileUpload.class) { + if (!_requestHandlerRegistered) { + if (WOApplication.application().requestHandlerForKey(AjaxFileUploadRequestHandler.REQUEST_HANDLER_KEY) == null) { + WOApplication.application().registerRequestHandler(new AjaxFileUploadRequestHandler(), AjaxFileUploadRequestHandler.REQUEST_HANDLER_KEY); + } + _requestHandlerRegistered = true; + } + } + } + } + + public void setRequestHandlerKey(String requestHandlerKey) { + _requestHandlerKey = requestHandlerKey; + } + + public String requestHandlerKey() { + return _requestHandlerKey; + } + + public boolean synchronizesVariablesWithBindings() { + return false; + } + + public String uploadLabel() { + String uploadLabel = (String)valueForBinding("uploadLabel"); + if (uploadLabel == null) { + uploadLabel = "Upload"; + } + return uploadLabel; + } + + public boolean progressBarBeforeStart() { + boolean progressBarBeforeStart = false; + if (hasBinding("progressBarBeforeStart")) { + progressBarBeforeStart = ERXComponentUtilities.booleanValueForBinding(this, "progressBarBeforeStart"); + } + return progressBarBeforeStart; + } + + public boolean progressBarAfterDone() { + boolean progressBarAfterDone = false; + if (hasBinding("progressBarAfterDone")) { + progressBarAfterDone = ERXComponentUtilities.booleanValueForBinding(this, "progressBarAfterDone"); + } + return progressBarAfterDone; + } + + public void setUploadProgress(AjaxUploadProgress progress) { + _progress = progress; + if (hasBinding("uploadProgress")) { + setValueForBinding(progress, "uploadProgress"); + } + if (progress == null && !hasBinding("uploadStarted")) { + _uploadStarted = false; + } + } + + public AjaxUploadProgress uploadProgress() { + return _progress; + } + + public String id() { + String id = _id; + if (id == null) { + id = (String) valueForBinding("id"); + if (id == null) { + id = ERXWOContext.safeIdentifierName(context(), true); + } + _id = id; + } + return id; + } + + public String uploadUrl() { + String uploadUrl = context().urlWithRequestHandlerKey(_requestHandlerKey, "", null); + return uploadUrl; + } + + public String bytesReadSize() { + String bytesReadSize = null; + AjaxUploadProgress progress = uploadProgress(); + if (progress != null) { + NumberFormat formatter = new ERXUnitAwareDecimalFormat(ERXUnitAwareDecimalFormat.BYTE); + formatter.setMaximumFractionDigits(2); + bytesReadSize = formatter.format(progress.value()); + } + return bytesReadSize; + } + + public String streamLengthSize() { + String streamLengthSize = null; + AjaxUploadProgress progress = uploadProgress(); + if (progress != null) { + NumberFormat formatter = new ERXUnitAwareDecimalFormat(ERXUnitAwareDecimalFormat.BYTE); + formatter.setMaximumFractionDigits(2); + streamLengthSize = formatter.format(progress.maximum()); + } + return streamLengthSize; + } + + public String uploadFrameName() { + return id() + "UploadFrame"; + } + + public String startUploadName() { + return id() + "StartUpload"; + } + + public String startUploadFunctionCall() { + return "form.submit(true); " + startUploadName() + "();"; + } + + public boolean triggerStartUpload() { + boolean triggerUploadStart = _triggerUploadStart; + if (triggerUploadStart) { + _triggerUploadStart = false; + } + return triggerUploadStart; + } + + public String uploadFormID() { + return id() + "Form"; + } + + public String progressBarID() { + return id() + "ProgressBar"; + } + + public String startingText() { + String startingText = (String) valueForBinding("startingText"); + if (startingText == null) { + startingText = "Upload Starting ..."; + } + return startingText; + } + + public String cancelText() { + String cancelText = (String) valueForBinding("cancelText"); + if (cancelText == null) { + cancelText = "cancel"; + } + return cancelText; + } + + public String cancelingText() { + String cancelingText = (String) valueForBinding("cancelingText"); + if (cancelingText == null) { + cancelingText = "Canceling Upload ..."; + } + return cancelingText; + } + + public WOActionResults startUpload() { + _triggerUploadStart = true; + if (_progress != null) { + _progress.reset(); + } + _progress = null; + if (hasBinding("uploadProgress")) { + setValueForBinding(null, "uploadProgress"); + } + + _uploadStarted = true; + if (hasBinding("uploadStarted")) { + setValueForBinding(Boolean.TRUE, "uploadStarted"); + } + + AjaxResponse response = AjaxUtils.createResponse(context().request(), context()); + AjaxUtils.appendScriptHeaderIfNecessary(context().request(), response); + response.appendContentString("document." + uploadFormID() + ".submit();"); + AjaxUtils.appendScriptFooterIfNecessary(context().request(), response); + return response; + } + + public boolean isUploadStarted() { + boolean uploadStarted; + if (hasBinding("uploadStarted")) { + uploadStarted = ERXComponentUtilities.booleanValueForBinding(this, "uploadStarted"); + } + else { + AjaxUploadProgress progress = uploadProgress(); + if (progress != null && progress.shouldReset()) { + _uploadStarted = false; + setValueForBinding(Boolean.FALSE, "uploadStarted"); + } + uploadStarted = _uploadStarted; + } + return uploadStarted; + } + + public void uploadFinished() { + valueForBinding("finishedAction"); + } + + public WOActionResults uploadCanceled() { + uploadFinished(); + WOActionResults results = (WOActionResults) valueForBinding("canceledAction"); + return results; + } + + public WOActionResults uploadSucceeded() { + AjaxUploadProgress progress = uploadProgress(); + try { + boolean deleteFile = true; + if (hasBinding("filePath")) { + setValueForBinding(progress.fileName(), "filePath"); + } + + if (hasBinding("data")) { + NSData data = new NSData(progress.tempFile().toURL()); + setValueForBinding(data, "data"); + } + + if (hasBinding("mimeType")) { + String contentType = progress.contentType(); + if (contentType != null) { + setValueForBinding(contentType, "mimeType"); + } + } + + if (hasBinding("inputStream")) { + setValueForBinding(new FileInputStream(progress.tempFile()), "inputStream"); + deleteFile = false; + } + + if (hasBinding("outputStream")) { + OutputStream outputStream = (OutputStream) valueForBinding("outputStream"); + if (outputStream != null) { + ERXFileUtilities.writeInputStreamToOutputStream(new FileInputStream(progress.tempFile()), true, outputStream, true); + } + } + + String finalFilePath = progress.tempFile().getAbsolutePath(); + if (hasBinding("streamToFilePath")) { + File streamToFile = new File((String) valueForBinding("streamToFilePath")); + boolean renamedFile; + boolean renameFile; + if (streamToFile.exists()) { + boolean overwrite = ERXComponentUtilities.booleanValueForBinding(this, "overwrite"); + if (streamToFile.isDirectory()) { + File parentDir = streamToFile; + String fileName = ERXFileUtilities.fileNameFromBrowserSubmittedPath(progress.fileName()); + streamToFile = ERXFileUtilities.reserveUniqueFile(new File(parentDir, fileName), overwrite); + renameFile = true; + } + else { + renameFile = overwrite; + } + } + else { + renameFile = true; + } + + if (renameFile && !streamToFile.isDirectory()) { + ERXFileUtilities.renameTo(progress.tempFile(), streamToFile); + renamedFile = true; + } + else { + renamedFile = false; + progress.setFailure(new Exception ("Could not rename file.")); + return this.uploadFailed(); + } + + if (renamedFile) { + finalFilePath = streamToFile.getAbsolutePath(); + } + + deleteFile = false; + } + else if (hasBinding("keepTempFile") && deleteFile) { + deleteFile = !ERXComponentUtilities.booleanValueForBinding(this, "keepTempFile"); + } + + if (deleteFile) { + progress.dispose(); + } + else if (hasBinding("finalFilePath")) { + setValueForBinding(finalFilePath, "finalFilePath"); + } + + } + catch (Throwable t) { + t.printStackTrace(); + progress.setFailure(t); + return this.uploadFailed(); + } + finally { + uploadFinished(); + } + WOActionResults results = (WOActionResults) valueForBinding("succeededAction"); + return results; + } + + public WOActionResults uploadFailed() { + uploadFinished(); + WOActionResults results = (WOActionResults) valueForBinding("failedAction"); + return results; + } + + public String srcUrl() { + return ERXWOContext._directActionURL(context(), "ERXDirectAction/empty", null, ERXRequest.isRequestSecure(context().request())); + } + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxModalContainer.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxModalContainer.java new file mode 100644 index 00000000000..4a9865f71d3 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxModalContainer.java @@ -0,0 +1,296 @@ +package er.ajax.mootools; + +import java.net.MalformedURLException; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOAssociation; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSForwardException; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxOption; +import er.ajax.AjaxOptions; +import er.ajax.AjaxUpdateContainer; +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXRequest; +import er.extensions.appserver.ERXWOContext; +import er.extensions.foundation.ERXMutableURL; + +public class MTAjaxModalContainer extends AjaxDynamicElement { + + private String _updateContainerID = null; + private String _url = null; + + public MTAjaxModalContainer(String name, NSDictionary associations, WOElement children) { + super(name, associations, children); + } + + public void appendToResponse(WOResponse response, WOContext context) { + + WOComponent component = context.component(); + + String linkID = (String) valueForBinding("id", component); + if(linkID == null) { + linkID = ERXWOContext.safeIdentifierName(context, false); + } + String containerID = (String) valueForBinding("containerID", linkID + "Container", component); + + String linkElementName = (String)valueForBinding("linkElementName", "a", component); + String label = (String)valueForBinding("label", "Open", component); + + _url = (String) valueForBinding("href", component); + if(_url == null) { + String directActionName = stringValueForBinding("directActionName", component); + + if(directActionName != null) { + NSDictionary queryDictionary = (NSDictionary)valueForBinding("queryDictionary", component); + boolean secure = booleanValueForBinding("secure", ERXRequest.isRequestSecure(context.request()), component); + if(secure) { + boolean generatingCompleteURLs = (context instanceof ERXWOContext) ? ((ERXWOContext)context)._generatingCompleteURLs() : false; + if(!generatingCompleteURLs) { + context._generateCompleteURLs(); + } + try { + _url = context._directActionURL(directActionName, queryDictionary, secure); + ERXMutableURL u = new ERXMutableURL(_url); + u.addQueryParameter(String.valueOf(System.currentTimeMillis()), null); + _url = u.toExternalForm(); + } catch (MalformedURLException e) { + throw new NSForwardException(e); + } finally { + if(!generatingCompleteURLs) { + context._generateRelativeURLs(); + } + } + } else { + _url = context.directActionURLForActionNamed(directActionName, queryDictionary); + } + } + } + + boolean isAjax = booleanValueForBinding("ajax", false, component); + if(_url == null) { + if(isAjax) { + if(valueForBinding("id", component) == null) { + throw new IllegalArgumentException("If ajax = 'true', you must also bind 'id'"); + } + _url = AjaxUtils.ajaxComponentActionUrl(context); + } else if (associations().objectForKey("action") != null) { + _url = context.componentActionURL(); + } + if(_url == null) { + _url = "#" + containerID; + } + } + + response.appendContentString("<"); + response.appendContentString(linkElementName); + appendTagAttributeToResponse(response, "id", linkID); + appendTagAttributeToResponse(response, "href", _url); + appendTagAttributeToResponse(response, "title", valueForBinding("title", component)); + appendTagAttributeToResponse(response, "value", valueForBinding("value", component)); + appendTagAttributeToResponse(response, "class", valueForBinding("class", component)); + appendTagAttributeToResponse(response, "style", valueForBinding("style", component)); + response.appendContentString(">"); + response.appendContentString(label); + response.appendContentString(""); + + Boolean autoWrapContent = (Boolean)valueForBinding("autoWrapContent", true, component); + Boolean showFooter = (Boolean)valueForBinding("showFooter", true, component); + Boolean showTitle = (Boolean)valueForBinding("showTitle", true, component); + String modalClassNames = (String)valueForBinding("modalClassNames", "modal fade", component); + _updateContainerID = null; + if(_url.startsWith("#")) { + + response.appendContentString("\n
    "); + + String title = stringValueForBinding("title", component); + if(showTitle && title != null) { + response.appendContentString("\n\t
    "); + response.appendContentString("\n\t\tx"); + response.appendContentString("\n\t\t

    "); + response.appendContentString(title); + response.appendContentString("

    "); + response.appendContentString("\n\t
    "); + } + + if(autoWrapContent) { + response.appendContentString("\n\t
    "); + } + + appendChildrenToResponse(response, context); + + if(autoWrapContent) { + response.appendContentString("\n\t
    "); + } + + if(showFooter) { + response.appendContentString("\n\t
    "); + response.appendContentString("\n\t\tClose"); + response.appendContentString("\n\t
    "); + } + + response.appendContentString("
    "); + + } else { + _updateContainerID = containerID; + response.appendContentString("\n
    "); + + String title = stringValueForBinding("title", component); + if(showTitle && title != null) { + response.appendContentString("\n\t
    "); + response.appendContentString("\n\t\tx"); + response.appendContentString("\n\t\t

    "); + response.appendContentString(title); + response.appendContentString("

    "); + response.appendContentString("\n\t
    "); + } + + if(autoWrapContent) { + String modalBodyID = stringValueForBinding("modalBodyID", component); + if(modalBodyID == null) { + modalBodyID = "modalBody" + ERXWOContext.safeIdentifierName(context, false); + } + _updateContainerID = modalBodyID; + response.appendContentString("\n\t
    "); + + } + + if(autoWrapContent) { + response.appendContentString("\n\t
    "); + } + + if(showFooter) { + response.appendContentString("\n\t
    "); + response.appendContentString("\n\t\tClose"); + response.appendContentString("\n\t
    "); + } + + response.appendContentString("
    "); + + + } + + String varName = stringValueForBinding("varName", component); + if(varName == null) { + varName = "bsPopUp" + ERXWOContext.safeIdentifierName(context, false); + } + + AjaxUtils.appendScriptHeader(response); + response.appendContentString("\nwindow.addEvent('domready', function() {"); + response.appendContentString("\n\tvar "); + response.appendContentString(varName); + response.appendContentString(" = new Bootstrap.Popup('"); + response.appendContentString(containerID); + response.appendContentString("', {"); + if(_updateContainerID != null) { + response.appendContentString("onShow: function() { "); + response.appendContentString("\n\tnew Request.HTML("); + AjaxOptions.appendToResponse(createAjaxOptions(component), response, context); + response.appendContentString(").send();"); + response.appendContentString("}"); + } + response.appendContentString("});"); + response.appendContentString("\n\tdocument.id('"); + response.appendContentString(linkID); + response.appendContentString("').addEvent('click', function(e) { e.preventDefault(); this.show(); }.bind("); + response.appendContentString(varName); + response.appendContentString("));"); + response.appendContentString("\n})"); + AjaxUtils.appendScriptFooter(response); + super.appendToResponse(response, context); + } + + protected String _containerID(WOContext context) { + String id = (String) valueForBinding("id", context.component()); + return id; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public NSDictionary createAjaxOptions(WOComponent component) { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("async", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("onRequest", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onSuccess", AjaxOption.FUNCTION_2)); + ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onException", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY)); + + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations()); + options.setObjectForKey("'" + _url + "'", "url"); + options.setObjectForKey("'" + _updateContainerID + "'", "update"); + options.setObjectForKey("'get'", "method"); + + if (options.objectForKey("async") == null) { + options.setObjectForKey("true", "async"); + } + if (options.objectForKey("evalScripts") == null) { + options.setObjectForKey("true", "evalScripts"); + } + + AjaxUpdateContainer.expandInsertionFromOptions(options, this, component); + return options; + + } + + @Override + protected void addRequiredWebResources(WOResponse response, WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", "scripts/plugins/bootstrap/ui/Bootstrap.js"); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", "scripts/plugins/bootstrap/behaviors/Behavior.js"); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", "scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.js"); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", "scripts/plugins/bootstrap/ui/Bootstrap.Popup.js"); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", "scripts/plugins/bootstrap/ui/CSSEvents.js"); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + System.out.println("Hello?"); + WOComponent component = context.component(); + + WOResponse response = null; + WOAssociation action = (WOAssociation)associations().objectForKey("action"); + if(action != null) { + action.valueInComponent(component); + } + + if(booleanValueForBinding("ajax", false, component) && hasChildrenElements()) { + response = AjaxUtils.createResponse(request, context); + AjaxUtils.setPageReplacementCacheKey(context, _containerID(context)); + appendChildrenToResponse(response, context); + } + + return response; + + } + + + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxObserveField.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxObserveField.java new file mode 100644 index 00000000000..9e99836e788 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxObserveField.java @@ -0,0 +1,203 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxOption; +import er.ajax.AjaxOptions; +import er.ajax.AjaxSubmitButton; +import er.ajax.AjaxUpdateContainer; +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXWOContext; +import er.extensions.appserver.ajax.ERXAjaxApplication; + +/** + * AjaxObserveField allows you to perform an Ajax submit (and optional update) based + * on the state of a form field changing. If you specify an observeFieldID, that + * single field will be observed for changes. If you also specify an updateContainerID, + * the given container will be refreshed after the field changes. If you do NOT specify + * an observeFieldID, all of the form fields contained within this component will be + * observed for changes instead. The list of form fields to observe is obtained on + * the client side, so you should not put AjaxUpdateContainers INSIDE of this component + * or any fields inside of the container will no be observed after an update. Instead, + * AjaxObserveFields should be surrounded by a container. + * + * If you leave of observeFieldID, AjaxObserveField must generate an HTML container, so + * that it can find the form fields that correspond to this component from the client + * side. + * + * @binding id the ID of the observe field container (only useful if you leave off observeFieldID). + * @binding elementName element to use for the observe field container. Defaults to div. + * (Only used if you leave off observeFieldID) + * @binding observeFieldID the ID of the field to observe + * @binding updateContainerID the ID of the container to update. Specify "_parent" to use the nearest one. + * @binding action the action to call when the observer fires + * @binding onBeforeSubmit called prior to submitting the observed content; return false to deny the submit + * @binding observeFieldFrequency the polling observe frequency (in seconds) + * @binding observeDelay the minimum time between submits (in seconds) + * @binding fullSubmit When false, only the value of the field that changed is sent to the server (partial submit), + * when true, the whole form is sent. Defaults to false. + * Caution: Partial submit doesn't work correctly if you manually set the name on your inputs. + * @binding class CSS class to use on the container. (Only used if you leave off observeFieldID) + * @binding style CSS style to use on the container. (Only used if you leave off observeFieldID) + * @binding onCreate Takes a JavaScript function which is called after the form has been serialized, + * but befor the Ajax request is sent to the server. Useful e.g. if you want to disable the + * form while the ajax request is running. + */ + +public class MTAjaxObserveField extends AjaxDynamicElement { + + public MTAjaxObserveField(String name, NSDictionary associations, WOElement children) { + super(name, associations, children); + } + + + + @SuppressWarnings({"rawtypes","unchecked"}) + public NSMutableDictionary createAjaxOptions(WOComponent component) { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("observeFieldFrequency", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("observeDelay", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("onCancel", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onException", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onRequest", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onSuccess", AjaxOption.FUNCTION_2)); + ajaxOptionsArray.addObject(new AjaxOption("async", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY)); + + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations()); + return options; + + } + + @SuppressWarnings("rawtypes") + public void appendToResponse(WOResponse response, WOContext context) { + + super.appendToResponse(response, context); + + WOComponent component = context.component(); + String observeFieldID = (String) valueForBinding("observeFieldID", component); + String updateContainerID = MTAjaxUpdateContainer.updateContainerID(this, component); + NSMutableDictionary options = createAjaxOptions(component); + boolean fullSubmit = booleanValueForBinding("fullSubmit", false, component); + boolean observeFieldDescendents; + + if (observeFieldID != null) { + observeFieldDescendents = false; + } + else { + observeFieldDescendents = true; + observeFieldID = (String)valueForBinding("id", component); + if (observeFieldID == null) { + observeFieldID = ERXWOContext.safeIdentifierName(context, false); + } + String elementName = (String)valueForBinding("elementName", component); + if (elementName == null) { + elementName = "div"; + } + response.appendContentString("<" + elementName + " id = \"" + observeFieldID + "\""); + + String className = stringValueForBinding("class", component); + if (className != null && className.length() > 0) { + response.appendContentString(" class=\"" + className + "\""); + } + + String style = stringValueForBinding("style", component); + if (style != null && style.length() > 0) { + response.appendContentString(" style=\"" + style + "\""); + } + + response.appendContentString(">"); + if (hasChildrenElements()) { + appendChildrenToResponse(response, context); + } + response.appendContentString(""); + } + AjaxUtils.appendScriptHeader(response); + MTAjaxObserveField.appendToResponse(response, context, this, observeFieldID, observeFieldDescendents, updateContainerID, fullSubmit, options); + AjaxUtils.appendScriptFooter(response); + } + + public static void appendToResponse(WOResponse response, WOContext context, AjaxDynamicElement element, String observeFieldID, boolean observeDescendentFields, String updateContainerID, boolean fullSubmit, NSMutableDictionary options) { + WOComponent component = context.component(); + String submitButtonName = nameInContext(context, component, element); + NSMutableDictionary observerOptions = new NSMutableDictionary(); + if (options != null) { + observerOptions.addEntriesFromDictionary(options); + } + AjaxSubmitButton.fillInAjaxOptions(element, component, submitButtonName, observerOptions); + + Object observeFieldFrequency = observerOptions.removeObjectForKey("observeFieldFrequency"); + if (observeDescendentFields) { + response.appendContentString("MTASB.observeDescendentFields"); + } + else { + response.appendContentString("MTASB.observeField"); + } + + Object observeDelay = observerOptions.removeObjectForKey("observeDelay"); + response.appendContentString("(" + AjaxUtils.quote(updateContainerID) + ", " + AjaxUtils.quote(observeFieldID) + ", " + observeFieldFrequency + ", " + (!fullSubmit) + ", " + observeDelay + ", "); + AjaxOptions.appendToResponse(observerOptions, response, context); + response.appendContentString(");"); + } + + + @Override + protected void addRequiredWebResources(WOResponse response, WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + Boolean useSpinner = (Boolean)valueForBinding("useSpinner", Boolean.FALSE, context.component()); + if(useSpinner) { + Boolean useDefaultSpinnerClass = (Boolean)valueForBinding("defaultSpinnerClass", Boolean.TRUE, context.component()); + if(useDefaultSpinnerClass) { + MTAjaxUtils.addStylesheetResourceInHead(context, context.response(), "MooTools", "scripts/plugins/spinner/spinner.css"); + } + } + + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + public static String nameInContext(WOContext context, WOComponent component, AjaxDynamicElement element) { + return (String) element.valueForBinding("name", context.elementID(), component); + } + + @Override + public WOActionResults invokeAction(WORequest request, WOContext context) { + WOActionResults result = null; + WOComponent wocomponent = context.component(); + String nameInContext = nameInContext(context, wocomponent, this); + boolean shouldHandleRequest = !context._wasActionInvoked() && context._wasFormSubmitted() && nameInContext.equals(ERXAjaxApplication.ajaxSubmitButtonName(request)); + if (shouldHandleRequest) { + String updateContainerID = MTAjaxUpdateContainer.updateContainerID(this, wocomponent); + AjaxUpdateContainer.setUpdateContainerID(request, updateContainerID); + context._setActionInvoked(true); + result = (WOActionResults)valueForBinding("action", wocomponent); + if (result == null) { + result = handleRequest(request, context); + } + AjaxUtils.updateMutableUserInfoWithAjaxInfo(context); + } else { + result = invokeChildrenAction(request, context); + } + return result; + } + + public WOActionResults handleRequest(WORequest request, WOContext context) { + WOResponse response = AjaxUtils.createResponse(request, context); + return response; + } +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxProgressBar.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxProgressBar.java new file mode 100644 index 00000000000..9e6319aa253 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxProgressBar.java @@ -0,0 +1,335 @@ +package er.ajax.mootools; + +import java.text.NumberFormat; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; + +import er.ajax.AjaxProgress; +import er.ajax.AjaxProgressBar; +import er.extensions.appserver.ERXWOContext; +import er.extensions.components.ERXComponentUtilities; + +/** + * @binding id the id of the update container + * @binding progressID the id of the AjaxProgress + * @binding progress the progress object for this progress bar (can bind a new progress back out if one is in the + * registry) + * @binding startedFunction the javascript function to execute when the progress is started + * @binding canceledFunction the javascript function to execute when the progress is canceled + * @binding succeededFunction the javascript function to execute when the progress succeeds + * @binding failedFunction the javascript function to execute when the progress fails + * @binding finishedFunction the javascript function to execute when the progress finishes (succeeded, failed, or + * canceled) + * @binding cancelText the text to display for the cancel link + * @binding cancelingText the text to display when the progress is being canceled + * @binding startingText the text to display when the progress is starting + * @binding progressOfText the text to display for the word "of" in the "[size] of [totalsize]" string during upload + * @binding finishedAction the action to fire when the progress finishes (cancel, failed, or succeeded) + * @binding canceledAction the action to fire when the progress is canceled + * @binding succeededAction the action to fire when the progress succeeded + * @binding failedAction the action to fire when the progress fails + * @binding started boolean of whether or not the progress has started (i.e. begin polling) + * @binding allowCancel if true, the cancel link is visible + * @binding visibleBeforeStart if true, the progress bar is visible before the activity is started + * @binding visibleAfterDone if true, the progress bar is visible after the activity is done + * @binding refreshTime the number of milliseconds to wait between refreshes + * + * @author mschrag + */ + +public class MTAjaxProgressBar extends WOComponent { + + private String _id; + private boolean _running; + private AjaxProgress _progress; + private boolean _completionEventsFired; + private boolean _fireFinishedJavascriptEvents; + private boolean _fireStartedJavascriptEvent; + + public MTAjaxProgressBar(WOContext context) { + super(context); + } + + public boolean synchronizesVariablesWithBindings() { + return false; + } + + public boolean fireStartedJavascriptEvent() { + boolean fireStartedJavascriptEvent = _fireStartedJavascriptEvent; + if (fireStartedJavascriptEvent) { + _fireStartedJavascriptEvent = false; + } + return fireStartedJavascriptEvent; + } + + public boolean fireFinishedJavascriptEvents() { + boolean fireFinishedJavascriptEvents = _fireFinishedJavascriptEvents; + if (fireFinishedJavascriptEvents) { + _fireFinishedJavascriptEvents = false; + } + return fireFinishedJavascriptEvents; + } + + public boolean progressBarVisible() { + boolean visible = true; + AjaxProgress progress = progress(); + if (!isStarted()) { + if (hasBinding("visibleBeforeStart")) { + visible = ERXComponentUtilities.booleanValueForBinding(this, "visibleBeforeStart"); + } + } + else if (done() && !_fireFinishedJavascriptEvents) { + if (hasBinding("visibleAfterDone")) { + visible = ERXComponentUtilities.booleanValueForBinding(this, "visibleAfterDone"); + } + } + return visible; + } + + public String startingText() { + String startingText = (String) valueForBinding("startingText"); + if (startingText == null) { + startingText = "Starting ..."; + } + return startingText; + } + + public String cancelingText() { + String cancelingText = (String) valueForBinding("cancelingText"); + if (cancelingText == null) { + cancelingText = "Canceling ..."; + } + return cancelingText; + } + + public AjaxProgress progress() { + if (_progress != null && _progress.shouldReset()) { + _progress = null; + setValueForBinding(null, "progress"); + } + if (_progress == null) { + _progress = (AjaxProgress) valueForBinding("progress"); + if (_progress != null && _progress.shouldReset()) { + _progress = null; + setValueForBinding(null, "progress"); + } + if (_progress == null) { + _progress = AjaxProgressBar.progress(session(), progressID()); + if (_progress != null) { + if (_progress.shouldReset()) { + AjaxProgressBar.unregisterProgress(session(), _progress); + _progress = null; + } + setValueForBinding(_progress, "progress"); + } + } + } + return _progress; + } + + public String progressID() { + String progressID = (String) valueForBinding("progressID"); + if (progressID == null) { + progressID = id(); + } + return progressID; + } + + public String id() { + String id = _id; + if (id == null) { + id = (String) valueForBinding("id"); + if (id == null) { + id = ERXWOContext.safeIdentifierName(context(), true); + } + _id = id; + } + return id; + } + + public String finishedClass() { + String finishedClass; + String percentage = percentage(); + if ("0".equals(percentage)) { + finishedClass = "percentageUnfinished"; + } + else { + AjaxProgress progress = progress(); + if (progress != null && progress.isDone()) { + finishedClass = "percentageFinished done"; + } + else { + finishedClass = "percentageFinished"; + } + } + return finishedClass; + } + + public Object displayValue() { + Object displayValue = valueForBinding("displayValue"); + if (displayValue == null) { + AjaxProgress progress = progress(); + if (progress != null) { + displayValue = String.valueOf(progress.value()); + } + else { + displayValue = ""; + } + } + return displayValue; + } + + public Object displayMaximum() { + Object displayMaximum = valueForBinding("displayMaximum"); + if (displayMaximum == null) { + AjaxProgress progress = progress(); + if (progress != null) { + displayMaximum = String.valueOf(progress.maximum()); + } + else { + displayMaximum = ""; + } + } + return displayMaximum; + } + + public String percentage() { + AjaxProgress progress = progress(); + String percentageStr; + if (progress == null || progress.isSucceeded()) { + percentageStr = "0"; + } + else { + + double percentage = progress.percentage() * 100.0; + if (percentage < 5) { + percentageStr = "0"; + } + else { + percentageStr = NumberFormat.getIntegerInstance().format(percentage) + "%"; + } + } + return "width: " + percentageStr; + } + + public boolean isStarted() { + boolean started; + if (hasBinding("started")) { + started = ERXComponentUtilities.booleanValueForBinding(this, "started"); + } + else { + started = (progress() != null || _running); + } + return started; + } + + public String cancelText() { + String cancelText = (String) valueForBinding("cancelText"); + if (cancelText == null) { + cancelText = "cancel"; + } + return cancelText; + } + + public String progressOfText() { + String progressOfText = (String) valueForBinding("progressOfText"); + if (progressOfText == null) { + progressOfText = "of"; + } + return progressOfText; + } + + public String onChange() { + return id() + "AjaxProgress.start()"; + } + + protected void _checkForCompletion() { + AjaxProgress progress = progress(); + if (progress != null) { + if (progress.isDone()) { + if (!progress.completionEventsFired()) { + if (progress.isCanceled()) { + progressCanceled(); + } + else if (progress.isFailed()) { + progressFailed(); + } + else if (progress.isSucceeded()) { + progressSucceeded(); + } + progress.setCompletionEventsFired(true); + _fireFinishedJavascriptEvents = true; + } + } + } + } + + public boolean done() { + boolean done = false; + AjaxProgress progress = progress(); + if (progress != null) { + done = progress.isDone() && progress.completionEventsFired(); + } + return done; + } + + public String refreshTime() { + String refreshTimeStr; + Object refreshTime = valueForBinding("refreshTime"); + if (refreshTime == null) { + refreshTimeStr = "1000"; + } + else { + refreshTimeStr = refreshTime.toString(); + } + return refreshTimeStr; + } + + public WOActionResults refreshing() { + if (!_running) { + _fireStartedJavascriptEvent = true; + } + _running = true; + _checkForCompletion(); + return null; + } + + public WOActionResults cancel() { + AjaxProgress progress = progress(); + if (progress != null) { + progress.cancel(); + } + return null; + } + + protected void finished() { + if (_progress != null) { + AjaxProgressBar.unregisterProgress(session(), _progress); + } + _running = false; + valueForBinding("finishedAction"); + } + + protected void progressCanceled() { + finished(); + valueForBinding("canceledAction"); + } + + protected void progressSucceeded() { + AjaxProgress progress = progress(); + finished(); + valueForBinding("succeededAction"); + } + + protected void progressFailed() { + finished(); + valueForBinding("failedAction"); + } + + public String progressBarContainerClass() { + return valueForStringBinding("progressBarContainerClass", "progress"); + } + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxSortableList.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxSortableList.java new file mode 100644 index 00000000000..a5d14848c2c --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxSortableList.java @@ -0,0 +1,236 @@ +package er.ajax.mootools; + +import java.util.NoSuchElementException; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.eocontrol.EOKeyValueQualifier; +import com.webobjects.eocontrol.EOQualifier; +import com.webobjects.foundation.NSArray; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSKeyValueCodingAdditions; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; +import com.webobjects.foundation.NSRange; + +import er.ajax.AjaxComponent; +import er.ajax.AjaxOption; +import er.ajax.AjaxUtils; + +public class MTAjaxSortableList extends AjaxComponent { + + private String _id; + private String _actionUrl; + private String _sortOrderKeyName; + private String _var; + + public MTAjaxSortableList(WOContext context) { + super(context); + } + + public void appendToResponse(WOResponse response, WOContext context) { + + _actionUrl = AjaxUtils.ajaxComponentActionUrl(context); + _id = hasBinding("id") ? (String) valueForBinding("id") : safeElementID(); + _var = hasBinding("var") ? (String) valueForBinding("var") : safeElementID(); + + _sortOrderKeyName = safeElementID(); + + super.appendToResponse(response, context); + + } + + public String listElementName() { + return valueForStringBinding("listElementName", "ul"); + } + + public String listItemElementName() { + return valueForStringBinding("listItemElementName", "li"); + } + + public String listItemID(String itemID) { + String listID = (String) valueForBinding("id"); + String listItemIDWithoutIndex = listID + "_" + itemID; + return listItemIDWithoutIndex; + } + + public String listItemID() { + Object item = valueForBinding("item"); + String listItemIDKeyPath = (String) valueForBinding("listItemIDKeyPath"); + String itemID = String.valueOf(NSKeyValueCodingAdditions.Utility.valueForKeyPath(item, listItemIDKeyPath)); + String listItemID = listItemID(itemID); + return listItemID; + } + + @Override + protected void addRequiredWebResources(WOResponse res) { + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + if(!canGetValueForBinding("list")) { + throw new IllegalArgumentException("You must specify a readable 'list'."); + } + + if (!canGetValueForBinding("listItemIDKeyPath")) { + throw new IllegalArgumentException("You must specify 'listItemIDKeyPath' if you specify 'list'."); + } + + String listItemIDKeyPath = (String) valueForBinding("listItemIDKeyPath"); + Object listItemIDArrayObj = request.formValues().objectForKey(_sortOrderKeyName + "[]"); + NSArray listItemIDArray; + + if (listItemIDArrayObj instanceof NSArray) { + listItemIDArray = (NSArray) listItemIDArrayObj; + } + else if (listItemIDArrayObj instanceof String) { + String listItemIDStr = (String) listItemIDArrayObj; + listItemIDArray = new NSArray(listItemIDStr); + } + else { + throw new IllegalArgumentException("Unknown list item ID array " + listItemIDArrayObj); + } + + + NSArray list = (NSArray) valueForBinding("list"); + boolean mutableList = (list instanceof NSMutableArray); + NSMutableArray reorderedList; + + if(mutableList) { + reorderedList = (NSMutableArray) list; + } else { + reorderedList = new NSMutableArray(); + } + + int startIndex = 0; + if(canGetValueForBinding("startIndex")) { + Number startIndexNumber = (Number) valueForBinding("startIndex"); + startIndex = startIndexNumber.intValue(); + if(!mutableList) { + for(int i = 0; i < startIndex; i++) { + reorderedList.addObject(list.objectAtIndex(i)); + } + } + } + + int listItemIDCount = listItemIDArray.count(); + for(int listItemIDIndex = 0; listItemIDIndex < listItemIDCount; listItemIDIndex++) { + + String itemID = (String) listItemIDArray.objectAtIndex(listItemIDIndex); + NSRange itemPageRange; + + if(mutableList) { + itemPageRange = new NSRange(startIndex + listItemIDIndex, listItemIDCount - listItemIDIndex); + } else { + itemPageRange = new NSRange(startIndex, listItemIDCount); + } + + NSArray itemPageArray = list.subarrayWithRange(itemPageRange); + EOQualifier itemIDQualifier = new EOKeyValueQualifier(listItemIDKeyPath, EOQualifier.QualifierOperatorEqual, itemID); + NSArray matchingItems = EOQualifier.filteredArrayWithQualifier(itemPageArray, itemIDQualifier); + + if(matchingItems.count() == 0) { + throw new NoSuchElementException("There was no item that matched the ID '" + itemID + "' in " + list + "."); + } else if(matchingItems.count() > 1) { + throw new IllegalStateException("There was more than one item that matched the ID '" + itemID + "' in " + list + "."); + } + + Object replacingItem = matchingItems.objectAtIndex(0); + + if(mutableList) { + int replacedItemIndex = itemPageRange.location(); + Object replacedItem = reorderedList.objectAtIndex(replacedItemIndex); + if(replacedItem != replacingItem) { + int replacingItemIndex = replacedItemIndex + itemPageArray.indexOfObject(replacingItem); + reorderedList.replaceObjectAtIndex(replacingItem, replacedItemIndex); + reorderedList.replaceObjectAtIndex(replacedItem, replacingItemIndex); + } + } else { + reorderedList.addObject(replacingItem); + } + + if(! mutableList) { + int listCount = list.count(); + for(int i = startIndex + reorderedList.count(); i < listCount; i++) { + reorderedList.addObject(list.objectAtIndex(i)); + } + setValueForBinding(reorderedList, "list"); + } + + if(canGetValueForBinding("action")) { + WOActionResults results = (WOActionResults) valueForBinding("action"); + if(results != null) { + System.out.println("Not quite sure what to do with non-null results yet ..."); + } + } + + } + + return null; + } + + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public NSDictionary createAjaxOptions() { + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("clone", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("constrain", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("handle", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onSort", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onStart", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("opacity", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("revert", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("snap", AjaxOption.NUMBER)); + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); + return options; + } + + public String onComplete() { + StringBuilder onCompleteBuffer = new StringBuilder(); + onCompleteBuffer.append("function(container) {"); + onCompleteBuffer.append("var data = ").append(var()).append(".serialize(false, function(element, index) {\n") + .append("return '").append(_sortOrderKeyName).append("[]' + '=' + element.getProperty('id').replace('").append(_sortOrderKeyName).append("_','');}).join('&');"); + onCompleteBuffer.append("var ajaxRequest = new Request({url: '").append(_actionUrl).append("'}).send( { method: 'get', data: data } );"); + if(canGetValueForBinding("onComplete")) { + String onComplete = (String) valueForBinding("onComplete"); + onCompleteBuffer.append(" var parentOnComplete = ") + .append(onComplete).append(";").append("parentOnUpdate(container);"); + } + onCompleteBuffer.append("}"); + + return onCompleteBuffer.toString(); + } + + + public boolean synchronizesVariablesWithBindings() { + return false; + } + + public void setId(String id) { + this._id = id; + } + + public String getId() { + return _id; + } + + /** + * @return the var + */ + public String var() { + return _var; + } + + /** + * @param var the var to set + */ + public void setVar(String var) { + this._var = var; + } + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxSubmitButton.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxSubmitButton.java new file mode 100644 index 00000000000..8684dcc9456 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxSubmitButton.java @@ -0,0 +1,407 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.appserver._private.WODynamicElementCreationException; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxOption; +import er.ajax.AjaxOptions; +import er.ajax.AjaxSubmitButton; +import er.ajax.AjaxUpdateContainer; +import er.ajax.AjaxUtils; +import er.ajax.IAjaxElement; +import er.extensions.appserver.ajax.ERXAjaxApplication; +import er.extensions.components._private.ERXWOForm; +import er.extensions.foundation.ERXProperties; +import er.extensions.foundation.ERXStringUtilities; + +/** + * AjaxSubmitButton behaves just like a WOSubmitButton except that it submits in the background with an Ajax.Request. + * + * @binding name the HTML name of this submit button (optional) + * @binding value the HTML value of this submit button (optional) + * @binding action the action to execute when this button is pressed + * @binding id the HTML ID of this submit button + * @binding class the HTML class of this submit button + * @binding style the HTML style of this submit button + * @binding title the HTML title of this submit button + * @binding onClick arbitrary Javascript to execute when the client clicks the button + * @binding onClickBefore if the given function returns true, the onClick is executed. This is to support confirm(..) dialogs. + * @binding onClickServer if the action defined in the action binding returns null, the value of this binding will be returned as javascript from the server + * @binding async boolean defining if the update request is sent asynchronously or synchronously, defaults to true + * @binding accesskey hot key that should trigger the link (optional) + * @binding onCancel Fired when a request has been cancelled. + * @binding onClickBefore if the given function returns true, the onClick is executed. This is to support confirm(..) dialogs. + * @binding onClick JS function, called after the click on the client + * @binding onComplete Fired when the Request is completed. + * @binding onException Fired when setting a request header fails. + * @binding onFailure Fired when the request failed (error status code). + * @binding onRequest Fired when the Request is sent. + * @binding onSuccess(responseTree, responseElements, responseHTML, responseJavaScript) Fired when the Request is completed successfully. + * @binding evalScripts evaluate scripts on the result + * @binding button if false, it will display a link + * @binding formName if button is false, you must specify the name of the form to submit + * @binding functionName if set, the link becomes a javascript function instead + * @binding updateContainerID the id of the AjaxUpdateContainer to update after performing this action + * @binding showUI if functionName is set, the UI defaults to hidden; showUI re-enables it + * @binding formSerializer the name of the javascript function to call to serialize the form + * @binding elementName the element name to use (defaults to "a") + * @binding async boolean defining if the request is sent asynchronously or synchronously, defaults to true + * @binding accesskey hot key that should trigger the button (optional) + * @binding disabled if true, the button will be disabled (defaults to false) + * @property er.ajax.formSerializer the default form serializer to use for all ajax submits + */ + + +public class MTAjaxSubmitButton extends AjaxDynamicElement { + + // MS: If you change this value, make sure to change it in ERXAjaxApplication + public static final String KEY_AJAX_SUBMIT_BUTTON_NAME = "AJAX_SUBMIT_BUTTON_NAME"; + // MS: If you change this value, make sure to change it in ERXAjaxApplication and in wonder.js + public static final String KEY_PARTIAL_FORM_SENDER_ID = "_partialSenderID"; + + public MTAjaxSubmitButton(String name, NSDictionary associations, WOElement children) { + super(name, associations, children); + } + + public static boolean isAjaxSubmit(WORequest request) { + return request.formValueForKey(KEY_AJAX_SUBMIT_BUTTON_NAME) != null; + } + + public boolean disabledInComponent(WOComponent component) { + return booleanValueForBinding("disabled", false, component); + } + + public String nameInContext(WOContext context, WOComponent component) { + return (String) valueForBinding("name", context.elementID(), component); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public NSMutableDictionary createAjaxOptions(WOComponent component) { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("onCancel", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onException", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onRequest", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onSuccess", AjaxOption.FUNCTION_2)); + ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("async", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY)); + + String name = nameInContext(component.context(), component); + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations()); + MTAjaxSubmitButton.fillInAjaxOptions(this, component, name, options); + return options; + + } + + public void addRequiredWebResources(WOResponse response, WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + Boolean useSpinner = (Boolean)valueForBinding("useSpinner", Boolean.FALSE, context.component()); + if(useSpinner) { + Boolean useDefaultSpinnerClass = (Boolean)valueForBinding("defaultSpinnerClass", Boolean.TRUE, context.component()); + if(useDefaultSpinnerClass) { + MTAjaxUtils.addStylesheetResourceInHead(context, context.response(), "MooTools", "scripts/plugins/spinner/spinner.css"); + } + } + + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + + @SuppressWarnings("rawtypes") + public void appendToResponse(WOResponse response, WOContext context) { + + WOComponent component = context.component(); + String functionName = (String)valueForBinding("functionName", null, component); + String formName = (String)valueForBinding("formName", component); + + boolean showUI = (functionName == null || booleanValueForBinding("showUI", false, component)); + boolean showButton = showUI && booleanValueForBinding("button", true, component); + String formReference; + + if((!showButton || functionName != null) && formName == null) { + formName = ERXWOForm.formName(context, null); + if(formName == null) { + throw new WODynamicElementCreationException("If button = false or functionName is not null, the containing form must have an explicit name."); + } + } + + if(formName == null) { + formReference = "this.form"; + } else { + formReference = "document." + formName; + } + + StringBuffer onClickBuffer = new StringBuffer(); + + // JavaScript function to be fired before submit is sent i.e. confirm(); + String onClickBefore = (String)valueForBinding("onClickBefore", component); + if(onClickBefore != null) { + onClickBuffer.append("if(") + .append(onClickBefore) + .append(") {"); + } + + String updateContainerID = (String)valueForBinding("updateContainerID", component); + + // Needs to be refactored. Same function as MoAjaxUpdateLink + // Maybe create a helper class with a static function that takes the component as an argument? + // Could add it to MoAjaxUpdateLink like addEffect. + String beforeEffect = (String)valueForBinding("beforeEffect", component); + if(beforeEffect != null) { + + String beforeEffectID = (String)valueForBinding("beforeEffectID", component); + String beforeEffectDuration = (String) valueForBinding("beforeEffectDuration", component); + String beforeEffectProperty = (String) valueForBinding("beforeEffectProperty", component); + String beforeEffectStart = (String) valueForBinding("beforeEffectStart", component); + + if(beforeEffectID == null) { + beforeEffectID = AjaxUpdateContainer.currentUpdateContainerID(); + if (beforeEffectID == null) { + beforeEffectID = updateContainerID; + } + } + + if(beforeEffect.equals("tween")) { + if(beforeEffectDuration != null) { + onClickBuffer.append("$('").append(beforeEffectID) + .append("').set('tween', { duration: '") + .append(beforeEffectDuration).append("', property: '" + beforeEffectProperty + "' });"); + } else { + onClickBuffer.append("$('").append(beforeEffectID).append("').set('tween', { property: '" + beforeEffectProperty + "' });"); + } + onClickBuffer.append("$('").append(beforeEffectID).append("').get('tween').start(") + .append(beforeEffectStart).append(").chain(function() {"); + } else if(beforeEffect.equals("morph")) { + if(beforeEffectDuration != null) { + onClickBuffer.append("$('").append(beforeEffectID).append("').set('morph', { duration: '").append(beforeEffectDuration).append("' });"); + } + onClickBuffer.append("$('").append(beforeEffectID).append("').get('morph').start('." + beforeEffectStart + "'").append(").chain(function() {"); + } else if(beforeEffect.equals("slide")) { + String mode = (String) valueForBinding("effectSlideMode", component); + String transition = (String) valueForBinding("beforeEffectTransition", component); + onClickBuffer.append("$('").append(beforeEffectID).append("').set('slide'"); + if(beforeEffectDuration != null || mode != null) { + onClickBuffer.append(", { "); + if(beforeEffectDuration != null) { + onClickBuffer.append("duration: '").append(beforeEffectDuration).append("'").append(mode != null || transition != null ? "," : ""); + } + if(mode != null) { + onClickBuffer.append("mode: '").append(mode).append("'").append(transition != null ? "," : ""); + } + if(transition != null) { + onClickBuffer.append("transition: ").append(transition); + } + onClickBuffer.append("}"); + } + onClickBuffer.append("); $('").append(beforeEffectID).append("').get('slide').slide").append(ERXStringUtilities.capitalize(beforeEffectProperty)).append("().chain(function() {"); + } else if(beforeEffect.equals("highlight")) { + if(beforeEffectDuration != null) { + onClickBuffer.append("$('").append(beforeEffectID) + .append("').set('tween', { duration: '").append(beforeEffectDuration).append("', property: 'background-color'});"); + } else { + onClickBuffer.append("$('").append(beforeEffectID) + .append("').set('tween', { property: 'background-color' });"); + } + onClickBuffer.append("$('").append(updateContainerID).append("').get('tween').start('").append(beforeEffectProperty != null ? beforeEffectProperty : "#ffff88', '#ffffff") + .append("').chain(function() { "); + } + } + + if(updateContainerID != null) { + onClickBuffer.append("MTASB.update('").append(updateContainerID).append("', "); + } else { + onClickBuffer.append("MTASB.request("); + } + onClickBuffer.append(formReference); + if(valueForBinding("functionName", component) != null) { + onClickBuffer.append(", additionalParams"); + } else { + onClickBuffer.append(", null"); + } + + onClickBuffer.append(","); + NSMutableDictionary options = createAjaxOptions(component); + + String effect = (String) valueForBinding("effect", component); + String afterEffect = (String) valueForBinding("afterEffect", component); + + if(effect != null) { + String duration = (String) valueForBinding("effectDuration", component); + String property = (String) valueForBinding("effectProperty", component); + String start = (String) valueForBinding("effectStart", component); + String mode = (String) valueForBinding("effectSlideMode", component); + MTAjaxUpdateLink.addEffect(options, effect, updateContainerID, property, start, duration, mode); + } else if(afterEffect != null) { + String duration = (String) valueForBinding("afterEffectDuration", component); + String property = (String) valueForBinding("afterEffectProperty", component); + String start = (String) valueForBinding("afterEffectStart", component); + String afterEffectID = (String) valueForBinding("afterEffectID", component); + String mode = (String) valueForBinding("effectSlideMode", component); + if(afterEffectID == null) { + afterEffectID = AjaxUpdateContainer.currentUpdateContainerID() != null ? AjaxUpdateContainer.currentUpdateContainerID() : + updateContainerID; + } + MTAjaxUpdateLink.addEffect(options, afterEffect, afterEffectID, property, start, duration, mode); + } + + AjaxOptions.appendToBuffer(options, onClickBuffer, context); + onClickBuffer.append(")"); + String onClick = (String)valueForBinding("onClick", component); + if(onClick != null) { + onClickBuffer.append("; ").append(onClick); + } + + if(beforeEffect != null) { + onClickBuffer.append("}.bind(this));"); + } + + if(onClickBefore != null) { + onClickBuffer.append("}"); + } + + if(functionName != null) { + AjaxUtils.appendScriptHeader(response); + response.appendContentString(functionName + " = function(additionalParams) { " + onClickBuffer + " }\n"); + AjaxUtils.appendScriptFooter(response); + } + + if(showUI) { + + boolean disabled = disabledInComponent(component); + String elementName = (String)valueForBinding("elementName", "a", component); + + if(showButton) { + response.appendContentString(""); + } else { + response.appendContentString(">"); + if(hasChildrenElements()) { + appendChildrenToResponse(response, context); + } + response.appendContentString(""); + } + + } + + super.appendToResponse(response, context); + + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public static void fillInAjaxOptions(IAjaxElement element, WOComponent component, String submitButtonName, NSMutableDictionary options) { + + String systemDefaultFormSerializer = "Form.serializeWithoutSubmits"; + String defaultFormSerializer = ERXProperties.stringForKeyWithDefault("er.ajax.formSerializer", systemDefaultFormSerializer); + String formSerializer = (String) element.valueForBinding("formSerializer", defaultFormSerializer, component); + if(!defaultFormSerializer.equals(systemDefaultFormSerializer)) { + options.setObjectForKey(formSerializer, "_fs"); + } + + options.setObjectForKey("'" + submitButtonName + "'", "_asbn"); + + if("true".equals(options.objectForKey("async"))) { + options.removeObjectForKey("async"); + } + + if("true".equals(options.objectForKey("evalScripts"))) { + options.removeObjectForKey("evalScripts"); + } + + MTAjaxUpdateContainer.expandInsertionFromOptions(options, element, component); + + } + + public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) { + + WOActionResults result = null; + WOComponent wocomponent = wocontext.component(); + + String nameInContext = nameInContext(wocontext, wocomponent); + boolean shouldHandleRequest = (!disabledInComponent(wocomponent) && wocontext._wasFormSubmitted()) && ((wocontext._isMultipleSubmitForm() && nameInContext.equals(worequest.formValueForKey(KEY_AJAX_SUBMIT_BUTTON_NAME))) || !wocontext._isMultipleSubmitForm()); + + if (shouldHandleRequest) { + String updateContainerID = MTAjaxUpdateContainer.updateContainerID(this, wocomponent); + MTAjaxUpdateContainer.setUpdateContainerID(worequest, updateContainerID); + wocontext._setActionInvoked(true); + result = handleRequest(worequest, wocontext); + AjaxUtils.updateMutableUserInfoWithAjaxInfo(wocontext); + } + + return result; + } + + public WOActionResults handleRequest(WORequest request, WOContext context) { + + WOComponent component = context.component(); + WOActionResults result = (WOActionResults) valueForBinding("action", component); + + if (ERXAjaxApplication.isAjaxReplacement(request)) { + AjaxUtils.setPageReplacementCacheKey(context, (String)valueForBinding("replaceID", component)); + } + else if (result == null || booleanValueForBinding("ignoreActionResponse", false, component)) { + WOResponse response = AjaxUtils.createResponse(request, context); + String onClickServer = (String) valueForBinding("onClickServer", component); + if (onClickServer != null) { + AjaxUtils.appendScriptHeaderIfNecessary(request, response); + response.appendContentString(onClickServer); + AjaxUtils.appendScriptFooterIfNecessary(request, response); + } + result = response; + } + else { + String updateContainerID = MTAjaxUpdateContainer.updateContainerID(this, component); + if (updateContainerID != null) { + AjaxUtils.setPageReplacementCacheKey(context, updateContainerID); + } + } + + return result; + } + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTabbedPanel.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTabbedPanel.java new file mode 100644 index 00000000000..c4139346f40 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTabbedPanel.java @@ -0,0 +1,238 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOAssociation; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.appserver._private.WOConstantValueAssociation; +import com.webobjects.appserver._private.WODynamicGroup; +import com.webobjects.foundation.NSArray; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXWOContext; + +/** + * This implements the tabs and the main control of a tabbed panel display as an + * unordered list (UL and LI elements). The tab contents go in AjaxTabbedPanel + * components contained within this component. The tab contents are loaded on + * demand so only the selected tab is rendered when the page is displayed. If + * tabs can take a while to load, a hidden div containing a "working" message + * can temporarily replace the panel content while it loads. + * + *

    CSS Classes Used by AjaxTabbedPanel and AjaxTabbedPanelTab

    + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    Class NameUsed For
    ajaxTabbedPanelThe UL containing the tabs.
    ajaxTabbedPanelTab-selectedThe LI representing the selected tab and the A element that is the clickable title.
    ajaxTabbedPanelTab-unselectedThe LI representing the selected tab(s) and the A element that is the clickable title.
    ajaxTabbedPanelPanesThe UL containing the panels (panes).
    ajaxTabbedPanelPane-selectedThe LI representing the selected panel.
    ajaxTabbedPanelPane-unselectedThe LI representing the unselected panel(s).
    not get called when this is first rendered. Use onLoad if you need that. + * @binding class css classes to add to the ul. + * @author Chuck Hill + */ + +public class MTAjaxTabbedPanel extends AjaxDynamicElement { + + private WOElement content; + private NSMutableArray tabs = new NSMutableArray(); + private WOAssociation id; + private WOAssociation busyDiv; + private WOAssociation onLoad; + private WOAssociation onSelect; + + public MTAjaxTabbedPanel(String name, NSDictionary associations, WOElement template) { + super(name, associations, template); + content = template; + id = (WOAssociation) associations.objectForKey("id"); + busyDiv = (WOAssociation) associations.objectForKey("busyDiv"); + onLoad = (WOAssociation) associations.objectForKey("onLoad"); + onSelect = (WOAssociation) associations.objectForKey("onSelect"); + findTabs((WODynamicGroup)template); + + if (id == null) + { + throw new RuntimeException("id binding is required"); + } + } + + /** + * Looks through the child components to locate the AjaxTabbedPanelTabs that are controlled by this panel. + * Tabs without an explicit id attributed are assigned a calculated one. + * + * @param template the graph of elements passed to the constructor. + */ + private void findTabs(WODynamicGroup template) { + if (template == null || template.childrenElements() == null) return; + + NSArray children = template.childrenElements(); + for (int i = 0; i < children.count(); i++) { + WOElement child = (WOElement)children.objectAtIndex(i); + if (child instanceof MTAjaxTabbedPanelTab) { + MTAjaxTabbedPanelTab childTab = (MTAjaxTabbedPanelTab)child; + + // The tabs need to have an id attribute so we assign one if needed + if (childTab.id() == null) { + childTab.setId(new WOConstantValueAssociation(id.valueInComponent(null) + "_pane_" + tabs.count())); + } + + tabs.addObject(childTab); + } + else if (child instanceof WODynamicGroup) { + findTabs((WODynamicGroup)child); + } + } + } + + public void appendToResponse(WOResponse response, WOContext context) { + + WOComponent component = context.component(); + String idString = (String) id.valueInComponent(component); + if (idString == null) { + throw new RuntimeException("id binding evaluated to null"); + } + + // UL for tabs + response.appendContentString("\n"); + + String paneControlID = idString + "_panecontrol"; + String selectedTabClassName = stringValueForBinding("selectedPanelClassName", component); + if(selectedTabClassName == null) { + selectedTabClassName = "active"; + } + for(MTAjaxTabbedPanelTab tab : tabs) { + + if (tab.isVisble(component)) { + boolean isSelectedTab = tab.isSelected(context.component()); + String panelTabID = (String) tab.id().valueInComponent(component); + String panelID = panelTabID + "_panel"; + response.appendContentString(" \n"); + response.appendContentString(""); + response.appendContentString((String) tab.name().valueInComponent(component)); + response.appendContentString("\n"); + response.appendContentString("\n"); + } + } + + response.appendContentString("
\n"); + + // UL for panes + response.appendContentString("
    \n"); + // The tabs render themselves as panes + if (content != null) { + content.appendToResponse(response, context); + } + response.appendContentString("
\n"); + super.appendToResponse(response, context); + + AjaxUtils.appendScriptHeader(response); + response.appendContentString("window.addEvent('domready', function() {"); + response.appendContentString("\n\tvar "); + response.appendContentString(safeID(context)); + response.appendContentString(" = new MTAjaxTabbedPanel({"); + response.appendContentString("tabbedPanelTabsContainer : "); + response.appendContentString("'"); + response.appendContentString(idString); + response.appendContentString("', "); + response.appendContentString("tabbedPanelPanesContainer : "); + response.appendContentString("'"); + response.appendContentString(paneControlID); + response.appendContentString("'"); + if(! selectedTabClassName.equals("active")) { + response.appendContentString(", "); + response.appendContentString("selectedTabClassName : "); + response.appendContentString("'"); + response.appendContentString(selectedTabClassName); + response.appendContentString("'"); + } + + response.appendContentString("});"); + response.appendContentString("\n});"); + AjaxUtils.appendScriptFooter(response); + + } + + public String safeID(WOContext context) { + return "mtTabbedPanel" + ERXWOContext.safeIdentifierName(context, true); + } + + protected void addRequiredWebResources(WOResponse response, WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", "scripts/plugins/tabs/MTAjaxTabbedPanel.js"); + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + // TODO Auto-generated method stub + return null; + } + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTabbedPanelTab.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTabbedPanelTab.java new file mode 100644 index 00000000000..ace0f5a11ca --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTabbedPanelTab.java @@ -0,0 +1,204 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOAssociation; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxUtils; + +public class MTAjaxTabbedPanelTab extends AjaxDynamicElement { + + private WOElement content; + private WOAssociation name; + private WOAssociation id; + private WOAssociation isSelected; + private WOAssociation refreshOnSelect; + private WOAssociation onLoad; + private WOAssociation isVisible; + private WOAssociation accesskey; + + public MTAjaxTabbedPanelTab(String aName, NSDictionary associations, WOElement template) { + super(aName, associations, template); + + content = template; + name = (WOAssociation) associations.objectForKey("name"); + id = (WOAssociation) associations.objectForKey("id"); + isSelected = (WOAssociation) associations.objectForKey("isSelected"); + refreshOnSelect = (WOAssociation) associations.objectForKey("refreshOnSelect"); + onLoad = (WOAssociation) associations.objectForKey("onLoad"); + isVisible = (WOAssociation) associations.objectForKey("isVisible"); + accesskey = (WOAssociation)associations.objectForKey("accesskey"); + + if (name == null) { + throw new RuntimeException("name binding is required"); + } + + } + + /** + * Creates the panes. + */ + public void appendToResponse(WOResponse response, WOContext aContext) + { + WOComponent component = aContext.component(); + + if (isVisble(component)) { + response.appendContentString("
  • "); + + // The selected pane needs to have its content rendered when the page is first rendered. After that + // it is controlled by the user clicking tabs + if (isSelected(component) && content != null) { + content.appendToResponse(response, aContext); + } + + response.appendContentString("
  • \n"); + + } + + } + + + /** + * Do nothing if not visible. + */ + public void takeValuesFromRequest(WORequest request, WOContext context) + { + if (isVisble(context.component()) && (isSelected == null || isSelected(context.component())) ) { + super.takeChildrenValuesFromRequest(request, context); + } + } + + /** + * Do nothing if not visible. + */ + public WOActionResults invokeAction(WORequest request, WOContext context) + { + if (isVisble(context.component())) { + return super.invokeAction(request, context); + } + return null; + } + + /** + * + * @param component the component this is being rendered in + * @return true if this pane is the selected one + */ + public boolean isSelected(WOComponent component) { + return (isSelected != null) ? isSelected.booleanValueInComponent(component) : false; + } + + /** + * If present and settable, sets the isSelected association to true for this tab when it selected and + * to false when it is no longer the selected tab. + * + * @param component the component this is being rendered in + * @param isTabSelected true is this is being rendered as the selected tab + */ + public void setIsSelected(WOComponent component, boolean isTabSelected) { + if (isSelected != null && isSelected.isValueSettableInComponent(component)) { + isSelected.setValue(new Boolean(isTabSelected), component); + } + } + + protected void addRequiredWebResources(WOResponse response, WOContext context) { + } + + /** + * The pane content is rendered when an Ajax request is received. + * @return the children rendered as HTML + */ + public WOActionResults handleRequest(WORequest request, WOContext context) { + WOResponse response = null; + String didSelect = request.stringFormValueForKey("didSelect"); + + // This is not set when the tab is initially loaded, that is our cue to generate our content + if ( didSelect == null) { + response = AjaxUtils.createResponse(request, context); + AjaxUtils.setPageReplacementCacheKey(context, _containerID(context)); + + if (content != null) { + content.appendToResponse(response, context); + } + } + else setIsSelected(context.component(), didSelect.equals("true")); + + return response; + } + + /** + * @param context WOContext response is being returned in + * @return ID to cache this Ajax response under + */ + protected String _containerID(WOContext context) { + return (String)id().valueInComponent(context.component()) + "_panel"; + } + + + /** + * @return association for HTML id attribute + */ + public WOAssociation id() { + return id; + } + + /** + * Sets the id association so that the AjaxTabbedPanel can provide an id if needed. + * + * @param newID the association to use to get the HTML id attribute + */ + public void setId(WOAssociation newID) { + id = newID; + } + + /** + * @return association for HTML id attribute. + */ + public WOAssociation name() { + return name; + } + + /** + * Returns current component's value for the refreshOnSelect binding. + * + * @param component the component this is being rendered in + * @return Boolean value for refreshOnSelect binding, Boolean.FALSE if unset + */ + public Boolean refreshesOnSelect(WOComponent component) { + return (refreshOnSelect != null) ? (Boolean)refreshOnSelect.valueInComponent(component): Boolean.FALSE; + } + + /** + * Returns current component's value for the isVisible binding. + * + * @param component the component this is being rendered in + * @return Boolean value for isVisible binding, Boolean.TRUE if unset + */ + public boolean isVisble(WOComponent component) { + return (isVisible != null) ? ((Boolean)isVisible.valueInComponent(component)).booleanValue() : true; + } + + /** + * @return WOAssociation for the accesskey binding + */ + public WOAssociation accesskey() { + return accesskey; + } +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTree.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTree.java new file mode 100644 index 00000000000..37b3ddaccf3 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxTree.java @@ -0,0 +1,10 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOContext; +import er.ajax.AjaxTree; + +public class MTAjaxTree extends AjaxTree { + public MTAjaxTree(WOContext context) { + super(context); + } +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUpdateContainer.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUpdateContainer.java new file mode 100644 index 00000000000..cafeeec17a7 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUpdateContainer.java @@ -0,0 +1,232 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxObserveField; +import er.ajax.AjaxOption; +import er.ajax.AjaxOptions; +import er.ajax.AjaxUpdateContainer; +import er.ajax.AjaxUtils; +import er.extensions.foundation.ERXValueUtilities; + + +/** + * observeFieldID requires ERExtensions, specifically ERXWOForm + * @binding elementName the container's element defaults to DIV. + * @binding action the action to call when this updateContainer refreshes + * @binding method - (string: defaults to 'post') The HTTP method for the request, can be either 'post' or 'get'. + * @binding encoding - (string: defaults to 'utf-8') The encoding to be set in the request header. + * @binding emulation - (boolean: defaults to true) If set to true, other methods than 'post' or 'get' are appended as post-data named '_method' (as used in rails) + * @binding headers - (object) An object to use in order to set the request headers. + * @binding isSuccess - (function) Overrides the built-in isSuccess function. + * @binding evalScripts - (boolean: defaults to true) If set to true, script tags inside the response will be evaluated. + * @binding evalResponse - (boolean: defaults to false) If set to true, the entire response will be evaluated. Responses with javascript content-type will be evaluated automatically. + * @binding urlEncoded - (boolean: defaults to true) If set to true, the content-type header is set to www-form-urlencoded + encoding + * @binding noCache - (boolean; defaults to false) If true, appends a unique noCache value to the request to prevent caching. (IE has a bad habit of caching ajax request values. Including this script and setting the noCache value to true will prevent it from caching. The server should ignore the noCache value.) + * @binding async - (boolean: defaults to true) If set to false, the requests will be synchronous and freeze the browser during request. + * @binding optional set to true if you want the container tags to be skipped if this is already in an update container (similar to ERXOptionalForm). + * If optional is true and there is a container, it's as if this AUC doesn't exist, and only its children will render to the page. + * @binding onCancel Fired when a request has been cancelled. + * @binding onComplete Fired when the Request is completed. + * @binding onException Fired when setting a request header fails. + * @binding onFailure Fired when the request failed (error status code). + * @binding onRequest Fired when the Request is sent. + * @binding onSuccess(responseTree, responseElements, responseHTML, responseJavaScript) Fired when the Request is completed successfully. + * @binding frequency the frequency (in seconds) of a periodic update + * @binding initialDelay - (number; defaults to 5000) The initial delay to wait for the request after a call to the start method + * @binding delay - (number; defaults to 5000) The delay between requests and the number of ms to add if no valid data has been returned + * @binding limit - (number; defaults to 60000) The maximum time the interval uses to request the server + * responseTree - (element) The node list of the remote response. + * responseElements - (array) An array containing all elements of the remote response. + * responseHTML - (string) The content of the remote response. + * responseJavaScript - (string) The portion of JavaScript from the remote response. + * @binding onFailure Fired when the request failed (error status code). + * @binding useSpinner (boolean) use the Spinner class with this request + * @binding defaultSpinnerClass inclue the default spinner css class in the headers - if false provide your own. + * @binding spinnerOptions - (object) the options object for the Spinner class + * @binding spinnerTarget - (mixed) a string of the id for an Element or an Element reference to use instead of the one specifed in the update option. This is useful if you want to overlay a different area (or, say, the parent of the one being updated). + */ + + +public class MTAjaxUpdateContainer extends AjaxUpdateContainer { + + public MTAjaxUpdateContainer(String name, NSDictionary associations, WOElement children) { + super(name, associations, children); + } + + public static String updateContainerID(AjaxDynamicElement element, WOComponent component) { + return AjaxUpdateContainer.updateContainerID(element, component); + } + + @Override + protected void addRequiredWebResources(WOResponse response, WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + Boolean useSpinner = (Boolean)valueForBinding("useSpinner", Boolean.FALSE, context.component()); + if(useSpinner) { + Boolean useDefaultSpinnerClass = (Boolean)valueForBinding("defaultSpinnerClass", Boolean.TRUE, context.component()); + if(useDefaultSpinnerClass) { + MTAjaxUtils.addStylesheetResourceInHead(context, context.response(), "MTAjax", "scripts/plugins/spinner/spinner.css"); + } + } + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public NSDictionary createAjaxOptions(WOComponent component) { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("method", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("frequency", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("initialDelay", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("delay", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("limit", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("encoding", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("emulation", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("headers", AjaxOption.ARRAY)); + ajaxOptionsArray.addObject(new AjaxOption("isSuccess", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("evalResponse", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("urlEncoded", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("async", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("noCache", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("onRequest", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onCancel", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onSuccess", AjaxOption.FUNCTION_2)); + ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.FUNCTION_1)); + ajaxOptionsArray.addObject(new AjaxOption("onException", AjaxOption.FUNCTION_2)); + ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY)); + + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations()); + options.setObjectForKey("'get'", "method"); + if (options.objectForKey("evalScripts") == null) { + options.setObjectForKey("true", "evalScripts"); + } + + AjaxUpdateContainer.expandInsertionFromOptions(options, this, component); + + return options; + + } + + public static NSDictionary removeDefaultOptions(NSDictionary options) { + // PROTOTYPE OPTIONS + NSMutableDictionary mutableOptions = options.mutableClone(); + if ("'get'".equals(mutableOptions.objectForKey("method"))) { + mutableOptions.removeObjectForKey("method"); + } + if ("true".equals(mutableOptions.objectForKey("evalScripts"))) { + mutableOptions.removeObjectForKey("evalScripts"); + } + if ("true".equals(mutableOptions.objectForKey("async"))) { + mutableOptions.removeObjectForKey("async"); + } + return mutableOptions; + } + + + public void appendToResponse(WOResponse response, WOContext context) { + + WOComponent component = context.component(); + + if(!shouldRenderContainer(component)) { + if(hasChildrenElements()) { + appendChildrenToResponse(response, context); + } + super.appendToResponse(response, context); + } + + else { + + String previousUpdateContainerID = MTAjaxUpdateContainer.currentUpdateContainerID(); + try { + + String elementName = (String) valueForBinding("elementName", "div", component); + String id = _containerID(context); + MTAjaxUpdateContainer.setCurrentUpdateContainerID(_containerID(context)); + response.appendContentString("<" + elementName + " "); + appendTagAttributeToResponse(response, "id", id); + appendTagAttributeToResponse(response, "class", valueForBinding("class", component)); + appendTagAttributeToResponse(response, "style", valueForBinding("style", component)); + appendTagAttributeToResponse(response, "updateUrl", MTAjaxUtils.ajaxComponentActionUrl(context)); + response.appendContentString(">"); + + if(hasChildrenElements()) { + appendChildrenToResponse(response, context); + } + + response.appendContentString(""); + + addRequiredWebResources(response, context); +// super.appendToResponse(response, context); + + NSDictionary options = createAjaxOptions(component); + + Object frequency = valueForBinding("frequency", component); + String observeFieldID = (String) valueForBinding("observeFieldID", component); + + boolean skipFunction = frequency == null && observeFieldID == null && booleanValueForBinding("skipFunction", false, component); + + if(!skipFunction) { + MTAjaxUtils.appendScriptHeader(response); + if(frequency != null) { + boolean isNotZero = true; + try { + float numberFrequency = ERXValueUtilities.floatValue(frequency); + if(numberFrequency == 0.0) { + isNotZero = false; + } + } catch (RuntimeException e) { + throw new IllegalStateException("Error parsing float from value : <" + frequency + ">"); + } + if(isNotZero) { + boolean canStop = false; + boolean stopped = false; + if(associations().objectForKey("stopped") != null) { + canStop = true; + stopped = booleanValueForBinding("stopped", false, component); + } + response.appendContentString("MTAUC.registerPeriodic('" + id + "'," + canStop + "," + stopped + ","); + AjaxOptions.appendToResponse(options, response, context); + response.appendContentString(");"); + } + } + + if(observeFieldID != null) { + boolean fullSubmit = booleanValueForBinding("fullSubmit", false, component); + AjaxObserveField.appendToResponse(response, context, this, observeFieldID, false, id, fullSubmit, createObserveFieldOptions(component)); + } + + response.appendContentString("MTAUC.register('" + id + "'"); + NSDictionary nonDefaultOptions = AjaxUpdateContainer.removeDefaultOptions(options); + if (nonDefaultOptions.count() > 0) { + response.appendContentString(", "); + AjaxOptions.appendToResponse(nonDefaultOptions, response, context); + } + response.appendContentString(");"); + + AjaxUtils.appendScriptFooter(response); + + } + + + } finally { + MTAjaxUpdateContainer.setCurrentUpdateContainerID(previousUpdateContainerID); + } + + } + + } + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUpdateLink.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUpdateLink.java new file mode 100644 index 00000000000..caa6e7701aa --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUpdateLink.java @@ -0,0 +1,318 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOAssociation; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WOResponse; +import com.webobjects.appserver._private.WODynamicElementCreationException; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxOption; +import er.ajax.AjaxOptions; +import er.ajax.AjaxUpdateContainer; +import er.ajax.AjaxUpdateLink; +import er.ajax.AjaxUtils; +import er.extensions.components.ERXComponentUtilities; +import er.extensions.foundation.ERXStringUtilities; + +/** + * Updates a region on the screen by creating a request to an action, then returning a script that in turn creates an + * Ajax.Updater for the area. If you do not provide an action binding, it will just update the specified area. + * @binding action the action to call when the link executes + * @binding directActionName the direct action to call when link executes + * @binding updateContainerID the id of the AjaxUpdateContainer to update after performing this action + * @binding title title of the link + * @binding style css style of the link + * @binding class css class of the link + * @binding id of the link + * @binding disabled boolean defining if the link renders the tag + * @binding string string to get preprended to the contained elements + * @binding function a custom function to call that takes a single parameter that is the action url + * @binding elementName the element name to use (defaults to "a") + * @binding functionName if set, the link becomes a javascript function + * @binding button if true, this is rendered as a javascript button + * @binding async boolean defining if the update request is sent asynchronously or synchronously, defaults to true + * @binding accesskey hot key that should trigger the link (optional) + * @binding onCancel Fired when a request has been cancelled. + * @binding onClickBefore if the given function returns true, the onClick is executed. This is to support confirm(..) dialogs. + * @binding onClick JS function, called after the click on the client + * @binding onComplete Fired when the Request is completed. + * @binding onException Fired when setting a request header fails. + * @binding onFailure Fired when the request failed (error status code). + * @binding onRequest Fired when the Request is sent. + * @binding onSuccess(responseTree, responseElements, responseHTML, responseJavaScript) Fired when the Request is completed successfully. + * @binding useSpinner (boolean) use the Spinner class with this request + * @binding defaultSpinnerClass inclue the default spinner css class in the headers - if false provide your own. + * @binding spinnerOptions - (object) the options object for the Spinner class + * @binding spinnerTarget - (mixed) a string of the id for an Element or an Element reference to use instead of the one specifed in the update option. This is useful if you want to overlay a different area (or, say, the parent of the one being updated). + +**/ + +public class MTAjaxUpdateLink extends AjaxUpdateLink { + + + public MTAjaxUpdateLink(String name, NSDictionary associations, WOElement children) { + super(name, associations, children); + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + protected NSMutableDictionary createAjaxOptions(WOComponent component) { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("async", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("onRequest", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onSuccess", AjaxOption.FUNCTION_2)); + ajaxOptionsArray.addObject(new AjaxOption("onFailure", AjaxOption.FUNCTION)); + ajaxOptionsArray.addObject(new AjaxOption("onException", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("evalScripts", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("useSpinner", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerTarget", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("spinnerOptions", AjaxOption.DICTIONARY)); + + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations()); + + options.setObjectForKey("'get'", "method"); + if (options.objectForKey("async") == null) { + options.setObjectForKey("true", "async"); + } + if (options.objectForKey("evalScripts") == null) { + options.setObjectForKey("true", "evalScripts"); + } + + AjaxUpdateContainer.expandInsertionFromOptions(options, this, component); + return options; + + } + + public void addRequiredWebResources(WOResponse response, WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + Boolean useSpinner = (Boolean)valueForBinding("useSpinner", Boolean.FALSE, context.component()); + if(useSpinner) { + Boolean useDefaultSpinnerClass = (Boolean)valueForBinding("defaultSpinnerClass", Boolean.TRUE, context.component()); + if(useDefaultSpinnerClass) { + MTAjaxUtils.addStylesheetResourceInHead(context, context.response(), "MooTools", "scripts/plugins/spinner/spinner.css"); + } + } + + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_WONDER_JS); + } + + public String onClick(WOContext context, boolean generateFunctionWrapper) { + + WOComponent component = context.component(); + NSMutableDictionary options = createAjaxOptions(component); + + StringBuffer onClickBuffer = new StringBuffer(); + + String onClick = (String) valueForBinding("onClick", component); + String onClickBefore = (String) valueForBinding("onClickBefore", component); + String updateContainerID = (String) valueForBinding("updateContainerID", component); + String functionName = (String) valueForBinding("functionName", component); + String function = (String) valueForBinding("function", component); + String replaceID = (String) valueForBinding("replaceID", component); + String effect = (String) valueForBinding("effect", component); + String afterEffect = (String) valueForBinding("afterEffect", component); + String beforeEffect = (String) valueForBinding("beforeEffect", component); + + if(effect != null) { + String duration = (String) valueForBinding("effectDuration", component); + String property = (String) valueForBinding("effectProperty", component); + String start = (String) valueForBinding("effectStart", component); + String mode = (String) valueForBinding("effectSlideMode", component); + MTAjaxUpdateLink.addEffect(options, effect, updateContainerID, property, start, duration, mode); + } else if(afterEffect != null) { + String duration = (String) valueForBinding("afterEffectDuration", component); + String property = (String) valueForBinding("afterEffectProperty", component); + String start = (String) valueForBinding("afterEffectStart", component); + String afterEffectID = (String) valueForBinding("afterEffectID", component); + String mode = (String) valueForBinding("effectSlideMode", component); + if(afterEffectID == null) { + afterEffectID = AjaxUpdateContainer.currentUpdateContainerID() != null ? AjaxUpdateContainer.currentUpdateContainerID() : + updateContainerID; + } + MTAjaxUpdateLink.addEffect(options, afterEffect, afterEffectID, property, start, duration, mode); + } + + WOAssociation directActionNameAssociation = (WOAssociation) associations().valueForKey("directActionName"); + + if(beforeEffect == null && updateContainerID != null && directActionNameAssociation == null && replaceID == null + && function == null && onClick == null && onClickBefore == null) { + NSDictionary nonDefaultOptions = MTAjaxUpdateContainer.removeDefaultOptions(options); + onClickBuffer.append("MTAUL.") + .append(generateFunctionWrapper ? "updateFunc" : "update") + .append("('").append(updateContainerID).append("', "); + AjaxOptions.appendToBuffer(nonDefaultOptions, onClickBuffer, context); + onClickBuffer.append(", '").append(context.contextID()).append('.').append(context.elementID()) + .append("'").append(")").append(";"); + + } else { + + if(generateFunctionWrapper) { + onClickBuffer.append("function(additionalParams) {"); + } + + if(onClickBefore != null) { + onClickBuffer.append("if (") + .append(onClickBefore) + .append(") { "); + } + + // EFFECTS + if(beforeEffect != null) { + String beforeEffectID = (String)valueForBinding("beforeEffectID", component); + String beforeEffectDuration = (String) valueForBinding("beforeEffectDuration", component); + String beforeEffectProperty = (String)valueForBinding("beforeEffectProperty", component); + String beforeEffectStart = (String)valueForBinding("beforeEffectStart", component); + + if(beforeEffectID == null) { + beforeEffectID = AjaxUpdateContainer.currentUpdateContainerID() != null ? + AjaxUpdateContainer.currentUpdateContainerID() : updateContainerID; + } + + if(beforeEffect.equals("tween")) { + if(beforeEffectDuration != null) { + onClickBuffer.append("$('").append(beforeEffectID) + .append("').set('tween', { duration: '") + .append(beforeEffectDuration).append("', property: '" + beforeEffectProperty + "' });"); + } else { + onClickBuffer.append("$('").append(beforeEffectID).append("').set('tween', { property: '" + beforeEffectProperty + "' });"); + } + onClickBuffer.append("$('").append(beforeEffectID).append("').get('tween').start(") + .append(beforeEffectStart).append(").chain(function() {"); + } else if(beforeEffect.equals("morph")) { + if(beforeEffectDuration != null) { + onClickBuffer.append("$('").append(beforeEffectID).append("').set('morph', { duration: '").append(beforeEffectDuration).append("' });"); + } + onClickBuffer.append("$('").append(beforeEffectID).append("').get('morph').start('." + beforeEffectStart + "'").append(").chain(function() {"); + } else if(beforeEffect.equals("slide")) { + String mode = (String) valueForBinding("effectSlideMode", component); + String transition = (String) valueForBinding("beforeEffectTransition", component); + onClickBuffer.append("$('").append(beforeEffectID).append("').set('slide'"); + if(beforeEffectDuration != null || mode != null) { + onClickBuffer.append(", { "); + if(beforeEffectDuration != null) { + onClickBuffer.append("duration: '").append(beforeEffectDuration).append("'").append(mode != null || transition != null ? "," : ""); + } + if(mode != null) { + onClickBuffer.append("mode: '").append(mode).append("'").append(transition != null ? "," : ""); + } + if(transition != null) { + onClickBuffer.append("transition: ").append(transition); + } + onClickBuffer.append("}"); + } + onClickBuffer.append("); $('").append(beforeEffectID).append("').get('slide').slide").append(ERXStringUtilities.capitalize(beforeEffectProperty)).append("().chain(function() {"); + } else if(beforeEffect.equals("highlight")) { + if(beforeEffectDuration != null) { + onClickBuffer.append("$('").append(beforeEffectID) + .append("').set('tween', { duration: '").append(beforeEffectDuration).append("', property: 'background-color'});"); + } else { + onClickBuffer.append("$('").append(beforeEffectID) + .append("').set('tween', { property: 'background-color' });"); + } + onClickBuffer.append("$('").append(updateContainerID).append("').get('tween').start('").append(beforeEffectProperty != null ? beforeEffectProperty : "#ffff88', '#ffffff") + .append("').chain(function() { "); + } + } + + String actionUrl = null; + if(directActionNameAssociation != null) { + actionUrl = context.directActionURLForActionNamed((String) directActionNameAssociation.valueInComponent(component), ERXComponentUtilities.queryParametersInComponent(associations(), component)).replaceAll("&", "&"); + } else { + actionUrl = AjaxUtils.ajaxComponentActionUrl(context); + } + actionUrl = "'" + actionUrl + "'"; + + if(functionName != null) { + actionUrl = actionUrl + ".addQueryParameters(additionalParams);"; + } + + if(function != null) { + onClickBuffer.append("return " + function + "(" + actionUrl + ")"); + } else { + options.setObjectForKey(actionUrl, "url"); + if(replaceID == null) { + if(updateContainerID == null) { + onClickBuffer.append("new Request("); + AjaxOptions.appendToBuffer(options, onClickBuffer, context); + onClickBuffer.append(").send();"); + } else { + options.takeValueForKey("'" + updateContainerID + "'", "update"); + onClickBuffer.append("new Request.HTML("); + AjaxOptions.appendToBuffer(options, onClickBuffer, context); + onClickBuffer.append(").send();"); + } + } else { + options.takeValueForKey("'" + replaceID + "'", "update"); + onClickBuffer.append("new Request.HTML("); + AjaxOptions.appendToBuffer(options, onClickBuffer, context); + onClickBuffer.append(").send();"); + } + } + + if(onClick != null) { + onClickBuffer.append(";") + .append(onClick); + } + + if(beforeEffect != null) { + onClickBuffer.append("});"); + } + + if(onClickBefore != null) { + onClickBuffer.append(" } "); + } + + if(generateFunctionWrapper) { + onClickBuffer.append("}"); + } + } + + return onClickBuffer.toString(); + + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static void addEffect(NSMutableDictionary options, String effect, String updateContainerID, String effectProperty, String effectStart, String duration, String mode) { + + if(effect != null) { + + if(options.objectForKey("onSuccess") != null) { + throw new WODynamicElementCreationException("You cannot specify both an effect and a custom onSuccess function."); + } + if(updateContainerID == null) { + throw new WODynamicElementCreationException("You cannot specify an effect without an updateContainerID."); + } + StringBuffer effectBuffer = new StringBuffer(); + effectBuffer.append("function() { "); + if(effect.equals("tween")) { + if(duration != null) { + effectBuffer.append("$('").append(updateContainerID).append("').set('tween', { duration: '").append(duration).append("', property: '") + .append(effectProperty).append("' });"); + } else { + effectBuffer.append("$('").append(updateContainerID).append("').set('tween', { property: '").append(effectProperty).append("' });"); + } + effectBuffer.append("$('").append(updateContainerID).append("').get('tween').start(" + effectStart + ");"); + } else if(effect.equals("morph")) { + if(duration != null) { + effectBuffer.append("$('").append(updateContainerID).append("').set('morph', { duration: '").append(duration).append("'});"); + } + effectBuffer.append("$('").append(updateContainerID).append("').get('morph').start('." + effectStart + "');"); + } else if(effect.equals("slide")) { + effectBuffer.append("$('").append(updateContainerID).append("').get('slide').slide").append(ERXStringUtilities.capitalize(effectProperty)).append("(); "); + } else if(effect.equals("highlight")) { + effectBuffer.append("$('").append(updateContainerID).append("').highlight(").append(effectProperty != null ? effectProperty : "").append(");"); + } + effectBuffer.append("}"); + options.setObjectForKey(effectBuffer.toString(), "onSuccess"); + } + } + + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUtils.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUtils.java new file mode 100644 index 00000000000..80ab8c59a98 --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTAjaxUtils.java @@ -0,0 +1,32 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOResponse; + +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXResponseRewriter; +import er.extensions.foundation.ERXProperties; + +public class MTAjaxUtils extends AjaxUtils { + + public static final String MOOTOOLS_MORE_JS = "scripts/core/mootools-more-1.4.0.1.js"; + public static final String MOOTOOLS_CORE_JS = "scripts/core/mootools-core-1.4.4.js"; + public static final String MOOTOOLS_WONDER_JS = "scripts/core/MTWonder.js"; + + public static void addScriptResourceInHead(WOContext context, WOResponse response, String framework, String fileName) { + + String processedFileName = fileName; + + if(ERXProperties.booleanForKey("er.mootools.compressed") && MOOTOOLS_CORE_JS.equals(fileName)) { + processedFileName = "scripts/core/mootools-core-1.4.4-yc.js"; + } + + if(ERXProperties.booleanForKey("er.mootools.compressed") && MOOTOOLS_MORE_JS.equals(fileName)) { + processedFileName = "scripts/core/mootools-more-1.4.0.1-yc.js"; + } + + ERXResponseRewriter.addScriptResourceInHead(response, context, framework, processedFileName); + + } + +} diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTJSDatePicker.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTJSDatePicker.java new file mode 100644 index 00000000000..385cb4fd05e --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTJSDatePicker.java @@ -0,0 +1,130 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxComponent; +import er.ajax.AjaxOption; + +/* + * @binding pickerClass - default (datepicker) CSS class for the main datepicker container element. + * @binding toggleElements - default (null) Toggle your datepicker by clicking another element. Specify as a MooTools selector. The resulting elements are mapped to the selected datepickers by index (the 1st toggle works for the 1st input, the 2nd toggle works for the 2nd input, etc.) + * @binding days - default (['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']) - Labels for the days, allows for localization. + * @binding daysShort - default (2) - Length of day-abbreviations used in the datepicker. + * @binding months - default (['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']) Labels for the months, allows for localization. + * @binding monthShort default (3) - Length of month-abbreviations used in the datepicker. + * @binding startDay default (1) - First day of a week. Can be 0 (Sunday) through 6 (Saturday) - be aware that this may affect your layout, since days in the last column will likely have a style with right-margin: 0px;which would need to be applied to a different day. Default value 1 is Monday. + * @binding timePicker default (false) - Enable/disable timepicker functionality. See timepicker example below. Hours/Minutes values can be changed using the scrollwheel. + * @binding timePickerOnly (false) - set to true to use datepicker for time-selection only; recommended formatis H:i; will automatically force timePicker and startView options into timepicker mode + * @binding yearPicker (true) - Enable/disable yearpicker functionality. Makes it much easier to change years. + * @binding yearsPerPage (20) - Amount of years to show in the year-picking view. Be aware that this may affect your layout. + * @binding dateFormat - the dateformat to use. Same as normal. + * @binding animationDuration default (400) - Duration of the slide/fade animations in milliseconds. + * @binding useFadeInOut default (true (false on Internet Explorer)) Whether to fade-in/out the datepicker popup. + * @binding startView default (month) - Initial view of the datepicker. Allowed values are: time(only when timePicker option is true), month,year, decades + * @binding allowEmpty default (false) - When set to true the datepicker intializes empty when no value was set (instead of starting at today). In addition the backspace- and delete-key will remove a value from the input. Check out the Allow empty example below. + * @binding positionOffset default ({ x: 0, y: 0 }) Allows you to tweak the position at which the datepicker appears, relative to the input element. Formatted as an object with x and y properties. Values can be negative. + * @binding debug default (false) - When enabled, will not hide the original input element. Additionally, any formatting errors will be alerted to the user. + * @binding onShow default null - function to fire onShow + * @binding onCancel default null function to fire onCancel + * @binding onSelect default null function to fire onSelect + + */ + +public class MTJSDatePicker extends AjaxComponent { + + public MTJSDatePicker(WOContext context) { + super(context); + } + + public boolean isStateless() { + return true; + } + + @Override + protected void addRequiredWebResources(WOResponse res) { + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context(), res, "MooTools", "scripts/plugins/datepicker/datepicker.js"); + Boolean useDefaultCSS = booleanValueForBinding("useDefaultCSS", true); + if(useDefaultCSS) { + MTAjaxUtils.addStylesheetResourceInHead(context(), res, "MooTools", "scripts/plugins/datepicker/datepicker.css"); + } + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + // TODO Auto-generated method stub + return null; + } + + private static String[][] conversionTable = new String[][] { { "%Y", "Y" }, { "%y", "y" }, { "%B", "F" }, { "%B", "F" }, + { "%B", "M" }, { "%m", "m" }, { "%A", "l" }, { "%A", "l" }, { "%A", "l" }, { "%A", "D" }, { "%d", "d" }, + { "%H", "H" }, { "%M", "i" }, { "%S", "s" }, { "%I", "h" }, { "%p", "a" } }; + + public static String convertDateToPhpFormat(String javaFormat) { + String result = javaFormat; + for(int i = 0; i < conversionTable.length; i++) { + result = result.replaceAll(conversionTable[i][0], conversionTable[i][1]); + } + return result; + } + + public static String convertDateToJavaFormat(String phpFormat) { + String result = phpFormat; + for(int i = 0; i < conversionTable.length; i++) { + result = result.replaceAll(conversionTable[i][1], conversionTable[i][0]); + } + return result; + } + + public String classes() { + String userDefinedClass = valueForStringBinding("class", ""); + userDefinedClass += userDefinedClass.length() > 0 ? " dateinput" : "dateinput"; + return userDefinedClass; + } + + public String format() { + String format = (String) valueForBinding("dateformat", "%Y-%m-%d"); + return "'" + convertDateToPhpFormat(format) + "'"; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public NSDictionary createAjaxOptions() { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("pickerClass", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("toggleElements", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("days", AjaxOption.ARRAY)); + ajaxOptionsArray.addObject(new AjaxOption("dayShort", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("months", AjaxOption.ARRAY)); + ajaxOptionsArray.addObject(new AjaxOption("monthShort", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("startDay", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("timePicker", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("timePickerOnly", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("yearPicker", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("yearsPerPage", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("animationDuration", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("useFadeInOut", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("startView", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("allowEmpty", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("positionOffset", AjaxOption.ARRAY)); + ajaxOptionsArray.addObject(new AjaxOption("minDate", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("maxDate", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("debug", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("onShow", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onClose", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onSelect", AjaxOption.SCRIPT)); + + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, this); + options.takeValueForKey(format(), "format"); + options.takeValueForKey(format(), "inputOutputFormat"); + return options; + + } + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTJSSlider.java b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTJSSlider.java new file mode 100644 index 00000000000..3f3cc92221a --- /dev/null +++ b/Frameworks/Ajax/MooTools/Sources/er/ajax/mootools/MTJSSlider.java @@ -0,0 +1,147 @@ +package er.ajax.mootools; + +import com.webobjects.appserver.WOActionResults; +import com.webobjects.appserver.WOComponent; +import com.webobjects.appserver.WOContext; +import com.webobjects.appserver.WOElement; +import com.webobjects.appserver.WORequest; +import com.webobjects.appserver.WOResponse; +import com.webobjects.foundation.NSDictionary; +import com.webobjects.foundation.NSMutableArray; +import com.webobjects.foundation.NSMutableDictionary; + +import er.ajax.AjaxDynamicElement; +import er.ajax.AjaxOption; +import er.ajax.AjaxOptions; +import er.ajax.AjaxUtils; +import er.extensions.appserver.ERXWOContext; + +/** + * Creates a JavaScript slider + * see the MooTools documentation here: http://mootools.net/docs/more/Drag/Slider + * + * The HTML for the slider will be written like this: + * >div id="_1Element" class="element"< + * >div id="_2Knob" class="knob">>/div< + * >/div< + * + * @binding id - the identifer for the slider's JS var. + * @binding element the identifier to be used for the slider's container + * @binding knob the identifier to be used for the knob's container. + * @binding elementClass the CSS class to be used on the slider's container. + * @binding element - (element) The container element for the slider. + * @binding knob - (element) The handle element for the slider. + * OPTIONS + * @binding snap - (boolean: defaults to false) True if you want the knob to snap to the nearest value. + * @binding offset - (number: defaults to 0) Relative offset for knob position at start. + * @binding range - (mixed: defaults to false) Array of numbers or false. The minimum and maximum limits values the slider will use. + * @binding wheel - (boolean: defaults to false) True if you want the ability to move the knob by mousewheeling. + * @binding steps - (number: defaults to 100) The number of steps the Slider should move/tick. + * @binding mode - (string: defaults to horizontal) The type of Slider can be either 'horizontal' or 'vertical' in movement. + * @binding initialStep - (number: defaults to 0) The step the slider will start at. + * + * OBSERVER + * @binding the id of the element who will update the slider's value with it's value. + * @binding the event to observer on defaults to "change" + * + * This is the layout of the HTML that the + * + * + * @author johnnymiller + * + */ + + +public class MTJSSlider extends AjaxDynamicElement { + + public MTJSSlider(String name, NSDictionary associations, WOElement children) { + super(name, associations, children); + } + + public void appendToResponse(WOResponse response, WOContext context) { + + // TODO Auto-generated method stub + + WOComponent component = context.component(); + String sliderID = (String)valueForBinding("id", ERXWOContext.safeIdentifierName(context, true) + "Slider", component); + String elementID = (String)valueForBinding("element", ERXWOContext.safeIdentifierName(context, true) + "Element", component); + String knobID = (String)valueForBinding("knob", ERXWOContext.safeIdentifierName(context, true) + "Knob", component); + response.appendContentString("\n"); + response.appendContentString("\n\t"); + response.appendContentString("\n\n"); + + AjaxUtils.appendScriptHeader(response); + response.appendContentString("var "); + response.appendContentString(sliderID); + response.appendContentString(";"); + response.appendContentString("\nwindow.addEvent('domready', function() {"); + response.appendContentString("\n\t"); + response.appendContentString(sliderID); + response.appendContentString(" = new Slider('"); + response.appendContentString(elementID); + response.appendContentString("', '"); + response.appendContentString(knobID); + response.appendContentString("', {"); + AjaxOptions._appendToResponse(createOptions(component), response, context); + response.appendContentString("});"); + + String observer = stringValueForBinding("observer", component); + if(observer != null) { + String observerEvent = (String)valueForBinding("observerEvent", "change", component); + response.appendContentString("\n\t$('"); + response.appendContentString(observer); + response.appendContentString("').addEvent('"); + response.appendContentString(observerEvent); + response.appendContentString("', function(e) { "); + response.appendContentString("this.set(e.target.value);"); + response.appendContentString("}.bind("); + response.appendContentString(sliderID); + response.appendContentString("));"); + } + + response.appendContentString("\n});\n"); + AjaxUtils.appendScriptFooter(response); + super.appendToResponse(response, context); + + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected NSMutableDictionary createOptions(WOComponent component) { + + NSMutableArray ajaxOptionsArray = new NSMutableArray(); + ajaxOptionsArray.addObject(new AjaxOption("snap", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("offset", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("range", AjaxOption.ARRAY)); + ajaxOptionsArray.addObject(new AjaxOption("wheel", AjaxOption.BOOLEAN)); + ajaxOptionsArray.addObject(new AjaxOption("steps", AjaxOption.NUMBER)); + ajaxOptionsArray.addObject(new AjaxOption("mode", AjaxOption.STRING)); + ajaxOptionsArray.addObject(new AjaxOption("onChange", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onComplete", AjaxOption.SCRIPT)); + ajaxOptionsArray.addObject(new AjaxOption("onTick", AjaxOption.SCRIPT)); + NSMutableDictionary options = AjaxOption.createAjaxOptionsDictionary(ajaxOptionsArray, component, associations()); + return options; + + } + + @Override + protected void addRequiredWebResources(WOResponse response, + WOContext context) { + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_CORE_JS); + MTAjaxUtils.addScriptResourceInHead(context, context.response(), "MooTools", MTAjaxUtils.MOOTOOLS_MORE_JS); + } + + @Override + public WOActionResults handleRequest(WORequest request, WOContext context) { + // TODO Auto-generated method stub + return null; + } + + + +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/MTWonder.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/MTWonder.js new file mode 100644 index 00000000000..40cc8407863 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/MTWonder.js @@ -0,0 +1,483 @@ +/* + The code in this file is based upon wonder.js. Which is used in Project Wonder's Ajax Framework. + http://wiki.wocommunity.org/display/WO/Project+WONDER-Frameworks-Ajax-AjaxUpdateContainer + MoWonder.js ports the functionality found in wonder.js to MooTools. wonder.js is based upon Prototype/Scriptaculous + @author Jonathan Miller + */ + + + var $wi = $; + + String.implement({ + + addQueryParameters: function(additionalParameters) { + if(additionalParameters) { + return this + (this.match(/\?/) ? '&' : '?') + additionalParameters; + } else { + return this; + } + }, + + blank: function() { + return this.trim().length === 0; + } + + }); + +var MTAjaxOptions = { + + defaultOptions: function(additionalOptions) { + var options = { + method: 'get', + async: true, + evalScripts: true + }; + + return Object.merge(options, additionalOptions); + + } + +} + +var MTAjaxUpdateContainer = { + + registerPeriodic: function(id, canStop, stopped, options) { + + var el = $(id); + var url = el.get('updateUrl'); + var updater; + if(!canStop) { + + var merged = Object.merge(MTAjaxOptions.defaultOptions(options), { + update: el, + url: url + }); + + if(! merged.delay && options.frequency) { + merged.delay = options.frequency * 1000; + } + if(! merged.initialDelay && options.frequency) { + merged.initialDelay = merged.delay; + } + updater = new Request.HTML(merged).startTimer(); + + } + + }, + + insertionFunc: function() {}, + + register : function(id, options) { + if(!options) options = {}, + eval(id + "Update = function() { MTAjaxUpdateContainer.update(id, options); }"); + }, + + update: function(id, options) { + + var updateElement = $(id); + + if(updateElement == null) { + alert('There is no element on this page with the id "' + id + '".'); + } + + var actionUrl = updateElement.get('updateUrl'); + actionUrl = actionUrl.addQueryParameters('__updateID=' + id); +// new Ajax.Updater(id, actionUrl, AjaxOptions.defaultOptions(options)); + new Request.HTML(Object.merge(MTAjaxOptions.defaultOptions(options), { + update : $(id), + url : actionUrl + })).send(); + + } + +} + +var MTAUC = MTAjaxUpdateContainer; + +var MTAjaxUpdateLink = { + + updateFunc: function(id, options, elementID) { + var updateFunction = function(queryParams) { + MTAjaxUpdateLink.update(id, options, elementID, queryParams); + } + return updateFunction; + }, + + update: function(id, options, elementID, queryParams) { + var updateElement = $(id); + if(updateElement == null) { + alert('There is no element on this page with the id "' + id + '".'); + } + MTAjaxUpdateLink._update(id, updateElement.get('updateUrl'), options, elementID, queryParams); + }, + + _update: function(id, actionUrl, options, elementID, queryParams) { + + if(elementID) { + actionUrl = actionUrl.replace(/[^\/]+$/, elementID); + } + + options.url = actionUrl; + options.update = $(id); + options.__updateID = id; + options.noCache = true; + + if(options && options['_r']) { + options._r = id; + } + else { + options._u = id; + } + + new Request.HTML(MTAjaxOptions.defaultOptions(options)).send(queryParams); + + }, + + request: function() { + + if(actionUrl, options, elementID, queryParams) { + actionUrl = actionUrl.replace(/[^\/]+$/, elementID); + } + + options = Object.merge(options, queryParams.parseQueryString()); + options.url = actionUrl; + + new Request(MTAjaxOptions.defaultOptions(options)).send(); + + } + +} + +var MTAUL = MTAjaxUpdateLink; + +var MTAjaxSubmitButton = { + + PartialFormSenderIDKey: '_partialSenderID', + AjaxSubmitButtonNameKey: 'AJAX_SUBMIT_BUTTON_NAME', + defaultOptions: function(additionalOptions) { + var options = MTAjaxOptions.defaultOptions(additionalOptions); + options.method = 'post'; + options.noCache = true; + return options; + }, + + generateActionUrl: function(id, form, queryParams) { + var actionUrl = form.action; + + if(queryParams != null) { + actionUrl = actionUrl.addQueryParameters(queryParams); + } + + actionUrl = actionUrl.replace('/wo/', '/ajax/'); + + if(id != null) { + actionUrl = actionUrl.addQueryParameters('__updateID=' + id); + } + + return actionUrl; + + }, + + processOptions: function(form, options) { + var processedOptions = null; + + if(options != null) { + processedOptions = Object.merge(new Object(), options); + var ajaxSubmitButtonName = processedOptions._asbn; + if(ajaxSubmitButtonName != null) { + processedOptions._asbn = null; + var parameters = processedOptions.parameters; + if(parameters === undefined || parameters == null) { + var formSerializer = processedOptions._fs; + var serializedForm = $(form).toQueryString(); + processedOptions.parameters = serializedForm + + '&' + MTAjaxSubmitButton.AjaxSubmitButtonNameKey + '=' + ajaxSubmitButtonName; + + } else { + processedOptions.parameters = parameters + + '&' + MTAjaxSubmitButton.AjaxSubmitButtonNameKey + '=' + ajaxSubmitButtonName; + } + } + } + + processedOptions = MTAjaxSubmitButton.defaultOptions(processedOptions); + return processedOptions; + + }, + + partial: function(updateContainerID, formFieldID, options) { + + var optionsCopy = Object.merge(new Object(), options); + var formField = $(formFieldID); + var form = formField.form; + + var queryParams = {}; + queryParams[formField.name] = formField.get('value'); + queryParams[MTAjaxSubmitButton.PartialFormSenderIDKey] = formField.name; + optionsCopy['parameters'] = Object.toQueryString(queryParams); + + + if(updateContainerID == null) { + MTAjaxSubmitButton.request(form, null, optionsCopy); + } else { + MTAjaxSubmitButton.update(updateContainerID, form, null, optionsCopy); + } + + }, + + preventEnterKeySubmit : function() { + $$('.m-a-s-b').each(function(el) { + $(el.form).addEvent('keydown', function(e) { + if(e.key == 'enter' && e.target.tagName != 'SELECT') { + e.preventDefault(); + } + }); + }); + }, + + update : function(id, form, queryParams, options) { + var updateElement = $(id); + if(updateElement == null) { + alert('There is no element on this page with the id "' + id + '".'); + } + var finalUrl = MTAjaxSubmitButton.generateActionUrl(id, form, queryParams); + var finalOptions = MTAjaxSubmitButton.processOptions(form, options); + new Request.HTML(Object.merge({ + update : id, + url : finalUrl + }, finalOptions)).send(finalOptions.parameters); + + }, + + request : function(form, queryParams, options) { + + var finalUrl = MTAjaxSubmitButton.generateActionUrl(id, form, queryParams); + var finalOptions = MTAjaxSubmitButton.processOptions(form, options); + + new Request.HTML(Object.merge({ + url : finalUrl + }, finalOptions)).send(finalOptions.parameters); + + }, + + observeDescendentFields : function(updateContainerID, containerID, observeFieldFrequency, partial, observeDelay, options) { + $(containerID).getChildren().each(function(element) { + if(element.type != 'hidden' && ['input', 'select', 'textarea'].contains(element.tagName.toLowerCase())){ + MTAjaxSubmitButton.observeField(updateContainerID, element, observeFieldFrequency, partial, observeDelay, options); + } + }); + }, + + observeField: function(updateContainerID, formFieldID, observeFieldFrequency, partial, observeDelay, options) { + + var submitFunction; + + if(partial) { + submitFunction = function(element, value) { + if(!options.onBeforeSubmit || options.onBeforeSubmit(formFieldID)) { + MTASB.partial(updateContainerID, formFieldID, options); + } + } + } else if (updateContainerID != null) { + submitFunction = function(element, value) { + if(!options.onBeforeSubmit || options.onBeforeSubmit(formFieldID)) { + MTASB.update(updateContainerID, $(formFieldID), null, options); + } + } + } else { + submitFunction = function(element, value) { + if (!options.onBeforeSubmit || options.onBeforeSubmit(formFieldID)) { + MTASB.request($(formFieldID).form, null, options); + } + } + + } + + if(observeDelay) { + var delayer = new MTAjaxObserveDelayer(observeDelay, submitFunction); + submitFunction = delayer.valueChanged.bind(delayer); + } + + $(formFieldID).addEvent('change', submitFunction); + + } + +}; + + +var MTASB = MTAjaxSubmitButton; + +var MTAjaxObserveDelayer = new Class({ + + delay: null, + waiting: null, + lastValueChange: null, + submitFunction: null, + element: null, + value: null, + + initialize: function(delay, submitFunction) { + this.delay = delay * 1000.0; + this.submitFunction = submitFunction; + }, + + valueChanged: function(element, value) { + + this.element = element; + this.value = value; + this.lastValueChange = new Date().getTime(); + + if (!this.waiting) { + this.waiting = true; + var lastValueChange = this.lastValueChange; + setTimeout(this.delayFinished.bind(this, lastValueChange), this.delay); + } + + }, + + delayFinished: function(lastValueChange) { + if (lastValueChange == this.lastValueChange) { + this.waiting = false; + this.submitFunction(this.element, this.value); + } + else { + var newLastValueChange = this.lastValueChange; + var now = new Date().getTime(); + var delayLeft = Math.max(250, this.delay - (now - newLastValueChange)); + setTimeout(this.delayFinished.bind(this, newLastValueChange), delayLeft); + } + } + + +}); + +var MTAjaxDraggable = new Class({ + + Implements: [Options, Events], + + options: { + + draggableKeyName: '', + draggableKeyName: null, + droppableElementID: null, + + grid: 0, + handle: null, + invert: false, + limit: false, + modifiers: {x: 'left', y: 'top'}, + style: true, + snap: 6, + unit: 'px', + preventDefault: false, + stopPropagation: false, + container: null, + droppables: '', + precalculate: false, + includeMargins: true, + checkDroppables: true, + + ghost: false, + ghostOpacity: 0.7, + + id:null, + useSpinner: false + /* + beforeStart: function(draggable) {}, + onStart: function(draggable) {}, + onSnap: function(draggable) {}, + onDrag: function(draggable) {}, + onComplete: function(draggable) {}, + onCancel: function(draggable) {}, + afterDrop: function(element, droppables) {}, + onDrop: function(element, droppables) {}, + onEnter: function(element, droppables) {}, + onLeave: function(element, droppables) {}, + */ + }, + + initialize : function(updateContainerID, options) { + Object.merge(this.options, options); + this.setOptions(options); + this.element = $(this.options.id); + this.updateContainer = $(updateContainerID); + var draggableContainer; + var draggableContainerName = 'draggable_' + this.options.id; + var draggableContainerType = eval("typeof " + draggableContainerName); + + if (draggableContainerType != 'undefined') { + eval(draggableContainerName).destroy(); + } + if(this.element == null) { + alert("Please supply the draggable element's id."); + } else { + + if(this.options.ghost) { + + this.element.addEvent('mousedown', function(event) { + var clone = this.element.clone().setStyles(this.element.getCoordinates()) + .setStyles({opacity: this.options.ghostOpacity, position: 'absolute'}).inject(document.body); + draggableContainer = clone; + var drag = new Drag.Move(clone, Object.merge(this.options, { onDrop: this._onDrop.bind(this), onEnter: this.enter.bind(this), onLeave: this.leave.bind(this) })); + drag.start(event); + + }.bind(this)); + + } else { + draggableContainer = element; + element.makeDraggable(this.options); + } + + eval(draggableContainerName + "=draggableContainer"); + + } + + }, + + _onDrop: function(element, droppable) { + + element = $(element); + if(droppable) { + + var draggableID = element.get('draggableID'); + var droppedAreaID = droppable.get('id'); + + if(draggableID == null) + draggableID = element.get('id'); + + var data = this.options.draggableKeyName + '=' + draggableID + "&" + "dropAreaID=" + droppedAreaID; + + if(this.updateContainer == null) { + if(this.form) { + + } + } else { + if(this.options.form) { + + } else { + MTAUL.update(this.updateContainer, {}, this.options.contextID + '.' + this.options.elementID, data); + } + } + } + + element.destroy(); + this.drop(element, droppable); + + }, + drop: function(element, droppable) { + this.fireEvent("drop", [element, droppable]); + }, + enter: function(element, droppable) { + this.fireEvent("enter", [element, droppable]); + }, + + leave: function(element, droppable) { + this.fireEvent("leave", [element, droppable]); + } + +}); + +var MTAD = MTAjaxDraggable; + + + diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-core-1.4.4-yc.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-core-1.4.4-yc.js new file mode 100644 index 00000000000..71e8e76db3e --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-core-1.4.4-yc.js @@ -0,0 +1,490 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0 + +packager build: + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ + +(function(){this.MooTools={version:"1.4.4",build:"adb02e676407521b516ffa10d2dc6b54237a80f9"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); +}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; +}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; +while(s){if(s===i){return true;}s=s.parent;}if(!t.hasOwnProperty){return false;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null; +}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];}f.prototype.overloadSetter=function(s){var i=this; +return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]);}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]); +}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this;return function(u){var v,t;if(s||typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments; +}}if(v){t={};for(var w=0;w>>0; +b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d);for(var a=0;a>>0; +b-1:String(this).indexOf(a)>-1;},trim:function(){return String(this).replace(/^\s+|\s+$/g,""); +},clean:function(){return String(this).replace(/\s+/g," ").trim();},camelCase:function(){return String(this).replace(/-\D/g,function(a){return a.charAt(1).toUpperCase(); +});},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(a){return a.toUpperCase(); +});},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this); +},hexToRgb:function(b){var a=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=String(this).match(/\d{1,3}/g); +return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); +return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype; +g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments);return g==e?f:g;};return c;},pass:function(b,c){var a=this; +if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); +},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; +for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(q,r){e+=r+"\n"; +return"";});if(o===true){n.exec(e);}else{if(typeOf(o)=="function"){o(e,p);}}return p;});n.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,o){g[e]=o;});this.Document=j.$constructor=new Type("Document",function(){}); +j.$family=Function.from("document").hide();Document.mirror(function(e,o){j[e]=o;});j.html=j.documentElement;if(!j.head){j.head=j.getElementsByTagName("head")[0]; +}if(j.execCommand){try{j.execCommand("BackgroundImageCache",false,true);}catch(f){}}if(this.attachEvent&&!this.addEventListener){var c=function(){this.detachEvent("onunload",c); +j.head=j.html=j.window=null;};this.attachEvent("onunload",c);}var l=Array.from;try{l(j.html.childNodes);}catch(f){Array.from=function(o){if(typeof o!="string"&&Type.isEnumerable(o)&&typeOf(o)!="array"){var e=o.length,p=new Array(e); +while(e--){p[e]=o[e];}return p;}return l(o);};var k=Array.prototype,m=k.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var o=k[e]; +Array[e]=function(p){return o.apply(Array.from(p),m.call(arguments,1));};});}})();(function(){var b={};var a=this.DOMEvent=new Type("DOMEvent",function(c,g){if(!g){g=window; +}c=c||g.event;if(c.$extended){return c;}this.event=c;this.$extended=true;this.shift=c.shiftKey;this.control=c.ctrlKey;this.alt=c.altKey;this.meta=c.metaKey; +var i=this.type=c.type;var h=c.target||c.srcElement;while(h&&h.nodeType==3){h=h.parentNode;}this.target=document.id(h);if(i.indexOf("key")==0){var d=this.code=(c.which||c.keyCode); +this.key=b[d];if(i=="keydown"){if(d>111&&d<124){this.key="f"+(d-111);}else{if(d>95&&d<106){this.key=d-96;}}}if(this.key==null){this.key=String.fromCharCode(d).toLowerCase(); +}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i=="DOMMouseScroll"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body; +this.page={x:(c.pageX!=null)?c.pageX:c.clientX+j.scrollLeft,y:(c.pageY!=null)?c.pageY:c.clientY+j.scrollTop};this.client={x:(c.pageX!=null)?c.pageX-g.pageXOffset:c.clientX,y:(c.pageY!=null)?c.pageY-g.pageYOffset:c.clientY}; +if(i=="DOMMouseScroll"||i=="mousewheel"){this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3;}this.rightClick=(c.which==3||c.button==2);if(i=="mouseover"||i=="mouseout"){var k=c.relatedTarget||c[(i=="mouseover"?"from":"to")+"Element"]; +while(k&&k.nodeType==3){k=k.parentNode;}this.relatedTarget=document.id(k);}}else{if(i.indexOf("touch")==0||i.indexOf("gesture")==0){this.rotation=c.rotation; +this.scale=c.scale;this.targetTouches=c.targetTouches;this.changedTouches=c.changedTouches;var f=this.touches=c.touches;if(f&&f[0]){var e=f[0];this.page={x:e.pageX,y:e.pageY}; +this.client={x:e.clientX,y:e.clientY};}}}}if(!this.client){this.client={};}if(!this.page){this.page={};}});a.implement({stop:function(){return this.preventDefault().stopPropagation(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});a.defineKey=function(d,c){b[d]=c;return this;};a.defineKeys=a.defineKey.overloadSetter(true);a.defineKeys({"38":"up","40":"down","37":"left","39":"right","27":"esc","32":"space","8":"backspace","9":"tab","46":"delete","13":"enter"}); +})();(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h};}var g=function(){e(this);if(g.$prototyping){return this; +}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;return i;}.extend(this).implement(h); +g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); +}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); +};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); +break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); +}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); +return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; +}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; +return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; +for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); +return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); +return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); +this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; +},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; +}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); +if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})(); +(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; +var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; +return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; +}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); +function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; +if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); +}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); +}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); +}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); +break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; +case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); +};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); +};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var k={},m={},d=Object.prototype.toString; +k.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};k.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(d.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); +};k.setDocument=function(w){var p=w.nodeType;if(p==9){}else{if(p){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; +}this.document=w;var A=w.documentElement,o=this.getUIDXML(A),s=m[o],r;if(s){for(r in s){this[r]=s[r];}return;}s=m[o]={};s.root=A;s.isXMLDocument=this.isXML(w); +s.brokenStarGEBTN=s.starSelectsClosedQSA=s.idGetsName=s.brokenMixedCaseQSA=s.brokenGEBCN=s.brokenCheckedQSA=s.brokenEmptyAttributeQSA=s.isHTMLDocument=s.nativeMatchesSelector=false; +var q,u,y,z,t;var x,v="slick_uniqueid";var c=w.createElement("div");var n=w.body||w.getElementsByTagName("body")[0]||A;n.appendChild(c);try{c.innerHTML=''; +s.isHTMLDocument=!!w.getElementById(v);}catch(C){}if(s.isHTMLDocument){c.style.display="none";c.appendChild(w.createComment(""));u=(c.getElementsByTagName("*").length>1); +try{c.innerHTML="foo";x=c.getElementsByTagName("*");q=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/");}catch(C){}s.brokenStarGEBTN=u||q;try{c.innerHTML=''; +s.idGetsName=w.getElementById(v)===c.firstChild;}catch(C){}if(c.getElementsByClassName){try{c.innerHTML='';c.getElementsByClassName("b").length; +c.firstChild.className="b";z=(c.getElementsByClassName("b").length!=2);}catch(C){}try{c.innerHTML='';y=(c.getElementsByClassName("a").length!=2); +}catch(C){}s.brokenGEBCN=z||y;}if(c.querySelectorAll){try{c.innerHTML="foo";x=c.querySelectorAll("*");s.starSelectsClosedQSA=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/"); +}catch(C){}try{c.innerHTML='';s.brokenMixedCaseQSA=!c.querySelectorAll(".MiX").length;}catch(C){}try{c.innerHTML=''; +s.brokenCheckedQSA=(c.querySelectorAll(":checked").length==0);}catch(C){}try{c.innerHTML='';s.brokenEmptyAttributeQSA=(c.querySelectorAll('[class*=""]').length!=0); +}catch(C){}}try{c.innerHTML='
    ';t=(c.firstChild.getAttribute("action")!="s");}catch(C){}s.nativeMatchesSelector=A.matchesSelector||A.mozMatchesSelector||A.webkitMatchesSelector; +if(s.nativeMatchesSelector){try{s.nativeMatchesSelector.call(A,":slick");s.nativeMatchesSelector=null;}catch(C){}}}try{A.slick_expando=1;delete A.slick_expando; +s.getUID=this.getUIDHTML;}catch(C){s.getUID=this.getUIDXML;}n.removeChild(c);c=x=n=null;s.getAttribute=(s.isHTMLDocument&&t)?function(G,E){var H=this.attributeGetters[E]; +if(H){return H.call(G);}var F=G.getAttributeNode(E);return(F)?F.nodeValue:null;}:function(F,E){var G=this.attributeGetters[E];return(G)?G.call(F):F.getAttribute(E); +};s.hasAttribute=(A&&this.isNativeCode(A.hasAttribute))?function(F,E){return F.hasAttribute(E);}:function(F,E){F=F.getAttributeNode(E);return !!(F&&(F.specified||F.nodeValue)); +};var D=A&&this.isNativeCode(A.contains),B=w&&this.isNativeCode(w.contains);s.contains=(D&&B)?function(E,F){return E.contains(F);}:(D&&!B)?function(E,F){return E===F||((E===w)?w.documentElement:E).contains(F); +}:(A&&A.compareDocumentPosition)?function(E,F){return E===F||!!(E.compareDocumentPosition(F)&16);}:function(E,F){if(F){do{if(F===E){return true;}}while((F=F.parentNode)); +}return false;};s.documentSorter=(A.compareDocumentPosition)?function(F,E){if(!F.compareDocumentPosition||!E.compareDocumentPosition){return 0;}return F.compareDocumentPosition(E)&4?-1:F===E?0:1; +}:("sourceIndex" in A)?function(F,E){if(!F.sourceIndex||!E.sourceIndex){return 0;}return F.sourceIndex-E.sourceIndex;}:(w.createRange)?function(H,F){if(!H.ownerDocument||!F.ownerDocument){return 0; +}var G=H.ownerDocument.createRange(),E=F.ownerDocument.createRange();G.setStart(H,0);G.setEnd(H,0);E.setStart(F,0);E.setEnd(F,0);return G.compareBoundaryPoints(Range.START_TO_END,E); +}:null;A=null;for(r in s){this[r]=s[r];}};var f=/^([#.]?)((?:[\w-]+|\*))$/,h=/\[.+[*$^]=(?:""|'')?\]/,g={};k.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]); +if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9);if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U); +}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(f);simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors; +}E=U.getElementsByTagName(v);if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors; +}A=U.getElementById(v);if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A); +}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v); +if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+e.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*"); +for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p); +}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||g[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&h.test(z))||(!y&&z.indexOf(",")>-1)||e.disableQSA){break querySelector; +}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null; +}else{E=U.querySelectorAll(S);}}catch(Q){g[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0; +A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p); +}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z; +return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID; +if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator; +if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1)); +this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search; +}}else{if(s&&w){for(L=0,K=N.length;L1)){this.sort(p);}return(s)?(p[0]||null):p;};k.uidx=1;k.uidk="slick-uniqueid";k.getUIDXML=function(n){var c=n.getAttribute(this.uidk); +if(!c){c=this.uidx++;n.setAttribute(this.uidk,c);}return c;};k.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};k.sort=function(c){if(!this.documentSorter){return c; +}c.sort(this.documentSorter);return c;};k.cacheNTH={};k.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;k.parseNTHArgument=function(q){var o=q.match(this.matchNTH); +if(!o){return false;}var p=o[2]||false;var n=o[1]||1;if(n=="-"){n=-1;}var c=+o[3]||0;o=(p=="n")?{a:n,b:c}:(p=="odd")?{a:2,b:1}:(p=="even")?{a:2,b:0}:{a:0,b:n}; +return(this.cacheNTH[q]=o);};k.createNTHPseudo=function(p,n,c,o){return function(s,q){var u=this.getUID(s);if(!this[c][u]){var A=s.parentNode;if(!A){return false; +}var r=A[p],t=1;if(o){var z=s.nodeName;do{if(r.nodeName!=z){continue;}this[c][this.getUID(r)]=t++;}while((r=r[n]));}else{do{if(r.nodeType!=1){continue; +}this[c][this.getUID(r)]=t++;}while((r=r[n]));}}q=q||"n";var v=this.cacheNTH[q]||this.parseNTHArgument(q);if(!v){return false;}var y=v.a,x=v.b,w=this[c][u]; +if(y==0){return x==w;}if(y>0){if(w":function(p,c,r,o,n,q){if((p=p.firstChild)){do{if(p.nodeType==1){this.push(p,c,r,o,n,q); +}}while((p=p.nextSibling));}},"+":function(p,c,r,o,n,q){while((p=p.nextSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q);break;}}},"^":function(p,c,r,o,n,q){p=p.firstChild; +if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:+"](p,c,r,o,n,q);}}},"~":function(q,c,s,p,n,r){while((q=q.nextSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}},"++":function(p,c,r,o,n,q){this["combinator:+"](p,c,r,o,n,q); +this["combinator:!+"](p,c,r,o,n,q);},"~~":function(p,c,r,o,n,q){this["combinator:~"](p,c,r,o,n,q);this["combinator:!~"](p,c,r,o,n,q);},"!":function(p,c,r,o,n,q){while((p=p.parentNode)){if(p!==this.document){this.push(p,c,r,o,n,q); +}}},"!>":function(p,c,r,o,n,q){p=p.parentNode;if(p!==this.document){this.push(p,c,r,o,n,q);}},"!+":function(p,c,r,o,n,q){while((p=p.previousSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q); +break;}}},"!^":function(p,c,r,o,n,q){p=p.lastChild;if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:!+"](p,c,r,o,n,q);}}},"!~":function(q,c,s,p,n,r){while((q=q.previousSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}}};for(var i in j){k["combinator:"+i]=j[i];}var l={empty:function(c){var n=c.firstChild; +return !(n&&n.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,n){return !this.matchNode(c,n);},contains:function(c,n){return(c.innerText||c.textContent||"").indexOf(n)>-1; +},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"only-child":function(o){var n=o;while((n=n.previousSibling)){if(n.nodeType==1){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"nth-child":k.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":k.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":k.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":k.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(n,c){return this["pseudo:nth-child"](n,""+(c+1)); +},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var n=c.nodeName; +while((c=c.previousSibling)){if(c.nodeName==n){return false;}}return true;},"last-of-type":function(c){var n=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==n){return false; +}}return true;},"only-of-type":function(o){var n=o,p=o.nodeName;while((n=n.previousSibling)){if(n.nodeName==p){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeName==p){return false; +}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); +},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var b in l){k["pseudo:"+b]=l[b];}var a=k.attributeGetters={"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for"); +},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href");},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style"); +},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null;},type:function(){return this.getAttribute("type"); +},maxlength:function(){var c=this.getAttributeNode("maxLength");return(c&&c.specified)?c.nodeValue:null;}};a.MAXLENGTH=a.maxLength=a.maxlength;var e=k.Slick=(this.Slick||{}); +e.version="1.1.7";e.search=function(n,o,c){return k.search(n,o,c);};e.find=function(c,n){return k.search(c,n,null,true);};e.contains=function(c,n){k.setDocument(c); +return k.contains(c,n);};e.getAttribute=function(n,c){k.setDocument(n);return k.getAttribute(n,c);};e.hasAttribute=function(n,c){k.setDocument(n);return k.hasAttribute(n,c); +};e.match=function(n,c){if(!(n&&c)){return false;}if(!c||c===n){return true;}k.setDocument(n);return k.matchNode(n,c);};e.defineAttributeGetter=function(c,n){k.attributeGetters[c]=n; +return this;};e.lookupAttributeGetter=function(c){return k.attributeGetters[c];};e.definePseudo=function(c,n){k["pseudo:"+c]=function(p,o){return n.call(p,o); +};return this;};e.lookupPseudo=function(c){var n=k["pseudo:"+c];if(n){return function(o){return n.call(this,o);};}return null;};e.override=function(n,c){k.override(n,c); +return this;};e.isXML=k.isXML;e.uidOf=function(c){return k.getUIDHTML(c);};if(!this.Slick){this.Slick=e;}}).apply((typeof exports!="undefined")?exports:this); +var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; +b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var a,f=0,c=d.length;f=this.length){delete this[g--]; +}return e;}.protect());}Array.forEachMethod(function(g,e){Elements.implement(e,g);});Array.mirror(Elements);var d;try{d=(document.createElement("").name=="x"); +}catch(b){}var c=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,g){if(g&&g.checked!=null){g.defaultChecked=g.checked; +}if(d&&g){e="<"+e;if(g.name){e+=' name="'+c(g.name)+'"';}if(g.type){e+=' type="'+c(g.type)+'"';}e+=">";delete g.name;delete g.type;}return this.id(this.createElement(e)).set(g); +}});})();(function(){Slick.uidOf(window);Slick.uidOf(document);Document.implement({newTextNode:function(e){return this.createTextNode(e);},getDocument:function(){return this; +},getWindow:function(){return this.window;},id:(function(){var e={string:function(E,D,l){E=Slick.find(l,"#"+E.replace(/(\W)/g,"\\$1"));return(E)?e.element(E,D):null; +},element:function(D,E){Slick.uidOf(D);if(!E&&!D.$family&&!(/^(?:object|embed)$/i).test(D.tagName)){var l=D.fireEvent;D._fireEvent=function(F,G){return l(F,G); +};Object.append(D,Element.Prototype);}return D;},object:function(D,E,l){if(D.toElement){return e.element(D.toElement(l),E);}return null;}};e.textnode=e.whitespace=e.window=e.document=function(l){return l; +};return function(D,F,E){if(D&&D.$family&&D.uniqueNumber){return D;}var l=typeOf(D);return(e[l])?e[l](D,F,E||document):null;};})()});if(window.$==null){Window.implement("$",function(e,l){return document.id(e,l,this.document); +});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements); +},getElement:function(e){return document.id(Slick.find(this,e));}});var m={contains:function(e){return Slick.contains(this,e);}};if(!document.contains){Document.implement(m); +}if(!document.createElement("div").contains){Element.implement(m);}var r=function(E,D){if(!E){return D;}E=Object.clone(Slick.parse(E));var l=E.expressions; +for(var e=l.length;e--;){l[e][0].combinator=D;}return E;};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,l){Element.implement(l,function(D){return this.getElement(r(D,e)); +});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,l){Element.implement(l,function(D){return this.getElements(r(D,e)); +});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,r(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,r(e,">")).getLast()); +},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1"))); +},match:function(e){return !e||Slick.match(this,e);}});if(window.$$==null){Window.implement("$$",function(e){if(arguments.length==1){if(typeof e=="string"){return Slick.search(this.document,e,new Elements); +}else{if(Type.isEnumerable(e)){return new Elements(e);}}}return new Elements(arguments);});}var w={before:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e); +}},after:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e.nextSibling);}},bottom:function(l,e){e.appendChild(l);},top:function(l,e){e.insertBefore(l,e.firstChild); +}};w.inside=w.bottom;var j={},d={};var k={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){k[e.toLowerCase()]=e; +});k.html="innerHTML";k.text=(document.createElement("div").textContent==null)?"innerText":"textContent";Object.forEach(k,function(l,e){d[e]=function(D,E){D[l]=E; +};j[e]=function(D){return D[l];};});var x=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; +var h={};Array.forEach(x,function(e){var l=e.toLowerCase();h[l]=e;d[l]=function(D,E){D[e]=!!E;};j[l]=function(D){return !!D[e];};});Object.append(d,{"class":function(e,l){("className" in e)?e.className=(l||""):e.setAttribute("class",l); +},"for":function(e,l){("htmlFor" in e)?e.htmlFor=l:e.setAttribute("for",l);},style:function(e,l){(e.style)?e.style.cssText=l:e.setAttribute("style",l); +},value:function(e,l){e.value=(l!=null)?l:"";}});j["class"]=function(e){return("className" in e)?e.className||null:e.getAttribute("class");};var f=document.createElement("button"); +try{f.type="button";}catch(z){}if(f.type!="button"){d.type=function(e,l){e.setAttribute("type",l);};}f=null;var p=document.createElement("input");p.value="t"; +p.type="submit";if(p.value!="t"){d.type=function(l,e){var D=l.value;l.type=e;l.value=D;};}p=null;var q=(function(e){e.random="attribute";return(e.getAttribute("random")=="attribute"); +})(document.createElement("div"));Element.implement({setProperty:function(l,D){var E=d[l.toLowerCase()];if(E){E(this,D);}else{if(q){var e=this.retrieve("$attributeWhiteList",{}); +}if(D==null){this.removeAttribute(l);if(q){delete e[l];}}else{this.setAttribute(l,D);if(q){e[l]=true;}}}return this;},setProperties:function(e){for(var l in e){this.setProperty(l,e[l]); +}return this;},getProperty:function(F){var D=j[F.toLowerCase()];if(D){return D(this);}if(q){var l=this.getAttributeNode(F),E=this.retrieve("$attributeWhiteList",{}); +if(!l){return null;}if(l.expando&&!E[F]){var G=this.outerHTML;if(G.substr(0,G.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(F)<0){return null;}E[F]=true;}}var e=Slick.getAttribute(this,F); +return(!e&&!Slick.hasAttribute(this,F))?null:e;},getProperties:function(){var e=Array.from(arguments);return e.map(this.getProperty,this).associate(e); +},removeProperty:function(e){return this.setProperty(e,null);},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},set:function(D,l){var e=Element.Properties[D]; +(e&&e.set)?e.set.call(this,l):this.setProperty(D,l);}.overloadSetter(),get:function(l){var e=Element.Properties[l];return(e&&e.get)?e.get.apply(this):this.getProperty(l); +}.overloadGetter(),erase:function(l){var e=Element.Properties[l];(e&&e.erase)?e.erase.apply(this):this.removeProperty(l);return this;},hasClass:function(e){return this.className.clean().contains(e," "); +},addClass:function(e){if(!this.hasClass(e)){this.className=(this.className+" "+e).clean();}return this;},removeClass:function(e){this.className=this.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)"),"$1"); +return this;},toggleClass:function(e,l){if(l==null){l=!this.hasClass(e);}return(l)?this.addClass(e):this.removeClass(e);},adopt:function(){var E=this,e,G=Array.flatten(arguments),F=G.length; +if(F>1){E=e=document.createDocumentFragment();}for(var D=0;D"; +var a=(t.childNodes.length==1);if(!a){var s="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),b=document.createDocumentFragment(),u=s.length; +while(u--){b.createElement(s[u]);}}t=null;var g=Function.attempt(function(){var e=document.createElement("table");e.innerHTML="";return true; +});var c=document.createElement("tr"),o="";c.innerHTML=o;var y=(c.innerHTML==o);c=null;if(!g||!y||!a){Element.Properties.html.set=(function(l){var e={table:[1,"","
    "],select:[1,""],tbody:[2,"","
    "],tr:[3,"","
    "]}; +e.thead=e.tfoot=e.tbody;return function(D){var E=e[this.get("tag")];if(!E&&!a){E=[0,"",""];}if(!E){return l.call(this,D);}var H=E[0],G=document.createElement("div"),F=G; +if(!a){b.appendChild(G);}G.innerHTML=[E[1],D,E[2]].flatten().join("");while(H--){F=F.firstChild;}this.empty().adopt(F.childNodes);if(!a){b.removeChild(G); +}G=null;};})(Element.Properties.html.set);}var n=document.createElement("form");n.innerHTML="";if(n.firstChild.value!="s"){Element.Properties.value={set:function(G){var l=this.get("tag"); +if(l!="select"){return this.setProperty("value",G);}var D=this.getElements("option");for(var E=0;E0||k==null?"visible":"hidden";};var f=(h?function(l,k){l.style.opacity=k;}:(e?function(l,k){var n=l.style; +if(!l.currentStyle||!l.currentStyle.hasLayout){n.zoom=1;}if(k==null){k="";}else{k="alpha(opacity="+(k*100).limit(0,100).round()+")";}var m=n.filter||l.getComputedStyle("filter")||""; +n.filter=j.test(m)?m.replace(j,k):m+k;if(!n.filter){n.removeAttribute("filter");}}:a));var g=(h?function(l){var k=l.style.opacity||l.getComputedStyle("opacity"); +return(k=="")?1:k.toFloat();}:(e?function(l){var m=(l.style.filter||l.getComputedStyle("filter")),k;if(m){k=m.match(j);}return(k==null||m==null)?1:(k[1]/100); +}:function(l){var k=l.retrieve("$opacity");if(k==null){k=(l.style.visibility=="hidden"?0:1);}return k;}));var b=(i.style.cssFloat==null)?"styleFloat":"cssFloat"; +Element.implement({getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()];}var l=Element.getDocument(this).defaultView,k=l?l.getComputedStyle(this,null):null; +return(k)?k.getPropertyValue((m==b)?"float":m.hyphenate()):null;},setStyle:function(l,k){if(l=="opacity"){if(k!=null){k=parseFloat(k);}f(this,k);return this; +}l=(l=="float"?b:l).camelCase();if(typeOf(k)!="string"){var m=(Element.Styles[l]||"@").split(" ");k=Array.from(k).map(function(o,n){if(!m[n]){return""; +}return(typeOf(o)=="number")?m[n].replace("@",Math.round(o)):o;}).join(" ");}else{if(k==String(Number(k))){k=Math.round(k);}}this.style[l]=k;if((k==""||k==null)&&c&&this.style.removeAttribute){this.style.removeAttribute(l); +}return this;},getStyle:function(q){if(q=="opacity"){return g(this);}q=(q=="float"?b:q).camelCase();var k=this.style[q];if(!k||q=="zIndex"){k=[];for(var p in Element.ShortStyles){if(q!=p){continue; +}for(var o in Element.ShortStyles[p]){k.push(this.getStyle(o));}return k.join(" ");}k=this.getComputedStyle(q);}if(k){k=String(k);var m=k.match(/rgba?\([\d\s,]+\)/); +if(m){k=k.replace(m[0],m[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(k)))){if((/^(height|width)$/).test(q)){var l=(q=="width")?["left","right"]:["top","bottom"],n=0; +l.each(function(r){n+=this.getStyle("border-"+r+"-width").toInt()+this.getStyle("padding-"+r).toInt();},this);return this["offset"+q.capitalize()]-n+"px"; +}if(Browser.opera&&String(k).indexOf("px")!=-1){return k;}if((/^border(.+)Width|margin|padding/).test(q)){return"0px";}}return k;},setStyles:function(l){for(var k in l){this.setStyle(k,l[k]); +}return this;},getStyles:function(){var k={};Array.flatten(arguments).each(function(l){k[l]=this.getStyle(l);},this);return k;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(q){var p=Element.ShortStyles; +var l=Element.Styles;["margin","padding"].each(function(r){var s=r+q;p[r][s]=l[s]="@px";});var o="border"+q;p.border[o]=l[o]="@px @ rgb(@, @, @)";var n=o+"Width",k=o+"Style",m=o+"Color"; +p[o]={};p.borderWidth[n]=p[o][n]=l[n]="@px";p.borderStyle[k]=p[o][k]=l[k]="@";p.borderColor[m]=p[o][m]=l[m]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b); +}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{});if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this; +}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h,f);}if(b.condition){d=function(k){if(b.condition.call(this,k,f)){return h.call(this,k); +}return true;};}if(b.base){g=Function.from(b.base).call(this,f);}}var e=function(){return h.call(j);};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new DOMEvent(k,j.getWindow()); +if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]);}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events"); +if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d);if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e]; +if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.base).call(this,e);}}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this; +},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this;},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]); +}return this;}var c=this.retrieve("events");if(!c){return this;}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e); +},this);delete c[b];}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); +}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +Element.Events={mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};if("onmouseenter" in document.documentElement){Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2; +}else{var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a};}if(!window.addEventListener){Element.NativeEvents.propertychange=2; +Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return this.type!="radio"||(b.event.propertyName=="checked"&&this.checked); +}};}})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var k=function(l,m,n,o,p){while(p&&p!=l){if(m(p,o)){return n.call(p,o,p); +}p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}}; +var b="$delegation:";var i=function(l){return{base:"focusin",remove:function(m,o){var p=m.retrieve(b+l+"listeners",{})[o];if(p&&p.forms){for(var n=p.forms.length; +n--;){p.forms[n].removeEvent(l,p.fns[n]);}}},listen:function(x,r,v,n,t,s){var o=(t.get("tag")=="form")?t:n.target.getParent("form");if(!o){return;}var u=x.retrieve(b+l+"listeners",{}),p=u[s]||{forms:[],fns:[]},m=p.forms,w=p.fns; +if(m.indexOf(o)!=-1){return;}m.push(o);var q=function(y){k(x,r,v,y,t);};o.addEvent(l,q);w.push(q);u[s]=p;x.store(b+l+"listeners",u);}};};var d=function(l){return{base:"focusin",listen:function(m,n,p,q,r){var o={blur:function(){this.removeEvents(o); +}};o[l]=function(s){k(m,n,p,s,r);};q.target.addEvents(o);}};};if(!c){Object.append(a,{submit:i("submit"),reset:i("reset"),change:d("change"),select:d("select")}); +}var h=Element.prototype,f=h.addEvent,j=h.removeEvent;var e=function(l,m){return function(r,q,n){if(r.indexOf(":relay")==-1){return l.call(this,r,q,n); +}var o=Slick.parse(r).expressions[0][0];if(o.pseudos[0].key!="relay"){return l.call(this,r,q,n);}var p=o.tag;o.pseudos.slice(1).each(function(s){p+=":"+s.key+(s.value?"("+s.value+")":""); +});l.call(this,r,q);return m.call(this,p,o.pseudos[0].value,q);};};var g={addEvent:function(v,q,x){var t=this.retrieve("$delegates",{}),r=t[v];if(r){for(var y in r){if(r[y].fn==x&&r[y].match==q){return this; +}}}var p=v,u=q,o=x,n=a[v]||{};v=n.base||p;q=function(B){return Slick.match(B,u);};var w=Element.Events[p];if(w&&w.condition){var l=q,m=w.condition;q=function(C,B){return l(C,B)&&m.call(C,B,v); +};}var z=this,s=String.uniqueID();var A=n.listen?function(B,C){if(!C&&B&&B.target){C=B.target;}if(C){n.listen(z,q,x,B,C,s);}}:function(B,C){if(!C&&B&&B.target){C=B.target; +}if(C){k(z,q,x,B,C);}};if(!r){r={};}r[s]={match:u,fn:o,delegator:A};t[p]=r;return f.call(this,v,A,n.capture);},removeEvent:function(r,n,t,u){var q=this.retrieve("$delegates",{}),p=q[r]; +if(!p){return this;}if(u){var m=r,w=p[u].delegator,l=a[r]||{};r=l.base||m;if(l.remove){l.remove(this,u);}delete p[u];q[m]=p;return j.call(this,r,w);}var o,v; +if(t){for(o in p){v=p[o];if(v.match==n&&v.fn==t){return g.removeEvent.call(this,r,n,t,o);}}}else{for(o in p){v=p[o];if(v.match==n){g.removeEvent.call(this,r,n,v.fn,o); +}}}return this;}};[Element,Window,Document].invoke("implement",{addEvent:e(f,g.addEvent),removeEvent:e(j,g.removeEvent)});})();(function(){var h=document.createElement("div"),e=document.createElement("div"); +h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName); +};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize(); +}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight}; +},getScroll:function(){if(a(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0}; +while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; +}var n=(k(m,"position")=="static")?i:l;while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; +}try{return m.offsetParent;}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); +return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; +m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); +m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){var q=this.getOffsets(),n=this.getScrolls(); +var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); +}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; +},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; +},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; +return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); +return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; +}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); +}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y; +},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x; +},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y; +},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; +this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; +this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e; +},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2); +});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); +this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; +this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; +}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); +}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); +}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); +},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; +return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; +}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; +o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); +break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; +j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; +}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); +}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); +}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; +}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); +}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}else{if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); +}}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; +if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; +if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); +return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); +this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); +Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(f){var e=this.options,c=this.response; +c.html=f.stripScripts(function(h){c.javascript=h;});var d=c.html.match(/]*>([\s\S]*?)<\/body>/i);if(d){c.html=d[1];}var b=new Element("div").set("html",c.html); +c.tree=b.childNodes;c.elements=b.getElements(e.filter||"*");if(e.filter){c.tree=c.elements;}if(e.update){var g=document.id(e.update).empty();if(e.filter){g.adopt(c.elements); +}else{g.set("html",c.html);}}else{if(e.append){var a=document.id(e.append);if(e.filter){c.elements.reverse().inject(a);}else{a.adopt(b.getChildren());}}}if(e.evalScripts){Browser.exec(c.javascript); +}this.onSuccess(c.tree,c.elements,c.html,c.javascript);}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this; +},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a);}return a; +}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));return this;}});if(typeof JSON=="undefined"){this.JSON={}; +}(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4); +};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); +return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); +}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; +Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; +case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); +}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); +};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); +},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); +}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; +this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; +}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; +}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); +return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); +Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); +};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a); +k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b); +if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h); +c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a); +}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this); +}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; +},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; +var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; +var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); +};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; +params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; +},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); +return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); +return eval(rs);};})(); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-core-1.4.4.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-core-1.4.4.js new file mode 100644 index 00000000000..c453119948a --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-core-1.4.4.js @@ -0,0 +1,5966 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0 + +packager build: + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + +... +*/ + +/* +--- + +name: Core + +description: The heart of MooTools. + +license: MIT-style license. + +copyright: Copyright (c) 2006-2012 [Valerio Proietti](http://mad4milk.net/). + +authors: The MooTools production team (http://mootools.net/developers/) + +inspiration: + - Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php) + - Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php) + +provides: [Core, MooTools, Type, typeOf, instanceOf, Native] + +... +*/ + +(function(){ + +this.MooTools = { + version: '1.4.4', + build: 'adb02e676407521b516ffa10d2dc6b54237a80f9' +}; + +// typeOf, instanceOf + +var typeOf = this.typeOf = function(item){ + if (item == null) return 'null'; + if (item.$family != null) return item.$family(); + + if (item.nodeName){ + if (item.nodeType == 1) return 'element'; + if (item.nodeType == 3) return (/\S/).test(item.nodeValue) ? 'textnode' : 'whitespace'; + } else if (typeof item.length == 'number'){ + if (item.callee) return 'arguments'; + if ('item' in item) return 'collection'; + } + + return typeof item; +}; + +var instanceOf = this.instanceOf = function(item, object){ + if (item == null) return false; + var constructor = item.$constructor || item.constructor; + while (constructor){ + if (constructor === object) return true; + constructor = constructor.parent; + } + /**/ + if (!item.hasOwnProperty) return false; + /**/ + return item instanceof object; +}; + +// Function overloading + +var Function = this.Function; + +var enumerables = true; +for (var i in {toString: 1}) enumerables = null; +if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor']; + +Function.prototype.overloadSetter = function(usePlural){ + var self = this; + return function(a, b){ + if (a == null) return this; + if (usePlural || typeof a != 'string'){ + for (var k in a) self.call(this, k, a[k]); + if (enumerables) for (var i = enumerables.length; i--;){ + k = enumerables[i]; + if (a.hasOwnProperty(k)) self.call(this, k, a[k]); + } + } else { + self.call(this, a, b); + } + return this; + }; +}; + +Function.prototype.overloadGetter = function(usePlural){ + var self = this; + return function(a){ + var args, result; + if (usePlural || typeof a != 'string') args = a; + else if (arguments.length > 1) args = arguments; + if (args){ + result = {}; + for (var i = 0; i < args.length; i++) result[args[i]] = self.call(this, args[i]); + } else { + result = self.call(this, a); + } + return result; + }; +}; + +Function.prototype.extend = function(key, value){ + this[key] = value; +}.overloadSetter(); + +Function.prototype.implement = function(key, value){ + this.prototype[key] = value; +}.overloadSetter(); + +// From + +var slice = Array.prototype.slice; + +Function.from = function(item){ + return (typeOf(item) == 'function') ? item : function(){ + return item; + }; +}; + +Array.from = function(item){ + if (item == null) return []; + return (Type.isEnumerable(item) && typeof item != 'string') ? (typeOf(item) == 'array') ? item : slice.call(item) : [item]; +}; + +Number.from = function(item){ + var number = parseFloat(item); + return isFinite(number) ? number : null; +}; + +String.from = function(item){ + return item + ''; +}; + +// hide, protect + +Function.implement({ + + hide: function(){ + this.$hidden = true; + return this; + }, + + protect: function(){ + this.$protected = true; + return this; + } + +}); + +// Type + +var Type = this.Type = function(name, object){ + if (name){ + var lower = name.toLowerCase(); + var typeCheck = function(item){ + return (typeOf(item) == lower); + }; + + Type['is' + name] = typeCheck; + if (object != null){ + object.prototype.$family = (function(){ + return lower; + }).hide(); + + } + } + + if (object == null) return null; + + object.extend(this); + object.$constructor = Type; + object.prototype.$constructor = object; + + return object; +}; + +var toString = Object.prototype.toString; + +Type.isEnumerable = function(item){ + return (item != null && typeof item.length == 'number' && toString.call(item) != '[object Function]' ); +}; + +var hooks = {}; + +var hooksOf = function(object){ + var type = typeOf(object.prototype); + return hooks[type] || (hooks[type] = []); +}; + +var implement = function(name, method){ + if (method && method.$hidden) return; + + var hooks = hooksOf(this); + + for (var i = 0; i < hooks.length; i++){ + var hook = hooks[i]; + if (typeOf(hook) == 'type') implement.call(hook, name, method); + else hook.call(this, name, method); + } + + var previous = this.prototype[name]; + if (previous == null || !previous.$protected) this.prototype[name] = method; + + if (this[name] == null && typeOf(method) == 'function') extend.call(this, name, function(item){ + return method.apply(item, slice.call(arguments, 1)); + }); +}; + +var extend = function(name, method){ + if (method && method.$hidden) return; + var previous = this[name]; + if (previous == null || !previous.$protected) this[name] = method; +}; + +Type.implement({ + + implement: implement.overloadSetter(), + + extend: extend.overloadSetter(), + + alias: function(name, existing){ + implement.call(this, name, this.prototype[existing]); + }.overloadSetter(), + + mirror: function(hook){ + hooksOf(this).push(hook); + return this; + } + +}); + +new Type('Type', Type); + +// Default Types + +var force = function(name, object, methods){ + var isType = (object != Object), + prototype = object.prototype; + + if (isType) object = new Type(name, object); + + for (var i = 0, l = methods.length; i < l; i++){ + var key = methods[i], + generic = object[key], + proto = prototype[key]; + + if (generic) generic.protect(); + if (isType && proto) object.implement(key, proto.protect()); + } + + if (isType){ + var methodsEnumerable = prototype.propertyIsEnumerable(methods[0]); + object.forEachMethod = function(fn){ + if (!methodsEnumerable) for (var i = 0, l = methods.length; i < l; i++){ + fn.call(prototype, prototype[methods[i]], methods[i]); + } + for (var key in prototype) fn.call(prototype, prototype[key], key) + }; + } + + return force; +}; + +force('String', String, [ + 'charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf', 'match', 'quote', 'replace', 'search', + 'slice', 'split', 'substr', 'substring', 'trim', 'toLowerCase', 'toUpperCase' +])('Array', Array, [ + 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice', + 'indexOf', 'lastIndexOf', 'filter', 'forEach', 'every', 'map', 'some', 'reduce', 'reduceRight' +])('Number', Number, [ + 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision' +])('Function', Function, [ + 'apply', 'call', 'bind' +])('RegExp', RegExp, [ + 'exec', 'test' +])('Object', Object, [ + 'create', 'defineProperty', 'defineProperties', 'keys', + 'getPrototypeOf', 'getOwnPropertyDescriptor', 'getOwnPropertyNames', + 'preventExtensions', 'isExtensible', 'seal', 'isSealed', 'freeze', 'isFrozen' +])('Date', Date, ['now']); + +Object.extend = extend.overloadSetter(); + +Date.extend('now', function(){ + return +(new Date); +}); + +new Type('Boolean', Boolean); + +// fixes NaN returning as Number + +Number.prototype.$family = function(){ + return isFinite(this) ? 'number' : 'null'; +}.hide(); + +// Number.random + +Number.extend('random', function(min, max){ + return Math.floor(Math.random() * (max - min + 1) + min); +}); + +// forEach, each + +var hasOwnProperty = Object.prototype.hasOwnProperty; +Object.extend('forEach', function(object, fn, bind){ + for (var key in object){ + if (hasOwnProperty.call(object, key)) fn.call(bind, object[key], key, object); + } +}); + +Object.each = Object.forEach; + +Array.implement({ + + forEach: function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++){ + if (i in this) fn.call(bind, this[i], i, this); + } + }, + + each: function(fn, bind){ + Array.forEach(this, fn, bind); + return this; + } + +}); + +// Array & Object cloning, Object merging and appending + +var cloneOf = function(item){ + switch (typeOf(item)){ + case 'array': return item.clone(); + case 'object': return Object.clone(item); + default: return item; + } +}; + +Array.implement('clone', function(){ + var i = this.length, clone = new Array(i); + while (i--) clone[i] = cloneOf(this[i]); + return clone; +}); + +var mergeOne = function(source, key, current){ + switch (typeOf(current)){ + case 'object': + if (typeOf(source[key]) == 'object') Object.merge(source[key], current); + else source[key] = Object.clone(current); + break; + case 'array': source[key] = current.clone(); break; + default: source[key] = current; + } + return source; +}; + +Object.extend({ + + merge: function(source, k, v){ + if (typeOf(k) == 'string') return mergeOne(source, k, v); + for (var i = 1, l = arguments.length; i < l; i++){ + var object = arguments[i]; + for (var key in object) mergeOne(source, key, object[key]); + } + return source; + }, + + clone: function(object){ + var clone = {}; + for (var key in object) clone[key] = cloneOf(object[key]); + return clone; + }, + + append: function(original){ + for (var i = 1, l = arguments.length; i < l; i++){ + var extended = arguments[i] || {}; + for (var key in extended) original[key] = extended[key]; + } + return original; + } + +}); + +// Object-less types + +['Object', 'WhiteSpace', 'TextNode', 'Collection', 'Arguments'].each(function(name){ + new Type(name); +}); + +// Unique ID + +var UID = Date.now(); + +String.extend('uniqueID', function(){ + return (UID++).toString(36); +}); + + + +})(); + + +/* +--- + +name: Array + +description: Contains Array Prototypes like each, contains, and erase. + +license: MIT-style license. + +requires: Type + +provides: Array + +... +*/ + +Array.implement({ + + /**/ + every: function(fn, bind){ + for (var i = 0, l = this.length >>> 0; i < l; i++){ + if ((i in this) && !fn.call(bind, this[i], i, this)) return false; + } + return true; + }, + + filter: function(fn, bind){ + var results = []; + for (var value, i = 0, l = this.length >>> 0; i < l; i++) if (i in this){ + value = this[i]; + if (fn.call(bind, value, i, this)) results.push(value); + } + return results; + }, + + indexOf: function(item, from){ + var length = this.length >>> 0; + for (var i = (from < 0) ? Math.max(0, length + from) : from || 0; i < length; i++){ + if (this[i] === item) return i; + } + return -1; + }, + + map: function(fn, bind){ + var length = this.length >>> 0, results = Array(length); + for (var i = 0; i < length; i++){ + if (i in this) results[i] = fn.call(bind, this[i], i, this); + } + return results; + }, + + some: function(fn, bind){ + for (var i = 0, l = this.length >>> 0; i < l; i++){ + if ((i in this) && fn.call(bind, this[i], i, this)) return true; + } + return false; + }, + /**/ + + clean: function(){ + return this.filter(function(item){ + return item != null; + }); + }, + + invoke: function(methodName){ + var args = Array.slice(arguments, 1); + return this.map(function(item){ + return item[methodName].apply(item, args); + }); + }, + + associate: function(keys){ + var obj = {}, length = Math.min(this.length, keys.length); + for (var i = 0; i < length; i++) obj[keys[i]] = this[i]; + return obj; + }, + + link: function(object){ + var result = {}; + for (var i = 0, l = this.length; i < l; i++){ + for (var key in object){ + if (object[key](this[i])){ + result[key] = this[i]; + delete object[key]; + break; + } + } + } + return result; + }, + + contains: function(item, from){ + return this.indexOf(item, from) != -1; + }, + + append: function(array){ + this.push.apply(this, array); + return this; + }, + + getLast: function(){ + return (this.length) ? this[this.length - 1] : null; + }, + + getRandom: function(){ + return (this.length) ? this[Number.random(0, this.length - 1)] : null; + }, + + include: function(item){ + if (!this.contains(item)) this.push(item); + return this; + }, + + combine: function(array){ + for (var i = 0, l = array.length; i < l; i++) this.include(array[i]); + return this; + }, + + erase: function(item){ + for (var i = this.length; i--;){ + if (this[i] === item) this.splice(i, 1); + } + return this; + }, + + empty: function(){ + this.length = 0; + return this; + }, + + flatten: function(){ + var array = []; + for (var i = 0, l = this.length; i < l; i++){ + var type = typeOf(this[i]); + if (type == 'null') continue; + array = array.concat((type == 'array' || type == 'collection' || type == 'arguments' || instanceOf(this[i], Array)) ? Array.flatten(this[i]) : this[i]); + } + return array; + }, + + pick: function(){ + for (var i = 0, l = this.length; i < l; i++){ + if (this[i] != null) return this[i]; + } + return null; + }, + + hexToRgb: function(array){ + if (this.length != 3) return null; + var rgb = this.map(function(value){ + if (value.length == 1) value += value; + return value.toInt(16); + }); + return (array) ? rgb : 'rgb(' + rgb + ')'; + }, + + rgbToHex: function(array){ + if (this.length < 3) return null; + if (this.length == 4 && this[3] == 0 && !array) return 'transparent'; + var hex = []; + for (var i = 0; i < 3; i++){ + var bit = (this[i] - 0).toString(16); + hex.push((bit.length == 1) ? '0' + bit : bit); + } + return (array) ? hex : '#' + hex.join(''); + } + +}); + + + + +/* +--- + +name: String + +description: Contains String Prototypes like camelCase, capitalize, test, and toInt. + +license: MIT-style license. + +requires: Type + +provides: String + +... +*/ + +String.implement({ + + test: function(regex, params){ + return ((typeOf(regex) == 'regexp') ? regex : new RegExp('' + regex, params)).test(this); + }, + + contains: function(string, separator){ + return (separator) ? (separator + this + separator).indexOf(separator + string + separator) > -1 : String(this).indexOf(string) > -1; + }, + + trim: function(){ + return String(this).replace(/^\s+|\s+$/g, ''); + }, + + clean: function(){ + return String(this).replace(/\s+/g, ' ').trim(); + }, + + camelCase: function(){ + return String(this).replace(/-\D/g, function(match){ + return match.charAt(1).toUpperCase(); + }); + }, + + hyphenate: function(){ + return String(this).replace(/[A-Z]/g, function(match){ + return ('-' + match.charAt(0).toLowerCase()); + }); + }, + + capitalize: function(){ + return String(this).replace(/\b[a-z]/g, function(match){ + return match.toUpperCase(); + }); + }, + + escapeRegExp: function(){ + return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); + }, + + toInt: function(base){ + return parseInt(this, base || 10); + }, + + toFloat: function(){ + return parseFloat(this); + }, + + hexToRgb: function(array){ + var hex = String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); + return (hex) ? hex.slice(1).hexToRgb(array) : null; + }, + + rgbToHex: function(array){ + var rgb = String(this).match(/\d{1,3}/g); + return (rgb) ? rgb.rgbToHex(array) : null; + }, + + substitute: function(object, regexp){ + return String(this).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){ + if (match.charAt(0) == '\\') return match.slice(1); + return (object[name] != null) ? object[name] : ''; + }); + } + +}); + + +/* +--- + +name: Number + +description: Contains Number Prototypes like limit, round, times, and ceil. + +license: MIT-style license. + +requires: Type + +provides: Number + +... +*/ + +Number.implement({ + + limit: function(min, max){ + return Math.min(max, Math.max(min, this)); + }, + + round: function(precision){ + precision = Math.pow(10, precision || 0).toFixed(precision < 0 ? -precision : 0); + return Math.round(this * precision) / precision; + }, + + times: function(fn, bind){ + for (var i = 0; i < this; i++) fn.call(bind, i, this); + }, + + toFloat: function(){ + return parseFloat(this); + }, + + toInt: function(base){ + return parseInt(this, base || 10); + } + +}); + +Number.alias('each', 'times'); + +(function(math){ + var methods = {}; + math.each(function(name){ + if (!Number[name]) methods[name] = function(){ + return Math[name].apply(null, [this].concat(Array.from(arguments))); + }; + }); + Number.implement(methods); +})(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']); + + +/* +--- + +name: Function + +description: Contains Function Prototypes like create, bind, pass, and delay. + +license: MIT-style license. + +requires: Type + +provides: Function + +... +*/ + +Function.extend({ + + attempt: function(){ + for (var i = 0, l = arguments.length; i < l; i++){ + try { + return arguments[i](); + } catch (e){} + } + return null; + } + +}); + +Function.implement({ + + attempt: function(args, bind){ + try { + return this.apply(bind, Array.from(args)); + } catch (e){} + + return null; + }, + + /**/ + bind: function(that){ + var self = this, + args = arguments.length > 1 ? Array.slice(arguments, 1) : null, + F = function(){}; + + var bound = function(){ + var context = that, length = arguments.length; + if (this instanceof bound){ + F.prototype = self.prototype; + context = new F; + } + var result = (!args && !length) + ? self.call(context) + : self.apply(context, args && length ? args.concat(Array.slice(arguments)) : args || arguments); + return context == that ? result : context; + }; + return bound; + }, + /**/ + + pass: function(args, bind){ + var self = this; + if (args != null) args = Array.from(args); + return function(){ + return self.apply(bind, args || arguments); + }; + }, + + delay: function(delay, bind, args){ + return setTimeout(this.pass((args == null ? [] : args), bind), delay); + }, + + periodical: function(periodical, bind, args){ + return setInterval(this.pass((args == null ? [] : args), bind), periodical); + } + +}); + + + + +/* +--- + +name: Object + +description: Object generic methods + +license: MIT-style license. + +requires: Type + +provides: [Object, Hash] + +... +*/ + +(function(){ + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +Object.extend({ + + subset: function(object, keys){ + var results = {}; + for (var i = 0, l = keys.length; i < l; i++){ + var k = keys[i]; + if (k in object) results[k] = object[k]; + } + return results; + }, + + map: function(object, fn, bind){ + var results = {}; + for (var key in object){ + if (hasOwnProperty.call(object, key)) results[key] = fn.call(bind, object[key], key, object); + } + return results; + }, + + filter: function(object, fn, bind){ + var results = {}; + for (var key in object){ + var value = object[key]; + if (hasOwnProperty.call(object, key) && fn.call(bind, value, key, object)) results[key] = value; + } + return results; + }, + + every: function(object, fn, bind){ + for (var key in object){ + if (hasOwnProperty.call(object, key) && !fn.call(bind, object[key], key)) return false; + } + return true; + }, + + some: function(object, fn, bind){ + for (var key in object){ + if (hasOwnProperty.call(object, key) && fn.call(bind, object[key], key)) return true; + } + return false; + }, + + keys: function(object){ + var keys = []; + for (var key in object){ + if (hasOwnProperty.call(object, key)) keys.push(key); + } + return keys; + }, + + values: function(object){ + var values = []; + for (var key in object){ + if (hasOwnProperty.call(object, key)) values.push(object[key]); + } + return values; + }, + + getLength: function(object){ + return Object.keys(object).length; + }, + + keyOf: function(object, value){ + for (var key in object){ + if (hasOwnProperty.call(object, key) && object[key] === value) return key; + } + return null; + }, + + contains: function(object, value){ + return Object.keyOf(object, value) != null; + }, + + toQueryString: function(object, base){ + var queryString = []; + + Object.each(object, function(value, key){ + if (base) key = base + '[' + key + ']'; + var result; + switch (typeOf(value)){ + case 'object': result = Object.toQueryString(value, key); break; + case 'array': + var qs = {}; + value.each(function(val, i){ + qs[i] = val; + }); + result = Object.toQueryString(qs, key); + break; + default: result = key + '=' + encodeURIComponent(value); + } + if (value != null) queryString.push(result); + }); + + return queryString.join('&'); + } + +}); + +})(); + + + + +/* +--- + +name: Browser + +description: The Browser Object. Contains Browser initialization, Window and Document, and the Browser Hash. + +license: MIT-style license. + +requires: [Array, Function, Number, String] + +provides: [Browser, Window, Document] + +... +*/ + +(function(){ + +var document = this.document; +var window = document.window = this; + +var ua = navigator.userAgent.toLowerCase(), + platform = navigator.platform.toLowerCase(), + UA = ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/) || [null, 'unknown', 0], + mode = UA[1] == 'ie' && document.documentMode; + +var Browser = this.Browser = { + + extend: Function.prototype.extend, + + name: (UA[1] == 'version') ? UA[3] : UA[1], + + version: mode || parseFloat((UA[1] == 'opera' && UA[4]) ? UA[4] : UA[2]), + + Platform: { + name: ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || platform.match(/mac|win|linux/) || ['other'])[0] + }, + + Features: { + xpath: !!(document.evaluate), + air: !!(window.runtime), + query: !!(document.querySelector), + json: !!(window.JSON) + }, + + Plugins: {} + +}; + +Browser[Browser.name] = true; +Browser[Browser.name + parseInt(Browser.version, 10)] = true; +Browser.Platform[Browser.Platform.name] = true; + +// Request + +Browser.Request = (function(){ + + var XMLHTTP = function(){ + return new XMLHttpRequest(); + }; + + var MSXML2 = function(){ + return new ActiveXObject('MSXML2.XMLHTTP'); + }; + + var MSXML = function(){ + return new ActiveXObject('Microsoft.XMLHTTP'); + }; + + return Function.attempt(function(){ + XMLHTTP(); + return XMLHTTP; + }, function(){ + MSXML2(); + return MSXML2; + }, function(){ + MSXML(); + return MSXML; + }); + +})(); + +Browser.Features.xhr = !!(Browser.Request); + +// Flash detection + +var version = (Function.attempt(function(){ + return navigator.plugins['Shockwave Flash'].description; +}, function(){ + return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version'); +}) || '0 r0').match(/\d+/g); + +Browser.Plugins.Flash = { + version: Number(version[0] || '0.' + version[1]) || 0, + build: Number(version[2]) || 0 +}; + +// String scripts + +Browser.exec = function(text){ + if (!text) return text; + if (window.execScript){ + window.execScript(text); + } else { + var script = document.createElement('script'); + script.setAttribute('type', 'text/javascript'); + script.text = text; + document.head.appendChild(script); + document.head.removeChild(script); + } + return text; +}; + +String.implement('stripScripts', function(exec){ + var scripts = ''; + var text = this.replace(/]*>([\s\S]*?)<\/script>/gi, function(all, code){ + scripts += code + '\n'; + return ''; + }); + if (exec === true) Browser.exec(scripts); + else if (typeOf(exec) == 'function') exec(scripts, text); + return text; +}); + +// Window, Document + +Browser.extend({ + Document: this.Document, + Window: this.Window, + Element: this.Element, + Event: this.Event +}); + +this.Window = this.$constructor = new Type('Window', function(){}); + +this.$family = Function.from('window').hide(); + +Window.mirror(function(name, method){ + window[name] = method; +}); + +this.Document = document.$constructor = new Type('Document', function(){}); + +document.$family = Function.from('document').hide(); + +Document.mirror(function(name, method){ + document[name] = method; +}); + +document.html = document.documentElement; +if (!document.head) document.head = document.getElementsByTagName('head')[0]; + +if (document.execCommand) try { + document.execCommand("BackgroundImageCache", false, true); +} catch (e){} + +/**/ +if (this.attachEvent && !this.addEventListener){ + var unloadEvent = function(){ + this.detachEvent('onunload', unloadEvent); + document.head = document.html = document.window = null; + }; + this.attachEvent('onunload', unloadEvent); +} + +// IE fails on collections and ) +var arrayFrom = Array.from; +try { + arrayFrom(document.html.childNodes); +} catch(e){ + Array.from = function(item){ + if (typeof item != 'string' && Type.isEnumerable(item) && typeOf(item) != 'array'){ + var i = item.length, array = new Array(i); + while (i--) array[i] = item[i]; + return array; + } + return arrayFrom(item); + }; + + var prototype = Array.prototype, + slice = prototype.slice; + ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice'].each(function(name){ + var method = prototype[name]; + Array[name] = function(item){ + return method.apply(Array.from(item), slice.call(arguments, 1)); + }; + }); +} +/**/ + + + +})(); + + +/* +--- + +name: Event + +description: Contains the Event Type, to make the event object cross-browser. + +license: MIT-style license. + +requires: [Window, Document, Array, Function, String, Object] + +provides: Event + +... +*/ + +(function() { + +var _keys = {}; + +var DOMEvent = this.DOMEvent = new Type('DOMEvent', function(event, win){ + if (!win) win = window; + event = event || win.event; + if (event.$extended) return event; + this.event = event; + this.$extended = true; + this.shift = event.shiftKey; + this.control = event.ctrlKey; + this.alt = event.altKey; + this.meta = event.metaKey; + var type = this.type = event.type; + var target = event.target || event.srcElement; + while (target && target.nodeType == 3) target = target.parentNode; + this.target = document.id(target); + + if (type.indexOf('key') == 0){ + var code = this.code = (event.which || event.keyCode); + this.key = _keys[code]; + if (type == 'keydown'){ + if (code > 111 && code < 124) this.key = 'f' + (code - 111); + else if (code > 95 && code < 106) this.key = code - 96; + } + if (this.key == null) this.key = String.fromCharCode(code).toLowerCase(); + } else if (type == 'click' || type == 'dblclick' || type == 'contextmenu' || type == 'DOMMouseScroll' || type.indexOf('mouse') == 0){ + var doc = win.document; + doc = (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body; + this.page = { + x: (event.pageX != null) ? event.pageX : event.clientX + doc.scrollLeft, + y: (event.pageY != null) ? event.pageY : event.clientY + doc.scrollTop + }; + this.client = { + x: (event.pageX != null) ? event.pageX - win.pageXOffset : event.clientX, + y: (event.pageY != null) ? event.pageY - win.pageYOffset : event.clientY + }; + if (type == 'DOMMouseScroll' || type == 'mousewheel') + this.wheel = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3; + + this.rightClick = (event.which == 3 || event.button == 2); + if (type == 'mouseover' || type == 'mouseout'){ + var related = event.relatedTarget || event[(type == 'mouseover' ? 'from' : 'to') + 'Element']; + while (related && related.nodeType == 3) related = related.parentNode; + this.relatedTarget = document.id(related); + } + } else if (type.indexOf('touch') == 0 || type.indexOf('gesture') == 0){ + this.rotation = event.rotation; + this.scale = event.scale; + this.targetTouches = event.targetTouches; + this.changedTouches = event.changedTouches; + var touches = this.touches = event.touches; + if (touches && touches[0]){ + var touch = touches[0]; + this.page = {x: touch.pageX, y: touch.pageY}; + this.client = {x: touch.clientX, y: touch.clientY}; + } + } + + if (!this.client) this.client = {}; + if (!this.page) this.page = {}; +}); + +DOMEvent.implement({ + + stop: function(){ + return this.preventDefault().stopPropagation(); + }, + + stopPropagation: function(){ + if (this.event.stopPropagation) this.event.stopPropagation(); + else this.event.cancelBubble = true; + return this; + }, + + preventDefault: function(){ + if (this.event.preventDefault) this.event.preventDefault(); + else this.event.returnValue = false; + return this; + } + +}); + +DOMEvent.defineKey = function(code, key){ + _keys[code] = key; + return this; +}; + +DOMEvent.defineKeys = DOMEvent.defineKey.overloadSetter(true); + +DOMEvent.defineKeys({ + '38': 'up', '40': 'down', '37': 'left', '39': 'right', + '27': 'esc', '32': 'space', '8': 'backspace', '9': 'tab', + '46': 'delete', '13': 'enter' +}); + +})(); + + + + + + +/* +--- + +name: Class + +description: Contains the Class Function for easily creating, extending, and implementing reusable Classes. + +license: MIT-style license. + +requires: [Array, String, Function, Number] + +provides: Class + +... +*/ + +(function(){ + +var Class = this.Class = new Type('Class', function(params){ + if (instanceOf(params, Function)) params = {initialize: params}; + + var newClass = function(){ + reset(this); + if (newClass.$prototyping) return this; + this.$caller = null; + var value = (this.initialize) ? this.initialize.apply(this, arguments) : this; + this.$caller = this.caller = null; + return value; + }.extend(this).implement(params); + + newClass.$constructor = Class; + newClass.prototype.$constructor = newClass; + newClass.prototype.parent = parent; + + return newClass; +}); + +var parent = function(){ + if (!this.$caller) throw new Error('The method "parent" cannot be called.'); + var name = this.$caller.$name, + parent = this.$caller.$owner.parent, + previous = (parent) ? parent.prototype[name] : null; + if (!previous) throw new Error('The method "' + name + '" has no parent.'); + return previous.apply(this, arguments); +}; + +var reset = function(object){ + for (var key in object){ + var value = object[key]; + switch (typeOf(value)){ + case 'object': + var F = function(){}; + F.prototype = value; + object[key] = reset(new F); + break; + case 'array': object[key] = value.clone(); break; + } + } + return object; +}; + +var wrap = function(self, key, method){ + if (method.$origin) method = method.$origin; + var wrapper = function(){ + if (method.$protected && this.$caller == null) throw new Error('The method "' + key + '" cannot be called.'); + var caller = this.caller, current = this.$caller; + this.caller = current; this.$caller = wrapper; + var result = method.apply(this, arguments); + this.$caller = current; this.caller = caller; + return result; + }.extend({$owner: self, $origin: method, $name: key}); + return wrapper; +}; + +var implement = function(key, value, retain){ + if (Class.Mutators.hasOwnProperty(key)){ + value = Class.Mutators[key].call(this, value); + if (value == null) return this; + } + + if (typeOf(value) == 'function'){ + if (value.$hidden) return this; + this.prototype[key] = (retain) ? value : wrap(this, key, value); + } else { + Object.merge(this.prototype, key, value); + } + + return this; +}; + +var getInstance = function(klass){ + klass.$prototyping = true; + var proto = new klass; + delete klass.$prototyping; + return proto; +}; + +Class.implement('implement', implement.overloadSetter()); + +Class.Mutators = { + + Extends: function(parent){ + this.parent = parent; + this.prototype = getInstance(parent); + }, + + Implements: function(items){ + Array.from(items).each(function(item){ + var instance = new item; + for (var key in instance) implement.call(this, key, instance[key], true); + }, this); + } +}; + +})(); + + +/* +--- + +name: Class.Extras + +description: Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks. + +license: MIT-style license. + +requires: Class + +provides: [Class.Extras, Chain, Events, Options] + +... +*/ + +(function(){ + +this.Chain = new Class({ + + $chain: [], + + chain: function(){ + this.$chain.append(Array.flatten(arguments)); + return this; + }, + + callChain: function(){ + return (this.$chain.length) ? this.$chain.shift().apply(this, arguments) : false; + }, + + clearChain: function(){ + this.$chain.empty(); + return this; + } + +}); + +var removeOn = function(string){ + return string.replace(/^on([A-Z])/, function(full, first){ + return first.toLowerCase(); + }); +}; + +this.Events = new Class({ + + $events: {}, + + addEvent: function(type, fn, internal){ + type = removeOn(type); + + + + this.$events[type] = (this.$events[type] || []).include(fn); + if (internal) fn.internal = true; + return this; + }, + + addEvents: function(events){ + for (var type in events) this.addEvent(type, events[type]); + return this; + }, + + fireEvent: function(type, args, delay){ + type = removeOn(type); + var events = this.$events[type]; + if (!events) return this; + args = Array.from(args); + events.each(function(fn){ + if (delay) fn.delay(delay, this, args); + else fn.apply(this, args); + }, this); + return this; + }, + + removeEvent: function(type, fn){ + type = removeOn(type); + var events = this.$events[type]; + if (events && !fn.internal){ + var index = events.indexOf(fn); + if (index != -1) delete events[index]; + } + return this; + }, + + removeEvents: function(events){ + var type; + if (typeOf(events) == 'object'){ + for (type in events) this.removeEvent(type, events[type]); + return this; + } + if (events) events = removeOn(events); + for (type in this.$events){ + if (events && events != type) continue; + var fns = this.$events[type]; + for (var i = fns.length; i--;) if (i in fns){ + this.removeEvent(type, fns[i]); + } + } + return this; + } + +}); + +this.Options = new Class({ + + setOptions: function(){ + var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments)); + if (this.addEvent) for (var option in options){ + if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue; + this.addEvent(option, options[option]); + delete options[option]; + } + return this; + } + +}); + +})(); + + +/* +--- +name: Slick.Parser +description: Standalone CSS3 Selector parser +provides: Slick.Parser +... +*/ + +;(function(){ + +var parsed, + separatorIndex, + combinatorIndex, + reversed, + cache = {}, + reverseCache = {}, + reUnescape = /\\/g; + +var parse = function(expression, isReversed){ + if (expression == null) return null; + if (expression.Slick === true) return expression; + expression = ('' + expression).replace(/^\s+|\s+$/g, ''); + reversed = !!isReversed; + var currentCache = (reversed) ? reverseCache : cache; + if (currentCache[expression]) return currentCache[expression]; + parsed = { + Slick: true, + expressions: [], + raw: expression, + reverse: function(){ + return parse(this.raw, true); + } + }; + separatorIndex = -1; + while (expression != (expression = expression.replace(regexp, parser))); + parsed.length = parsed.expressions.length; + return currentCache[parsed.raw] = (reversed) ? reverse(parsed) : parsed; +}; + +var reverseCombinator = function(combinator){ + if (combinator === '!') return ' '; + else if (combinator === ' ') return '!'; + else if ((/^!/).test(combinator)) return combinator.replace(/^!/, ''); + else return '!' + combinator; +}; + +var reverse = function(expression){ + var expressions = expression.expressions; + for (var i = 0; i < expressions.length; i++){ + var exp = expressions[i]; + var last = {parts: [], tag: '*', combinator: reverseCombinator(exp[0].combinator)}; + + for (var j = 0; j < exp.length; j++){ + var cexp = exp[j]; + if (!cexp.reverseCombinator) cexp.reverseCombinator = ' '; + cexp.combinator = cexp.reverseCombinator; + delete cexp.reverseCombinator; + } + + exp.reverse().push(last); + } + return expression; +}; + +var escapeRegExp = function(string){// Credit: XRegExp 0.6.1 (c) 2007-2008 Steven Levithan MIT License + return string.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, function(match){ + return '\\' + match; + }); +}; + +var regexp = new RegExp( +/* +#!/usr/bin/env ruby +puts "\t\t" + DATA.read.gsub(/\(\?x\)|\s+#.*$|\s+|\\$|\\n/,'') +__END__ + "(?x)^(?:\ + \\s* ( , ) \\s* # Separator \n\ + | \\s* ( + ) \\s* # Combinator \n\ + | ( \\s+ ) # CombinatorChildren \n\ + | ( + | \\* ) # Tag \n\ + | \\# ( + ) # ID \n\ + | \\. ( + ) # ClassName \n\ + | # Attribute \n\ + \\[ \ + \\s* (+) (?: \ + \\s* ([*^$!~|]?=) (?: \ + \\s* (?:\ + ([\"']?)(.*?)\\9 \ + )\ + ) \ + )? \\s* \ + \\](?!\\]) \n\ + | :+ ( + )(?:\ + \\( (?:\ + (?:([\"'])([^\\12]*)\\12)|((?:\\([^)]+\\)|[^()]*)+)\ + ) \\)\ + )?\ + )" +*/ + "^(?:\\s*(,)\\s*|\\s*(+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)" + .replace(//, '[' + escapeRegExp(">+~`!@$%^&={}\\;/g, '(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') + .replace(//g, '(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])') +); + +function parser( + rawMatch, + + separator, + combinator, + combinatorChildren, + + tagName, + id, + className, + + attributeKey, + attributeOperator, + attributeQuote, + attributeValue, + + pseudoMarker, + pseudoClass, + pseudoQuote, + pseudoClassQuotedValue, + pseudoClassValue +){ + if (separator || separatorIndex === -1){ + parsed.expressions[++separatorIndex] = []; + combinatorIndex = -1; + if (separator) return ''; + } + + if (combinator || combinatorChildren || combinatorIndex === -1){ + combinator = combinator || ' '; + var currentSeparator = parsed.expressions[separatorIndex]; + if (reversed && currentSeparator[combinatorIndex]) + currentSeparator[combinatorIndex].reverseCombinator = reverseCombinator(combinator); + currentSeparator[++combinatorIndex] = {combinator: combinator, tag: '*'}; + } + + var currentParsed = parsed.expressions[separatorIndex][combinatorIndex]; + + if (tagName){ + currentParsed.tag = tagName.replace(reUnescape, ''); + + } else if (id){ + currentParsed.id = id.replace(reUnescape, ''); + + } else if (className){ + className = className.replace(reUnescape, ''); + + if (!currentParsed.classList) currentParsed.classList = []; + if (!currentParsed.classes) currentParsed.classes = []; + currentParsed.classList.push(className); + currentParsed.classes.push({ + value: className, + regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)') + }); + + } else if (pseudoClass){ + pseudoClassValue = pseudoClassValue || pseudoClassQuotedValue; + pseudoClassValue = pseudoClassValue ? pseudoClassValue.replace(reUnescape, '') : null; + + if (!currentParsed.pseudos) currentParsed.pseudos = []; + currentParsed.pseudos.push({ + key: pseudoClass.replace(reUnescape, ''), + value: pseudoClassValue, + type: pseudoMarker.length == 1 ? 'class' : 'element' + }); + + } else if (attributeKey){ + attributeKey = attributeKey.replace(reUnescape, ''); + attributeValue = (attributeValue || '').replace(reUnescape, ''); + + var test, regexp; + + switch (attributeOperator){ + case '^=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) ); break; + case '$=' : regexp = new RegExp( escapeRegExp(attributeValue) +'$' ); break; + case '~=' : regexp = new RegExp( '(^|\\s)'+ escapeRegExp(attributeValue) +'(\\s|$)' ); break; + case '|=' : regexp = new RegExp( '^'+ escapeRegExp(attributeValue) +'(-|$)' ); break; + case '=' : test = function(value){ + return attributeValue == value; + }; break; + case '*=' : test = function(value){ + return value && value.indexOf(attributeValue) > -1; + }; break; + case '!=' : test = function(value){ + return attributeValue != value; + }; break; + default : test = function(value){ + return !!value; + }; + } + + if (attributeValue == '' && (/^[*$^]=$/).test(attributeOperator)) test = function(){ + return false; + }; + + if (!test) test = function(value){ + return value && regexp.test(value); + }; + + if (!currentParsed.attributes) currentParsed.attributes = []; + currentParsed.attributes.push({ + key: attributeKey, + operator: attributeOperator, + value: attributeValue, + test: test + }); + + } + + return ''; +}; + +// Slick NS + +var Slick = (this.Slick || {}); + +Slick.parse = function(expression){ + return parse(expression); +}; + +Slick.escapeRegExp = escapeRegExp; + +if (!this.Slick) this.Slick = Slick; + +}).apply(/**/(typeof exports != 'undefined') ? exports : /**/this); + + +/* +--- +name: Slick.Finder +description: The new, superfast css selector engine. +provides: Slick.Finder +requires: Slick.Parser +... +*/ + +;(function(){ + +var local = {}, + featuresCache = {}, + toString = Object.prototype.toString; + +// Feature / Bug detection + +local.isNativeCode = function(fn){ + return (/\{\s*\[native code\]\s*\}/).test('' + fn); +}; + +local.isXML = function(document){ + return (!!document.xmlVersion) || (!!document.xml) || (toString.call(document) == '[object XMLDocument]') || + (document.nodeType == 9 && document.documentElement.nodeName != 'HTML'); +}; + +local.setDocument = function(document){ + + // convert elements / window arguments to document. if document cannot be extrapolated, the function returns. + var nodeType = document.nodeType; + if (nodeType == 9); // document + else if (nodeType) document = document.ownerDocument; // node + else if (document.navigator) document = document.document; // window + else return; + + // check if it's the old document + + if (this.document === document) return; + this.document = document; + + // check if we have done feature detection on this document before + + var root = document.documentElement, + rootUid = this.getUIDXML(root), + features = featuresCache[rootUid], + feature; + + if (features){ + for (feature in features){ + this[feature] = features[feature]; + } + return; + } + + features = featuresCache[rootUid] = {}; + + features.root = root; + features.isXMLDocument = this.isXML(document); + + features.brokenStarGEBTN + = features.starSelectsClosedQSA + = features.idGetsName + = features.brokenMixedCaseQSA + = features.brokenGEBCN + = features.brokenCheckedQSA + = features.brokenEmptyAttributeQSA + = features.isHTMLDocument + = features.nativeMatchesSelector + = false; + + var starSelectsClosed, starSelectsComments, + brokenSecondClassNameGEBCN, cachedGetElementsByClassName, + brokenFormAttributeGetter; + + var selected, id = 'slick_uniqueid'; + var testNode = document.createElement('div'); + + var testRoot = document.body || document.getElementsByTagName('body')[0] || root; + testRoot.appendChild(testNode); + + // on non-HTML documents innerHTML and getElementsById doesnt work properly + try { + testNode.innerHTML = ''; + features.isHTMLDocument = !!document.getElementById(id); + } catch(e){}; + + if (features.isHTMLDocument){ + + testNode.style.display = 'none'; + + // IE returns comment nodes for getElementsByTagName('*') for some documents + testNode.appendChild(document.createComment('')); + starSelectsComments = (testNode.getElementsByTagName('*').length > 1); + + // IE returns closed nodes (EG:"") for getElementsByTagName('*') for some documents + try { + testNode.innerHTML = 'foo'; + selected = testNode.getElementsByTagName('*'); + starSelectsClosed = (selected && !!selected.length && selected[0].nodeName.charAt(0) == '/'); + } catch(e){}; + + features.brokenStarGEBTN = starSelectsComments || starSelectsClosed; + + // IE returns elements with the name instead of just id for getElementsById for some documents + try { + testNode.innerHTML = ''; + features.idGetsName = document.getElementById(id) === testNode.firstChild; + } catch(e){}; + + if (testNode.getElementsByClassName){ + + // Safari 3.2 getElementsByClassName caches results + try { + testNode.innerHTML = ''; + testNode.getElementsByClassName('b').length; + testNode.firstChild.className = 'b'; + cachedGetElementsByClassName = (testNode.getElementsByClassName('b').length != 2); + } catch(e){}; + + // Opera 9.6 getElementsByClassName doesnt detects the class if its not the first one + try { + testNode.innerHTML = ''; + brokenSecondClassNameGEBCN = (testNode.getElementsByClassName('a').length != 2); + } catch(e){}; + + features.brokenGEBCN = cachedGetElementsByClassName || brokenSecondClassNameGEBCN; + } + + if (testNode.querySelectorAll){ + // IE 8 returns closed nodes (EG:"") for querySelectorAll('*') for some documents + try { + testNode.innerHTML = 'foo'; + selected = testNode.querySelectorAll('*'); + features.starSelectsClosedQSA = (selected && !!selected.length && selected[0].nodeName.charAt(0) == '/'); + } catch(e){}; + + // Safari 3.2 querySelectorAll doesnt work with mixedcase on quirksmode + try { + testNode.innerHTML = ''; + features.brokenMixedCaseQSA = !testNode.querySelectorAll('.MiX').length; + } catch(e){}; + + // Webkit and Opera dont return selected options on querySelectorAll + try { + testNode.innerHTML = ''; + features.brokenCheckedQSA = (testNode.querySelectorAll(':checked').length == 0); + } catch(e){}; + + // IE returns incorrect results for attr[*^$]="" selectors on querySelectorAll + try { + testNode.innerHTML = ''; + features.brokenEmptyAttributeQSA = (testNode.querySelectorAll('[class*=""]').length != 0); + } catch(e){}; + + } + + // IE6-7, if a form has an input of id x, form.getAttribute(x) returns a reference to the input + try { + testNode.innerHTML = '
    '; + brokenFormAttributeGetter = (testNode.firstChild.getAttribute('action') != 's'); + } catch(e){}; + + // native matchesSelector function + + features.nativeMatchesSelector = root.matchesSelector || /*root.msMatchesSelector ||*/ root.mozMatchesSelector || root.webkitMatchesSelector; + if (features.nativeMatchesSelector) try { + // if matchesSelector trows errors on incorrect sintaxes we can use it + features.nativeMatchesSelector.call(root, ':slick'); + features.nativeMatchesSelector = null; + } catch(e){}; + + } + + try { + root.slick_expando = 1; + delete root.slick_expando; + features.getUID = this.getUIDHTML; + } catch(e) { + features.getUID = this.getUIDXML; + } + + testRoot.removeChild(testNode); + testNode = selected = testRoot = null; + + // getAttribute + + features.getAttribute = (features.isHTMLDocument && brokenFormAttributeGetter) ? function(node, name){ + var method = this.attributeGetters[name]; + if (method) return method.call(node); + var attributeNode = node.getAttributeNode(name); + return (attributeNode) ? attributeNode.nodeValue : null; + } : function(node, name){ + var method = this.attributeGetters[name]; + return (method) ? method.call(node) : node.getAttribute(name); + }; + + // hasAttribute + + features.hasAttribute = (root && this.isNativeCode(root.hasAttribute)) ? function(node, attribute) { + return node.hasAttribute(attribute); + } : function(node, attribute) { + node = node.getAttributeNode(attribute); + return !!(node && (node.specified || node.nodeValue)); + }; + + // contains + // FIXME: Add specs: local.contains should be different for xml and html documents? + var nativeRootContains = root && this.isNativeCode(root.contains), + nativeDocumentContains = document && this.isNativeCode(document.contains); + + features.contains = (nativeRootContains && nativeDocumentContains) ? function(context, node){ + return context.contains(node); + } : (nativeRootContains && !nativeDocumentContains) ? function(context, node){ + // IE8 does not have .contains on document. + return context === node || ((context === document) ? document.documentElement : context).contains(node); + } : (root && root.compareDocumentPosition) ? function(context, node){ + return context === node || !!(context.compareDocumentPosition(node) & 16); + } : function(context, node){ + if (node) do { + if (node === context) return true; + } while ((node = node.parentNode)); + return false; + }; + + // document order sorting + // credits to Sizzle (http://sizzlejs.com/) + + features.documentSorter = (root.compareDocumentPosition) ? function(a, b){ + if (!a.compareDocumentPosition || !b.compareDocumentPosition) return 0; + return a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; + } : ('sourceIndex' in root) ? function(a, b){ + if (!a.sourceIndex || !b.sourceIndex) return 0; + return a.sourceIndex - b.sourceIndex; + } : (document.createRange) ? function(a, b){ + if (!a.ownerDocument || !b.ownerDocument) return 0; + var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); + aRange.setStart(a, 0); + aRange.setEnd(a, 0); + bRange.setStart(b, 0); + bRange.setEnd(b, 0); + return aRange.compareBoundaryPoints(Range.START_TO_END, bRange); + } : null ; + + root = null; + + for (feature in features){ + this[feature] = features[feature]; + } +}; + +// Main Method + +var reSimpleSelector = /^([#.]?)((?:[\w-]+|\*))$/, + reEmptyAttribute = /\[.+[*$^]=(?:""|'')?\]/, + qsaFailExpCache = {}; + +local.search = function(context, expression, append, first){ + + var found = this.found = (first) ? null : (append || []); + + if (!context) return found; + else if (context.navigator) context = context.document; // Convert the node from a window to a document + else if (!context.nodeType) return found; + + // setup + + var parsed, i, + uniques = this.uniques = {}, + hasOthers = !!(append && append.length), + contextIsDocument = (context.nodeType == 9); + + if (this.document !== (contextIsDocument ? context : context.ownerDocument)) this.setDocument(context); + + // avoid duplicating items already in the append array + if (hasOthers) for (i = found.length; i--;) uniques[this.getUID(found[i])] = true; + + // expression checks + + if (typeof expression == 'string'){ // expression is a string + + /**/ + var simpleSelector = expression.match(reSimpleSelector); + simpleSelectors: if (simpleSelector) { + + var symbol = simpleSelector[1], + name = simpleSelector[2], + node, nodes; + + if (!symbol){ + + if (name == '*' && this.brokenStarGEBTN) break simpleSelectors; + nodes = context.getElementsByTagName(name); + if (first) return nodes[0] || null; + for (i = 0; node = nodes[i++];){ + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + + } else if (symbol == '#'){ + + if (!this.isHTMLDocument || !contextIsDocument) break simpleSelectors; + node = context.getElementById(name); + if (!node) return found; + if (this.idGetsName && node.getAttributeNode('id').nodeValue != name) break simpleSelectors; + if (first) return node || null; + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + + } else if (symbol == '.'){ + + if (!this.isHTMLDocument || ((!context.getElementsByClassName || this.brokenGEBCN) && context.querySelectorAll)) break simpleSelectors; + if (context.getElementsByClassName && !this.brokenGEBCN){ + nodes = context.getElementsByClassName(name); + if (first) return nodes[0] || null; + for (i = 0; node = nodes[i++];){ + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + } else { + var matchClass = new RegExp('(^|\\s)'+ Slick.escapeRegExp(name) +'(\\s|$)'); + nodes = context.getElementsByTagName('*'); + for (i = 0; node = nodes[i++];){ + className = node.className; + if (!(className && matchClass.test(className))) continue; + if (first) return node; + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + } + + } + + if (hasOthers) this.sort(found); + return (first) ? null : found; + + } + /**/ + + /**/ + querySelector: if (context.querySelectorAll) { + + if (!this.isHTMLDocument + || qsaFailExpCache[expression] + //TODO: only skip when expression is actually mixed case + || this.brokenMixedCaseQSA + || (this.brokenCheckedQSA && expression.indexOf(':checked') > -1) + || (this.brokenEmptyAttributeQSA && reEmptyAttribute.test(expression)) + || (!contextIsDocument //Abort when !contextIsDocument and... + // there are multiple expressions in the selector + // since we currently only fix non-document rooted QSA for single expression selectors + && expression.indexOf(',') > -1 + ) + || Slick.disableQSA + ) break querySelector; + + var _expression = expression, _context = context; + if (!contextIsDocument){ + // non-document rooted QSA + // credits to Andrew Dupont + var currentId = _context.getAttribute('id'), slickid = 'slickid__'; + _context.setAttribute('id', slickid); + _expression = '#' + slickid + ' ' + _expression; + context = _context.parentNode; + } + + try { + if (first) return context.querySelector(_expression) || null; + else nodes = context.querySelectorAll(_expression); + } catch(e) { + qsaFailExpCache[expression] = 1; + break querySelector; + } finally { + if (!contextIsDocument){ + if (currentId) _context.setAttribute('id', currentId); + else _context.removeAttribute('id'); + context = _context; + } + } + + if (this.starSelectsClosedQSA) for (i = 0; node = nodes[i++];){ + if (node.nodeName > '@' && !(hasOthers && uniques[this.getUID(node)])) found.push(node); + } else for (i = 0; node = nodes[i++];){ + if (!(hasOthers && uniques[this.getUID(node)])) found.push(node); + } + + if (hasOthers) this.sort(found); + return found; + + } + /**/ + + parsed = this.Slick.parse(expression); + if (!parsed.length) return found; + } else if (expression == null){ // there is no expression + return found; + } else if (expression.Slick){ // expression is a parsed Slick object + parsed = expression; + } else if (this.contains(context.documentElement || context, expression)){ // expression is a node + (found) ? found.push(expression) : found = expression; + return found; + } else { // other junk + return found; + } + + /**//**/ + + // cache elements for the nth selectors + + this.posNTH = {}; + this.posNTHLast = {}; + this.posNTHType = {}; + this.posNTHTypeLast = {}; + + /**//**/ + + // if append is null and there is only a single selector with one expression use pushArray, else use pushUID + this.push = (!hasOthers && (first || (parsed.length == 1 && parsed.expressions[0].length == 1))) ? this.pushArray : this.pushUID; + + if (found == null) found = []; + + // default engine + + var j, m, n; + var combinator, tag, id, classList, classes, attributes, pseudos; + var currentItems, currentExpression, currentBit, lastBit, expressions = parsed.expressions; + + search: for (i = 0; (currentExpression = expressions[i]); i++) for (j = 0; (currentBit = currentExpression[j]); j++){ + + combinator = 'combinator:' + currentBit.combinator; + if (!this[combinator]) continue search; + + tag = (this.isXMLDocument) ? currentBit.tag : currentBit.tag.toUpperCase(); + id = currentBit.id; + classList = currentBit.classList; + classes = currentBit.classes; + attributes = currentBit.attributes; + pseudos = currentBit.pseudos; + lastBit = (j === (currentExpression.length - 1)); + + this.bitUniques = {}; + + if (lastBit){ + this.uniques = uniques; + this.found = found; + } else { + this.uniques = {}; + this.found = []; + } + + if (j === 0){ + this[combinator](context, tag, id, classes, attributes, pseudos, classList); + if (first && lastBit && found.length) break search; + } else { + if (first && lastBit) for (m = 0, n = currentItems.length; m < n; m++){ + this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList); + if (found.length) break search; + } else for (m = 0, n = currentItems.length; m < n; m++) this[combinator](currentItems[m], tag, id, classes, attributes, pseudos, classList); + } + + currentItems = this.found; + } + + // should sort if there are nodes in append and if you pass multiple expressions. + if (hasOthers || (parsed.expressions.length > 1)) this.sort(found); + + return (first) ? (found[0] || null) : found; +}; + +// Utils + +local.uidx = 1; +local.uidk = 'slick-uniqueid'; + +local.getUIDXML = function(node){ + var uid = node.getAttribute(this.uidk); + if (!uid){ + uid = this.uidx++; + node.setAttribute(this.uidk, uid); + } + return uid; +}; + +local.getUIDHTML = function(node){ + return node.uniqueNumber || (node.uniqueNumber = this.uidx++); +}; + +// sort based on the setDocument documentSorter method. + +local.sort = function(results){ + if (!this.documentSorter) return results; + results.sort(this.documentSorter); + return results; +}; + +/**//**/ + +local.cacheNTH = {}; + +local.matchNTH = /^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/; + +local.parseNTHArgument = function(argument){ + var parsed = argument.match(this.matchNTH); + if (!parsed) return false; + var special = parsed[2] || false; + var a = parsed[1] || 1; + if (a == '-') a = -1; + var b = +parsed[3] || 0; + parsed = + (special == 'n') ? {a: a, b: b} : + (special == 'odd') ? {a: 2, b: 1} : + (special == 'even') ? {a: 2, b: 0} : {a: 0, b: a}; + + return (this.cacheNTH[argument] = parsed); +}; + +local.createNTHPseudo = function(child, sibling, positions, ofType){ + return function(node, argument){ + var uid = this.getUID(node); + if (!this[positions][uid]){ + var parent = node.parentNode; + if (!parent) return false; + var el = parent[child], count = 1; + if (ofType){ + var nodeName = node.nodeName; + do { + if (el.nodeName != nodeName) continue; + this[positions][this.getUID(el)] = count++; + } while ((el = el[sibling])); + } else { + do { + if (el.nodeType != 1) continue; + this[positions][this.getUID(el)] = count++; + } while ((el = el[sibling])); + } + } + argument = argument || 'n'; + var parsed = this.cacheNTH[argument] || this.parseNTHArgument(argument); + if (!parsed) return false; + var a = parsed.a, b = parsed.b, pos = this[positions][uid]; + if (a == 0) return b == pos; + if (a > 0){ + if (pos < b) return false; + } else { + if (b < pos) return false; + } + return ((pos - b) % a) == 0; + }; +}; + +/**//**/ + +local.pushArray = function(node, tag, id, classes, attributes, pseudos){ + if (this.matchSelector(node, tag, id, classes, attributes, pseudos)) this.found.push(node); +}; + +local.pushUID = function(node, tag, id, classes, attributes, pseudos){ + var uid = this.getUID(node); + if (!this.uniques[uid] && this.matchSelector(node, tag, id, classes, attributes, pseudos)){ + this.uniques[uid] = true; + this.found.push(node); + } +}; + +local.matchNode = function(node, selector){ + if (this.isHTMLDocument && this.nativeMatchesSelector){ + try { + return this.nativeMatchesSelector.call(node, selector.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g, '[$1="$2"]')); + } catch(matchError) {} + } + + var parsed = this.Slick.parse(selector); + if (!parsed) return true; + + // simple (single) selectors + var expressions = parsed.expressions, simpleExpCounter = 0, i; + for (i = 0; (currentExpression = expressions[i]); i++){ + if (currentExpression.length == 1){ + var exp = currentExpression[0]; + if (this.matchSelector(node, (this.isXMLDocument) ? exp.tag : exp.tag.toUpperCase(), exp.id, exp.classes, exp.attributes, exp.pseudos)) return true; + simpleExpCounter++; + } + } + + if (simpleExpCounter == parsed.length) return false; + + var nodes = this.search(this.document, parsed), item; + for (i = 0; item = nodes[i++];){ + if (item === node) return true; + } + return false; +}; + +local.matchPseudo = function(node, name, argument){ + var pseudoName = 'pseudo:' + name; + if (this[pseudoName]) return this[pseudoName](node, argument); + var attribute = this.getAttribute(node, name); + return (argument) ? argument == attribute : !!attribute; +}; + +local.matchSelector = function(node, tag, id, classes, attributes, pseudos){ + if (tag){ + var nodeName = (this.isXMLDocument) ? node.nodeName : node.nodeName.toUpperCase(); + if (tag == '*'){ + if (nodeName < '@') return false; // Fix for comment nodes and closed nodes + } else { + if (nodeName != tag) return false; + } + } + + if (id && node.getAttribute('id') != id) return false; + + var i, part, cls; + if (classes) for (i = classes.length; i--;){ + cls = this.getAttribute(node, 'class'); + if (!(cls && classes[i].regexp.test(cls))) return false; + } + if (attributes) for (i = attributes.length; i--;){ + part = attributes[i]; + if (part.operator ? !part.test(this.getAttribute(node, part.key)) : !this.hasAttribute(node, part.key)) return false; + } + if (pseudos) for (i = pseudos.length; i--;){ + part = pseudos[i]; + if (!this.matchPseudo(node, part.key, part.value)) return false; + } + return true; +}; + +var combinators = { + + ' ': function(node, tag, id, classes, attributes, pseudos, classList){ // all child nodes, any level + + var i, item, children; + + if (this.isHTMLDocument){ + getById: if (id){ + item = this.document.getElementById(id); + if ((!item && node.all) || (this.idGetsName && item && item.getAttributeNode('id').nodeValue != id)){ + // all[id] returns all the elements with that name or id inside node + // if theres just one it will return the element, else it will be a collection + children = node.all[id]; + if (!children) return; + if (!children[0]) children = [children]; + for (i = 0; item = children[i++];){ + var idNode = item.getAttributeNode('id'); + if (idNode && idNode.nodeValue == id){ + this.push(item, tag, null, classes, attributes, pseudos); + break; + } + } + return; + } + if (!item){ + // if the context is in the dom we return, else we will try GEBTN, breaking the getById label + if (this.contains(this.root, node)) return; + else break getById; + } else if (this.document !== node && !this.contains(node, item)) return; + this.push(item, tag, null, classes, attributes, pseudos); + return; + } + getByClass: if (classes && node.getElementsByClassName && !this.brokenGEBCN){ + children = node.getElementsByClassName(classList.join(' ')); + if (!(children && children.length)) break getByClass; + for (i = 0; item = children[i++];) this.push(item, tag, id, null, attributes, pseudos); + return; + } + } + getByTag: { + children = node.getElementsByTagName(tag); + if (!(children && children.length)) break getByTag; + if (!this.brokenStarGEBTN) tag = null; + for (i = 0; item = children[i++];) this.push(item, tag, id, classes, attributes, pseudos); + } + }, + + '>': function(node, tag, id, classes, attributes, pseudos){ // direct children + if ((node = node.firstChild)) do { + if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos); + } while ((node = node.nextSibling)); + }, + + '+': function(node, tag, id, classes, attributes, pseudos){ // next sibling + while ((node = node.nextSibling)) if (node.nodeType == 1){ + this.push(node, tag, id, classes, attributes, pseudos); + break; + } + }, + + '^': function(node, tag, id, classes, attributes, pseudos){ // first child + node = node.firstChild; + if (node){ + if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos); + else this['combinator:+'](node, tag, id, classes, attributes, pseudos); + } + }, + + '~': function(node, tag, id, classes, attributes, pseudos){ // next siblings + while ((node = node.nextSibling)){ + if (node.nodeType != 1) continue; + var uid = this.getUID(node); + if (this.bitUniques[uid]) break; + this.bitUniques[uid] = true; + this.push(node, tag, id, classes, attributes, pseudos); + } + }, + + '++': function(node, tag, id, classes, attributes, pseudos){ // next sibling and previous sibling + this['combinator:+'](node, tag, id, classes, attributes, pseudos); + this['combinator:!+'](node, tag, id, classes, attributes, pseudos); + }, + + '~~': function(node, tag, id, classes, attributes, pseudos){ // next siblings and previous siblings + this['combinator:~'](node, tag, id, classes, attributes, pseudos); + this['combinator:!~'](node, tag, id, classes, attributes, pseudos); + }, + + '!': function(node, tag, id, classes, attributes, pseudos){ // all parent nodes up to document + while ((node = node.parentNode)) if (node !== this.document) this.push(node, tag, id, classes, attributes, pseudos); + }, + + '!>': function(node, tag, id, classes, attributes, pseudos){ // direct parent (one level) + node = node.parentNode; + if (node !== this.document) this.push(node, tag, id, classes, attributes, pseudos); + }, + + '!+': function(node, tag, id, classes, attributes, pseudos){ // previous sibling + while ((node = node.previousSibling)) if (node.nodeType == 1){ + this.push(node, tag, id, classes, attributes, pseudos); + break; + } + }, + + '!^': function(node, tag, id, classes, attributes, pseudos){ // last child + node = node.lastChild; + if (node){ + if (node.nodeType == 1) this.push(node, tag, id, classes, attributes, pseudos); + else this['combinator:!+'](node, tag, id, classes, attributes, pseudos); + } + }, + + '!~': function(node, tag, id, classes, attributes, pseudos){ // previous siblings + while ((node = node.previousSibling)){ + if (node.nodeType != 1) continue; + var uid = this.getUID(node); + if (this.bitUniques[uid]) break; + this.bitUniques[uid] = true; + this.push(node, tag, id, classes, attributes, pseudos); + } + } + +}; + +for (var c in combinators) local['combinator:' + c] = combinators[c]; + +var pseudos = { + + /**/ + + 'empty': function(node){ + var child = node.firstChild; + return !(child && child.nodeType == 1) && !(node.innerText || node.textContent || '').length; + }, + + 'not': function(node, expression){ + return !this.matchNode(node, expression); + }, + + 'contains': function(node, text){ + return (node.innerText || node.textContent || '').indexOf(text) > -1; + }, + + 'first-child': function(node){ + while ((node = node.previousSibling)) if (node.nodeType == 1) return false; + return true; + }, + + 'last-child': function(node){ + while ((node = node.nextSibling)) if (node.nodeType == 1) return false; + return true; + }, + + 'only-child': function(node){ + var prev = node; + while ((prev = prev.previousSibling)) if (prev.nodeType == 1) return false; + var next = node; + while ((next = next.nextSibling)) if (next.nodeType == 1) return false; + return true; + }, + + /**/ + + 'nth-child': local.createNTHPseudo('firstChild', 'nextSibling', 'posNTH'), + + 'nth-last-child': local.createNTHPseudo('lastChild', 'previousSibling', 'posNTHLast'), + + 'nth-of-type': local.createNTHPseudo('firstChild', 'nextSibling', 'posNTHType', true), + + 'nth-last-of-type': local.createNTHPseudo('lastChild', 'previousSibling', 'posNTHTypeLast', true), + + 'index': function(node, index){ + return this['pseudo:nth-child'](node, '' + (index + 1)); + }, + + 'even': function(node){ + return this['pseudo:nth-child'](node, '2n'); + }, + + 'odd': function(node){ + return this['pseudo:nth-child'](node, '2n+1'); + }, + + /**/ + + /**/ + + 'first-of-type': function(node){ + var nodeName = node.nodeName; + while ((node = node.previousSibling)) if (node.nodeName == nodeName) return false; + return true; + }, + + 'last-of-type': function(node){ + var nodeName = node.nodeName; + while ((node = node.nextSibling)) if (node.nodeName == nodeName) return false; + return true; + }, + + 'only-of-type': function(node){ + var prev = node, nodeName = node.nodeName; + while ((prev = prev.previousSibling)) if (prev.nodeName == nodeName) return false; + var next = node; + while ((next = next.nextSibling)) if (next.nodeName == nodeName) return false; + return true; + }, + + /**/ + + // custom pseudos + + 'enabled': function(node){ + return !node.disabled; + }, + + 'disabled': function(node){ + return node.disabled; + }, + + 'checked': function(node){ + return node.checked || node.selected; + }, + + 'focus': function(node){ + return this.isHTMLDocument && this.document.activeElement === node && (node.href || node.type || this.hasAttribute(node, 'tabindex')); + }, + + 'root': function(node){ + return (node === this.root); + }, + + 'selected': function(node){ + return node.selected; + } + + /**/ +}; + +for (var p in pseudos) local['pseudo:' + p] = pseudos[p]; + +// attributes methods + +var attributeGetters = local.attributeGetters = { + + 'for': function(){ + return ('htmlFor' in this) ? this.htmlFor : this.getAttribute('for'); + }, + + 'href': function(){ + return ('href' in this) ? this.getAttribute('href', 2) : this.getAttribute('href'); + }, + + 'style': function(){ + return (this.style) ? this.style.cssText : this.getAttribute('style'); + }, + + 'tabindex': function(){ + var attributeNode = this.getAttributeNode('tabindex'); + return (attributeNode && attributeNode.specified) ? attributeNode.nodeValue : null; + }, + + 'type': function(){ + return this.getAttribute('type'); + }, + + 'maxlength': function(){ + var attributeNode = this.getAttributeNode('maxLength'); + return (attributeNode && attributeNode.specified) ? attributeNode.nodeValue : null; + } + +}; + +attributeGetters.MAXLENGTH = attributeGetters.maxLength = attributeGetters.maxlength; + +// Slick + +var Slick = local.Slick = (this.Slick || {}); + +Slick.version = '1.1.7'; + +// Slick finder + +Slick.search = function(context, expression, append){ + return local.search(context, expression, append); +}; + +Slick.find = function(context, expression){ + return local.search(context, expression, null, true); +}; + +// Slick containment checker + +Slick.contains = function(container, node){ + local.setDocument(container); + return local.contains(container, node); +}; + +// Slick attribute getter + +Slick.getAttribute = function(node, name){ + local.setDocument(node); + return local.getAttribute(node, name); +}; + +Slick.hasAttribute = function(node, name){ + local.setDocument(node); + return local.hasAttribute(node, name); +}; + +// Slick matcher + +Slick.match = function(node, selector){ + if (!(node && selector)) return false; + if (!selector || selector === node) return true; + local.setDocument(node); + return local.matchNode(node, selector); +}; + +// Slick attribute accessor + +Slick.defineAttributeGetter = function(name, fn){ + local.attributeGetters[name] = fn; + return this; +}; + +Slick.lookupAttributeGetter = function(name){ + return local.attributeGetters[name]; +}; + +// Slick pseudo accessor + +Slick.definePseudo = function(name, fn){ + local['pseudo:' + name] = function(node, argument){ + return fn.call(node, argument); + }; + return this; +}; + +Slick.lookupPseudo = function(name){ + var pseudo = local['pseudo:' + name]; + if (pseudo) return function(argument){ + return pseudo.call(this, argument); + }; + return null; +}; + +// Slick overrides accessor + +Slick.override = function(regexp, fn){ + local.override(regexp, fn); + return this; +}; + +Slick.isXML = local.isXML; + +Slick.uidOf = function(node){ + return local.getUIDHTML(node); +}; + +if (!this.Slick) this.Slick = Slick; + +}).apply(/**/(typeof exports != 'undefined') ? exports : /**/this); + + +/* +--- + +name: Element + +description: One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements. + +license: MIT-style license. + +requires: [Window, Document, Array, String, Function, Object, Number, Slick.Parser, Slick.Finder] + +provides: [Element, Elements, $, $$, Iframe, Selectors] + +... +*/ + +var Element = function(tag, props){ + var konstructor = Element.Constructors[tag]; + if (konstructor) return konstructor(props); + if (typeof tag != 'string') return document.id(tag).set(props); + + if (!props) props = {}; + + if (!(/^[\w-]+$/).test(tag)){ + var parsed = Slick.parse(tag).expressions[0][0]; + tag = (parsed.tag == '*') ? 'div' : parsed.tag; + if (parsed.id && props.id == null) props.id = parsed.id; + + var attributes = parsed.attributes; + if (attributes) for (var attr, i = 0, l = attributes.length; i < l; i++){ + attr = attributes[i]; + if (props[attr.key] != null) continue; + + if (attr.value != null && attr.operator == '=') props[attr.key] = attr.value; + else if (!attr.value && !attr.operator) props[attr.key] = true; + } + + if (parsed.classList && props['class'] == null) props['class'] = parsed.classList.join(' '); + } + + return document.newElement(tag, props); +}; + + +if (Browser.Element){ + Element.prototype = Browser.Element.prototype; + // IE8 and IE9 require the wrapping. + Element.prototype._fireEvent = (function(fireEvent){ + return function(type, event){ + return fireEvent.call(this, type, event); + }; + })(Element.prototype.fireEvent); +} + +new Type('Element', Element).mirror(function(name){ + if (Array.prototype[name]) return; + + var obj = {}; + obj[name] = function(){ + var results = [], args = arguments, elements = true; + for (var i = 0, l = this.length; i < l; i++){ + var element = this[i], result = results[i] = element[name].apply(element, args); + elements = (elements && typeOf(result) == 'element'); + } + return (elements) ? new Elements(results) : results; + }; + + Elements.implement(obj); +}); + +if (!Browser.Element){ + Element.parent = Object; + + Element.Prototype = { + '$constructor': Element, + '$family': Function.from('element').hide() + }; + + Element.mirror(function(name, method){ + Element.Prototype[name] = method; + }); +} + +Element.Constructors = {}; + + + +var IFrame = new Type('IFrame', function(){ + var params = Array.link(arguments, { + properties: Type.isObject, + iframe: function(obj){ + return (obj != null); + } + }); + + var props = params.properties || {}, iframe; + if (params.iframe) iframe = document.id(params.iframe); + var onload = props.onload || function(){}; + delete props.onload; + props.id = props.name = [props.id, props.name, iframe ? (iframe.id || iframe.name) : 'IFrame_' + String.uniqueID()].pick(); + iframe = new Element(iframe || 'iframe', props); + + var onLoad = function(){ + onload.call(iframe.contentWindow); + }; + + if (window.frames[props.id]) onLoad(); + else iframe.addListener('load', onLoad); + return iframe; +}); + +var Elements = this.Elements = function(nodes){ + if (nodes && nodes.length){ + var uniques = {}, node; + for (var i = 0; node = nodes[i++];){ + var uid = Slick.uidOf(node); + if (!uniques[uid]){ + uniques[uid] = true; + this.push(node); + } + } + } +}; + +Elements.prototype = {length: 0}; +Elements.parent = Array; + +new Type('Elements', Elements).implement({ + + filter: function(filter, bind){ + if (!filter) return this; + return new Elements(Array.filter(this, (typeOf(filter) == 'string') ? function(item){ + return item.match(filter); + } : filter, bind)); + }.protect(), + + push: function(){ + var length = this.length; + for (var i = 0, l = arguments.length; i < l; i++){ + var item = document.id(arguments[i]); + if (item) this[length++] = item; + } + return (this.length = length); + }.protect(), + + unshift: function(){ + var items = []; + for (var i = 0, l = arguments.length; i < l; i++){ + var item = document.id(arguments[i]); + if (item) items.push(item); + } + return Array.prototype.unshift.apply(this, items); + }.protect(), + + concat: function(){ + var newElements = new Elements(this); + for (var i = 0, l = arguments.length; i < l; i++){ + var item = arguments[i]; + if (Type.isEnumerable(item)) newElements.append(item); + else newElements.push(item); + } + return newElements; + }.protect(), + + append: function(collection){ + for (var i = 0, l = collection.length; i < l; i++) this.push(collection[i]); + return this; + }.protect(), + + empty: function(){ + while (this.length) delete this[--this.length]; + return this; + }.protect() + +}); + + + +(function(){ + +// FF, IE +var splice = Array.prototype.splice, object = {'0': 0, '1': 1, length: 2}; + +splice.call(object, 1, 1); +if (object[1] == 1) Elements.implement('splice', function(){ + var length = this.length; + var result = splice.apply(this, arguments); + while (length >= this.length) delete this[length--]; + return result; +}.protect()); + +Array.forEachMethod(function(method, name){ + Elements.implement(name, method); +}); + +Array.mirror(Elements); + +/**/ +var createElementAcceptsHTML; +try { + createElementAcceptsHTML = (document.createElement('').name == 'x'); +} catch (e){} + +var escapeQuotes = function(html){ + return ('' + html).replace(/&/g, '&').replace(/"/g, '"'); +}; +/**/ + +Document.implement({ + + newElement: function(tag, props){ + if (props && props.checked != null) props.defaultChecked = props.checked; + /**/// Fix for readonly name and type properties in IE < 8 + if (createElementAcceptsHTML && props){ + tag = '<' + tag; + if (props.name) tag += ' name="' + escapeQuotes(props.name) + '"'; + if (props.type) tag += ' type="' + escapeQuotes(props.type) + '"'; + tag += '>'; + delete props.name; + delete props.type; + } + /**/ + return this.id(this.createElement(tag)).set(props); + } + +}); + +})(); + +(function(){ + +Slick.uidOf(window); +Slick.uidOf(document); + +Document.implement({ + + newTextNode: function(text){ + return this.createTextNode(text); + }, + + getDocument: function(){ + return this; + }, + + getWindow: function(){ + return this.window; + }, + + id: (function(){ + + var types = { + + string: function(id, nocash, doc){ + id = Slick.find(doc, '#' + id.replace(/(\W)/g, '\\$1')); + return (id) ? types.element(id, nocash) : null; + }, + + element: function(el, nocash){ + Slick.uidOf(el); + if (!nocash && !el.$family && !(/^(?:object|embed)$/i).test(el.tagName)){ + var fireEvent = el.fireEvent; + // wrapping needed in IE7, or else crash + el._fireEvent = function(type, event){ + return fireEvent(type, event); + }; + Object.append(el, Element.Prototype); + } + return el; + }, + + object: function(obj, nocash, doc){ + if (obj.toElement) return types.element(obj.toElement(doc), nocash); + return null; + } + + }; + + types.textnode = types.whitespace = types.window = types.document = function(zero){ + return zero; + }; + + return function(el, nocash, doc){ + if (el && el.$family && el.uniqueNumber) return el; + var type = typeOf(el); + return (types[type]) ? types[type](el, nocash, doc || document) : null; + }; + + })() + +}); + +if (window.$ == null) Window.implement('$', function(el, nc){ + return document.id(el, nc, this.document); +}); + +Window.implement({ + + getDocument: function(){ + return this.document; + }, + + getWindow: function(){ + return this; + } + +}); + +[Document, Element].invoke('implement', { + + getElements: function(expression){ + return Slick.search(this, expression, new Elements); + }, + + getElement: function(expression){ + return document.id(Slick.find(this, expression)); + } + +}); + +var contains = {contains: function(element){ + return Slick.contains(this, element); +}}; + +if (!document.contains) Document.implement(contains); +if (!document.createElement('div').contains) Element.implement(contains); + + + +// tree walking + +var injectCombinator = function(expression, combinator){ + if (!expression) return combinator; + + expression = Object.clone(Slick.parse(expression)); + + var expressions = expression.expressions; + for (var i = expressions.length; i--;) + expressions[i][0].combinator = combinator; + + return expression; +}; + +Object.forEach({ + getNext: '~', + getPrevious: '!~', + getParent: '!' +}, function(combinator, method){ + Element.implement(method, function(expression){ + return this.getElement(injectCombinator(expression, combinator)); + }); +}); + +Object.forEach({ + getAllNext: '~', + getAllPrevious: '!~', + getSiblings: '~~', + getChildren: '>', + getParents: '!' +}, function(combinator, method){ + Element.implement(method, function(expression){ + return this.getElements(injectCombinator(expression, combinator)); + }); +}); + +Element.implement({ + + getFirst: function(expression){ + return document.id(Slick.search(this, injectCombinator(expression, '>'))[0]); + }, + + getLast: function(expression){ + return document.id(Slick.search(this, injectCombinator(expression, '>')).getLast()); + }, + + getWindow: function(){ + return this.ownerDocument.window; + }, + + getDocument: function(){ + return this.ownerDocument; + }, + + getElementById: function(id){ + return document.id(Slick.find(this, '#' + ('' + id).replace(/(\W)/g, '\\$1'))); + }, + + match: function(expression){ + return !expression || Slick.match(this, expression); + } + +}); + + + +if (window.$$ == null) Window.implement('$$', function(selector){ + if (arguments.length == 1){ + if (typeof selector == 'string') return Slick.search(this.document, selector, new Elements); + else if (Type.isEnumerable(selector)) return new Elements(selector); + } + return new Elements(arguments); +}); + +// Inserters + +var inserters = { + + before: function(context, element){ + var parent = element.parentNode; + if (parent) parent.insertBefore(context, element); + }, + + after: function(context, element){ + var parent = element.parentNode; + if (parent) parent.insertBefore(context, element.nextSibling); + }, + + bottom: function(context, element){ + element.appendChild(context); + }, + + top: function(context, element){ + element.insertBefore(context, element.firstChild); + } + +}; + +inserters.inside = inserters.bottom; + + + +// getProperty / setProperty + +var propertyGetters = {}, propertySetters = {}; + +// properties + +var properties = {}; +Array.forEach([ + 'type', 'value', 'defaultValue', 'accessKey', 'cellPadding', 'cellSpacing', 'colSpan', + 'frameBorder', 'rowSpan', 'tabIndex', 'useMap' +], function(property){ + properties[property.toLowerCase()] = property; +}); + +properties.html = 'innerHTML'; +properties.text = (document.createElement('div').textContent == null) ? 'innerText': 'textContent'; + +Object.forEach(properties, function(real, key){ + propertySetters[key] = function(node, value){ + node[real] = value; + }; + propertyGetters[key] = function(node){ + return node[real]; + }; +}); + +// Booleans + +var bools = [ + 'compact', 'nowrap', 'ismap', 'declare', 'noshade', 'checked', + 'disabled', 'readOnly', 'multiple', 'selected', 'noresize', + 'defer', 'defaultChecked', 'autofocus', 'controls', 'autoplay', + 'loop' +]; + +var booleans = {}; +Array.forEach(bools, function(bool){ + var lower = bool.toLowerCase(); + booleans[lower] = bool; + propertySetters[lower] = function(node, value){ + node[bool] = !!value; + }; + propertyGetters[lower] = function(node){ + return !!node[bool]; + }; +}); + +// Special cases + +Object.append(propertySetters, { + + 'class': function(node, value){ + ('className' in node) ? node.className = (value || '') : node.setAttribute('class', value); + }, + + 'for': function(node, value){ + ('htmlFor' in node) ? node.htmlFor = value : node.setAttribute('for', value); + }, + + 'style': function(node, value){ + (node.style) ? node.style.cssText = value : node.setAttribute('style', value); + }, + + 'value': function(node, value){ + node.value = (value != null) ? value : ''; + } + +}); + +propertyGetters['class'] = function(node){ + return ('className' in node) ? node.className || null : node.getAttribute('class'); +}; + +/* */ +var el = document.createElement('button'); +// IE sets type as readonly and throws +try { el.type = 'button'; } catch(e){} +if (el.type != 'button') propertySetters.type = function(node, value){ + node.setAttribute('type', value); +}; +el = null; +/* */ + +/**/ +var input = document.createElement('input'); +input.value = 't'; +input.type = 'submit'; +if (input.value != 't') propertySetters.type = function(node, type){ + var value = node.value; + node.type = type; + node.value = value; +}; +input = null; +/**/ + +/* getProperty, setProperty */ + +/* */ +var pollutesGetAttribute = (function(div){ + div.random = 'attribute'; + return (div.getAttribute('random') == 'attribute'); +})(document.createElement('div')); + +/* */ + +Element.implement({ + + setProperty: function(name, value){ + var setter = propertySetters[name.toLowerCase()]; + if (setter){ + setter(this, value); + } else { + /* */ + if (pollutesGetAttribute) var attributeWhiteList = this.retrieve('$attributeWhiteList', {}); + /* */ + + if (value == null){ + this.removeAttribute(name); + /* */ + if (pollutesGetAttribute) delete attributeWhiteList[name]; + /* */ + } else { + this.setAttribute(name, value); + /* */ + if (pollutesGetAttribute) attributeWhiteList[name] = true; + /* */ + } + } + return this; + }, + + setProperties: function(attributes){ + for (var attribute in attributes) this.setProperty(attribute, attributes[attribute]); + return this; + }, + + getProperty: function(name){ + var getter = propertyGetters[name.toLowerCase()]; + if (getter) return getter(this); + /* */ + if (pollutesGetAttribute){ + var attr = this.getAttributeNode(name), attributeWhiteList = this.retrieve('$attributeWhiteList', {}); + if (!attr) return null; + if (attr.expando && !attributeWhiteList[name]){ + var outer = this.outerHTML; + // segment by the opening tag and find mention of attribute name + if (outer.substr(0, outer.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(name) < 0) return null; + attributeWhiteList[name] = true; + } + } + /* */ + var result = Slick.getAttribute(this, name); + return (!result && !Slick.hasAttribute(this, name)) ? null : result; + }, + + getProperties: function(){ + var args = Array.from(arguments); + return args.map(this.getProperty, this).associate(args); + }, + + removeProperty: function(name){ + return this.setProperty(name, null); + }, + + removeProperties: function(){ + Array.each(arguments, this.removeProperty, this); + return this; + }, + + set: function(prop, value){ + var property = Element.Properties[prop]; + (property && property.set) ? property.set.call(this, value) : this.setProperty(prop, value); + }.overloadSetter(), + + get: function(prop){ + var property = Element.Properties[prop]; + return (property && property.get) ? property.get.apply(this) : this.getProperty(prop); + }.overloadGetter(), + + erase: function(prop){ + var property = Element.Properties[prop]; + (property && property.erase) ? property.erase.apply(this) : this.removeProperty(prop); + return this; + }, + + hasClass: function(className){ + return this.className.clean().contains(className, ' '); + }, + + addClass: function(className){ + if (!this.hasClass(className)) this.className = (this.className + ' ' + className).clean(); + return this; + }, + + removeClass: function(className){ + this.className = this.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)'), '$1'); + return this; + }, + + toggleClass: function(className, force){ + if (force == null) force = !this.hasClass(className); + return (force) ? this.addClass(className) : this.removeClass(className); + }, + + adopt: function(){ + var parent = this, fragment, elements = Array.flatten(arguments), length = elements.length; + if (length > 1) parent = fragment = document.createDocumentFragment(); + + for (var i = 0; i < length; i++){ + var element = document.id(elements[i], true); + if (element) parent.appendChild(element); + } + + if (fragment) this.appendChild(fragment); + + return this; + }, + + appendText: function(text, where){ + return this.grab(this.getDocument().newTextNode(text), where); + }, + + grab: function(el, where){ + inserters[where || 'bottom'](document.id(el, true), this); + return this; + }, + + inject: function(el, where){ + inserters[where || 'bottom'](this, document.id(el, true)); + return this; + }, + + replaces: function(el){ + el = document.id(el, true); + el.parentNode.replaceChild(this, el); + return this; + }, + + wraps: function(el, where){ + el = document.id(el, true); + return this.replaces(el).grab(el, where); + }, + + getSelected: function(){ + this.selectedIndex; // Safari 3.2.1 + return new Elements(Array.from(this.options).filter(function(option){ + return option.selected; + })); + }, + + toQueryString: function(){ + var queryString = []; + this.getElements('input, select, textarea').each(function(el){ + var type = el.type; + if (!el.name || el.disabled || type == 'submit' || type == 'reset' || type == 'file' || type == 'image') return; + + var value = (el.get('tag') == 'select') ? el.getSelected().map(function(opt){ + // IE + return document.id(opt).get('value'); + }) : ((type == 'radio' || type == 'checkbox') && !el.checked) ? null : el.get('value'); + + Array.from(value).each(function(val){ + if (typeof val != 'undefined') queryString.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(val)); + }); + }); + return queryString.join('&'); + } + +}); + +var collected = {}, storage = {}; + +var get = function(uid){ + return (storage[uid] || (storage[uid] = {})); +}; + +var clean = function(item){ + var uid = item.uniqueNumber; + if (item.removeEvents) item.removeEvents(); + if (item.clearAttributes) item.clearAttributes(); + if (uid != null){ + delete collected[uid]; + delete storage[uid]; + } + return item; +}; + +var formProps = {input: 'checked', option: 'selected', textarea: 'value'}; + +Element.implement({ + + destroy: function(){ + var children = clean(this).getElementsByTagName('*'); + Array.each(children, clean); + Element.dispose(this); + return null; + }, + + empty: function(){ + Array.from(this.childNodes).each(Element.dispose); + return this; + }, + + dispose: function(){ + return (this.parentNode) ? this.parentNode.removeChild(this) : this; + }, + + clone: function(contents, keepid){ + contents = contents !== false; + var clone = this.cloneNode(contents), ce = [clone], te = [this], i; + + if (contents){ + ce.append(Array.from(clone.getElementsByTagName('*'))); + te.append(Array.from(this.getElementsByTagName('*'))); + } + + for (i = ce.length; i--;){ + var node = ce[i], element = te[i]; + if (!keepid) node.removeAttribute('id'); + /**/ + if (node.clearAttributes){ + node.clearAttributes(); + node.mergeAttributes(element); + node.removeAttribute('uniqueNumber'); + if (node.options){ + var no = node.options, eo = element.options; + for (var j = no.length; j--;) no[j].selected = eo[j].selected; + } + } + /**/ + var prop = formProps[element.tagName.toLowerCase()]; + if (prop && element[prop]) node[prop] = element[prop]; + } + + /**/ + if (Browser.ie){ + var co = clone.getElementsByTagName('object'), to = this.getElementsByTagName('object'); + for (i = co.length; i--;) co[i].outerHTML = to[i].outerHTML; + } + /**/ + return document.id(clone); + } + +}); + +[Element, Window, Document].invoke('implement', { + + addListener: function(type, fn){ + if (type == 'unload'){ + var old = fn, self = this; + fn = function(){ + self.removeListener('unload', fn); + old(); + }; + } else { + collected[Slick.uidOf(this)] = this; + } + if (this.addEventListener) this.addEventListener(type, fn, !!arguments[2]); + else this.attachEvent('on' + type, fn); + return this; + }, + + removeListener: function(type, fn){ + if (this.removeEventListener) this.removeEventListener(type, fn, !!arguments[2]); + else this.detachEvent('on' + type, fn); + return this; + }, + + retrieve: function(property, dflt){ + var storage = get(Slick.uidOf(this)), prop = storage[property]; + if (dflt != null && prop == null) prop = storage[property] = dflt; + return prop != null ? prop : null; + }, + + store: function(property, value){ + var storage = get(Slick.uidOf(this)); + storage[property] = value; + return this; + }, + + eliminate: function(property){ + var storage = get(Slick.uidOf(this)); + delete storage[property]; + return this; + } + +}); + +/**/ +if (window.attachEvent && !window.addEventListener) window.addListener('unload', function(){ + Object.each(collected, clean); + if (window.CollectGarbage) CollectGarbage(); +}); +/**/ + +Element.Properties = {}; + + + +Element.Properties.style = { + + set: function(style){ + this.style.cssText = style; + }, + + get: function(){ + return this.style.cssText; + }, + + erase: function(){ + this.style.cssText = ''; + } + +}; + +Element.Properties.tag = { + + get: function(){ + return this.tagName.toLowerCase(); + } + +}; + +Element.Properties.html = { + + set: function(html){ + if (html == null) html = ''; + else if (typeOf(html) == 'array') html = html.join(''); + this.innerHTML = html; + }, + + erase: function(){ + this.innerHTML = ''; + } + +}; + +/**/ +// technique by jdbarlett - http://jdbartlett.com/innershiv/ +var div = document.createElement('div'); +div.innerHTML = ''; +var supportsHTML5Elements = (div.childNodes.length == 1); +if (!supportsHTML5Elements){ + var tags = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' '), + fragment = document.createDocumentFragment(), l = tags.length; + while (l--) fragment.createElement(tags[l]); +} +div = null; +/**/ + +/**/ +var supportsTableInnerHTML = Function.attempt(function(){ + var table = document.createElement('table'); + table.innerHTML = ''; + return true; +}); + +/**/ +var tr = document.createElement('tr'), html = ''; +tr.innerHTML = html; +var supportsTRInnerHTML = (tr.innerHTML == html); +tr = null; +/**/ + +if (!supportsTableInnerHTML || !supportsTRInnerHTML || !supportsHTML5Elements){ + + Element.Properties.html.set = (function(set){ + + var translations = { + table: [1, '', '
    '], + select: [1, ''], + tbody: [2, '', '
    '], + tr: [3, '', '
    '] + }; + + translations.thead = translations.tfoot = translations.tbody; + + return function(html){ + var wrap = translations[this.get('tag')]; + if (!wrap && !supportsHTML5Elements) wrap = [0, '', '']; + if (!wrap) return set.call(this, html); + + var level = wrap[0], wrapper = document.createElement('div'), target = wrapper; + if (!supportsHTML5Elements) fragment.appendChild(wrapper); + wrapper.innerHTML = [wrap[1], html, wrap[2]].flatten().join(''); + while (level--) target = target.firstChild; + this.empty().adopt(target.childNodes); + if (!supportsHTML5Elements) fragment.removeChild(wrapper); + wrapper = null; + }; + + })(Element.Properties.html.set); +} +/*
    */ + +/**/ +var testForm = document.createElement('form'); +testForm.innerHTML = ''; + +if (testForm.firstChild.value != 's') Element.Properties.value = { + + set: function(value){ + var tag = this.get('tag'); + if (tag != 'select') return this.setProperty('value', value); + var options = this.getElements('option'); + for (var i = 0; i < options.length; i++){ + var option = options[i], + attr = option.getAttributeNode('value'), + optionValue = (attr && attr.specified) ? option.value : option.get('text'); + if (optionValue == value) return option.selected = true; + } + }, + + get: function(){ + var option = this, tag = option.get('tag'); + + if (tag != 'select' && tag != 'option') return this.getProperty('value'); + + if (tag == 'select' && !(option = option.getSelected()[0])) return ''; + + var attr = option.getAttributeNode('value'); + return (attr && attr.specified) ? option.value : option.get('text'); + } + +}; +testForm = null; +/**/ + +/**/ +if (document.createElement('div').getAttributeNode('id')) Element.Properties.id = { + set: function(id){ + this.id = this.getAttributeNode('id').value = id; + }, + get: function(){ + return this.id || null; + }, + erase: function(){ + this.id = this.getAttributeNode('id').value = ''; + } +}; +/**/ + +})(); + + +/* +--- + +name: Element.Style + +description: Contains methods for interacting with the styles of Elements in a fashionable way. + +license: MIT-style license. + +requires: Element + +provides: Element.Style + +... +*/ + +(function(){ + +var html = document.html; + +// +// Check for oldIE, which does not remove styles when they're set to null +var el = document.createElement('div'); +el.style.color = 'red'; +el.style.color = null; +var doesNotRemoveStyles = el.style.color == 'red'; +el = null; +// + +Element.Properties.styles = {set: function(styles){ + this.setStyles(styles); +}}; + +var hasOpacity = (html.style.opacity != null), + hasFilter = (html.style.filter != null), + reAlpha = /alpha\(opacity=([\d.]+)\)/i; + +var setVisibility = function(element, opacity){ + element.store('$opacity', opacity); + element.style.visibility = opacity > 0 || opacity == null ? 'visible' : 'hidden'; +}; + +var setOpacity = (hasOpacity ? function(element, opacity){ + element.style.opacity = opacity; +} : (hasFilter ? function(element, opacity){ + var style = element.style; + if (!element.currentStyle || !element.currentStyle.hasLayout) style.zoom = 1; + if (opacity == null) opacity = ''; + else opacity = 'alpha(opacity=' + (opacity * 100).limit(0, 100).round() + ')'; + var filter = style.filter || element.getComputedStyle('filter') || ''; + style.filter = reAlpha.test(filter) ? filter.replace(reAlpha, opacity) : filter + opacity; + if (!style.filter) style.removeAttribute('filter'); +} : setVisibility)); + +var getOpacity = (hasOpacity ? function(element){ + var opacity = element.style.opacity || element.getComputedStyle('opacity'); + return (opacity == '') ? 1 : opacity.toFloat(); +} : (hasFilter ? function(element){ + var filter = (element.style.filter || element.getComputedStyle('filter')), + opacity; + if (filter) opacity = filter.match(reAlpha); + return (opacity == null || filter == null) ? 1 : (opacity[1] / 100); +} : function(element){ + var opacity = element.retrieve('$opacity'); + if (opacity == null) opacity = (element.style.visibility == 'hidden' ? 0 : 1); + return opacity; +})); + +var floatName = (html.style.cssFloat == null) ? 'styleFloat' : 'cssFloat'; + +Element.implement({ + + getComputedStyle: function(property){ + if (this.currentStyle) return this.currentStyle[property.camelCase()]; + var defaultView = Element.getDocument(this).defaultView, + computed = defaultView ? defaultView.getComputedStyle(this, null) : null; + return (computed) ? computed.getPropertyValue((property == floatName) ? 'float' : property.hyphenate()) : null; + }, + + setStyle: function(property, value){ + if (property == 'opacity'){ + if (value != null) value = parseFloat(value); + setOpacity(this, value); + return this; + } + property = (property == 'float' ? floatName : property).camelCase(); + if (typeOf(value) != 'string'){ + var map = (Element.Styles[property] || '@').split(' '); + value = Array.from(value).map(function(val, i){ + if (!map[i]) return ''; + return (typeOf(val) == 'number') ? map[i].replace('@', Math.round(val)) : val; + }).join(' '); + } else if (value == String(Number(value))){ + value = Math.round(value); + } + try { + this.style[property] = value; + } + catch(e){} + // + if ((value == '' || value == null) && doesNotRemoveStyles && this.style.removeAttribute) { + console.log("I'm less than IE 9"); + this.style.removeAttribute(property); + } + // + return this; + }, + + getStyle: function(property){ + if (property == 'opacity') return getOpacity(this); + property = (property == 'float' ? floatName : property).camelCase(); + var result = this.style[property]; + if (!result || property == 'zIndex'){ + result = []; + for (var style in Element.ShortStyles){ + if (property != style) continue; + for (var s in Element.ShortStyles[style]) result.push(this.getStyle(s)); + return result.join(' '); + } + result = this.getComputedStyle(property); + } + if (result){ + result = String(result); + var color = result.match(/rgba?\([\d\s,]+\)/); + if (color) result = result.replace(color[0], color[0].rgbToHex()); + } + if (Browser.opera || (Browser.ie && isNaN(parseFloat(result)))){ + if ((/^(height|width)$/).test(property)){ + var values = (property == 'width') ? ['left', 'right'] : ['top', 'bottom'], size = 0; + values.each(function(value){ + size += this.getStyle('border-' + value + '-width').toInt() + this.getStyle('padding-' + value).toInt(); + }, this); + return this['offset' + property.capitalize()] - size + 'px'; + } + if (Browser.opera && String(result).indexOf('px') != -1) return result; + if ((/^border(.+)Width|margin|padding/).test(property)) return '0px'; + } + return result; + }, + + setStyles: function(styles){ + for (var style in styles) this.setStyle(style, styles[style]); + return this; + }, + + getStyles: function(){ + var result = {}; + Array.flatten(arguments).each(function(key){ + result[key] = this.getStyle(key); + }, this); + return result; + } + +}); + +Element.Styles = { + left: '@px', top: '@px', bottom: '@px', right: '@px', + width: '@px', height: '@px', maxWidth: '@px', maxHeight: '@px', minWidth: '@px', minHeight: '@px', + backgroundColor: 'rgb(@, @, @)', backgroundPosition: '@px @px', color: 'rgb(@, @, @)', + fontSize: '@px', letterSpacing: '@px', lineHeight: '@px', clip: 'rect(@px @px @px @px)', + margin: '@px @px @px @px', padding: '@px @px @px @px', border: '@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)', + borderWidth: '@px @px @px @px', borderStyle: '@ @ @ @', borderColor: 'rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)', + zIndex: '@', 'zoom': '@', fontWeight: '@', textIndent: '@px', opacity: '@' +}; + + + + + +Element.ShortStyles = {margin: {}, padding: {}, border: {}, borderWidth: {}, borderStyle: {}, borderColor: {}}; + +['Top', 'Right', 'Bottom', 'Left'].each(function(direction){ + var Short = Element.ShortStyles; + var All = Element.Styles; + ['margin', 'padding'].each(function(style){ + var sd = style + direction; + Short[style][sd] = All[sd] = '@px'; + }); + var bd = 'border' + direction; + Short.border[bd] = All[bd] = '@px @ rgb(@, @, @)'; + var bdw = bd + 'Width', bds = bd + 'Style', bdc = bd + 'Color'; + Short[bd] = {}; + Short.borderWidth[bdw] = Short[bd][bdw] = All[bdw] = '@px'; + Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@'; + Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)'; +}); + +})(); + + +/* +--- + +name: Element.Event + +description: Contains Element methods for dealing with events. This file also includes mouseenter and mouseleave custom Element Events, if necessary. + +license: MIT-style license. + +requires: [Element, Event] + +provides: Element.Event + +... +*/ + +(function(){ + +Element.Properties.events = {set: function(events){ + this.addEvents(events); +}}; + +[Element, Window, Document].invoke('implement', { + + addEvent: function(type, fn){ + var events = this.retrieve('events', {}); + if (!events[type]) events[type] = {keys: [], values: []}; + if (events[type].keys.contains(fn)) return this; + events[type].keys.push(fn); + var realType = type, + custom = Element.Events[type], + condition = fn, + self = this; + if (custom){ + if (custom.onAdd) custom.onAdd.call(this, fn, type); + if (custom.condition){ + condition = function(event){ + if (custom.condition.call(this, event, type)) return fn.call(this, event); + return true; + }; + } + if (custom.base) realType = Function.from(custom.base).call(this, type); + } + var defn = function(){ + return fn.call(self); + }; + var nativeEvent = Element.NativeEvents[realType]; + if (nativeEvent){ + if (nativeEvent == 2){ + defn = function(event){ + event = new DOMEvent(event, self.getWindow()); + if (condition.call(self, event) === false) event.stop(); + }; + } + this.addListener(realType, defn, arguments[2]); + } + events[type].values.push(defn); + return this; + }, + + removeEvent: function(type, fn){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + var list = events[type]; + var index = list.keys.indexOf(fn); + if (index == -1) return this; + var value = list.values[index]; + delete list.keys[index]; + delete list.values[index]; + var custom = Element.Events[type]; + if (custom){ + if (custom.onRemove) custom.onRemove.call(this, fn, type); + if (custom.base) type = Function.from(custom.base).call(this, type); + } + return (Element.NativeEvents[type]) ? this.removeListener(type, value, arguments[2]) : this; + }, + + addEvents: function(events){ + for (var event in events) this.addEvent(event, events[event]); + return this; + }, + + removeEvents: function(events){ + var type; + if (typeOf(events) == 'object'){ + for (type in events) this.removeEvent(type, events[type]); + return this; + } + var attached = this.retrieve('events'); + if (!attached) return this; + if (!events){ + for (type in attached) this.removeEvents(type); + this.eliminate('events'); + } else if (attached[events]){ + attached[events].keys.each(function(fn){ + this.removeEvent(events, fn); + }, this); + delete attached[events]; + } + return this; + }, + + fireEvent: function(type, args, delay){ + var events = this.retrieve('events'); + if (!events || !events[type]) return this; + args = Array.from(args); + + events[type].keys.each(function(fn){ + if (delay) fn.delay(delay, this, args); + else fn.apply(this, args); + }, this); + return this; + }, + + cloneEvents: function(from, type){ + from = document.id(from); + var events = from.retrieve('events'); + if (!events) return this; + if (!type){ + for (var eventType in events) this.cloneEvents(from, eventType); + } else if (events[type]){ + events[type].keys.each(function(fn){ + this.addEvent(type, fn); + }, this); + } + return this; + } + +}); + +Element.NativeEvents = { + click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttons + mousewheel: 2, DOMMouseScroll: 2, //mouse wheel + mouseover: 2, mouseout: 2, mousemove: 2, selectstart: 2, selectend: 2, //mouse movement + keydown: 2, keypress: 2, keyup: 2, //keyboard + orientationchange: 2, // mobile + touchstart: 2, touchmove: 2, touchend: 2, touchcancel: 2, // touch + gesturestart: 2, gesturechange: 2, gestureend: 2, // gesture + focus: 2, blur: 2, change: 2, reset: 2, select: 2, submit: 2, paste: 2, input: 2, //form elements + load: 2, unload: 1, beforeunload: 2, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window + error: 1, abort: 1, scroll: 1 //misc +}; + +Element.Events = {mousewheel: { + base: (Browser.firefox) ? 'DOMMouseScroll' : 'mousewheel' +}}; + +if ('onmouseenter' in document.documentElement){ + Element.NativeEvents.mouseenter = Element.NativeEvents.mouseleave = 2; +} else { + var check = function(event){ + var related = event.relatedTarget; + if (related == null) return true; + if (!related) return false; + return (related != this && related.prefix != 'xul' && typeOf(this) != 'document' && !this.contains(related)); + }; + + Element.Events.mouseenter = { + base: 'mouseover', + condition: check + }; + + Element.Events.mouseleave = { + base: 'mouseout', + condition: check + }; +} + +/**/ +if (!window.addEventListener){ + Element.NativeEvents.propertychange = 2; + Element.Events.change = { + base: function(){ + var type = this.type; + return (this.get('tag') == 'input' && (type == 'radio' || type == 'checkbox')) ? 'propertychange' : 'change' + }, + condition: function(event){ + return this.type != 'radio' || (event.event.propertyName == 'checked' && this.checked); + } + } +} +/**/ + + + +})(); + + +/* +--- + +name: Element.Delegation + +description: Extends the Element native object to include the delegate method for more efficient event management. + +license: MIT-style license. + +requires: [Element.Event] + +provides: [Element.Delegation] + +... +*/ + +(function(){ + +var eventListenerSupport = !!window.addEventListener; + +Element.NativeEvents.focusin = Element.NativeEvents.focusout = 2; + +var bubbleUp = function(self, match, fn, event, target){ + while (target && target != self){ + if (match(target, event)) return fn.call(target, event, target); + target = document.id(target.parentNode); + } +}; + +var map = { + mouseenter: { + base: 'mouseover' + }, + mouseleave: { + base: 'mouseout' + }, + focus: { + base: 'focus' + (eventListenerSupport ? '' : 'in'), + capture: true + }, + blur: { + base: eventListenerSupport ? 'blur' : 'focusout', + capture: true + } +}; + +/**/ +var _key = '$delegation:'; +var formObserver = function(type){ + + return { + + base: 'focusin', + + remove: function(self, uid){ + var list = self.retrieve(_key + type + 'listeners', {})[uid]; + if (list && list.forms) for (var i = list.forms.length; i--;){ + list.forms[i].removeEvent(type, list.fns[i]); + } + }, + + listen: function(self, match, fn, event, target, uid){ + var form = (target.get('tag') == 'form') ? target : event.target.getParent('form'); + if (!form) return; + + var listeners = self.retrieve(_key + type + 'listeners', {}), + listener = listeners[uid] || {forms: [], fns: []}, + forms = listener.forms, fns = listener.fns; + + if (forms.indexOf(form) != -1) return; + forms.push(form); + + var _fn = function(event){ + bubbleUp(self, match, fn, event, target); + }; + form.addEvent(type, _fn); + fns.push(_fn); + + listeners[uid] = listener; + self.store(_key + type + 'listeners', listeners); + } + }; +}; + +var inputObserver = function(type){ + return { + base: 'focusin', + listen: function(self, match, fn, event, target){ + var events = {blur: function(){ + this.removeEvents(events); + }}; + events[type] = function(event){ + bubbleUp(self, match, fn, event, target); + }; + event.target.addEvents(events); + } + }; +}; + +if (!eventListenerSupport) Object.append(map, { + submit: formObserver('submit'), + reset: formObserver('reset'), + change: inputObserver('change'), + select: inputObserver('select') +}); +/**/ + +var proto = Element.prototype, + addEvent = proto.addEvent, + removeEvent = proto.removeEvent; + +var relay = function(old, method){ + return function(type, fn, useCapture){ + if (type.indexOf(':relay') == -1) return old.call(this, type, fn, useCapture); + var parsed = Slick.parse(type).expressions[0][0]; + if (parsed.pseudos[0].key != 'relay') return old.call(this, type, fn, useCapture); + var newType = parsed.tag; + parsed.pseudos.slice(1).each(function(pseudo){ + newType += ':' + pseudo.key + (pseudo.value ? '(' + pseudo.value + ')' : ''); + }); + old.call(this, type, fn); + return method.call(this, newType, parsed.pseudos[0].value, fn); + }; +}; + +var delegation = { + + addEvent: function(type, match, fn){ + var storage = this.retrieve('$delegates', {}), stored = storage[type]; + if (stored) for (var _uid in stored){ + if (stored[_uid].fn == fn && stored[_uid].match == match) return this; + } + + var _type = type, _match = match, _fn = fn, _map = map[type] || {}; + type = _map.base || _type; + + match = function(target){ + return Slick.match(target, _match); + }; + + var elementEvent = Element.Events[_type]; + if (elementEvent && elementEvent.condition){ + var __match = match, condition = elementEvent.condition; + match = function(target, event){ + return __match(target, event) && condition.call(target, event, type); + }; + } + + var self = this, uid = String.uniqueID(); + var delegator = _map.listen ? function(event, target){ + if (!target && event && event.target) target = event.target; + if (target) _map.listen(self, match, fn, event, target, uid); + } : function(event, target){ + if (!target && event && event.target) target = event.target; + if (target) bubbleUp(self, match, fn, event, target); + }; + + if (!stored) stored = {}; + stored[uid] = { + match: _match, + fn: _fn, + delegator: delegator + }; + storage[_type] = stored; + return addEvent.call(this, type, delegator, _map.capture); + }, + + removeEvent: function(type, match, fn, _uid){ + var storage = this.retrieve('$delegates', {}), stored = storage[type]; + if (!stored) return this; + + if (_uid){ + var _type = type, delegator = stored[_uid].delegator, _map = map[type] || {}; + type = _map.base || _type; + if (_map.remove) _map.remove(this, _uid); + delete stored[_uid]; + storage[_type] = stored; + return removeEvent.call(this, type, delegator); + } + + var __uid, s; + if (fn) for (__uid in stored){ + s = stored[__uid]; + if (s.match == match && s.fn == fn) return delegation.removeEvent.call(this, type, match, fn, __uid); + } else for (__uid in stored){ + s = stored[__uid]; + if (s.match == match) delegation.removeEvent.call(this, type, match, s.fn, __uid); + } + return this; + } + +}; + +[Element, Window, Document].invoke('implement', { + addEvent: relay(addEvent, delegation.addEvent), + removeEvent: relay(removeEvent, delegation.removeEvent) +}); + +})(); + + +/* +--- + +name: Element.Dimensions + +description: Contains methods to work with size, scroll, or positioning of Elements and the window object. + +license: MIT-style license. + +credits: + - Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html). + - Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html). + +requires: [Element, Element.Style] + +provides: [Element.Dimensions] + +... +*/ + +(function(){ + +var element = document.createElement('div'), + child = document.createElement('div'); +element.style.height = '0'; +element.appendChild(child); +var brokenOffsetParent = (child.offsetParent === element); +element = child = null; + +var isOffset = function(el){ + return styleString(el, 'position') != 'static' || isBody(el); +}; + +var isOffsetStatic = function(el){ + return isOffset(el) || (/^(?:table|td|th)$/i).test(el.tagName); +}; + +Element.implement({ + + scrollTo: function(x, y){ + if (isBody(this)){ + this.getWindow().scrollTo(x, y); + } else { + this.scrollLeft = x; + this.scrollTop = y; + } + return this; + }, + + getSize: function(){ + if (isBody(this)) return this.getWindow().getSize(); + return {x: this.offsetWidth, y: this.offsetHeight}; + }, + + getScrollSize: function(){ + if (isBody(this)) return this.getWindow().getScrollSize(); + return {x: this.scrollWidth, y: this.scrollHeight}; + }, + + getScroll: function(){ + if (isBody(this)) return this.getWindow().getScroll(); + return {x: this.scrollLeft, y: this.scrollTop}; + }, + + getScrolls: function(){ + var element = this.parentNode, position = {x: 0, y: 0}; + while (element && !isBody(element)){ + position.x += element.scrollLeft; + position.y += element.scrollTop; + element = element.parentNode; + } + return position; + }, + + getOffsetParent: brokenOffsetParent ? function(){ + var element = this; + if (isBody(element) || styleString(element, 'position') == 'fixed') return null; + + var isOffsetCheck = (styleString(element, 'position') == 'static') ? isOffsetStatic : isOffset; + while ((element = element.parentNode)){ + if (isOffsetCheck(element)) return element; + } + return null; + } : function(){ + var element = this; + if (isBody(element) || styleString(element, 'position') == 'fixed') return null; + + try { + return element.offsetParent; + } catch(e) {} + return null; + }, + + getOffsets: function(){ + if (this.getBoundingClientRect && !Browser.Platform.ios){ + var bound = this.getBoundingClientRect(), + html = document.id(this.getDocument().documentElement), + htmlScroll = html.getScroll(), + elemScrolls = this.getScrolls(), + isFixed = (styleString(this, 'position') == 'fixed'); + + return { + x: bound.left.toInt() + elemScrolls.x + ((isFixed) ? 0 : htmlScroll.x) - html.clientLeft, + y: bound.top.toInt() + elemScrolls.y + ((isFixed) ? 0 : htmlScroll.y) - html.clientTop + }; + } + + var element = this, position = {x: 0, y: 0}; + if (isBody(this)) return position; + + while (element && !isBody(element)){ + position.x += element.offsetLeft; + position.y += element.offsetTop; + + if (Browser.firefox){ + if (!borderBox(element)){ + position.x += leftBorder(element); + position.y += topBorder(element); + } + var parent = element.parentNode; + if (parent && styleString(parent, 'overflow') != 'visible'){ + position.x += leftBorder(parent); + position.y += topBorder(parent); + } + } else if (element != this && Browser.safari){ + position.x += leftBorder(element); + position.y += topBorder(element); + } + + element = element.offsetParent; + } + if (Browser.firefox && !borderBox(this)){ + position.x -= leftBorder(this); + position.y -= topBorder(this); + } + return position; + }, + + getPosition: function(relative){ + var offset = this.getOffsets(), + scroll = this.getScrolls(); + var position = { + x: offset.x - scroll.x, + y: offset.y - scroll.y + }; + + if (relative && (relative = document.id(relative))){ + var relativePosition = relative.getPosition(); + return {x: position.x - relativePosition.x - leftBorder(relative), y: position.y - relativePosition.y - topBorder(relative)}; + } + return position; + }, + + getCoordinates: function(element){ + if (isBody(this)) return this.getWindow().getCoordinates(); + var position = this.getPosition(element), + size = this.getSize(); + var obj = { + left: position.x, + top: position.y, + width: size.x, + height: size.y + }; + obj.right = obj.left + obj.width; + obj.bottom = obj.top + obj.height; + return obj; + }, + + computePosition: function(obj){ + return { + left: obj.x - styleNumber(this, 'margin-left'), + top: obj.y - styleNumber(this, 'margin-top') + }; + }, + + setPosition: function(obj){ + return this.setStyles(this.computePosition(obj)); + } + +}); + + +[Document, Window].invoke('implement', { + + getSize: function(){ + var doc = getCompatElement(this); + return {x: doc.clientWidth, y: doc.clientHeight}; + }, + + getScroll: function(){ + var win = this.getWindow(), doc = getCompatElement(this); + return {x: win.pageXOffset || doc.scrollLeft, y: win.pageYOffset || doc.scrollTop}; + }, + + getScrollSize: function(){ + var doc = getCompatElement(this), + min = this.getSize(), + body = this.getDocument().body; + + return {x: Math.max(doc.scrollWidth, body.scrollWidth, min.x), y: Math.max(doc.scrollHeight, body.scrollHeight, min.y)}; + }, + + getPosition: function(){ + return {x: 0, y: 0}; + }, + + getCoordinates: function(){ + var size = this.getSize(); + return {top: 0, left: 0, bottom: size.y, right: size.x, height: size.y, width: size.x}; + } + +}); + +// private methods + +var styleString = Element.getComputedStyle; + +function styleNumber(element, style){ + return styleString(element, style).toInt() || 0; +} + +function borderBox(element){ + return styleString(element, '-moz-box-sizing') == 'border-box'; +} + +function topBorder(element){ + return styleNumber(element, 'border-top-width'); +} + +function leftBorder(element){ + return styleNumber(element, 'border-left-width'); +} + +function isBody(element){ + return (/^(?:body|html)$/i).test(element.tagName); +} + +function getCompatElement(element){ + var doc = element.getDocument(); + return (!doc.compatMode || doc.compatMode == 'CSS1Compat') ? doc.html : doc.body; +} + +})(); + +//aliases +Element.alias({position: 'setPosition'}); //compatability + +[Window, Document, Element].invoke('implement', { + + getHeight: function(){ + return this.getSize().y; + }, + + getWidth: function(){ + return this.getSize().x; + }, + + getScrollTop: function(){ + return this.getScroll().y; + }, + + getScrollLeft: function(){ + return this.getScroll().x; + }, + + getScrollHeight: function(){ + return this.getScrollSize().y; + }, + + getScrollWidth: function(){ + return this.getScrollSize().x; + }, + + getTop: function(){ + return this.getPosition().y; + }, + + getLeft: function(){ + return this.getPosition().x; + } + +}); + + +/* +--- + +name: Fx + +description: Contains the basic animation logic to be extended by all other Fx Classes. + +license: MIT-style license. + +requires: [Chain, Events, Options] + +provides: Fx + +... +*/ + +(function(){ + +var Fx = this.Fx = new Class({ + + Implements: [Chain, Events, Options], + + options: { + /* + onStart: nil, + onCancel: nil, + onComplete: nil, + */ + fps: 60, + unit: false, + duration: 500, + frames: null, + frameSkip: true, + link: 'ignore' + }, + + initialize: function(options){ + this.subject = this.subject || this; + this.setOptions(options); + }, + + getTransition: function(){ + return function(p){ + return -(Math.cos(Math.PI * p) - 1) / 2; + }; + }, + + step: function(now){ + if (this.options.frameSkip){ + var diff = (this.time != null) ? (now - this.time) : 0, frames = diff / this.frameInterval; + this.time = now; + this.frame += frames; + } else { + this.frame++; + } + + if (this.frame < this.frames){ + var delta = this.transition(this.frame / this.frames); + this.set(this.compute(this.from, this.to, delta)); + } else { + this.frame = this.frames; + this.set(this.compute(this.from, this.to, 1)); + this.stop(); + } + }, + + set: function(now){ + return now; + }, + + compute: function(from, to, delta){ + return Fx.compute(from, to, delta); + }, + + check: function(){ + if (!this.isRunning()) return true; + switch (this.options.link){ + case 'cancel': this.cancel(); return true; + case 'chain': this.chain(this.caller.pass(arguments, this)); return false; + } + return false; + }, + + start: function(from, to){ + if (!this.check(from, to)) return this; + this.from = from; + this.to = to; + this.frame = (this.options.frameSkip) ? 0 : -1; + this.time = null; + this.transition = this.getTransition(); + var frames = this.options.frames, fps = this.options.fps, duration = this.options.duration; + this.duration = Fx.Durations[duration] || duration.toInt(); + this.frameInterval = 1000 / fps; + this.frames = frames || Math.round(this.duration / this.frameInterval); + this.fireEvent('start', this.subject); + pushInstance.call(this, fps); + return this; + }, + + stop: function(){ + if (this.isRunning()){ + this.time = null; + pullInstance.call(this, this.options.fps); + if (this.frames == this.frame){ + this.fireEvent('complete', this.subject); + if (!this.callChain()) this.fireEvent('chainComplete', this.subject); + } else { + this.fireEvent('stop', this.subject); + } + } + return this; + }, + + cancel: function(){ + if (this.isRunning()){ + this.time = null; + pullInstance.call(this, this.options.fps); + this.frame = this.frames; + this.fireEvent('cancel', this.subject).clearChain(); + } + return this; + }, + + pause: function(){ + if (this.isRunning()){ + this.time = null; + pullInstance.call(this, this.options.fps); + } + return this; + }, + + resume: function(){ + if ((this.frame < this.frames) && !this.isRunning()) pushInstance.call(this, this.options.fps); + return this; + }, + + isRunning: function(){ + var list = instances[this.options.fps]; + return list && list.contains(this); + } + +}); + +Fx.compute = function(from, to, delta){ + return (to - from) * delta + from; +}; + +Fx.Durations = {'short': 250, 'normal': 500, 'long': 1000}; + +// global timers + +var instances = {}, timers = {}; + +var loop = function(){ + var now = Date.now(); + for (var i = this.length; i--;){ + var instance = this[i]; + if (instance) instance.step(now); + } +}; + +var pushInstance = function(fps){ + var list = instances[fps] || (instances[fps] = []); + list.push(this); + if (!timers[fps]) timers[fps] = loop.periodical(Math.round(1000 / fps), list); +}; + +var pullInstance = function(fps){ + var list = instances[fps]; + if (list){ + list.erase(this); + if (!list.length && timers[fps]){ + delete instances[fps]; + timers[fps] = clearInterval(timers[fps]); + } + } +}; + +})(); + + +/* +--- + +name: Fx.CSS + +description: Contains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements. + +license: MIT-style license. + +requires: [Fx, Element.Style] + +provides: Fx.CSS + +... +*/ + +Fx.CSS = new Class({ + + Extends: Fx, + + //prepares the base from/to object + + prepare: function(element, property, values){ + values = Array.from(values); + if (values[1] == null){ + values[1] = values[0]; + values[0] = element.getStyle(property); + // adapted from: https://github.com/ryanmorr/fx/blob/master/fx.js#L299 + if (this.options.unit != 'px'){ + element.setStyle(property, values[1] + this.options.unit); + values[0] = (values[1] || 1) / parseFloat(element.getComputedStyle(property)) * (parseFloat(values[0]) || 0); + element.setStyle(property, values[0] + this.options.unit); + } + } + var parsed = values.map(this.parse); + return {from: parsed[0], to: parsed[1]}; + }, + + //parses a value into an array + + parse: function(value){ + value = Function.from(value)(); + value = (typeof value == 'string') ? value.split(' ') : Array.from(value); + return value.map(function(val){ + val = String(val); + var found = false; + Object.each(Fx.CSS.Parsers, function(parser, key){ + if (found) return; + var parsed = parser.parse(val); + if (parsed || parsed === 0) found = {value: parsed, parser: parser}; + }); + found = found || {value: val, parser: Fx.CSS.Parsers.String}; + return found; + }); + }, + + //computes by a from and to prepared objects, using their parsers. + + compute: function(from, to, delta){ + var computed = []; + (Math.min(from.length, to.length)).times(function(i){ + computed.push({value: from[i].parser.compute(from[i].value, to[i].value, delta), parser: from[i].parser}); + }); + computed.$family = Function.from('fx:css:value'); + return computed; + }, + + //serves the value as settable + + serve: function(value, unit){ + if (typeOf(value) != 'fx:css:value') value = this.parse(value); + var returned = []; + value.each(function(bit){ + returned = returned.concat(bit.parser.serve(bit.value, unit)); + }); + return returned; + }, + + //renders the change to an element + + render: function(element, property, value, unit){ + element.setStyle(property, this.serve(value, unit)); + }, + + //searches inside the page css to find the values for a selector + + search: function(selector){ + if (Fx.CSS.Cache[selector]) return Fx.CSS.Cache[selector]; + var to = {}, selectorTest = new RegExp('^' + selector.escapeRegExp() + '$'); + Array.each(document.styleSheets, function(sheet, j){ + var href = sheet.href; + if (href && href.contains('://') && !href.contains(document.domain)) return; + var rules = sheet.rules || sheet.cssRules; + Array.each(rules, function(rule, i){ + if (!rule.style) return; + var selectorText = (rule.selectorText) ? rule.selectorText.replace(/^\w+/, function(m){ + return m.toLowerCase(); + }) : null; + if (!selectorText || !selectorTest.test(selectorText)) return; + Object.each(Element.Styles, function(value, style){ + if (!rule.style[style] || Element.ShortStyles[style]) return; + value = String(rule.style[style]); + to[style] = ((/^rgb/).test(value)) ? value.rgbToHex() : value; + }); + }); + }); + return Fx.CSS.Cache[selector] = to; + } + +}); + +Fx.CSS.Cache = {}; + +Fx.CSS.Parsers = { + + Color: { + parse: function(value){ + if (value.match(/^#[0-9a-f]{3,6}$/i)) return value.hexToRgb(true); + return ((value = value.match(/(\d+),\s*(\d+),\s*(\d+)/))) ? [value[1], value[2], value[3]] : false; + }, + compute: function(from, to, delta){ + return from.map(function(value, i){ + return Math.round(Fx.compute(from[i], to[i], delta)); + }); + }, + serve: function(value){ + return value.map(Number); + } + }, + + Number: { + parse: parseFloat, + compute: Fx.compute, + serve: function(value, unit){ + return (unit) ? value + unit : value; + } + }, + + String: { + parse: Function.from(false), + compute: function(zero, one){ + return one; + }, + serve: function(zero){ + return zero; + } + } + +}; + + + + +/* +--- + +name: Fx.Tween + +description: Formerly Fx.Style, effect to transition any CSS property for an element. + +license: MIT-style license. + +requires: Fx.CSS + +provides: [Fx.Tween, Element.fade, Element.highlight] + +... +*/ + +Fx.Tween = new Class({ + + Extends: Fx.CSS, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + }, + + set: function(property, now){ + if (arguments.length == 1){ + now = property; + property = this.property || this.options.property; + } + this.render(this.element, property, now, this.options.unit); + return this; + }, + + start: function(property, from, to){ + if (!this.check(property, from, to)) return this; + var args = Array.flatten(arguments); + this.property = this.options.property || args.shift(); + var parsed = this.prepare(this.element, this.property, args); + return this.parent(parsed.from, parsed.to); + } + +}); + +Element.Properties.tween = { + + set: function(options){ + this.get('tween').cancel().setOptions(options); + return this; + }, + + get: function(){ + var tween = this.retrieve('tween'); + if (!tween){ + tween = new Fx.Tween(this, {link: 'cancel'}); + this.store('tween', tween); + } + return tween; + } + +}; + +Element.implement({ + + tween: function(property, from, to){ + this.get('tween').start(property, from, to); + return this; + }, + + fade: function(how){ + var fade = this.get('tween'), method, args = ['opacity'].append(arguments), toggle; + if (args[1] == null) args[1] = 'toggle'; + switch (args[1]){ + case 'in': method = 'start'; args[1] = 1; break; + case 'out': method = 'start'; args[1] = 0; break; + case 'show': method = 'set'; args[1] = 1; break; + case 'hide': method = 'set'; args[1] = 0; break; + case 'toggle': + var flag = this.retrieve('fade:flag', this.getStyle('opacity') == 1); + method = 'start'; + args[1] = flag ? 0 : 1; + this.store('fade:flag', !flag); + toggle = true; + break; + default: method = 'start'; + } + if (!toggle) this.eliminate('fade:flag'); + fade[method].apply(fade, args); + var to = args[args.length - 1]; + if (method == 'set' || to != 0) this.setStyle('visibility', to == 0 ? 'hidden' : 'visible'); + else fade.chain(function(){ + this.element.setStyle('visibility', 'hidden'); + this.callChain(); + }); + return this; + }, + + highlight: function(start, end){ + if (!end){ + end = this.retrieve('highlight:original', this.getStyle('background-color')); + end = (end == 'transparent') ? '#fff' : end; + } + var tween = this.get('tween'); + tween.start('background-color', start || '#ffff88', end).chain(function(){ + this.setStyle('background-color', this.retrieve('highlight:original')); + tween.callChain(); + }.bind(this)); + return this; + } + +}); + + +/* +--- + +name: Fx.Morph + +description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules. + +license: MIT-style license. + +requires: Fx.CSS + +provides: Fx.Morph + +... +*/ + +Fx.Morph = new Class({ + + Extends: Fx.CSS, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + }, + + set: function(now){ + if (typeof now == 'string') now = this.search(now); + for (var p in now) this.render(this.element, p, now[p], this.options.unit); + return this; + }, + + compute: function(from, to, delta){ + var now = {}; + for (var p in from) now[p] = this.parent(from[p], to[p], delta); + return now; + }, + + start: function(properties){ + if (!this.check(properties)) return this; + if (typeof properties == 'string') properties = this.search(properties); + var from = {}, to = {}; + for (var p in properties){ + var parsed = this.prepare(this.element, p, properties[p]); + from[p] = parsed.from; + to[p] = parsed.to; + } + return this.parent(from, to); + } + +}); + +Element.Properties.morph = { + + set: function(options){ + this.get('morph').cancel().setOptions(options); + return this; + }, + + get: function(){ + var morph = this.retrieve('morph'); + if (!morph){ + morph = new Fx.Morph(this, {link: 'cancel'}); + this.store('morph', morph); + } + return morph; + } + +}; + +Element.implement({ + + morph: function(props){ + this.get('morph').start(props); + return this; + } + +}); + + +/* +--- + +name: Fx.Transitions + +description: Contains a set of advanced transitions to be used with any of the Fx Classes. + +license: MIT-style license. + +credits: + - Easing Equations by Robert Penner, , modified and optimized to be used with MooTools. + +requires: Fx + +provides: Fx.Transitions + +... +*/ + +Fx.implement({ + + getTransition: function(){ + var trans = this.options.transition || Fx.Transitions.Sine.easeInOut; + if (typeof trans == 'string'){ + var data = trans.split(':'); + trans = Fx.Transitions; + trans = trans[data[0]] || trans[data[0].capitalize()]; + if (data[1]) trans = trans['ease' + data[1].capitalize() + (data[2] ? data[2].capitalize() : '')]; + } + return trans; + } + +}); + +Fx.Transition = function(transition, params){ + params = Array.from(params); + var easeIn = function(pos){ + return transition(pos, params); + }; + return Object.append(easeIn, { + easeIn: easeIn, + easeOut: function(pos){ + return 1 - transition(1 - pos, params); + }, + easeInOut: function(pos){ + return (pos <= 0.5 ? transition(2 * pos, params) : (2 - transition(2 * (1 - pos), params))) / 2; + } + }); +}; + +Fx.Transitions = { + + linear: function(zero){ + return zero; + } + +}; + + + +Fx.Transitions.extend = function(transitions){ + for (var transition in transitions) Fx.Transitions[transition] = new Fx.Transition(transitions[transition]); +}; + +Fx.Transitions.extend({ + + Pow: function(p, x){ + return Math.pow(p, x && x[0] || 6); + }, + + Expo: function(p){ + return Math.pow(2, 8 * (p - 1)); + }, + + Circ: function(p){ + return 1 - Math.sin(Math.acos(p)); + }, + + Sine: function(p){ + return 1 - Math.cos(p * Math.PI / 2); + }, + + Back: function(p, x){ + x = x && x[0] || 1.618; + return Math.pow(p, 2) * ((x + 1) * p - x); + }, + + Bounce: function(p){ + var value; + for (var a = 0, b = 1; 1; a += b, b /= 2){ + if (p >= (7 - 4 * a) / 11){ + value = b * b - Math.pow((11 - 6 * a - 11 * p) / 4, 2); + break; + } + } + return value; + }, + + Elastic: function(p, x){ + return Math.pow(2, 10 * --p) * Math.cos(20 * p * Math.PI * (x && x[0] || 1) / 3); + } + +}); + +['Quad', 'Cubic', 'Quart', 'Quint'].each(function(transition, i){ + Fx.Transitions[transition] = new Fx.Transition(function(p){ + return Math.pow(p, i + 2); + }); +}); + + +/* +--- + +name: Request + +description: Powerful all purpose Request Class. Uses XMLHTTPRequest. + +license: MIT-style license. + +requires: [Object, Element, Chain, Events, Options, Browser] + +provides: Request + +... +*/ + +(function(){ + +var empty = function(){}, + progressSupport = ('onprogress' in new Browser.Request); + +var Request = this.Request = new Class({ + + Implements: [Chain, Events, Options], + + options: {/* + onRequest: function(){}, + onLoadstart: function(event, xhr){}, + onProgress: function(event, xhr){}, + onComplete: function(){}, + onCancel: function(){}, + onSuccess: function(responseText, responseXML){}, + onFailure: function(xhr){}, + onException: function(headerName, value){}, + onTimeout: function(){}, + user: '', + password: '',*/ + url: '', + data: '', + headers: { + 'X-Requested-With': 'XMLHttpRequest', + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }, + async: true, + format: false, + method: 'post', + link: 'ignore', + isSuccess: null, + emulation: true, + urlEncoded: true, + encoding: 'utf-8', + evalScripts: false, + evalResponse: false, + timeout: 0, + noCache: false + }, + + initialize: function(options){ + this.xhr = new Browser.Request(); + this.setOptions(options); + this.headers = this.options.headers; + }, + + onStateChange: function(){ + var xhr = this.xhr; + if (xhr.readyState != 4 || !this.running) return; + this.running = false; + this.status = 0; + Function.attempt(function(){ + var status = xhr.status; + this.status = (status == 1223) ? 204 : status; + }.bind(this)); + xhr.onreadystatechange = empty; + if (progressSupport) xhr.onprogress = xhr.onloadstart = empty; + clearTimeout(this.timer); + + this.response = {text: this.xhr.responseText || '', xml: this.xhr.responseXML}; + if (this.options.isSuccess.call(this, this.status)) + this.success(this.response.text, this.response.xml); + else + this.failure(); + }, + + isSuccess: function(){ + var status = this.status; + return (status >= 200 && status < 300); + }, + + isRunning: function(){ + return !!this.running; + }, + + processScripts: function(text){ + if (this.options.evalResponse || (/(ecma|java)script/).test(this.getHeader('Content-type'))) return Browser.exec(text); + return text.stripScripts(this.options.evalScripts); + }, + + success: function(text, xml){ + this.onSuccess(this.processScripts(text), xml); + }, + + onSuccess: function(){ + this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain(); + }, + + failure: function(){ + this.onFailure(); + }, + + onFailure: function(){ + this.fireEvent('complete').fireEvent('failure', this.xhr); + }, + + loadstart: function(event){ + this.fireEvent('loadstart', [event, this.xhr]); + }, + + progress: function(event){ + this.fireEvent('progress', [event, this.xhr]); + }, + + timeout: function(){ + this.fireEvent('timeout', this.xhr); + }, + + setHeader: function(name, value){ + this.headers[name] = value; + return this; + }, + + getHeader: function(name){ + return Function.attempt(function(){ + return this.xhr.getResponseHeader(name); + }.bind(this)); + }, + + check: function(){ + if (!this.running) return true; + switch (this.options.link){ + case 'cancel': this.cancel(); return true; + case 'chain': this.chain(this.caller.pass(arguments, this)); return false; + } + return false; + }, + + send: function(options){ + if (!this.check(options)) return this; + + this.options.isSuccess = this.options.isSuccess || this.isSuccess; + this.running = true; + + var type = typeOf(options); + if (type == 'string' || type == 'element') options = {data: options}; + + var old = this.options; + options = Object.append({data: old.data, url: old.url, method: old.method}, options); + var data = options.data, url = String(options.url), method = options.method.toLowerCase(); + + switch (typeOf(data)){ + case 'element': data = document.id(data).toQueryString(); break; + case 'object': case 'hash': data = Object.toQueryString(data); + } + + if (this.options.format){ + var format = 'format=' + this.options.format; + data = (data) ? format + '&' + data : format; + } + + if (this.options.emulation && !['get', 'post'].contains(method)){ + var _method = '_method=' + method; + data = (data) ? _method + '&' + data : _method; + method = 'post'; + } + + if (this.options.urlEncoded && ['post', 'put'].contains(method)){ + var encoding = (this.options.encoding) ? '; charset=' + this.options.encoding : ''; + this.headers['Content-type'] = 'application/x-www-form-urlencoded' + encoding; + } + + if (!url) url = document.location.pathname; + + var trimPosition = url.lastIndexOf('/'); + if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition); + + if (this.options.noCache) + url += (url.contains('?') ? '&' : '?') + String.uniqueID(); + + if (data && method == 'get'){ + url += (url.contains('?') ? '&' : '?') + data; + data = null; + } + + var xhr = this.xhr; + if (progressSupport){ + xhr.onloadstart = this.loadstart.bind(this); + xhr.onprogress = this.progress.bind(this); + } + + xhr.open(method.toUpperCase(), url, this.options.async, this.options.user, this.options.password); + if (this.options.user && 'withCredentials' in xhr) xhr.withCredentials = true; + + xhr.onreadystatechange = this.onStateChange.bind(this); + + Object.each(this.headers, function(value, key){ + try { + xhr.setRequestHeader(key, value); + } catch (e){ + this.fireEvent('exception', [key, value]); + } + }, this); + + this.fireEvent('request'); + xhr.send(data); + if (!this.options.async) this.onStateChange(); + else if (this.options.timeout) this.timer = this.timeout.delay(this.options.timeout, this); + return this; + }, + + cancel: function(){ + if (!this.running) return this; + this.running = false; + var xhr = this.xhr; + xhr.abort(); + clearTimeout(this.timer); + xhr.onreadystatechange = empty; + if (progressSupport) xhr.onprogress = xhr.onloadstart = empty; + this.xhr = new Browser.Request(); + this.fireEvent('cancel'); + return this; + } + +}); + +var methods = {}; +['get', 'post', 'put', 'delete', 'GET', 'POST', 'PUT', 'DELETE'].each(function(method){ + methods[method] = function(data){ + var object = { + method: method + }; + if (data != null) object.data = data; + return this.send(object); + }; +}); + +Request.implement(methods); + +Element.Properties.send = { + + set: function(options){ + var send = this.get('send').cancel(); + send.setOptions(options); + return this; + }, + + get: function(){ + var send = this.retrieve('send'); + if (!send){ + send = new Request({ + data: this, link: 'cancel', method: this.get('method') || 'post', url: this.get('action') + }); + this.store('send', send); + } + return send; + } + +}; + +Element.implement({ + + send: function(url){ + var sender = this.get('send'); + sender.send({data: this, url: url || sender.options.url}); + return this; + } + +}); + +})(); + + +/* +--- + +name: Request.HTML + +description: Extends the basic Request Class with additional methods for interacting with HTML responses. + +license: MIT-style license. + +requires: [Element, Request] + +provides: Request.HTML + +... +*/ + +Request.HTML = new Class({ + + Extends: Request, + + options: { + update: false, + append: false, + evalScripts: true, + filter: false, + headers: { + Accept: 'text/html, application/xml, text/xml, */*' + } + }, + + success: function(text){ + var options = this.options, response = this.response; + + response.html = text.stripScripts(function(script){ + response.javascript = script; + }); + + var match = response.html.match(/]*>([\s\S]*?)<\/body>/i); + if (match) response.html = match[1]; + var temp = new Element('div').set('html', response.html); + + response.tree = temp.childNodes; + response.elements = temp.getElements(options.filter || '*'); + + if (options.filter) response.tree = response.elements; + if (options.update){ + var update = document.id(options.update).empty(); + if (options.filter) update.adopt(response.elements); + else update.set('html', response.html); + } else if (options.append){ + var append = document.id(options.append); + if (options.filter) response.elements.reverse().inject(append); + else append.adopt(temp.getChildren()); + } + if (options.evalScripts) Browser.exec(response.javascript); + + this.onSuccess(response.tree, response.elements, response.html, response.javascript); + } + +}); + +Element.Properties.load = { + + set: function(options){ + var load = this.get('load').cancel(); + load.setOptions(options); + return this; + }, + + get: function(){ + var load = this.retrieve('load'); + if (!load){ + load = new Request.HTML({data: this, link: 'cancel', update: this, method: 'get'}); + this.store('load', load); + } + return load; + } + +}; + +Element.implement({ + + load: function(){ + this.get('load').send(Array.link(arguments, {data: Type.isObject, url: Type.isString})); + return this; + } + +}); + + +/* +--- + +name: JSON + +description: JSON encoder and decoder. + +license: MIT-style license. + +SeeAlso: + +requires: [Array, String, Number, Function] + +provides: JSON + +... +*/ + +if (typeof JSON == 'undefined') this.JSON = {}; + + + +(function(){ + +var special = {'\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\'}; + +var escape = function(chr){ + return special[chr] || '\\u' + ('0000' + chr.charCodeAt(0).toString(16)).slice(-4); +}; + +JSON.validate = function(string){ + string = string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). + replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). + replace(/(?:^|:|,)(?:\s*\[)+/g, ''); + + return (/^[\],:{}\s]*$/).test(string); +}; + +JSON.encode = JSON.stringify ? function(obj){ + return JSON.stringify(obj); +} : function(obj){ + if (obj && obj.toJSON) obj = obj.toJSON(); + + switch (typeOf(obj)){ + case 'string': + return '"' + obj.replace(/[\x00-\x1f\\"]/g, escape) + '"'; + case 'array': + return '[' + obj.map(JSON.encode).clean() + ']'; + case 'object': case 'hash': + var string = []; + Object.each(obj, function(value, key){ + var json = JSON.encode(value); + if (json) string.push(JSON.encode(key) + ':' + json); + }); + return '{' + string + '}'; + case 'number': case 'boolean': return '' + obj; + case 'null': return 'null'; + } + + return null; +}; + +JSON.decode = function(string, secure){ + if (!string || typeOf(string) != 'string') return null; + + if (secure || JSON.secure){ + if (JSON.parse) return JSON.parse(string); + if (!JSON.validate(string)) throw new Error('JSON could not decode the input; security is enabled and the value is not secure.'); + } + + return eval('(' + string + ')'); +}; + +})(); + + +/* +--- + +name: Request.JSON + +description: Extends the basic Request Class with additional methods for sending and receiving JSON data. + +license: MIT-style license. + +requires: [Request, JSON] + +provides: Request.JSON + +... +*/ + +Request.JSON = new Class({ + + Extends: Request, + + options: { + /*onError: function(text, error){},*/ + secure: true + }, + + initialize: function(options){ + this.parent(options); + Object.append(this.headers, { + 'Accept': 'application/json', + 'X-Request': 'JSON' + }); + }, + + success: function(text){ + var json; + try { + json = this.response.json = JSON.decode(text, this.options.secure); + } catch (error){ + this.fireEvent('error', [text, error]); + return; + } + if (json == null) this.onFailure(); + else this.onSuccess(json, text); + } + +}); + + +/* +--- + +name: Cookie + +description: Class for creating, reading, and deleting browser Cookies. + +license: MIT-style license. + +credits: + - Based on the functions by Peter-Paul Koch (http://quirksmode.org). + +requires: [Options, Browser] + +provides: Cookie + +... +*/ + +var Cookie = new Class({ + + Implements: Options, + + options: { + path: '/', + domain: false, + duration: false, + secure: false, + document: document, + encode: true + }, + + initialize: function(key, options){ + this.key = key; + this.setOptions(options); + }, + + write: function(value){ + if (this.options.encode) value = encodeURIComponent(value); + if (this.options.domain) value += '; domain=' + this.options.domain; + if (this.options.path) value += '; path=' + this.options.path; + if (this.options.duration){ + var date = new Date(); + date.setTime(date.getTime() + this.options.duration * 24 * 60 * 60 * 1000); + value += '; expires=' + date.toGMTString(); + } + if (this.options.secure) value += '; secure'; + this.options.document.cookie = this.key + '=' + value; + return this; + }, + + read: function(){ + var value = this.options.document.cookie.match('(?:^|;)\\s*' + this.key.escapeRegExp() + '=([^;]*)'); + return (value) ? decodeURIComponent(value[1]) : null; + }, + + dispose: function(){ + new Cookie(this.key, Object.merge({}, this.options, {duration: -1})).write(''); + return this; + } + +}); + +Cookie.write = function(key, value, options){ + return new Cookie(key, options).write(value); +}; + +Cookie.read = function(key){ + return new Cookie(key).read(); +}; + +Cookie.dispose = function(key, options){ + return new Cookie(key, options).dispose(); +}; + + +/* +--- + +name: DOMReady + +description: Contains the custom event domready. + +license: MIT-style license. + +requires: [Browser, Element, Element.Event] + +provides: [DOMReady, DomReady] + +... +*/ + +(function(window, document){ + +var ready, + loaded, + checks = [], + shouldPoll, + timer, + testElement = document.createElement('div'); + +var domready = function(){ + clearTimeout(timer); + if (ready) return; + Browser.loaded = ready = true; + document.removeListener('DOMContentLoaded', domready).removeListener('readystatechange', check); + + document.fireEvent('domready'); + window.fireEvent('domready'); +}; + +var check = function(){ + for (var i = checks.length; i--;) if (checks[i]()){ + domready(); + return true; + } + return false; +}; + +var poll = function(){ + clearTimeout(timer); + if (!check()) timer = setTimeout(poll, 10); +}; + +document.addListener('DOMContentLoaded', domready); + +/**/ +// doScroll technique by Diego Perini http://javascript.nwbox.com/IEContentLoaded/ +// testElement.doScroll() throws when the DOM is not ready, only in the top window +var doScrollWorks = function(){ + try { + testElement.doScroll(); + return true; + } catch (e){} + return false; +}; +// If doScroll works already, it can't be used to determine domready +// e.g. in an iframe +if (testElement.doScroll && !doScrollWorks()){ + checks.push(doScrollWorks); + shouldPoll = true; +} +/**/ + +if (document.readyState) checks.push(function(){ + var state = document.readyState; + return (state == 'loaded' || state == 'complete'); +}); + +if ('onreadystatechange' in document) document.addListener('readystatechange', check); +else shouldPoll = true; + +if (shouldPoll) poll(); + +Element.Events.domready = { + onAdd: function(fn){ + if (ready) fn.call(this); + } +}; + +// Make sure that domready fires before load +Element.Events.load = { + base: 'load', + onAdd: function(fn){ + if (loaded && this == window) fn.call(this); + }, + condition: function(){ + if (this == window){ + domready(); + delete Element.Events.load; + } + return true; + } +}; + +// This is based on the custom load event +window.addEvent('load', function(){ + loaded = true; +}); + +})(window, document); + + +/* +--- + +name: Swiff + +description: Wrapper for embedding SWF movies. Supports External Interface Communication. + +license: MIT-style license. + +credits: + - Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject. + +requires: [Options, Object, Element] + +provides: Swiff + +... +*/ + +(function(){ + +var Swiff = this.Swiff = new Class({ + + Implements: Options, + + options: { + id: null, + height: 1, + width: 1, + container: null, + properties: {}, + params: { + quality: 'high', + allowScriptAccess: 'always', + wMode: 'window', + swLiveConnect: true + }, + callBacks: {}, + vars: {} + }, + + toElement: function(){ + return this.object; + }, + + initialize: function(path, options){ + this.instance = 'Swiff_' + String.uniqueID(); + + this.setOptions(options); + options = this.options; + var id = this.id = options.id || this.instance; + var container = document.id(options.container); + + Swiff.CallBacks[this.instance] = {}; + + var params = options.params, vars = options.vars, callBacks = options.callBacks; + var properties = Object.append({height: options.height, width: options.width}, options.properties); + + var self = this; + + for (var callBack in callBacks){ + Swiff.CallBacks[this.instance][callBack] = (function(option){ + return function(){ + return option.apply(self.object, arguments); + }; + })(callBacks[callBack]); + vars[callBack] = 'Swiff.CallBacks.' + this.instance + '.' + callBack; + } + + params.flashVars = Object.toQueryString(vars); + if (Browser.ie){ + properties.classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; + params.movie = path; + } else { + properties.type = 'application/x-shockwave-flash'; + } + properties.data = path; + + var build = ''; + } + build += ''; + this.object = ((container) ? container.empty() : new Element('div')).set('html', build).firstChild; + }, + + replaces: function(element){ + element = document.id(element, true); + element.parentNode.replaceChild(this.toElement(), element); + return this; + }, + + inject: function(element){ + document.id(element, true).appendChild(this.toElement()); + return this; + }, + + remote: function(){ + return Swiff.remote.apply(Swiff, [this.toElement()].append(arguments)); + } + +}); + +Swiff.CallBacks = {}; + +Swiff.remote = function(obj, fn){ + var rs = obj.CallFunction('' + __flash__argumentsToXML(arguments, 2) + ''); + return eval(rs); +}; + +})(); + diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-more-1.4.0.1-yc.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-more-1.4.0.1-yc.js new file mode 100644 index 00000000000..b67bcfb1545 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-more-1.4.0.1-yc.js @@ -0,0 +1,438 @@ +// MooTools: the javascript framework. +// Load this file's selection again by visiting: http://mootools.net/more/fb61ad1e1a36c672a3470d3640c69d38 +// Or build this file again with packager using: packager build More/More More/Class.Refactor More/Class.Binds More/Class.Occlude More/Date More/Date.Extras More/String.Extras More/String.QueryString More/Element.Forms More/Elements.From More/Element.Measure More/Element.Position More/Element.Shortcuts More/Form.Validator More/Fx.Elements More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag More/Drag.Move More/Slider More/Sortables More/Request.Periodical More/Assets More/IframeShim More/Mask More/Tips More/Spinner More/Locale.en-US.Date +/* +--- +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ +MooTools.More={version:"1.4.0.1",build:"a4244edf2aa97ac8a196fc96082dd35af1abab87"};Class.refactor=function(b,a){Object.each(a,function(e,d){var c=b.prototype[d]; +c=(c&&c.$origin)||c||function(){};b.implement(d,(typeof e=="function")?function(){var f=this.previous;this.previous=c;var g=e.apply(this,arguments);this.previous=f; +return g;}:e);});return b;};Class.Mutators.Binds=function(a){if(!this.prototype.initialize){this.implement("initialize",function(){});}return Array.from(a).concat(this.prototype.Binds||[]); +};Class.Mutators.initialize=function(a){return function(){Array.from(this.Binds).each(function(b){var c=this[b];if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments); +};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property);if(a&&!this.occluded){return(this.occluded=a); +}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});(function(){var b=function(c){return c!=null;};var a=Object.prototype.hasOwnProperty; +Object.extend({getFromPath:function(e,f){if(typeof f=="string"){f=f.split(".");}for(var d=0,c=f.length;d3&&a<21)?"th":["th","st","nd","rd","th"][Math.min(a%10,4)]; +},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"}); +(function(){var a=this.Date;var f=a.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds","UTCMilliseconds"].each(function(s){a.Methods[s.toLowerCase()]=s; +});var p=function(u,t,s){if(t==1){return u;}return u28){return 1;}if(y==0&&s<-2){x=new a(x).decrement("day",u); +u=0;}w=new a(x.get("year"),0,1).get("day")||7;if(w>4){t=-7;}}else{w=new a(x.get("year"),0,1).get("day");}t+=x.get("dayofyear");t+=6-u;t+=(7+w-v)%7;return(t/7); +},getOrdinal:function(s){return a.getMsg("ordinal",s||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3"); +},getGMTOffset:function(){var s=this.get("timezoneOffset");return((s>0)?"-":"+")+p((s.abs()/60).floor(),2)+p(s%60,2);},setAMPM:function(s){s=s.toUpperCase(); +var t=this.get("hr");if(t>11&&s=="AM"){return this.decrement("hour",12);}else{if(t<12&&s=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"; +},parse:function(s){this.set("time",a.parse(s));return this;},isValid:function(s){if(!s){s=this;}return typeOf(s)=="date"&&!isNaN(s.valueOf());},format:function(s){if(!this.isValid()){return"invalid date"; +}if(!s){s="%x %X";}if(typeof s=="string"){s=g[s.toLowerCase()]||s;}if(typeof s=="function"){return s(this);}var t=this;return s.replace(/%([a-z%])/gi,function(v,u){switch(u){case"a":return a.getMsg("days_abbr")[t.get("day")]; +case"A":return a.getMsg("days")[t.get("day")];case"b":return a.getMsg("months_abbr")[t.get("month")];case"B":return a.getMsg("months")[t.get("month")]; +case"c":return t.format("%a %b %d %H:%M:%S %Y");case"d":return p(t.get("date"),2);case"e":return p(t.get("date"),2," ");case"H":return p(t.get("hr"),2); +case"I":return p((t.get("hr")%12)||12,2);case"j":return p(t.get("dayofyear"),3);case"k":return p(t.get("hr"),2," ");case"l":return p((t.get("hr")%12)||12,2," "); +case"L":return p(t.get("ms"),3);case"m":return p((t.get("mo")+1),2);case"M":return p(t.get("min"),2);case"o":return t.get("ordinal");case"p":return a.getMsg(t.get("ampm")); +case"s":return Math.round(t/1000);case"S":return p(t.get("seconds"),2);case"T":return t.format("%H:%M:%S");case"U":return p(t.get("week"),2);case"w":return t.get("day"); +case"x":return t.format(a.getMsg("shortDate"));case"X":return t.format(a.getMsg("shortTime"));case"y":return t.get("year").toString().substr(2);case"Y":return t.get("year"); +case"z":return t.get("GMTOffset");case"Z":return t.get("Timezone");}return u;});},toISOString:function(){return this.format("iso8601");}}).alias({toJSON:"toISOString",compare:"diff",strftime:"format"}); +var k=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var g={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M",rfc822:function(s){return k[s.get("day")]+s.format(", %d ")+h[s.get("month")]+s.format(" %Y %H:%M:%S %Z"); +},rfc2822:function(s){return k[s.get("day")]+s.format(", %d ")+h[s.get("month")]+s.format(" %Y %H:%M:%S %z");},iso8601:function(s){return(s.getUTCFullYear()+"-"+p(s.getUTCMonth()+1,2)+"-"+p(s.getUTCDate(),2)+"T"+p(s.getUTCHours(),2)+":"+p(s.getUTCMinutes(),2)+":"+p(s.getUTCSeconds(),2)+"."+p(s.getUTCMilliseconds(),3)+"Z"); +}};var c=[],n=a.parse;var r=function(v,x,u){var t=-1,w=a.getMsg(v+"s");switch(typeOf(x)){case"object":t=w[x.get(v)];break;case"number":t=w[x];if(!t){throw new Error("Invalid "+v+" index: "+x); +}break;case"string":var s=w.filter(function(y){return this.test(y);},new RegExp("^"+x,"i"));if(!s.length){throw new Error("Invalid "+v+" string");}if(s.length>1){throw new Error("Ambiguous "+v); +}t=s[0];}return(u)?w.indexOf(t):t;};var i=1900,o=70;a.extend({getMsg:function(t,s){return Locale.get("Date."+t,s);},units:{ms:Function.from(1),second:Function.from(1000),minute:Function.from(60000),hour:Function.from(3600000),day:Function.from(86400000),week:Function.from(608400000),month:function(t,s){var u=new a; +return a.daysInMonth(t!=null?t:u.get("mo"),s!=null?s:u.get("year"))*86400000;},year:function(s){s=s||new a().get("year");return a.isLeapYear(s)?31622400000:31536000000; +}},daysInMonth:function(t,s){return[31,a.isLeapYear(s)?29:28,31,30,31,30,31,31,30,31,30,31][t];},isLeapYear:function(s){return((s%4===0)&&(s%100!==0))||(s%400===0); +},parse:function(v){var u=typeOf(v);if(u=="number"){return new a(v);}if(u!="string"){return v;}v=v.clean();if(!v.length){return null;}var s;c.some(function(w){var t=w.re.exec(v); +return(t)?(s=w.handler(t)):false;});if(!(s&&s.isValid())){s=new a(n(v));if(!(s&&s.isValid())){s=new a(v.toInt());}}return s;},parseDay:function(s,t){return r("day",s,t); +},parseMonth:function(t,s){return r("month",t,s);},parseUTC:function(t){var s=new a(t);var u=a.UTC(s.get("year"),s.get("mo"),s.get("date"),s.get("hr"),s.get("min"),s.get("sec"),s.get("ms")); +return new a(u);},orderIndex:function(s){return a.getMsg("dateOrder").indexOf(s)+1;},defineFormat:function(s,t){g[s]=t;return this;},defineParser:function(s){c.push((s.re&&s.handler)?s:l(s)); +return this;},defineParsers:function(){Array.flatten(arguments).each(a.defineParser);return this;},define2DigitYearStart:function(s){o=s%100;i=s-o;return this; +}}).extend({defineFormats:a.defineFormat.overloadSetter()});var d=function(s){return new RegExp("(?:"+a.getMsg(s).map(function(t){return t.substr(0,3); +}).join("|")+")[a-z]*");};var m=function(s){switch(s){case"T":return"%H:%M:%S";case"x":return((a.orderIndex("month")==1)?"%m[-./]%d":"%d[-./]%m")+"([-./]%y)?"; +case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?";}return null;};var j={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,z:/Z|[+-]\d{2}(?::?\d{2})?/}; +j.m=j.I;j.S=j.M;var e;var b=function(s){e=s;j.a=j.A=d("days");j.b=j.B=d("months");c.each(function(u,t){if(u.format){c[t]=l(u.format);}});};var l=function(u){if(!e){return{format:u}; +}var s=[];var t=(u.source||u).replace(/%([a-z])/gi,function(w,v){return m(v)||w;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(w,v){var x=j[v]; +if(!x){return v;}s.push(v);return"("+x.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff;&]");return{format:u,re:new RegExp("^"+t+"$","i"),handler:function(y){y=y.slice(1).associate(s); +var v=new a().clearTime(),x=y.y||y.Y;if(x!=null){q.call(v,"y",x);}if("d" in y){q.call(v,"d",1);}if("m" in y||y.b||y.B){q.call(v,"m",1);}for(var w in y){q.call(v,w,y[w]); +}return v;}};};var q=function(s,t){if(!t){return this;}switch(s){case"a":case"A":return this.set("day",a.parseDay(t,true));case"b":case"B":return this.set("mo",a.parseMonth(t,true)); +case"d":return this.set("date",t);case"H":case"I":return this.set("hr",t);case"m":return this.set("mo",t-1);case"M":return this.set("min",t);case"p":return this.set("ampm",t.replace(/\./g,"")); +case"S":return this.set("sec",t);case"s":return this.set("ms",("0."+t)*1000);case"w":return this.set("day",t);case"Y":return this.set("year",t);case"y":t=+t; +if(t<100){t+=i+(t0.75*a){e=c;}break;}f/=a;e=c+"s";}f=f.round();return Date.getMsg(e+d,f).substitute({delta:f});}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(a){var b=new Date().clearTime(); +switch(a[0]){case"tom":return b.increment();case"yes":return b.decrement();default:return b;}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var f=new Date().clearTime(); +var b=f.getDay();var c=Date.parseDay(e[2],true);var a=c-b;if(c<=b){a+=7;}if(e[1]=="last"){a-=7;}return f.set("date",f.getDate()+a);}}).alias("timeAgoInWords","timeDiffInWords"); +(function(){var c={a:/[àáâãäåăą]/g,A:/[ÀÁÂÃÄÅĂĄ]/g,c:/[ćčç]/g,C:/[ĆČÇ]/g,d:/[ďđ]/g,D:/[ĎÐ]/g,e:/[èéêëěę]/g,E:/[ÈÉÊËĚĘ]/g,g:/[ğ]/g,G:/[Ğ]/g,i:/[ìíîï]/g,I:/[ÌÍÎÏ]/g,l:/[ĺľł]/g,L:/[ĹĽŁ]/g,n:/[ñňń]/g,N:/[ÑŇŃ]/g,o:/[òóôõöøő]/g,O:/[ÒÓÔÕÖØ]/g,r:/[řŕ]/g,R:/[ŘŔ]/g,s:/[ššş]/g,S:/[ŠŞŚ]/g,t:/[ťţ]/g,T:/[ŤŢ]/g,ue:/[ü]/g,UE:/[Ü]/g,u:/[ùúûůµ]/g,U:/[ÙÚÛŮ]/g,y:/[ÿý]/g,Y:/[ŸÝ]/g,z:/[žźż]/g,Z:/[ŽŹŻ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ð]/g,ss:/[ß]/g,oe:/[œ]/g,OE:/[Œ]/g,ae:/[æ]/g,AE:/[Æ]/g},b={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"»":/[\uFFFD]/g}; +var a=function(f,h){var e=f,g;for(g in h){e=e.replace(h[g],g);}return e;};var d=function(e,g){e=e||"";var h=g?"<"+e+"(?!\\w)[^>]*>([\\s\\S]*?)":"]+)?>",f=new RegExp(h,"gi"); +return f;};String.implement({standardize:function(){return a(this,c);},repeat:function(e){return new Array(e+1).join(this);},pad:function(e,h,g){if(this.length>=e){return this; +}var f=(h==null?" ":""+h).repeat(e-this.length).substr(0,e-this.length);if(!g||g=="right"){return this+f;}if(g=="left"){return f+this;}return f.substr(0,(f.length/2).floor())+this+f.substr(0,(f.length/2).ceil()); +},getTags:function(e,f){return this.match(d(e,f))||[];},stripTags:function(e,f){return this.replace(d(e,f),"");},tidy:function(){return a(this,b);},truncate:function(e,f,i){var h=this; +if(f==null&&arguments.length==1){f="…";}if(h.length>e){h=h.substring(0,e);if(i){var g=h.lastIndexOf(i);if(g!=-1){h=h.substr(0,g);}}if(f){h+=f;}}return h; +}});})();String.implement({parseQueryString:function(d,a){if(d==null){d=true;}if(a==null){a=true;}var c=this.split(/[&;]/),b={};if(!c.length){return b; +}c.each(function(i){var e=i.indexOf("=")+1,g=e?i.substr(e):"",f=e?i.substr(0,e-1).match(/([^\]\[]+|(\B)(?=\]))/g):[i],h=b;if(!f){return;}if(a){g=decodeURIComponent(g); +}f.each(function(k,j){if(d){k=decodeURIComponent(k);}var l=h[k];if(j=0||g.parentPositioned||d.allowNegative)?c.x:0).toInt(); +c.top=((c.y>=0||g.parentPositioned||d.allowNegative)?c.y:0).toInt();a.toMinMax(c,d);if(d.relFixedPosition||f.getStyle("position")=="fixed"){a.toRelFixedPosition(f,c); +}if(d.ignoreScroll){a.toIgnoreScroll(f,c);}if(d.ignoreMargins){a.toIgnoreMargins(c,d);}c.left=Math.ceil(c.left);c.top=Math.ceil(c.top);delete c.x;delete c.y; +return c;},setPositionCoordinates:function(k,g,d){var f=k.offset.y,h=k.offset.x,e=(d==document.body)?window.getScroll():d.getPosition(),j=e.y,c=e.x,i=window.getSize(); +switch(k.position.x){case"left":g.x=c+h;break;case"right":g.x=c+h+d.offsetWidth;break;default:g.x=c+((d==document.body?i.x:d.offsetWidth)/2)+h;break;}switch(k.position.y){case"top":g.y=j+f; +break;case"bottom":g.y=j+f+d.offsetHeight;break;default:g.y=j+((d==document.body?i.y:d.offsetHeight)/2)+f;break;}},toMinMax:function(c,d){var f={left:"x",top:"y"},e; +["minimum","maximum"].each(function(g){["left","top"].each(function(h){e=d[g]?d[g][f[h]]:null;if(e!=null&&((g=="minimum")?c[h]e)){c[h]=e;}});}); +},toRelFixedPosition:function(e,c){var d=window.getScroll();c.top+=d.y;c.left+=d.x;},toIgnoreScroll:function(e,d){var c=e.getScroll();d.top-=c.y;d.left-=c.x; +},toIgnoreMargins:function(c,d){c.left+=d.edge.x=="right"?d.dimensions["margin-right"]:(d.edge.x!="center"?-d.dimensions["margin-left"]:-d.dimensions["margin-left"]+((d.dimensions["margin-right"]+d.dimensions["margin-left"])/2)); +c.top+=d.edge.y=="bottom"?d.dimensions["margin-bottom"]:(d.edge.y!="center"?-d.dimensions["margin-top"]:-d.dimensions["margin-top"]+((d.dimensions["margin-bottom"]+d.dimensions["margin-top"])/2)); +},toEdge:function(c,d){var e={},g=d.dimensions,f=d.edge;switch(f.x){case"left":e.x=0;break;case"right":e.x=-g.x-g.computedRight-g.computedLeft;break;default:e.x=-(Math.round(g.totalWidth/2)); +break;}switch(f.y){case"top":e.y=0;break;case"bottom":e.y=-g.y-g.computedTop-g.computedBottom;break;default:e.y=-(Math.round(g.totalHeight/2));break;}c.x+=e.x; +c.y+=e.y;},getCoordinateFromValue:function(c){if(typeOf(c)!="string"){return c;}c=c.toLowerCase();return{x:c.test("left")?"left":(c.test("right")?"right":"center"),y:c.test(/upper|top/)?"top":(c.test("bottom")?"bottom":"center")}; +}};Element.implement({position:function(d){if(d&&(d.x!=null||d.y!=null)){return(b?b.apply(this,arguments):this);}var c=this.setStyle("position","absolute").calculatePosition(d); +return(d&&d.returnPos)?c:this.setStyles(c);},calculatePosition:function(c){return a.getPosition(this,c);}});})(Element.prototype.position);Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; +},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return(a==0&&b==0)?false:(a>0&&b>0)?true:this.style.display!="none";},toggle:function(){return this[this.isDisplayed()?"hide":"show"](); +},hide:function(){var b;try{b=this.getStyle("display");}catch(a){}if(b=="none"){return this;}return this.store("element:_originalDisplay",b||"").setStyle("display","none"); +},show:function(a){if(!a&&this.isDisplayed()){return this;}a=a||this.retrieve("element:_originalDisplay")||"block";return this.setStyle("display",(a=="none")?"block":a); +},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection(); +if(a&&a.removeAllRanges){a.removeAllRanges();}}else{if(document.selection&&document.selection.empty){try{document.selection.empty();}catch(b){}}}}});Locale.define("en-US","FormValidator",{required:"This field is required.",length:"Please enter {length} characters (you entered {elLength} characters)",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use only letters (a-z) within this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".',url:"Please enter a valid URL such as http://www.example.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There can be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date",currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other.",creditcard:"The credit card number entered is invalid. Please check the number and try again. {length} digits entered."}); +if(!window.Form){window.Form={};}var InputValidator=this.InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:Function.from(true)},initialize:function(b,a){this.setOptions(a); +this.className=b;},test:function(b,a){b=document.id(b);return(b)?this.options.test(b,a||this.getProps(b)):false;},getError:function(c,a){c=document.id(c); +var b=this.options.errorMsg;if(typeOf(b)=="function"){b=b(c,a||this.getProps(c));}return b;},getProps:function(a){a=document.id(a);return(a)?a.get("validatorProps"):{}; +}});Element.Properties.validators={get:function(){return(this.get("data-validators")||this.className).clean().split(" ");}};Element.Properties.validatorProps={set:function(a){return this.eliminate("$moo:validatorProps").store("$moo:validatorProps",a); +},get:function(a){if(a){this.set(a);}if(this.retrieve("$moo:validatorProps")){return this.retrieve("$moo:validatorProps");}if(this.getProperty("data-validator-properties")||this.getProperty("validatorProps")){try{this.store("$moo:validatorProps",JSON.decode(this.getProperty("validatorProps")||this.getProperty("data-validator-properties"))); +}catch(c){return{};}}else{var b=this.get("validators").filter(function(d){return d.test(":");});if(!b.length){this.store("$moo:validatorProps",{});}else{a={}; +b.each(function(d){var f=d.split(":");if(f[1]){try{a[f[0]]=JSON.decode(f[1]);}catch(g){}}});this.store("$moo:validatorProps",a);}}return this.retrieve("$moo:validatorProps"); +}};Form.Validator=new Class({Implements:[Options,Events],Binds:["onSubmit"],options:{fieldSelectors:"input, select, textarea",ignoreHidden:true,ignoreDisabled:true,useTitles:false,evaluateOnSubmit:true,evaluateFieldsOnBlur:true,evaluateFieldsOnChange:true,serial:true,stopOnFailure:true,warningPrefix:function(){return Form.Validator.getMsg("warningPrefix")||"Warning: "; +},errorPrefix:function(){return Form.Validator.getMsg("errorPrefix")||"Error: ";}},initialize:function(b,a){this.setOptions(a);this.element=document.id(b); +this.element.store("validator",this);this.warningPrefix=Function.from(this.options.warningPrefix)();this.errorPrefix=Function.from(this.options.errorPrefix)(); +if(this.options.evaluateOnSubmit){this.element.addEvent("submit",this.onSubmit);}if(this.options.evaluateFieldsOnBlur||this.options.evaluateFieldsOnChange){this.watchFields(this.getFields()); +}},toElement:function(){return this.element;},getFields:function(){return(this.fields=this.element.getElements(this.options.fieldSelectors));},watchFields:function(a){a.each(function(b){if(this.options.evaluateFieldsOnBlur){b.addEvent("blur",this.validationMonitor.pass([b,false],this)); +}if(this.options.evaluateFieldsOnChange){b.addEvent("change",this.validationMonitor.pass([b,true],this));}},this);},validationMonitor:function(){clearTimeout(this.timer); +this.timer=this.validateField.delay(50,this,arguments);},onSubmit:function(a){if(this.validate(a)){this.reset();}},reset:function(){this.getFields().each(this.resetField,this); +return this;},validate:function(b){var a=this.getFields().map(function(c){return this.validateField(c,true);},this).every(function(c){return c;});this.fireEvent("formValidate",[a,this.element,b]); +if(this.options.stopOnFailure&&!a&&b){b.preventDefault();}return a;},validateField:function(j,b){if(this.paused){return true;}j=document.id(j);var f=!j.hasClass("validation-failed"); +var g,i;if(this.options.serial&&!b){g=this.element.getElement(".validation-failed");i=this.element.getElement(".warning");}if(j&&(!g||b||j.hasClass("validation-failed")||(g&&!this.options.serial))){var a=j.get("validators"); +var d=a.some(function(k){return this.getValidator(k);},this);var h=[];a.each(function(k){if(k&&!this.test(k,j)){h.include(k);}},this);f=h.length===0;if(d&&!this.hasValidator(j,"warnOnly")){if(f){j.addClass("validation-passed").removeClass("validation-failed"); +this.fireEvent("elementPass",[j]);}else{j.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("elementFail",[j,h]);}}if(!i){var e=a.some(function(k){if(k.test("^warn")){return this.getValidator(k.replace(/^warn-/,"")); +}else{return null;}},this);j.removeClass("warning");var c=a.map(function(k){if(k.test("^warn")){return this.test(k.replace(/^warn-/,""),j,true);}else{return null; +}},this);}}return f;},test:function(b,d,e){d=document.id(d);if((this.options.ignoreHidden&&!d.isVisible())||(this.options.ignoreDisabled&&d.get("disabled"))){return true; +}var a=this.getValidator(b);if(e!=null){e=false;}if(this.hasValidator(d,"warnOnly")){e=true;}var c=this.hasValidator(d,"ignoreValidation")||(a?a.test(d):true); +if(a&&d.isVisible()){this.fireEvent("elementValidate",[c,d,b,e]);}if(e){return true;}return c;},hasValidator:function(b,a){return b.get("validators").contains(a); +},resetField:function(a){a=document.id(a);if(a){a.get("validators").each(function(b){if(b.test("^warn-")){b=b.replace(/^warn-/,"");}a.removeClass("validation-failed"); +a.removeClass("warning");a.removeClass("validation-passed");},this);}return this;},stop:function(){this.paused=true;return this;},start:function(){this.paused=false; +return this;},ignoreField:function(a,b){a=document.id(a);if(a){this.enforceField(a);if(b){a.addClass("warnOnly");}else{a.addClass("ignoreValidation");}}return this; +},enforceField:function(a){a=document.id(a);if(a){a.removeClass("warnOnly").removeClass("ignoreValidation");}return this;}});Form.Validator.getMsg=function(a){return Locale.get("FormValidator."+a); +};Form.Validator.adders={validators:{},add:function(b,a){this.validators[b]=new InputValidator(b,a);if(!this.initialize){this.implement({validators:this.validators}); +}},addAllThese:function(a){Array.from(a).each(function(b){this.add(b[0],b[1]);},this);},getValidator:function(a){return this.validators[a.split(":")[0]]; +}};Object.append(Form.Validator,Form.Validator.adders);Form.Validator.implement(Form.Validator.adders);Form.Validator.add("IsEmpty",{errorMsg:false,test:function(a){if(a.type=="select-one"||a.type=="select"){return !(a.selectedIndex>=0&&a.options[a.selectedIndex].value!=""); +}else{return((a.get("value")==null)||(a.get("value").length==0));}}});Form.Validator.addAllThese([["required",{errorMsg:function(){return Form.Validator.getMsg("required"); +},test:function(a){return !Form.Validator.getValidator("IsEmpty").test(a);}}],["length",{errorMsg:function(a,b){if(typeOf(b.length)!="null"){return Form.Validator.getMsg("length").substitute({length:b.length,elLength:a.get("value").length}); +}else{return"";}},test:function(a,b){if(typeOf(b.length)!="null"){return(a.get("value").length==b.length||a.get("value").length==0);}else{return true;}}}],["minLength",{errorMsg:function(a,b){if(typeOf(b.minLength)!="null"){return Form.Validator.getMsg("minLength").substitute({minLength:b.minLength,length:a.get("value").length}); +}else{return"";}},test:function(a,b){if(typeOf(b.minLength)!="null"){return(a.get("value").length>=(b.minLength||0));}else{return true;}}}],["maxLength",{errorMsg:function(a,b){if(typeOf(b.maxLength)!="null"){return Form.Validator.getMsg("maxLength").substitute({maxLength:b.maxLength,length:a.get("value").length}); +}else{return"";}},test:function(a,b){return a.get("value").length<=(b.maxLength||10000);}}],["validate-integer",{errorMsg:Form.Validator.getMsg.pass("integer"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(-?[1-9]\d*|0)$/).test(a.get("value")); +}}],["validate-numeric",{errorMsg:Form.Validator.getMsg.pass("numeric"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(a.get("value")); +}}],["validate-digits",{errorMsg:Form.Validator.getMsg.pass("digits"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^[\d() .:\-\+#]+$/.test(a.get("value"))); +}}],["validate-alpha",{errorMsg:Form.Validator.getMsg.pass("alpha"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^[a-zA-Z]+$/).test(a.get("value")); +}}],["validate-alphanum",{errorMsg:Form.Validator.getMsg.pass("alphanum"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||!(/\W/).test(a.get("value")); +}}],["validate-date",{errorMsg:function(a,b){if(Date.parse){var c=b.dateFormat||"%x";return Form.Validator.getMsg("dateSuchAs").substitute({date:new Date().format(c)}); +}else{return Form.Validator.getMsg("dateInFormatMDY");}},test:function(e,g){if(Form.Validator.getValidator("IsEmpty").test(e)){return true;}var a=Locale.getCurrent().sets.Date,b=new RegExp([a.days,a.days_abbr,a.months,a.months_abbr].flatten().join("|"),"i"),i=e.get("value"),f=i.match(/[a-z]+/gi); +if(f&&!f.every(b.exec,b)){return false;}var c=Date.parse(i),h=g.dateFormat||"%x",d=c.format(h);if(d!="invalid date"){e.set("value",d);}return c.isValid(); +}}],["validate-email",{errorMsg:Form.Validator.getMsg.pass("email"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(a.get("value")); +}}],["validate-url",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(a.get("value")); +}}],["validate-currency-dollar",{errorMsg:Form.Validator.getMsg.pass("currencyDollar"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(a.get("value")); +}}],["validate-one-required",{errorMsg:Form.Validator.getMsg.pass("oneRequired"),test:function(a,b){var c=document.id(b["validate-one-required"])||a.getParent(b["validate-one-required"]); +return c.getElements("input").some(function(d){if(["checkbox","radio"].contains(d.get("type"))){return d.get("checked");}return d.get("value");});}}]]); +Element.Properties.validator={set:function(a){this.get("validator").setOptions(a);},get:function(){var a=this.retrieve("validator");if(!a){a=new Form.Validator(this); +this.store("validator",a);}return a;}};Element.implement({validate:function(a){if(a){this.set("validator",a);}return this.get("validator").validate();}}); +Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={}; +for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c;},set:function(b){for(var c in b){if(!this.elements[c]){continue;}var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit); +}}return this;},start:function(c){if(!this.check(c)){return this;}var h={},j={};for(var d in c){if(!this.elements[d]){continue;}var f=c[d],a=h[d]={},g=j[d]={}; +for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to;}}return this.parent(h,j);}});Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:false,fixedWidth:false,display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,resetHeight:true},initialize:function(){var g=function(h){return h!=null; +};var f=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:g,elements:g});this.parent(f.elements,f.options);var b=this.options,e=this.togglers=$$(f.togglers); +this.previous=-1;this.internalChain=new Chain();if(b.alwaysHide){this.options.link="chain";}if(b.show||this.options.show===0){b.display=false;this.previous=b.show; +}if(b.start){b.display=false;b.show=false;}var d=this.effects={};if(b.opacity){d.opacity="fullOpacity";}if(b.width){d.width=b.fixedWidth?"fullWidth":"offsetWidth"; +}if(b.height){d.height=b.fixedHeight?"fullHeight":"scrollHeight";}for(var c=0,a=e.length;c=0?a-1:0)).chain(d);}else{d();}return this;},detach:function(b){var a=function(c){c.removeEvent(this.options.trigger,c.retrieve("accordion:display")); +}.bind(this);if(!b){this.togglers.each(a);}else{a(b);}return this;},display:function(b,c){if(!this.check(b,c)){return this;}var h={},g=this.elements,a=this.options,f=this.effects; +if(c==null){c=true;}if(typeOf(b)=="element"){b=g.indexOf(b);}if(b==this.previous&&!a.alwaysHide){return this;}if(a.resetHeight){var e=g[this.previous]; +if(e&&!this.selfHidden){for(var d in f){e.setStyle(d,e[f[d]]);}}}if((this.timer&&a.link=="chain")||(b===this.previous&&!a.alwaysHide)){return this;}this.previous=b; +this.selfHidden=false;g.each(function(l,k){h[k]={};var j;if(k!=b){j=true;}else{if(a.alwaysHide&&((l.offsetHeight>0&&a.height)||l.offsetWidth>0&&a.width)){j=true; +this.selfHidden=true;}}this.fireEvent(j?"background":"active",[this.togglers[k],l]);for(var m in f){h[k][m]=j?0:l[f[m]];}if(!c&&!j&&a.resetHeight){h[k].height="auto"; +}},this);this.internalChain.clearChain();this.internalChain.chain(function(){if(a.resetHeight&&!this.selfHidden){var i=g[b];if(i){i.setStyle("height","auto"); +}}}.bind(this));return c?this.start(h):this.set(h).internalChain.callChain();}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(a){var b=this.element,c=b.getStyles("top","left"); +if(c.top=="auto"||c.left=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()));}return this.parent(b.position(Object.merge({},this.options,a,{returnPos:true}))); +}});Element.Properties.move={set:function(a){this.get("move").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("move");if(!a){a=new Fx.Move(this,{link:"cancel"}); +this.store("move",a);}return a;}};Element.implement({move:function(a){this.get("move").start(a);return this;}});(function(){var a=function(d){var b=d.options.hideInputs; +if(window.OverText){var c=[null];OverText.each(function(e){c.include("."+e.options.labelClass);});if(c){b+=c.join(", ");}}return(b)?d.element.getElements(b):null; +};Fx.Reveal=new Class({Extends:Fx.Morph,options:{link:"cancel",styles:["padding","border","margin"],transitionOpacity:!Browser.ie6,mode:"vertical",display:function(){return this.element.get("tag")!="tr"?"block":"table-row"; +},opacity:1,hideInputs:Browser.ie?"select, input, textarea, object, embed":null},dissolve:function(){if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true; +this.showing=false;this.hidden=true;this.cssText=this.element.style.cssText;var d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); +if(this.options.transitionOpacity){d.opacity=this.options.opacity;}var c={};Object.each(d,function(f,e){c[e]=[f,0];});this.element.setStyles({display:Function.from(this.options.display).call(this),overflow:"hidden"}); +var b=a(this);if(b){b.setStyle("visibility","hidden");}this.$chain.unshift(function(){if(this.hidden){this.hiding=false;this.element.style.cssText=this.cssText; +this.element.setStyle("display","none");if(b){b.setStyle("visibility","visible");}}this.fireEvent("hide",this.element);this.callChain();}.bind(this));this.start(c); +}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element);}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this)); +}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel();this.dissolve();}}}return this;},reveal:function(){if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"){this.hiding=false; +this.showing=true;this.hidden=false;this.cssText=this.element.style.cssText;var d;this.element.measure(function(){d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); +}.bind(this));if(this.options.heightOverride!=null){d.height=this.options.heightOverride.toInt();}if(this.options.widthOverride!=null){d.width=this.options.widthOverride.toInt(); +}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);d.opacity=this.options.opacity;}var c={height:0,display:Function.from(this.options.display).call(this)}; +Object.each(d,function(f,e){c[e]=0;});c.overflow="hidden";this.element.setStyles(c);var b=a(this);if(b){b.setStyle("visibility","hidden");}this.$chain.unshift(function(){this.element.style.cssText=this.cssText; +this.element.setStyle("display",Function.from(this.options.display).call(this));if(!this.hidden){this.showing=false;}if(b){b.setStyle("visibility","visible"); +}this.callChain();this.fireEvent("show",this.element);}.bind(this));this.start(d);}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element); +}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this));}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal(); +}}}return this;},toggle:function(){if(this.element.getStyle("display")=="none"){this.reveal();}else{this.dissolve();}return this;},cancel:function(){this.parent.apply(this,arguments); +if(this.cssText!=null){this.element.style.cssText=this.cssText;}this.hiding=false;this.showing=false;return this;}});Element.Properties.reveal={set:function(b){this.get("reveal").cancel().setOptions(b); +return this;},get:function(){var b=this.retrieve("reveal");if(!b){b=new Fx.Reveal(this);this.store("reveal",b);}return b;}};Element.Properties.dissolve=Element.Properties.reveal; +Element.implement({reveal:function(b){this.get("reveal").setOptions(b).reveal();return this;},dissolve:function(b){this.get("reveal").setOptions(b).dissolve(); +return this;},nix:function(b){var c=Array.link(arguments,{destroy:Type.isBoolean,options:Type.isObject});this.get("reveal").setOptions(b).dissolve().chain(function(){this[c.destroy?"destroy":"dispose"](); +}.bind(this));return this;},wink:function(){var c=Array.link(arguments,{duration:Type.isNumber,options:Type.isObject});var b=this.get("reveal").setOptions(c.options); +b.reveal().chain(function(){(function(){b.dissolve();}).delay(c.duration||2000);});}});})();(function(){Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(c,b){this.element=this.subject=document.id(c); +this.parent(b);if(typeOf(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}if(this.options.wheelStops){var d=this.element,e=this.cancel.pass(false,this); +this.addEvent("start",function(){d.addEvent("mousewheel",e);},true);this.addEvent("complete",function(){d.removeEvent("mousewheel",e);},true);}},set:function(){var b=Array.flatten(arguments); +if(Browser.firefox){b=[Math.round(b[0]),Math.round(b[1])];}this.element.scrollTo(b[0],b[1]);return this;},compute:function(d,c,b){return[0,1].map(function(e){return Fx.compute(d[e],c[e],b); +});},start:function(c,d){if(!this.check(c,d)){return this;}var b=this.element.getScroll();return this.parent([b.x,b.y],[c,d]);},calculateScroll:function(g,f){var d=this.element,b=d.getScrollSize(),h=d.getScroll(),j=d.getSize(),c=this.options.offset,i={x:g,y:f}; +for(var e in i){if(!i[e]&&i[e]!==0){i[e]=h[e];}if(typeOf(i[e])!="number"){i[e]=b[e]-j[e];}i[e]+=c[e];}return[i.x,i.y];},toTop:function(){return this.start.apply(this,this.calculateScroll(false,0)); +},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,false));},toRight:function(){return this.start.apply(this,this.calculateScroll("right",false)); +},toBottom:function(){return this.start.apply(this,this.calculateScroll(false,"bottom"));},toElement:function(d,e){e=e?Array.from(e):["x","y"];var c=a(this.element)?{x:0,y:0}:this.element.getScroll(); +var b=Object.map(document.id(d).getPosition(this.element),function(g,f){return e.contains(f)?g+c[f]:false;});return this.start.apply(this,this.calculateScroll(b.x,b.y)); +},toElementEdge:function(d,g,e){g=g?Array.from(g):["x","y"];d=document.id(d);var i={},f=d.getPosition(this.element),j=d.getSize(),h=this.element.getScroll(),b=this.element.getSize(),c={x:f.x+j.x,y:f.y+j.y}; +["x","y"].each(function(k){if(g.contains(k)){if(c[k]>h[k]+b[k]){i[k]=c[k]-b[k];}if(f[k]this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); +}}var b=0;i=a=0;e.each(function(k){var j={};if(d){j.top=i-f[k].top-b;i+=f[k].height;}else{j.left=a-f[k].left;a+=f[k].width;}b=b+f[k].margin;c[k]=j;},this); +var g={};Array.clone(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; +var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); +},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; +});},getCurrentOrder:function(){return this.currentOrder;},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse()); +},reverse:function(){return this.sort(this.currentOrder.reverse());},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b); +},this));},swap:function(c,b){if(typeOf(c)=="element"){c=this.elements.indexOf(c);}if(typeOf(b)=="element"){b=this.elements.indexOf(b);}var a=Array.clone(this.currentOrder); +a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;return this.sort(a);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,element:function(c){return c!=null; +}});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=typeOf(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element; +this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.ie)?"selectstart":"mousedown";if(Browser.ie&&!Drag.ondragstartFixed){document.ondragstart=Function.from(false); +Drag.ondragstartFixed=true;}this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.from(false)}; +this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start); +return this;},start:function(a){var j=this.options;if(a.rightClick){return;}if(j.preventDefault){a.preventDefault();}if(j.stopPropagation){a.stopPropagation(); +}this.mouse.start=a.page;this.fireEvent("beforeStart",this.element);var c=j.limit;this.limit={x:[],y:[]};var e,g;for(e in j.modifiers){if(!j.modifiers[e]){continue; +}var b=this.element.getStyle(j.modifiers[e]);if(b&&!b.match(/px$/)){if(!g){g=this.element.getCoordinates(this.element.getOffsetParent());}b=g[j.modifiers[e]]; +}if(j.style){this.value.now[e]=(b||0).toInt();}else{this.value.now[e]=this.element[j.modifiers[e]];}if(j.invert){this.value.now[e]*=-1;}this.mouse.pos[e]=a.page[e]-this.value.now[e]; +if(c&&c[e]){var d=2;while(d--){var f=c[e][d];if(f||f===0){this.limit[e][d]=(typeof f=="function")?f():f;}}}}if(typeOf(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}; +}var h={mousemove:this.bound.check,mouseup:this.bound.cancel};h[this.selection]=this.bound.eventStop;this.document.addEvents(h);},check:function(a){if(this.options.preventDefault){a.preventDefault(); +}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop}); +this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:function(b){var a=this.options;if(a.preventDefault){b.preventDefault(); +}this.mouse.now=b.page;for(var c in a.modifiers){if(!a.modifiers[c]){continue;}this.value.now[c]=this.mouse.now[c]-this.mouse.pos[c];if(a.invert){this.value.now[c]*=-1; +}if(a.limit&&this.limit[c]){if((this.limit[c][1]||this.limit[c][1]===0)&&(this.value.now[c]>this.limit[c][1])){this.value.now[c]=this.limit[c][1];}else{if((this.limit[c][0]||this.limit[c][0]===0)&&(this.value.now[c]d.left&&b.xd.top);},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]); +}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables(); +}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a); +this.store("dragger",b);return b;}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){this.setKnobPosition(a); +},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(f,a,e){this.setOptions(e);e=this.options;this.element=document.id(f); +a=this.knob=document.id(a);this.previousChange=this.previousEnd=this.step=-1;var b={},d={x:false,y:false};switch(e.mode){case"vertical":this.axis="y";this.property="top"; +this.offset="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";this.offset="offsetWidth";}this.setSliderDimensions();this.setRange(e.range); +if(a.getStyle("position")=="static"){a.setStyle("position","relative");}a.setStyle(this.property,-e.offset);d[this.axis]=this.property;b[this.axis]=[-e.offset,this.full-e.offset]; +var c={snap:0,limit:b,modifiers:d,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true;}).bind(this),onCancel:function(){this.isDragging=false; +}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end();}.bind(this)};if(e.snap){this.setSnap(c);}this.drag=new Drag(a,c); +this.attach();if(e.initialStep!=null){this.set(e.initialStep);}},attach:function(){this.element.addEvent("mousedown",this.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement); +}this.drag.attach();return this;},detach:function(){this.element.removeEvent("mousedown",this.clickedElement).removeEvent("mousewheel",this.scrolledElement); +this.drag.detach();return this;},autosize:function(){this.setSliderDimensions().setKnobPosition(this.toPosition(this.step));this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset]; +if(this.options.snap){this.setSnap();}return this;},setSnap:function(a){if(!a){a=this.drag.options;}a.grid=Math.ceil(this.stepWidth);a.limit[this.axis][1]=this.full; +return this;},setKnobPosition:function(a){if(this.options.snap){a=this.toPosition(this.step);}this.knob.setStyle(this.property,a);return this;},setSliderDimensions:function(){this.full=this.element.measure(function(){this.half=this.knob[this.offset]/2; +return this.element[this.offset]-this.knob[this.offset]+(this.options.offset*2);}.bind(this));return this;},set:function(a){if(!((this.range>0)^(a0)^(a>this.max))){a=this.max;}this.step=Math.round(a);return this.checkStep().fireEvent("tick",this.toPosition(this.step)).end();},setRange:function(a,b){this.min=Array.pick([a[0],0]); +this.max=Array.pick([a[1],this.options.steps]);this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps; +this.stepWidth=this.stepSize*this.full/Math.abs(this.range);if(a){this.set(Array.pick([b,this.step]).floor(this.min).max(this.max));}return this;},clickedElement:function(c){if(this.isDragging||c.target==this.knob){return; +}var b=this.range<0?-1:1,a=c.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset); +this.step=Math.round(this.min+b*this.toStep(a));this.checkStep().fireEvent("tick",a).end();},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0); +this.set(this.step+(b?-1:1)*this.stepSize);a.stop();},draggedKnob:function(){var b=this.range<0?-1:1,a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset); +this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();},checkStep:function(){var a=this.step;if(this.previousChange!=a){this.previousChange=a; +this.fireEvent("change",a);}return this;},end:function(){var a=this.step;if(this.previousEnd!==a){this.previousEnd=a;this.fireEvent("complete",a+"");}return this; +},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b;},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset; +}});var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:false,revert:false,handle:false,dragOptions:{}},initialize:function(a,b){this.setOptions(b); +this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,Object.merge({duration:250,link:"cancel"},this.options.revert)); +}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a); +var b=a.retrieve("sortables:start",function(c){this.start.call(this,c,a);}.bind(this));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b); +},this);return this;},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.include(a);this.addItems(a.getChildren());},this);return this; +},removeItems:function(){return $$(Array.flatten(arguments).map(function(a){this.elements.erase(a);var b=a.retrieve("sortables:start");(this.options.handle?a.getElement(this.options.handle)||a:a).removeEvent("mousedown",b); +return a;},this));},removeLists:function(){return $$(Array.flatten(arguments).map(function(a){this.lists.erase(a);this.removeItems(a.getChildren());return a; +},this));},getClone:function(b,a){if(!this.options.clone){return new Element(a.tagName).inject(document.body);}if(typeOf(this.options.clone)=="function"){return this.options.clone.call(this,b,a,this.list); +}var c=a.clone(true).setStyles({margin:0,position:"absolute",visibility:"hidden",width:a.getStyle("width")}).addEvent("mousedown",function(d){a.fireEvent("mousedown",d); +});if(c.get("html").test("radio")){c.getElements("input[type=radio]").each(function(d,e){d.set("name","clone_"+e);if(d.get("checked")){a.getElements("input[type=radio]")[e].set("checked",true); +}});}return c.inject(this.list).setPosition(a.getPosition(a.getOffsetParent()));},getDroppables:function(){var a=this.list.getChildren().erase(this.clone).erase(this.element); +if(!this.options.constrain){a.append(this.lists).erase(this.list);}return a;},insert:function(c,b){var a="inside";if(this.lists.contains(b)){this.list=b; +this.drag.droppables=this.getDroppables();}else{a=this.element.getAllPrevious().contains(b)?"before":"after";}this.element.inject(b,a);this.fireEvent("sort",[this.element,this.clone]); +},start:function(b,a){if(!this.idle||b.rightClick||["button","input","a","textarea"].contains(b.target.get("tag"))){return;}this.idle=false;this.element=a; +this.opacity=a.getStyle("opacity");this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,Object.merge({droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){b.stop(); +this.clone.setStyle("visibility","visible");this.element.setStyle("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]); +}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(b); +},end:function(){this.drag.detach();this.element.setStyle("opacity",this.opacity);if(this.effect){var b=this.element.getStyles("width","height"),d=this.clone,c=d.computePosition(this.element.getPosition(this.clone.getOffsetParent())); +var a=function(){this.removeEvent("cancel",a);d.destroy();};this.effect.element=d;this.effect.start({top:c.top,left:c.left,width:b.width,height:b.height,opacity:0.25}).addEvent("cancel",a).chain(a); +}else{this.clone.destroy();}this.reset();},reset:function(){this.idle=true;this.fireEvent("complete",this.element);},serialize:function(){var c=Array.link(arguments,{modifier:Type.isFunction,index:function(d){return d!=null; +}});var b=this.lists.map(function(d){return d.getChildren().map(c.modifier||function(e){return e.get("id");},this);},this);var a=c.index;if(this.lists.length==1){a=0; +}return(a||a===0)&&a>=0&&athis.options.zIndex)?this.options.zIndex:c-1;if(c<0){c=1;}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:c,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this); +var a=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject");}).bind(this);if(!IframeShim.ready){window.addEvent("load",a); +}else{a();}}else{this.position=this.hide=this.show=this.dispose=Function.from(this);}},position:function(){if(!IframeShim.ready||!this.shim){return this; +}var a=this.element.measure(function(){return this.getSize();});if(this.options.margin!=undefined){a.x=a.x-(this.options.margin*2);a.y=a.y-(this.options.margin*2); +this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin;}this.shim.set({width:a.x,height:a.y}).position({relativeTo:this.element,offset:this.options.offset}); +return this;},hide:function(){if(this.shim){this.shim.setStyle("display","none");}return this;},show:function(){if(this.shim){this.shim.setStyle("display","block"); +}return this.position();},dispose:function(){if(this.shim){this.shim.dispose();}return this;},destroy:function(){if(this.shim){this.shim.destroy();}return this; +}});window.addEvent("load",function(){IframeShim.ready=true;});var Mask=new Class({Implements:[Options,Events],Binds:["position"],options:{style:{},"class":"mask",maskMargins:false,useIframeShim:true,iframeShimOptions:{}},initialize:function(b,a){this.target=document.id(b)||document.id(document.body); +this.target.store("mask",this);this.setOptions(a);this.render();this.inject();},render:function(){this.element=new Element("div",{"class":this.options["class"],id:this.options.id||"mask-"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:"none"}),events:{click:function(a){this.fireEvent("click",a); +if(this.options.hideOnClick){this.hide();}}.bind(this)}});this.hidden=true;},toElement:function(){return this.element;},inject:function(b,a){a=a||(this.options.inject?this.options.inject.where:"")||this.target==document.body?"inside":"after"; +b=b||(this.options.inject&&this.options.inject.target)||this.target;this.element.inject(b,a);if(this.options.useIframeShim){this.shim=new IframeShim(this.element,this.options.iframeShimOptions); +this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)});}},position:function(){this.resize(this.options.width,this.options.height); +this.element.position({relativeTo:this.target,position:"topLeft",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body});return this; +},resize:function(a,e){var b={styles:["padding","border"]};if(this.options.maskMargins){b.styles.push("margin");}var d=this.target.getComputedSize(b);if(this.target==document.body){this.element.setStyles({width:0,height:0}); +var c=window.getScrollSize();if(d.totalHeightc[i]-this.options.windowPadding[i]){h[d[i]]=f.page[i]-this.options.offset[i]-g[i]; +e[i+"2"]=true;}}this.fireEvent("bound",e);this.tip.setStyles(h);},fill:function(b,c){if(typeof c=="string"){b.set("html",c);}else{b.adopt(c);}},show:function(b){if(!this.tip){document.id(this); +}if(!this.tip.getParent()){this.tip.inject(document.body);}this.fireEvent("show",[this.tip,b]);},hide:function(b){if(!this.tip){document.id(this);}this.fireEvent("hide",[this.tip,b]); +}});})();var Spinner=new Class({Extends:Mask,Implements:Chain,options:{"class":"spinner",containerPosition:{},content:{"class":"spinner-content"},messageContainer:{"class":"spinner-msg"},img:{"class":"spinner-img"},fxOptions:{link:"chain"}},initialize:function(c,a){this.target=document.id(c)||document.id(document.body); +this.target.store("spinner",this);this.setOptions(a);this.render();this.inject();var b=function(){this.active=false;}.bind(this);this.addEvents({hide:b,show:b}); +},render:function(){this.parent();this.element.set("id",this.options.id||"spinner-"+String.uniqueID());this.content=document.id(this.options.content)||new Element("div",this.options.content); +this.content.inject(this.element);if(this.options.message){this.msg=document.id(this.options.message)||new Element("p",this.options.messageContainer).appendText(this.options.message); +this.msg.inject(this.content);}if(this.options.img){this.img=document.id(this.options.img)||new Element("div",this.options.img);this.img.inject(this.content); +}this.element.set("tween",this.options.fxOptions);},show:function(a){if(this.active){return this.chain(this.show.bind(this));}if(!this.hidden){this.callChain.delay(20,this); +return this;}this.active=true;return this.parent(a);},showMask:function(a){var b=function(){this.content.position(Object.merge({relativeTo:this.element},this.options.containerPosition)); +}.bind(this);if(a){this.parent();b();}else{if(!this.options.style.opacity){this.options.style.opacity=this.element.getStyle("opacity").toFloat();}this.element.setStyles({display:"block",opacity:0}).tween("opacity",this.options.style.opacity); +b();this.hidden=false;this.fireEvent("show");this.callChain();}},hide:function(a){if(this.active){return this.chain(this.hide.bind(this));}if(this.hidden){this.callChain.delay(20,this); +return this;}this.active=true;return this.parent(a);},hideMask:function(a){if(a){return this.parent();}this.element.tween("opacity",0).get("tween").chain(function(){this.element.setStyle("display","none"); +this.hidden=true;this.fireEvent("hide");this.callChain();}.bind(this));},destroy:function(){this.content.destroy();this.parent();this.target.eliminate("spinner"); +}});Request=Class.refactor(Request,{options:{useSpinner:false,spinnerOptions:{},spinnerTarget:false},initialize:function(a){this._send=this.send;this.send=function(b){var c=this.getSpinner(); +if(c){c.chain(this._send.pass(b,this)).show();}else{this._send(b);}return this;};this.previous(a);},getSpinner:function(){if(!this.spinner){var b=document.id(this.options.spinnerTarget)||document.id(this.options.update); +if(this.options.useSpinner&&b){b.set("spinner",this.options.spinnerOptions);var a=this.spinner=b.get("spinner");["complete","exception","cancel"].each(function(c){this.addEvent(c,a.hide.bind(a)); +},this);}}return this.spinner;}});Element.Properties.spinner={set:function(a){var b=this.retrieve("spinner");if(b){b.destroy();}return this.eliminate("spinner").store("spinner:options",a); +},get:function(){var a=this.retrieve("spinner");if(!a){a=new Spinner(this,this.retrieve("spinner:options"));this.store("spinner",a);}return a;}};Element.implement({spin:function(a){if(a){this.set("spinner",a); +}this.get("spinner").show();return this;},unspin:function(){this.get("spinner").hide();return this;}}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-more-1.4.0.1.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-more-1.4.0.1.js new file mode 100644 index 00000000000..a10a33db09f --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/core/mootools-more-1.4.0.1.js @@ -0,0 +1,5723 @@ +// MooTools: the javascript framework. +// Load this file's selection again by visiting: http://mootools.net/more/fb61ad1e1a36c672a3470d3640c69d38 +// Or build this file again with packager using: packager build More/More More/Class.Refactor More/Class.Binds More/Class.Occlude More/Date More/Date.Extras More/String.Extras More/String.QueryString More/Element.Forms More/Elements.From More/Element.Measure More/Element.Position More/Element.Shortcuts More/Form.Validator More/Fx.Elements More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag More/Drag.Move More/Slider More/Sortables More/Request.Periodical More/Assets More/IframeShim More/Mask More/Tips More/Spinner More/Locale.en-US.Date +/* +--- + +script: More.js + +name: More + +description: MooTools More + +license: MIT-style license + +authors: + - Guillermo Rauch + - Thomas Aylott + - Scott Kyle + - Arian Stolwijk + - Tim Wienk + - Christoph Pojer + - Aaron Newton + - Jacob Thornton + +requires: + - Core/MooTools + +provides: [MooTools.More] + +... +*/ + +MooTools.More = { + 'version': '1.4.0.1', + 'build': 'a4244edf2aa97ac8a196fc96082dd35af1abab87' +}; + + +/* +--- + +script: Class.Refactor.js + +name: Class.Refactor + +description: Extends a class onto itself with new property, preserving any items attached to the class's namespace. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Class + - /MooTools.More + +# Some modules declare themselves dependent on Class.Refactor +provides: [Class.refactor, Class.Refactor] + +... +*/ + +Class.refactor = function(original, refactors){ + + Object.each(refactors, function(item, name){ + var origin = original.prototype[name]; + origin = (origin && origin.$origin) || origin || function(){}; + original.implement(name, (typeof item == 'function') ? function(){ + var old = this.previous; + this.previous = origin; + var value = item.apply(this, arguments); + this.previous = old; + return value; + } : item); + }); + + return original; + +}; + + +/* +--- + +script: Class.Binds.js + +name: Class.Binds + +description: Automagically binds specified methods in a class to the instance of the class. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Class + - /MooTools.More + +provides: [Class.Binds] + +... +*/ + +Class.Mutators.Binds = function(binds){ + if (!this.prototype.initialize) this.implement('initialize', function(){}); + return Array.from(binds).concat(this.prototype.Binds || []); +}; + +Class.Mutators.initialize = function(initialize){ + return function(){ + Array.from(this.Binds).each(function(name){ + var original = this[name]; + if (original) this[name] = original.bind(this); + }, this); + return initialize.apply(this, arguments); + }; +}; + + +/* +--- + +script: Class.Occlude.js + +name: Class.Occlude + +description: Prevents a class from being applied to a DOM element twice. + +license: MIT-style license. + +authors: + - Aaron Newton + +requires: + - Core/Class + - Core/Element + - /MooTools.More + +provides: [Class.Occlude] + +... +*/ + +Class.Occlude = new Class({ + + occlude: function(property, element){ + element = document.id(element || this.element); + var instance = element.retrieve(property || this.property); + if (instance && !this.occluded) + return (this.occluded = instance); + + this.occluded = false; + element.store(property || this.property, this); + return this.occluded; + } + +}); + + +/* +--- + +script: Object.Extras.js + +name: Object.Extras + +description: Extra Object generics, like getFromPath which allows a path notation to child elements. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Object + - /MooTools.More + +provides: [Object.Extras] + +... +*/ + +(function(){ + +var defined = function(value){ + return value != null; +}; + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +Object.extend({ + + getFromPath: function(source, parts){ + if (typeof parts == 'string') parts = parts.split('.'); + for (var i = 0, l = parts.length; i < l; i++){ + if (hasOwnProperty.call(source, parts[i])) source = source[parts[i]]; + else return null; + } + return source; + }, + + cleanValues: function(object, method){ + method = method || defined; + for (var key in object) if (!method(object[key])){ + delete object[key]; + } + return object; + }, + + erase: function(object, key){ + if (hasOwnProperty.call(object, key)) delete object[key]; + return object; + }, + + run: function(object){ + var args = Array.slice(arguments, 1); + for (var key in object) if (object[key].apply){ + object[key].apply(object, args); + } + return object; + } + +}); + +})(); + + +/* +--- + +script: Locale.js + +name: Locale + +description: Provides methods for localization. + +license: MIT-style license + +authors: + - Aaron Newton + - Arian Stolwijk + +requires: + - Core/Events + - /Object.Extras + - /MooTools.More + +provides: [Locale, Lang] + +... +*/ + +(function(){ + +var current = null, + locales = {}, + inherits = {}; + +var getSet = function(set){ + if (instanceOf(set, Locale.Set)) return set; + else return locales[set]; +}; + +var Locale = this.Locale = { + + define: function(locale, set, key, value){ + var name; + if (instanceOf(locale, Locale.Set)){ + name = locale.name; + if (name) locales[name] = locale; + } else { + name = locale; + if (!locales[name]) locales[name] = new Locale.Set(name); + locale = locales[name]; + } + + if (set) locale.define(set, key, value); + + + + if (!current) current = locale; + + return locale; + }, + + use: function(locale){ + locale = getSet(locale); + + if (locale){ + current = locale; + + this.fireEvent('change', locale); + + + } + + return this; + }, + + getCurrent: function(){ + return current; + }, + + get: function(key, args){ + return (current) ? current.get(key, args) : ''; + }, + + inherit: function(locale, inherits, set){ + locale = getSet(locale); + + if (locale) locale.inherit(inherits, set); + return this; + }, + + list: function(){ + return Object.keys(locales); + } + +}; + +Object.append(Locale, new Events); + +Locale.Set = new Class({ + + sets: {}, + + inherits: { + locales: [], + sets: {} + }, + + initialize: function(name){ + this.name = name || ''; + }, + + define: function(set, key, value){ + var defineData = this.sets[set]; + if (!defineData) defineData = {}; + + if (key){ + if (typeOf(key) == 'object') defineData = Object.merge(defineData, key); + else defineData[key] = value; + } + this.sets[set] = defineData; + + return this; + }, + + get: function(key, args, _base){ + var value = Object.getFromPath(this.sets, key); + if (value != null){ + var type = typeOf(value); + if (type == 'function') value = value.apply(null, Array.from(args)); + else if (type == 'object') value = Object.clone(value); + return value; + } + + // get value of inherited locales + var index = key.indexOf('.'), + set = index < 0 ? key : key.substr(0, index), + names = (this.inherits.sets[set] || []).combine(this.inherits.locales).include('en-US'); + if (!_base) _base = []; + + for (var i = 0, l = names.length; i < l; i++){ + if (_base.contains(names[i])) continue; + _base.include(names[i]); + + var locale = locales[names[i]]; + if (!locale) continue; + + value = locale.get(key, args, _base); + if (value != null) return value; + } + + return ''; + }, + + inherit: function(names, set){ + names = Array.from(names); + + if (set && !this.inherits.sets[set]) this.inherits.sets[set] = []; + + var l = names.length; + while (l--) (set ? this.inherits.sets[set] : this.inherits.locales).unshift(names[l]); + + return this; + } + +}); + + + +})(); + + +/* +--- + +name: Locale.en-US.Date + +description: Date messages for US English. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Locale + +provides: [Locale.en-US.Date] + +... +*/ + +Locale.define('en-US', 'Date', { + + months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + months_abbr: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + days_abbr: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + + // Culture's date order: MM/DD/YYYY + dateOrder: ['month', 'date', 'year'], + shortDate: '%m/%d/%Y', + shortTime: '%I:%M%p', + AM: 'AM', + PM: 'PM', + firstDayOfWeek: 0, + + // Date.Extras + ordinal: function(dayOfMonth){ + // 1st, 2nd, 3rd, etc. + return (dayOfMonth > 3 && dayOfMonth < 21) ? 'th' : ['th', 'st', 'nd', 'rd', 'th'][Math.min(dayOfMonth % 10, 4)]; + }, + + lessThanMinuteAgo: 'less than a minute ago', + minuteAgo: 'about a minute ago', + minutesAgo: '{delta} minutes ago', + hourAgo: 'about an hour ago', + hoursAgo: 'about {delta} hours ago', + dayAgo: '1 day ago', + daysAgo: '{delta} days ago', + weekAgo: '1 week ago', + weeksAgo: '{delta} weeks ago', + monthAgo: '1 month ago', + monthsAgo: '{delta} months ago', + yearAgo: '1 year ago', + yearsAgo: '{delta} years ago', + + lessThanMinuteUntil: 'less than a minute from now', + minuteUntil: 'about a minute from now', + minutesUntil: '{delta} minutes from now', + hourUntil: 'about an hour from now', + hoursUntil: 'about {delta} hours from now', + dayUntil: '1 day from now', + daysUntil: '{delta} days from now', + weekUntil: '1 week from now', + weeksUntil: '{delta} weeks from now', + monthUntil: '1 month from now', + monthsUntil: '{delta} months from now', + yearUntil: '1 year from now', + yearsUntil: '{delta} years from now' + +}); + + +/* +--- + +script: Date.js + +name: Date + +description: Extends the Date native object to include methods useful in managing dates. + +license: MIT-style license + +authors: + - Aaron Newton + - Nicholas Barthelemy - https://svn.nbarthelemy.com/date-js/ + - Harald Kirshner - mail [at] digitarald.de; http://digitarald.de + - Scott Kyle - scott [at] appden.com; http://appden.com + +requires: + - Core/Array + - Core/String + - Core/Number + - MooTools.More + - Locale + - Locale.en-US.Date + +provides: [Date] + +... +*/ + +(function(){ + +var Date = this.Date; + +var DateMethods = Date.Methods = { + ms: 'Milliseconds', + year: 'FullYear', + min: 'Minutes', + mo: 'Month', + sec: 'Seconds', + hr: 'Hours' +}; + +['Date', 'Day', 'FullYear', 'Hours', 'Milliseconds', 'Minutes', 'Month', 'Seconds', 'Time', 'TimezoneOffset', + 'Week', 'Timezone', 'GMTOffset', 'DayOfYear', 'LastMonth', 'LastDayOfMonth', 'UTCDate', 'UTCDay', 'UTCFullYear', + 'AMPM', 'Ordinal', 'UTCHours', 'UTCMilliseconds', 'UTCMinutes', 'UTCMonth', 'UTCSeconds', 'UTCMilliseconds'].each(function(method){ + Date.Methods[method.toLowerCase()] = method; +}); + +var pad = function(n, digits, string){ + if (digits == 1) return n; + return n < Math.pow(10, digits - 1) ? (string || '0') + pad(n, digits - 1, string) : n; +}; + +Date.implement({ + + set: function(prop, value){ + prop = prop.toLowerCase(); + var method = DateMethods[prop] && 'set' + DateMethods[prop]; + if (method && this[method]) this[method](value); + return this; + }.overloadSetter(), + + get: function(prop){ + prop = prop.toLowerCase(); + var method = DateMethods[prop] && 'get' + DateMethods[prop]; + if (method && this[method]) return this[method](); + return null; + }.overloadGetter(), + + clone: function(){ + return new Date(this.get('time')); + }, + + increment: function(interval, times){ + interval = interval || 'day'; + times = times != null ? times : 1; + + switch (interval){ + case 'year': + return this.increment('month', times * 12); + case 'month': + var d = this.get('date'); + this.set('date', 1).set('mo', this.get('mo') + times); + return this.set('date', d.min(this.get('lastdayofmonth'))); + case 'week': + return this.increment('day', times * 7); + case 'day': + return this.set('date', this.get('date') + times); + } + + if (!Date.units[interval]) throw new Error(interval + ' is not a supported interval'); + + return this.set('time', this.get('time') + times * Date.units[interval]()); + }, + + decrement: function(interval, times){ + return this.increment(interval, -1 * (times != null ? times : 1)); + }, + + isLeapYear: function(){ + return Date.isLeapYear(this.get('year')); + }, + + clearTime: function(){ + return this.set({hr: 0, min: 0, sec: 0, ms: 0}); + }, + + diff: function(date, resolution){ + if (typeOf(date) == 'string') date = Date.parse(date); + + return ((date - this) / Date.units[resolution || 'day'](3, 3)).round(); // non-leap year, 30-day month + }, + + getLastDayOfMonth: function(){ + return Date.daysInMonth(this.get('mo'), this.get('year')); + }, + + getDayOfYear: function(){ + return (Date.UTC(this.get('year'), this.get('mo'), this.get('date') + 1) + - Date.UTC(this.get('year'), 0, 1)) / Date.units.day(); + }, + + setDay: function(day, firstDayOfWeek){ + if (firstDayOfWeek == null){ + firstDayOfWeek = Date.getMsg('firstDayOfWeek'); + if (firstDayOfWeek === '') firstDayOfWeek = 1; + } + + day = (7 + Date.parseDay(day, true) - firstDayOfWeek) % 7; + var currentDay = (7 + this.get('day') - firstDayOfWeek) % 7; + + return this.increment('day', day - currentDay); + }, + + getWeek: function(firstDayOfWeek){ + if (firstDayOfWeek == null){ + firstDayOfWeek = Date.getMsg('firstDayOfWeek'); + if (firstDayOfWeek === '') firstDayOfWeek = 1; + } + + var date = this, + dayOfWeek = (7 + date.get('day') - firstDayOfWeek) % 7, + dividend = 0, + firstDayOfYear; + + if (firstDayOfWeek == 1){ + // ISO-8601, week belongs to year that has the most days of the week (i.e. has the thursday of the week) + var month = date.get('month'), + startOfWeek = date.get('date') - dayOfWeek; + + if (month == 11 && startOfWeek > 28) return 1; // Week 1 of next year + + if (month == 0 && startOfWeek < -2){ + // Use a date from last year to determine the week + date = new Date(date).decrement('day', dayOfWeek); + dayOfWeek = 0; + } + + firstDayOfYear = new Date(date.get('year'), 0, 1).get('day') || 7; + if (firstDayOfYear > 4) dividend = -7; // First week of the year is not week 1 + } else { + // In other cultures the first week of the year is always week 1 and the last week always 53 or 54. + // Days in the same week can have a different weeknumber if the week spreads across two years. + firstDayOfYear = new Date(date.get('year'), 0, 1).get('day'); + } + + dividend += date.get('dayofyear'); + dividend += 6 - dayOfWeek; // Add days so we calculate the current date's week as a full week + dividend += (7 + firstDayOfYear - firstDayOfWeek) % 7; // Make up for first week of the year not being a full week + + return (dividend / 7); + }, + + getOrdinal: function(day){ + return Date.getMsg('ordinal', day || this.get('date')); + }, + + getTimezone: function(){ + return this.toString() + .replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/, '$1') + .replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, '$1$2$3'); + }, + + getGMTOffset: function(){ + var off = this.get('timezoneOffset'); + return ((off > 0) ? '-' : '+') + pad((off.abs() / 60).floor(), 2) + pad(off % 60, 2); + }, + + setAMPM: function(ampm){ + ampm = ampm.toUpperCase(); + var hr = this.get('hr'); + if (hr > 11 && ampm == 'AM') return this.decrement('hour', 12); + else if (hr < 12 && ampm == 'PM') return this.increment('hour', 12); + return this; + }, + + getAMPM: function(){ + return (this.get('hr') < 12) ? 'AM' : 'PM'; + }, + + parse: function(str){ + this.set('time', Date.parse(str)); + return this; + }, + + isValid: function(date){ + if (!date) date = this; + return typeOf(date) == 'date' && !isNaN(date.valueOf()); + }, + + format: function(format){ + if (!this.isValid()) return 'invalid date'; + + if (!format) format = '%x %X'; + if (typeof format == 'string') format = formats[format.toLowerCase()] || format; + if (typeof format == 'function') return format(this); + + var d = this; + return format.replace(/%([a-z%])/gi, + function($0, $1){ + switch ($1){ + case 'a': return Date.getMsg('days_abbr')[d.get('day')]; + case 'A': return Date.getMsg('days')[d.get('day')]; + case 'b': return Date.getMsg('months_abbr')[d.get('month')]; + case 'B': return Date.getMsg('months')[d.get('month')]; + case 'c': return d.format('%a %b %d %H:%M:%S %Y'); + case 'd': return pad(d.get('date'), 2); + case 'e': return pad(d.get('date'), 2, ' '); + case 'H': return pad(d.get('hr'), 2); + case 'I': return pad((d.get('hr') % 12) || 12, 2); + case 'j': return pad(d.get('dayofyear'), 3); + case 'k': return pad(d.get('hr'), 2, ' '); + case 'l': return pad((d.get('hr') % 12) || 12, 2, ' '); + case 'L': return pad(d.get('ms'), 3); + case 'm': return pad((d.get('mo') + 1), 2); + case 'M': return pad(d.get('min'), 2); + case 'o': return d.get('ordinal'); + case 'p': return Date.getMsg(d.get('ampm')); + case 's': return Math.round(d / 1000); + case 'S': return pad(d.get('seconds'), 2); + case 'T': return d.format('%H:%M:%S'); + case 'U': return pad(d.get('week'), 2); + case 'w': return d.get('day'); + case 'x': return d.format(Date.getMsg('shortDate')); + case 'X': return d.format(Date.getMsg('shortTime')); + case 'y': return d.get('year').toString().substr(2); + case 'Y': return d.get('year'); + case 'z': return d.get('GMTOffset'); + case 'Z': return d.get('Timezone'); + } + return $1; + } + ); + }, + + toISOString: function(){ + return this.format('iso8601'); + } + +}).alias({ + toJSON: 'toISOString', + compare: 'diff', + strftime: 'format' +}); + +// The day and month abbreviations are standardized, so we cannot use simply %a and %b because they will get localized +var rfcDayAbbr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + rfcMonthAbbr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var formats = { + db: '%Y-%m-%d %H:%M:%S', + compact: '%Y%m%dT%H%M%S', + 'short': '%d %b %H:%M', + 'long': '%B %d, %Y %H:%M', + rfc822: function(date){ + return rfcDayAbbr[date.get('day')] + date.format(', %d ') + rfcMonthAbbr[date.get('month')] + date.format(' %Y %H:%M:%S %Z'); + }, + rfc2822: function(date){ + return rfcDayAbbr[date.get('day')] + date.format(', %d ') + rfcMonthAbbr[date.get('month')] + date.format(' %Y %H:%M:%S %z'); + }, + iso8601: function(date){ + return ( + date.getUTCFullYear() + '-' + + pad(date.getUTCMonth() + 1, 2) + '-' + + pad(date.getUTCDate(), 2) + 'T' + + pad(date.getUTCHours(), 2) + ':' + + pad(date.getUTCMinutes(), 2) + ':' + + pad(date.getUTCSeconds(), 2) + '.' + + pad(date.getUTCMilliseconds(), 3) + 'Z' + ); + } +}; + +var parsePatterns = [], + nativeParse = Date.parse; + +var parseWord = function(type, word, num){ + var ret = -1, + translated = Date.getMsg(type + 's'); + switch (typeOf(word)){ + case 'object': + ret = translated[word.get(type)]; + break; + case 'number': + ret = translated[word]; + if (!ret) throw new Error('Invalid ' + type + ' index: ' + word); + break; + case 'string': + var match = translated.filter(function(name){ + return this.test(name); + }, new RegExp('^' + word, 'i')); + if (!match.length) throw new Error('Invalid ' + type + ' string'); + if (match.length > 1) throw new Error('Ambiguous ' + type); + ret = match[0]; + } + + return (num) ? translated.indexOf(ret) : ret; +}; + +var startCentury = 1900, + startYear = 70; + +Date.extend({ + + getMsg: function(key, args){ + return Locale.get('Date.' + key, args); + }, + + units: { + ms: Function.from(1), + second: Function.from(1000), + minute: Function.from(60000), + hour: Function.from(3600000), + day: Function.from(86400000), + week: Function.from(608400000), + month: function(month, year){ + var d = new Date; + return Date.daysInMonth(month != null ? month : d.get('mo'), year != null ? year : d.get('year')) * 86400000; + }, + year: function(year){ + year = year || new Date().get('year'); + return Date.isLeapYear(year) ? 31622400000 : 31536000000; + } + }, + + daysInMonth: function(month, year){ + return [31, Date.isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; + }, + + isLeapYear: function(year){ + return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); + }, + + parse: function(from){ + var t = typeOf(from); + if (t == 'number') return new Date(from); + if (t != 'string') return from; + from = from.clean(); + if (!from.length) return null; + + var parsed; + parsePatterns.some(function(pattern){ + var bits = pattern.re.exec(from); + return (bits) ? (parsed = pattern.handler(bits)) : false; + }); + + if (!(parsed && parsed.isValid())){ + parsed = new Date(nativeParse(from)); + if (!(parsed && parsed.isValid())) parsed = new Date(from.toInt()); + } + return parsed; + }, + + parseDay: function(day, num){ + return parseWord('day', day, num); + }, + + parseMonth: function(month, num){ + return parseWord('month', month, num); + }, + + parseUTC: function(value){ + var localDate = new Date(value); + var utcSeconds = Date.UTC( + localDate.get('year'), + localDate.get('mo'), + localDate.get('date'), + localDate.get('hr'), + localDate.get('min'), + localDate.get('sec'), + localDate.get('ms') + ); + return new Date(utcSeconds); + }, + + orderIndex: function(unit){ + return Date.getMsg('dateOrder').indexOf(unit) + 1; + }, + + defineFormat: function(name, format){ + formats[name] = format; + return this; + }, + + + + defineParser: function(pattern){ + parsePatterns.push((pattern.re && pattern.handler) ? pattern : build(pattern)); + return this; + }, + + defineParsers: function(){ + Array.flatten(arguments).each(Date.defineParser); + return this; + }, + + define2DigitYearStart: function(year){ + startYear = year % 100; + startCentury = year - startYear; + return this; + } + +}).extend({ + defineFormats: Date.defineFormat.overloadSetter() +}); + +var regexOf = function(type){ + return new RegExp('(?:' + Date.getMsg(type).map(function(name){ + return name.substr(0, 3); + }).join('|') + ')[a-z]*'); +}; + +var replacers = function(key){ + switch (key){ + case 'T': + return '%H:%M:%S'; + case 'x': // iso8601 covers yyyy-mm-dd, so just check if month is first + return ((Date.orderIndex('month') == 1) ? '%m[-./]%d' : '%d[-./]%m') + '([-./]%y)?'; + case 'X': + return '%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?'; + } + return null; +}; + +var keys = { + d: /[0-2]?[0-9]|3[01]/, + H: /[01]?[0-9]|2[0-3]/, + I: /0?[1-9]|1[0-2]/, + M: /[0-5]?\d/, + s: /\d+/, + o: /[a-z]*/, + p: /[ap]\.?m\.?/, + y: /\d{2}|\d{4}/, + Y: /\d{4}/, + z: /Z|[+-]\d{2}(?::?\d{2})?/ +}; + +keys.m = keys.I; +keys.S = keys.M; + +var currentLanguage; + +var recompile = function(language){ + currentLanguage = language; + + keys.a = keys.A = regexOf('days'); + keys.b = keys.B = regexOf('months'); + + parsePatterns.each(function(pattern, i){ + if (pattern.format) parsePatterns[i] = build(pattern.format); + }); +}; + +var build = function(format){ + if (!currentLanguage) return {format: format}; + + var parsed = []; + var re = (format.source || format) // allow format to be regex + .replace(/%([a-z])/gi, + function($0, $1){ + return replacers($1) || $0; + } + ).replace(/\((?!\?)/g, '(?:') // make all groups non-capturing + .replace(/ (?!\?|\*)/g, ',? ') // be forgiving with spaces and commas + .replace(/%([a-z%])/gi, + function($0, $1){ + var p = keys[$1]; + if (!p) return $1; + parsed.push($1); + return '(' + p.source + ')'; + } + ).replace(/\[a-z\]/gi, '[a-z\\u00c0-\\uffff;\&]'); // handle unicode words + + return { + format: format, + re: new RegExp('^' + re + '$', 'i'), + handler: function(bits){ + bits = bits.slice(1).associate(parsed); + var date = new Date().clearTime(), + year = bits.y || bits.Y; + + if (year != null) handle.call(date, 'y', year); // need to start in the right year + if ('d' in bits) handle.call(date, 'd', 1); + if ('m' in bits || bits.b || bits.B) handle.call(date, 'm', 1); + + for (var key in bits) handle.call(date, key, bits[key]); + return date; + } + }; +}; + +var handle = function(key, value){ + if (!value) return this; + + switch (key){ + case 'a': case 'A': return this.set('day', Date.parseDay(value, true)); + case 'b': case 'B': return this.set('mo', Date.parseMonth(value, true)); + case 'd': return this.set('date', value); + case 'H': case 'I': return this.set('hr', value); + case 'm': return this.set('mo', value - 1); + case 'M': return this.set('min', value); + case 'p': return this.set('ampm', value.replace(/\./g, '')); + case 'S': return this.set('sec', value); + case 's': return this.set('ms', ('0.' + value) * 1000); + case 'w': return this.set('day', value); + case 'Y': return this.set('year', value); + case 'y': + value = +value; + if (value < 100) value += startCentury + (value < startYear ? 100 : 0); + return this.set('year', value); + case 'z': + if (value == 'Z') value = '+00'; + var offset = value.match(/([+-])(\d{2}):?(\d{2})?/); + offset = (offset[1] + '1') * (offset[2] * 60 + (+offset[3] || 0)) + this.getTimezoneOffset(); + return this.set('time', this - offset * 60000); + } + + return this; +}; + +Date.defineParsers( + '%Y([-./]%m([-./]%d((T| )%X)?)?)?', // "1999-12-31", "1999-12-31 11:59pm", "1999-12-31 23:59:59", ISO8601 + '%Y%m%d(T%H(%M%S?)?)?', // "19991231", "19991231T1159", compact + '%x( %X)?', // "12/31", "12.31.99", "12-31-1999", "12/31/2008 11:59 PM" + '%d%o( %b( %Y)?)?( %X)?', // "31st", "31st December", "31 Dec 1999", "31 Dec 1999 11:59pm" + '%b( %d%o)?( %Y)?( %X)?', // Same as above with month and day switched + '%Y %b( %d%o( %X)?)?', // Same as above with year coming first + '%o %b %d %X %z %Y', // "Thu Oct 22 08:11:23 +0000 2009" + '%T', // %H:%M:%S + '%H:%M( ?%p)?' // "11:05pm", "11:05 am" and "11:05" +); + +Locale.addEvent('change', function(language){ + if (Locale.get('Date')) recompile(language); +}).fireEvent('change', Locale.getCurrent()); + +})(); + + +/* +--- + +script: Date.Extras.js + +name: Date.Extras + +description: Extends the Date native object to include extra methods (on top of those in Date.js). + +license: MIT-style license + +authors: + - Aaron Newton + - Scott Kyle + +requires: + - /Date + +provides: [Date.Extras] + +... +*/ + +Date.implement({ + + timeDiffInWords: function(to){ + return Date.distanceOfTimeInWords(this, to || new Date); + }, + + timeDiff: function(to, separator){ + if (to == null) to = new Date; + var delta = ((to - this) / 1000).floor().abs(); + + var vals = [], + durations = [60, 60, 24, 365, 0], + names = ['s', 'm', 'h', 'd', 'y'], + value, duration; + + for (var item = 0; item < durations.length; item++){ + if (item && !delta) break; + value = delta; + if ((duration = durations[item])){ + value = (delta % duration); + delta = (delta / duration).floor(); + } + vals.unshift(value + (names[item] || '')); + } + + return vals.join(separator || ':'); + } + +}).extend({ + + distanceOfTimeInWords: function(from, to){ + return Date.getTimePhrase(((to - from) / 1000).toInt()); + }, + + getTimePhrase: function(delta){ + var suffix = (delta < 0) ? 'Until' : 'Ago'; + if (delta < 0) delta *= -1; + + var units = { + minute: 60, + hour: 60, + day: 24, + week: 7, + month: 52 / 12, + year: 12, + eon: Infinity + }; + + var msg = 'lessThanMinute'; + + for (var unit in units){ + var interval = units[unit]; + if (delta < 1.5 * interval){ + if (delta > 0.75 * interval) msg = unit; + break; + } + delta /= interval; + msg = unit + 's'; + } + + delta = delta.round(); + return Date.getMsg(msg + suffix, delta).substitute({delta: delta}); + } + +}).defineParsers( + + { + // "today", "tomorrow", "yesterday" + re: /^(?:tod|tom|yes)/i, + handler: function(bits){ + var d = new Date().clearTime(); + switch (bits[0]){ + case 'tom': return d.increment(); + case 'yes': return d.decrement(); + default: return d; + } + } + }, + + { + // "next Wednesday", "last Thursday" + re: /^(next|last) ([a-z]+)$/i, + handler: function(bits){ + var d = new Date().clearTime(); + var day = d.getDay(); + var newDay = Date.parseDay(bits[2], true); + var addDays = newDay - day; + if (newDay <= day) addDays += 7; + if (bits[1] == 'last') addDays -= 7; + return d.set('date', d.getDate() + addDays); + } + } + +).alias('timeAgoInWords', 'timeDiffInWords'); + + +/* +--- + +script: String.Extras.js + +name: String.Extras + +description: Extends the String native object to include methods useful in managing various kinds of strings (query strings, urls, html, etc). + +license: MIT-style license + +authors: + - Aaron Newton + - Guillermo Rauch + - Christopher Pitt + +requires: + - Core/String + - Core/Array + - MooTools.More + +provides: [String.Extras] + +... +*/ + +(function(){ + +var special = { + 'a': /[àáâãäåăą]/g, + 'A': /[ÀÁÂÃÄÅĂĄ]/g, + 'c': /[ćčç]/g, + 'C': /[ĆČÇ]/g, + 'd': /[ďđ]/g, + 'D': /[ĎÐ]/g, + 'e': /[èéêëěę]/g, + 'E': /[ÈÉÊËĚĘ]/g, + 'g': /[ğ]/g, + 'G': /[Ğ]/g, + 'i': /[ìíîï]/g, + 'I': /[ÌÍÎÏ]/g, + 'l': /[ĺľł]/g, + 'L': /[ĹĽŁ]/g, + 'n': /[ñňń]/g, + 'N': /[ÑŇŃ]/g, + 'o': /[òóôõöøő]/g, + 'O': /[ÒÓÔÕÖØ]/g, + 'r': /[řŕ]/g, + 'R': /[ŘŔ]/g, + 's': /[ššş]/g, + 'S': /[ŠŞŚ]/g, + 't': /[ťţ]/g, + 'T': /[ŤŢ]/g, + 'ue': /[ü]/g, + 'UE': /[Ü]/g, + 'u': /[ùúûůµ]/g, + 'U': /[ÙÚÛŮ]/g, + 'y': /[ÿý]/g, + 'Y': /[ŸÝ]/g, + 'z': /[žźż]/g, + 'Z': /[ŽŹŻ]/g, + 'th': /[þ]/g, + 'TH': /[Þ]/g, + 'dh': /[ð]/g, + 'DH': /[Ð]/g, + 'ss': /[ß]/g, + 'oe': /[œ]/g, + 'OE': /[Œ]/g, + 'ae': /[æ]/g, + 'AE': /[Æ]/g +}, + +tidy = { + ' ': /[\xa0\u2002\u2003\u2009]/g, + '*': /[\xb7]/g, + '\'': /[\u2018\u2019]/g, + '"': /[\u201c\u201d]/g, + '...': /[\u2026]/g, + '-': /[\u2013]/g, +// '--': /[\u2014]/g, + '»': /[\uFFFD]/g +}; + +var walk = function(string, replacements){ + var result = string, key; + for (key in replacements) result = result.replace(replacements[key], key); + return result; +}; + +var getRegexForTag = function(tag, contents){ + tag = tag || ''; + var regstr = contents ? "<" + tag + "(?!\\w)[^>]*>([\\s\\S]*?)<\/" + tag + "(?!\\w)>" : "<\/?" + tag + "([^>]+)?>", + reg = new RegExp(regstr, "gi"); + return reg; +}; + +String.implement({ + + standardize: function(){ + return walk(this, special); + }, + + repeat: function(times){ + return new Array(times + 1).join(this); + }, + + pad: function(length, str, direction){ + if (this.length >= length) return this; + + var pad = (str == null ? ' ' : '' + str) + .repeat(length - this.length) + .substr(0, length - this.length); + + if (!direction || direction == 'right') return this + pad; + if (direction == 'left') return pad + this; + + return pad.substr(0, (pad.length / 2).floor()) + this + pad.substr(0, (pad.length / 2).ceil()); + }, + + getTags: function(tag, contents){ + return this.match(getRegexForTag(tag, contents)) || []; + }, + + stripTags: function(tag, contents){ + return this.replace(getRegexForTag(tag, contents), ''); + }, + + tidy: function(){ + return walk(this, tidy); + }, + + truncate: function(max, trail, atChar){ + var string = this; + if (trail == null && arguments.length == 1) trail = '…'; + if (string.length > max){ + string = string.substring(0, max); + if (atChar){ + var index = string.lastIndexOf(atChar); + if (index != -1) string = string.substr(0, index); + } + if (trail) string += trail; + } + return string; + } + +}); + +})(); + + +/* +--- + +script: String.QueryString.js + +name: String.QueryString + +description: Methods for dealing with URI query strings. + +license: MIT-style license + +authors: + - Sebastian Markbåge + - Aaron Newton + - Lennart Pilon + - Valerio Proietti + +requires: + - Core/Array + - Core/String + - /MooTools.More + +provides: [String.QueryString] + +... +*/ + +String.implement({ + + parseQueryString: function(decodeKeys, decodeValues){ + if (decodeKeys == null) decodeKeys = true; + if (decodeValues == null) decodeValues = true; + + var vars = this.split(/[&;]/), + object = {}; + if (!vars.length) return object; + + vars.each(function(val){ + var index = val.indexOf('=') + 1, + value = index ? val.substr(index) : '', + keys = index ? val.substr(0, index - 1).match(/([^\]\[]+|(\B)(?=\]))/g) : [val], + obj = object; + if (!keys) return; + if (decodeValues) value = decodeURIComponent(value); + keys.each(function(key, i){ + if (decodeKeys) key = decodeURIComponent(key); + var current = obj[key]; + + if (i < keys.length - 1) obj = obj[key] = current || {}; + else if (typeOf(current) == 'array') current.push(value); + else obj[key] = current != null ? [current, value] : value; + }); + }); + + return object; + }, + + cleanQueryString: function(method){ + return this.split('&').filter(function(val){ + var index = val.indexOf('='), + key = index < 0 ? '' : val.substr(0, index), + value = val.substr(index + 1); + + return method ? method.call(null, key, value) : (value || value === 0); + }).join('&'); + } + +}); + + +/* +--- + +script: Element.Forms.js + +name: Element.Forms + +description: Extends the Element native object to include methods useful in managing inputs. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element + - /String.Extras + - /MooTools.More + +provides: [Element.Forms] + +... +*/ + +Element.implement({ + + tidy: function(){ + this.set('value', this.get('value').tidy()); + }, + + getTextInRange: function(start, end){ + return this.get('value').substring(start, end); + }, + + getSelectedText: function(){ + if (this.setSelectionRange) return this.getTextInRange(this.getSelectionStart(), this.getSelectionEnd()); + return document.selection.createRange().text; + }, + + getSelectedRange: function(){ + if (this.selectionStart != null){ + return { + start: this.selectionStart, + end: this.selectionEnd + }; + } + + var pos = { + start: 0, + end: 0 + }; + var range = this.getDocument().selection.createRange(); + if (!range || range.parentElement() != this) return pos; + var duplicate = range.duplicate(); + + if (this.type == 'text'){ + pos.start = 0 - duplicate.moveStart('character', -100000); + pos.end = pos.start + range.text.length; + } else { + var value = this.get('value'); + var offset = value.length; + duplicate.moveToElementText(this); + duplicate.setEndPoint('StartToEnd', range); + if (duplicate.text.length) offset -= value.match(/[\n\r]*$/)[0].length; + pos.end = offset - duplicate.text.length; + duplicate.setEndPoint('StartToStart', range); + pos.start = offset - duplicate.text.length; + } + return pos; + }, + + getSelectionStart: function(){ + return this.getSelectedRange().start; + }, + + getSelectionEnd: function(){ + return this.getSelectedRange().end; + }, + + setCaretPosition: function(pos){ + if (pos == 'end') pos = this.get('value').length; + this.selectRange(pos, pos); + return this; + }, + + getCaretPosition: function(){ + return this.getSelectedRange().start; + }, + + selectRange: function(start, end){ + if (this.setSelectionRange){ + this.focus(); + this.setSelectionRange(start, end); + } else { + var value = this.get('value'); + var diff = value.substr(start, end - start).replace(/\r/g, '').length; + start = value.substr(0, start).replace(/\r/g, '').length; + var range = this.createTextRange(); + range.collapse(true); + range.moveEnd('character', start + diff); + range.moveStart('character', start); + range.select(); + } + return this; + }, + + insertAtCursor: function(value, select){ + var pos = this.getSelectedRange(); + var text = this.get('value'); + this.set('value', text.substring(0, pos.start) + value + text.substring(pos.end, text.length)); + if (select !== false) this.selectRange(pos.start, pos.start + value.length); + else this.setCaretPosition(pos.start + value.length); + return this; + }, + + insertAroundCursor: function(options, select){ + options = Object.append({ + before: '', + defaultMiddle: '', + after: '' + }, options); + + var value = this.getSelectedText() || options.defaultMiddle; + var pos = this.getSelectedRange(); + var text = this.get('value'); + + if (pos.start == pos.end){ + this.set('value', text.substring(0, pos.start) + options.before + value + options.after + text.substring(pos.end, text.length)); + this.selectRange(pos.start + options.before.length, pos.end + options.before.length + value.length); + } else { + var current = text.substring(pos.start, pos.end); + this.set('value', text.substring(0, pos.start) + options.before + current + options.after + text.substring(pos.end, text.length)); + var selStart = pos.start + options.before.length; + if (select !== false) this.selectRange(selStart, selStart + current.length); + else this.setCaretPosition(selStart + text.length); + } + return this; + } + +}); + + +/* +--- + +script: Elements.From.js + +name: Elements.From + +description: Returns a collection of elements from a string of html. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/String + - Core/Element + - /MooTools.More + +provides: [Elements.from, Elements.From] + +... +*/ + +Elements.from = function(text, excludeScripts){ + if (excludeScripts || excludeScripts == null) text = text.stripScripts(); + + var container, match = text.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i); + + if (match){ + container = new Element('table'); + var tag = match[1].toLowerCase(); + if (['td', 'th', 'tr'].contains(tag)){ + container = new Element('tbody').inject(container); + if (tag != 'tr') container = new Element('tr').inject(container); + } + } + + return (container || new Element('div')).set('html', text).getChildren(); +}; + + +/* +--- + +script: Element.Measure.js + +name: Element.Measure + +description: Extends the Element native object to include methods useful in measuring dimensions. + +credits: "Element.measure / .expose methods by Daniel Steigerwald License: MIT-style license. Copyright: Copyright (c) 2008 Daniel Steigerwald, daniel.steigerwald.cz" + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Style + - Core/Element.Dimensions + - /MooTools.More + +provides: [Element.Measure] + +... +*/ + +(function(){ + +var getStylesList = function(styles, planes){ + var list = []; + Object.each(planes, function(directions){ + Object.each(directions, function(edge){ + styles.each(function(style){ + list.push(style + '-' + edge + (style == 'border' ? '-width' : '')); + }); + }); + }); + return list; +}; + +var calculateEdgeSize = function(edge, styles){ + var total = 0; + Object.each(styles, function(value, style){ + if (style.test(edge)) total = total + value.toInt(); + }); + return total; +}; + +var isVisible = function(el){ + return !!(!el || el.offsetHeight || el.offsetWidth); +}; + + +Element.implement({ + + measure: function(fn){ + if (isVisible(this)) return fn.call(this); + var parent = this.getParent(), + toMeasure = []; + while (!isVisible(parent) && parent != document.body){ + toMeasure.push(parent.expose()); + parent = parent.getParent(); + } + var restore = this.expose(), + result = fn.call(this); + restore(); + toMeasure.each(function(restore){ + restore(); + }); + return result; + }, + + expose: function(){ + if (this.getStyle('display') != 'none') return function(){}; + var before = this.style.cssText; + this.setStyles({ + display: 'block', + position: 'absolute', + visibility: 'hidden' + }); + return function(){ + this.style.cssText = before; + }.bind(this); + }, + + getDimensions: function(options){ + options = Object.merge({computeSize: false}, options); + var dim = {x: 0, y: 0}; + + var getSize = function(el, options){ + return (options.computeSize) ? el.getComputedSize(options) : el.getSize(); + }; + + var parent = this.getParent('body'); + + if (parent && this.getStyle('display') == 'none'){ + dim = this.measure(function(){ + return getSize(this, options); + }); + } else if (parent){ + try { //safari sometimes crashes here, so catch it + dim = getSize(this, options); + }catch(e){} + } + + return Object.append(dim, (dim.x || dim.x === 0) ? { + width: dim.x, + height: dim.y + } : { + x: dim.width, + y: dim.height + } + ); + }, + + getComputedSize: function(options){ + + + options = Object.merge({ + styles: ['padding','border'], + planes: { + height: ['top','bottom'], + width: ['left','right'] + }, + mode: 'both' + }, options); + + var styles = {}, + size = {width: 0, height: 0}, + dimensions; + + if (options.mode == 'vertical'){ + delete size.width; + delete options.planes.width; + } else if (options.mode == 'horizontal'){ + delete size.height; + delete options.planes.height; + } + + getStylesList(options.styles, options.planes).each(function(style){ + styles[style] = this.getStyle(style).toInt(); + }, this); + + Object.each(options.planes, function(edges, plane){ + + var capitalized = plane.capitalize(), + style = this.getStyle(plane); + + if (style == 'auto' && !dimensions) dimensions = this.getDimensions(); + + style = styles[plane] = (style == 'auto') ? dimensions[plane] : style.toInt(); + size['total' + capitalized] = style; + + edges.each(function(edge){ + var edgesize = calculateEdgeSize(edge, styles); + size['computed' + edge.capitalize()] = edgesize; + size['total' + capitalized] += edgesize; + }); + + }, this); + + return Object.append(size, styles); + } + +}); + +})(); + + +/* +--- + +script: Element.Position.js + +name: Element.Position + +description: Extends the Element native object to include methods useful positioning elements relative to others. + +license: MIT-style license + +authors: + - Aaron Newton + - Jacob Thornton + +requires: + - Core/Options + - Core/Element.Dimensions + - Element.Measure + +provides: [Element.Position] + +... +*/ + +(function(original){ + +var local = Element.Position = { + + options: {/* + edge: false, + returnPos: false, + minimum: {x: 0, y: 0}, + maximum: {x: 0, y: 0}, + relFixedPosition: false, + ignoreMargins: false, + ignoreScroll: false, + allowNegative: false,*/ + relativeTo: document.body, + position: { + x: 'center', //left, center, right + y: 'center' //top, center, bottom + }, + offset: {x: 0, y: 0} + }, + + getOptions: function(element, options){ + options = Object.merge({}, local.options, options); + local.setPositionOption(options); + local.setEdgeOption(options); + local.setOffsetOption(element, options); + local.setDimensionsOption(element, options); + return options; + }, + + setPositionOption: function(options){ + options.position = local.getCoordinateFromValue(options.position); + }, + + setEdgeOption: function(options){ + var edgeOption = local.getCoordinateFromValue(options.edge); + options.edge = edgeOption ? edgeOption : + (options.position.x == 'center' && options.position.y == 'center') ? {x: 'center', y: 'center'} : + {x: 'left', y: 'top'}; + }, + + setOffsetOption: function(element, options){ + var parentOffset = {x: 0, y: 0}, + offsetParent = element.measure(function(){ + return document.id(this.getOffsetParent()); + }), + parentScroll = offsetParent.getScroll(); + + if (!offsetParent || offsetParent == element.getDocument().body) return; + parentOffset = offsetParent.measure(function(){ + var position = this.getPosition(); + if (this.getStyle('position') == 'fixed'){ + var scroll = window.getScroll(); + position.x += scroll.x; + position.y += scroll.y; + } + return position; + }); + + options.offset = { + parentPositioned: offsetParent != document.id(options.relativeTo), + x: options.offset.x - parentOffset.x + parentScroll.x, + y: options.offset.y - parentOffset.y + parentScroll.y + }; + }, + + setDimensionsOption: function(element, options){ + options.dimensions = element.getDimensions({ + computeSize: true, + styles: ['padding', 'border', 'margin'] + }); + }, + + getPosition: function(element, options){ + var position = {}; + options = local.getOptions(element, options); + var relativeTo = document.id(options.relativeTo) || document.body; + + local.setPositionCoordinates(options, position, relativeTo); + if (options.edge) local.toEdge(position, options); + + var offset = options.offset; + position.left = ((position.x >= 0 || offset.parentPositioned || options.allowNegative) ? position.x : 0).toInt(); + position.top = ((position.y >= 0 || offset.parentPositioned || options.allowNegative) ? position.y : 0).toInt(); + + local.toMinMax(position, options); + + if (options.relFixedPosition || relativeTo.getStyle('position') == 'fixed') local.toRelFixedPosition(relativeTo, position); + if (options.ignoreScroll) local.toIgnoreScroll(relativeTo, position); + if (options.ignoreMargins) local.toIgnoreMargins(position, options); + + position.left = Math.ceil(position.left); + position.top = Math.ceil(position.top); + delete position.x; + delete position.y; + + return position; + }, + + setPositionCoordinates: function(options, position, relativeTo){ + var offsetY = options.offset.y, + offsetX = options.offset.x, + calc = (relativeTo == document.body) ? window.getScroll() : relativeTo.getPosition(), + top = calc.y, + left = calc.x, + winSize = window.getSize(); + + switch(options.position.x){ + case 'left': position.x = left + offsetX; break; + case 'right': position.x = left + offsetX + relativeTo.offsetWidth; break; + default: position.x = left + ((relativeTo == document.body ? winSize.x : relativeTo.offsetWidth) / 2) + offsetX; break; + } + + switch(options.position.y){ + case 'top': position.y = top + offsetY; break; + case 'bottom': position.y = top + offsetY + relativeTo.offsetHeight; break; + default: position.y = top + ((relativeTo == document.body ? winSize.y : relativeTo.offsetHeight) / 2) + offsetY; break; + } + }, + + toMinMax: function(position, options){ + var xy = {left: 'x', top: 'y'}, value; + ['minimum', 'maximum'].each(function(minmax){ + ['left', 'top'].each(function(lr){ + value = options[minmax] ? options[minmax][xy[lr]] : null; + if (value != null && ((minmax == 'minimum') ? position[lr] < value : position[lr] > value)) position[lr] = value; + }); + }); + }, + + toRelFixedPosition: function(relativeTo, position){ + var winScroll = window.getScroll(); + position.top += winScroll.y; + position.left += winScroll.x; + }, + + toIgnoreScroll: function(relativeTo, position){ + var relScroll = relativeTo.getScroll(); + position.top -= relScroll.y; + position.left -= relScroll.x; + }, + + toIgnoreMargins: function(position, options){ + position.left += options.edge.x == 'right' + ? options.dimensions['margin-right'] + : (options.edge.x != 'center' + ? -options.dimensions['margin-left'] + : -options.dimensions['margin-left'] + ((options.dimensions['margin-right'] + options.dimensions['margin-left']) / 2)); + + position.top += options.edge.y == 'bottom' + ? options.dimensions['margin-bottom'] + : (options.edge.y != 'center' + ? -options.dimensions['margin-top'] + : -options.dimensions['margin-top'] + ((options.dimensions['margin-bottom'] + options.dimensions['margin-top']) / 2)); + }, + + toEdge: function(position, options){ + var edgeOffset = {}, + dimensions = options.dimensions, + edge = options.edge; + + switch(edge.x){ + case 'left': edgeOffset.x = 0; break; + case 'right': edgeOffset.x = -dimensions.x - dimensions.computedRight - dimensions.computedLeft; break; + // center + default: edgeOffset.x = -(Math.round(dimensions.totalWidth / 2)); break; + } + + switch(edge.y){ + case 'top': edgeOffset.y = 0; break; + case 'bottom': edgeOffset.y = -dimensions.y - dimensions.computedTop - dimensions.computedBottom; break; + // center + default: edgeOffset.y = -(Math.round(dimensions.totalHeight / 2)); break; + } + + position.x += edgeOffset.x; + position.y += edgeOffset.y; + }, + + getCoordinateFromValue: function(option){ + if (typeOf(option) != 'string') return option; + option = option.toLowerCase(); + + return { + x: option.test('left') ? 'left' + : (option.test('right') ? 'right' : 'center'), + y: option.test(/upper|top/) ? 'top' + : (option.test('bottom') ? 'bottom' : 'center') + }; + } + +}; + +Element.implement({ + + position: function(options){ + if (options && (options.x != null || options.y != null)){ + return (original ? original.apply(this, arguments) : this); + } + var position = this.setStyle('position', 'absolute').calculatePosition(options); + return (options && options.returnPos) ? position : this.setStyles(position); + }, + + calculatePosition: function(options){ + return local.getPosition(this, options); + } + +}); + +})(Element.prototype.position); + + +/* +--- + +script: Element.Shortcuts.js + +name: Element.Shortcuts + +description: Extends the Element native object to include some shortcut methods. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Style + - /MooTools.More + +provides: [Element.Shortcuts] + +... +*/ + +Element.implement({ + + isDisplayed: function(){ + return this.getStyle('display') != 'none'; + }, + + isVisible: function(){ + var w = this.offsetWidth, + h = this.offsetHeight; + return (w == 0 && h == 0) ? false : (w > 0 && h > 0) ? true : this.style.display != 'none'; + }, + + toggle: function(){ + return this[this.isDisplayed() ? 'hide' : 'show'](); + }, + + hide: function(){ + var d; + try { + //IE fails here if the element is not in the dom + d = this.getStyle('display'); + } catch(e){} + if (d == 'none') return this; + return this.store('element:_originalDisplay', d || '').setStyle('display', 'none'); + }, + + show: function(display){ + if (!display && this.isDisplayed()) return this; + display = display || this.retrieve('element:_originalDisplay') || 'block'; + return this.setStyle('display', (display == 'none') ? 'block' : display); + }, + + swapClass: function(remove, add){ + return this.removeClass(remove).addClass(add); + } + +}); + +Document.implement({ + + clearSelection: function(){ + if (window.getSelection){ + var selection = window.getSelection(); + if (selection && selection.removeAllRanges) selection.removeAllRanges(); + } else if (document.selection && document.selection.empty){ + try { + //IE fails here if selected element is not in dom + document.selection.empty(); + } catch(e){} + } + } + +}); + + +/* +--- + +name: Locale.en-US.Form.Validator + +description: Form Validator messages for English. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - /Locale + +provides: [Locale.en-US.Form.Validator] + +... +*/ + +Locale.define('en-US', 'FormValidator', { + + required: 'This field is required.', + length: 'Please enter {length} characters (you entered {elLength} characters)', + minLength: 'Please enter at least {minLength} characters (you entered {length} characters).', + maxLength: 'Please enter no more than {maxLength} characters (you entered {length} characters).', + integer: 'Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.', + numeric: 'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").', + digits: 'Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).', + alpha: 'Please use only letters (a-z) within this field. No spaces or other characters are allowed.', + alphanum: 'Please use only letters (a-z) or numbers (0-9) in this field. No spaces or other characters are allowed.', + dateSuchAs: 'Please enter a valid date such as {date}', + dateInFormatMDY: 'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")', + email: 'Please enter a valid email address. For example "fred@domain.com".', + url: 'Please enter a valid URL such as http://www.example.com.', + currencyDollar: 'Please enter a valid $ amount. For example $100.00 .', + oneRequired: 'Please enter something for at least one of these inputs.', + errorPrefix: 'Error: ', + warningPrefix: 'Warning: ', + + // Form.Validator.Extras + noSpace: 'There can be no spaces in this input.', + reqChkByNode: 'No items are selected.', + requiredChk: 'This field is required.', + reqChkByName: 'Please select a {label}.', + match: 'This field needs to match the {matchName} field', + startDate: 'the start date', + endDate: 'the end date', + currendDate: 'the current date', + afterDate: 'The date should be the same or after {label}.', + beforeDate: 'The date should be the same or before {label}.', + startMonth: 'Please select a start month', + sameMonth: 'These two dates must be in the same month - you must change one or the other.', + creditcard: 'The credit card number entered is invalid. Please check the number and try again. {length} digits entered.' + +}); + + +/* +--- + +script: Form.Validator.js + +name: Form.Validator + +description: A css-class based form validation system. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Options + - Core/Events + - Core/Slick.Finder + - Core/Element.Event + - Core/Element.Style + - Core/JSON + - /Locale + - /Class.Binds + - /Date + - /Element.Forms + - /Locale.en-US.Form.Validator + - /Element.Shortcuts + +provides: [Form.Validator, InputValidator, FormValidator.BaseValidators] + +... +*/ +if (!window.Form) window.Form = {}; + +var InputValidator = this.InputValidator = new Class({ + + Implements: [Options], + + options: { + errorMsg: 'Validation failed.', + test: Function.from(true) + }, + + initialize: function(className, options){ + this.setOptions(options); + this.className = className; + }, + + test: function(field, props){ + field = document.id(field); + return (field) ? this.options.test(field, props || this.getProps(field)) : false; + }, + + getError: function(field, props){ + field = document.id(field); + var err = this.options.errorMsg; + if (typeOf(err) == 'function') err = err(field, props || this.getProps(field)); + return err; + }, + + getProps: function(field){ + field = document.id(field); + return (field) ? field.get('validatorProps') : {}; + } + +}); + +Element.Properties.validators = { + + get: function(){ + return (this.get('data-validators') || this.className).clean().split(' '); + } + +}; + +Element.Properties.validatorProps = { + + set: function(props){ + return this.eliminate('$moo:validatorProps').store('$moo:validatorProps', props); + }, + + get: function(props){ + if (props) this.set(props); + if (this.retrieve('$moo:validatorProps')) return this.retrieve('$moo:validatorProps'); + if (this.getProperty('data-validator-properties') || this.getProperty('validatorProps')){ + try { + this.store('$moo:validatorProps', JSON.decode(this.getProperty('validatorProps') || this.getProperty('data-validator-properties'))); + }catch(e){ + return {}; + } + } else { + var vals = this.get('validators').filter(function(cls){ + return cls.test(':'); + }); + if (!vals.length){ + this.store('$moo:validatorProps', {}); + } else { + props = {}; + vals.each(function(cls){ + var split = cls.split(':'); + if (split[1]){ + try { + props[split[0]] = JSON.decode(split[1]); + } catch(e){} + } + }); + this.store('$moo:validatorProps', props); + } + } + return this.retrieve('$moo:validatorProps'); + } + +}; + +Form.Validator = new Class({ + + Implements: [Options, Events], + + Binds: ['onSubmit'], + + options: {/* + onFormValidate: function(isValid, form, event){}, + onElementValidate: function(isValid, field, className, warn){}, + onElementPass: function(field){}, + onElementFail: function(field, validatorsFailed){}, */ + fieldSelectors: 'input, select, textarea', + ignoreHidden: true, + ignoreDisabled: true, + useTitles: false, + evaluateOnSubmit: true, + evaluateFieldsOnBlur: true, + evaluateFieldsOnChange: true, + serial: true, + stopOnFailure: true, + warningPrefix: function(){ + return Form.Validator.getMsg('warningPrefix') || 'Warning: '; + }, + errorPrefix: function(){ + return Form.Validator.getMsg('errorPrefix') || 'Error: '; + } + }, + + initialize: function(form, options){ + this.setOptions(options); + this.element = document.id(form); + this.element.store('validator', this); + this.warningPrefix = Function.from(this.options.warningPrefix)(); + this.errorPrefix = Function.from(this.options.errorPrefix)(); + if (this.options.evaluateOnSubmit) this.element.addEvent('submit', this.onSubmit); + if (this.options.evaluateFieldsOnBlur || this.options.evaluateFieldsOnChange) this.watchFields(this.getFields()); + }, + + toElement: function(){ + return this.element; + }, + + getFields: function(){ + return (this.fields = this.element.getElements(this.options.fieldSelectors)); + }, + + watchFields: function(fields){ + fields.each(function(el){ + if (this.options.evaluateFieldsOnBlur) + el.addEvent('blur', this.validationMonitor.pass([el, false], this)); + if (this.options.evaluateFieldsOnChange) + el.addEvent('change', this.validationMonitor.pass([el, true], this)); + }, this); + }, + + validationMonitor: function(){ + clearTimeout(this.timer); + this.timer = this.validateField.delay(50, this, arguments); + }, + + onSubmit: function(event){ + if (this.validate(event)) this.reset(); + }, + + reset: function(){ + this.getFields().each(this.resetField, this); + return this; + }, + + validate: function(event){ + var result = this.getFields().map(function(field){ + return this.validateField(field, true); + }, this).every(function(v){ + return v; + }); + this.fireEvent('formValidate', [result, this.element, event]); + if (this.options.stopOnFailure && !result && event) event.preventDefault(); + return result; + }, + + validateField: function(field, force){ + if (this.paused) return true; + field = document.id(field); + var passed = !field.hasClass('validation-failed'); + var failed, warned; + if (this.options.serial && !force){ + failed = this.element.getElement('.validation-failed'); + warned = this.element.getElement('.warning'); + } + if (field && (!failed || force || field.hasClass('validation-failed') || (failed && !this.options.serial))){ + var validationTypes = field.get('validators'); + var validators = validationTypes.some(function(cn){ + return this.getValidator(cn); + }, this); + var validatorsFailed = []; + validationTypes.each(function(className){ + if (className && !this.test(className, field)) validatorsFailed.include(className); + }, this); + passed = validatorsFailed.length === 0; + if (validators && !this.hasValidator(field, 'warnOnly')){ + if (passed){ + field.addClass('validation-passed').removeClass('validation-failed'); + this.fireEvent('elementPass', [field]); + } else { + field.addClass('validation-failed').removeClass('validation-passed'); + this.fireEvent('elementFail', [field, validatorsFailed]); + } + } + if (!warned){ + var warnings = validationTypes.some(function(cn){ + if (cn.test('^warn')) + return this.getValidator(cn.replace(/^warn-/,'')); + else return null; + }, this); + field.removeClass('warning'); + var warnResult = validationTypes.map(function(cn){ + if (cn.test('^warn')) + return this.test(cn.replace(/^warn-/,''), field, true); + else return null; + }, this); + } + } + return passed; + }, + + test: function(className, field, warn){ + field = document.id(field); + if ((this.options.ignoreHidden && !field.isVisible()) || (this.options.ignoreDisabled && field.get('disabled'))) return true; + var validator = this.getValidator(className); + if (warn != null) warn = false; + if (this.hasValidator(field, 'warnOnly')) warn = true; + var isValid = this.hasValidator(field, 'ignoreValidation') || (validator ? validator.test(field) : true); + if (validator && field.isVisible()) this.fireEvent('elementValidate', [isValid, field, className, warn]); + if (warn) return true; + return isValid; + }, + + hasValidator: function(field, value){ + return field.get('validators').contains(value); + }, + + resetField: function(field){ + field = document.id(field); + if (field){ + field.get('validators').each(function(className){ + if (className.test('^warn-')) className = className.replace(/^warn-/, ''); + field.removeClass('validation-failed'); + field.removeClass('warning'); + field.removeClass('validation-passed'); + }, this); + } + return this; + }, + + stop: function(){ + this.paused = true; + return this; + }, + + start: function(){ + this.paused = false; + return this; + }, + + ignoreField: function(field, warn){ + field = document.id(field); + if (field){ + this.enforceField(field); + if (warn) field.addClass('warnOnly'); + else field.addClass('ignoreValidation'); + } + return this; + }, + + enforceField: function(field){ + field = document.id(field); + if (field) field.removeClass('warnOnly').removeClass('ignoreValidation'); + return this; + } + +}); + +Form.Validator.getMsg = function(key){ + return Locale.get('FormValidator.' + key); +}; + +Form.Validator.adders = { + + validators:{}, + + add : function(className, options){ + this.validators[className] = new InputValidator(className, options); + //if this is a class (this method is used by instances of Form.Validator and the Form.Validator namespace) + //extend these validators into it + //this allows validators to be global and/or per instance + if (!this.initialize){ + this.implement({ + validators: this.validators + }); + } + }, + + addAllThese : function(validators){ + Array.from(validators).each(function(validator){ + this.add(validator[0], validator[1]); + }, this); + }, + + getValidator: function(className){ + return this.validators[className.split(':')[0]]; + } + +}; + +Object.append(Form.Validator, Form.Validator.adders); + +Form.Validator.implement(Form.Validator.adders); + +Form.Validator.add('IsEmpty', { + + errorMsg: false, + test: function(element){ + if (element.type == 'select-one' || element.type == 'select') + return !(element.selectedIndex >= 0 && element.options[element.selectedIndex].value != ''); + else + return ((element.get('value') == null) || (element.get('value').length == 0)); + } + +}); + +Form.Validator.addAllThese([ + + ['required', { + errorMsg: function(){ + return Form.Validator.getMsg('required'); + }, + test: function(element){ + return !Form.Validator.getValidator('IsEmpty').test(element); + } + }], + + ['length', { + errorMsg: function(element, props){ + if (typeOf(props.length) != 'null') + return Form.Validator.getMsg('length').substitute({length: props.length, elLength: element.get('value').length}); + else return ''; + }, + test: function(element, props){ + if (typeOf(props.length) != 'null') return (element.get('value').length == props.length || element.get('value').length == 0); + else return true; + } + }], + + ['minLength', { + errorMsg: function(element, props){ + if (typeOf(props.minLength) != 'null') + return Form.Validator.getMsg('minLength').substitute({minLength: props.minLength, length: element.get('value').length}); + else return ''; + }, + test: function(element, props){ + if (typeOf(props.minLength) != 'null') return (element.get('value').length >= (props.minLength || 0)); + else return true; + } + }], + + ['maxLength', { + errorMsg: function(element, props){ + //props is {maxLength:10} + if (typeOf(props.maxLength) != 'null') + return Form.Validator.getMsg('maxLength').substitute({maxLength: props.maxLength, length: element.get('value').length}); + else return ''; + }, + test: function(element, props){ + return element.get('value').length <= (props.maxLength || 10000); + } + }], + + ['validate-integer', { + errorMsg: Form.Validator.getMsg.pass('integer'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^(-?[1-9]\d*|0)$/).test(element.get('value')); + } + }], + + ['validate-numeric', { + errorMsg: Form.Validator.getMsg.pass('numeric'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || + (/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(element.get('value')); + } + }], + + ['validate-digits', { + errorMsg: Form.Validator.getMsg.pass('digits'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^[\d() .:\-\+#]+$/.test(element.get('value'))); + } + }], + + ['validate-alpha', { + errorMsg: Form.Validator.getMsg.pass('alpha'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^[a-zA-Z]+$/).test(element.get('value')); + } + }], + + ['validate-alphanum', { + errorMsg: Form.Validator.getMsg.pass('alphanum'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || !(/\W/).test(element.get('value')); + } + }], + + ['validate-date', { + errorMsg: function(element, props){ + if (Date.parse){ + var format = props.dateFormat || '%x'; + return Form.Validator.getMsg('dateSuchAs').substitute({date: new Date().format(format)}); + } else { + return Form.Validator.getMsg('dateInFormatMDY'); + } + }, + test: function(element, props){ + if (Form.Validator.getValidator('IsEmpty').test(element)) return true; + var dateLocale = Locale.getCurrent().sets.Date, + dateNouns = new RegExp([dateLocale.days, dateLocale.days_abbr, dateLocale.months, dateLocale.months_abbr].flatten().join('|'), 'i'), + value = element.get('value'), + wordsInValue = value.match(/[a-z]+/gi); + + if (wordsInValue && !wordsInValue.every(dateNouns.exec, dateNouns)) return false; + + var date = Date.parse(value), + format = props.dateFormat || '%x', + formatted = date.format(format); + + if (formatted != 'invalid date') element.set('value', formatted); + return date.isValid(); + } + }], + + ['validate-email', { + errorMsg: Form.Validator.getMsg.pass('email'), + test: function(element){ + /* + var chars = "[a-z0-9!#$%&'*+/=?^_`{|}~-]", + local = '(?:' + chars + '\\.?){0,63}' + chars, + + label = '[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?', + hostname = '(?:' + label + '\\.)*' + label; + + octet = '(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)', + ipv4 = '\\[(?:' + octet + '\\.){3}' + octet + '\\]', + + domain = '(?:' + hostname + '|' + ipv4 + ')'; + + var regex = new RegExp('^' + local + '@' + domain + '$', 'i'); + */ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(element.get('value')); + } + }], + + ['validate-url', { + errorMsg: Form.Validator.getMsg.pass('url'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(element.get('value')); + } + }], + + ['validate-currency-dollar', { + errorMsg: Form.Validator.getMsg.pass('currencyDollar'), + test: function(element){ + return Form.Validator.getValidator('IsEmpty').test(element) || (/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(element.get('value')); + } + }], + + ['validate-one-required', { + errorMsg: Form.Validator.getMsg.pass('oneRequired'), + test: function(element, props){ + var p = document.id(props['validate-one-required']) || element.getParent(props['validate-one-required']); + return p.getElements('input').some(function(el){ + if (['checkbox', 'radio'].contains(el.get('type'))) return el.get('checked'); + return el.get('value'); + }); + } + }] + +]); + +Element.Properties.validator = { + + set: function(options){ + this.get('validator').setOptions(options); + }, + + get: function(){ + var validator = this.retrieve('validator'); + if (!validator){ + validator = new Form.Validator(this); + this.store('validator', validator); + } + return validator; + } + +}; + +Element.implement({ + + validate: function(options){ + if (options) this.set('validator', options); + return this.get('validator').validate(); + } + +}); + + + + + + + +/* +--- + +script: Fx.Elements.js + +name: Fx.Elements + +description: Effect to change any number of CSS properties of any number of Elements. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Fx.CSS + - /MooTools.More + +provides: [Fx.Elements] + +... +*/ + +Fx.Elements = new Class({ + + Extends: Fx.CSS, + + initialize: function(elements, options){ + this.elements = this.subject = $$(elements); + this.parent(options); + }, + + compute: function(from, to, delta){ + var now = {}; + + for (var i in from){ + var iFrom = from[i], iTo = to[i], iNow = now[i] = {}; + for (var p in iFrom) iNow[p] = this.parent(iFrom[p], iTo[p], delta); + } + + return now; + }, + + set: function(now){ + for (var i in now){ + if (!this.elements[i]) continue; + + var iNow = now[i]; + for (var p in iNow) this.render(this.elements[i], p, iNow[p], this.options.unit); + } + + return this; + }, + + start: function(obj){ + if (!this.check(obj)) return this; + var from = {}, to = {}; + + for (var i in obj){ + if (!this.elements[i]) continue; + + var iProps = obj[i], iFrom = from[i] = {}, iTo = to[i] = {}; + + for (var p in iProps){ + var parsed = this.prepare(this.elements[i], p, iProps[p]); + iFrom[p] = parsed.from; + iTo[p] = parsed.to; + } + } + + return this.parent(from, to); + } + +}); + + +/* +--- + +script: Fx.Accordion.js + +name: Fx.Accordion + +description: An Fx.Elements extension which allows you to easily create accordion type controls. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Element.Event + - /Fx.Elements + +provides: [Fx.Accordion] + +... +*/ + +Fx.Accordion = new Class({ + + Extends: Fx.Elements, + + options: {/* + onActive: function(toggler, section){}, + onBackground: function(toggler, section){},*/ + fixedHeight: false, + fixedWidth: false, + display: 0, + show: false, + height: true, + width: false, + opacity: true, + alwaysHide: false, + trigger: 'click', + initialDisplayFx: true, + resetHeight: true + }, + + initialize: function(){ + var defined = function(obj){ + return obj != null; + }; + + var params = Array.link(arguments, { + 'container': Type.isElement, //deprecated + 'options': Type.isObject, + 'togglers': defined, + 'elements': defined + }); + this.parent(params.elements, params.options); + + var options = this.options, + togglers = this.togglers = $$(params.togglers); + + this.previous = -1; + this.internalChain = new Chain(); + + if (options.alwaysHide) this.options.link = 'chain'; + + if (options.show || this.options.show === 0){ + options.display = false; + this.previous = options.show; + } + + if (options.start){ + options.display = false; + options.show = false; + } + + var effects = this.effects = {}; + + if (options.opacity) effects.opacity = 'fullOpacity'; + if (options.width) effects.width = options.fixedWidth ? 'fullWidth' : 'offsetWidth'; + if (options.height) effects.height = options.fixedHeight ? 'fullHeight' : 'scrollHeight'; + + for (var i = 0, l = togglers.length; i < l; i++) this.addSection(togglers[i], this.elements[i]); + + this.elements.each(function(el, i){ + if (options.show === i){ + this.fireEvent('active', [togglers[i], el]); + } else { + for (var fx in effects) el.setStyle(fx, 0); + } + }, this); + + if (options.display || options.display === 0 || options.initialDisplayFx === false){ + this.display(options.display, options.initialDisplayFx); + } + + if (options.fixedHeight !== false) options.resetHeight = false; + this.addEvent('complete', this.internalChain.callChain.bind(this.internalChain)); + }, + + addSection: function(toggler, element){ + toggler = document.id(toggler); + element = document.id(element); + this.togglers.include(toggler); + this.elements.include(element); + + var togglers = this.togglers, + options = this.options, + test = togglers.contains(toggler), + idx = togglers.indexOf(toggler), + displayer = this.display.pass(idx, this); + + toggler.store('accordion:display', displayer) + .addEvent(options.trigger, displayer); + + if (options.height) element.setStyles({'padding-top': 0, 'border-top': 'none', 'padding-bottom': 0, 'border-bottom': 'none'}); + if (options.width) element.setStyles({'padding-left': 0, 'border-left': 'none', 'padding-right': 0, 'border-right': 'none'}); + + element.fullOpacity = 1; + if (options.fixedWidth) element.fullWidth = options.fixedWidth; + if (options.fixedHeight) element.fullHeight = options.fixedHeight; + element.setStyle('overflow', 'hidden'); + + if (!test) for (var fx in this.effects){ + element.setStyle(fx, 0); + } + return this; + }, + + removeSection: function(toggler, displayIndex){ + var togglers = this.togglers, + idx = togglers.indexOf(toggler), + element = this.elements[idx]; + + var remover = function(){ + togglers.erase(toggler); + this.elements.erase(element); + this.detach(toggler); + }.bind(this); + + if (this.now == idx || displayIndex != null){ + this.display(displayIndex != null ? displayIndex : (idx - 1 >= 0 ? idx - 1 : 0)).chain(remover); + } else { + remover(); + } + return this; + }, + + detach: function(toggler){ + var remove = function(toggler){ + toggler.removeEvent(this.options.trigger, toggler.retrieve('accordion:display')); + }.bind(this); + + if (!toggler) this.togglers.each(remove); + else remove(toggler); + return this; + }, + + display: function(index, useFx){ + if (!this.check(index, useFx)) return this; + + var obj = {}, + elements = this.elements, + options = this.options, + effects = this.effects; + + if (useFx == null) useFx = true; + if (typeOf(index) == 'element') index = elements.indexOf(index); + if (index == this.previous && !options.alwaysHide) return this; + + if (options.resetHeight){ + var prev = elements[this.previous]; + if (prev && !this.selfHidden){ + for (var fx in effects) prev.setStyle(fx, prev[effects[fx]]); + } + } + + if ((this.timer && options.link == 'chain') || (index === this.previous && !options.alwaysHide)) return this; + + this.previous = index; + this.selfHidden = false; + + elements.each(function(el, i){ + obj[i] = {}; + var hide; + if (i != index){ + hide = true; + } else if (options.alwaysHide && ((el.offsetHeight > 0 && options.height) || el.offsetWidth > 0 && options.width)){ + hide = true; + this.selfHidden = true; + } + this.fireEvent(hide ? 'background' : 'active', [this.togglers[i], el]); + for (var fx in effects) obj[i][fx] = hide ? 0 : el[effects[fx]]; + if (!useFx && !hide && options.resetHeight) obj[i].height = 'auto'; + }, this); + + this.internalChain.clearChain(); + this.internalChain.chain(function(){ + if (options.resetHeight && !this.selfHidden){ + var el = elements[index]; + if (el) el.setStyle('height', 'auto'); + } + }.bind(this)); + + return useFx ? this.start(obj) : this.set(obj).internalChain.callChain(); + } + +}); + + + + +/* +--- + +script: Fx.Move.js + +name: Fx.Move + +description: Defines Fx.Move, a class that works with Element.Position.js to transition an element from one location to another. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Fx.Morph + - /Element.Position + +provides: [Fx.Move] + +... +*/ + +Fx.Move = new Class({ + + Extends: Fx.Morph, + + options: { + relativeTo: document.body, + position: 'center', + edge: false, + offset: {x: 0, y: 0} + }, + + start: function(destination){ + var element = this.element, + topLeft = element.getStyles('top', 'left'); + if (topLeft.top == 'auto' || topLeft.left == 'auto'){ + element.setPosition(element.getPosition(element.getOffsetParent())); + } + return this.parent(element.position(Object.merge({}, this.options, destination, {returnPos: true}))); + } + +}); + +Element.Properties.move = { + + set: function(options){ + this.get('move').cancel().setOptions(options); + return this; + }, + + get: function(){ + var move = this.retrieve('move'); + if (!move){ + move = new Fx.Move(this, {link: 'cancel'}); + this.store('move', move); + } + return move; + } + +}; + +Element.implement({ + + move: function(options){ + this.get('move').start(options); + return this; + } + +}); + + +/* +--- + +script: Fx.Reveal.js + +name: Fx.Reveal + +description: Defines Fx.Reveal, a class that shows and hides elements with a transition. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Fx.Morph + - /Element.Shortcuts + - /Element.Measure + +provides: [Fx.Reveal] + +... +*/ + +(function(){ + + +var hideTheseOf = function(object){ + var hideThese = object.options.hideInputs; + if (window.OverText){ + var otClasses = [null]; + OverText.each(function(ot){ + otClasses.include('.' + ot.options.labelClass); + }); + if (otClasses) hideThese += otClasses.join(', '); + } + return (hideThese) ? object.element.getElements(hideThese) : null; +}; + + +Fx.Reveal = new Class({ + + Extends: Fx.Morph, + + options: {/* + onShow: function(thisElement){}, + onHide: function(thisElement){}, + onComplete: function(thisElement){}, + heightOverride: null, + widthOverride: null,*/ + link: 'cancel', + styles: ['padding', 'border', 'margin'], + transitionOpacity: !Browser.ie6, + mode: 'vertical', + display: function(){ + return this.element.get('tag') != 'tr' ? 'block' : 'table-row'; + }, + opacity: 1, + hideInputs: Browser.ie ? 'select, input, textarea, object, embed' : null + }, + + dissolve: function(){ + if (!this.hiding && !this.showing){ + if (this.element.getStyle('display') != 'none'){ + this.hiding = true; + this.showing = false; + this.hidden = true; + this.cssText = this.element.style.cssText; + + var startStyles = this.element.getComputedSize({ + styles: this.options.styles, + mode: this.options.mode + }); + if (this.options.transitionOpacity) startStyles.opacity = this.options.opacity; + + var zero = {}; + Object.each(startStyles, function(style, name){ + zero[name] = [style, 0]; + }); + + this.element.setStyles({ + display: Function.from(this.options.display).call(this), + overflow: 'hidden' + }); + + var hideThese = hideTheseOf(this); + if (hideThese) hideThese.setStyle('visibility', 'hidden'); + + this.$chain.unshift(function(){ + if (this.hidden){ + this.hiding = false; + this.element.style.cssText = this.cssText; + this.element.setStyle('display', 'none'); + if (hideThese) hideThese.setStyle('visibility', 'visible'); + } + this.fireEvent('hide', this.element); + this.callChain(); + }.bind(this)); + + this.start(zero); + } else { + this.callChain.delay(10, this); + this.fireEvent('complete', this.element); + this.fireEvent('hide', this.element); + } + } else if (this.options.link == 'chain'){ + this.chain(this.dissolve.bind(this)); + } else if (this.options.link == 'cancel' && !this.hiding){ + this.cancel(); + this.dissolve(); + } + return this; + }, + + reveal: function(){ + if (!this.showing && !this.hiding){ + if (this.element.getStyle('display') == 'none'){ + this.hiding = false; + this.showing = true; + this.hidden = false; + this.cssText = this.element.style.cssText; + + var startStyles; + this.element.measure(function(){ + startStyles = this.element.getComputedSize({ + styles: this.options.styles, + mode: this.options.mode + }); + }.bind(this)); + if (this.options.heightOverride != null) startStyles.height = this.options.heightOverride.toInt(); + if (this.options.widthOverride != null) startStyles.width = this.options.widthOverride.toInt(); + if (this.options.transitionOpacity){ + this.element.setStyle('opacity', 0); + startStyles.opacity = this.options.opacity; + } + + var zero = { + height: 0, + display: Function.from(this.options.display).call(this) + }; + Object.each(startStyles, function(style, name){ + zero[name] = 0; + }); + zero.overflow = 'hidden'; + + this.element.setStyles(zero); + + var hideThese = hideTheseOf(this); + if (hideThese) hideThese.setStyle('visibility', 'hidden'); + + this.$chain.unshift(function(){ + this.element.style.cssText = this.cssText; + this.element.setStyle('display', Function.from(this.options.display).call(this)); + if (!this.hidden) this.showing = false; + if (hideThese) hideThese.setStyle('visibility', 'visible'); + this.callChain(); + this.fireEvent('show', this.element); + }.bind(this)); + + this.start(startStyles); + } else { + this.callChain(); + this.fireEvent('complete', this.element); + this.fireEvent('show', this.element); + } + } else if (this.options.link == 'chain'){ + this.chain(this.reveal.bind(this)); + } else if (this.options.link == 'cancel' && !this.showing){ + this.cancel(); + this.reveal(); + } + return this; + }, + + toggle: function(){ + if (this.element.getStyle('display') == 'none'){ + this.reveal(); + } else { + this.dissolve(); + } + return this; + }, + + cancel: function(){ + this.parent.apply(this, arguments); + if (this.cssText != null) this.element.style.cssText = this.cssText; + this.hiding = false; + this.showing = false; + return this; + } + +}); + +Element.Properties.reveal = { + + set: function(options){ + this.get('reveal').cancel().setOptions(options); + return this; + }, + + get: function(){ + var reveal = this.retrieve('reveal'); + if (!reveal){ + reveal = new Fx.Reveal(this); + this.store('reveal', reveal); + } + return reveal; + } + +}; + +Element.Properties.dissolve = Element.Properties.reveal; + +Element.implement({ + + reveal: function(options){ + this.get('reveal').setOptions(options).reveal(); + return this; + }, + + dissolve: function(options){ + this.get('reveal').setOptions(options).dissolve(); + return this; + }, + + nix: function(options){ + var params = Array.link(arguments, {destroy: Type.isBoolean, options: Type.isObject}); + this.get('reveal').setOptions(options).dissolve().chain(function(){ + this[params.destroy ? 'destroy' : 'dispose'](); + }.bind(this)); + return this; + }, + + wink: function(){ + var params = Array.link(arguments, {duration: Type.isNumber, options: Type.isObject}); + var reveal = this.get('reveal').setOptions(params.options); + reveal.reveal().chain(function(){ + (function(){ + reveal.dissolve(); + }).delay(params.duration || 2000); + }); + } + +}); + +})(); + + +/* +--- + +script: Fx.Scroll.js + +name: Fx.Scroll + +description: Effect to smoothly scroll any element, including the window. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Fx + - Core/Element.Event + - Core/Element.Dimensions + - /MooTools.More + +provides: [Fx.Scroll] + +... +*/ + +(function(){ + +Fx.Scroll = new Class({ + + Extends: Fx, + + options: { + offset: {x: 0, y: 0}, + wheelStops: true + }, + + initialize: function(element, options){ + this.element = this.subject = document.id(element); + this.parent(options); + + if (typeOf(this.element) != 'element') this.element = document.id(this.element.getDocument().body); + + if (this.options.wheelStops){ + var stopper = this.element, + cancel = this.cancel.pass(false, this); + this.addEvent('start', function(){ + stopper.addEvent('mousewheel', cancel); + }, true); + this.addEvent('complete', function(){ + stopper.removeEvent('mousewheel', cancel); + }, true); + } + }, + + set: function(){ + var now = Array.flatten(arguments); + if (Browser.firefox) now = [Math.round(now[0]), Math.round(now[1])]; // not needed anymore in newer firefox versions + this.element.scrollTo(now[0], now[1]); + return this; + }, + + compute: function(from, to, delta){ + return [0, 1].map(function(i){ + return Fx.compute(from[i], to[i], delta); + }); + }, + + start: function(x, y){ + if (!this.check(x, y)) return this; + var scroll = this.element.getScroll(); + return this.parent([scroll.x, scroll.y], [x, y]); + }, + + calculateScroll: function(x, y){ + var element = this.element, + scrollSize = element.getScrollSize(), + scroll = element.getScroll(), + size = element.getSize(), + offset = this.options.offset, + values = {x: x, y: y}; + + for (var z in values){ + if (!values[z] && values[z] !== 0) values[z] = scroll[z]; + if (typeOf(values[z]) != 'number') values[z] = scrollSize[z] - size[z]; + values[z] += offset[z]; + } + + return [values.x, values.y]; + }, + + toTop: function(){ + return this.start.apply(this, this.calculateScroll(false, 0)); + }, + + toLeft: function(){ + return this.start.apply(this, this.calculateScroll(0, false)); + }, + + toRight: function(){ + return this.start.apply(this, this.calculateScroll('right', false)); + }, + + toBottom: function(){ + return this.start.apply(this, this.calculateScroll(false, 'bottom')); + }, + + toElement: function(el, axes){ + axes = axes ? Array.from(axes) : ['x', 'y']; + var scroll = isBody(this.element) ? {x: 0, y: 0} : this.element.getScroll(); + var position = Object.map(document.id(el).getPosition(this.element), function(value, axis){ + return axes.contains(axis) ? value + scroll[axis] : false; + }); + return this.start.apply(this, this.calculateScroll(position.x, position.y)); + }, + + toElementEdge: function(el, axes, offset){ + axes = axes ? Array.from(axes) : ['x', 'y']; + el = document.id(el); + var to = {}, + position = el.getPosition(this.element), + size = el.getSize(), + scroll = this.element.getScroll(), + containerSize = this.element.getSize(), + edge = { + x: position.x + size.x, + y: position.y + size.y + }; + + ['x', 'y'].each(function(axis){ + if (axes.contains(axis)){ + if (edge[axis] > scroll[axis] + containerSize[axis]) to[axis] = edge[axis] - containerSize[axis]; + if (position[axis] < scroll[axis]) to[axis] = position[axis]; + } + if (to[axis] == null) to[axis] = scroll[axis]; + if (offset && offset[axis]) to[axis] = to[axis] + offset[axis]; + }, this); + + if (to.x != scroll.x || to.y != scroll.y) this.start(to.x, to.y); + return this; + }, + + toElementCenter: function(el, axes, offset){ + axes = axes ? Array.from(axes) : ['x', 'y']; + el = document.id(el); + var to = {}, + position = el.getPosition(this.element), + size = el.getSize(), + scroll = this.element.getScroll(), + containerSize = this.element.getSize(); + + ['x', 'y'].each(function(axis){ + if (axes.contains(axis)){ + to[axis] = position[axis] - (containerSize[axis] - size[axis]) / 2; + } + if (to[axis] == null) to[axis] = scroll[axis]; + if (offset && offset[axis]) to[axis] = to[axis] + offset[axis]; + }, this); + + if (to.x != scroll.x || to.y != scroll.y) this.start(to.x, to.y); + return this; + } + +}); + + + +function isBody(element){ + return (/^(?:body|html)$/i).test(element.tagName); +} + +})(); + + +/* +--- + +script: Fx.Slide.js + +name: Fx.Slide + +description: Effect to slide an element in and out of view. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Fx + - Core/Element.Style + - /MooTools.More + +provides: [Fx.Slide] + +... +*/ + +Fx.Slide = new Class({ + + Extends: Fx, + + options: { + mode: 'vertical', + wrapper: false, + hideOverflow: true, + resetHeight: false + }, + + initialize: function(element, options){ + element = this.element = this.subject = document.id(element); + this.parent(options); + options = this.options; + + var wrapper = element.retrieve('wrapper'), + styles = element.getStyles('margin', 'position', 'overflow'); + + if (options.hideOverflow) styles = Object.append(styles, {overflow: 'hidden'}); + if (options.wrapper) wrapper = document.id(options.wrapper).setStyles(styles); + + if (!wrapper) wrapper = new Element('div', { + styles: styles + }).wraps(element); + + element.store('wrapper', wrapper).setStyle('margin', 0); + if (element.getStyle('overflow') == 'visible') element.setStyle('overflow', 'hidden'); + + this.now = []; + this.open = true; + this.wrapper = wrapper; + + this.addEvent('complete', function(){ + this.open = (wrapper['offset' + this.layout.capitalize()] != 0); + if (this.open && this.options.resetHeight) wrapper.setStyle('height', ''); + }, true); + }, + + vertical: function(){ + this.margin = 'margin-top'; + this.layout = 'height'; + this.offset = this.element.offsetHeight; + }, + + horizontal: function(){ + this.margin = 'margin-left'; + this.layout = 'width'; + this.offset = this.element.offsetWidth; + }, + + set: function(now){ + this.element.setStyle(this.margin, now[0]); + this.wrapper.setStyle(this.layout, now[1]); + return this; + }, + + compute: function(from, to, delta){ + return [0, 1].map(function(i){ + return Fx.compute(from[i], to[i], delta); + }); + }, + + start: function(how, mode){ + if (!this.check(how, mode)) return this; + this[mode || this.options.mode](); + + var margin = this.element.getStyle(this.margin).toInt(), + layout = this.wrapper.getStyle(this.layout).toInt(), + caseIn = [[margin, layout], [0, this.offset]], + caseOut = [[margin, layout], [-this.offset, 0]], + start; + + switch (how){ + case 'in': start = caseIn; break; + case 'out': start = caseOut; break; + case 'toggle': start = (layout == 0) ? caseIn : caseOut; + } + return this.parent(start[0], start[1]); + }, + + slideIn: function(mode){ + return this.start('in', mode); + }, + + slideOut: function(mode){ + return this.start('out', mode); + }, + + hide: function(mode){ + this[mode || this.options.mode](); + this.open = false; + return this.set([-this.offset, 0]); + }, + + show: function(mode){ + this[mode || this.options.mode](); + this.open = true; + return this.set([0, this.offset]); + }, + + toggle: function(mode){ + return this.start('toggle', mode); + } + +}); + +Element.Properties.slide = { + + set: function(options){ + this.get('slide').cancel().setOptions(options); + return this; + }, + + get: function(){ + var slide = this.retrieve('slide'); + if (!slide){ + slide = new Fx.Slide(this, {link: 'cancel'}); + this.store('slide', slide); + } + return slide; + } + +}; + +Element.implement({ + + slide: function(how, mode){ + how = how || 'toggle'; + var slide = this.get('slide'), toggle; + switch (how){ + case 'hide': slide.hide(mode); break; + case 'show': slide.show(mode); break; + case 'toggle': + var flag = this.retrieve('slide:flag', slide.open); + slide[flag ? 'slideOut' : 'slideIn'](mode); + this.store('slide:flag', !flag); + toggle = true; + break; + default: slide.start(how, mode); + } + if (!toggle) this.eliminate('slide:flag'); + return this; + } + +}); + + +/* +--- + +script: Fx.SmoothScroll.js + +name: Fx.SmoothScroll + +description: Class for creating a smooth scrolling effect to all internal links on the page. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Slick.Finder + - /Fx.Scroll + +provides: [Fx.SmoothScroll] + +... +*/ + +Fx.SmoothScroll = new Class({ + + Extends: Fx.Scroll, + + options: { + axes: ['x', 'y'] + }, + + initialize: function(options, context){ + context = context || document; + this.doc = context.getDocument(); + this.parent(this.doc, options); + + var win = context.getWindow(), + location = win.location.href.match(/^[^#]*/)[0] + '#', + links = $$(this.options.links || this.doc.links); + + links.each(function(link){ + if (link.href.indexOf(location) != 0) return; + var anchor = link.href.substr(location.length); + if (anchor) this.useLink(link, anchor); + }, this); + + this.addEvent('complete', function(){ + win.location.hash = this.anchor; + this.element.scrollTo(this.to[0], this.to[1]); + }, true); + }, + + useLink: function(link, anchor){ + + link.addEvent('click', function(event){ + var el = document.id(anchor) || this.doc.getElement('a[name=' + anchor + ']'); + if (!el) return; + + event.preventDefault(); + this.toElement(el, this.options.axes).chain(function(){ + this.fireEvent('scrolledTo', [link, el]); + }.bind(this)); + + this.anchor = anchor; + + }.bind(this)); + + return this; + } +}); + + +/* +--- + +script: Fx.Sort.js + +name: Fx.Sort + +description: Defines Fx.Sort, a class that reorders lists with a transition. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Dimensions + - /Fx.Elements + - /Element.Measure + +provides: [Fx.Sort] + +... +*/ + +Fx.Sort = new Class({ + + Extends: Fx.Elements, + + options: { + mode: 'vertical' + }, + + initialize: function(elements, options){ + this.parent(elements, options); + this.elements.each(function(el){ + if (el.getStyle('position') == 'static') el.setStyle('position', 'relative'); + }); + this.setDefaultOrder(); + }, + + setDefaultOrder: function(){ + this.currentOrder = this.elements.map(function(el, index){ + return index; + }); + }, + + sort: function(){ + if (!this.check(arguments)) return this; + var newOrder = Array.flatten(arguments); + + var top = 0, + left = 0, + next = {}, + zero = {}, + vert = this.options.mode == 'vertical'; + + var current = this.elements.map(function(el, index){ + var size = el.getComputedSize({styles: ['border', 'padding', 'margin']}); + var val; + if (vert){ + val = { + top: top, + margin: size['margin-top'], + height: size.totalHeight + }; + top += val.height - size['margin-top']; + } else { + val = { + left: left, + margin: size['margin-left'], + width: size.totalWidth + }; + left += val.width; + } + var plane = vert ? 'top' : 'left'; + zero[index] = {}; + var start = el.getStyle(plane).toInt(); + zero[index][plane] = start || 0; + return val; + }, this); + + this.set(zero); + newOrder = newOrder.map(function(i){ return i.toInt(); }); + if (newOrder.length != this.elements.length){ + this.currentOrder.each(function(index){ + if (!newOrder.contains(index)) newOrder.push(index); + }); + if (newOrder.length > this.elements.length) + newOrder.splice(this.elements.length-1, newOrder.length - this.elements.length); + } + var margin = 0; + top = left = 0; + newOrder.each(function(item){ + var newPos = {}; + if (vert){ + newPos.top = top - current[item].top - margin; + top += current[item].height; + } else { + newPos.left = left - current[item].left; + left += current[item].width; + } + margin = margin + current[item].margin; + next[item]=newPos; + }, this); + var mapped = {}; + Array.clone(newOrder).sort().each(function(index){ + mapped[index] = next[index]; + }); + this.start(mapped); + this.currentOrder = newOrder; + + return this; + }, + + rearrangeDOM: function(newOrder){ + newOrder = newOrder || this.currentOrder; + var parent = this.elements[0].getParent(); + var rearranged = []; + this.elements.setStyle('opacity', 0); + //move each element and store the new default order + newOrder.each(function(index){ + rearranged.push(this.elements[index].inject(parent).setStyles({ + top: 0, + left: 0 + })); + }, this); + this.elements.setStyle('opacity', 1); + this.elements = $$(rearranged); + this.setDefaultOrder(); + return this; + }, + + getDefaultOrder: function(){ + return this.elements.map(function(el, index){ + return index; + }); + }, + + getCurrentOrder: function(){ + return this.currentOrder; + }, + + forward: function(){ + return this.sort(this.getDefaultOrder()); + }, + + backward: function(){ + return this.sort(this.getDefaultOrder().reverse()); + }, + + reverse: function(){ + return this.sort(this.currentOrder.reverse()); + }, + + sortByElements: function(elements){ + return this.sort(elements.map(function(el){ + return this.elements.indexOf(el); + }, this)); + }, + + swap: function(one, two){ + if (typeOf(one) == 'element') one = this.elements.indexOf(one); + if (typeOf(two) == 'element') two = this.elements.indexOf(two); + + var newOrder = Array.clone(this.currentOrder); + newOrder[this.currentOrder.indexOf(one)] = two; + newOrder[this.currentOrder.indexOf(two)] = one; + + return this.sort(newOrder); + } + +}); + + +/* +--- + +script: Drag.js + +name: Drag + +description: The base Drag Class. Can be used to drag and resize Elements using mouse events. + +license: MIT-style license + +authors: + - Valerio Proietti + - Tom Occhinno + - Jan Kassens + +requires: + - Core/Events + - Core/Options + - Core/Element.Event + - Core/Element.Style + - Core/Element.Dimensions + - /MooTools.More + +provides: [Drag] +... + +*/ + +var Drag = new Class({ + + Implements: [Events, Options], + + options: {/* + onBeforeStart: function(thisElement){}, + onStart: function(thisElement, event){}, + onSnap: function(thisElement){}, + onDrag: function(thisElement, event){}, + onCancel: function(thisElement){}, + onComplete: function(thisElement, event){},*/ + snap: 6, + unit: 'px', + grid: false, + style: true, + limit: false, + handle: false, + invert: false, + preventDefault: false, + stopPropagation: false, + modifiers: {x: 'left', y: 'top'} + }, + + initialize: function(){ + var params = Array.link(arguments, { + 'options': Type.isObject, + 'element': function(obj){ + return obj != null; + } + }); + + this.element = document.id(params.element); + this.document = this.element.getDocument(); + this.setOptions(params.options || {}); + var htype = typeOf(this.options.handle); + this.handles = ((htype == 'array' || htype == 'collection') ? $$(this.options.handle) : document.id(this.options.handle)) || this.element; + this.mouse = {'now': {}, 'pos': {}}; + this.value = {'start': {}, 'now': {}}; + + this.selection = (Browser.ie) ? 'selectstart' : 'mousedown'; + + + if (Browser.ie && !Drag.ondragstartFixed){ + document.ondragstart = Function.from(false); + Drag.ondragstartFixed = true; + } + + this.bound = { + start: this.start.bind(this), + check: this.check.bind(this), + drag: this.drag.bind(this), + stop: this.stop.bind(this), + cancel: this.cancel.bind(this), + eventStop: Function.from(false) + }; + this.attach(); + }, + + attach: function(){ + this.handles.addEvent('mousedown', this.bound.start); + return this; + }, + + detach: function(){ + this.handles.removeEvent('mousedown', this.bound.start); + return this; + }, + + start: function(event){ + var options = this.options; + + if (event.rightClick) return; + + if (options.preventDefault) event.preventDefault(); + if (options.stopPropagation) event.stopPropagation(); + this.mouse.start = event.page; + + this.fireEvent('beforeStart', this.element); + + var limit = options.limit; + this.limit = {x: [], y: []}; + + var z, coordinates; + for (z in options.modifiers){ + if (!options.modifiers[z]) continue; + + var style = this.element.getStyle(options.modifiers[z]); + + // Some browsers (IE and Opera) don't always return pixels. + if (style && !style.match(/px$/)){ + if (!coordinates) coordinates = this.element.getCoordinates(this.element.getOffsetParent()); + style = coordinates[options.modifiers[z]]; + } + + if (options.style) this.value.now[z] = (style || 0).toInt(); + else this.value.now[z] = this.element[options.modifiers[z]]; + + if (options.invert) this.value.now[z] *= -1; + + this.mouse.pos[z] = event.page[z] - this.value.now[z]; + + if (limit && limit[z]){ + var i = 2; + while (i--){ + var limitZI = limit[z][i]; + if (limitZI || limitZI === 0) this.limit[z][i] = (typeof limitZI == 'function') ? limitZI() : limitZI; + } + } + } + + if (typeOf(this.options.grid) == 'number') this.options.grid = { + x: this.options.grid, + y: this.options.grid + }; + + var events = { + mousemove: this.bound.check, + mouseup: this.bound.cancel + }; + events[this.selection] = this.bound.eventStop; + this.document.addEvents(events); + }, + + check: function(event){ + if (this.options.preventDefault) event.preventDefault(); + var distance = Math.round(Math.sqrt(Math.pow(event.page.x - this.mouse.start.x, 2) + Math.pow(event.page.y - this.mouse.start.y, 2))); + if (distance > this.options.snap){ + this.cancel(); + this.document.addEvents({ + mousemove: this.bound.drag, + mouseup: this.bound.stop + }); + this.fireEvent('start', [this.element, event]).fireEvent('snap', this.element); + } + }, + + drag: function(event){ + var options = this.options; + + if (options.preventDefault) event.preventDefault(); + this.mouse.now = event.page; + + for (var z in options.modifiers){ + if (!options.modifiers[z]) continue; + this.value.now[z] = this.mouse.now[z] - this.mouse.pos[z]; + + if (options.invert) this.value.now[z] *= -1; + + if (options.limit && this.limit[z]){ + if ((this.limit[z][1] || this.limit[z][1] === 0) && (this.value.now[z] > this.limit[z][1])){ + this.value.now[z] = this.limit[z][1]; + } else if ((this.limit[z][0] || this.limit[z][0] === 0) && (this.value.now[z] < this.limit[z][0])){ + this.value.now[z] = this.limit[z][0]; + } + } + + if (options.grid[z]) this.value.now[z] -= ((this.value.now[z] - (this.limit[z][0]||0)) % options.grid[z]); + + if (options.style) this.element.setStyle(options.modifiers[z], this.value.now[z] + options.unit); + else this.element[options.modifiers[z]] = this.value.now[z]; + } + + this.fireEvent('drag', [this.element, event]); + }, + + cancel: function(event){ + this.document.removeEvents({ + mousemove: this.bound.check, + mouseup: this.bound.cancel + }); + if (event){ + this.document.removeEvent(this.selection, this.bound.eventStop); + this.fireEvent('cancel', this.element); + } + }, + + stop: function(event){ + var events = { + mousemove: this.bound.drag, + mouseup: this.bound.stop + }; + events[this.selection] = this.bound.eventStop; + this.document.removeEvents(events); + if (event) this.fireEvent('complete', [this.element, event]); + } + +}); + +Element.implement({ + + makeResizable: function(options){ + var drag = new Drag(this, Object.merge({ + modifiers: { + x: 'width', + y: 'height' + } + }, options)); + + this.store('resizer', drag); + return drag.addEvent('drag', function(){ + this.fireEvent('resize', drag); + }.bind(this)); + } + +}); + + +/* +--- + +script: Drag.Move.js + +name: Drag.Move + +description: A Drag extension that provides support for the constraining of draggables to containers and droppables. + +license: MIT-style license + +authors: + - Valerio Proietti + - Tom Occhinno + - Jan Kassens + - Aaron Newton + - Scott Kyle + +requires: + - Core/Element.Dimensions + - /Drag + +provides: [Drag.Move] + +... +*/ + +Drag.Move = new Class({ + + Extends: Drag, + + options: {/* + onEnter: function(thisElement, overed){}, + onLeave: function(thisElement, overed){}, + onDrop: function(thisElement, overed, event){},*/ + droppables: [], + container: false, + precalculate: false, + includeMargins: true, + checkDroppables: true + }, + + initialize: function(element, options){ + this.parent(element, options); + element = this.element; + + this.droppables = $$(this.options.droppables); + this.container = document.id(this.options.container); + + if (this.container && typeOf(this.container) != 'element') + this.container = document.id(this.container.getDocument().body); + + if (this.options.style){ + if (this.options.modifiers.x == 'left' && this.options.modifiers.y == 'top'){ + var parent = element.getOffsetParent(), + styles = element.getStyles('left', 'top'); + if (parent && (styles.left == 'auto' || styles.top == 'auto')){ + element.setPosition(element.getPosition(parent)); + } + } + + if (element.getStyle('position') == 'static') element.setStyle('position', 'absolute'); + } + + this.addEvent('start', this.checkDroppables, true); + this.overed = null; + }, + + start: function(event){ + if (this.container) this.options.limit = this.calculateLimit(); + + if (this.options.precalculate){ + this.positions = this.droppables.map(function(el){ + return el.getCoordinates(); + }); + } + + this.parent(event); + }, + + calculateLimit: function(){ + var element = this.element, + container = this.container, + + offsetParent = document.id(element.getOffsetParent()) || document.body, + containerCoordinates = container.getCoordinates(offsetParent), + elementMargin = {}, + elementBorder = {}, + containerMargin = {}, + containerBorder = {}, + offsetParentPadding = {}; + + ['top', 'right', 'bottom', 'left'].each(function(pad){ + elementMargin[pad] = element.getStyle('margin-' + pad).toInt(); + elementBorder[pad] = element.getStyle('border-' + pad).toInt(); + containerMargin[pad] = container.getStyle('margin-' + pad).toInt(); + containerBorder[pad] = container.getStyle('border-' + pad).toInt(); + offsetParentPadding[pad] = offsetParent.getStyle('padding-' + pad).toInt(); + }, this); + + var width = element.offsetWidth + elementMargin.left + elementMargin.right, + height = element.offsetHeight + elementMargin.top + elementMargin.bottom, + left = 0, + top = 0, + right = containerCoordinates.right - containerBorder.right - width, + bottom = containerCoordinates.bottom - containerBorder.bottom - height; + + if (this.options.includeMargins){ + left += elementMargin.left; + top += elementMargin.top; + } else { + right += elementMargin.right; + bottom += elementMargin.bottom; + } + + if (element.getStyle('position') == 'relative'){ + var coords = element.getCoordinates(offsetParent); + coords.left -= element.getStyle('left').toInt(); + coords.top -= element.getStyle('top').toInt(); + + left -= coords.left; + top -= coords.top; + if (container.getStyle('position') != 'relative'){ + left += containerBorder.left; + top += containerBorder.top; + } + right += elementMargin.left - coords.left; + bottom += elementMargin.top - coords.top; + + if (container != offsetParent){ + left += containerMargin.left + offsetParentPadding.left; + top += ((Browser.ie6 || Browser.ie7) ? 0 : containerMargin.top) + offsetParentPadding.top; + } + } else { + left -= elementMargin.left; + top -= elementMargin.top; + if (container != offsetParent){ + left += containerCoordinates.left + containerBorder.left; + top += containerCoordinates.top + containerBorder.top; + } + } + + return { + x: [left, right], + y: [top, bottom] + }; + }, + + getDroppableCoordinates: function(element){ + var position = element.getCoordinates(); + if (element.getStyle('position') == 'fixed'){ + var scroll = window.getScroll(); + position.left += scroll.x; + position.right += scroll.x; + position.top += scroll.y; + position.bottom += scroll.y; + } + return position; + }, + + checkDroppables: function(){ + var overed = this.droppables.filter(function(el, i){ + el = this.positions ? this.positions[i] : this.getDroppableCoordinates(el); + var now = this.mouse.now; + return (now.x > el.left && now.x < el.right && now.y < el.bottom && now.y > el.top); + }, this).getLast(); + + if (this.overed != overed){ + if (this.overed) this.fireEvent('leave', [this.element, this.overed]); + if (overed) this.fireEvent('enter', [this.element, overed]); + this.overed = overed; + } + }, + + drag: function(event){ + this.parent(event); + if (this.options.checkDroppables && this.droppables.length) this.checkDroppables(); + }, + + stop: function(event){ + this.checkDroppables(); + this.fireEvent('drop', [this.element, this.overed, event]); + this.overed = null; + return this.parent(event); + } + +}); + +Element.implement({ + + makeDraggable: function(options){ + var drag = new Drag.Move(this, options); + this.store('dragger', drag); + return drag; + } + +}); + + +/* +--- + +script: Slider.js + +name: Slider + +description: Class for creating horizontal and vertical slider controls. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Element.Dimensions + - /Class.Binds + - /Drag + - /Element.Measure + +provides: [Slider] + +... +*/ + +var Slider = new Class({ + + Implements: [Events, Options], + + Binds: ['clickedElement', 'draggedKnob', 'scrolledElement'], + + options: {/* + onTick: function(intPosition){}, + onChange: function(intStep){}, + onComplete: function(strStep){},*/ + onTick: function(position){ + this.setKnobPosition(position); + }, + initialStep: 0, + snap: false, + offset: 0, + range: false, + wheel: false, + steps: 100, + mode: 'horizontal' + }, + + initialize: function(element, knob, options){ + this.setOptions(options); + options = this.options; + this.element = document.id(element); + knob = this.knob = document.id(knob); + this.previousChange = this.previousEnd = this.step = -1; + + var limit = {}, + modifiers = {x: false, y: false}; + + switch (options.mode){ + case 'vertical': + this.axis = 'y'; + this.property = 'top'; + this.offset = 'offsetHeight'; + break; + case 'horizontal': + this.axis = 'x'; + this.property = 'left'; + this.offset = 'offsetWidth'; + } + + this.setSliderDimensions(); + this.setRange(options.range); + + if (knob.getStyle('position') == 'static') knob.setStyle('position', 'relative'); + knob.setStyle(this.property, -options.offset); + modifiers[this.axis] = this.property; + limit[this.axis] = [-options.offset, this.full - options.offset]; + + var dragOptions = { + snap: 0, + limit: limit, + modifiers: modifiers, + onDrag: this.draggedKnob, + onStart: this.draggedKnob, + onBeforeStart: (function(){ + this.isDragging = true; + }).bind(this), + onCancel: function(){ + this.isDragging = false; + }.bind(this), + onComplete: function(){ + this.isDragging = false; + this.draggedKnob(); + this.end(); + }.bind(this) + }; + if (options.snap) this.setSnap(dragOptions); + + this.drag = new Drag(knob, dragOptions); + this.attach(); + if (options.initialStep != null) this.set(options.initialStep); + }, + + attach: function(){ + this.element.addEvent('mousedown', this.clickedElement); + if (this.options.wheel) this.element.addEvent('mousewheel', this.scrolledElement); + this.drag.attach(); + return this; + }, + + detach: function(){ + this.element.removeEvent('mousedown', this.clickedElement) + .removeEvent('mousewheel', this.scrolledElement); + this.drag.detach(); + return this; + }, + + autosize: function(){ + this.setSliderDimensions() + .setKnobPosition(this.toPosition(this.step)); + this.drag.options.limit[this.axis] = [-this.options.offset, this.full - this.options.offset]; + if (this.options.snap) this.setSnap(); + return this; + }, + + setSnap: function(options){ + if (!options) options = this.drag.options; + options.grid = Math.ceil(this.stepWidth); + options.limit[this.axis][1] = this.full; + return this; + }, + + setKnobPosition: function(position){ + if (this.options.snap) position = this.toPosition(this.step); + this.knob.setStyle(this.property, position); + return this; + }, + + setSliderDimensions: function(){ + this.full = this.element.measure(function(){ + this.half = this.knob[this.offset] / 2; + return this.element[this.offset] - this.knob[this.offset] + (this.options.offset * 2); + }.bind(this)); + return this; + }, + + set: function(step){ + if (!((this.range > 0) ^ (step < this.min))) step = this.min; + if (!((this.range > 0) ^ (step > this.max))) step = this.max; + + this.step = Math.round(step); + return this.checkStep() + .fireEvent('tick', this.toPosition(this.step)) + .end(); + }, + + setRange: function(range, pos){ + this.min = Array.pick([range[0], 0]); + this.max = Array.pick([range[1], this.options.steps]); + this.range = this.max - this.min; + this.steps = this.options.steps || this.full; + this.stepSize = Math.abs(this.range) / this.steps; + this.stepWidth = this.stepSize * this.full / Math.abs(this.range); + if (range) this.set(Array.pick([pos, this.step]).floor(this.min).max(this.max)); + return this; + }, + + clickedElement: function(event){ + if (this.isDragging || event.target == this.knob) return; + + var dir = this.range < 0 ? -1 : 1, + position = event.page[this.axis] - this.element.getPosition()[this.axis] - this.half; + + position = position.limit(-this.options.offset, this.full - this.options.offset); + + this.step = Math.round(this.min + dir * this.toStep(position)); + + this.checkStep() + .fireEvent('tick', position) + .end(); + }, + + scrolledElement: function(event){ + var mode = (this.options.mode == 'horizontal') ? (event.wheel < 0) : (event.wheel > 0); + this.set(this.step + (mode ? -1 : 1) * this.stepSize); + event.stop(); + }, + + draggedKnob: function(){ + var dir = this.range < 0 ? -1 : 1, + position = this.drag.value.now[this.axis]; + + position = position.limit(-this.options.offset, this.full -this.options.offset); + + this.step = Math.round(this.min + dir * this.toStep(position)); + this.checkStep(); + }, + + checkStep: function(){ + var step = this.step; + if (this.previousChange != step){ + this.previousChange = step; + this.fireEvent('change', step); + } + return this; + }, + + end: function(){ + var step = this.step; + if (this.previousEnd !== step){ + this.previousEnd = step; + this.fireEvent('complete', step + ''); + } + return this; + }, + + toStep: function(position){ + var step = (position + this.options.offset) * this.stepSize / this.full * this.steps; + return this.options.steps ? Math.round(step -= step % this.stepSize) : step; + }, + + toPosition: function(step){ + return (this.full * Math.abs(this.min - step)) / (this.steps * this.stepSize) - this.options.offset; + } + +}); + + +/* +--- + +script: Sortables.js + +name: Sortables + +description: Class for creating a drag and drop sorting interface for lists of items. + +license: MIT-style license + +authors: + - Tom Occhino + +requires: + - Core/Fx.Morph + - /Drag.Move + +provides: [Sortables] + +... +*/ + +var Sortables = new Class({ + + Implements: [Events, Options], + + options: {/* + onSort: function(element, clone){}, + onStart: function(element, clone){}, + onComplete: function(element){},*/ + opacity: 1, + clone: false, + revert: false, + handle: false, + dragOptions: {} + }, + + initialize: function(lists, options){ + this.setOptions(options); + + this.elements = []; + this.lists = []; + this.idle = true; + + this.addLists($$(document.id(lists) || lists)); + + if (!this.options.clone) this.options.revert = false; + if (this.options.revert) this.effect = new Fx.Morph(null, Object.merge({ + duration: 250, + link: 'cancel' + }, this.options.revert)); + }, + + attach: function(){ + this.addLists(this.lists); + return this; + }, + + detach: function(){ + this.lists = this.removeLists(this.lists); + return this; + }, + + addItems: function(){ + Array.flatten(arguments).each(function(element){ + this.elements.push(element); + var start = element.retrieve('sortables:start', function(event){ + this.start.call(this, event, element); + }.bind(this)); + (this.options.handle ? element.getElement(this.options.handle) || element : element).addEvent('mousedown', start); + }, this); + return this; + }, + + addLists: function(){ + Array.flatten(arguments).each(function(list){ + this.lists.include(list); + this.addItems(list.getChildren()); + }, this); + return this; + }, + + removeItems: function(){ + return $$(Array.flatten(arguments).map(function(element){ + this.elements.erase(element); + var start = element.retrieve('sortables:start'); + (this.options.handle ? element.getElement(this.options.handle) || element : element).removeEvent('mousedown', start); + + return element; + }, this)); + }, + + removeLists: function(){ + return $$(Array.flatten(arguments).map(function(list){ + this.lists.erase(list); + this.removeItems(list.getChildren()); + + return list; + }, this)); + }, + + getClone: function(event, element){ + if (!this.options.clone) return new Element(element.tagName).inject(document.body); + if (typeOf(this.options.clone) == 'function') return this.options.clone.call(this, event, element, this.list); + var clone = element.clone(true).setStyles({ + margin: 0, + position: 'absolute', + visibility: 'hidden', + width: element.getStyle('width') + }).addEvent('mousedown', function(event){ + element.fireEvent('mousedown', event); + }); + //prevent the duplicated radio inputs from unchecking the real one + if (clone.get('html').test('radio')){ + clone.getElements('input[type=radio]').each(function(input, i){ + input.set('name', 'clone_' + i); + if (input.get('checked')) element.getElements('input[type=radio]')[i].set('checked', true); + }); + } + + return clone.inject(this.list).setPosition(element.getPosition(element.getOffsetParent())); + }, + + getDroppables: function(){ + var droppables = this.list.getChildren().erase(this.clone).erase(this.element); + if (!this.options.constrain) droppables.append(this.lists).erase(this.list); + return droppables; + }, + + insert: function(dragging, element){ + var where = 'inside'; + if (this.lists.contains(element)){ + this.list = element; + this.drag.droppables = this.getDroppables(); + } else { + where = this.element.getAllPrevious().contains(element) ? 'before' : 'after'; + } + this.element.inject(element, where); + this.fireEvent('sort', [this.element, this.clone]); + }, + + start: function(event, element){ + if ( + !this.idle || + event.rightClick || + ['button', 'input', 'a', 'textarea'].contains(event.target.get('tag')) + ) return; + + this.idle = false; + this.element = element; + this.opacity = element.getStyle('opacity'); + this.list = element.getParent(); + this.clone = this.getClone(event, element); + + this.drag = new Drag.Move(this.clone, Object.merge({ + + droppables: this.getDroppables() + }, this.options.dragOptions)).addEvents({ + onSnap: function(){ + event.stop(); + this.clone.setStyle('visibility', 'visible'); + this.element.setStyle('opacity', this.options.opacity || 0); + this.fireEvent('start', [this.element, this.clone]); + }.bind(this), + onEnter: this.insert.bind(this), + onCancel: this.end.bind(this), + onComplete: this.end.bind(this) + }); + + this.clone.inject(this.element, 'before'); + this.drag.start(event); + }, + + end: function(){ + this.drag.detach(); + this.element.setStyle('opacity', this.opacity); + if (this.effect){ + var dim = this.element.getStyles('width', 'height'), + clone = this.clone, + pos = clone.computePosition(this.element.getPosition(this.clone.getOffsetParent())); + + var destroy = function(){ + this.removeEvent('cancel', destroy); + clone.destroy(); + }; + + this.effect.element = clone; + this.effect.start({ + top: pos.top, + left: pos.left, + width: dim.width, + height: dim.height, + opacity: 0.25 + }).addEvent('cancel', destroy).chain(destroy); + } else { + this.clone.destroy(); + } + this.reset(); + }, + + reset: function(){ + this.idle = true; + this.fireEvent('complete', this.element); + }, + + serialize: function(){ + var params = Array.link(arguments, { + modifier: Type.isFunction, + index: function(obj){ + return obj != null; + } + }); + var serial = this.lists.map(function(list){ + return list.getChildren().map(params.modifier || function(element){ + return element.get('id'); + }, this); + }, this); + + var index = params.index; + if (this.lists.length == 1) index = 0; + return (index || index === 0) && index >= 0 && index < this.lists.length ? serial[index] : serial; + } + +}); + + +/* +--- + +script: Request.Periodical.js + +name: Request.Periodical + +description: Requests the same URL to pull data from a server but increases the intervals if no data is returned to reduce the load + +license: MIT-style license + +authors: + - Christoph Pojer + +requires: + - Core/Request + - /MooTools.More + +provides: [Request.Periodical] + +... +*/ + +Request.implement({ + + options: { + initialDelay: 5000, + delay: 5000, + limit: 60000 + }, + + startTimer: function(data){ + var fn = function(){ + if (!this.running) this.send({data: data}); + }; + this.lastDelay = this.options.initialDelay; + this.timer = fn.delay(this.lastDelay, this); + this.completeCheck = function(response){ + clearTimeout(this.timer); + this.lastDelay = (response) ? this.options.delay : (this.lastDelay + this.options.delay).min(this.options.limit); + this.timer = fn.delay(this.lastDelay, this); + }; + return this.addEvent('complete', this.completeCheck); + }, + + stopTimer: function(){ + clearTimeout(this.timer); + return this.removeEvent('complete', this.completeCheck); + } + +}); + + +/* +--- + +script: Assets.js + +name: Assets + +description: Provides methods to dynamically load JavaScript, CSS, and Image files into the document. + +license: MIT-style license + +authors: + - Valerio Proietti + +requires: + - Core/Element.Event + - /MooTools.More + +provides: [Assets] + +... +*/ + +var Asset = { + + javascript: function(source, properties){ + if (!properties) properties = {}; + + var script = new Element('script', {src: source, type: 'text/javascript'}), + doc = properties.document || document, + load = properties.onload || properties.onLoad; + + delete properties.onload; + delete properties.onLoad; + delete properties.document; + + if (load){ + if (typeof script.onreadystatechange != 'undefined'){ + script.addEvent('readystatechange', function(){ + if (['loaded', 'complete'].contains(this.readyState)) load.call(this); + }); + } else { + script.addEvent('load', load); + } + } + + return script.set(properties).inject(doc.head); + }, + + css: function(source, properties){ + if (!properties) properties = {}; + + var link = new Element('link', { + rel: 'stylesheet', + media: 'screen', + type: 'text/css', + href: source + }); + + var load = properties.onload || properties.onLoad, + doc = properties.document || document; + + delete properties.onload; + delete properties.onLoad; + delete properties.document; + + if (load) link.addEvent('load', load); + return link.set(properties).inject(doc.head); + }, + + image: function(source, properties){ + if (!properties) properties = {}; + + var image = new Image(), + element = document.id(image) || new Element('img'); + + ['load', 'abort', 'error'].each(function(name){ + var type = 'on' + name, + cap = 'on' + name.capitalize(), + event = properties[type] || properties[cap] || function(){}; + + delete properties[cap]; + delete properties[type]; + + image[type] = function(){ + if (!image) return; + if (!element.parentNode){ + element.width = image.width; + element.height = image.height; + } + image = image.onload = image.onabort = image.onerror = null; + event.delay(1, element, element); + element.fireEvent(name, element, 1); + }; + }); + + image.src = element.src = source; + if (image && image.complete) image.onload.delay(1); + return element.set(properties); + }, + + images: function(sources, options){ + sources = Array.from(sources); + + var fn = function(){}, + counter = 0; + + options = Object.merge({ + onComplete: fn, + onProgress: fn, + onError: fn, + properties: {} + }, options); + + return new Elements(sources.map(function(source, index){ + return Asset.image(source, Object.append(options.properties, { + onload: function(){ + counter++; + options.onProgress.call(this, counter, index, source); + if (counter == sources.length) options.onComplete(); + }, + onerror: function(){ + counter++; + options.onError.call(this, counter, index, source); + if (counter == sources.length) options.onComplete(); + } + })); + })); + } + +}; + + +/* +--- + +script: IframeShim.js + +name: IframeShim + +description: Defines IframeShim, a class for obscuring select lists and flash objects in IE. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Element.Event + - Core/Element.Style + - Core/Options + - Core/Events + - /Element.Position + - /Class.Occlude + +provides: [IframeShim] + +... +*/ + +var IframeShim = new Class({ + + Implements: [Options, Events, Class.Occlude], + + options: { + className: 'iframeShim', + src: 'javascript:false;document.write("");', + display: false, + zIndex: null, + margin: 0, + offset: {x: 0, y: 0}, + browsers: (Browser.ie6 || (Browser.firefox && Browser.version < 3 && Browser.Platform.mac)) + }, + + property: 'IframeShim', + + initialize: function(element, options){ + this.element = document.id(element); + if (this.occlude()) return this.occluded; + this.setOptions(options); + this.makeShim(); + return this; + }, + + makeShim: function(){ + if (this.options.browsers){ + var zIndex = this.element.getStyle('zIndex').toInt(); + + if (!zIndex){ + zIndex = 1; + var pos = this.element.getStyle('position'); + if (pos == 'static' || !pos) this.element.setStyle('position', 'relative'); + this.element.setStyle('zIndex', zIndex); + } + zIndex = ((this.options.zIndex != null || this.options.zIndex === 0) && zIndex > this.options.zIndex) ? this.options.zIndex : zIndex - 1; + if (zIndex < 0) zIndex = 1; + this.shim = new Element('iframe', { + src: this.options.src, + scrolling: 'no', + frameborder: 0, + styles: { + zIndex: zIndex, + position: 'absolute', + border: 'none', + filter: 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)' + }, + 'class': this.options.className + }).store('IframeShim', this); + var inject = (function(){ + this.shim.inject(this.element, 'after'); + this[this.options.display ? 'show' : 'hide'](); + this.fireEvent('inject'); + }).bind(this); + if (!IframeShim.ready) window.addEvent('load', inject); + else inject(); + } else { + this.position = this.hide = this.show = this.dispose = Function.from(this); + } + }, + + position: function(){ + if (!IframeShim.ready || !this.shim) return this; + var size = this.element.measure(function(){ + return this.getSize(); + }); + if (this.options.margin != undefined){ + size.x = size.x - (this.options.margin * 2); + size.y = size.y - (this.options.margin * 2); + this.options.offset.x += this.options.margin; + this.options.offset.y += this.options.margin; + } + this.shim.set({width: size.x, height: size.y}).position({ + relativeTo: this.element, + offset: this.options.offset + }); + return this; + }, + + hide: function(){ + if (this.shim) this.shim.setStyle('display', 'none'); + return this; + }, + + show: function(){ + if (this.shim) this.shim.setStyle('display', 'block'); + return this.position(); + }, + + dispose: function(){ + if (this.shim) this.shim.dispose(); + return this; + }, + + destroy: function(){ + if (this.shim) this.shim.destroy(); + return this; + } + +}); + +window.addEvent('load', function(){ + IframeShim.ready = true; +}); + + +/* +--- + +script: Mask.js + +name: Mask + +description: Creates a mask element to cover another. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Options + - Core/Events + - Core/Element.Event + - /Class.Binds + - /Element.Position + - /IframeShim + +provides: [Mask] + +... +*/ + +var Mask = new Class({ + + Implements: [Options, Events], + + Binds: ['position'], + + options: {/* + onShow: function(){}, + onHide: function(){}, + onDestroy: function(){}, + onClick: function(event){}, + inject: { + where: 'after', + target: null, + }, + hideOnClick: false, + id: null, + destroyOnHide: false,*/ + style: {}, + 'class': 'mask', + maskMargins: false, + useIframeShim: true, + iframeShimOptions: {} + }, + + initialize: function(target, options){ + this.target = document.id(target) || document.id(document.body); + this.target.store('mask', this); + this.setOptions(options); + this.render(); + this.inject(); + }, + + render: function(){ + this.element = new Element('div', { + 'class': this.options['class'], + id: this.options.id || 'mask-' + String.uniqueID(), + styles: Object.merge({}, this.options.style, { + display: 'none' + }), + events: { + click: function(event){ + this.fireEvent('click', event); + if (this.options.hideOnClick) this.hide(); + }.bind(this) + } + }); + + this.hidden = true; + }, + + toElement: function(){ + return this.element; + }, + + inject: function(target, where){ + where = where || (this.options.inject ? this.options.inject.where : '') || this.target == document.body ? 'inside' : 'after'; + target = target || (this.options.inject && this.options.inject.target) || this.target; + + this.element.inject(target, where); + + if (this.options.useIframeShim){ + this.shim = new IframeShim(this.element, this.options.iframeShimOptions); + + this.addEvents({ + show: this.shim.show.bind(this.shim), + hide: this.shim.hide.bind(this.shim), + destroy: this.shim.destroy.bind(this.shim) + }); + } + }, + + position: function(){ + this.resize(this.options.width, this.options.height); + + this.element.position({ + relativeTo: this.target, + position: 'topLeft', + ignoreMargins: !this.options.maskMargins, + ignoreScroll: this.target == document.body + }); + + return this; + }, + + resize: function(x, y){ + var opt = { + styles: ['padding', 'border'] + }; + if (this.options.maskMargins) opt.styles.push('margin'); + + var dim = this.target.getComputedSize(opt); + if (this.target == document.body){ + this.element.setStyles({width: 0, height: 0}); + var win = window.getScrollSize(); + if (dim.totalHeight < win.y) dim.totalHeight = win.y; + if (dim.totalWidth < win.x) dim.totalWidth = win.x; + } + this.element.setStyles({ + width: Array.pick([x, dim.totalWidth, dim.x]), + height: Array.pick([y, dim.totalHeight, dim.y]) + }); + + return this; + }, + + show: function(){ + if (!this.hidden) return this; + + window.addEvent('resize', this.position); + this.position(); + this.showMask.apply(this, arguments); + + return this; + }, + + showMask: function(){ + this.element.setStyle('display', 'block'); + this.hidden = false; + this.fireEvent('show'); + }, + + hide: function(){ + if (this.hidden) return this; + + window.removeEvent('resize', this.position); + this.hideMask.apply(this, arguments); + if (this.options.destroyOnHide) return this.destroy(); + + return this; + }, + + hideMask: function(){ + this.element.setStyle('display', 'none'); + this.hidden = true; + this.fireEvent('hide'); + }, + + toggle: function(){ + this[this.hidden ? 'show' : 'hide'](); + }, + + destroy: function(){ + this.hide(); + this.element.destroy(); + this.fireEvent('destroy'); + this.target.eliminate('mask'); + } + +}); + +Element.Properties.mask = { + + set: function(options){ + var mask = this.retrieve('mask'); + if (mask) mask.destroy(); + return this.eliminate('mask').store('mask:options', options); + }, + + get: function(){ + var mask = this.retrieve('mask'); + if (!mask){ + mask = new Mask(this, this.retrieve('mask:options')); + this.store('mask', mask); + } + return mask; + } + +}; + +Element.implement({ + + mask: function(options){ + if (options) this.set('mask', options); + this.get('mask').show(); + return this; + }, + + unmask: function(){ + this.get('mask').hide(); + return this; + } + +}); + + +/* +--- + +script: Tips.js + +name: Tips + +description: Class for creating nice tips that follow the mouse cursor when hovering an element. + +license: MIT-style license + +authors: + - Valerio Proietti + - Christoph Pojer + - Luis Merino + +requires: + - Core/Options + - Core/Events + - Core/Element.Event + - Core/Element.Style + - Core/Element.Dimensions + - /MooTools.More + +provides: [Tips] + +... +*/ + +(function(){ + +var read = function(option, element){ + return (option) ? (typeOf(option) == 'function' ? option(element) : element.get(option)) : ''; +}; + +this.Tips = new Class({ + + Implements: [Events, Options], + + options: {/* + id: null, + onAttach: function(element){}, + onDetach: function(element){}, + onBound: function(coords){},*/ + onShow: function(){ + this.tip.setStyle('display', 'block'); + }, + onHide: function(){ + this.tip.setStyle('display', 'none'); + }, + title: 'title', + text: function(element){ + return element.get('rel') || element.get('href'); + }, + showDelay: 100, + hideDelay: 100, + className: 'tip-wrap', + offset: {x: 16, y: 16}, + windowPadding: {x:0, y:0}, + fixed: false, + waiAria: true + }, + + initialize: function(){ + var params = Array.link(arguments, { + options: Type.isObject, + elements: function(obj){ + return obj != null; + } + }); + this.setOptions(params.options); + if (params.elements) this.attach(params.elements); + this.container = new Element('div', {'class': 'tip'}); + + if (this.options.id){ + this.container.set('id', this.options.id); + if (this.options.waiAria) this.attachWaiAria(); + } + }, + + toElement: function(){ + if (this.tip) return this.tip; + + this.tip = new Element('div', { + 'class': this.options.className, + styles: { + position: 'absolute', + top: 0, + left: 0 + } + }).adopt( + new Element('div', {'class': 'tip-top'}), + this.container, + new Element('div', {'class': 'tip-bottom'}) + ); + + return this.tip; + }, + + attachWaiAria: function(){ + var id = this.options.id; + this.container.set('role', 'tooltip'); + + if (!this.waiAria){ + this.waiAria = { + show: function(element){ + if (id) element.set('aria-describedby', id); + this.container.set('aria-hidden', 'false'); + }, + hide: function(element){ + if (id) element.erase('aria-describedby'); + this.container.set('aria-hidden', 'true'); + } + }; + } + this.addEvents(this.waiAria); + }, + + detachWaiAria: function(){ + if (this.waiAria){ + this.container.erase('role'); + this.container.erase('aria-hidden'); + this.removeEvents(this.waiAria); + } + }, + + attach: function(elements){ + $$(elements).each(function(element){ + var title = read(this.options.title, element), + text = read(this.options.text, element); + + element.set('title', '').store('tip:native', title).retrieve('tip:title', title); + element.retrieve('tip:text', text); + this.fireEvent('attach', [element]); + + var events = ['enter', 'leave']; + if (!this.options.fixed) events.push('move'); + + events.each(function(value){ + var event = element.retrieve('tip:' + value); + if (!event) event = function(event){ + this['element' + value.capitalize()].apply(this, [event, element]); + }.bind(this); + + element.store('tip:' + value, event).addEvent('mouse' + value, event); + }, this); + }, this); + + return this; + }, + + detach: function(elements){ + $$(elements).each(function(element){ + ['enter', 'leave', 'move'].each(function(value){ + element.removeEvent('mouse' + value, element.retrieve('tip:' + value)).eliminate('tip:' + value); + }); + + this.fireEvent('detach', [element]); + + if (this.options.title == 'title'){ // This is necessary to check if we can revert the title + var original = element.retrieve('tip:native'); + if (original) element.set('title', original); + } + }, this); + + return this; + }, + + elementEnter: function(event, element){ + clearTimeout(this.timer); + this.timer = (function(){ + this.container.empty(); + + ['title', 'text'].each(function(value){ + var content = element.retrieve('tip:' + value); + var div = this['_' + value + 'Element'] = new Element('div', { + 'class': 'tip-' + value + }).inject(this.container); + if (content) this.fill(div, content); + }, this); + this.show(element); + this.position((this.options.fixed) ? {page: element.getPosition()} : event); + }).delay(this.options.showDelay, this); + }, + + elementLeave: function(event, element){ + clearTimeout(this.timer); + this.timer = this.hide.delay(this.options.hideDelay, this, element); + this.fireForParent(event, element); + }, + + setTitle: function(title){ + if (this._titleElement){ + this._titleElement.empty(); + this.fill(this._titleElement, title); + } + return this; + }, + + setText: function(text){ + if (this._textElement){ + this._textElement.empty(); + this.fill(this._textElement, text); + } + return this; + }, + + fireForParent: function(event, element){ + element = element.getParent(); + if (!element || element == document.body) return; + if (element.retrieve('tip:enter')) element.fireEvent('mouseenter', event); + else this.fireForParent(event, element); + }, + + elementMove: function(event, element){ + this.position(event); + }, + + position: function(event){ + if (!this.tip) document.id(this); + + var size = window.getSize(), scroll = window.getScroll(), + tip = {x: this.tip.offsetWidth, y: this.tip.offsetHeight}, + props = {x: 'left', y: 'top'}, + bounds = {y: false, x2: false, y2: false, x: false}, + obj = {}; + + for (var z in props){ + obj[props[z]] = event.page[z] + this.options.offset[z]; + if (obj[props[z]] < 0) bounds[z] = true; + if ((obj[props[z]] + tip[z] - scroll[z]) > size[z] - this.options.windowPadding[z]){ + obj[props[z]] = event.page[z] - this.options.offset[z] - tip[z]; + bounds[z+'2'] = true; + } + } + + this.fireEvent('bound', bounds); + this.tip.setStyles(obj); + }, + + fill: function(element, contents){ + if (typeof contents == 'string') element.set('html', contents); + else element.adopt(contents); + }, + + show: function(element){ + if (!this.tip) document.id(this); + if (!this.tip.getParent()) this.tip.inject(document.body); + this.fireEvent('show', [this.tip, element]); + }, + + hide: function(element){ + if (!this.tip) document.id(this); + this.fireEvent('hide', [this.tip, element]); + } + +}); + +})(); + + +/* +--- + +script: Spinner.js + +name: Spinner + +description: Adds a semi-transparent overlay over a dom element with a spinnin ajax icon. + +license: MIT-style license + +authors: + - Aaron Newton + +requires: + - Core/Fx.Tween + - Core/Request + - /Class.refactor + - /Mask + +provides: [Spinner] + +... +*/ + +var Spinner = new Class({ + + Extends: Mask, + + Implements: Chain, + + options: {/* + message: false,*/ + 'class': 'spinner', + containerPosition: {}, + content: { + 'class': 'spinner-content' + }, + messageContainer: { + 'class': 'spinner-msg' + }, + img: { + 'class': 'spinner-img' + }, + fxOptions: { + link: 'chain' + } + }, + + initialize: function(target, options){ + this.target = document.id(target) || document.id(document.body); + this.target.store('spinner', this); + this.setOptions(options); + this.render(); + this.inject(); + + // Add this to events for when noFx is true; parent methods handle hide/show. + var deactivate = function(){ this.active = false; }.bind(this); + this.addEvents({ + hide: deactivate, + show: deactivate + }); + }, + + render: function(){ + this.parent(); + + this.element.set('id', this.options.id || 'spinner-' + String.uniqueID()); + + this.content = document.id(this.options.content) || new Element('div', this.options.content); + this.content.inject(this.element); + + if (this.options.message){ + this.msg = document.id(this.options.message) || new Element('p', this.options.messageContainer).appendText(this.options.message); + this.msg.inject(this.content); + } + + if (this.options.img){ + this.img = document.id(this.options.img) || new Element('div', this.options.img); + this.img.inject(this.content); + } + + this.element.set('tween', this.options.fxOptions); + }, + + show: function(noFx){ + if (this.active) return this.chain(this.show.bind(this)); + if (!this.hidden){ + this.callChain.delay(20, this); + return this; + } + + this.active = true; + + return this.parent(noFx); + }, + + showMask: function(noFx){ + var pos = function(){ + this.content.position(Object.merge({ + relativeTo: this.element + }, this.options.containerPosition)); + }.bind(this); + + if (noFx){ + this.parent(); + pos(); + } else { + if (!this.options.style.opacity) this.options.style.opacity = this.element.getStyle('opacity').toFloat(); + this.element.setStyles({ + display: 'block', + opacity: 0 + }).tween('opacity', this.options.style.opacity); + pos(); + this.hidden = false; + this.fireEvent('show'); + this.callChain(); + } + }, + + hide: function(noFx){ + if (this.active) return this.chain(this.hide.bind(this)); + if (this.hidden){ + this.callChain.delay(20, this); + return this; + } + this.active = true; + return this.parent(noFx); + }, + + hideMask: function(noFx){ + if (noFx) return this.parent(); + this.element.tween('opacity', 0).get('tween').chain(function(){ + this.element.setStyle('display', 'none'); + this.hidden = true; + this.fireEvent('hide'); + this.callChain(); + }.bind(this)); + }, + + destroy: function(){ + this.content.destroy(); + this.parent(); + this.target.eliminate('spinner'); + } + +}); + +Request = Class.refactor(Request, { + + options: { + useSpinner: false, + spinnerOptions: {}, + spinnerTarget: false + }, + + initialize: function(options){ + this._send = this.send; + this.send = function(options){ + var spinner = this.getSpinner(); + if (spinner) spinner.chain(this._send.pass(options, this)).show(); + else this._send(options); + return this; + }; + this.previous(options); + }, + + getSpinner: function(){ + if (!this.spinner){ + var update = document.id(this.options.spinnerTarget) || document.id(this.options.update); + if (this.options.useSpinner && update){ + update.set('spinner', this.options.spinnerOptions); + var spinner = this.spinner = update.get('spinner'); + ['complete', 'exception', 'cancel'].each(function(event){ + this.addEvent(event, spinner.hide.bind(spinner)); + }, this); + } + } + return this.spinner; + } + +}); + +Element.Properties.spinner = { + + set: function(options){ + var spinner = this.retrieve('spinner'); + if (spinner) spinner.destroy(); + return this.eliminate('spinner').store('spinner:options', options); + }, + + get: function(){ + var spinner = this.retrieve('spinner'); + if (!spinner){ + spinner = new Spinner(this, this.retrieve('spinner:options')); + this.store('spinner', spinner); + } + return spinner; + } + +}; + +Element.implement({ + + spin: function(options){ + if (options) this.set('spinner', options); + this.get('spinner').show(); + return this; + }, + + unspin: function(){ + this.get('spinner').hide(); + return this; + } + +}); + diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Alert.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Alert.js new file mode 100644 index 00000000000..cd97df42255 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Alert.js @@ -0,0 +1,18 @@ +/* +--- + +name: Behavior.BS.Alert + +description: This file just depends on the Fx.Reveal delegator in More-Behaviors to ensure you get it if you load the entire Bootstrap JS package. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - More-Behaviors/Delegator.Nix + +provides: [Behavior.BS.Alert] + +... +*/ \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Dropdown.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Dropdown.js new file mode 100644 index 00000000000..b3f362b3847 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Dropdown.js @@ -0,0 +1,27 @@ +/* +--- + +name: Behavior.BS.Dropdown + +description: Instantiates Bootstrap.Dropdown based on HTML markup. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - Behavior/Behavior + - Bootstrap.Dropdown + +provides: [Behavior.BS.Dropdown] + +... +*/ +Behavior.addGlobalFilters({ + 'BS.Dropdown': { + returns: Bootstrap.Dropdown, + setup: function(el, api){ + return new Bootstrap.Dropdown(el); + } + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.FormValidator.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.FormValidator.js new file mode 100644 index 00000000000..37b642be45d --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.FormValidator.js @@ -0,0 +1,68 @@ +/* +--- + +name: Behavior.BS.FormValidator + +description: Integrates FormValidator behavior into Bootstrap. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - More-Behaviors/Behavior.FormValidator + +provides: [Behavior.BS.FormValidator] + +... +*/ + +Behavior.addGlobalPlugin("FormValidator", "BS.FormValidator", { + setup: function(element, api, instance){ + var original = { + showError: instance.showError, + hideError: instance.hideError + }; + instance.setOptions({ + showError: function(){}, + hideError: function(){} + }); + instance.warningPrefix = ''; + instance.errorPrefix = ''; + instance.addEvents({ + showAdvice: function(field, advice, className){ + var inputParent = field.getParent('.input'), + clearfixParent = inputParent.getParent('.clearfix'); + if (!inputParent || !clearfixParent){ + original.showError(advice); + } else { + field.addClass('error'); + var help = inputParent.getElement('div.advice'); + if (!help){ + inputParent.getElements('span.help-inline').setStyle('display', 'none'); + help = new Element('span.help-inline.advice.auto-created', { + html: advice.get('html') + }).inject(inputParent); + } + help.removeClass('hide'); + help.set('title', advice.get('html')); + clearfixParent.addClass('error'); + } + }, + hideAdvice: function(field, advice, className){ + var inputParent = field.getParent('.input'), + clearfixParent = inputParent.getParent('.clearfix'); + if (!inputParent || !clearfixParent){ + original.hideError(advice); + } else { + field.removeClass('error'); + var help = inputParent.getElement('span.advice'); + if (help.hasClass('auto-created')) help.destroy(); + else help.set('html', ''); + inputParent.getElements('span.help-inline').setStyle('display', ''); + clearfixParent.removeClass('error'); + } + } + }); + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popover.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popover.js new file mode 100644 index 00000000000..43a6cb4a734 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popover.js @@ -0,0 +1,55 @@ +/* +--- + +name: Behavior.BS.Popover + +description: Instantiates Bootstrap.Popover based on HTML markup. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - /Bootstrap.Popover + - Behavior/Behavior + - More/Object.Extras + +provides: [Behavior.BS.Popover] + +... +*/ +Behavior.addGlobalFilters({ + 'BS.Popover': { + defaults: { + onOverflow: false, + location: 'right', //below, left, right + animate: true, + delayIn: 200, + delayOut: 0, + offset: 10, + trigger: 'hover' //focus, manual + }, + delayUntil: 'mouseover,focus', + returns: Bootstrap.Popover, + setup: function(el, api){ + var options = Object.cleanValues( + api.getAs({ + onOverflow: Boolean, + location: String, + animate: Boolean, + delayIn: Number, + delayOut: Number, + html: Boolean, + offset: Number, + trigger: String + }) + ); + options.getContent = Function.from(api.get('content')); + options.getTitle = Function.from(api.get('title') || el.get('title')); + var tip = new Bootstrap.Popover(el, options); + if (api.event) tip._enter(); + api.onCleanup(tip.destroy.bind(tip)); + return tip; + } + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.FormRequest.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.FormRequest.js new file mode 100644 index 00000000000..29b770a417b --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.FormRequest.js @@ -0,0 +1,43 @@ +/* +--- + +name: Behavior.BS.Popup.FormRequest + +description: Integrates FormRequest behavior into Popups. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - /Behavior.BS.Popup + - More/Form.Request + +provides: [Behavior.BS.Popup.FormRequest] + +... +*/ + +Behavior.addGlobalPlugin("FormRequest", "Popup.FormRequest", { + defaults: { + closeOnSuccess: true + }, + setup: function(element, api, instance){ + if (element.getParent('.modal')){ + var dismissed; + var dismissals = element.getElements('input.dismiss, input.close').map(function(el){ + return el.addEvent('click', function(){ + dismissed = true; + }).removeClass('dismiss').removeClass('close'); + }); + instance.addEvents({ + success: function(){ + var formRequestAPI = new BehaviorAPI(element, 'formrequest'); + if (formRequestAPI.getAs(Boolean, 'closeOnSuccess') !== false || api.get(Boolean, 'closeOnSuccess') !== false || dismissed){ + element.getParent('.modal').getBehaviorResult('BS.Popup').hide(); + } + } + }); + } + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.js new file mode 100644 index 00000000000..1e5c087c8de --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Popup.js @@ -0,0 +1,54 @@ +/* +--- + +name: Behavior.Popup + +description: Creates a bootstrap popup based on HTML markup. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - Behavior/Behavior + - More/Object.Extras + - Bootstrap.Popup + +provides: [Behavior.BS.Popup] + +... +*/ + +Behavior.addGlobalFilters({ + 'BS.Popup': { + defaults: { + hide: false, + animate: true, + closeOnEsc: true, + closeOnClickOut: true, + mask: true, + persist: true + }, + returns: Bootstrap.Popup, + setup: function(el, api){ + var popup = new Bootstrap.Popup(el, + Object.cleanValues( + api.getAs({ + persist: Boolean, + animate: Boolean, + closeOnEsc: Boolean, + closeOnClickOut: Boolean, + mask: Boolean + }) + ) + ); + popup.addEvent('destroy', function(){ + api.cleanup(el); + }); + if (!el.hasClass('hide') && !api.getAs(Boolean, 'hide') && (!el.hasClass('in') && !el.hasClass('fade'))) { + popup.show(); + } + return popup; + } + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Tabs.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Tabs.js new file mode 100644 index 00000000000..13cb7109b3d --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Tabs.js @@ -0,0 +1,36 @@ +/* +--- + +name: Behavior.BS.Tabs + +description: Instantiates Bootstrap.Tabs based on HTML markup. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - Behavior/Behavior + - Clientcide/Behavior.Tabs + +provides: [Behavior.BS.Tabs] + +... +*/ +(function(){ + + var tabs = Object.clone(Behavior.getFilter('Tabs')); + + Behavior.addGlobalFilters({ + 'BS.Tabs': tabs.config + }); + + Behavior.setFilterDefaults('BS.Tabs', { + 'tabs-selector': '>li', + 'sections-selector': '+.tab-content >', + 'selectedClass': 'active', + smooth: false, + smoothSize: false + }); + +})(); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Twipsy.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Twipsy.js new file mode 100644 index 00000000000..5386b282c7c --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.BS.Twipsy.js @@ -0,0 +1,56 @@ +/* +--- + +name: Behavior.BS.Twipsy + +description: Instantiates Bootstrap.Twipsy based on HTML markup. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - /Bootstrap.Twipsy + - Behavior/Behavior + - More/Object.Extras + +provides: [Behavior.BS.Twipsy] + +... +*/ +Behavior.addGlobalFilters({ + 'BS.Twipsy': { + defaults: { + location: 'above', //below, left, right + animate: true, + delayIn: 200, + delayOut: 0, + onOverflow: false, + offset: 0, + trigger: 'hover' //focus, manual + }, + delayUntil: 'mouseover,focus', + returns: Bootstrap.Twipsy, + setup: function(el, api){ + var options = Object.cleanValues( + api.getAs({ + onOverflow: Boolean, + location: String, + animate: Boolean, + delayIn: Number, + delayOut: Number, + fallback: String, + override: String, + html: Boolean, + offset: Number, + trigger: String + }) + ); + options.getTitle = Function.from(api.get('content') || el.get('title')); + var tip = new Bootstrap.Twipsy(el, options); + api.onCleanup(tip.destroy.bind(tip)); + if (api.event) tip.show(); + return tip; + } + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.js new file mode 100644 index 00000000000..e9d1e132ff4 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/behaviors/Behavior.js @@ -0,0 +1,688 @@ + +// MooTools: the javascript framework. +// Load this file's selection again by visiting: http://mootools.net/more/7484fe5b0f7c444957a2413054e72008 +// Or build this file again with packager using: packager build More/Table +/* +--- +name: Table +description: LUA-Style table implementation. +license: MIT-style license +authors: + - Valerio Proietti +requires: [Core/Array] +provides: [Table] +... +*/ + +(function(){ + +var Table = this.Table = function(){ + + this.length = 0; + var keys = [], + values = []; + + this.set = function(key, value){ + var index = keys.indexOf(key); + if (index == -1){ + var length = keys.length; + keys[length] = key; + values[length] = value; + this.length++; + } else { + values[index] = value; + } + return this; + }; + + this.get = function(key){ + var index = keys.indexOf(key); + return (index == -1) ? null : values[index]; + }; + + this.erase = function(key){ + var index = keys.indexOf(key); + if (index != -1){ + this.length--; + keys.splice(index, 1); + return values.splice(index, 1)[0]; + } + return null; + }; + + this.each = this.forEach = function(fn, bind){ + for (var i = 0, l = this.length; i < l; i++) fn.call(bind, keys[i], values[i], this); + }; + +}; + +if (this.Type) new Type('Table', Table); + +})(); + + +// Begin: Source/BehaviorAPI.js +/* +--- +name: BehaviorAPI +description: HTML getters for Behavior's API model. +requires: [Core/Class, /Element.Data] +provides: [BehaviorAPI] +... +*/ + + +(function(){ + //see Docs/BehaviorAPI.md for documentation of public methods. + + var reggy = /[^a-z0-9\-]/gi; + + window.BehaviorAPI = new Class({ + element: null, + prefix: '', + defaults: {}, + + initialize: function(element, prefix){ + this.element = element; + this.prefix = prefix.toLowerCase().replace('.', '-', 'g').replace(reggy, ''); + }, + + /****************** + * PUBLIC METHODS + ******************/ + + get: function(/* name[, name, name, etc] */){ + if (arguments.length > 1) return this._getObj(Array.from(arguments)); + return this._getValue(arguments[0]); + }, + + getAs: function(/*returnType, name, defaultValue OR {name: returnType, name: returnType, etc}*/){ + if (typeOf(arguments[0]) == 'object') return this._getValuesAs.apply(this, arguments); + return this._getValueAs.apply(this, arguments); + }, + + require: function(/* name[, name, name, etc] */){ + for (var i = 0; i < arguments.length; i++){ + if (this._getValue(arguments[i]) == undefined) throw new Error('Could not retrieve ' + this.prefix + '-' + arguments[i] + ' option from element.'); + } + return this; + }, + + requireAs: function(returnType, name /* OR {name: returnType, name: returnType, etc}*/){ + var val; + if (typeOf(arguments[0]) == 'object'){ + for (var objName in arguments[0]){ + val = this._getValueAs(arguments[0][objName], objName); + if (val === undefined || val === null) throw new Error("Could not retrieve " + this.prefix + '-' + objName + " option from element."); + } + } else { + val = this._getValueAs(returnType, name); + if (val === undefined || val === null) throw new Error("Could not retrieve " + this.prefix + '-' + name + " option from element."); + } + return this; + }, + + setDefault: function(name, value /* OR {name: value, name: value, etc }*/){ + if (typeOf(arguments[0]) == 'object'){ + for (var objName in arguments[0]){ + this.setDefault(objName, arguments[0][objName]); + } + return; + } + name = name.camelCase(); + this.defaults[name] = value; + if (this._getValue(name) == null){ + var options = this._getOptions(); + options[name] = value; + } + return this; + }, + + refreshAPI: function(){ + delete this.options; + this.setDefault(this.defaults); + return; + }, + + /****************** + * PRIVATE METHODS + ******************/ + + //given an array of names, returns an object of key/value pairs for each name + _getObj: function(names){ + var obj = {}; + names.each(function(name){ + var value = this._getValue(name); + if (value !== undefined) obj[name] = value; + }, this); + return obj; + }, + //gets the data-behaviorname-options object and parses it as JSON + _getOptions: function(){ + if (!this.options){ + var options = this.element.getData(this.prefix + '-options', '{}'); + if (options && options.substring(0,1) != '{') options = '{' + options + '}'; + var isSecure = JSON.isSecure(options); + if (!isSecure) throw new Error('warning, options value for element is not parsable, check your JSON format for quotes, etc.'); + this.options = isSecure ? JSON.decode(options) : {}; + for (option in this.options) { + this.options[option.camelCase()] = this.options[option]; + } + } + return this.options; + }, + //given a name (string) returns the value for it + _getValue: function(name){ + name = name.camelCase(); + var options = this._getOptions(); + if (!options.hasOwnProperty(name)){ + var inline = this.element.getData(this.prefix + '-' + name.hyphenate()); + if (inline) options[name] = inline; + } + return options[name]; + }, + //given a Type and a name (string) returns the value for it coerced to that type if possible + //else returns the defaultValue or null + _getValueAs: function(returnType, name, defaultValue){ + var value = this._getValue(name); + if (value == null || value == undefined) return defaultValue; + var coerced = this._coerceFromString(returnType, value); + if (coerced == null) throw new Error("Could not retrieve value '" + name + "' as the specified type. Its value is: " + value); + return coerced; + }, + //given an object of name/Type pairs, returns those as an object of name/value (as specified Type) pairs + _getValuesAs: function(obj){ + var returnObj = {}; + for (var name in obj){ + returnObj[name] = this._getValueAs(obj[name], name); + } + return returnObj; + }, + //attempts to run a value through the JSON parser. If the result is not of that type returns null. + _coerceFromString: function(toType, value){ + if (typeOf(value) == 'string' && toType != String){ + if (JSON.isSecure(value)) value = JSON.decode(value); + } + if (instanceOf(value, toType)) return value; + return null; + } + }); + +})(); + + +// Begin: Source/Behavior.js +/* +--- +name: Behavior +description: Auto-instantiates widgets/classes based on parsed, declarative HTML. +requires: [Core/Class.Extras, Core/Element.Event, Core/Selectors, More/Table, /Element.Data, /BehaviorAPI] +provides: [Behavior] +... +*/ + +(function(){ + + var getLog = function(method){ + return function(){ + if (window.console && console[method]){ + if(console[method].apply) console[method].apply(console, arguments); + else console[method](Array.from(arguments).join(' ')); + } + }; + }; + + var PassMethods = new Class({ + //pass a method pointer through to a filter + //by default the methods for add/remove events are passed to the filter + //pointed to this instance of behavior. you could use this to pass along + //other methods to your filters. For example, a method to close a popup + //for filters presented inside popups. + passMethod: function(method, fn){ + if (this.API.prototype[method]) throw new Error('Cannot overwrite API method ' + method + ' as it already exists'); + this.API.implement(method, fn); + return this; + }, + + passMethods: function(methods){ + for (method in methods) this.passMethod(method, methods[method]); + return this; + } + + }); + + var spaceOrCommaRegex = /\s*,\s*|\s+/g; + + BehaviorAPI.implement({ + deprecate: function(deprecated, asJSON){ + var set, + values = {}; + Object.each(deprecated, function(prop, key){ + var value = this.element[ asJSON ? 'getJSONData' : 'getData'](prop); + if (value !== undefined){ + set = true; + values[key] = value; + } + }, this); + this.setDefault(values); + return this; + } + }); + + this.Behavior = new Class({ + + Implements: [Options, Events, PassMethods], + + options: { + //by default, errors thrown by filters are caught; the onError event is fired. + //set this to *true* to NOT catch these errors to allow them to be handled by the browser. + // breakOnErrors: false, + // container: document.body, + + //default error behavior when a filter cannot be applied + onError: getLog('error'), + onWarn: getLog('warn'), + enableDeprecation: true, + selector: '[data-behavior]' + }, + + initialize: function(options){ + this.setOptions(options); + this.API = new Class({ Extends: BehaviorAPI }); + this.passMethods({ + addEvent: this.addEvent.bind(this), + removeEvent: this.removeEvent.bind(this), + addEvents: this.addEvents.bind(this), + removeEvents: this.removeEvents.bind(this), + fireEvent: this.fireEvent.bind(this), + applyFilters: this.apply.bind(this), + applyFilter: this.applyFilter.bind(this), + getContentElement: this.getContentElement.bind(this), + cleanup: this.cleanup.bind(this), + getContainerSize: function(){ + return this.getContentElement().measure(function(){ + return this.getSize(); + }); + }.bind(this), + error: function(){ this.fireEvent('error', arguments); }.bind(this), + fail: function(){ + var msg = Array.join(arguments, ' '); + throw new Error(msg); + }, + warn: function(){ + this.fireEvent('warn', arguments); + }.bind(this) + }); + }, + + getContentElement: function(){ + return this.options.container || document.body; + }, + + //Applies all the behavior filters for an element. + //container - (element) an element to apply the filters registered with this Behavior instance to. + //force - (boolean; optional) passed through to applyFilter (see it for docs) + apply: function(container, force){ + this._getElements(container).each(function(element){ + var plugins = []; + element.getBehaviors().each(function(name){ + var filter = this.getFilter(name); + if (!filter){ + this.fireEvent('error', ['There is no filter registered with this name: ', name, element]); + } else { + var config = filter.config; + if (config.delay !== undefined){ + this.applyFilter.delay(filter.config.delay, this, [element, filter, force]); + } else if(config.delayUntil){ + this._delayFilterUntil(element, filter, force); + } else if(config.initializer){ + this._customInit(element, filter, force); + } else { + plugins.append(this.applyFilter(element, filter, force, true)); + } + } + }, this); + plugins.each(function(plugin){ plugin(); }); + }, this); + return this; + }, + + _getElements: function(container){ + if (typeOf(this.options.selector) == 'function') return this.options.selector(container); + else return document.id(container).getElements(this.options.selector); + }, + + //delays a filter until the event specified in filter.config.delayUntil is fired on the element + _delayFilterUntil: function(element, filter, force){ + var events = filter.config.delayUntil.split(','), + attached = {}, + inited = false; + var clear = function(){ + events.each(function(event){ + element.removeEvent(event, attached[event]); + }); + clear = function(){}; + }; + events.each(function(event){ + var init = function(e){ + clear(); + if (inited) return; + inited = true; + var setup = filter.setup; + filter.setup = function(element, api, _pluginResult){ + api.event = e; + return setup.apply(filter, [element, api, _pluginResult]); + }; + this.applyFilter(element, filter, force); + filter.setup = setup; + }.bind(this); + element.addEvent(event, init); + attached[event] = init; + }, this); + }, + + //runs custom initiliazer defined in filter.config.initializer + _customInit: function(element, filter, force){ + var api = new this.API(element, filter.name); + api.runSetup = this.applyFilter.pass([element, filter, force], this); + filter.config.initializer(element, api); + }, + + //Applies a specific behavior to a specific element. + //element - the element to which to apply the behavior + //filter - (object) a specific behavior filter, typically one registered with this instance or registered globally. + //force - (boolean; optional) apply the behavior to each element it matches, even if it was previously applied. Defaults to *false*. + //_returnPlugins - (boolean; optional; internal) if true, plugins are not rendered but instead returned as an array of functions + //_pluginTargetResult - (obj; optional internal) if this filter is a plugin for another, this is whatever that target filter returned + // (an instance of a class for example) + applyFilter: function(element, filter, force, _returnPlugins, _pluginTargetResult){ + var pluginsToReturn = []; + if (this.options.breakOnErrors){ + pluginsToReturn = this._applyFilter.apply(this, arguments); + } else { + try { + pluginsToReturn = this._applyFilter.apply(this, arguments); + } catch (e){ + this.fireEvent('error', ['Could not apply the behavior ' + filter.name, e]); + } + } + return _returnPlugins ? pluginsToReturn : this; + }, + + //see argument list above for applyFilter + _applyFilter: function(element, filter, force, _returnPlugins, _pluginTargetResult){ + var pluginsToReturn = []; + element = document.id(element); + //get the filters already applied to this element + var applied = getApplied(element); + //if this filter is not yet applied to the element, or we are forcing the filter + if (!applied[filter.name] || force){ + //if it was previously applied, garbage collect it + if (applied[filter.name]) applied[filter.name].cleanup(element); + var api = new this.API(element, filter.name); + + //deprecated + api.markForCleanup = filter.markForCleanup.bind(filter); + api.onCleanup = function(fn){ + filter.markForCleanup(element, fn); + }; + + if (filter.config.deprecated && this.options.enableDeprecation) api.deprecate(filter.config.deprecated); + if (filter.config.deprecateAsJSON && this.options.enableDeprecation) api.deprecate(filter.config.deprecatedAsJSON, true); + + //deal with requirements and defaults + if (filter.config.requireAs){ + api.requireAs(filter.config.requireAs); + } else if (filter.config.require){ + api.require.apply(api, Array.from(filter.config.require)); + } + + if (filter.config.defaults) api.setDefault(filter.config.defaults); + + //apply the filter + var result = filter.setup(element, api, _pluginTargetResult); + if (filter.config.returns && !instanceOf(result, filter.config.returns)){ + throw new Error("Filter " + filter.name + " did not return a valid instance."); + } + element.store('Behavior Filter result:' + filter.name, result); + //and mark it as having been previously applied + applied[filter.name] = filter; + //apply all the plugins for this filter + var plugins = this.getPlugins(filter.name); + if (plugins){ + for (var name in plugins){ + if (_returnPlugins){ + pluginsToReturn.push(this.applyFilter.pass([element, plugins[name], force, null, result], this)); + } else { + this.applyFilter(element, plugins[name], force, null, result); + } + } + } + } + return pluginsToReturn; + }, + + //given a name, returns a registered behavior + getFilter: function(name){ + return this._registered[name] || Behavior.getFilter(name); + }, + + getPlugins: function(name){ + return this._plugins[name] || Behavior._plugins[name]; + }, + + //Garbage collects all applied filters for an element and its children. + //element - (*element*) container to cleanup + //ignoreChildren - (*boolean*; optional) if *true* only the element will be cleaned, otherwise the element and all the + // children with filters applied will be cleaned. Defaults to *false*. + cleanup: function(element, ignoreChildren){ + element = document.id(element); + var applied = getApplied(element); + for (var filter in applied){ + applied[filter].cleanup(element); + element.eliminate('Behavior Filter result:' + filter); + delete applied[filter]; + } + if (!ignoreChildren) this._getElements(element).each(this.cleanup, this); + return this; + } + + }); + + //Export these for use elsewhere (notabily: Delegator). + Behavior.getLog = getLog; + Behavior.PassMethods = PassMethods; + + + //Returns the applied behaviors for an element. + var getApplied = function(el){ + return el.retrieve('_appliedBehaviors', {}); + }; + + //Registers a behavior filter. + //name - the name of the filter + //fn - a function that applies the filter to the given element + //overwrite - (boolean) if true, will overwrite existing filter if one exists; defaults to false. + var addFilter = function(name, fn, overwrite){ + if (!this._registered[name] || overwrite) this._registered[name] = new Behavior.Filter(name, fn); + else throw new Error('Could not add the Behavior filter "' + name +'" as a previous trigger by that same name exists.'); + }; + + var addFilters = function(obj, overwrite){ + for (var name in obj){ + addFilter.apply(this, [name, obj[name], overwrite]); + } + }; + + //Registers a behavior plugin + //filterName - (*string*) the filter (or plugin) this is a plugin for + //name - (*string*) the name of this plugin + //setup - a function that applies the filter to the given element + var addPlugin = function(filterName, name, setup, overwrite){ + if (!this._plugins[filterName]) this._plugins[filterName] = {}; + if (!this._plugins[filterName][name] || overwrite) this._plugins[filterName][name] = new Behavior.Filter(name, setup); + else throw new Error('Could not add the Behavior filter plugin "' + name +'" as a previous trigger by that same name exists.'); + }; + + var addPlugins = function(obj, overwrite){ + for (var name in obj){ + addPlugin.apply(this, [obj[name].fitlerName, obj[name].name, obj[name].setup], overwrite); + } + }; + + var setFilterDefaults = function(name, defaults){ + var filter = this.getFilter(name); + if (!filter.config.defaults) filter.config.defaults = {}; + Object.append(filter.config.defaults, defaults); + }; + + //Add methods to the Behavior namespace for global registration. + Object.append(Behavior, { + _registered: {}, + _plugins: {}, + addGlobalFilter: addFilter, + addGlobalFilters: addFilters, + addGlobalPlugin: addPlugin, + addGlobalPlugins: addPlugins, + setFilterDefaults: setFilterDefaults, + getFilter: function(name){ + return this._registered[name]; + } + }); + //Add methods to the Behavior class for instance registration. + Behavior.implement({ + _registered: {}, + _plugins: {}, + addFilter: addFilter, + addFilters: addFilters, + addPlugin: addPlugin, + addPlugins: addPlugins, + setFilterDefaults: setFilterDefaults + }); + + //This class is an actual filter that, given an element, alters it with specific behaviors. + Behavior.Filter = new Class({ + + config: { + /** + returns: Foo, + require: ['req1', 'req2'], + //or + requireAs: { + req1: Boolean, + req2: Number, + req3: String + }, + defaults: { + opt1: false, + opt2: 2 + }, + //simple example: + setup: function(element, API){ + var kids = element.getElements(API.get('selector')); + //some validation still has to occur here + if (!kids.length) API.fail('there were no child elements found that match ', API.get('selector')); + if (kids.length < 2) API.warn("there weren't more than 2 kids that match", API.get('selector')); + var fooInstance = new Foo(kids, API.get('opt1', 'opt2')); + API.onCleanup(function(){ + fooInstance.destroy(); + }); + return fooInstance; + }, + delayUntil: 'mouseover', + //OR + delay: 100, + //OR + initializer: function(element, API){ + element.addEvent('mouseover', API.runSetup); //same as specifying event + //or + API.runSetup.delay(100); //same as specifying delay + //or something completely esoteric + var timer = (function(){ + if (element.hasClass('foo')){ + clearInterval(timer); + API.runSetup(); + } + }).periodical(100); + //or + API.addEvent('someBehaviorEvent', API.runSetup); + }); + */ + }, + + //Pass in an object with the following properties: + //name - the name of this filter + //setup - a function that applies the filter to the given element + initialize: function(name, setup){ + this.name = name; + if (typeOf(setup) == "function"){ + this.setup = setup; + } else { + Object.append(this.config, setup); + this.setup = this.config.setup; + } + this._cleanupFunctions = new Table(); + }, + + //Stores a garbage collection pointer for a specific element. + //Example: if your filter enhances all the inputs in the container + //you might have a function that removes that enhancement for garbage collection. + //You would mark each input matched with its own cleanup function. + //NOTE: this MUST be the element passed to the filter - the element with this filters + // name in its data-behavior property. I.E.: + //
    + // + //
    + //If this filter is FormValidator, you can mark the form for cleanup, but not, for example + //the input. Only elements that match this filter can be marked. + markForCleanup: function(element, fn){ + var functions = this._cleanupFunctions.get(element); + if (!functions) functions = []; + functions.include(fn); + this._cleanupFunctions.set(element, functions); + return this; + }, + + //Garbage collect a specific element. + //NOTE: this should be an element that has a data-behavior property that matches this filter. + cleanup: function(element){ + var marks = this._cleanupFunctions.get(element); + if (marks){ + marks.each(function(fn){ fn(); }); + this._cleanupFunctions.erase(element); + } + return this; + } + + }); + + Behavior.elementDataProperty = 'behavior'; + + Element.implement({ + + addBehaviorFilter: function(name){ + return this.setData(Behavior.elementDataProperty, this.getBehaviors().include(name).join(' ')); + }, + + removeBehaviorFilter: function(name){ + return this.setData(Behavior.elementDataProperty, this.getBehaviors().erase(name).join(' ')); + }, + + getBehaviors: function(){ + var filters = this.getData(Behavior.elementDataProperty); + if (!filters) return []; + return filters.trim().split(spaceOrCommaRegex); + }, + + hasBehavior: function(name){ + return this.getBehaviors().contains(name); + }, + + getBehaviorResult: function(name){ + return this.retrieve('Behavior Filter result:' + name); + } + + }); + + +})(); diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Dropdown.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Dropdown.js new file mode 100644 index 00000000000..a96b00f25db --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Dropdown.js @@ -0,0 +1,70 @@ +/* +--- + +name: Bootstrap.Dropdown + +description: A simple dropdown menu that works with the Twitter Bootstrap css framework. + +license: MIT-style license. + +authors: [Aaron Newton] + +requires: + - /Bootstrap + - Core/Element.Event + - More/Element.Shortcuts + +provides: Bootstrap.Dropdown + +... +*/ +Bootstrap.Dropdown = new Class({ + + Implements: [Options, Events], + + options: { + /* + onShow: function(element){}, + onHide: function(elements){}, + */ + ignore: 'input, select, label' + }, + + initialize: function(container, options){ + this.element = document.id(container); + this.setOptions(options); + this.boundHandle = this._handle.bind(this); + document.id(document.body).addEvent('click', this.boundHandle); + }, + + hideAll: function(){ + var els = this.element.getElements('li.open').removeClass('open'); + this.fireEvent('hide', els); + return this; + }, + + show: function(subMenu){ + this.hideAll(); + this.fireEvent('show', subMenu); + subMenu.addClass('open'); + return this; + }, + + destroy: function(){ + this.hideAll(); + document.body.removeEvent('click', this.boundHandle); + return this; + }, + + // PRIVATE + + _handle: function(e){ + var el = e.target; + var open = el.getParent('li.open'); + if (!el.match(this.options.ignore) || !open) this.hideAll(); + if (this.element.contains(el) && (el.match('a.menu') || el.getParent('a.menu'))) { + e.preventDefault(); + if (!open) this.show(el.getParent('li')); + } + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Popover.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Popover.js new file mode 100644 index 00000000000..8c5247a433c --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Popover.js @@ -0,0 +1,58 @@ +/* +--- + +name: Bootstrap.Popover + +description: A simple tooltip (yet larger than twipsy) implementation that works with the Twitter Bootstrap css framework. + +authors: [Aaron Newton] + +license: MIT-style license. + +requires: + - /Bootstrap.Twipsy + +provides: Bootstrap.Popover + +... +*/ + +Bootstrap.Popover = new Class({ + + Extends: Bootstrap.Twipsy, + + options: { + location: 'right', + offset: 10, + getTitle: function(el){ + return el.get(this.options.title); + }, + content: 'data-content', + getContent: function(el){ + return el.get(this.options.content); + } + }, + + _makeTip: function(){ + if (!this.tip){ + this.tip = new Element('div.popover').addClass(this.options.location) + .adopt(new Element('div.arrow')) + .adopt( + new Element('div.inner').adopt( + new Element('h3.title', { html: this.options.getTitle.apply(this, [this.element]) || this.options.fallback }) + ).adopt( + new Element('div.content').adopt( + new Element('p', { html: this.options.getContent.apply(this, [this.element])}) + ) + ) + ); + if (this.options.animate) this.tip.addClass('fade'); + if (Browser.Features.cssTransition && this.tip.addEventListener){ + this.tip.addEventListener(Browser.Features.transitionEnd, this.bound.complete); + } + this.element.set('alt', '').set('title', ''); + } + return this.tip; + } + +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Popup.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Popup.js new file mode 100644 index 00000000000..2b68f73eb49 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Popup.js @@ -0,0 +1,170 @@ +/* +--- + +name: Popup + +description: A simple Popup class for the Twitter Bootstrap CSS framework. + +authors: [Aaron Newton] + +license: MIT-style license. + +requires: + - Core/Element.Delegation + - Core/Fx.Tween + - Core/Fx.Transitions + - More/Mask + - More/Elements.From + - More/Element.Position + - More/Element.Shortcuts + - More/Events.Pseudos + - /CSSEvents + - /Bootstrap + +provides: [Bootstrap.Popup] + +... +*/ + +Bootstrap.Popup = new Class({ + + Implements: [Options, Events], + + options: { + /* + onShow: function(){}, + onHide: function(){}, + animate: function(){}, + destroy: function(){}, + */ + persist: true, + closeOnClickOut: true, + closeOnEsc: true, + mask: true, + animate: true + }, + + initialize: function(element, options){ + + this.element = document.id(element).store('Bootstrap.Popup', this); + this.setOptions(options); + this.bound = { + hide: this.hide.bind(this), + bodyClick: function(e){ + if (!this.element.contains(e.target)){ + this.hide(); + } + }.bind(this), + keyMonitor: function(e){ + if (e.key == 'esc') this.hide(); + }.bind(this), + animationEnd: this._animationEnd.bind(this) + }; + if ((this.element.hasClass('fade') && this.element.hasClass('in')) || + (!this.element.hasClass('hide') && !this.element.hasClass('fade'))){ + if (this.element.hasClass('fade')) this.element.removeClass('in'); + this.show(); + } + }, + + _checkAnimate: function(){ + var check = this.options.animate !== false && Browser.Features.getCSSTransition() && (this.options.animate || this.element.hasClass('fade')); + if (!check) { + this.element.removeClass('fade').addClass('hide'); + this._mask.removeClass('fade').addClass('hide'); + } else if (check) { + this.element.addClass('fade').removeClass('hide'); + this._mask.addClass('fade').removeClass('hide'); + } + return check; + }, + + show: function(){ + if (this.visible || this.animating) return; + this.element.addEvent('click:relay(.close, .dismiss)', this.bound.hide); + if (this.options.closeOnEsc) document.addEvent('keyup', this.bound.keyMonitor); + this._makeMask(); + this._mask.inject(document.body); + this.animating = true; + if (this._checkAnimate()){ + this.element.offsetWidth; // force reflow + this.element.addClass('in'); + this._mask.addClass('in'); + } else { + this.element.show(); + this._mask.show(); + } + this.visible = true; + this._watch(); + }, + + _watch: function(){ + if (this._checkAnimate()) this.element.addEventListener(Browser.Features.getCSSTransition(), this.bound.animationEnd); + else this._animationEnd(); + }, + + _animationEnd: function(){ + if (Browser.Features.getCSSTransition()) this.element.removeEventListener(Browser.Features.getCSSTransition(), this.bound.animationEnd); + this.animating = false; + if (this.visible){ + this.fireEvent('show', this.element); + } else { + this.fireEvent('hide', this.element); + if (!this.options.persist){ + this.destroy(); + } else { + this._mask.dispose(); + } + } + }, + + destroy: function(){ + this._mask.destroy(); + this.fireEvent('destroy', this.element); + this.element.destroy(); + this._mask = null; + this.destroyed = true; + }, + + hide: function(event, clicked){ + if (!this.visible || this.animating) return; + this.animating = true; + if (event && clicked && clicked.hasClass('stopEvent')){ + event.preventDefault(); + } + document.id(document.body).removeEvent('click', this.bound.hide); + document.removeEvent('keyup', this.bound.keyMonitor); + this.element.removeEvent('click:relay(.close, .dismiss)', this.bound.hide); + + if (this._checkAnimate()){ + this.element.removeClass('in'); + this._mask.removeClass('in'); + this._mask.hide(); + } else { + this.element.hide(); + this._mask.hide(); + } + this.visible = false; + this._watch(); + }, + + // PRIVATE + + _makeMask: function(){ + if (this.options.mask){ + if (!this._mask){ + this._mask = new Element('div.modal-backdrop', { + events: { + click: this.bound.hide + } + }); + if (this._checkAnimate()){ + this._mask.addClass('fade'); + } + } + } else if (this.options.closeOnClickOut){ + document.id(document.body).addEvent('click', this.bound.hide); + } + } + +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Twipsy.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Twipsy.js new file mode 100644 index 00000000000..db03af7533f --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.Twipsy.js @@ -0,0 +1,183 @@ +/* +--- + +name: Bootstrap.Twipsy + +description: A simple tooltip implementation (twipsy) that works with the Twitter Bootstrap css framework. + +authors: [Aaron Newton] + +license: MIT-style license. + +requires: + - /Bootstrap + - /CSSEvents + - More/Element.Position + - Behavior/Behavior + +provides: Bootstrap.Twipsy + +... +*/ + +Bootstrap.Twipsy = new Class({ + + Implements: [Options, Events], + + options: { + location: 'above', //below, left, right + animate: true, + delayIn: 200, + delayOut: 0, + fallback: '', + override: '', + onOverflow: false, + offset: 0, + title: 'title', //element property + trigger: 'hover', //focus, manual + getContent: function(el){ + return el.get(this.options.title); + } + }, + + initialize: function(el, options){ + this.element = document.id(el); + this.setOptions(options); + this._attach(); + }, + + show: function(){ + this._clear(); + this._makeTip(); + var pos, edge, offset = {x: 0, y: 0}; + switch(this.options.location){ + case 'below': + pos = 'centerBottom'; + edge = 'centerTop'; + offset.y = this.options.offset; + break; + case 'left': + pos = 'centerLeft'; + edge = 'centerRight'; + offset.x = this.options.offset; + break; + case 'right': + pos = 'centerRight'; + edge = 'centerLeft'; + offset.x = this.options.offset; + break; + default: //top + pos = 'centerTop'; + edge = 'centerBottom'; + offset.y = this.options.offset; + } + if (typeOf(this.options.offset) == "object") offset = this.options.offset; + this.tip.inject(document.body).show().position({ + relativeTo: this.element, + position: pos, + edge: edge, + offset: offset + }).removeClass('out').addClass('in'); + this.visible = true; + if (!Browser.Features.cssTransition || !this.options.animate) this._complete(); + this.fireEvent('show'); + return this; + }, + + hide: function(){ + this._makeTip(); + this.tip.removeClass('in').addClass('out'); + this.visible = false; + if (!Browser.Features.cssTransition || !this.options.animate) this._complete(); + this.fireEvent('hide'); + return this; + }, + + destroy: function(){ + this._detach(); + if (this.tip) this.tip.destroy(); + this.destroyed = true; + return this; + }, + + // PRIVATE METHODS + + _makeTip: function(){ + if (!this.tip){ + this.tip = new Element('div.twipsy').addClass(this.options.location) + .adopt(new Element('div.twipsy-arrow')) + .adopt( + new Element('div.twipsy-inner', { + html: this.options.override || this.options.getContent.apply(this, [this.element]) || this.options.fallback + }) + ); + if (this.options.animate) this.tip.addClass('fade'); + if (Browser.Features.cssTransition && this.tip.addEventListener){ + this.tip.addEventListener(Browser.Features.transitionEnd, this.bound.complete); + } + this.element.set('alt', '').set('title', ''); + } + return this.tip; + }, + + _attach: function(method){ + method = method || 'addEvents'; + this.bound = { + enter: this._enter.bind(this), + leave: this._leave.bind(this), + complete: this._complete.bind(this) + }; + + if (this.options.trigger == 'hover') { + this.element[method]({ + mouseenter: this.bound.enter, + mouseleave: this.bound.leave + }); + } else if (this.options.trigger == 'focus'){ + this.element[method]({ + focus: this.bound.enter, + blur: this.bound.leave + }); + } + }, + + _detach: function(){ + this._attach('removeEvents'); + }, + + _clear: function(){ + clearTimeout(this._inDelay); + clearTimeout(this._outDelay); + }, + + _enter: function(){ + if (this.options.onOverflow){ + var scroll = this.element.getScrollSize(), + size = this.element.getSize(); + if (scroll.x <= size.x && scroll.y <= size.y) return; + } + this._clear(); + if (this.options.delayIn){ + this._inDelay = this.show.delay(this.options.delayIn, this); + } else { + this.show(); + } + }, + + _leave: function(){ + this._clear(); + if (this.options.delayOut){ + this._outDelay = this.hide.delay(this.options.delayOut, this); + } else { + this.hide(); + } + }, + + _complete: function(){ + if (!this.visible){ + this.tip.dispose(); + } + this.fireEvent('complete', this.visible); + } + +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.js new file mode 100644 index 00000000000..1d253e886d6 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Bootstrap.js @@ -0,0 +1,16 @@ +/* +--- + +name: Bootstrap + +description: The BootStrap namespace. + +authors: [Aaron Newton] + +license: MIT-style license. + +provides: [Bootstrap] + +... +*/ +var Bootstrap = {}; \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/CSSEvents.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/CSSEvents.js new file mode 100644 index 00000000000..81361cd8d8b --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/CSSEvents.js @@ -0,0 +1,38 @@ +/* +--- + +name: CSSEvents + +license: MIT-style + +authors: [Aaron Newton] + +requires: [Core/DomReady] + +provides: CSSEvents +... +*/ + +Browser.Features.getCSSTransition = function(){ + Browser.Features.cssTransition = (function () { + var thisBody = document.body || document.documentElement + , thisStyle = thisBody.style + , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; + return support; + })(); + + // set CSS transition event type + if ( Browser.Features.cssTransition ) { + Browser.Features.transitionEnd = "TransitionEnd"; + if ( Browser.safari || Browser.chrome ) { + Browser.Features.transitionEnd = "webkitTransitionEnd"; + } else if ( Browser.firefox ) { + Browser.Features.transitionEnd = "transitionend"; + } else if ( Browser.opera ) { + Browser.Features.transitionEnd = "oTransitionEnd"; + } + } + Browser.Features.getCSSTransition = Function.from(Browser.Features.transitionEnd); +}; + +window.addEvent("domready", Browser.Features.getCSSTransition); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Delegator.BS.ShowPopup.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Delegator.BS.ShowPopup.js new file mode 100644 index 00000000000..07fec4a4d2b --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/bootstrap/ui/Delegator.BS.ShowPopup.js @@ -0,0 +1,38 @@ +/* +--- + +name: Delegator.BS.ShowPopup + +description: Shows a hidden popup. + +authors: [Aaron Newton] + +license: MIT-style license. + +requires: + - Behavior/Delegator + - Behavior/Behavior + +provides: [Delegator.BS.ShowPopup] + +... +*/ + +(function(){ + + + + Delegator.register('click', 'BS.showPopup', { + + require: ['target'], + handler: function(event, link, api){ + var target = link.getElement(api.get('target')); + event.preventDefault(); + if (!target) api.fail('Could not find target element to activate: ', api.get('target')); + api.getBehavior().apply(target); + target.getBehaviorResult('BS.Popup').show(); + } + + }); + +})(); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/datepicker/datepicker.css b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/datepicker/datepicker.css new file mode 100644 index 00000000000..8479c746319 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/datepicker/datepicker.css @@ -0,0 +1,222 @@ +.datepicker { + position: absolute; + border: 2px solid #1C3262; + font-size: 11px; + width: 194px; + padding: 3px; + height: 221px; + background: #fff; + line-height: normal; + z-index: 10000; +} + +/* header +********************************************************/ +.datepicker .header { + position: relative; + background: #1C3262; + height: 21px; + padding-top: 4px; + margin-bottom: 3px; +} + +.datepicker .header .title { + text-align: center; + padding-top: 1px; + margin: 0px 42px 0 20px; +} + +.datepicker .header .titleText { + color: #fff; + font-weight: bold; +} +.datepicker .header .next, +.datepicker .header .previous, +.datepicker .header .closeButton { + position: absolute; + width: 15px; + height: 15px; + background: #fff; + text-align: center; + color: #666; + top: 5px; + cursor: pointer; +} +.datepicker .header .previous { + left: 5px; +} +.datepicker .header .next { + right: 28px; +} +.datepicker .header .closeButton { + right: 5px; +} + +/* body +********************************************************/ +.datepicker .body { + position: relative; + top: 0px; + left: 0px; + width: 194px; + border-right: 2px solid #fff; + height: 193px; + overflow: hidden; +} + +/* time +********************************************************/ +.datepicker .time { + width: 100%; + height: 100%; + background: #eee; +} + +.datepicker .time .hour, +.datepicker .time .separator, +.datepicker .time .minutes { + border: 1px solid #ccc; + background: #fff; + width: 50px; + font-size: 32px; + position: absolute; + top: 50px; + text-align: center; + padding: 2px; +} + +.datepicker .time .hour { + left: 30px; +} +.datepicker .time .separator { + background: transparent; + border: 0px; + width: 10px; + left: 91px; +} + +.datepicker .time .minutes { + left: 110px; +} +.datepicker .time .ok { + position: absolute; + top: 105px; + width: 136px; + left: 30px; + font-size: 20px; +} + +/* days-grid +********************************************************/ +.datepicker .days .day { + float: left; + background: #ccc; + cursor: pointer; + text-align: center; + padding-top: 4px; + width: 25px; + overflow: hidden; + height: 21px; + margin: 0 3px 3px 0; +} + +.datepicker .days .day0 { + margin-right: 0; +} + +.datepicker .days .week5 .day { + margin-bottom: 0; +} + +/* days-colors +********************************************************/ +.datepicker .days .title { + background: #5D6E95; + font-weight: bold; + color: #fff; + cursor: default; +} + +.datepicker .days .otherMonth { + background: #eee; + color: #aaa; +} + +/* months +********************************************************/ +.datepicker .months .month { + float: left; + background: #eee; + cursor: pointer; + text-align: center; + overflow: hidden; + width: 62px; + height: 31px; + padding-top: 15px; + margin: 0 3px 3px 0; +} + +.datepicker .months .month3, +.datepicker .months .month6, +.datepicker .months .month9, +.datepicker .months .month12 { + margin-right: 0; + width: 64px; +} + +.datepicker .months .month10, +.datepicker .months .month11, +.datepicker .months .month12 { + margin-bottom: 0; +} + +/* years +********************************************************/ +.datepicker .years .year { + float: left; + background: #eee; + cursor: pointer; + text-align: center; + padding-top: 11px; + width: 46px; + overflow: hidden; + height: 25px; + margin: 0 3px 3px 0; +} + +.datepicker .years .year3, +.datepicker .years .year7, +.datepicker .years .year11, +.datepicker .years .year15, +.datepicker .years .year19 { + margin-right: 0; + width: 47px; +} + +.datepicker .years .year16, +.datepicker .years .year17, +.datepicker .years .year18, +.datepicker .years .year19 { + margin-bottom: 0; + height: 26px; +} + +/* global +********************************************************/ +.datepicker .selected { + background: #8C929F !important; + color: #fff !important; +} + +.datepicker .unavailable { + background: #edd !important; + color: #b88 !important; + cursor: default !important; +} + +.datepicker .days .week .day:hover, +.datepicker .months .month:hover, +.datepicker .years .year:hover { + background: #5D6E95 !important; + color: #fff !important; +} \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/datepicker/datepicker.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/datepicker/datepicker.js new file mode 100644 index 00000000000..011e1b17f75 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/datepicker/datepicker.js @@ -0,0 +1,751 @@ +/** + * datepicker.js - MooTools Datepicker class + * @version 1.17 + * + * by MonkeyPhysics.com + * + * Source/Documentation available at: + * http://www.monkeyphysics.com/mootools/script/2/datepicker + * + * -- + * + * Smoothly animating, very configurable and easy to install. + * No Ajax, pure Javascript. 4 skins available out of the box. + * + * -- + * + * Some Rights Reserved + * http://creativecommons.org/licenses/by-sa/3.0/ + * + */ + +var $chk = function(obj){ + return !!(obj || obj === 0); +}; + +Function.implement({ + bindWithEvent: function(bind, args) { + var self = this; + if (args != null) args = Array.from(args); + return function(event) { + return self.apply(bind, (args == null) ? arguments : [event].concat(args)); + }; + } +}); + +var DatePicker = new Class({ + + Implements: [Options, Events], + + // working date, which we will keep modifying to render the calendars + d: '', + + // just so that we need not request it over and over + today: '', + + // current user-choice in date object format + choice: {}, + + // size of body, used to animate the sliding + bodysize: {}, + + // to check availability of next/previous buttons + limit: {}, + + // element references: + attachTo: null, // selector for target inputs + picker: null, // main datepicker container + slider: null, // slider that contains both oldContents and newContents, used to animate between 2 different views + oldContents: null, // used in animating from-view to new-view + newContents: null, // used in animating from-view to new-view + input: null, // original input element (used for input/output) + visual: null, // visible input (used for rendering) + + options: { + pickerClass: 'datepicker', + days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + dayShort: 2, + monthShort: 3, + startDay: 1, // Sunday (0) through Saturday (6) - be aware that this may affect your layout, since the days on the right might have a different margin + timePicker: false, + timePickerOnly: false, + yearPicker: true, + yearsPerPage: 20, + format: 'd-m-Y', + allowEmpty: false, + inputOutputFormat: 'U', // default to unix timestamp + animationDuration: 400, + useFadeInOut: !Browser.trident, // dont animate fade-in/fade-out for IE + startView: 'month', // allowed values: {time, month, year, decades} + positionOffset: { x: 0, y: 0 }, + minDate: null, // { date: '[date-string]', format: '[date-string-interpretation-format]' } + maxDate: null, // same as minDate + debug: false, + toggleElements: null + + // and some event hooks: + /* + onShow: function() {}, // triggered when the datepicker pops up + onClose: function() {}, // triggered after the datepicker is closed (destroyed) + onSelect: function() {} // triggered when a date is selected + */ + }, + + initialize: function(attachTo, options) { + this.attachTo = attachTo; + this.setOptions(options).attach(); + if (this.options.timePickerOnly) { + this.options.timePicker = true; + this.options.startView = 'time'; + } + this.formatMinMaxDates(); + document.addEvent('mousedown', this._close.bind(this)); + }, + + formatMinMaxDates: function() { + if (this.options.minDate && this.options.minDate.format) { + this.options.minDate = this.unformat(this.options.minDate.date, this.options.minDate.format); + } + if (this.options.maxDate && this.options.maxDate.format) { + this.options.maxDate = this.unformat(this.options.maxDate.date, this.options.maxDate.format); + this.options.maxDate.setHours(23); + this.options.maxDate.setMinutes(59); + this.options.maxDate.setSeconds(59); + } + }, + + attach: function() { + // toggle the datepicker through a separate element? + if ($chk(this.options.toggleElements)) { + var togglers = $$(this.options.toggleElements); + document.addEvents({ + 'keydown': function(e) { + if (e.key == "tab") { + this._close(null, true); + } + }.bind(this) + }); + }; + + // attach functionality to the inputs + $$(this.attachTo).each(function(item, index) { + + // never double attach + if (item.retrieve('datepicker')) return; + + // determine starting value(s) + if ($chk(item.get('value'))) { + var init_clone_val = this.format(new Date(this.unformat(item.get('value'), this.options.inputOutputFormat)), this.options.format); + } else if (!this.options.allowEmpty) { + var init_clone_val = this.format(new Date(), this.options.format); + } else { + var init_clone_val = ''; + } + + // create clone + var display = item.getStyle('display'); + var clone = item + .setStyle('display', this.options.debug ? display : 'none') + .store('datepicker', true) // to prevent double attachment... + .clone() + .store('datepicker', true) // ...even for the clone (!) + .removeProperty('name') // secure clean (form)submission + .setStyle('display', display) + .set('value', init_clone_val) + .inject(item, 'after'); + + // events + if ($chk(this.options.toggleElements)) { + togglers[index] + .setStyle('cursor', 'pointer') + .addEvents({ + 'click': function(e) { + this.onFocus(item, clone); + }.bind(this) + }); + clone.addEvents({ + 'blur': function() { + item.set('value', clone.get('value')); + } + }); + } else { + clone.addEvents({ + 'keydown': function(e) { + if (this.options.allowEmpty && (e.key == "delete" || e.key == "backspace")) { + item.set('value', ''); + e.target.set('value', ''); + this._close(null, true); + } else if (e.key == "tab") { + this._close(null, true); + } else { + e.stop(); + } + }.bind(this), + 'focus': function(e) { + this.onFocus(item, clone); + }.bind(this) + }); + } + }.bind(this)); + }, + + onFocus: function(original_input, visual_input) { + var init_visual_date, d = visual_input.getCoordinates(); + + if ($chk(original_input.get('value'))) { + init_visual_date = this.unformat(original_input.get('value'), this.options.inputOutputFormat).valueOf(); + } else { + init_visual_date = new Date(); + if ($chk(this.options.maxDate) && init_visual_date.valueOf() > this.options.maxDate.valueOf()) { + init_visual_date = new Date(this.options.maxDate.valueOf()); + } + if ($chk(this.options.minDate) && init_visual_date.valueOf() < this.options.minDate.valueOf()) { + init_visual_date = new Date(this.options.minDate.valueOf()); + } + } + + this._show({ left: d.left + this.options.positionOffset.x, top: d.top + d.height + this.options.positionOffset.y }, init_visual_date); + this.input = original_input; + this.visual = visual_input; + }, + + dateToObject: function(d) { + return { + year: d.getFullYear(), + month: d.getMonth(), + day: d.getDate(), + hours: d.getHours(), + minutes: d.getMinutes(), + seconds: d.getSeconds() + }; + }, + + dateFromObject: function(values) { + var d = new Date(); + d.setDate(1); + ['year', 'month', 'day', 'hours', 'minutes', 'seconds'].each(function(type) { + var v = values[type]; + if (!$chk(v)) return; + switch (type) { + case 'day': d.setDate(v); break; + case 'month': d.setMonth(v); break; + case 'year': d.setFullYear(v); break; + case 'hours': d.setHours(v); break; + case 'minutes': d.setMinutes(v); break; + case 'seconds': d.setSeconds(v); break; + } + }); + return d; + }, + + show: function() { + this.fireEvent('show') + }, + + _show: function(position, timestamp) { + this.formatMinMaxDates(); + if ($chk(timestamp)) { + this.d = new Date(timestamp); + } else { + this.d = new Date(); + } + this.today = new Date(); + this.choice = this.dateToObject(this.d); + this.mode = (this.options.startView == 'time' && !this.options.timePicker) ? 'month' : this.options.startView; + this.render(); + this.picker.setStyles(position); + this.show(); + }, + + render: function(fx) { + if (!$chk(this.picker)) { + this.constructPicker(); + } else { + // swap contents so we can fill the newContents again and animate + var o = this.oldContents; + this.oldContents = this.newContents; + this.newContents = o; + this.newContents.empty(); + } + + // remember current working date + var startDate = new Date(this.d.getTime()); + + // intially assume both left and right are allowed + this.limit = { right: false, left: false }; + + // render! booty! + if (this.mode == 'decades') { + this.renderDecades(); + } else if (this.mode == 'year') { + this.renderYear(); + } else if (this.mode == 'time') { + this.renderTime(); + this.limit = { right: true, left: true }; // no left/right in timeview + } else { + this.renderMonth(); + } + + this.picker.getElement('.previous').setStyle('visibility', this.limit.left ? 'hidden' : 'visible'); + this.picker.getElement('.next').setStyle('visibility', this.limit.right ? 'hidden' : 'visible'); + this.picker.getElement('.titleText').setStyle('cursor', this.allowZoomOut() ? 'pointer' : 'default'); + + // restore working date + this.d = startDate; + + // if ever the opacity is set to '0' it was only to have us fade it in here + // refer to the constructPicker() function, which instantiates the picker at opacity 0 when fading is desired + if (this.picker.getStyle('opacity') == 0) { + this.picker.tween('opacity', 0, 1); + } + + // animate + if ($chk(fx)) this.fx(fx); + }, + + fx: function(fx) { + if (fx == 'right') { + this.oldContents.setStyles({ left: 0, opacity: 1 }); + this.newContents.setStyles({ left: this.bodysize.x, opacity: 1 }); + this.slider.setStyle('left', 0).tween('left', 0, -this.bodysize.x); + } else if (fx == 'left') { + this.oldContents.setStyles({ left: this.bodysize.x, opacity: 1 }); + this.newContents.setStyles({ left: 0, opacity: 1 }); + this.slider.setStyle('left', -this.bodysize.x).tween('left', -this.bodysize.x, 0); + } else if (fx == 'fade') { + this.slider.setStyle('left', 0); + this.oldContents.setStyle('left', 0).set('tween', { duration: this.options.animationDuration / 2 }).tween('opacity', 1, 0); + this.newContents.setStyles({ opacity: 0, left: 0}).set('tween', { duration: this.options.animationDuration }).tween('opacity', 0, 1); + } + }, + + constructPicker: function() { + this.picker = new Element('div', { 'class': this.options.pickerClass }).inject(document.body); + if (this.options.useFadeInOut) { + this.picker.setStyle('opacity', 0).set('tween', { duration: this.options.animationDuration }); + } + + var h = new Element('div', { 'class': 'header' }).inject(this.picker); + var titlecontainer = new Element('div', { 'class': 'title' }).inject(h); + new Element('div', { 'class': 'previous' }).addEvent('click', this.previous.bind(this)).set('html', '«').inject(h); + new Element('div', { 'class': 'next' }).addEvent('click', this.next.bind(this)).set('html', '»').inject(h); + new Element('div', { 'class': 'closeButton' }).addEvent('click', this._close.bindWithEvent(this, true)).set('text', 'x').inject(h); + new Element('span', { 'class': 'titleText' }).addEvent('click', this.zoomOut.bind(this)).inject(titlecontainer); + + var b = new Element('div', { 'class': 'body' }).inject(this.picker); + this.bodysize = b.getSize(); + this.slider = new Element('div', { styles: { position: 'absolute', top: 0, left: 0, width: 2 * this.bodysize.x, height: this.bodysize.y }}) + .set('tween', { duration: this.options.animationDuration, transition: Fx.Transitions.Quad.easeInOut }).inject(b); + this.oldContents = new Element('div', { styles: { position: 'absolute', top: 0, left: this.bodysize.x, width: this.bodysize.x, height: this.bodysize.y }}).inject(this.slider); + this.newContents = new Element('div', { styles: { position: 'absolute', top: 0, left: 0, width: this.bodysize.x, height: this.bodysize.y }}).inject(this.slider); + }, + + renderTime: function() { + var container = new Element('div', { 'class': 'time' }).inject(this.newContents); + + if (this.options.timePickerOnly) { + this.picker.getElement('.titleText').set('text', 'Select a time'); + } else { + this.picker.getElement('.titleText').set('text', this.format(this.d, 'j M, Y')); + } + + new Element('input', { type: 'text', 'class': 'hour' }) + .set('value', this.leadZero(this.d.getHours())) + .addEvents({ + mousewheel: function(e) { + var i = e.target, v = i.get('value').toInt(); + i.focus(); + if (e.wheel > 0) { + v = (v < 23) ? v + 1 : 0; + } else { + v = (v > 0) ? v - 1 : 23; + } + i.set('value', this.leadZero(v)); + e.stop(); + }.bind(this) + }) + .set('maxlength', 2) + .inject(container); + + new Element('input', { type: 'text', 'class': 'minutes' }) + .set('value', this.leadZero(this.d.getMinutes())) + .addEvents({ + mousewheel: function(e) { + var i = e.target, v = i.get('value').toInt(); + i.focus(); + if (e.wheel > 0) { + v = (v < 59) ? v + 1 : 0; + } else { + v = (v > 0) ? v - 1 : 59; + } + i.set('value', this.leadZero(v)); + e.stop(); + }.bind(this) + }) + .set('maxlength', 2) + .inject(container); + + new Element('div', { 'class': 'separator' }).set('text', ':').inject(container); + + new Element('input', { type: 'submit', value: 'OK', 'class': 'ok' }) + .addEvents({ + click: function(e) { + e.stop(); + this._select(Object.merge(this.dateToObject(this.d), { hours: this.picker.getElement('.hour').get('value').toInt(), minutes: this.picker.getElement('.minutes').get('value').toInt() })); + }.bind(this) + }) + .set('maxlength', 2) + .inject(container); + }, + + renderMonth: function() { + var month = this.d.getMonth(); + + this.picker.getElement('.titleText').set('text', this.options.months[month] + ' ' + this.d.getFullYear()); + + this.d.setDate(1); + while (this.d.getDay() != this.options.startDay) { + this.d.setDate(this.d.getDate() - 1); + } + + var container = new Element('div', { 'class': 'days' }).inject(this.newContents); + var titles = new Element('div', { 'class': 'titles' }).inject(container); + var d, i, classes, e, weekcontainer; + + for (d = this.options.startDay; d < (this.options.startDay + 7); d++) { + new Element('div', { 'class': 'title day day' + (d % 7) }).set('text', this.options.days[(d % 7)].substring(0,this.options.dayShort)).inject(titles); + } + + var available = false; + var t = this.today.toDateString(); + var currentChoice = this.dateFromObject(this.choice).toDateString(); + + for (i = 0; i < 42; i++) { + classes = []; + classes.push('day'); + classes.push('day'+this.d.getDay()); + if (this.d.toDateString() == t) classes.push('today'); + if (this.d.toDateString() == currentChoice) classes.push('selected'); + if (this.d.getMonth() != month) classes.push('otherMonth'); + + if (i % 7 == 0) { + weekcontainer = new Element('div', { 'class': 'week week'+(Math.floor(i/7)) }).inject(container); + } + + e = new Element('div', { 'class': classes.join(' ') }).set('text', this.d.getDate()).inject(weekcontainer); + if (this.limited('date')) { + e.addClass('unavailable'); + if (available) { + this.limit.right = true; + } else if (this.d.getMonth() == month) { + this.limit.left = true; + } + } else { + available = true; + e.addEvent('click', function(e, d) { + if (this.options.timePicker) { + this.d.setDate(d.day); + this.d.setMonth(d.month); + this.mode = 'time'; + this.render('fade'); + } else { + this._select(d); + } + }.bindWithEvent(this, { day: this.d.getDate(), month: this.d.getMonth(), year: this.d.getFullYear() })); + } + this.d.setDate(this.d.getDate() + 1); + } + if (!available) this.limit.right = true; + }, + + renderYear: function() { + var month = this.today.getMonth(); + var thisyear = this.d.getFullYear() == this.today.getFullYear(); + var selectedyear = this.d.getFullYear() == this.choice.year; + + this.picker.getElement('.titleText').set('text', this.d.getFullYear()); + this.d.setMonth(0); + + var i, e; + var available = false; + var container = new Element('div', { 'class': 'months' }).inject(this.newContents); + + for (i = 0; i <= 11; i++) { + e = new Element('div', { 'class': 'month month'+(i+1)+(i == month && thisyear ? ' today' : '')+(i == this.choice.month && selectedyear ? ' selected' : '') }) + .set('text', this.options.monthShort ? this.options.months[i].substring(0, this.options.monthShort) : this.options.months[i]).inject(container); + + if (this.limited('month')) { + e.addClass('unavailable'); + if (available) { + this.limit.right = true; + } else { + this.limit.left = true; + } + } else { + available = true; + e.addEvent('click', function(e, d) { + this.d.setDate(1); + this.d.setMonth(d); + this.mode = 'month'; + this.render('fade'); + }.bindWithEvent(this, i)); + } + this.d.setMonth(i); + } + if (!available) this.limit.right = true; + }, + + renderDecades: function() { + // start neatly at interval (eg. 1980 instead of 1987) + while (this.d.getFullYear() % this.options.yearsPerPage > 0) { + this.d.setFullYear(this.d.getFullYear() - 1); + } + + this.picker.getElement('.titleText').set('text', this.d.getFullYear() + '-' + (this.d.getFullYear() + this.options.yearsPerPage - 1)); + + var i, y, e; + var available = false; + var container = new Element('div', { 'class': 'years' }).inject(this.newContents); + + if ($chk(this.options.minDate) && this.d.getFullYear() <= this.options.minDate.getFullYear()) { + this.limit.left = true; + } + + for (i = 0; i < this.options.yearsPerPage; i++) { + y = this.d.getFullYear(); + e = new Element('div', { 'class': 'year year' + i + (y == this.today.getFullYear() ? ' today' : '') + (y == this.choice.year ? ' selected' : '') }).set('text', y).inject(container); + + if (this.limited('year')) { + e.addClass('unavailable'); + if (available) { + this.limit.right = true; + } else { + this.limit.left = true; + } + } else { + available = true; + e.addEvent('click', function(e, d) { + this.d.setFullYear(d); + this.mode = 'year'; + this.render('fade'); + }.bindWithEvent(this, y)); + } + this.d.setFullYear(this.d.getFullYear() + 1); + } + if (!available) { + this.limit.right = true; + } + if ($chk(this.options.maxDate) && this.d.getFullYear() >= this.options.maxDate.getFullYear()) { + this.limit.right = true; + } + }, + + limited: function(type) { + var cs = $chk(this.options.minDate); + var ce = $chk(this.options.maxDate); + if (!cs && !ce) return false; + + switch (type) { + case 'year': + return (cs && this.d.getFullYear() < this.options.minDate.getFullYear()) || (ce && this.d.getFullYear() > this.options.maxDate.getFullYear()); + + case 'month': + // todo: there has got to be an easier way...? + var ms = ('' + this.d.getFullYear() + this.leadZero(this.d.getMonth())).toInt(); + return cs && ms < ('' + this.options.minDate.getFullYear() + this.leadZero(this.options.minDate.getMonth())).toInt() + || ce && ms > ('' + this.options.maxDate.getFullYear() + this.leadZero(this.options.maxDate.getMonth())).toInt() + + case 'date': + return (cs && this.d < this.options.minDate) || (ce && this.d > this.options.maxDate); + } + }, + + allowZoomOut: function() { + if (this.mode == 'time' && this.options.timePickerOnly) return false; + if (this.mode == 'decades') return false; + if (this.mode == 'year' && !this.options.yearPicker) return false; + return true; + }, + + zoomOut: function() { + if (!this.allowZoomOut()) return; + if (this.mode == 'year') { + this.mode = 'decades'; + } else if (this.mode == 'time') { + this.mode = 'month'; + } else { + this.mode = 'year'; + } + this.render('fade'); + }, + + previous: function() { + if (this.mode == 'decades') { + this.d.setFullYear(this.d.getFullYear() - this.options.yearsPerPage); + } else if (this.mode == 'year') { + this.d.setFullYear(this.d.getFullYear() - 1); + } else if (this.mode == 'month') { + this.d.setDate(1); + this.d.setMonth(this.d.getMonth() - 1); + } + this.render('left'); + }, + + next: function() { + if (this.mode == 'decades') { + this.d.setFullYear(this.d.getFullYear() + this.options.yearsPerPage); + } else if (this.mode == 'year') { + this.d.setFullYear(this.d.getFullYear() + 1); + } else if (this.mode == 'month') { + this.d.setDate(1); + this.d.setMonth(this.d.getMonth() + 1); + } + this.render('right'); + }, + + _close: function(e, force) { + if (!$(this.picker)) return; + var clickOutside = ($chk(e) && e.target != this.picker && !this.picker.contains(e.target) && e.target != this.visual); + if (force || clickOutside) { + if (this.options.useFadeInOut) { + this.picker.set('tween', { duration: this.options.animationDuration / 2, onComplete: this.destroy.bind(this) }).tween('opacity', 1, 0); + } else { + this.destroy(); + } + } + this.close(); + }, + + close: function() { + this.fireEvent('close'); + }, + + destroy: function() { + this.picker.destroy(); + this.picker = null; + }, + + _select: function(values) { + this.choice = Object.merge(this.choice, values); + var d = this.dateFromObject(this.choice); + this.input.set('value', this.format(d, this.options.inputOutputFormat)); + this.visual.set('value', this.format(d, this.options.format)); + this.select(values); + this._close(null, true); + }, + + select : function(values) { + this.fireEvent('select'); + }, + + leadZero: function(v) { + return v < 10 ? '0'+v : v; + }, + + format: function(t, format) { + var f = ''; + var h = t.getHours(); + var m = t.getMonth(); + + for (var i = 0; i < format.length; i++) { + switch(format.charAt(i)) { + case '\\': i++; f+= format.charAt(i); break; + case 'y': f += (t.getFullYear() + '').substring(2); break; + case 'Y': f += t.getFullYear(); break; + case 'm': f += this.leadZero(m + 1); break; + case 'n': f += (m + 1); break; + case 'M': f += this.options.months[m].substring(0,this.options.monthShort); break; + case 'F': f += this.options.months[m]; break; + case 'd': f += this.leadZero(t.getDate()); break; + case 'j': f += t.getDate(); break; + case 'D': f += this.options.days[t.getDay()].substring(0,this.options.dayShort); break; + case 'l': f += this.options.days[t.getDay()]; break; + case 'G': f += h; break; + case 'H': f += this.leadZero(h); break; + case 'g': f += (h % 12 ? h % 12 : 12); break; + case 'h': f += this.leadZero(h % 12 ? h % 12 : 12); break; + case 'a': f += (h > 11 ? 'pm' : 'am'); break; + case 'A': f += (h > 11 ? 'PM' : 'AM'); break; + case 'i': f += this.leadZero(t.getMinutes()); break; + case 's': f += this.leadZero(t.getSeconds()); break; + case 'U': f += Math.floor(t.valueOf() / 1000); break; + default: f += format.charAt(i); + } + } + return f; + }, + + unformat: function(t, format) { + var d = new Date(); + d.setMonth(0); + d.setDate(1); + var a = {}; + var c, m; + t = t.toString(); + + for (var i = 0; i < format.length; i++) { + c = format.charAt(i); + switch(c) { + case '\\': r = null; i++; break; + case 'y': r = '[0-9]{2}'; break; + case 'Y': r = '[0-9]{4}'; break; + case 'm': r = '0[1-9]|1[012]'; break; + case 'n': r = '[1-9]|1[012]'; break; + case 'M': r = '[A-Za-z]{'+this.options.monthShort+'}'; break; + case 'F': r = '[A-Za-z]+'; break; + case 'd': r = '0[1-9]|[12][0-9]|3[01]'; break; + case 'j': r = '[12][0-9]|3[01]|[1-9]'; break; + case 'D': r = '[A-Za-z]{'+this.options.dayShort+'}'; break; + case 'l': r = '[A-Za-z]+'; break; + case 'G': + case 'H': + case 'g': + case 'h': r = '[0-9]{1,2}'; break; + case 'a': r = '(am|pm)'; break; + case 'A': r = '(AM|PM)'; break; + case 'i': + case 's': r = '[012345][0-9]'; break; + case 'U': r = '-?[0-9]+$'; break; + default: r = null; + } + + if ($chk(r)) { + m = t.match('^'+r); + if ($chk(m)) { + a[c] = m[0]; + t = t.substring(a[c].length); + } else { + if (this.options.debug) alert("Fatal Error in DatePicker\n\nUnexpected format at: '"+t+"' expected format character '"+c+"' (pattern '"+r+"')"); + return d; + } + } else { + t = t.substring(1); + } + } + + for (c in a) { + var v = a[c]; + switch(c) { + case 'y': d.setFullYear(v < 30 ? 2000 + v.toInt() : 1900 + v.toInt()); break; // assume between 1930 - 2029 + case 'Y': d.setFullYear(v); break; + case 'm': + case 'n': d.setMonth(v - 1); break; + // FALL THROUGH NOTICE! "M" has no break, because "v" now is the full month (eg. 'February'), which will work with the next format "F": + case 'M': v = this.options.months.filter(function(item, index) { return item.substring(0,this.options.monthShort) == v }.bind(this))[0]; + case 'F': d.setMonth(this.options.months.indexOf(v)); break; + case 'd': + case 'j': d.setDate(v); break; + case 'G': + case 'H': d.setHours(v); break; + case 'g': + case 'h': if (a['a'] == 'pm' || a['A'] == 'PM') { d.setHours(v == 12 ? 0 : v.toInt() + 12); } else { d.setHours(v); } break; + case 'i': d.setMinutes(v); break; + case 's': d.setSeconds(v); break; + case 'U': d = new Date(v.toInt() * 1000); + } + }; + + return d; + } +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/spinner/spinner.css b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/spinner/spinner.css new file mode 100644 index 00000000000..964155b0904 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/spinner/spinner.css @@ -0,0 +1,19 @@ +.spinner { + position: absolute; + opacity: 0.9; + filter: alpha(opacity=90); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=90); + z-index: 999; + background: #fff; +} +.spinner-msg { + text-align: center; + font-weight: bold; +} + +.spinner-img { + background: url(spinner.gif) no-repeat; + width: 24px; + height: 24px; + margin: 0 auto; +} diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/spinner/spinner.gif b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/spinner/spinner.gif new file mode 100644 index 00000000000..53dd589fa19 Binary files /dev/null and b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/spinner/spinner.gif differ diff --git a/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/tabs/MTAjaxTabbedPanel.js b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/tabs/MTAjaxTabbedPanel.js new file mode 100644 index 00000000000..151251f7589 --- /dev/null +++ b/Frameworks/Ajax/MooTools/WebServerResources/scripts/plugins/tabs/MTAjaxTabbedPanel.js @@ -0,0 +1,165 @@ +var MTAjaxTabbedPanel = new Class({ + + Implements: [Options, Events], + + options : { + + busyDiv: 'busyDiv', + selectedTabClassName: 'active', + selectedPanelClassName: 'active', + tabbedPanelTabsContainer: '', + tabbedPanelPanesContainer: '' + + }, + + initialize: function(options) { + this.setOptions(options); + if(this.options.elementID) { + this.runOnLoad($(this.options.elementID)); + } + this.initializeTabs(); + }, + + initializeTabs : function() { + + var tabbedPanelTabsContainer = $(this.options.tabbedPanelTabsContainer); + + if(tabbedPanelTabsContainer == null) { + alert("Unable to find tabbed panel with id: " + this.options.tabbedPanelContainer); + } + + tabbedPanelTabsContainer.getElements('a').each(function(el) { + + if(el.get('rel') != null) { + + el.addEvent('click', function(e) { + e.preventDefault(); + var element = e.target; + var panel = $(element.get('rel')); + this.loadPanel(panel); + this.selectPanel(panel); + this.selectTab(element); + }.bind(this)); + } + }.bind(this)); + + }, + + + selectTab : function(selectedTab) { + + var nodes = $(this.options.tabbedPanelTabsContainer).getElements("a"); + + var dict = { + node: selectedTab, + selectedTabClassName: this.options.selectedTabClassName + } + + nodes.each(function(node) { + if(node != this.node) { + node.getParent().removeClass(this.selectedTabClassName); + } + }, dict); + + selectedTab.getParent().addClass(this.options.selectedTabClassName); + + var pane = $(selectedTab.get('rel')); + + if(pane.get('html') == '' && pane.get('html') != this.busyContent(this.options.busyDiv)) { + this.runOnSelect($(this.options.tabbedPanelTabsContainer)); + } + + }, + + loadPanel : function(panel) { + + if(panel.get('html') == '' || panel.get('html') == this.busyContent(this.options.busyDiv)) { + + var req = new Request.HTML({ + delay: 0.25, + initialDelay: 0.25, + update : panel, + url : panel.get('updateUrl'), + async: true, + evalScripts: true, + onSuccess: function() { + req.stopTimer(); + this.runOnLoad(panel); + this.runOnSelect($(this.options.tabbedPanelPanesContainer)); + }.bind(this) + + }).startTimer(); + + } + + }, + + selectPanel : function(selectedPanelID) { + + var selectedPane = $(selectedPanelID); + + var formInPanel = selectedPane.getFirst('form'); + if(formInPanel) { + MTASB.request(formInPanel, null, {async: false, evalScripts:false, _asbn:'dummy'}); + } else { + var formAroundPanel = selectedPane.getParent(); + if(formAroundPanel.tagName == 'FORM') { + MTASB.request(formAroundPanel, null, {async: false, evalScripts:false, _asbn:'dummy'}); + } + } + + var nodes = $(this.options.tabbedPanelPanesContainer).getChildren('li'); + var dict = { + selectedPane: selectedPane, + selectedPanelClassName: this.options.selectedPanelClassName + }; + + nodes.each(function(node) { + + if(node != this.selectedPane) { + if(node.hasClass(this.selectedPanelClassName)) { + new Request({ + url: node.get('updateUrl'), + async: true, + evalScripts: false, + didSelect: false + }).send(); + } + node.removeClass(this.selectedPanelClassName); + } + + }, dict); + + selectedPane.addClass(this.options.selectedPanelClassName); + new Request({ + url: selectedPane.get('updateUrl'), + async: true, + evalScripts: false, + didSelect: true, + }).send(); + + }, + + runOnLoad : function(element) { + var onLoadScript = element.get('onLoad'); + if(onLoadScript) { + eval(onLoadScript); + } + }, + + runOnSelect : function(element) { + var onSelectScript = element.get('onSelect'); + if(onSelectScript) { + eval(onSelectScript); + } + }, + + busyContent : function(busyDivID) { + var busyContent = 'Loading, please wait...'; + if(busyDivID != '') { + busyContent = $(busyDivID).get('html'); + } + return busyContent; + } + +}); \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/build.properties b/Frameworks/Ajax/MooTools/build.properties new file mode 100644 index 00000000000..cbcc79e1a7a --- /dev/null +++ b/Frameworks/Ajax/MooTools/build.properties @@ -0,0 +1,16 @@ +classes.dir = bin +project.name=MooTools +project.name.lowercase=mootools +project.type=framework +principalClass = +customInfoPListContent = +eoAdaptorClassName = +cfBundleVersion = +cfBundleShortVersion = +cfBundleID = org.mywoapp +javaVersion = 1.5+ +component.wellFormedTemplateRequired=false +component.inlineBindingPrefix=$ +component.inlineBindingSuffix= +embed.Local=true +embed.System=true diff --git a/Frameworks/Ajax/MooTools/build.xml b/Frameworks/Ajax/MooTools/build.xml new file mode 100644 index 00000000000..483e675147a --- /dev/null +++ b/Frameworks/Ajax/MooTools/build.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Frameworks/Ajax/MooTools/woproject/classes.exclude.patternset b/Frameworks/Ajax/MooTools/woproject/classes.exclude.patternset new file mode 100644 index 00000000000..56fb545fa67 --- /dev/null +++ b/Frameworks/Ajax/MooTools/woproject/classes.exclude.patternset @@ -0,0 +1 @@ +build.properties diff --git a/Frameworks/Ajax/MooTools/woproject/classes.include.patternset b/Frameworks/Ajax/MooTools/woproject/classes.include.patternset new file mode 100644 index 00000000000..3179091db39 --- /dev/null +++ b/Frameworks/Ajax/MooTools/woproject/classes.include.patternset @@ -0,0 +1,2 @@ +**/*.class +*.properties diff --git a/Frameworks/Ajax/MooTools/woproject/resources.exclude.patternset b/Frameworks/Ajax/MooTools/woproject/resources.exclude.patternset new file mode 100644 index 00000000000..905050dfb73 --- /dev/null +++ b/Frameworks/Ajax/MooTools/woproject/resources.exclude.patternset @@ -0,0 +1,3 @@ +**/*.eomodeld~/ +**/*.woa/** +**/*.framework/** diff --git a/Frameworks/Ajax/MooTools/woproject/resources.include.patternset b/Frameworks/Ajax/MooTools/woproject/resources.include.patternset new file mode 100644 index 00000000000..611978755e2 --- /dev/null +++ b/Frameworks/Ajax/MooTools/woproject/resources.include.patternset @@ -0,0 +1,3 @@ +Components/**/*.wo/**/* +Components/**/*.api +Resources/**/* \ No newline at end of file diff --git a/Frameworks/Ajax/MooTools/woproject/wsresources.exclude.patternset b/Frameworks/Ajax/MooTools/woproject/wsresources.exclude.patternset new file mode 100644 index 00000000000..9435a512320 --- /dev/null +++ b/Frameworks/Ajax/MooTools/woproject/wsresources.exclude.patternset @@ -0,0 +1,3 @@ +**/*.woa/** +**/*.framework/** +**/*.eomodeld~/** diff --git a/Frameworks/Ajax/MooTools/woproject/wsresources.include.patternset b/Frameworks/Ajax/MooTools/woproject/wsresources.include.patternset new file mode 100644 index 00000000000..234cdc88bb7 --- /dev/null +++ b/Frameworks/Ajax/MooTools/woproject/wsresources.include.patternset @@ -0,0 +1 @@ +WebServerResources/**/*