├── .gitignore ├── demos ├── MouseWheel │ ├── demo.css │ ├── up.gif │ ├── down.gif │ ├── demo.details │ ├── demo.html │ └── demo.js ├── Drag.Scroll │ ├── world.jpg │ ├── demo.css │ ├── demo.details │ ├── demo.js │ └── demo.html ├── Periodical │ ├── demo.css │ ├── demo.html │ ├── demo.details │ └── demo.js ├── Request.JSON │ ├── images │ │ ├── edit.jpg │ │ ├── fire.jpg │ │ ├── user.jpg │ │ ├── monitor.jpg │ │ ├── mouse.jpg │ │ ├── package.jpg │ │ ├── setting.jpg │ │ ├── speaker.jpg │ │ ├── earth-blue.jpg │ │ └── earth-gold.jpg │ ├── demo.details │ ├── demo.css │ ├── demo.html │ └── demo.js ├── Element.Event.Pseudos │ ├── spinner.gif │ ├── demo.details │ ├── demo.css │ ├── demo.js │ └── demo.html ├── Accordion │ ├── demo.js │ ├── demo.details │ ├── demo.css │ └── demo.html ├── Request │ ├── demo.css │ ├── demo.html │ ├── demo.details │ └── demo.js ├── Request.HTML │ ├── demo.css │ ├── demo.html │ ├── demo.details │ └── demo.js ├── Chaining │ ├── demo.css │ ├── demo.html │ ├── demo.details │ └── demo.js ├── Transitions │ ├── demo.css │ ├── demo.details │ ├── demo.html │ └── demo.js ├── MouseEnter │ ├── demo.details │ ├── demo.css │ ├── demo.html │ └── demo.js ├── Element.Delegation │ ├── demo.css │ ├── demo.html │ ├── demo.details │ └── demo.js ├── Sortables │ ├── demo.css │ ├── demo.js │ ├── demo.details │ └── demo.html ├── Slider │ ├── demo.details │ ├── demo.html │ ├── demo.css │ └── demo.js ├── Fx.Slide │ ├── demo.css │ ├── demo.details │ ├── demo.html │ └── demo.js ├── Drag.Drop │ ├── demo.css │ ├── demo.html │ ├── demo.details │ └── demo.js ├── Element.Event │ ├── demo.details │ ├── demo.html │ ├── demo.css │ └── demo.js ├── Drag.Move │ ├── demo.css │ ├── demo.details │ ├── demo.js │ └── demo.html ├── Native │ ├── demo.css │ ├── demo.js │ ├── demo.html │ └── demo.details ├── Fx.Morph │ ├── demo.html │ ├── demo.css │ ├── demo.details │ └── demo.js ├── Slick.Finder │ ├── demo.css │ ├── demo.js │ ├── demo.details │ └── demo.html ├── Fx.Sort │ ├── demo.css │ ├── demo.details │ ├── demo.html │ └── demo.js ├── Enhanced-Form │ ├── demo.js │ ├── demo.details │ ├── demo.html │ └── demo.css ├── Effects │ ├── demo.details │ ├── demo.css │ ├── demo.html │ └── demo.js └── Drag.Cart │ ├── demo.details │ ├── demo.html │ ├── demo.js │ └── demo.css ├── Source └── mootools-art-0.87.js ├── assets ├── css │ ├── graphics │ │ ├── tab.png │ │ ├── gradient.png │ │ ├── jsfiddle.png │ │ ├── mootools.png │ │ ├── shirt-1.jpg │ │ ├── shirt-2.jpg │ │ ├── shirt-3.jpg │ │ ├── shirt-4.jpg │ │ ├── shirt-5.jpg │ │ └── shirt-6.jpg │ ├── main.css │ └── demos.css ├── codemirror │ ├── css │ │ ├── people.jpg │ │ ├── sparqlcolors.css │ │ ├── csscolors.css │ │ ├── docs.css │ │ ├── xmlcolors.css │ │ └── jscolors.css │ ├── contrib │ │ ├── sql │ │ │ ├── css │ │ │ │ └── sqlcolors.css │ │ │ ├── LICENSE │ │ │ └── index.html │ │ ├── plsql │ │ │ ├── css │ │ │ │ └── plsqlcolors.css │ │ │ ├── LICENSE │ │ │ └── index.html │ │ ├── csharp │ │ │ ├── css │ │ │ │ └── csharpcolors.css │ │ │ └── index.html │ │ ├── lua │ │ │ ├── css │ │ │ │ └── luacolors.css │ │ │ ├── LICENSE │ │ │ └── index.html │ │ ├── ometa │ │ │ ├── css │ │ │ │ └── ometacolors.css │ │ │ ├── LICENSE │ │ │ └── index.html │ │ ├── scheme │ │ │ ├── LICENSE │ │ │ ├── css │ │ │ │ └── schemecolors.css │ │ │ └── index.html │ │ ├── python │ │ │ ├── css │ │ │ │ └── pythoncolors.css │ │ │ ├── LICENSE │ │ │ └── index.html │ │ ├── php │ │ │ ├── LICENSE │ │ │ ├── css │ │ │ │ └── phpcolors.css │ │ │ └── js │ │ │ │ └── parsephphtmlmixed.js │ │ └── groovy │ │ │ └── index.html │ ├── js │ │ ├── parsedummy.js │ │ ├── tokenize.js │ │ ├── highlight.js │ │ ├── mirrorframe.js │ │ ├── parsehtmlmixed.js │ │ ├── util.js │ │ ├── stringstream.js │ │ ├── parsecss.js │ │ └── parsesparql.js │ ├── LICENSE │ ├── sparqltest.html │ ├── csstest.html │ ├── mixedtest.html │ ├── htmltest.html │ ├── unittests.js │ ├── jstest.html │ ├── faq.html │ ├── highlight.html │ └── unittests.html └── js │ └── demos.js ├── libs └── yaml.php ├── Request.php ├── LICENCE ├── README.md └── index.php /.gitignore: -------------------------------------------------------------------------------- 1 | *.tmp* 2 | -------------------------------------------------------------------------------- /demos/MouseWheel/demo.css: -------------------------------------------------------------------------------- 1 | #wheel { 2 | margin: 1em; 3 | } -------------------------------------------------------------------------------- /demos/MouseWheel/up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/MouseWheel/up.gif -------------------------------------------------------------------------------- /Source/mootools-art-0.87.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/Source/mootools-art-0.87.js -------------------------------------------------------------------------------- /assets/css/graphics/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/tab.png -------------------------------------------------------------------------------- /demos/Drag.Scroll/world.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Drag.Scroll/world.jpg -------------------------------------------------------------------------------- /demos/MouseWheel/down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/MouseWheel/down.gif -------------------------------------------------------------------------------- /assets/codemirror/css/people.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/codemirror/css/people.jpg -------------------------------------------------------------------------------- /assets/css/graphics/gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/gradient.png -------------------------------------------------------------------------------- /assets/css/graphics/jsfiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/jsfiddle.png -------------------------------------------------------------------------------- /assets/css/graphics/mootools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/mootools.png -------------------------------------------------------------------------------- /assets/css/graphics/shirt-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/shirt-1.jpg -------------------------------------------------------------------------------- /assets/css/graphics/shirt-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/shirt-2.jpg -------------------------------------------------------------------------------- /assets/css/graphics/shirt-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/shirt-3.jpg -------------------------------------------------------------------------------- /assets/css/graphics/shirt-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/shirt-4.jpg -------------------------------------------------------------------------------- /assets/css/graphics/shirt-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/shirt-5.jpg -------------------------------------------------------------------------------- /assets/css/graphics/shirt-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/assets/css/graphics/shirt-6.jpg -------------------------------------------------------------------------------- /demos/Periodical/demo.css: -------------------------------------------------------------------------------- 1 | #box { 2 | margin: 1em auto; 3 | width: 200px; 4 | height: 150px; 5 | background: #6B7B95; 6 | } -------------------------------------------------------------------------------- /demos/Request.JSON/images/edit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/edit.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/fire.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/fire.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/user.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/monitor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/monitor.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/mouse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/mouse.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/package.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/package.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/setting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/setting.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/speaker.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/speaker.jpg -------------------------------------------------------------------------------- /demos/Element.Event.Pseudos/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Element.Event.Pseudos/spinner.gif -------------------------------------------------------------------------------- /demos/Request.JSON/images/earth-blue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/earth-blue.jpg -------------------------------------------------------------------------------- /demos/Request.JSON/images/earth-gold.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mootools/mootools-demos/HEAD/demos/Request.JSON/images/earth-gold.jpg -------------------------------------------------------------------------------- /demos/Periodical/demo.html: -------------------------------------------------------------------------------- 1 |

Periodical Effects

2 | start | stop 3 | 4 |
-------------------------------------------------------------------------------- /demos/Accordion/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | new Fx.Accordion($('accordion'), '#accordion h2', '#accordion .content'); 4 | }); 5 | -------------------------------------------------------------------------------- /demos/Request/demo.css: -------------------------------------------------------------------------------- 1 | #result { 2 | width: 500px; 3 | padding: 10px; 4 | background-color: #F9F9F9; 5 | border-right: 1px solid #ccc; 6 | border-bottom: 1px solid #ccc; 7 | } -------------------------------------------------------------------------------- /demos/Request.HTML/demo.css: -------------------------------------------------------------------------------- 1 | #result { 2 | width: 500px; 3 | padding: 10px; 4 | background-color: #F9F9F9; 5 | border-right: 1px solid #ccc; 6 | border-bottom: 1px solid #ccc; 7 | } 8 | -------------------------------------------------------------------------------- /demos/Chaining/demo.css: -------------------------------------------------------------------------------- 1 | #box { 2 | background: #6B7B95; 3 | height: 70px; 4 | margin: 0 auto; 5 | width: 100px; 6 | } 7 | 8 | #log { 9 | margin: 0; 10 | height: 50px; 11 | } 12 | -------------------------------------------------------------------------------- /demos/MouseWheel/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: MouseWheel 5 | 6 | description: Custom Mousewheel Event 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Mouse 13 | 14 | ... 15 | */ 16 | -------------------------------------------------------------------------------- /demos/Request/demo.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Make Request | This Request Will Fail 4 |

5 | 6 |

Result

7 |
Waiting for the request to happen.
-------------------------------------------------------------------------------- /demos/Request.HTML/demo.html: -------------------------------------------------------------------------------- 1 |

Request.HTML is a subclass of Request built for making XHR requests which return HTML content.

2 |

Get HTML

3 |

Result

4 | 5 |
Waiting for the request to happen.
-------------------------------------------------------------------------------- /demos/Chaining/demo.html: -------------------------------------------------------------------------------- 1 | 2 |

Chaining

3 | 4 |

Click start to see a sequence of effects controlled by chain

5 | 6 | Log:
7 |

waiting for start click

8 | 9 |
-------------------------------------------------------------------------------- /demos/Transitions/demo.css: -------------------------------------------------------------------------------- 1 | #box { 2 | height: 400px; 3 | width: 100%; 4 | background: #ddd; 5 | margin-top: 10px; 6 | overflow: hidden; 7 | } 8 | 9 | #target { 10 | height: 50px; 11 | width: 50px; 12 | background: #C17878; 13 | position: absolute; 14 | }​ -------------------------------------------------------------------------------- /demos/MouseEnter/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: MouseEnter 5 | 6 | description: 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Elements, Events 13 | 14 | ... 15 | */ 16 | 17 |

This demo shows how to use the custom mouseenter and mouseleave events. Just hover the grey box below.

18 | -------------------------------------------------------------------------------- /demos/MouseWheel/demo.html: -------------------------------------------------------------------------------- 1 |

2 | MouseWheel Event 3 |

4 |
Mousewheel Direction: none
5 |
6 |
UP
7 |
DOWN
8 |
-------------------------------------------------------------------------------- /demos/Element.Delegation/demo.css: -------------------------------------------------------------------------------- 1 | 2 | #container { 3 | width: 145px; 4 | margin: 20px 0; 5 | overflow: hidden; 6 | border: 1px solid #999; 7 | } 8 | 9 | .item { 10 | float: left; 11 | height: 40px; 12 | width: 40px; 13 | margin: 4px; 14 | background-color: #78BA91; 15 | cursor: pointer; 16 | } 17 | 18 | .new { 19 | background-color: #6B7B95; 20 | } 21 | -------------------------------------------------------------------------------- /demos/Sortables/demo.css: -------------------------------------------------------------------------------- 1 | 2 | ul#example1 { 3 | width: 200px; 4 | } 5 | 6 | #example1 LI, 7 | #example2 LI { 8 | cursor: move; 9 | padding: 3px; 10 | } 11 | 12 | #example2 UL { 13 | border: 1px solid #000; 14 | float: left; 15 | min-height: 10px; 16 | margin: 5px; 17 | width: 200px; 18 | } 19 | 20 | #example LI { 21 | margin: 0; 22 | background: #F9F9F9; 23 | } 24 | -------------------------------------------------------------------------------- /demos/Slider/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Slider 5 | 6 | description: Slider demo 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Effects 13 | 14 | docs: 15 | - name: Slider 16 | url: http://mootools.net/docs/more/Drag/Slider 17 | 18 | ... 19 | */ 20 | 21 |

The Slider allows you to drag a knob inside an element to set a value within a certain range.

-------------------------------------------------------------------------------- /demos/Fx.Slide/demo.css: -------------------------------------------------------------------------------- 1 | h3.section { 2 | margin-top: 1em; 3 | } 4 | 5 | #vertical_slide, #horizontal_slide { 6 | background: #D0C8C8; 7 | color: #8A7575; 8 | padding: 10px; 9 | border: 5px solid #F3F1F1; 10 | font-weight: bold; 11 | } 12 | 13 | div.marginbottom { 14 | /* Since the Fx.Slide element resets margins, we set a margin on the above element */ 15 | margin-bottom: 10px; 16 | } -------------------------------------------------------------------------------- /demos/Element.Delegation/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Click one of the blocks:

5 | 6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | 15 |
16 | -------------------------------------------------------------------------------- /demos/Fx.Slide/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Fx.Slide 5 | 6 | description: With Fx.Slide you can slide elements in and out, or even toggle them! 7 | 8 | authors: 9 | - The MooTools Developer Team 10 | 11 | docs: 12 | - name: Fx.Slide 13 | url: http://mootools.net/docs/more/Fx/Fx.Slide 14 | 15 | ... 16 | */ 17 | 18 |

With Fx.Slide you can slide elements in and out, or even toggle them!

-------------------------------------------------------------------------------- /demos/Drag.Drop/demo.css: -------------------------------------------------------------------------------- 1 | #draggables { 2 | height: 100px; 3 | position: relative; 4 | } 5 | #draggables DIV { 6 | background: #78BA91; 7 | cursor: move; 8 | height: 50px; 9 | left: 10px; 10 | position: absolute; 11 | top: 10px; 12 | width: 50px; 13 | } 14 | 15 | #droppables DIV { 16 | background: #6B7B95; 17 | float: left; 18 | height: 100px; 19 | margin: 10px; 20 | width: 100px; 21 | } 22 | -------------------------------------------------------------------------------- /demos/Element.Event/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Element.Event 5 | 6 | description: 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Elements, Events 13 | 14 | docs: 15 | - name: Element.Event 16 | url: http://mootools.net/docs/core/Element/Element.Event 17 | 18 | ... 19 | */ 20 | 21 |

This demo will show you how to: add multiple Events to an Element, create custom Events and fire an Event.

-------------------------------------------------------------------------------- /demos/Drag.Move/demo.css: -------------------------------------------------------------------------------- 1 | #container { 2 | background: #DDD; 3 | height: 260px; 4 | position: relative; 5 | } 6 | 7 | #drag { 8 | background: #78BA91; 9 | cursor: move; 10 | height: 40px; 11 | left: 0; 12 | position: absolute; 13 | top: 0; 14 | width: 40px; 15 | } 16 | 17 | .drop { 18 | background: #6B7B95; 19 | float: left; 20 | height: 60px; 21 | margin-left: 20px; 22 | margin-top: 20px; 23 | width: 72px; 24 | } -------------------------------------------------------------------------------- /libs/yaml.php: -------------------------------------------------------------------------------- 1 | Accordions are quite simply the most important UI element on the web today. This demo shows you how to use this Web 3.0 interface element.

-------------------------------------------------------------------------------- /demos/Request/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Request 5 | 6 | description: Simple Ajax example 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Request 13 | 14 | docs: 15 | - name: Request 16 | url: http://mootools.net/docs/core/Request/Request 17 | 18 | ... 19 | */ 20 | 21 |

Request is the basic XHR request class in MooTools. While not extremely useful on its own, it provides the basic functionality for both Request.HTML and Request.JSON.

22 | -------------------------------------------------------------------------------- /demos/Native/demo.css: -------------------------------------------------------------------------------- 1 | 2 | #elements { 3 | overflow: hidden; 4 | } 5 | 6 | div.element { 7 | width: 100px; 8 | height: 50px; 9 | border: 1px solid black; 10 | background-color: #f9f9f9; 11 | float: left; 12 | margin: 5px; 13 | } 14 | 15 | div.otherElement { 16 | height: 20px; 17 | } 18 | 19 | pre { 20 | padding: 5px 7px; 21 | margin: 5px 0; 22 | background: #f5f5f5; 23 | border: 1px solid #ddd; 24 | color: #333; 25 | overflow: auto; 26 | font-size: 12px; 27 | } 28 | -------------------------------------------------------------------------------- /demos/Fx.Morph/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 24 | 25 | -------------------------------------------------------------------------------- /demos/Accordion/demo.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | #accordion { 4 | margin: 20px 0 0; 5 | max-width: 400px; 6 | } 7 | #accordion H2 { 8 | background: #6B7B95; 9 | color: white; 10 | cursor: pointer; 11 | font: 12px Helvetica, Arial, sans-serif; 12 | line-height: 16px; 13 | margin: 0 0 4px 0; 14 | padding: 3px 5px 1px; 15 | } 16 | #accordion .content { 17 | background-color: #F4F5F5; 18 | } 19 | #accordion .content p { 20 | margin: 0.5em 0; 21 | padding: 0 6px 8px 6px; 22 | } 23 | -------------------------------------------------------------------------------- /demos/Slick.Finder/demo.css: -------------------------------------------------------------------------------- 1 | 2 | #selector_list, 3 | #search_wrapper { 4 | float: left; 5 | width: 50%; 6 | } 7 | 8 | #selector_list li { 9 | margin-bottom: 5px; 10 | } 11 | 12 | #selector_list a { 13 | font-family: "Courier New", Courier, monospace; 14 | } 15 | 16 | #seach_in_here { 17 | border: 1px solid #333; 18 | padding: 10px; 19 | } 20 | 21 | #seach_in_here div { 22 | margin-bottom: 20px; 23 | } 24 | 25 | #seach_in_here div p { 26 | margin: 0; 27 | border-style 28 | } 29 | -------------------------------------------------------------------------------- /demos/Request.HTML/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Request.HTML 5 | 6 | description: Request HTML 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Request 13 | - HTML 14 | 15 | docs: 16 | - name: Request.HTML 17 | url: http://mootools.net/docs/core/Request/Request.HTML 18 | 19 | ... 20 | */ 21 | 22 |

Request is the basic XHR request class in MooTools. While not extremely useful on its own, it provides the basic functionality for both Request.HTML and Request.JSON.

23 | -------------------------------------------------------------------------------- /demos/Request.JSON/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Request.JSON 5 | 6 | description: Request JSON 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Request 13 | - HTML 14 | 15 | docs: 16 | - name: Request.JSON 17 | url: http://mootools.net/docs/core/Request/Request.JSON 18 | 19 | ... 20 | */ 21 | 22 |

Request is the basic XHR request class in MooTools. While not extremely useful on its own, it provides the basic functionality for both Request.HTML and Request.JSON.

23 | -------------------------------------------------------------------------------- /demos/Periodical/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Periodical 5 | 6 | description: Periodically shows another Fx 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Function 13 | - Periodical 14 | 15 | docs: 16 | - name: Function:periodical 17 | url: http://mootools.net/docs/core/Types/Function#Function:periodical 18 | - name: MDC clearInterval 19 | url: https://developer.mozilla.org/en/DOM/window.clearInterval 20 | 21 | ... 22 | */ 23 | 24 |

Periodically shows another Fx

25 | -------------------------------------------------------------------------------- /demos/Sortables/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var example1 = $('example1'), 5 | step = 0; 6 | 7 | example1.getElements('li').each(function(li){ 8 | var color = [step, 82, 87].hsbToRgb(); 9 | li.setStyles({ 10 | 'background-color': color, 11 | height: Number.random(20, 50) 12 | }); 13 | step += 35; 14 | }); 15 | 16 | new Sortables(example1); 17 | 18 | new Sortables('#example2 UL', { 19 | clone: true, 20 | revert: true, 21 | opacity: 0.7 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /demos/Element.Event/demo.html: -------------------------------------------------------------------------------- 1 |

In below textarea you can type whatever. Typing one of listed "Magic Words" will cause Event "burn" to fire and starting an effect (see js code)

2 |

Magic Words to type: hello, moo, pizza, burn, delayed (this last one will fire after 1 second).

3 |
4 | 5 |
6 |
7 | 8 |
-------------------------------------------------------------------------------- /demos/Chaining/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Chaining 5 | 6 | description: An example of chaining used for effects 7 | 8 | authors: 9 | - Djamil Legato 10 | 11 | docs: 12 | - name: Chain 13 | url: http://mootools.net/docs/core/Class/Class.Extras#Chain 14 | - name: Fx.Morph 15 | url: http://mootools.net/docs/core/Fx/Fx.Morph#Fx-Morph 16 | - name: Function:delay 17 | url: http://mootools.net/docs/core/Types/Function#Function:delay 18 | 19 | ... 20 | */ 21 | 22 |

An example of chaining used for effects.

23 | -------------------------------------------------------------------------------- /demos/Element.Delegation/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Element.Delegation 5 | 6 | description: 7 | 8 | authors: 9 | - Subhaze 10 | 11 | keywords: 12 | - Elements, Events, Delegation 13 | 14 | docs: 15 | - name: Element.Delegation 16 | url: http://mootools.net/docs/more/Element/Element.Delegation 17 | 18 | ... 19 | */ 20 | 21 |

This demo will show you how to: add a single event to a parent element and have it delegate that event to it's children based on a selector, even elements that were created after the event was setup.

-------------------------------------------------------------------------------- /demos/Drag.Scroll/demo.css: -------------------------------------------------------------------------------- 1 | 2 | .scrollarea { 3 | cursor: move; 4 | height: 300px; 5 | width: 400px; 6 | border: 1px solid #6B7B95; 7 | overflow: hidden; 8 | } 9 | 10 | .scrollarea > div { 11 | background: #DDD; 12 | padding: 200px 0; 13 | } 14 | 15 | .scrollarea > div > div { 16 | padding: 20px; 17 | } 18 | 19 | .scrollarea.world_map { 20 | width: 700px; 21 | height: 400px; 22 | } 23 | 24 | .scrollarea.world_map > div { 25 | background: url(demos/Drag.Scroll/world.jpg); 26 | padding: 0; 27 | height: 2028px; 28 | width: 3652px; 29 | } 30 | -------------------------------------------------------------------------------- /demos/Drag.Move/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Drag.Move 5 | 6 | description: A drag example showing how to manage droppable areas 7 | 8 | authors: 9 | - Djamil Legato 10 | 11 | docs: 12 | - name: Drag.Move 13 | url: http://mootools.net/docs/more/Drag/Drag.Move 14 | 15 | ... 16 | */ 17 | 18 |

The Drag.Move class in MooTools More makes it easy to make an element draggable, and define 'droppable' elements which can interact with the dragged element. This is a simple example showing how you define these elements and add the relevant events.

-------------------------------------------------------------------------------- /demos/Drag.Move/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | new Drag.Move($('drag'), { 5 | 6 | container: $('container'), 7 | 8 | droppables: $$('.drop'), 9 | 10 | onEnter: function(element, droppable){ 11 | droppable.setStyle('background', '#E79D35'); 12 | }, 13 | 14 | onLeave: function(element, droppable){ 15 | droppable.setStyle('background', '#6B7B95'); 16 | }, 17 | 18 | onDrop: function(element, droppable){ 19 | if (droppable) droppable.setStyle('background', '#C17878'); 20 | } 21 | 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /demos/Drag.Scroll/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Drag.Scroll 5 | 6 | description: A drag and scroll example 7 | 8 | authors: 9 | - Arian Stolwijk 10 | 11 | docs: 12 | - name: Class 13 | url: http://mootools.net/docs/core/Class/Class 14 | - name: Drag 15 | url: http://mootools.net/docs/more/Drag/Drag 16 | - name: Fx.Scroll 17 | url: http://mootools.net/docs/more/Fx/Fx.Scroll 18 | 19 | ... 20 | */ 21 | 22 |

23 | Combining drag and its invert option, and Fx.Scroll to a Google Maps or 24 | Mobile scrolling experience. 25 |

26 | -------------------------------------------------------------------------------- /demos/Element.Event.Pseudos/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Element.Event.Pseudos 5 | 6 | description: 7 | 8 | authors: 9 | - Subhaze 10 | 11 | keywords: 12 | - Element, Event, Pseudos 13 | 14 | docs: 15 | - name: Element.Event.Pseudos 16 | url: http://mootools.net/docs/more/Element/Element.Event.Pseudos 17 | - name: Event 18 | url: http://mootools.net/docs/core/Types/Event 19 | 20 | ... 21 | */ 22 | 23 |

This demo will show you how to use the provided :once pseudo event and how to create a custom pseudo event.

24 | -------------------------------------------------------------------------------- /demos/Slick.Finder/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var selector_input = $('selector'), 5 | searchDOM = $('searchDOM'), 6 | elements = $('seach_in_here'); 7 | 8 | $('selector_list').getElements('a').addEvent('click', function(event){ 9 | event.stop(); 10 | selector_input.set('value', this.get('text')); 11 | searchDOM.fireEvent('click'); 12 | }); 13 | 14 | searchDOM.addEvent('click', function(){ 15 | var selector = selector_input.get('value'); 16 | elements.getElements(selector).highlight(); 17 | }); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /demos/Sortables/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Sortables 5 | 6 | description: Sortables 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Effects 13 | 14 | docs: 15 | - name: Sortables 16 | url: http://mootools.net/docs/more/Drag/Sortables 17 | 18 | ... 19 | */ 20 | 21 |

Back in the 90s you sorted items in a list with arrows up/down or maybe even with input-fields where you specified the item's position. But now you have the Sortables-Plugin, which comes in handy when you are using one or more lists and need the user to sort them.

22 | -------------------------------------------------------------------------------- /demos/Fx.Morph/demo.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | #idList, 4 | #idList2 { 5 | margin: 0 50px 0 0; 6 | width: 130px; 7 | padding: 0; 8 | float: left; 9 | } 10 | 11 | #idList li, 12 | #idList2 li { 13 | display: block; 14 | margin: 0; 15 | padding: 4px; 16 | width: 120px; 17 | background-color: #333; 18 | color: #888; 19 | } 20 | 21 | /* The styles for the second list defined in the CSS */ 22 | .hover { 23 | background-color: #666; 24 | color: #FF8; 25 | margin-left: 5px 26 | } 27 | 28 | .default { 29 | background-color: #333; 30 | color: #888; 31 | margin-left: 0; 32 | } 33 | -------------------------------------------------------------------------------- /demos/Drag.Drop/demo.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /demos/Element.Event/demo.css: -------------------------------------------------------------------------------- 1 | textarea { 2 | float: left; 3 | background: #f8f8f8; 4 | border: 1px solid #d6d6d6; 5 | border-left-color: #e4e4e4; 6 | border-top-color: #e4e4e4; 7 | padding: 0.3em; 8 | margin-top: 10px; 9 | overflow: auto; 10 | } 11 | 12 | #log { 13 | float: left; 14 | padding: 0.5em 0em 0.2em; 15 | margin-left: 10px; 16 | width: 290px; 17 | height: 50px; 18 | border: 1px solid #d6d6d6; 19 | border-left-color: #e4e4e4; 20 | border-top-color: #e4e4e4; 21 | margin-top: 10px; 22 | font-size: 25px; 23 | font-weight: bold; 24 | text-align: center; 25 | } -------------------------------------------------------------------------------- /demos/Element.Event.Pseudos/demo.css: -------------------------------------------------------------------------------- 1 | 2 | #container { 3 | border: 1px solid #999; 4 | width: 145px; 5 | overflow: hidden; 6 | } 7 | 8 | .item { 9 | height: 40px; 10 | width: 40px; 11 | margin: 4px; 12 | float: left; 13 | background-color: #78BA91; 14 | cursor: pointer; 15 | } 16 | 17 | .active { 18 | background-color: #6B7B95; 19 | } 20 | 21 | #multiplePseudoText textarea { 22 | background: #f8f8f8; 23 | border: 1px solid #d6d6d6; 24 | border-left-color: #e4e4e4; 25 | border-top-color: #e4e4e4; 26 | padding: 0.3em; 27 | margin-top: 10px; 28 | font: 2em sans-serif; 29 | } -------------------------------------------------------------------------------- /demos/Transitions/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Transitions 5 | 6 | description: Transitions 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Transitions, Fx 13 | 14 | docs: 15 | - name: Fx.Transitions 16 | url: http://mootools.net/docs/core/Fx/Fx.Transitions 17 | - name: Fx.Morph 18 | url: http://mootools.net/docs/core/Fx/Fx.Morph 19 | - name: Event page property 20 | url: http://mootools.net/docs/core/Types/Event#Event:constructor 21 | 22 | ... 23 | */ 24 | 25 |

Shows the transitions

26 | 27 |

Click somewhere on the gray area to see the transition

28 | -------------------------------------------------------------------------------- /demos/Slider/demo.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
Change the value, to change the fontsize.
6 | 7 |

With the Slider it is damn easy to create stuff like an RGB-Color Selector which actually looks good.

8 | 9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | 19 |

Selected color:

20 | -------------------------------------------------------------------------------- /demos/MouseEnter/demo.css: -------------------------------------------------------------------------------- 1 | div.floated { 2 | width: 400px; 3 | float: left; 4 | margin-left: 1em; 5 | } 6 | 7 | div#myElement { 8 | width: 100px; 9 | height: 100px; 10 | border: 1px solid black; 11 | background-color: #f9f9f9; 12 | float: left; 13 | } 14 | 15 | div#myOtherElement { 16 | width: 200px; 17 | height: 20px; 18 | line-height: 20px; 19 | overflow: hidden; 20 | border: 1px solid black; 21 | background-color: #f9f9f9; 22 | } 23 | 24 | div#myOtherElement span, div#myOtherElement a { 25 | display: block; 26 | padding: 0 3px; 27 | } 28 | 29 | div#myOtherElement a:hover { 30 | background: #f5f5f5; 31 | } -------------------------------------------------------------------------------- /demos/Request.JSON/demo.css: -------------------------------------------------------------------------------- 1 | .preview { 2 | float: left; 3 | width: 177px; 4 | height: 200px; 5 | margin: 4px; 6 | padding: 5px; 7 | text-align: center; 8 | background-color: #F9F9F9; 9 | border-right: 1px solid #ccc; 10 | border-bottom: 1px solid #ccc; 11 | } 12 | 13 | .preview img { 14 | margin: 0; 15 | } 16 | 17 | .preview span { 18 | display: block; 19 | font-size: 11px; 20 | margin-bottom: 4px; 21 | } 22 | 23 | .popular { 24 | color: #2e8531; 25 | font-weight: bold; 26 | } 27 | 28 | .SUPERpopular { 29 | font-weight: bold; 30 | color: #d62222; 31 | } 32 | 33 | .normal { 34 | font-weight: bold; 35 | } -------------------------------------------------------------------------------- /assets/codemirror/css/sparqlcolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | .editbox p { 14 | margin: 0; 15 | } 16 | 17 | span.sp-keyword { 18 | color: #708; 19 | } 20 | 21 | span.sp-prefixed { 22 | color: #5d1; 23 | } 24 | 25 | span.sp-var { 26 | color: #00c; 27 | } 28 | 29 | span.sp-comment { 30 | color: #a70; 31 | } 32 | 33 | span.sp-literal { 34 | color: #a22; 35 | } 36 | 37 | span.sp-uri { 38 | color: #292; 39 | } 40 | 41 | span.sp-operator { 42 | color: #088; 43 | } 44 | -------------------------------------------------------------------------------- /demos/Fx.Sort/demo.css: -------------------------------------------------------------------------------- 1 | 2 | .container .sort { 3 | display: inline-block; 4 | } 5 | .sort { 6 | border: 1px solid #333; 7 | color: #FFF; 8 | cursor: pointer; 9 | margin: 3px; 10 | padding: 2px; 11 | width: 100px; 12 | } 13 | .red { 14 | background-color: #C17878; 15 | } 16 | .purple { 17 | background-color: #A87AAD; 18 | } 19 | .green { 20 | background-color: #78BA91; 21 | } 22 | .orange { 23 | background-color: #E79D35; 24 | } 25 | .blue { 26 | background-color: #6B7B95; 27 | } 28 | strong { 29 | color: #C17878; 30 | } 31 | 32 | #note { 33 | color: #A87AAD; 34 | font-size: 0.9em; 35 | } 36 | -------------------------------------------------------------------------------- /demos/Slider/demo.css: -------------------------------------------------------------------------------- 1 | .slider { 2 | background: #CCC; 3 | height: 16px; 4 | width: 200px; 5 | } 6 | .slider .knob { 7 | background: #000; 8 | width: 16px; 9 | height: 16px; 10 | } 11 | 12 | #fontSize { 13 | height: 50px; 14 | line-height: 50px; 15 | } 16 | 17 | .advanced { 18 | width: 400px; 19 | margin: 5px 0; 20 | background: #CCC; 21 | } 22 | .advanced .knob { 23 | cursor: pointer; 24 | -moz-border-radius: 6px; 25 | -webkit-border-radius: 6px; 26 | border-radius: 6px; 27 | } 28 | #red .knob { 29 | background: red; 30 | } 31 | #green .knob { 32 | background: green; 33 | } 34 | #blue .knob { 35 | background: blue; 36 | } -------------------------------------------------------------------------------- /demos/Sortables/demo.html: -------------------------------------------------------------------------------- 1 | 8 | 9 |

It is even possible to drag & drop list-elements between lists.

10 | 11 |
12 | 19 | 26 |
-------------------------------------------------------------------------------- /demos/Request.JSON/demo.html: -------------------------------------------------------------------------------- 1 |

2 | Use a JSON request when you have complex data which you would like to send in a 3 | JavaScript-readable format to a handling method on the client side. The first 4 | method passed to a Request.JSON onComplete method is the data object represented 5 | in the JSON code which was returned by the server. For more information on the 6 | JSON format, see json.org. 7 |

8 | 9 |

10 | load JSON Data | 11 | clear JSON Data 12 |

13 | 14 | 15 | -------------------------------------------------------------------------------- /demos/Fx.Morph/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Fx.Morph 5 | 6 | description: Fx.Morph demo 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Fx 13 | 14 | docs: 15 | - name: Fx.Morph 16 | url: http://mootools.net/docs/core/Fx/Fx.Morph 17 | 18 | ... 19 | */ 20 | 21 |

The always-requested hover transition

22 | 23 |

24 | For the left list the styles are defined in a JavaScript object. For the right list the styles are defined in the 25 | CSS file. Fx.Morph can fetch those styles by a simple CSS selector. The main advantage of the last approach is that 26 | you can keep your styles in the CSS, and the logic in the JavaScript. 27 |

28 | -------------------------------------------------------------------------------- /demos/Enhanced-Form/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | // The elements used. 5 | var myForm = document.id('myForm'), 6 | myResult = document.id('myResult'); 7 | 8 | // Labels over the inputs. 9 | myForm.getElements('[type=text], textarea').each(function(el){ 10 | new OverText(el); 11 | }); 12 | 13 | // Validation. 14 | new Form.Validator.Inline(myForm); 15 | 16 | // Ajax (integrates with the validator). 17 | new Form.Request(myForm, myResult, { 18 | requestOptions: { 19 | 'spinnerTarget': myForm 20 | }, 21 | extraData: { // This is just to make this example work. 22 | 'html': 'Form sent.' 23 | } 24 | }); 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /demos/Drag.Drop/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Drag.Drop 5 | 6 | description: Another simple Drag example showing droppable areas 7 | 8 | authors: 9 | - Djamil Legato 10 | 11 | docs: 12 | - name: Element:makeDraggable 13 | url: http://mootools.net/docs/more/Drag/Drag.Move#Element:makeDraggable 14 | - name: Element:morph 15 | url: http://mootools.net/docs/core/Fx/Fx.Morph#Element:morph 16 | 17 | ... 18 | */ 19 | 20 |

The Drag.Move class in MooTools More makes it easy to make an element draggable, and define 'droppable' elements which can interact with the dragged element. This is a simple example showing how you define these elements and add the relevant events.

-------------------------------------------------------------------------------- /demos/Slider/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var slider = $('slider'); 5 | 6 | new Slider(slider, slider.getElement('.knob'), { 7 | range: [9, 35], 8 | initialStep: 14, 9 | onChange: function(value){ 10 | if (value) $('fontSize').setStyle('font-size', value); 11 | } 12 | }); 13 | 14 | 15 | var color = [0, 0, 0]; 16 | 17 | $$('.advanced.slider').each(function(slider, i){ 18 | new Slider(slider, slider.getElement('.knob'), { 19 | steps: 255, 20 | wheel: true, 21 | onChange: function(){ 22 | color[i] = this.step; 23 | $('setColor').setStyle('color', color).set('text', color.rgbToHex()); 24 | } 25 | }); 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /demos/Effects/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Effects 5 | 6 | description: Effects 7 | 8 | authors: 9 | - Darren Waddell 10 | 11 | docs: 12 | - name: Fx.Tween 13 | url: http://mootools.net/docs/core/Fx/Fx.Tween 14 | - name: Fx.Morph 15 | url: http://mootools.net/docs/core/Fx/Fx.Morph 16 | - name: Element:tween 17 | url: http://mootools.net/docs/core/Fx/Fx.Tween#Element:tween 18 | - name: Element:morph 19 | url: http://mootools.net/docs/core/Fx/Fx.Morph#Element:morph 20 | - name: Element:erase 21 | url: http://mootools.net/docs/core/Element/Element#Element:erase 22 | 23 | ... 24 | */ 25 | 26 |

The powerful Fx Classes allow you to change any number of css styles with any transition and any duration.

-------------------------------------------------------------------------------- /demos/MouseWheel/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | 5 | var up = $('up'), 6 | down = $('down'), 7 | arrows = $$(up, down), 8 | log; 9 | 10 | arrows.setStyle('opacity', 0.1); 11 | 12 | document.addEvent('mousewheel', function(event){ 13 | 14 | /* Mousewheel UP */ 15 | if (event.wheel > 0){ 16 | up.setStyle('opacity', 1); 17 | down.setStyle('opacity', 0.1); 18 | log = 'up'; 19 | } 20 | /* Mousewheel DOWN*/ 21 | else if (event.wheel < 0){ 22 | up.setStyle('opacity', 0.1); 23 | down.setStyle('opacity', 1); 24 | log = 'down'; 25 | } 26 | 27 | $('log').set('html', log); 28 | 29 | var cls = function(){ 30 | arrows.setStyle('opacity', 0.1); 31 | }.delay(100); 32 | }); 33 | 34 | }); 35 | -------------------------------------------------------------------------------- /demos/Drag.Drop/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | $$('#draggables DIV').makeDraggable({ 5 | 6 | droppables: $$('#droppables DIV'), 7 | 8 | onEnter: function(draggable, droppable){ 9 | droppable.setStyle('background', '#E79D35'); 10 | }, 11 | 12 | onLeave: function(draggable, droppable){ 13 | droppable.setStyle('background', '#6B7B95'); 14 | }, 15 | 16 | onDrop: function(draggable, droppable){ 17 | if (droppable){ 18 | draggable.destroy(); 19 | droppable.morph({ 20 | 'height': droppable.getStyle('height').toInt() + 30, 21 | 'background-color' : ['#E79D35', '#6B7B95'] 22 | }); 23 | } else { 24 | draggable.setStyle('background', '#C17878'); 25 | } 26 | } 27 | 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /Request.php: -------------------------------------------------------------------------------- 1 | 28 | MooTools More has several plugins to enhance your forms, with a Form Validator, 29 | send your data with Request, and display text in your input fields with 30 | OverText. 31 |

32 | -------------------------------------------------------------------------------- /demos/MouseEnter/demo.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Why? MooTools features mouseenter and mouseleave because mouseover/mouseout sometimes 4 | just does not work as expected. Mouseenter only fires once you enter the element and 5 | does not fire again if your mouse crosses over children of the element. 6 |
7 |
8 | 9 |
10 |

Menu Example

11 |

12 | This example explains how to open a menu-like element on mouseenter and 13 | how it closes again on mouseleave. 14 |

15 |
16 | Menu 17 |
18 | Menuelement 1 19 | Menuelement 2 20 | Menuelement 3 21 |
22 |
-------------------------------------------------------------------------------- /assets/codemirror/css/csscolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | pre.code, .editbox { 14 | color: #666; 15 | } 16 | 17 | .editbox p { 18 | margin: 0; 19 | } 20 | 21 | span.css-at { 22 | color: #708; 23 | } 24 | 25 | span.css-unit { 26 | color: #281; 27 | } 28 | 29 | span.css-value { 30 | color: #281; 31 | } 32 | 33 | span.css-identifier { 34 | color: #666; 35 | } 36 | 37 | span.css-selector { 38 | color: #313334; 39 | } 40 | 41 | span.css-important { 42 | color: #00F; 43 | } 44 | 45 | span.css-colorcode { 46 | color: #281; 47 | } 48 | 49 | span.css-comment { 50 | color: #A70; 51 | } 52 | 53 | span.css-string { 54 | color: #A22; 55 | } 56 | -------------------------------------------------------------------------------- /demos/Drag.Move/demo.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | 30 |
-------------------------------------------------------------------------------- /assets/codemirror/css/docs.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 3em 6em; 4 | color: black; 5 | max-width: 50em; 6 | } 7 | 8 | h1 { 9 | font-size: 22pt; 10 | } 11 | 12 | .underline { 13 | border-bottom: 3px solid #C44; 14 | } 15 | 16 | h2 { 17 | font-size: 14pt; 18 | } 19 | 20 | h3 { 21 | font-size: 12pt; 22 | } 23 | 24 | p.rel { 25 | padding-left: 2em; 26 | text-indent: -2em; 27 | } 28 | 29 | div.border { 30 | border: 1px solid black; 31 | } 32 | 33 | code { 34 | font-family: courier, monospace; 35 | font-size: 90%; 36 | color: #144; 37 | } 38 | 39 | pre.code { 40 | margin: 1.1em 12px; 41 | border: 1px solid #CCCCCC; 42 | color: black; 43 | padding: .4em; 44 | font-family: courier, monospace; 45 | } 46 | 47 | .warn { 48 | color: #C00; 49 | } 50 | 51 | dl dl { 52 | margin: 0; 53 | } -------------------------------------------------------------------------------- /assets/codemirror/css/xmlcolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | .editbox p { 14 | margin: 0; 15 | } 16 | 17 | span.xml-tagname { 18 | color: #666; 19 | } 20 | 21 | span.xml-attribute { 22 | color: #489A1B; 23 | } 24 | 25 | span.xml-punctuation { 26 | color: black; 27 | } 28 | 29 | span.xml-attname { 30 | color: #666; 31 | } 32 | 33 | span.xml-comment { 34 | color: #A70; 35 | } 36 | 37 | span.xml-cdata { 38 | color: #48A; 39 | } 40 | 41 | span.xml-processing { 42 | color: #999; 43 | } 44 | 45 | span.xml-entity { 46 | color: #A22; 47 | } 48 | 49 | span.xml-error { 50 | color: #F00 !important; 51 | } 52 | 53 | span.xml-text { 54 | color: black; 55 | } 56 | -------------------------------------------------------------------------------- /demos/Element.Delegation/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function() { 3 | 4 | var output = $('output'), 5 | container = $('container'), 6 | timer; 7 | 8 | // Element.Delegation setup 9 | container.addEvent('click:relay(.item)', function(){ 10 | 11 | // Check whether it is a new div or not with the Element:hasClass method 12 | var message = this.hasClass('new') ? 'new div clicked!' : 'div clicked!'; 13 | output.set('text', message); 14 | 15 | this.set('tween', {link: 'chain'}).fade(0.5).fade(1); 16 | 17 | clearTimeout(timer); 18 | timer = (function(){ // clear the message after 1000 ms 19 | output.set('text', ''); 20 | }).delay(1000); 21 | 22 | }); 23 | 24 | // Add new divs 25 | $('addDiv').addEvent('click', function(){ 26 | container.grab(new Element('div.item.new'), 'top'); 27 | }); 28 | 29 | }); 30 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/sql/css/sqlcolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | .editbox p { 14 | margin: 0; 15 | } 16 | 17 | span.sql-keyword { 18 | color: blue; 19 | } 20 | 21 | span.sql-var { 22 | color: red; 23 | } 24 | 25 | span.sql-comment { 26 | color: #AA7700; 27 | } 28 | 29 | span.sql-literal { 30 | color: green; 31 | } 32 | 33 | span.sql-operator { 34 | color: blue; 35 | } 36 | 37 | span.sql-word { 38 | color: black; 39 | } 40 | 41 | span.sql-function { 42 | color: darkorange; 43 | } 44 | 45 | span.sql-type { 46 | color: purple; 47 | } 48 | 49 | span.sql-separator { 50 | color: #666666; 51 | } 52 | 53 | span.sql-number { 54 | color: darkcyan; 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/plsql/css/plsqlcolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | .editbox p { 14 | margin: 0; 15 | } 16 | 17 | span.plsql-keyword { 18 | color: blue; 19 | } 20 | 21 | span.plsql-var { 22 | color: red; 23 | } 24 | 25 | span.plsql-comment { 26 | color: #AA7700; 27 | } 28 | 29 | span.plsql-literal { 30 | color: green; 31 | } 32 | 33 | span.plsql-operator { 34 | color: blue; 35 | } 36 | 37 | span.plsql-word { 38 | color: black; 39 | } 40 | 41 | span.plsql-function { 42 | color: darkorange; 43 | } 44 | 45 | span.plsql-type { 46 | color: purple; 47 | } 48 | 49 | span.plsql-separator { 50 | color: #666666; 51 | } 52 | 53 | span.plsql-number { 54 | color: darkcyan; 55 | } 56 | 57 | 58 | -------------------------------------------------------------------------------- /demos/Drag.Cart/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Drag.Cart 5 | 6 | description: A shopping cart demo 7 | 8 | authors: 9 | - The MooTools Development Team 10 | 11 | docs: 12 | - name: Drag.Move 13 | url: http://mootools.net/docs/more/Drag/Drag.Move 14 | - name: Drag 15 | url: http://mootools.net/docs/more/Drag/Drag 16 | - name: Element:addEvent 17 | url: http://mootools.net/docs/core/Element/Element.Event#Element:addEvent 18 | - name: Event:stop 19 | url: http://mootools.net/docs/core/Types/Event#Event:stop 20 | - name: Element:getCoordinates 21 | url: http://mootools.net/docs/core/Element/Element.Dimensions#Element:getCoordinates 22 | - name: "Fx.Tween element methods: Element:highlight and Elementtween" 23 | url: http://mootools.net/docs/core/Fx/Fx.Tween#Element 24 | 25 | ... 26 | */ 27 | 28 |

Ghost dragging for Shopping Carts.

-------------------------------------------------------------------------------- /assets/codemirror/css/jscolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | pre.code, .editbox { 14 | color: #666666; 15 | } 16 | 17 | .editbox p { 18 | margin: 0; 19 | } 20 | 21 | span.js-punctuation { 22 | color: #666; 23 | } 24 | 25 | span.js-operator { 26 | color: #666666; 27 | } 28 | 29 | span.js-keyword { 30 | color: #9A6F1B; 31 | } 32 | 33 | span.js-atom { 34 | color: #70483D; 35 | } 36 | 37 | span.js-variable { 38 | color: #313334; 39 | } 40 | 41 | span.js-variabledef { 42 | color: #313334; 43 | } 44 | 45 | span.js-localvariable { 46 | color: #313334; 47 | } 48 | 49 | span.js-property { 50 | color: #666; 51 | } 52 | 53 | span.js-comment { 54 | color: #888; 55 | } 56 | 57 | span.js-string { 58 | color: #489A1B; 59 | } 60 | -------------------------------------------------------------------------------- /demos/Fx.Sort/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Fx.Sort 5 | 6 | description: With Fx.Sort you can reorder a group of items with a transition. 7 | 8 | authors: 9 | - subhaze 10 | 11 | docs: 12 | - name: Fx.Sort 13 | url: http://mootools.net/docs/more/Fx/Fx.Sort 14 | - name: Fx.Elements 15 | url: http://mootools.net/docs/more/Fx/Fx.Elements 16 | - name: Fx 17 | url: http://mootools.net/docs/core/Fx/Fx 18 | 19 | ... 20 | */ 21 | 22 |

With Fx.Sort you can reorder a group of items with a transition.

23 |

Notice: Fx.Sort does not, by default, reorder the DOM; it just puts the elements into x/y locations that imply the sort, but their location in the DOM remains unless you execute Fx.Sort:rearrangeDOM.

24 | -------------------------------------------------------------------------------- /demos/Accordion/demo.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |

What is MooTools?

5 | 6 |
7 |

MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer.

8 |

It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.

9 |
10 | 11 |

Cool! What licence does it have?

12 | 13 |
14 |

MooTools is released under the Open Source MIT license, which gives you the possibility to use it and modify it in every circumstance.

15 |
16 | 17 |

What browsers does it support?

18 | 19 |
20 |

MooTools is compatible and fully tested with Safari 3+, Internet Explorer 6+, Firefox 2+ (and browsers based on gecko), Opera 9+, and Chrome 4+.

21 |
22 | 23 |
-------------------------------------------------------------------------------- /assets/codemirror/contrib/csharp/css/csharpcolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | pre.code, .editbox { 14 | color: #666666; 15 | } 16 | 17 | .editbox p { 18 | margin: 0; 19 | } 20 | 21 | span.csharp-punctuation { 22 | color: green; 23 | } 24 | 25 | span.csharp-operator { 26 | color: purple; 27 | } 28 | 29 | span.csharp-keyword { 30 | color: blue; 31 | } 32 | 33 | span.csharp-atom { 34 | color: brown; 35 | } 36 | 37 | span.csharp-variable { 38 | color: black; 39 | } 40 | 41 | span.csharp-variabledef { 42 | color: #0000FF; 43 | } 44 | 45 | span.csharp-localvariable { 46 | color: #004499; 47 | } 48 | 49 | span.csharp-property { 50 | color: black; 51 | } 52 | 53 | span.csharp-comment { 54 | color: green; 55 | } 56 | 57 | span.csharp-string { 58 | color: red; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /demos/Native/demo.js: -------------------------------------------------------------------------------- 1 | 2 | // We add the "equalize" and "setRandom" methods to Elements 3 | Elements.implement({ 4 | 5 | equalize: function(property){ 6 | var sum = 0, i, len; 7 | len = i = this.length; 8 | while (i--) sum += this[i].getDimensions()[property]; 9 | var average = Math.round(sum / len); 10 | i = len; 11 | while (i--) this.tween(property, average); 12 | return this; 13 | }, 14 | 15 | setRandom: function(property, min, max){ 16 | var i = this.length, value; 17 | while (i--){ 18 | value = Math.round(min + (max - min) * Math.random()); 19 | this[i].tween(property, value); 20 | } 21 | return this; 22 | } 23 | 24 | }); 25 | 26 | window.addEvent('domready', function(){ 27 | 28 | var els = $$('div.element'), i = false; 29 | 30 | $('link').addEvent('click', function(event){ 31 | event.stop(); 32 | 33 | i = !i 34 | 35 | if (i) els.equalize('height'); 36 | else els.setRandom('height', 30, 150); 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /demos/Slick.Finder/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Slick.Finder 5 | 6 | description: A demo of Slick.Finder including its awesome Reversed Combinators 7 | 8 | keywords: 9 | - Drag 10 | 11 | docs: 12 | - name: Slick on Github 13 | url: https://github.com/mootools/slick 14 | - name: Reversed Combinators Wiki on Github 15 | url: https://github.com/mootools/slick/wiki/reversed-combinators 16 | - name: W3C Selectors 17 | url: http://www.w3.org/TR/css3-selectors/#selectors 18 | 19 | ... 20 | */ 21 | 22 |

23 | A new standalone selector engine that is totally slick! And it is the new Selector Engine of MooTools 24 |

25 | 26 |

27 | Reversed Combinators are a classification of combinators that are the reverse of their original. They redirect the flow of 28 | selectors and combinators to travel up the node tree rather than down. Slick implements these by prepending ! to a selector 29 | or combinator. 30 |

31 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/lua/css/luacolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | pre.code, .editbox { 14 | color: #666666; 15 | } 16 | 17 | .editbox p { 18 | margin: 0; 19 | } 20 | 21 | span.lua-comment { 22 | color: #BB9977; 23 | } 24 | 25 | span.lua-keyword { 26 | font-weight: bold; 27 | color: blue; 28 | } 29 | 30 | span.lua-string { 31 | color: #AA2222; 32 | } 33 | 34 | span.lua-stdfunc { 35 | font-weight: bold; 36 | color: #077; 37 | } 38 | span.lua-customfunc { 39 | font-weight: bold; 40 | color: #0AA; 41 | } 42 | 43 | 44 | span.lua-identifier { 45 | color: black; 46 | } 47 | 48 | span.lua-number { 49 | color: #3A3; 50 | } 51 | 52 | span.lua-token { 53 | color: #151; 54 | } 55 | 56 | span.lua-error { 57 | color: #FFF; 58 | background-color: #F00; 59 | } 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /demos/Effects/demo.html: -------------------------------------------------------------------------------- 1 | 2 |
MooTools
3 | 4 |
5 | 6 |

Simple Fx

7 | 19 | 20 |

More Fx

21 | 26 | 27 |

Reset

28 | 29 |
30 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/ometa/css/ometacolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | margin: .4em; 7 | padding: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | color: black; 11 | } 12 | 13 | pre.code, .editbox { 14 | color: #666666; 15 | } 16 | 17 | .editbox p { 18 | margin: 0; 19 | } 20 | 21 | span.js-punctuation { 22 | color: #666666; 23 | } 24 | 25 | span.js-operator { 26 | color: #E1570F; 27 | } 28 | 29 | span.js-keyword { 30 | color: #770088; 31 | } 32 | 33 | span.js-atom { 34 | color: #228811; 35 | } 36 | 37 | span.js-variable { 38 | color: black; 39 | } 40 | 41 | span.js-variabledef { 42 | color: #0000FF; 43 | } 44 | 45 | span.js-localvariable { 46 | color: #004499; 47 | } 48 | 49 | span.js-property { 50 | color: black; 51 | } 52 | 53 | span.js-comment { 54 | color: #AA7700; 55 | } 56 | 57 | span.js-string { 58 | color: #AA2222; 59 | } 60 | 61 | span.ometa-binding { 62 | color: #FF0000; 63 | } 64 | -------------------------------------------------------------------------------- /demos/Drag.Cart/demo.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | Shirt 1 5 |
6 |
7 | Shirt 2 8 |
9 |
10 | Shirt 3 11 |
12 |
13 | Shirt 4 14 |
15 |
16 | Shirt 5 17 |
18 |
19 | Shirt 6 20 |
21 |
22 |
23 |
Drag Items Here
24 |
-------------------------------------------------------------------------------- /demos/Native/demo.html: -------------------------------------------------------------------------------- 1 |

Execute Example

2 | 3 |
4 |
5 |
6 |
7 |
8 |
9 | 10 |

Code:

11 |
Elements.implement({
12 | 
13 | 	equalize: function(property){
14 | 		var sum = 0, i, len;
15 | 		len = i = this.length;
16 | 		while (i--) sum += this[i].getDimensions()[property];
17 | 		var average = Math.round(sum / len);
18 | 		i = len;
19 | 		while (i--) this.tween(property, average);
20 | 		return this;
21 | 	},
22 | 
23 | 	setRandom: function(property, min, max){
24 | 		var i = this.length, value;
25 | 		while (i--){
26 | 			value = Math.round(min + (max - min) * Math.random());
27 | 			this[i].tween(property, value);
28 | 		}
29 | 		return this;
30 | 	}
31 | 
32 | });
33 | 34 |

Usage:

35 |
myElements.equalize(property);
36 | myElements.setRandom(property, min, max);
37 | -------------------------------------------------------------------------------- /demos/Native/demo.details: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | name: Native 5 | 6 | description: How to add natives to MooTools 7 | 8 | authors: 9 | - 10 | 11 | keywords: 12 | - Native 13 | 14 | ... 15 | */ 16 | 17 |

18 | There are times you may ask yourself "Why isn't that part of MooTools?" and while 19 | there are possibly a lot of answers to that it simply could be that it is something with only small usage. 20 |

21 |

22 | For that reason MooTools made it easy for you to extend any native object like Arrays, Strings etc. to add the 23 | functionality you want. 24 |

25 |

26 | In this example you will learn how to extend the Elements-Object with two custom methods. For this example 27 | we create two methods, the first equalize method calculates the average of a certain property, 28 | and applies it with the tween method. The setRandom tweens the property to a random value between 29 | the min and max values. 30 |

31 | -------------------------------------------------------------------------------- /assets/codemirror/js/parsedummy.js: -------------------------------------------------------------------------------- 1 | var DummyParser = Editor.Parser = (function() { 2 | function tokenizeDummy(source) { 3 | while (!source.endOfLine()) source.next(); 4 | return "text"; 5 | } 6 | function parseDummy(source) { 7 | function indentTo(n) {return function() {return n;}} 8 | source = tokenizer(source, tokenizeDummy); 9 | var space = 0; 10 | 11 | var iter = { 12 | next: function() { 13 | var tok = source.next(); 14 | if (tok.type == "whitespace") { 15 | if (tok.value == "\n") tok.indentation = indentTo(space); 16 | else space = tok.value.length; 17 | } 18 | return tok; 19 | }, 20 | copy: function() { 21 | var _space = space; 22 | return function(_source) { 23 | space = _space; 24 | source = tokenizer(_source, tokenizeDummy); 25 | return iter; 26 | }; 27 | } 28 | }; 29 | return iter; 30 | } 31 | return {make: parseDummy}; 32 | })(); 33 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/plsql/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Peter Raganitsch 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any 5 | damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any 8 | purpose, including commercial applications, and to alter it and 9 | redistribute it freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must 12 | not claim that you wrote the original software. If you use this 13 | software in a product, an acknowledgment in the product 14 | documentation would be appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must 17 | not be misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | 22 | Peter Raganitsch 23 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/sql/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 John Benediktsson 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any 5 | damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any 8 | purpose, including commercial applications, and to alter it and 9 | redistribute it freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must 12 | not claim that you wrote the original software. If you use this 13 | software in a product, an acknowledgment in the product 14 | documentation would be appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must 17 | not be misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | 22 | John Benediktsson 23 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/scheme/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Danny Yoo 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any 5 | damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any 8 | purpose, including commercial applications, and to alter it and 9 | redistribute it freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must 12 | not claim that you wrote the original software. If you use this 13 | software in a product, an acknowledgment in the product 14 | documentation would be appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must 17 | not be misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | 22 | Danny Yoo 23 | dyoo@cs.wpi.edu 24 | -------------------------------------------------------------------------------- /assets/codemirror/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2010 Marijn Haverbeke 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any 5 | damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any 8 | purpose, including commercial applications, and to alter it and 9 | redistribute it freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must 12 | not claim that you wrote the original software. If you use this 13 | software in a product, an acknowledgment in the product 14 | documentation would be appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must 17 | not be misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | 22 | Marijn Haverbeke 23 | marijnh@gmail.com 24 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/python/css/pythoncolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | } 4 | 5 | .editbox { 6 | padding: .4em; 7 | margin: 0; 8 | font-family: monospace; 9 | font-size: 10pt; 10 | line-height: 1.1em; 11 | color: black; 12 | } 13 | 14 | pre.code, .editbox { 15 | color: #666666; 16 | } 17 | 18 | .editbox p { 19 | margin: 0; 20 | } 21 | 22 | span.py-delimiter, span.py-special { 23 | color: #666666; 24 | } 25 | 26 | span.py-operator { 27 | color: #666666; 28 | } 29 | 30 | span.py-error { 31 | background-color: #660000; 32 | color: #FFFFFF; 33 | } 34 | 35 | span.py-keyword { 36 | color: #770088; 37 | font-weight: bold; 38 | } 39 | 40 | span.py-literal { 41 | color: #228811; 42 | } 43 | 44 | span.py-identifier, span.py-func { 45 | color: black; 46 | } 47 | 48 | span.py-type, span.py-decorator { 49 | color: #0000FF; 50 | } 51 | 52 | span.py-comment { 53 | color: #AA7700; 54 | } 55 | 56 | span.py-string, span.py-bytes, span.py-raw, span.py-unicode { 57 | color: #AA2222; 58 | } 59 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/scheme/css/schemecolors.css: -------------------------------------------------------------------------------- 1 | html { 2 | cursor: text; 3 | width: 100%; 4 | height: 100%; 5 | background-color: white; 6 | } 7 | 8 | .editbox { 9 | width: 100%; 10 | height: 100%; 11 | margin: 0pt; 12 | padding: 0; 13 | font-family: monospace; 14 | font-size: 10pt; 15 | color: black; 16 | } 17 | 18 | 19 | 20 | pre.code, .editbox { 21 | color: #666666; 22 | } 23 | 24 | .editbox p { 25 | margin: 0; 26 | } 27 | 28 | span.scheme-string {color: green;} 29 | span.scheme-number {color: blue;} 30 | span.scheme-boolean {color: darkred;} 31 | span.scheme-character {color: orange;} 32 | span.scheme-symbol {color: steelblue;} 33 | span.scheme-punctuation {color: black;} 34 | span.scheme-lparen {color: black;} 35 | span.scheme-rparen {color: black;} 36 | span.scheme-comment { color: orange; } 37 | 38 | span.good-matching-paren { 39 | font-weight: bold; 40 | color: #3399FF; 41 | } 42 | span.bad-matching-paren { 43 | font-weight: bold; 44 | color: red; 45 | } 46 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/ometa/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2009 Marijn Haverbeke 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any 5 | damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any 8 | purpose, including commercial applications, and to alter it and 9 | redistribute it freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must 12 | not claim that you wrote the original software. If you use this 13 | software in a product, an acknowledgment in the product 14 | documentation would be appreciated but is not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must 17 | not be misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source 20 | distribution. 21 | 22 | Marijn Haverbeke 23 | marijnh at gmail 24 | -------------------------------------------------------------------------------- /demos/Effects/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function() { 3 | 4 | $$('.simple-fx LI').addEvent('click', function(){ 5 | 6 | var property = $(this).get('data-property'); 7 | var to = $(this).get('data-value'); 8 | 9 | $('element').tween(property, to); 10 | 11 | }); 12 | 13 | 14 | $('morph-1').addEvent('click', function(){ 15 | $('element').morph({ 16 | 'background-color': '#F9F9F9', 17 | 'color': '#78BA91', 18 | 'width': '200px' 19 | }); 20 | }); 21 | 22 | $('morph-2').addEvent('click', function(){ 23 | $('element').morph({ 24 | 'background-color': '#E79D35', 25 | 'border-width': '1px', 26 | 'border-style': 'solid', 27 | 'border-color': '#000000', 28 | 'color': '#fff', 29 | 'height': '45px', 30 | 'opacity': '0.6', 31 | 'width': '100px' 32 | }); 33 | }); 34 | 35 | $('morph-3').addEvent('click', function(){ 36 | $('element').morph('.myClass') 37 | }); 38 | 39 | 40 | $('reset').addEvent('click', function(){ 41 | $('element').erase('style'); 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /demos/Drag.Cart/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | $$('.item').addEvent('mousedown', function(event){ 5 | event.stop(); 6 | 7 | // `this` refers to the element with the .item class 8 | var shirt = this; 9 | 10 | var clone = shirt.clone().setStyles(shirt.getCoordinates()).setStyles({ 11 | opacity: 0.7, 12 | position: 'absolute' 13 | }).inject(document.body); 14 | 15 | var drag = new Drag.Move(clone, { 16 | 17 | droppables: $('cart'), 18 | 19 | onDrop: function(dragging, cart){ 20 | 21 | dragging.destroy(); 22 | 23 | if (cart != null){ 24 | shirt.clone().inject(cart); 25 | cart.highlight('#7389AE', '#FFF'); 26 | } 27 | }, 28 | onEnter: function(dragging, cart){ 29 | cart.tween('background-color', '#98B5C1'); 30 | }, 31 | onLeave: function(dragging, cart){ 32 | cart.tween('background-color', '#FFF'); 33 | }, 34 | onCancel: function(dragging){ 35 | dragging.destroy(); 36 | } 37 | }); 38 | drag.start(event); 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /demos/Enhanced-Form/demo.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | Contact form example 5 | 19 | 20 |
21 | 22 |
23 | 24 |
25 | 26 |
27 | -------------------------------------------------------------------------------- /demos/Drag.Cart/demo.css: -------------------------------------------------------------------------------- 1 | #items { 2 | float: left; 3 | border: 1px solid #F9F9F9; 4 | width: 525px; 5 | } 6 | 7 | .item { 8 | background-color: #FFF; 9 | background-position: left top; 10 | background-repeat: no-repeat; 11 | border: 1px solid #EEE; 12 | border-bottom: 2px solid #DDD; 13 | border-right: 2px solid #DDD; 14 | cursor: move; 15 | float: left; 16 | height: 175px; 17 | margin: 10px; 18 | position: relative; 19 | width: 150px; 20 | } 21 | .item span { 22 | bottom: 0; 23 | font-size: 8px; 24 | font-weight: bold; 25 | left: 0; 26 | position: absolute; 27 | text-align: center; 28 | width: 100%; 29 | } 30 | 31 | #cart { 32 | background-color: #FFF; 33 | border: 1px solid #F9F9F9; 34 | float: right; 35 | padding-bottom: 50px; 36 | width: 195px; 37 | } 38 | #cart .info { 39 | color: #444; 40 | font-size: 9px; 41 | font-weight: bold; 42 | text-align: center; 43 | } 44 | #cart .item { 45 | background-position: 50% -22px; 46 | border-width: 1px; 47 | cursor: default; 48 | height: 85px; 49 | margin: 5px; 50 | width: 85px; 51 | } -------------------------------------------------------------------------------- /demos/Periodical/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var effect = new Fx.Tween('box', {duration: 800}), 5 | periodical; 6 | 7 | // Create the function wich will run the effect 8 | var fx = function() { 9 | effect.start('background-color', '#6B7B95').chain(function(){ 10 | effect.start('background-color', '#E79D35'); 11 | }); 12 | // return this function, so you could do fx() which returns fx, 13 | //or fx()()() which still returns fx and runs the function 3 times 14 | return fx; 15 | }; 16 | 17 | $('start').addEvent('click', function(event){ 18 | event.stop(); 19 | // We call the fx function once directly, which returns the fx function again, and set the periodical to 1.7 seconds 20 | // We store the reference to the peridical in the peridical, so we can stop it later 21 | periodical = fx().periodical(1700); 22 | }); 23 | 24 | $('stop').addEvent('click', function(event){ 25 | event.stop(); 26 | // With the JavaScipt function clearInterval we can stop the interval 27 | clearInterval(periodical); 28 | }); 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /demos/Request.HTML/demo.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | window.addEvent('domready', function(){ 4 | 5 | $('makeRequest').addEvent('click', function(event){ 6 | event.stop(); 7 | 8 | new Request.HTML({ 9 | 10 | url: '/echo/html/', 11 | 12 | onRequest: function(){ 13 | $('result').set('text', 'loading...'); 14 | }, 15 | 16 | onComplete: function(response){ 17 | $('result').empty().adopt(response); 18 | }, 19 | 20 | data: { 21 | // This is some content that the server will return 22 | // we pass this only for our demo runner and jsfiddle 23 | html: '

The Request Was Successful

' + 24 | '

Here is some HTML content. It\'s pretty neat, isn\'t it?

' + 25 | '

It does not have to be a complete page, since the <head> section is already present in the parent page.

' + 26 | '

If we had things inside this HTML that needed some MooTools love (the sort of things that go inside the domready event), we would have to call our scripts\' attention to this code manually.

' 27 | } 28 | 29 | }).send(); 30 | 31 | }); 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /demos/Request/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var result = $('result'); 5 | 6 | //We can use one Request object many times. 7 | var req = new Request({ 8 | 9 | url: '/echo/html/', 10 | 11 | onRequest: function(){ 12 | result.set('text', 'Loading...'); 13 | }, 14 | 15 | onSuccess: function(txt){ 16 | result.set('text', txt); 17 | }, 18 | 19 | // Our request will most likely succeed, but just in case, we'll add an 20 | // onFailure method which will let the user know what happened. 21 | onFailure: function(){ 22 | result.set('text', 'The request failed.'); 23 | } 24 | 25 | }); 26 | 27 | $('makeRequest').addEvent('click', function(event){ 28 | event.stop(); 29 | req.send({data: { // our demo runner and jsfiddle will return this as return html 30 | html: 'The request was successful!' 31 | }}); 32 | }); 33 | 34 | $('failedRequest').addEvent('click', function(event){ 35 | event.stop(); 36 | //We can pass new options for our Request object to the send method. 37 | req.send({url: 'Request/not_here.txt'}); 38 | }); 39 | 40 | }); 41 | -------------------------------------------------------------------------------- /demos/Fx.Morph/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | // First list, using CSS styles in the JavaScript 5 | var list = $$('#idList LI'); 6 | 7 | list.set('morph', { 8 | duration: 200 9 | }); 10 | 11 | list.addEvents({ 12 | 13 | mouseenter: function(){ 14 | // this refers to the element in an event 15 | this.morph({ 16 | 'background-color': '#666', 17 | 'color': '#FF8', 18 | 'margin-left': 5 19 | }); 20 | }, 21 | 22 | mouseleave: function(){ 23 | // this refers to the element in an event 24 | this.morph({ 25 | 'background-color': '#333', 26 | 'color': '#888', 27 | 'margin-left': 0 28 | }); 29 | } 30 | 31 | }); 32 | 33 | // Morphing the list with CSS selectors 34 | $$('#idList2 LI').each(function(el){ 35 | el.set('morph', { 36 | duration: 200 37 | }).addEvents({ 38 | // Using Function:pass, which is a shorter alternative for 39 | // function(){ 40 | // el.morph('.hover'); 41 | // } 42 | mouseenter: el.morph.pass('.hover', el), 43 | mouseleave: el.morph.pass('.default', el) 44 | }); 45 | }); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /demos/Transitions/demo.html: -------------------------------------------------------------------------------- 1 |
2 | : 3 | 16 | 21 | : 22 | 23 |
24 | 25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2010-2011 by The MooTools Dev Team (http://mootools.net/developers) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /assets/codemirror/sparqltest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Sparql demonstration 5 | 6 | 7 | 8 | 9 |

Demonstration of CodeMirror's Sparql 10 | highlighter.

11 | 12 |
13 | 29 |
30 | 31 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /demos/Element.Event.Pseudos/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function() { 3 | 4 | // `:once` psuedo event provided by mootools-more 5 | $('clickOnce').addEvent('click:once', function(event){ 6 | event.stop(); 7 | 8 | this.set('tween', { 9 | transition: 'bounce:out', 10 | duration: 'long' 11 | }).tween('margin-left', 300); 12 | }); 13 | 14 | // we can define our own pseudo events as well, for example to check for the alt key 15 | DOMEvent.definePseudo('alt', function(split, fn, args){ 16 | // args[0] is the Event instance 17 | if(args[0].alt) fn.apply(this, args); 18 | }); 19 | 20 | // apply the psuedo event to some elements 21 | $$('.item').addEvent('click:alt', function(){ 22 | this.toggleClass('active'); 23 | }); 24 | 25 | // use multiple pseudos 26 | $('multiplePseudoText').addEvent('keydown:relay(textarea):keys(enter):once', function(event, el){ 27 | el.set('value', 'MooTools!!').highlight(); 28 | }); 29 | 30 | // pause pseudo event, you can define the pause, otherwise it will use the default (250) 31 | var spinner = $('spinner').setStyle('opacity', 0).set('tween', { 32 | link: 'chain' 33 | }); 34 | $('pauseEvent').addEvent('keydown:pause(200)', function(){ 35 | spinner.get('tween').cancel(); 36 | spinner.fade(1).pauseFx(400).fade(0); 37 | }); 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /demos/Element.Event.Pseudos/demo.html: -------------------------------------------------------------------------------- 1 |

Only fires once:

2 | Click me and I'll just fire once and no more! 3 | 4 |

:alt Pseudo

5 | 6 |

Hold the Alt key and click a block to toggle the .active class.

7 | 8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 |

Multiple Pseudos

18 | 19 | This demo uses the keydown:relay(textarea):keys(enter):once event: 20 | 21 |
22 | 23 |
24 | 25 |

:pause Pseudo

26 | 27 |

28 | This Pseudo Event prevents the event function from firing immediately after 29 | every keystroke. :pause instead waits for a pause in keystrokes of 30 | a optional amount of time (in milliseconds) to pass before firing. This is for 31 | example very useful when you want to validate the field when the user is 32 | ready typing, or if you do some Requests in an efficient way. 33 |

34 | 35 | 36 | Spinner 37 | -------------------------------------------------------------------------------- /demos/MouseEnter/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | //First Example 5 | var el = $('myElement'), 6 | color = el.getStyle('backgroundColor'); 7 | 8 | // We are setting the opacity of the element to 0.5 and adding two events 9 | $('myElement').set('opacity', 0.5).addEvents({ 10 | mouseenter: function(){ 11 | // This morphes the opacity and backgroundColor 12 | this.morph({ 13 | 'opacity': 0.6, 14 | 'background-color': '#E79D35' 15 | }); 16 | }, 17 | mouseleave: function(){ 18 | // Morphes back to the original style 19 | this.morph({ 20 | opacity: 0.5, 21 | backgroundColor: color 22 | }); 23 | } 24 | }); 25 | 26 | // Second Example 27 | 28 | // The same as before: adding events 29 | $('myOtherElement').addEvents({ 30 | mouseenter: function(){ 31 | // Always sets the duration of the tween to 1000 ms and a bouncing transition 32 | // And then tweens the height of the element 33 | this.set('tween', { 34 | duration: 1000, 35 | transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out' 36 | }).tween('height', '150px'); 37 | }, 38 | mouseleave: function(){ 39 | // Resets the tween and changes the element back to its original size 40 | this.set('tween', {}).tween('height', '20px'); 41 | } 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /assets/codemirror/csstest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: CSS demonstration 5 | 6 | 7 | 8 | 9 |

Demonstration of CodeMirror's CSS 10 | highlighter.

11 | 12 |
13 | 48 |
49 | 50 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /demos/Chaining/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var log = $('log'); 5 | 6 | var fx = new Fx.Morph('box', { 7 | duration: 1000, 8 | transition: Fx.Transitions.Quart.easeOut 9 | }); 10 | 11 | $('start').addEvent('click', function(event){ 12 | 13 | event.stop(); 14 | 15 | log.set('html', 'starting...'); 16 | 17 | fx.start({ 18 | 'width': 300, 19 | 'height': 210 20 | }).chain(function(){ 21 | log.set('html', 'First effect completed (1/5)'); 22 | this.start({ 23 | 'opacity': .3 24 | }); 25 | }).chain(function(){ 26 | log.set('html', 'Second effect completed (2/5).
Waiting 5 seconds before starting third.'); 27 | this.start.delay(5000, this, { 28 | 'opacity': 1 29 | }); 30 | }) 31 | .chain(function(){ 32 | log.set('html', 'Third effect completed (3/5).
Waiting 2 seconds before starting fourth.'); 33 | this.start.delay(2000, this, { 34 | 'background-color': '#78BA91' 35 | }); 36 | }).chain(function(){ 37 | log.set('html', 'Fourth effect completed (4/5).
Waiting 1 second before starting fifth.'); 38 | this.start.delay(1000, this, { 39 | 'background-color': '#A87AAD', 40 | 'width': 100, 41 | 'height': 70 42 | }); 43 | }).chain(function(){ 44 | log.set('html', 'Fifth effect completed (5/5).'); 45 | }); 46 | 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /assets/js/demos.js: -------------------------------------------------------------------------------- 1 | 2 | var editors = { 3 | 4 | html: CodeMirror.fromTextArea('html_tab', { 5 | parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"], 6 | stylesheet: ["assets/codemirror/css/xmlcolors.css", "assets/codemirror/css/jscolors.css", "assets/codemirror/css/csscolors.css"], 7 | height: "dynamic", 8 | path: "assets/codemirror/js/", 9 | autoMatchParens: true, 10 | readOnly: true 11 | }), 12 | 13 | js: CodeMirror.fromTextArea('js_tab', { 14 | parserfile: ["tokenizejavascript.js", "parsejavascript.js"], 15 | stylesheet: "assets/codemirror/css/jscolors.css", 16 | height: "dynamic", 17 | path: "assets/codemirror/js/", 18 | autoMatchParens: true, 19 | readOnly: true 20 | }), 21 | 22 | css: CodeMirror.fromTextArea('css_tab', { 23 | parserfile: "parsecss.js", 24 | stylesheet: "assets/codemirror/css/csscolors.css", 25 | height: "dynamic", 26 | path: "assets/codemirror/js/", 27 | autoMatchParens: true, 28 | readOnly: true 29 | }) 30 | 31 | }; 32 | 33 | var tabs = $$('.tabs LI.tab'), 34 | content = $$('.tabcontent'); 35 | 36 | tabs.each(function(tab, index){ 37 | tab.addEvent('click', function(){ 38 | tabs.removeClass('selected'); 39 | content.removeClass('selected'); 40 | tabs[index].addClass('selected'); 41 | content[index].addClass('selected'); 42 | for (var name in editors) if (editors.hasOwnProperty(name)) editors[name].setDynamicHeight(); 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/lua/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, Franciszek Wawrzak 2 | All rights reserved. 3 | 4 | This software is provided for use in connection with the 5 | CodeMirror suite of modules and utilities, hosted and maintained 6 | at http://codemirror.net/. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/python/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, Timothy Farrell 2 | All rights reserved. 3 | 4 | This software is provided for use in connection with the 5 | CodeMirror suite of modules and utilities, hosted and maintained 6 | at http://codemirror.net/. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/sql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: SQL demonstration 5 | 6 | 7 | 8 | 9 |

Demonstration of CodeMirror's SQL 10 | highlighter.

11 | 12 |

Written by John Benediktsson (license).

13 | 14 |
15 | 43 |
44 | 45 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /assets/codemirror/mixedtest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: HTML mixed-mode demonstration 5 | 6 | 7 | 8 | 9 |

This is a simple demonstration of the HTML mixed-mode indentation 10 | module for CodeMirror. Script tags use the JS 11 | parser, style tags use the CSS parser.

12 | 13 |
14 | 41 |
42 | 43 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /assets/codemirror/htmltest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: HTML/XML demonstration 5 | 6 | 18 | 19 | 20 | 21 |

This is a simple demonstration of the XML/HTML indentation module 22 | for CodeMirror. The javascript file contains some comments with 24 | more information.

25 | 26 |
27 | 39 |
40 | 41 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /demos/Enhanced-Form/demo.css: -------------------------------------------------------------------------------- 1 | 2 | #myForm fieldset { 3 | margin-bottom: 10px; 4 | padding: 10px; 5 | border: 1px solid #c0c0c0; 6 | border-radius: 5px; 7 | -webkit-border-radius: 5px; 8 | -moz-border-radius: 5px; 9 | } 10 | 11 | #myForm ul { 12 | list-style: none; 13 | } 14 | 15 | #myForm li { 16 | position: relative; 17 | } 18 | 19 | #myForm [type=text], 20 | #myForm [type=submit], 21 | #myForm textarea { 22 | margin-top: 3px; 23 | padding: 1px; 24 | border: 1px solid #000000; 25 | border-radius: 3px; 26 | -webkit-border-radius: 3px; 27 | -moz-border-radius: 3px; 28 | } 29 | 30 | #myForm [type=check], 31 | #myForm [type=radio], 32 | #myForm [type=submit] { 33 | cursor: pointer; 34 | } 35 | 36 | #myForm label { 37 | display: block; 38 | } 39 | 40 | #myForm [type=check] + label, 41 | #myForm [type=radio] + label { 42 | display: inline-block; 43 | cursor: pointer; 44 | } 45 | 46 | #myForm input:hover, 47 | #myForm textarea:hover, 48 | #myForm input:focus, 49 | #myForm textarea:focus { 50 | background-color: #ddffdd; 51 | } 52 | 53 | #myForm .validation-failed { 54 | border-color: #ff0000; 55 | background-color: #ffdddd; 56 | } 57 | 58 | #myForm .validation-advice { 59 | padding-bottom: 5px; 60 | font-weight: bold; 61 | color: #ff0000; 62 | } 63 | 64 | #myForm #myResult { 65 | margin-top: 10px; 66 | padding: 10px; 67 | border: 1px solid #0000ff; 68 | background-color: #ddddff; 69 | } 70 | 71 | #myForm #myResult:empty { 72 | border-width: 0; 73 | padding: 0; 74 | } 75 | 76 | #myForm .spinner { 77 | border-radius: 3px; 78 | -webkit-border-radius: 3px; 79 | -moz-border-radius: 3px; 80 | background-color: #f0f0f0; 81 | } 82 | 83 | #myForm .overTxtLabel { 84 | color: #888888; 85 | } 86 | -------------------------------------------------------------------------------- /demos/Fx.Slide/demo.html: -------------------------------------------------------------------------------- 1 |

Vertical

2 |
3 | slide out | 4 | slide in | 5 | toggle | 6 | hide | 7 | show | 8 | status: open 9 |
10 | 11 |
12 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 13 |
14 | 15 |

Horizontal

16 |
17 | slide out | 18 | slide in | 19 | toggle | 20 | hide | 21 | show | 22 | status: open 23 |
24 | 25 |
26 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 27 |
-------------------------------------------------------------------------------- /assets/codemirror/contrib/lua/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Lua demonstration 5 | 6 | 7 | 8 |

This page demonstrates CodeMirror's 9 | Lua parser. Written by Franciszek 10 | Wawrzak, released under a BSD-style license.

12 | 13 |
14 | 57 |
58 | 59 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /assets/codemirror/unittests.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Test Harness for CodeMirror 3 | * JS-unit compatible tests here. The two available assertions are 4 | * assertEquals (strict equality) and assertEquivalent (looser equivalency). 5 | * 6 | * 'editor' is a global object for the CodeMirror editor shared between all 7 | * tests. After manipulating it in each test, try to restore it to 8 | * approximately its original state. 9 | */ 10 | 11 | function testSetGet() { 12 | var code = 'It was the best of times.\nIt was the worst of times.'; 13 | editor.setCode(code); 14 | assertEquals(code, editor.getCode()); 15 | editor.setCode(''); 16 | assertEquals('', editor.getCode()); 17 | } 18 | 19 | function testSetStylesheet() { 20 | function cssStatus() { 21 | // Returns a list of tuples, for each CSS link return the filename and 22 | // whether it is enabled. 23 | links = editor.win.document.getElementsByTagName('link'); 24 | css = []; 25 | for (var x = 0, link; link = links[x]; x++) { 26 | if (link.rel.indexOf("stylesheet") !== -1) { 27 | css.push([link.href.substring(link.href.lastIndexOf('/') + 1), 28 | !link.disabled]) 29 | } 30 | } 31 | return css; 32 | } 33 | assertEquivalent([], cssStatus()); 34 | editor.setStylesheet('css/jscolors.css'); 35 | assertEquivalent([['jscolors.css', true]], cssStatus()); 36 | editor.setStylesheet(['css/csscolors.css', 'css/xmlcolors.css']); 37 | assertEquivalent([['jscolors.css', false], ['csscolors.css', true], ['xmlcolors.css', true]], cssStatus()); 38 | editor.setStylesheet([]); 39 | assertEquivalent([['jscolors.css', false], ['csscolors.css', false], ['xmlcolors.css', false]], cssStatus()); 40 | } 41 | 42 | // Update this list of tests as new ones are added. 43 | var tests = ['testSetGet', 'testSetStylesheet']; 44 | 45 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/php/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2009, Yahoo! Inc. 2 | All rights reserved. 3 | 4 | This software is provided for use in connection with the 5 | CodeMirror suite of modules and utilities, hosted and maintained 6 | at http://codemirror.net/. 7 | 8 | Redistribution and use of this software in source and binary forms, 9 | with or without modification, are permitted provided that the 10 | following conditions are met: 11 | 12 | * Redistributions of source code must retain the above 13 | copyright notice, this list of conditions and the 14 | following disclaimer. 15 | 16 | * Redistributions in binary form must reproduce the above 17 | copyright notice, this list of conditions and the 18 | following disclaimer in the documentation and/or other 19 | materials provided with the distribution. 20 | 21 | * Neither the name of Yahoo! Inc. nor the names of its 22 | contributors may be used to endorse or promote products 23 | derived from this software without specific prior 24 | written permission of Yahoo! Inc. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 29 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 30 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 31 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 32 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 34 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 36 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 37 | POSSIBILITY OF SUCH DAMAGE. 38 | -------------------------------------------------------------------------------- /demos/Transitions/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | // First we create a Fx.Morph instance which we will use to move the red box 5 | var target = $('target'); 6 | var fx = new Fx.Morph(target, { 7 | duration: 1000, 8 | link: 'chain' 9 | }); 10 | 11 | // The big gray erea 12 | var box = $('box'); 13 | 14 | target.setStyles({ 15 | top: box.getTop(), 16 | left: box.getLeft() 17 | }); 18 | 19 | var selectTransition = $('fxTransition'), 20 | selectEase = $('fxEase'), 21 | durationInput = $('duration'), 22 | result = $('result'); 23 | 24 | // Run the event if one of the select boxes has changed 25 | $$(selectEase, selectTransition).addEvent('change', function(){ 26 | var transition = selectTransition.get('value'); 27 | 28 | // This is where we set the transition option to the selected value 29 | if (transition == 'linear'){ 30 | fx.options.transition = Fx.Transitions.linear; 31 | transition = 'Fx.Transitions.linear'; 32 | } else { 33 | var ease = selectEase.get('value'); 34 | fx.options.transition = Fx.Transitions[transition][ease]; 35 | transition = 'Fx.Transitions.' + transition + '.' + ease; 36 | } 37 | result.set('html', transition); 38 | 39 | }); 40 | 41 | // Run the above event on once on startup 42 | selectEase.fireEvent('change'); 43 | 44 | // Set the duration option if it has changed 45 | durationInput.addEvent('keyup', function(){ 46 | fx.options.duration = parseFloat(durationInput.get('value')); 47 | }); 48 | 49 | // If you click anywhere on the gray box, the red box should morph to the clicked coordinates 50 | box.addEvent('mousedown', function(event){ 51 | event.stop(); 52 | fx.start({ 53 | // The clicked coordinates are stored in the event.page property 54 | top: [event.page.y - 25], 55 | left: [event.page.x - 25] 56 | }); 57 | }); 58 | 59 | }); 60 | 61 | -------------------------------------------------------------------------------- /demos/Element.Event/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function() { 3 | var textarea = $('myTextarea'), log = $('log').setStyle('opacity', 0); 4 | 5 | // We define the highlight morph we're going to 6 | // use when firing an event 7 | var highlight = new Fx.Morph(log, { 8 | duration: 1500, 9 | link: 'cancel', 10 | transition: 'quad:out' 11 | }); 12 | 13 | // Here we start adding events to textarea. 14 | // Note that 'focus' and 'keyup' are native events, while 'burn' 15 | // is a custom one we've made 16 | textarea.addEvents({ 17 | focus: function() { 18 | // When focusing, if the textarea contains value "Type here", we 19 | // simply clear it. 20 | if (textarea.value.contains('Type here')) textarea.set('value', ''); 21 | }, 22 | 23 | keyup: function() { 24 | // When user keyups we check if there are any of the magic words. 25 | // If yes, we fire our custom event burn with a different text for each one. 26 | if (textarea.value.contains('hello')) textarea.fireEvent('burn', 'hello world!'); 27 | else if (textarea.value.contains('moo')) textarea.fireEvent('burn', 'mootools!'); 28 | else if (textarea.value.contains('pizza')) textarea.fireEvent('burn', 'Italy!'); 29 | else if (textarea.value.contains('burn')) textarea.fireEvent('burn', 'fireEvent'); 30 | // note that in case of 'delayed', we are firing the event 1 second late. 31 | else if (textarea.value.contains('delayed')) textarea.fireEvent('burn', "I'm a bit late!", 1000); 32 | }, 33 | 34 | burn: function(text) { 35 | // When the textarea contains one of the magic words 36 | // we reset textarea value and set the log with text 37 | textarea.set('value', ''); 38 | log.set('html', text); 39 | 40 | // then we start the highlight morphing 41 | highlight.start({ 42 | backgroundColor: ['#fff36f', '#fff'], 43 | opacity: [1, 0] 44 | }); 45 | } 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/csharp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: C# demonstration 5 | 6 | 7 | 8 | 9 |

Demonstration of CodeMirror's C# highlighter.

10 | 11 |

Written by Boris Gaber and Christopher Buchino (license).

13 | 14 |
15 | 49 |
50 | 51 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MooTools Demos 2 | ============== 3 | 4 | This is the new MooTools Demo runner and the new MooTools Demos. 5 | The demos can be opened in [jsFiddle](http://www.jsfiddle.net) for editing. 6 | 7 | ## Creating new Demos 8 | 9 | We're always looking for new demos that can be great additions to the docs or give the wow-effect for new users. 10 | With the demos we want to show what MooTools is capable of. The demos is a great way to contribute to MooTools 11 | in a easy way, by adding new demos and improving existing ones. 12 | 13 | You can submit new demos by forking this repository and send us a [pull request](https://github.com/mootools/mootools-demos/pulls). 14 | 15 | The *demos* directory contains all the demos. You can start creating a new demo by copying the directory of an existing 16 | demo. The name of the directory is the same as used in the URL after `?demo=`. 17 | 18 | Each demo contains at least four files: 19 | 20 | - **demo.css** - Contains the CSS for the demo, shows up in the CSS tab 21 | - **demo.details** - This is a YAML file which contains extra info, like a desription and links to the docs 22 | - **demo.html** - Contains the HTML of the demo, shows up in the HTML tab 23 | - **demo.js** - Contains the JavaScript of the demo, shows up in the JS tab 24 | 25 | ### demo.js 26 | 27 | demo.js is probably the most important file of the demo because it contains the MooTools code. 28 | 29 | It is important to wrap the code in a *domready* event. This is important so it works in this demo runner as well as on jsfiddle. 30 | 31 | window.addEvent('domready', function(){ 32 | // code here 33 | }); 34 | 35 | #### Code guidelines 36 | 37 | We try to use the MooTools code guidelines. Those can be found in the [MooTools Core Wiki](https://github.com/mootools/mootools-core/wiki/Syntax-and-Coding-Style-Conventions) 38 | 39 | ### Used Color Scheme 40 | 41 | In order to give the demos a consistent look, we use this [Color Scheme](http://jsfiddle.net/Z5u5s/3/) 42 | -------------------------------------------------------------------------------- /assets/codemirror/jstest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: JavaScript demonstration 6 | 7 | 8 | 9 | 10 |

This page demonstrates CodeMirror's 11 | JavaScript parser. Note that the ugly buttons at the top are not are 12 | not part of CodeMirror proper -- they demonstrate the way it can be 13 | embedded in a web-application.

14 | 15 |
16 | 41 |
42 | 43 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /assets/css/main.css: -------------------------------------------------------------------------------- 1 | HTML, BODY { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | BODY { 7 | background: #F4F5F5; 8 | font: 0.75em "Helvetica Neue", Helvetica, Arial, sans-serif; 9 | } 10 | 11 | H1, 12 | H2 { 13 | color: #C17878; 14 | font-size: 2em; 15 | line-height: 30px; 16 | } 17 | 18 | H2, 19 | H3 { 20 | color: #78ba91; 21 | font-size: 1.7em; 22 | } 23 | 24 | H3 { 25 | font-size: 1.5em; 26 | } 27 | 28 | P { 29 | line-height: 17px; 30 | } 31 | 32 | A:LINK, A:VISITED { 33 | color: #6B7B95; 34 | } 35 | 36 | A:HOVER, A:ACTIVE { 37 | color: #E79D35; 38 | } 39 | 40 | UL { 41 | list-style: none; 42 | margin: 0; 43 | padding: 0; 44 | } 45 | 46 | #header { 47 | background: #F9F9F9; 48 | border-bottom: 1px solid #DDD; 49 | height: 122px; 50 | } 51 | #header DIV { 52 | margin: 0 auto; 53 | width: 960px; 54 | } 55 | #header .button { 56 | margin: 50px 0 0; 57 | } 58 | #header H1 { 59 | background: url(graphics/mootools.png) no-repeat 0 50%; 60 | height: 46px; 61 | margin: 0 auto; 62 | padding: 38px 0; 63 | text-indent: -9999px; 64 | } 65 | 66 | #wrapper { 67 | background: url(graphics/gradient.png) repeat-x; 68 | } 69 | 70 | #content { 71 | margin: 0 auto; 72 | padding: 0 0 50px; 73 | width: 960px; 74 | } 75 | #content #leftcolumn { 76 | border-right: 1px solid #DDD; 77 | float: left; 78 | font-size: 1.1em; 79 | margin: 25px 24px 0 0; 80 | padding: 0 25px 50px 0; 81 | width: 150px; 82 | } 83 | #content #leftcolumn LI { 84 | padding: 1px 0; 85 | text-align: right; 86 | } 87 | #content #leftcolumn H4 { 88 | text-align: left; 89 | border-bottom: 1px solid #ddd; 90 | font-size: 1.2em; 91 | color: #313334; 92 | line-height: 20px; 93 | } 94 | #content #leftcolumn A { 95 | display: block; 96 | } 97 | #content #rightcolumn { 98 | float: left; 99 | margin: 25px 0 0; 100 | overflow: hidden; 101 | width: 760px; 102 | } 103 | -------------------------------------------------------------------------------- /assets/codemirror/js/tokenize.js: -------------------------------------------------------------------------------- 1 | // A framework for simple tokenizers. Takes care of newlines and 2 | // white-space, and of getting the text from the source stream into 3 | // the token object. A state is a function of two arguments -- a 4 | // string stream and a setState function. The second can be used to 5 | // change the tokenizer's state, and can be ignored for stateless 6 | // tokenizers. This function should advance the stream over a token 7 | // and return a string or object containing information about the next 8 | // token, or null to pass and have the (new) state be called to finish 9 | // the token. When a string is given, it is wrapped in a {style, type} 10 | // object. In the resulting object, the characters consumed are stored 11 | // under the content property. Any whitespace following them is also 12 | // automatically consumed, and added to the value property. (Thus, 13 | // content is the actual meaningful part of the token, while value 14 | // contains all the text it spans.) 15 | 16 | function tokenizer(source, state) { 17 | // Newlines are always a separate token. 18 | function isWhiteSpace(ch) { 19 | // The messy regexp is because IE's regexp matcher is of the 20 | // opinion that non-breaking spaces are no whitespace. 21 | return ch != "\n" && /^[\s\u00a0]*$/.test(ch); 22 | } 23 | 24 | var tokenizer = { 25 | state: state, 26 | 27 | take: function(type) { 28 | if (typeof(type) == "string") 29 | type = {style: type, type: type}; 30 | 31 | type.content = (type.content || "") + source.get(); 32 | if (!/\n$/.test(type.content)) 33 | source.nextWhile(isWhiteSpace); 34 | type.value = type.content + source.get(); 35 | return type; 36 | }, 37 | 38 | next: function () { 39 | if (!source.more()) throw StopIteration; 40 | 41 | var type; 42 | if (source.equals("\n")) { 43 | source.next(); 44 | return this.take("whitespace"); 45 | } 46 | 47 | if (source.applies(isWhiteSpace)) 48 | type = "whitespace"; 49 | else 50 | while (!type) 51 | type = this.state(source, function(s) {tokenizer.state = s;}); 52 | 53 | return this.take(type); 54 | } 55 | }; 56 | return tokenizer; 57 | } 58 | -------------------------------------------------------------------------------- /demos/Fx.Sort/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

*you can click on any two elements below to swap their position

30 | 31 |
32 |
red
33 |
purple
34 |
green
35 |
orange
36 |
blue
37 |
38 | 39 |

40 | backward | 41 | forward | 42 | reverse | 43 | Sort [1,3,0,2,4] | 44 | Swap first and last child | 45 | Current order | 46 | rearrangeDOM 47 |

48 | 49 |

Current DOM order

50 |

51 | 


--------------------------------------------------------------------------------
/assets/css/demos.css:
--------------------------------------------------------------------------------
 1 | .tabs	{
 2 | 	border-bottom: 1px solid #DDD;
 3 | 	height: 33px;
 4 | }
 5 | 	.tabs LI	{
 6 | 		cursor: pointer;
 7 | 		float: right;
 8 | 		font: bold 1em/18px Helvetica, Arial, sans-serif;
 9 | 		margin: 0 0 0 5px;
10 | 		text-align: center;
11 | 	}
12 | 	.tabs LI.tab	{
13 | 		background: #F4F5F5;
14 | 		background: -moz-linear-gradient(top, #FDFDFD, #F4F5F5);
15 | 		background: -webkit-gradient(linear, left top, left bottom, from(#FDFDFD), to(#F4F5F5));
16 | 		border: 1px solid #CCC;
17 | 		border-bottom: none;
18 | 		color: #777;
19 | 		filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#FDFDFD', EndColorStr='#F4F5F5');
20 | 		padding: 8px 0 0;
21 | 		height: 24px;
22 | 		width: 74px;
23 | 		-moz-border-radius-topleft: 6px;
24 | 		-moz-border-radius-topright: 6px;
25 | 		border-top-left-radius: 6px;
26 | 		border-top-right-radius: 6px;
27 | 	}
28 | 	.tabs LI.jsfiddle	{
29 | 		width: 140px;
30 | 	}
31 | 		.tabs LI.jsfiddle button	{
32 | 			cursor: pointer;
33 | 			background: url(graphics/jsfiddle.png) no-repeat;
34 | 			display: block;
35 | 			width: 140px;
36 | 			height: 33px;
37 | 			border: 0;
38 | 			text-indent: -3000px;
39 | 		}
40 | 	.tabs LI.first	{
41 | 		float: left;
42 | 		margin: 0;
43 | 	}
44 | 	.tabs LI.selected	{
45 | 		color: #B86364;
46 | 		height: 25px;
47 | 	}
48 | 	.tabs LI.selected.code {
49 | 		background: #FFF;
50 | 		background: -moz-linear-gradient(top, #FDFDFD, #FFFFFF);
51 | 		background: -webkit-gradient(linear, left top, left bottom, from(#FDFDFD), to(#FFFFFF));
52 | 		filter: progid:DXImageTransform.Microsoft.Gradient(StartColorStr='#FDFDFD', EndColorStr='#FFFFFF');
53 | 	}
54 | .tabs:AFTER	{
55 | 	clear: both;
56 | 	content: ".";
57 | 	display: block;
58 | 	height: 0;
59 | 	visibility: hidden;
60 | }
61 | 
62 | .tabcontent	{
63 | 	background: #F4F5F5;
64 | 	display: none;
65 | 	padding: 15px 0;
66 | }
67 | 	.tabcontent IFRAME	{
68 | 		min-height: 500px;
69 | 		width: 100%;
70 | 	}
71 | .tabcontent.selected	{
72 | 	display: block;
73 | }
74 | 
75 | #description	{
76 | 	margin: 0 0 40px;
77 | }
78 | 
79 | #jsfiddle_data {
80 | 	display: none;
81 | }
82 | 
83 | ul.doc_references {
84 | 	list-style: circle;
85 | 	padding-left: 20px;
86 | }
87 | 
88 | .CodeMirror-wrapping {
89 | 	background-color: #FFF;
90 | 	border: 1px solid #DDD;
91 | 	border-top: none;
92 | 	margin: -15px 0 0;
93 | 	padding: 10px;
94 | }
95 | 


--------------------------------------------------------------------------------
/assets/codemirror/js/highlight.js:
--------------------------------------------------------------------------------
 1 | // Minimal framing needed to use CodeMirror-style parsers to highlight
 2 | // code. Load this along with tokenize.js, stringstream.js, and your
 3 | // parser. Then call highlightText, passing a string as the first
 4 | // argument, and as the second argument either a callback function
 5 | // that will be called with an array of SPAN nodes for every line in
 6 | // the code, or a DOM node to which to append these spans, and
 7 | // optionally (not needed if you only loaded one parser) a parser
 8 | // object.
 9 | 
10 | // Stuff from util.js that the parsers are using.
11 | var StopIteration = {toString: function() {return "StopIteration"}};
12 | 
13 | var Editor = {};
14 | var indentUnit = 2;
15 | 
16 | (function(){
17 |   function normaliseString(string) {
18 |     var tab = "";
19 |     for (var i = 0; i < indentUnit; i++) tab += " ";
20 | 
21 |     string = string.replace(/\t/g, tab).replace(/\u00a0/g, " ").replace(/\r\n?/g, "\n");
22 |     var pos = 0, parts = [], lines = string.split("\n");
23 |     for (var line = 0; line < lines.length; line++) {
24 |       if (line != 0) parts.push("\n");
25 |       parts.push(lines[line]);
26 |     }
27 | 
28 |     return {
29 |       next: function() {
30 |         if (pos < parts.length) return parts[pos++];
31 |         else throw StopIteration;
32 |       }
33 |     };
34 |   }
35 | 
36 |   window.highlightText = function(string, callback, parser) {
37 |     parser = (parser || Editor.Parser).make(stringStream(normaliseString(string)));
38 |     var line = [];
39 |     if (callback.nodeType == 1) {
40 |       var node = callback;
41 |       callback = function(line) {
42 |         for (var i = 0; i < line.length; i++)
43 |           node.appendChild(line[i]);
44 |         node.appendChild(document.createElement("BR"));
45 |       };
46 |     }
47 | 
48 |     try {
49 |       while (true) {
50 |         var token = parser.next();
51 |         if (token.value == "\n") {
52 |           callback(line);
53 |           line = [];
54 |         }
55 |         else {
56 |           var span = document.createElement("SPAN");
57 |           span.className = token.style;
58 |           span.appendChild(document.createTextNode(token.value));
59 |           line.push(span);
60 |         }
61 |       }
62 |     }
63 |     catch (e) {
64 |       if (e != StopIteration) throw e;
65 |     }
66 |     if (line.length) callback(line);
67 |   }
68 | })();
69 | 


--------------------------------------------------------------------------------
/demos/Fx.Slide/demo.js:
--------------------------------------------------------------------------------
 1 | 
 2 | window.addEvent('domready', function() {
 3 | 
 4 | 	var status = {
 5 | 		'true': 'open',
 6 | 		'false': 'close'
 7 | 	};
 8 | 
 9 | 	// -- vertical
10 | 
11 | 	var myVerticalSlide = new Fx.Slide('vertical_slide');
12 | 
13 | 	$('v_slidein').addEvent('click', function(event){
14 | 		event.stop();
15 | 		myVerticalSlide.slideIn();
16 | 	});
17 | 
18 | 	$('v_slideout').addEvent('click', function(event){
19 | 		event.stop();
20 | 		myVerticalSlide.slideOut();
21 | 	});
22 | 
23 | 	$('v_toggle').addEvent('click', function(event){
24 | 		event.stop();
25 | 		myVerticalSlide.toggle();
26 | 	});
27 | 
28 | 	$('v_hide').addEvent('click', function(event){
29 | 		event.stop();
30 | 		myVerticalSlide.hide();
31 | 		$('vertical_status').set('text', status[myVerticalSlide.open]);
32 | 	});
33 | 
34 | 	$('v_show').addEvent('click', function(event){
35 | 		event.stop();
36 | 		myVerticalSlide.show();
37 | 		$('vertical_status').set('text', status[myVerticalSlide.open]);
38 | 	});
39 | 
40 | 	// When Vertical Slide ends its transition, we check for its status
41 | 	// note that complete will not affect 'hide' and 'show' methods
42 | 	myVerticalSlide.addEvent('complete', function() {
43 | 		$('vertical_status').set('text', status[myVerticalSlide.open]);
44 | 	});
45 | 
46 | 
47 | 	// -- horizontal
48 | 	var myHorizontalSlide = new Fx.Slide('horizontal_slide', {mode: 'horizontal'});
49 | 
50 | 	$('h_slidein').addEvent('click', function(event){
51 | 		event.stop();
52 | 		myHorizontalSlide.slideIn();
53 | 	});
54 | 
55 | 	$('h_slideout').addEvent('click', function(event){
56 | 		event.stop();
57 | 		myHorizontalSlide.slideOut();
58 | 	});
59 | 
60 | 	$('h_toggle').addEvent('click', function(event){
61 | 		event.stop();
62 | 		myHorizontalSlide.toggle();
63 | 	});
64 | 
65 | 	$('h_hide').addEvent('click', function(event){
66 | 		event.stop();
67 | 		myHorizontalSlide.hide();
68 | 		$('horizontal_status').set('text', status[myHorizontalSlide.open]);
69 | 	});
70 | 
71 | 	$('h_show').addEvent('click', function(event){
72 | 		event.stop();
73 | 		myHorizontalSlide.show();
74 | 		$('horizontal_status').set('text', status[myHorizontalSlide.open]);
75 | 	});
76 | 
77 | 	// When Horizontal Slide ends its transition, we check for its status
78 | 	// note that complete will not affect 'hide' and 'show' methods
79 | 	myHorizontalSlide.addEvent('complete', function() {
80 | 		$('horizontal_status').set('text', status[myHorizontalSlide.open]);
81 | 	});
82 | });
83 | 


--------------------------------------------------------------------------------
/assets/codemirror/faq.html:
--------------------------------------------------------------------------------
 1 | 
 2 |   
 3 |     CodeMirror: Frequently Asked Questions
 4 |     
 5 |     
 6 |     
 9 |   
10 |   
11 |     
12 |

CodeMirror

13 |

Frequently Asked Questions

14 |
15 | 16 |

Q: Can I use CodeMirror in my such-and-such project?

17 | 18 |

A: Yes. The license is short, simple, and 19 | permissive.

20 | 21 |

Q: You said you fixed this-and-this issue, but I'm 22 | still seeing it.

23 | 24 |

A: One possibility is that I screwed up, but a very real 25 | alternative is that you're looking at a cached version of the 26 | CodeMirror scripts. Because the scripts are loaded into an iframe, 27 | the ctrl-f5 you issued on the outer page doesn't always cause them 28 | to be reloaded (IE, Opera, and Firefox are the worst offenders 29 | here). Clear your cache and re-try.

30 | 31 |

Q: I can't put content containing 32 | </textarea> into CodeMirror!

33 | 34 |

A: [Web-programming 101] The first </textarea> 35 | following a <textarea> tag will close the 36 | textarea. This has nothing to do with CodeMirror. Sit down, and 37 | spend ten minutes thinking about why HTML-escaping was 38 | invented.

39 | 40 |

Q: I have this huge chunk of code that does not 41 | work, can you debug it for me?

42 | 43 |

A: Nope. If you can't be bothered isolate your problem in 20 44 | lines of code or less, I can't be bothered to think about it.

45 | 46 |

Q: How do I submit patches for CodeMirror?

47 | 48 |

A: Preferred way is to create a fork on github, add your 50 | patch, and send me a pull request. Diffs (against the latest 51 | version!) by mail are also cool.

52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/plsql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: PLSQL demonstration 5 | 6 | 7 | 8 | 9 |

Demonstration of CodeMirror's PLSQL 10 | highlighter.

11 | 12 |

Written by Peter Raganitsch (license), based 13 | on John Benediktsson SQL parser.

14 | 15 |
16 | 54 |
55 | 56 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /assets/codemirror/js/mirrorframe.js: -------------------------------------------------------------------------------- 1 | /* Demonstration of embedding CodeMirror in a bigger application. The 2 | * interface defined here is a mess of prompts and confirms, and 3 | * should probably not be used in a real project. 4 | */ 5 | 6 | function MirrorFrame(place, options) { 7 | this.home = document.createElement("DIV"); 8 | if (place.appendChild) 9 | place.appendChild(this.home); 10 | else 11 | place(this.home); 12 | 13 | var self = this; 14 | function makeButton(name, action) { 15 | var button = document.createElement("INPUT"); 16 | button.type = "button"; 17 | button.value = name; 18 | self.home.appendChild(button); 19 | button.onclick = function(){self[action].call(self);}; 20 | } 21 | 22 | makeButton("Search", "search"); 23 | makeButton("Replace", "replace"); 24 | makeButton("Current line", "line"); 25 | makeButton("Jump to line", "jump"); 26 | makeButton("Insert constructor", "macro"); 27 | makeButton("Indent all", "reindent"); 28 | 29 | this.mirror = new CodeMirror(this.home, options); 30 | } 31 | 32 | MirrorFrame.prototype = { 33 | search: function() { 34 | var text = prompt("Enter search term:", ""); 35 | if (!text) return; 36 | 37 | var first = true; 38 | do { 39 | var cursor = this.mirror.getSearchCursor(text, first); 40 | first = false; 41 | while (cursor.findNext()) { 42 | cursor.select(); 43 | if (!confirm("Search again?")) 44 | return; 45 | } 46 | } while (confirm("End of document reached. Start over?")); 47 | }, 48 | 49 | replace: function() { 50 | // This is a replace-all, but it is possible to implement a 51 | // prompting replace. 52 | var from = prompt("Enter search string:", ""), to; 53 | if (from) to = prompt("What should it be replaced with?", ""); 54 | if (to == null) return; 55 | 56 | var cursor = this.mirror.getSearchCursor(from, false); 57 | while (cursor.findNext()) 58 | cursor.replace(to); 59 | }, 60 | 61 | jump: function() { 62 | var line = prompt("Jump to line:", ""); 63 | if (line && !isNaN(Number(line))) 64 | this.mirror.jumpToLine(Number(line)); 65 | }, 66 | 67 | line: function() { 68 | alert("The cursor is currently at line " + this.mirror.currentLine()); 69 | this.mirror.focus(); 70 | }, 71 | 72 | macro: function() { 73 | var name = prompt("Name your constructor:", ""); 74 | if (name) 75 | this.mirror.replaceSelection("function " + name + "() {\n \n}\n\n" + name + ".prototype = {\n \n};\n"); 76 | }, 77 | 78 | reindent: function() { 79 | this.mirror.reindent(); 80 | } 81 | }; 82 | -------------------------------------------------------------------------------- /demos/Slick.Finder/demo.html: -------------------------------------------------------------------------------- 1 | 2 |

3 | Try a CSS Selector or pick one of the predefined ones. 4 |

5 | 6 | 7 |
8 | 9 | 48 | 49 | 50 |
51 | 52 |

The elements we search in:

53 | 54 |
55 | 56 | 57 |
58 |

div.chapter > p

59 |

div.chapter > p > strong

60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
ASimple tablewith: table > tr > th:nth-child(3) > strong > a
SomeOtherText
SomeOtherText
SomeOtherText
SomeOtherText
81 | 82 |
83 | 84 | 85 | 86 |
87 | 88 |
89 | Some text
90 | div 91 |
92 | 93 |
94 | 95 |
96 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/scheme/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CodeMirror: Scheme demonstration 6 | 7 | 8 | 20 | 21 | 22 | 23 |

This page demonstrates CodeMirror's 24 | Scheme parser. (license)

25 | 26 |
27 | 43 |
44 | 45 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /assets/codemirror/js/parsehtmlmixed.js: -------------------------------------------------------------------------------- 1 | var HTMLMixedParser = Editor.Parser = (function() { 2 | if (!(CSSParser && JSParser && XMLParser)) 3 | throw new Error("CSS, JS, and XML parsers must be loaded for HTML mixed mode to work."); 4 | XMLParser.configure({useHTMLKludges: true}); 5 | 6 | function parseMixed(stream) { 7 | var htmlParser = XMLParser.make(stream), localParser = null, inTag = false; 8 | var iter = {next: top, copy: copy}; 9 | 10 | function top() { 11 | var token = htmlParser.next(); 12 | if (token.content == "<") 13 | inTag = true; 14 | else if (token.style == "xml-tagname" && inTag === true) 15 | inTag = token.content.toLowerCase(); 16 | else if (token.content == ">") { 17 | if (inTag == "script") 18 | iter.next = local(JSParser, " 2 | 3 | 4 | CodeMirror: Groovy demonstration 5 | 6 | 7 | 8 | 9 |

Demonstration of CodeMirror's Groovy highlighter.

10 | 11 |

Created by eXo Platform SAS (license).

12 | 13 |

Note that the files for this parser aren't included in the CodeMirror repository, but have to fetched from svn.exoplatform.org:

14 | 15 | 20 | 21 |
22 | 44 |
45 | 46 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /demos/Request.JSON/demo.js: -------------------------------------------------------------------------------- 1 | 2 | // This is our JSON data which the server will return 3 | // We will send this data to the server which our demo runner and jsfiddle will return 4 | var data = {"previews":[ 5 | {"name":"Blue Earth", "src":"earth-blue.jpg", "description":"A blue version of Earth.", "views":200}, 6 | {"name":"User Profile", "src":"user.jpg", "description":"A chubby user guy.", "views":0}, 7 | {"name":"Mouse", "src":"mouse.jpg", "description":"Standard mouse icon.", "views":99}, 8 | {"name":"Gold Earth", "src":"earth-gold.jpg", "description":"A gold version of Earth.", "views":7855}, 9 | {"name":"Page and Pencil", "src":"edit.jpg", "description":"A piece of paper and a pencil.", "views":5}, 10 | {"name":"Speaker", "src":"speaker.jpg", "description":"A speaker.", "views":16}, 11 | {"name":"Orange Monitor", "src":"monitor.jpg", "description":"A yellow, glowing monitor.", "views":355}, 12 | {"name":"Software Box", "src":"package.jpg", "description":"A nice wrapped package in a box.", "views":23452}, 13 | {"name":"FIRE!!!!", "src":"fire.jpg", "description":"Orange flame.", "views":395}, 14 | {"name":"Screwdriver Paper", "src":"setting.jpg", "description":"An always useful screwdriver.", "views":42} 15 | ]}; 16 | 17 | window.addEvent('domready', function() { 18 | 19 | var images_path = 'demos/Request.JSON/images/'; 20 | var gallery = $('gallery'); 21 | 22 | var addImages = function(images){ 23 | images.each(function(image){ 24 | var el = new Element('div.preview'), 25 | name = new Element('h3', {'html': image.name}).inject(el), 26 | desc = new Element('span', {'html': image.description}).inject(name, 'after'), 27 | img = new Element('img', {'src': images_path + image.src}).inject(desc, 'after'), 28 | footer = new Element('span').inject(img, 'after'); 29 | 30 | if (image.views > 50 && image.views < 250) footer.set({'html': 'popular', 'class': 'popular'}); 31 | else if (image.views > 250) footer.set({'html': 'SUPERpopular', 'class': 'SUPERpopular'}); 32 | else footer.set({'html': 'normal', 'class': 'normal'}); 33 | 34 | el.inject(gallery); 35 | }); 36 | }; 37 | 38 | $('loadJSON').addEvent('click', function(e){ 39 | e.stop(); 40 | 41 | var request = new Request.JSON({ 42 | 43 | url: '/echo/json/', 44 | 45 | onRequest: function(){ 46 | gallery.set('text', 'Loading...'); 47 | }, 48 | 49 | onComplete: function(jsonObj) { 50 | gallery.empty(); 51 | addImages(jsonObj.previews); 52 | }, 53 | 54 | data: { // our demo runner and jsfiddle will return this exact data as a JSON string 55 | json: JSON.encode(data) 56 | } 57 | 58 | }).send(); 59 | }); 60 | 61 | $('clearJSON').addEvent('click', function(e){ 62 | e.stop(); 63 | gallery.empty(); 64 | }); 65 | 66 | }); 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /demos/Fx.Sort/demo.js: -------------------------------------------------------------------------------- 1 | 2 | window.addEvent('domready', function(){ 3 | 4 | var container = document.id('container'), //cache sort container 5 | queuedElems = []; //used to track what elements to swap on click 6 | 7 | var sorter = new Fx.Sort($$('#container .sort'), { 8 | duration: document.id('duration').get('value'), 9 | transition: Fx.Transitions[document.id('fxTransition').value][document.id('fxEase').value], 10 | mode: 'vertical', 11 | onComplete: function(){ 12 | displayDOM(); // update the UI DOM visual on each sort 13 | } 14 | }); 15 | 16 | displayDOM(); //update the UI DOM visual on domready 17 | 18 | //sort based on text of element that was clicked (forward, backward, reverse) 19 | $$('.fireSort').addEvent('click', function(event){ 20 | event.stop(); 21 | sorter[this.get('text')](); 22 | }); 23 | 24 | document.id('order').addEvent('click', function(event){ 25 | event.stop(); 26 | alert(sorter.currentOrder); 27 | }); 28 | 29 | document.id('reorderDOM').addEvent('click', function(event){ 30 | event.stop(); 31 | sorter.rearrangeDOM(); 32 | displayDOM(); //onComplete isn't fire so update UI DOM visual manually 33 | }); 34 | 35 | document.id('mode').addEvent('change', function(){ 36 | sorter.rearrangeDOM(); //rearrange DOM first so that elements stack properly 37 | sorter.options.mode = (this.checked) ? 'vertical' : 'horizontal'; 38 | container.toggleClass('container'); 39 | displayDOM(); //onComplete isn't fire so update UI DOM visual manually 40 | }); 41 | 42 | document.id('swap').addEvent('click', function(event){ 43 | event.stop(); 44 | var elems = container.getChildren(); 45 | sorter.swap(elems[0], elems[elems.length - 1]); 46 | }); 47 | 48 | document.id('sort').addEvent('click', function(event){ 49 | event.stop(); 50 | sorter.sort([1, 3, 0, 2, 4]); 51 | }); 52 | 53 | $$('#fxTransition, #fxEase').addEvent('change', function(){ 54 | var transition = document.id('fxTransition').get('value'), 55 | easing = document.id('fxEase').get('value'); 56 | sorter.options.transition = Fx.Transitions[transition][easing]; 57 | }); 58 | 59 | document.id('duration').addEvent('keyup', function(){ 60 | sorter.options.duration = this.value.toInt(); 61 | }); 62 | 63 | //allows users to click on elements to swap their positions 64 | $$('.sort').addEvent('click', function(){ 65 | if (queuedElems.length > 0) sorter.swap(queuedElems.pop(), this); 66 | else queuedElems.push(this); 67 | }); 68 | 69 | //helper function, displays the DOM visually to see how the sort effects it 70 | function displayDOM(){ 71 | var str = ''; 72 | container.getChildren().each(function(item){ 73 | str += '
' + item.get('text') + '
\n'; 74 | }); 75 | document.id('output').set('text', str); 76 | } 77 | }); 78 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/php/css/phpcolors.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. 3 | The copyrights embodied in the content of this file are licensed by 4 | Yahoo! Inc. under the BSD (revised) open source license 5 | 6 | @author Dan Vlad Dascalescu 7 | */ 8 | 9 | html { 10 | cursor: text; 11 | } 12 | 13 | .editbox { 14 | margin: .4em; 15 | padding: 0; 16 | font-family: monospace; 17 | font-size: 10pt; 18 | } 19 | 20 | /*We should define specific styles for every element of the syntax. 21 | the setting below will cause some annoying color to show through if we missed 22 | defining a style for a token. This is also the "color" of the whitespace and 23 | of the cursor. 24 | */ 25 | pre.code, .editbox { 26 | color: red; 27 | } 28 | 29 | .editbox p { 30 | margin: 0; 31 | } 32 | 33 | span.php-punctuation { 34 | color: blue; 35 | } 36 | 37 | span.php-keyword { 38 | color: #770088; 39 | font-weight: bold; 40 | } 41 | 42 | span.php-operator { 43 | color: blue; 44 | } 45 | 46 | /* __FILE__ etc.; http://php.net/manual/en/reserved.php */ 47 | span.php-compile-time-constant { 48 | color: #776088; 49 | font-weight: bold; 50 | } 51 | 52 | /* output of get_defined_constants(). Differs from http://php.net/manual/en/reserved.constants.php */ 53 | span.php-predefined-constant { 54 | color: darkgreen; 55 | font-weight: bold; 56 | } 57 | 58 | /* PHP reserved "language constructs"... echo() etc.; http://php.net/manual/en/reserved.php */ 59 | span.php-reserved-language-construct { 60 | color: green; 61 | font-weight: bold; 62 | } 63 | 64 | /* PHP built-in functions: glob(), chr() etc.; output of get_defined_functions()["internal"] */ 65 | span.php-predefined-function { 66 | color: green; 67 | } 68 | 69 | /* PHP predefined classes: PDO, Exception etc.; output of get_declared_classes() and different from http://php.net/manual/en/reserved.classes.php */ 70 | span.php-predefined-class { 71 | color: green; 72 | } 73 | 74 | span.php-atom { 75 | color: #228811; 76 | } 77 | 78 | /* class, interface, namespace or function names, but not $variables */ 79 | span.php-t_string { 80 | color: black; 81 | } 82 | 83 | span.php-variable { 84 | color: black; 85 | font-weight: bold; 86 | } 87 | 88 | 89 | span.js-localvariable { 90 | color: #004499; 91 | } 92 | 93 | span.php-comment { 94 | color: #AA7700; 95 | font-stretch: condensed; 96 | /* font-style: italic; This causes line height to slightly change, getting line numbers out of sync */ 97 | } 98 | 99 | span.php-string-single-quoted { 100 | color: #AA2222; 101 | } 102 | /* double quoted strings allow interpolation */ 103 | span.php-string-double-quoted { 104 | color: #AA2222; 105 | font-weight: bold; 106 | } 107 | 108 | span.syntax-error { 109 | background-color: red; 110 | } 111 | 112 | span.deprecated { 113 | font-size: smaller; 114 | } 115 | -------------------------------------------------------------------------------- /assets/codemirror/highlight.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | CodeMirror: String highlight demonstration 9 | 10 | 11 | 12 | 13 |
14 | 55 |
56 | 57 | 58 | 59 |
60 |
61 |

62 | 
63 | 64 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /demos/Drag.Scroll/demo.js: -------------------------------------------------------------------------------- 1 | 2 | (function(){ 3 | 4 | Drag.Scroll = new Class({ 5 | 6 | // We'd like to use the Options Class Mixin 7 | Implements: [Options], 8 | 9 | // Default options 10 | options: { 11 | friction: 5, 12 | axis: {x: true, y: true} 13 | }, 14 | 15 | initialize: function(element, options){ 16 | element = this.element = document.id(element); 17 | this.content = element.getFirst(); 18 | this.setOptions(options); 19 | 20 | // Drag speed 21 | var prevTime, prevScroll, speed, scroll, timer; 22 | var timerFn = function(){ 23 | var now = Date.now(); 24 | scroll = [element.scrollLeft, element.scrollTop]; 25 | if (prevTime){ 26 | var dt = now - prevTime + 1; 27 | speed = [ 28 | 1000 * (scroll[0] - prevScroll[0]) / dt, 29 | 1000 * (scroll[1] - prevScroll[1]) / dt 30 | ]; 31 | } 32 | prevScroll = scroll; 33 | prevTime = now; 34 | }; 35 | 36 | // Use Fx.Scroll for scrolling to the right position after the dragging 37 | var fx = this.fx = new Fx.Scroll(element, { 38 | transition: Fx.Transitions.Expo.easeOut 39 | }); 40 | 41 | // Set initial scroll 42 | fx.set.apply(fx, this.limit(element.scrollLeft, element.scrollTop)); 43 | 44 | var self = this; 45 | friction = this.options.friction, 46 | axis = this.options.axis; 47 | 48 | // Make the element draggable 49 | var drag = this.drag = new Drag(element, { 50 | style: false, 51 | invert: true, 52 | modifiers: {x: axis.x && 'scrollLeft', y: axis.y && 'scrollTop'}, 53 | onStart: function(){ 54 | // Start the speed measuring 55 | timerFn(); 56 | timer = setInterval(timerFn, 1000 / 60); 57 | // cancel any fx if they are still running 58 | fx.cancel(); 59 | }, 60 | onComplete: function(){ 61 | // Stop the speed measuring 62 | prevTime = false; 63 | clearInterval(timer); 64 | // Scroll to the new location 65 | fx.start.apply(fx, self.limit( 66 | scroll[0] + (speed[0] || 0) / friction, 67 | scroll[1] + (speed[1] || 0) / friction 68 | )); 69 | } 70 | }); 71 | 72 | }, 73 | 74 | // Calculate the limits 75 | getLimit: function(){ 76 | var limit = [[0, 0], [0, 0]], element = this.element; 77 | var styles = Object.values(this.content.getStyles( 78 | 'padding-left', 'border-left-width', 'margin-left', 79 | 'padding-top', 'border-top-width', 'margin-top', 80 | 'width', 'height' 81 | )).invoke('toInt'); 82 | limit[0][0] = sum(styles.slice(0, 3)); 83 | limit[0][1] = styles[6] + limit[0][0] - element.clientWidth; 84 | limit[1][0] = sum(styles.slice(3, 6)); 85 | limit[1][1] = styles[7] + limit[1][0] - element.clientHeight; 86 | return limit; 87 | }, 88 | 89 | // Apply the limits to the x and y values 90 | limit: function(x, y){ 91 | var limit = this.getLimit(); 92 | return [ 93 | x.limit(limit[0][0], limit[0][1]), 94 | y.limit(limit[1][0], limit[1][1]) 95 | ]; 96 | } 97 | 98 | }); 99 | 100 | var sum = function(array){ 101 | var result = 0; 102 | for (var l = array.length; l--;) result += array[l]; 103 | return result; 104 | }; 105 | 106 | })(); 107 | 108 | 109 | window.addEvent('domready', function(){ 110 | 111 | var elements = $$('.scrollarea'); 112 | 113 | new Drag.Scroll(elements[0], { 114 | axis: {x: true, y: true} 115 | }); 116 | 117 | new Drag.Scroll(elements[1], { 118 | friction: 5 119 | }); 120 | 121 | }); 122 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/ometa/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: OmetaJS demonstration 5 | 6 | 7 | 8 | 9 |

This page demonstrates CodeMirror's OmetaJS parser.

11 | 12 |

Adapted from the official Javascript parser by Eric KEDJI 13 | <eric.kedji@gmail.com>.

14 | 15 |
16 | 53 |
54 | 55 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /assets/codemirror/js/util.js: -------------------------------------------------------------------------------- 1 | /* A few useful utility functions. */ 2 | 3 | // Capture a method on an object. 4 | function method(obj, name) { 5 | return function() {obj[name].apply(obj, arguments);}; 6 | } 7 | 8 | // The value used to signal the end of a sequence in iterators. 9 | var StopIteration = {toString: function() {return "StopIteration"}}; 10 | 11 | // Apply a function to each element in a sequence. 12 | function forEach(iter, f) { 13 | if (iter.next) { 14 | try {while (true) f(iter.next());} 15 | catch (e) {if (e != StopIteration) throw e;} 16 | } 17 | else { 18 | for (var i = 0; i < iter.length; i++) 19 | f(iter[i]); 20 | } 21 | } 22 | 23 | // Map a function over a sequence, producing an array of results. 24 | function map(iter, f) { 25 | var accum = []; 26 | forEach(iter, function(val) {accum.push(f(val));}); 27 | return accum; 28 | } 29 | 30 | // Create a predicate function that tests a string againsts a given 31 | // regular expression. No longer used but might be used by 3rd party 32 | // parsers. 33 | function matcher(regexp){ 34 | return function(value){return regexp.test(value);}; 35 | } 36 | 37 | // Test whether a DOM node has a certain CSS class. Much faster than 38 | // the MochiKit equivalent, for some reason. 39 | function hasClass(element, className){ 40 | var classes = element.className; 41 | return classes && new RegExp("(^| )" + className + "($| )").test(classes); 42 | } 43 | 44 | // Insert a DOM node after another node. 45 | function insertAfter(newNode, oldNode) { 46 | var parent = oldNode.parentNode; 47 | parent.insertBefore(newNode, oldNode.nextSibling); 48 | return newNode; 49 | } 50 | 51 | function removeElement(node) { 52 | if (node.parentNode) 53 | node.parentNode.removeChild(node); 54 | } 55 | 56 | function clearElement(node) { 57 | while (node.firstChild) 58 | node.removeChild(node.firstChild); 59 | } 60 | 61 | // Check whether a node is contained in another one. 62 | function isAncestor(node, child) { 63 | while (child = child.parentNode) { 64 | if (node == child) 65 | return true; 66 | } 67 | return false; 68 | } 69 | 70 | // The non-breaking space character. 71 | var nbsp = "\u00a0"; 72 | var matching = {"{": "}", "[": "]", "(": ")", 73 | "}": "{", "]": "[", ")": "("}; 74 | 75 | // Standardize a few unportable event properties. 76 | function normalizeEvent(event) { 77 | if (!event.stopPropagation) { 78 | event.stopPropagation = function() {this.cancelBubble = true;}; 79 | event.preventDefault = function() {this.returnValue = false;}; 80 | } 81 | if (!event.stop) { 82 | event.stop = function() { 83 | this.stopPropagation(); 84 | this.preventDefault(); 85 | }; 86 | } 87 | 88 | if (event.type == "keypress") { 89 | event.code = (event.charCode == null) ? event.keyCode : event.charCode; 90 | event.character = String.fromCharCode(event.code); 91 | } 92 | return event; 93 | } 94 | 95 | // Portably register event handlers. 96 | function addEventHandler(node, type, handler, removeFunc) { 97 | function wrapHandler(event) { 98 | handler(normalizeEvent(event || window.event)); 99 | } 100 | if (typeof node.addEventListener == "function") { 101 | node.addEventListener(type, wrapHandler, false); 102 | if (removeFunc) return function() {node.removeEventListener(type, wrapHandler, false);}; 103 | } 104 | else { 105 | node.attachEvent("on" + type, wrapHandler); 106 | if (removeFunc) return function() {node.detachEvent("on" + type, wrapHandler);}; 107 | } 108 | } 109 | 110 | function nodeText(node) { 111 | return node.textContent || node.innerText || node.nodeValue || ""; 112 | } 113 | 114 | function nodeTop(node) { 115 | var top = 0; 116 | while (node.offsetParent) { 117 | top += node.offsetTop; 118 | node = node.offsetParent; 119 | } 120 | return top; 121 | } 122 | 123 | function isBR(node) { 124 | var nn = node.nodeName; 125 | return nn == "BR" || nn == "br"; 126 | } 127 | function isSpan(node) { 128 | var nn = node.nodeName; 129 | return nn == "SPAN" || nn == "span"; 130 | } 131 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/python/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Python demonstration 5 | 18 | 19 | 20 |

21 | This is a simple demonstration of the Python syntax highlighting module 22 | for CodeMirror. 23 |

24 |

25 | Features of this parser include: 26 |

27 | 37 |

Written by Timothy Farrell (license). Special 38 | thanks to Adam Brand and Marijn Haverbeke for their help in debugging 39 | and providing for this parser.

40 | 41 |
42 | 127 |
128 | 129 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /assets/codemirror/unittests.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | Test Harness for CodeMirror 11 | 12 | 13 | 14 | 106 | 107 | 108 | 109 |

Test Harness for CodeMirror

110 |
111 |
112 |
113 | 114 |
115 | 116 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /assets/codemirror/contrib/php/js/parsephphtmlmixed.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. 3 | The copyrights embodied in the content of this file are licensed by 4 | Yahoo! Inc. under the BSD (revised) open source license 5 | 6 | @author Dan Vlad Dascalescu 7 | 8 | Based on parsehtmlmixed.js by Marijn Haverbeke. 9 | */ 10 | 11 | var PHPHTMLMixedParser = Editor.Parser = (function() { 12 | var processingInstructions = [""); 36 | break; 37 | } 38 | } 39 | else if (token.style == "xml-attribute" && token.content == "\"php\"" && inTag == "script" && lastAtt == "language") 40 | inTag = "script/php"; 41 | // "xml-processing" tokens are ignored, because they should be handled by a specific local parser 42 | else if (token.content == ">") { 43 | if (inTag == "script/php") 44 | iter.next = local(PHPParser, ""); 45 | else if (inTag == "script") 46 | iter.next = local(JSParser, " character 43 | // Return the next character in the stream. 44 | peek: function() { 45 | if (!ensureChars()) return null; 46 | return current.charAt(pos); 47 | }, 48 | // next: -> character 49 | // Get the next character, throw StopIteration if at end, check 50 | // for unused content. 51 | next: function() { 52 | if (!ensureChars()) { 53 | if (accum.length > 0) 54 | throw "End of stringstream reached without emptying buffer ('" + accum + "')."; 55 | else 56 | throw StopIteration; 57 | } 58 | return current.charAt(pos++); 59 | }, 60 | // get(): -> string 61 | // Return the characters iterated over since the last call to 62 | // .get(). 63 | get: function() { 64 | var temp = accum; 65 | accum = ""; 66 | if (pos > 0){ 67 | temp += current.slice(0, pos); 68 | current = current.slice(pos); 69 | pos = 0; 70 | } 71 | return temp; 72 | }, 73 | // Push a string back into the stream. 74 | push: function(str) { 75 | current = current.slice(0, pos) + str + current.slice(pos); 76 | }, 77 | lookAhead: function(str, consume, skipSpaces, caseInsensitive) { 78 | function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} 79 | str = cased(str); 80 | var found = false; 81 | 82 | var _accum = accum, _pos = pos; 83 | if (skipSpaces) this.nextWhileMatches(/[\s\u00a0]/); 84 | 85 | while (true) { 86 | var end = pos + str.length, left = current.length - pos; 87 | if (end <= current.length) { 88 | found = str == cased(current.slice(pos, end)); 89 | pos = end; 90 | break; 91 | } 92 | else if (str.slice(0, left) == cased(current.slice(pos))) { 93 | accum += current; current = ""; 94 | try {current = source.next();} 95 | catch (e) {break;} 96 | pos = 0; 97 | str = str.slice(left); 98 | } 99 | else { 100 | break; 101 | } 102 | } 103 | 104 | if (!(found && consume)) { 105 | current = accum.slice(_accum.length) + current; 106 | pos = _pos; 107 | accum = _accum; 108 | } 109 | 110 | return found; 111 | }, 112 | 113 | // Utils built on top of the above 114 | // more: -> boolean 115 | // Produce true if the stream isn't empty. 116 | more: function() { 117 | return this.peek() !== null; 118 | }, 119 | applies: function(test) { 120 | var next = this.peek(); 121 | return (next !== null && test(next)); 122 | }, 123 | nextWhile: function(test) { 124 | var next; 125 | while ((next = this.peek()) !== null && test(next)) 126 | this.next(); 127 | }, 128 | matches: function(re) { 129 | var next = this.peek(); 130 | return (next !== null && re.test(next)); 131 | }, 132 | nextWhileMatches: function(re) { 133 | var next; 134 | while ((next = this.peek()) !== null && re.test(next)) 135 | this.next(); 136 | }, 137 | equals: function(ch) { 138 | return ch === this.peek(); 139 | }, 140 | endOfLine: function() { 141 | var next = this.peek(); 142 | return next == null || next == "\n"; 143 | } 144 | }; 145 | }; 146 | -------------------------------------------------------------------------------- /assets/codemirror/js/parsecss.js: -------------------------------------------------------------------------------- 1 | /* Simple parser for CSS */ 2 | 3 | var CSSParser = Editor.Parser = (function() { 4 | var tokenizeCSS = (function() { 5 | function normal(source, setState) { 6 | var ch = source.next(); 7 | if (ch == "@") { 8 | source.nextWhileMatches(/\w/); 9 | return "css-at"; 10 | } 11 | else if (ch == "/" && source.equals("*")) { 12 | setState(inCComment); 13 | return null; 14 | } 15 | else if (ch == "<" && source.equals("!")) { 16 | setState(inSGMLComment); 17 | return null; 18 | } 19 | else if (ch == "=") { 20 | return "css-compare"; 21 | } 22 | else if (source.equals("=") && (ch == "~" || ch == "|")) { 23 | source.next(); 24 | return "css-compare"; 25 | } 26 | else if (ch == "\"" || ch == "'") { 27 | setState(inString(ch)); 28 | return null; 29 | } 30 | else if (ch == "#") { 31 | source.nextWhileMatches(/\w/); 32 | return "css-hash"; 33 | } 34 | else if (ch == "!") { 35 | source.nextWhileMatches(/[ \t]/); 36 | source.nextWhileMatches(/\w/); 37 | return "css-important"; 38 | } 39 | else if (/\d/.test(ch)) { 40 | source.nextWhileMatches(/[\w.%]/); 41 | return "css-unit"; 42 | } 43 | else if (/[,.+>*\/]/.test(ch)) { 44 | return "css-select-op"; 45 | } 46 | else if (/[;{}:\[\]]/.test(ch)) { 47 | return "css-punctuation"; 48 | } 49 | else { 50 | source.nextWhileMatches(/[\w\\\-_]/); 51 | return "css-identifier"; 52 | } 53 | } 54 | 55 | function inCComment(source, setState) { 56 | var maybeEnd = false; 57 | while (!source.endOfLine()) { 58 | var ch = source.next(); 59 | if (maybeEnd && ch == "/") { 60 | setState(normal); 61 | break; 62 | } 63 | maybeEnd = (ch == "*"); 64 | } 65 | return "css-comment"; 66 | } 67 | 68 | function inSGMLComment(source, setState) { 69 | var dashes = 0; 70 | while (!source.endOfLine()) { 71 | var ch = source.next(); 72 | if (dashes >= 2 && ch == ">") { 73 | setState(normal); 74 | break; 75 | } 76 | dashes = (ch == "-") ? dashes + 1 : 0; 77 | } 78 | return "css-comment"; 79 | } 80 | 81 | function inString(quote) { 82 | return function(source, setState) { 83 | var escaped = false; 84 | while (!source.endOfLine()) { 85 | var ch = source.next(); 86 | if (ch == quote && !escaped) 87 | break; 88 | escaped = !escaped && ch == "\\"; 89 | } 90 | if (!escaped) 91 | setState(normal); 92 | return "css-string"; 93 | }; 94 | } 95 | 96 | return function(source, startState) { 97 | return tokenizer(source, startState || normal); 98 | }; 99 | })(); 100 | 101 | function indentCSS(inBraces, inRule, base) { 102 | return function(nextChars) { 103 | if (!inBraces || /^\}/.test(nextChars)) return base; 104 | else if (inRule) return base + indentUnit * 2; 105 | else return base + indentUnit; 106 | }; 107 | } 108 | 109 | // This is a very simplistic parser -- since CSS does not really 110 | // nest, it works acceptably well, but some nicer colouroing could 111 | // be provided with a more complicated parser. 112 | function parseCSS(source, basecolumn) { 113 | basecolumn = basecolumn || 0; 114 | var tokens = tokenizeCSS(source); 115 | var inBraces = false, inRule = false, inDecl = false;; 116 | 117 | var iter = { 118 | next: function() { 119 | var token = tokens.next(), style = token.style, content = token.content; 120 | 121 | if (style == "css-hash") 122 | style = token.style = inRule ? "css-colorcode" : "css-identifier"; 123 | if (style == "css-identifier") { 124 | if (inRule) token.style = "css-value"; 125 | else if (!inBraces && !inDecl) token.style = "css-selector"; 126 | } 127 | 128 | if (content == "\n") 129 | token.indentation = indentCSS(inBraces, inRule, basecolumn); 130 | 131 | if (content == "{") 132 | inBraces = true; 133 | else if (content == "}") 134 | inBraces = inRule = inDecl = false; 135 | else if (content == ";") 136 | inRule = inDecl = false; 137 | else if (inBraces && style != "css-comment" && style != "whitespace") 138 | inRule = true; 139 | else if (!inBraces && style == "css-at") 140 | inDecl = true; 141 | 142 | return token; 143 | }, 144 | 145 | copy: function() { 146 | var _inBraces = inBraces, _inRule = inRule, _tokenState = tokens.state; 147 | return function(source) { 148 | tokens = tokenizeCSS(source, _tokenState); 149 | inBraces = _inBraces; 150 | inRule = _inRule; 151 | return iter; 152 | }; 153 | } 154 | }; 155 | return iter; 156 | } 157 | 158 | return {make: parseCSS, electricChars: "}"}; 159 | })(); 160 | -------------------------------------------------------------------------------- /assets/codemirror/js/parsesparql.js: -------------------------------------------------------------------------------- 1 | var SparqlParser = Editor.Parser = (function() { 2 | function wordRegexp(words) { 3 | return new RegExp("^(?:" + words.join("|") + ")$", "i"); 4 | } 5 | var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", 6 | "isblank", "isliteral", "union", "a"]); 7 | var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", 8 | "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", 9 | "graph", "by", "asc", "desc"]); 10 | var operatorChars = /[*+\-<>=&|]/; 11 | 12 | var tokenizeSparql = (function() { 13 | function normal(source, setState) { 14 | var ch = source.next(); 15 | if (ch == "$" || ch == "?") { 16 | source.nextWhileMatches(/[\w\d]/); 17 | return "sp-var"; 18 | } 19 | else if (ch == "<" && !source.matches(/[\s\u00a0=]/)) { 20 | source.nextWhileMatches(/[^\s\u00a0>]/); 21 | if (source.equals(">")) source.next(); 22 | return "sp-uri"; 23 | } 24 | else if (ch == "\"" || ch == "'") { 25 | setState(inLiteral(ch)); 26 | return null; 27 | } 28 | else if (/[{}\(\),\.;\[\]]/.test(ch)) { 29 | return "sp-punc"; 30 | } 31 | else if (ch == "#") { 32 | while (!source.endOfLine()) source.next(); 33 | return "sp-comment"; 34 | } 35 | else if (operatorChars.test(ch)) { 36 | source.nextWhileMatches(operatorChars); 37 | return "sp-operator"; 38 | } 39 | else if (ch == ":") { 40 | source.nextWhileMatches(/[\w\d\._\-]/); 41 | return "sp-prefixed"; 42 | } 43 | else { 44 | source.nextWhileMatches(/[_\w\d]/); 45 | if (source.equals(":")) { 46 | source.next(); 47 | source.nextWhileMatches(/[\w\d_\-]/); 48 | return "sp-prefixed"; 49 | } 50 | var word = source.get(), type; 51 | if (ops.test(word)) 52 | type = "sp-operator"; 53 | else if (keywords.test(word)) 54 | type = "sp-keyword"; 55 | else 56 | type = "sp-word"; 57 | return {style: type, content: word}; 58 | } 59 | } 60 | 61 | function inLiteral(quote) { 62 | return function(source, setState) { 63 | var escaped = false; 64 | while (!source.endOfLine()) { 65 | var ch = source.next(); 66 | if (ch == quote && !escaped) { 67 | setState(normal); 68 | break; 69 | } 70 | escaped = !escaped && ch == "\\"; 71 | } 72 | return "sp-literal"; 73 | }; 74 | } 75 | 76 | return function(source, startState) { 77 | return tokenizer(source, startState || normal); 78 | }; 79 | })(); 80 | 81 | function indentSparql(context) { 82 | return function(nextChars) { 83 | var firstChar = nextChars && nextChars.charAt(0); 84 | if (/[\]\}]/.test(firstChar)) 85 | while (context && context.type == "pattern") context = context.prev; 86 | 87 | var closing = context && firstChar == matching[context.type]; 88 | if (!context) 89 | return 0; 90 | else if (context.type == "pattern") 91 | return context.col; 92 | else if (context.align) 93 | return context.col - (closing ? context.width : 0); 94 | else 95 | return context.indent + (closing ? 0 : indentUnit); 96 | } 97 | } 98 | 99 | function parseSparql(source) { 100 | var tokens = tokenizeSparql(source); 101 | var context = null, indent = 0, col = 0; 102 | function pushContext(type, width) { 103 | context = {prev: context, indent: indent, col: col, type: type, width: width}; 104 | } 105 | function popContext() { 106 | context = context.prev; 107 | } 108 | 109 | var iter = { 110 | next: function() { 111 | var token = tokens.next(), type = token.style, content = token.content, width = token.value.length; 112 | 113 | if (content == "\n") { 114 | token.indentation = indentSparql(context); 115 | indent = col = 0; 116 | if (context && context.align == null) context.align = false; 117 | } 118 | else if (type == "whitespace" && col == 0) { 119 | indent = width; 120 | } 121 | else if (type != "sp-comment" && context && context.align == null) { 122 | context.align = true; 123 | } 124 | 125 | if (content != "\n") col += width; 126 | 127 | if (/[\[\{\(]/.test(content)) { 128 | pushContext(content, width); 129 | } 130 | else if (/[\]\}\)]/.test(content)) { 131 | while (context && context.type == "pattern") 132 | popContext(); 133 | if (context && content == matching[context.type]) 134 | popContext(); 135 | } 136 | else if (content == "." && context && context.type == "pattern") { 137 | popContext(); 138 | } 139 | else if ((type == "sp-word" || type == "sp-prefixed" || type == "sp-uri" || type == "sp-var" || type == "sp-literal") && 140 | context && /[\{\[]/.test(context.type)) { 141 | pushContext("pattern", width); 142 | } 143 | 144 | return token; 145 | }, 146 | 147 | copy: function() { 148 | var _context = context, _indent = indent, _col = col, _tokenState = tokens.state; 149 | return function(source) { 150 | tokens = tokenizeSparql(source, _tokenState); 151 | context = _context; 152 | indent = _indent; 153 | col = _col; 154 | return iter; 155 | }; 156 | } 157 | }; 158 | return iter; 159 | } 160 | 161 | return {make: parseSparql, electricChars: "}]"}; 162 | })(); 163 | -------------------------------------------------------------------------------- /demos/Drag.Scroll/demo.html: -------------------------------------------------------------------------------- 1 | 2 |

Vertical Scrolling

3 | 4 |
5 | 6 |
7 | 8 |

9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et lectus eget 10 | magna interdum lacinia vitae vitae quam. Maecenas sed sem eu purus posuere 11 | auctor. Sed auctor vulputate pharetra. Curabitur augue tortor, auctor a 12 | molestie id, rutrum luctus tortor. Cras molestie libero id purus 13 | sollicitudin auctor sagittis id arcu. Donec porttitor, lacus ut rhoncus 14 | vestibulum, neque tellus auctor libero, at consequat nisi mi in orci. 15 | Aliquam justo tortor, egestas accumsan pulvinar vel, dictum eu orci. Aliquam 16 | id elit quis nibh sodales fermentum at et nunc. In quis odio nec odio cursus 17 | lobortis. Vestibulum orci magna, scelerisque id eleifend vitae, malesuada id 18 | magna. Aliquam dui arcu, ultricies sed facilisis ut, commodo sed eros. 19 | Quisque a nisi nisi, vel pretium est. Aliquam erat volutpat. Curabitur ac 20 | vestibulum augue. Nunc hendrerit nisl in tortor mollis laoreet. 21 |

22 | 23 |

24 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et lectus eget 25 | magna interdum lacinia vitae vitae quam. Maecenas sed sem eu purus posuere 26 | auctor. Sed auctor vulputate pharetra. Curabitur augue tortor, auctor a 27 | molestie id, rutrum luctus tortor. Cras molestie libero id purus 28 | sollicitudin auctor sagittis id arcu. Donec porttitor, lacus ut rhoncus 29 | vestibulum, neque tellus auctor libero, at consequat nisi mi in orci. 30 | Aliquam justo tortor, egestas accumsan pulvinar vel, dictum eu orci. Aliquam 31 | id elit quis nibh sodales fermentum at et nunc. In quis odio nec odio cursus 32 | lobortis. Vestibulum orci magna, scelerisque id eleifend vitae, malesuada id 33 | magna. Aliquam dui arcu, ultricies sed facilisis ut, commodo sed eros. 34 | Quisque a nisi nisi, vel pretium est. Aliquam erat volutpat. Curabitur ac 35 | vestibulum augue. Nunc hendrerit nisl in tortor mollis laoreet. 36 |

37 | 38 |

39 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et lectus eget 40 | magna interdum lacinia vitae vitae quam. Maecenas sed sem eu purus posuere 41 | auctor. Sed auctor vulputate pharetra. Curabitur augue tortor, auctor a 42 | molestie id, rutrum luctus tortor. Cras molestie libero id purus 43 | sollicitudin auctor sagittis id arcu. Donec porttitor, lacus ut rhoncus 44 | vestibulum, neque tellus auctor libero, at consequat nisi mi in orci. 45 | Aliquam justo tortor, egestas accumsan pulvinar vel, dictum eu orci. Aliquam 46 | id elit quis nibh sodales fermentum at et nunc. In quis odio nec odio cursus 47 | lobortis. Vestibulum orci magna, scelerisque id eleifend vitae, malesuada id 48 | magna. Aliquam dui arcu, ultricies sed facilisis ut, commodo sed eros. 49 | Quisque a nisi nisi, vel pretium est. Aliquam erat volutpat. Curabitur ac 50 | vestibulum augue. Nunc hendrerit nisl in tortor mollis laoreet. 51 |

52 | 53 |

54 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et lectus eget 55 | magna interdum lacinia vitae vitae quam. Maecenas sed sem eu purus posuere 56 | auctor. Sed auctor vulputate pharetra. Curabitur augue tortor, auctor a 57 | molestie id, rutrum luctus tortor. Cras molestie libero id purus 58 | sollicitudin auctor sagittis id arcu. Donec porttitor, lacus ut rhoncus 59 | vestibulum, neque tellus auctor libero, at consequat nisi mi in orci. 60 | Aliquam justo tortor, egestas accumsan pulvinar vel, dictum eu orci. Aliquam 61 | id elit quis nibh sodales fermentum at et nunc. In quis odio nec odio cursus 62 | lobortis. Vestibulum orci magna, scelerisque id eleifend vitae, malesuada id 63 | magna. Aliquam dui arcu, ultricies sed facilisis ut, commodo sed eros. 64 | Quisque a nisi nisi, vel pretium est. Aliquam erat volutpat. Curabitur ac 65 | vestibulum augue. Nunc hendrerit nisl in tortor mollis laoreet. 66 |

67 | 68 |

69 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et lectus eget 70 | magna interdum lacinia vitae vitae quam. Maecenas sed sem eu purus posuere 71 | auctor. Sed auctor vulputate pharetra. Curabitur augue tortor, auctor a 72 | molestie id, rutrum luctus tortor. Cras molestie libero id purus 73 | sollicitudin auctor sagittis id arcu. Donec porttitor, lacus ut rhoncus 74 | vestibulum, neque tellus auctor libero, at consequat nisi mi in orci. 75 | Aliquam justo tortor, egestas accumsan pulvinar vel, dictum eu orci. Aliquam 76 | id elit quis nibh sodales fermentum at et nunc. In quis odio nec odio cursus 77 | lobortis. Vestibulum orci magna, scelerisque id eleifend vitae, malesuada id 78 | magna. Aliquam dui arcu, ultricies sed facilisis ut, commodo sed eros. 79 | Quisque a nisi nisi, vel pretium est. Aliquam erat volutpat. Curabitur ac 80 | vestibulum augue. Nunc hendrerit nisl in tortor mollis laoreet. 81 |

82 | 83 |

84 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis et lectus eget 85 | magna interdum lacinia vitae vitae quam. Maecenas sed sem eu purus posuere 86 | auctor. Sed auctor vulputate pharetra. Curabitur augue tortor, auctor a 87 | molestie id, rutrum luctus tortor. Cras molestie libero id purus 88 | sollicitudin auctor sagittis id arcu. Donec porttitor, lacus ut rhoncus 89 | vestibulum, neque tellus auctor libero, at consequat nisi mi in orci. 90 | Aliquam justo tortor, egestas accumsan pulvinar vel, dictum eu orci. Aliquam 91 | id elit quis nibh sodales fermentum at et nunc. In quis odio nec odio cursus 92 | lobortis. Vestibulum orci magna, scelerisque id eleifend vitae, malesuada id 93 | magna. Aliquam dui arcu, ultricies sed facilisis ut, commodo sed eros. 94 | Quisque a nisi nisi, vel pretium est. Aliquam erat volutpat. Curabitur ac 95 | vestibulum augue. Nunc hendrerit nisl in tortor mollis laoreet. 96 |

97 | 98 |
99 | 100 |
101 | 102 |

Vertical and Horizontal Scrolling

103 | 104 |
105 | 106 |
107 | 108 |
109 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 37 | 38 | 39 | 40 | 41 | MooTools Demos<?php if (!empty($descriptor['name'])): echo ' - ' . $descriptor['name']; endif; ?> 42 | 43 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | 53 | 58 | 59 |
60 | 61 |
62 |
63 | 97 |
98 |
99 | 100 | 101 |
102 | ' . $descriptor['name'] . ''; endif; ?> 103 | 104 |
105 | 106 | 107 |
108 | 109 |
110 | 111 | 112 | 113 |
114 | 115 |
    116 |
  • Demo
  • 117 |
  • 118 | 119 |
  • Docs
  • 120 | 121 |
  • CSS
  • 122 |
  • HTML
  • 123 |
  • JavaScript
  • 124 |
125 | 126 |
127 | 128 |
129 | 130 |
131 | 132 | 133 |
134 |

Documentation References:

135 |
    136 | 137 |
  • 138 | 139 |
140 |
141 | 142 | 143 |
144 | 145 |
146 | 147 |
148 | 149 |
150 | 151 |
152 | 153 |
154 | 155 | 156 | 157 | 158 | 159 | 160 | 163 | 164 | 165 |

MooTools Demos

166 | 167 |

The demos are here to give you some examples of how MooTools works. Demos can be opened in jsFiddle for editing, and you can download the entire demo runner here.

168 | 169 |

We hope you enjoy our demos.

170 |

The MooTools Development Team.

171 | 172 |
173 |
174 | 175 |
176 | 177 | 178 | 179 | --------------------------------------------------------------------------------