diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8fb0b6a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +# Matches multiple files with brace expansion notation +# Set default charset +[*.{js,py}] +charset = utf-8 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +# Do NOT trim trailing whitespace because Markdown in slides needs 2 spaces to create line break +[*.html] +indent_style = space +indent_style = 2 +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c219de4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +.sass-cache diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..35ab724 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 823f896..67f78b9 --- a/README.md +++ b/README.md @@ -1 +1,31 @@ -This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. +# Canada Learning Code +## Intro to JavaScript + +A full day introductory to JavaScript workshop. + +### Quick Links + +Instructor Notes: https://ladieslearningcode.github.io/llc-intro-to-javascript/instructor-notes.html + +Preview Slides: https://ladieslearningcode.github.io/llc-intro-to-javascript/slides.html + +### Attributions + +Created by [William Wolfe-Wylie](http://www.wolfewylie.com/) for [Canada Learning Code](https://www.canadalearningcode.ca/). +Slide presentation created by [Christina Truong](http://christinatruong.com/) for [Canada Learning Code](https://www.canadalearningcode.ca/). +Contributions & Illustrations by [Florida Elago](http://floridaelago.com/). + +Email questions & comments to . + +This content was created with the advisory of and in collaboration with educators, industry representatives and technologists. These individuals have helped us to ensure that lesson content represents the technology landscape and educator needs, with learners in mind. If you'd like to contribute to future lesson content development, let us know [here](https://docs.google.com/forms/d/e/1FAIpQLSfJ8NSMKVAmzpdn3EAymxCbDDz3XZPxyDdmtQ87GECuvXzzDQ/viewform). + +We're really happy to see others leverage our content in their community - we’ve developed it to be used by others with attribution through a [Creative Commons (CC BY-NC 4.0) license](https://creativecommons.org/licenses/by-nc/4.0/). + +Here's an easy way to attribute content back to us - please include it wherever you use or make reference to our content. + +"Please note that this is not a [Canada Learning Code](https://www.canadalearningcode.ca/) affiliated event, but we want to acknowledge the organization for the creation of [the content](https://github.com/ladieslearningcode/llc-intro-to-javascript) being delivered under Creative Commons license" + + +### Contributing + +Our general Rule of Thumb is that it's okay to add examples if you feel it could provide more context for your community. However, we ask that instructors do not remove anything, as the content is designed with intention, whether that be meeting specific learning objectives, or maintaining our organization’s culture through the design. Any suggestions for revisions or updates can be submitted in Github via issues and pull requests. If submitting an issue, please include the slide number(s) in the title. diff --git a/assets/BentoBox.png b/assets/BentoBox.png deleted file mode 100755 index 071456c..0000000 Binary files a/assets/BentoBox.png and /dev/null differ diff --git a/assets/BentoBox2.png b/assets/BentoBox2.png deleted file mode 100755 index f0eb63f..0000000 Binary files a/assets/BentoBox2.png and /dev/null differ diff --git a/assets/ChromeConsole.gif b/assets/ChromeConsole.gif deleted file mode 100755 index 64517a1..0000000 Binary files a/assets/ChromeConsole.gif and /dev/null differ diff --git a/assets/CirqueDuSoleil.png b/assets/CirqueDuSoleil.png deleted file mode 100755 index d27226a..0000000 Binary files a/assets/CirqueDuSoleil.png and /dev/null differ diff --git a/assets/Cyberduck_icon.png b/assets/Cyberduck_icon.png deleted file mode 100755 index 4877284..0000000 Binary files a/assets/Cyberduck_icon.png and /dev/null differ diff --git a/assets/OneMillionTowers.jpg b/assets/OneMillionTowers.jpg deleted file mode 100755 index d3d1b6a..0000000 Binary files a/assets/OneMillionTowers.jpg and /dev/null differ diff --git a/assets/Rice.png b/assets/Rice.png deleted file mode 100755 index 9da1933..0000000 Binary files a/assets/Rice.png and /dev/null differ diff --git a/assets/SublimeTextIcon.jpg b/assets/SublimeTextIcon.jpg deleted file mode 100755 index 15c20c1..0000000 Binary files a/assets/SublimeTextIcon.jpg and /dev/null differ diff --git a/assets/TRIAD-css.gif b/assets/TRIAD-css.gif deleted file mode 100755 index 2e3bd0a..0000000 Binary files a/assets/TRIAD-css.gif and /dev/null differ diff --git a/assets/TRIAD-html.gif b/assets/TRIAD-html.gif deleted file mode 100755 index 876fdae..0000000 Binary files a/assets/TRIAD-html.gif and /dev/null differ diff --git a/assets/TRIAD-js.gif b/assets/TRIAD-js.gif deleted file mode 100755 index 968261a..0000000 Binary files a/assets/TRIAD-js.gif and /dev/null differ diff --git a/assets/beepbeep.jpg b/assets/beepbeep.jpg deleted file mode 100755 index 97d7171..0000000 Binary files a/assets/beepbeep.jpg and /dev/null differ diff --git a/assets/blindfold.gif b/assets/blindfold.gif deleted file mode 100755 index 8c81099..0000000 Binary files a/assets/blindfold.gif and /dev/null differ diff --git a/assets/clientversusserver.gif b/assets/clientversusserver.gif deleted file mode 100755 index 276dedb..0000000 Binary files a/assets/clientversusserver.gif and /dev/null differ diff --git a/assets/computer-memory.jpg b/assets/computer-memory.jpg deleted file mode 100755 index d00cdac..0000000 Binary files a/assets/computer-memory.jpg and /dev/null differ diff --git a/assets/dom-create-elements.jpg b/assets/dom-create-elements.jpg deleted file mode 100755 index ffd8a1a..0000000 Binary files a/assets/dom-create-elements.jpg and /dev/null differ diff --git a/assets/dom-document.gif b/assets/dom-document.gif deleted file mode 100755 index 13a5e6c..0000000 Binary files a/assets/dom-document.gif and /dev/null differ diff --git a/assets/dom-elements.jpg b/assets/dom-elements.jpg deleted file mode 100755 index 59cc616..0000000 Binary files a/assets/dom-elements.jpg and /dev/null differ diff --git a/assets/dom-location.gif b/assets/dom-location.gif deleted file mode 100755 index 9625a1d..0000000 Binary files a/assets/dom-location.gif and /dev/null differ diff --git a/assets/dom-overview.gif b/assets/dom-overview.gif deleted file mode 100755 index f995a17..0000000 Binary files a/assets/dom-overview.gif and /dev/null differ diff --git a/assets/dom-window.gif b/assets/dom-window.gif deleted file mode 100755 index 385af1f..0000000 Binary files a/assets/dom-window.gif and /dev/null differ diff --git a/assets/ejs.png b/assets/ejs.png deleted file mode 100755 index ff67f5e..0000000 Binary files a/assets/ejs.png and /dev/null differ diff --git a/assets/flickr-500.jpg b/assets/flickr-500.jpg deleted file mode 100755 index 1a72e2c..0000000 Binary files a/assets/flickr-500.jpg and /dev/null differ diff --git a/assets/function-parameters.jpg b/assets/function-parameters.jpg deleted file mode 100755 index 454ccbf..0000000 Binary files a/assets/function-parameters.jpg and /dev/null differ diff --git a/assets/gift-boxes.jpg b/assets/gift-boxes.jpg deleted file mode 100755 index f1216f3..0000000 Binary files a/assets/gift-boxes.jpg and /dev/null differ diff --git a/assets/git-download-zip.gif b/assets/git-download-zip.gif deleted file mode 100755 index 11dc3ce..0000000 Binary files a/assets/git-download-zip.gif and /dev/null differ diff --git a/assets/globe-mail.jpg b/assets/globe-mail.jpg deleted file mode 100755 index efb6022..0000000 Binary files a/assets/globe-mail.jpg and /dev/null differ diff --git a/assets/hash.gif b/assets/hash.gif deleted file mode 100755 index f69c914..0000000 Binary files a/assets/hash.gif and /dev/null differ diff --git a/assets/icon-hint.jpg b/assets/icon-hint.jpg deleted file mode 100755 index 351629b..0000000 Binary files a/assets/icon-hint.jpg and /dev/null differ diff --git a/assets/icon-reminder.jpg b/assets/icon-reminder.jpg deleted file mode 100755 index d8cb532..0000000 Binary files a/assets/icon-reminder.jpg and /dev/null differ diff --git a/assets/javascript-the-good-parts-the-definitive-guide.jpg b/assets/javascript-the-good-parts-the-definitive-guide.jpg deleted file mode 100755 index 3c1a1c5..0000000 Binary files a/assets/javascript-the-good-parts-the-definitive-guide.jpg and /dev/null differ diff --git a/assets/jquery-novice-to-ninja-cover.png b/assets/jquery-novice-to-ninja-cover.png deleted file mode 100755 index 0251986..0000000 Binary files a/assets/jquery-novice-to-ninja-cover.png and /dev/null differ diff --git a/assets/ladieslearningcode-125x125.gif b/assets/ladieslearningcode-125x125.gif deleted file mode 100755 index 968550b..0000000 Binary files a/assets/ladieslearningcode-125x125.gif and /dev/null differ diff --git a/assets/llcodedotcom_hamster.gif b/assets/llcodedotcom_hamster.gif deleted file mode 100755 index 11cf7e8..0000000 Binary files a/assets/llcodedotcom_hamster.gif and /dev/null differ diff --git a/assets/loading.gif b/assets/loading.gif deleted file mode 100755 index 63e9092..0000000 Binary files a/assets/loading.gif and /dev/null differ diff --git a/assets/logo_jquery.gif b/assets/logo_jquery.gif deleted file mode 100755 index 4ccb1cf..0000000 Binary files a/assets/logo_jquery.gif and /dev/null differ diff --git a/assets/new-chrome-logo.png b/assets/new-chrome-logo.png deleted file mode 100755 index ddfd6a2..0000000 Binary files a/assets/new-chrome-logo.png and /dev/null differ diff --git a/assets/next_section_icon.gif b/assets/next_section_icon.gif deleted file mode 100755 index 39fb676..0000000 Binary files a/assets/next_section_icon.gif and /dev/null differ diff --git a/assets/pearl_avatar.png b/assets/pearl_avatar.png deleted file mode 100755 index a9c28b5..0000000 Binary files a/assets/pearl_avatar.png and /dev/null differ diff --git a/assets/planet-robots.jpg b/assets/planet-robots.jpg deleted file mode 100755 index 98433f5..0000000 Binary files a/assets/planet-robots.jpg and /dev/null differ diff --git a/assets/scripting.gif b/assets/scripting.gif deleted file mode 100755 index 125cac8..0000000 Binary files a/assets/scripting.gif and /dev/null differ diff --git a/assets/storage_boxes.png b/assets/storage_boxes.png deleted file mode 100755 index 925552e..0000000 Binary files a/assets/storage_boxes.png and /dev/null differ diff --git a/assets/telus.png b/assets/telus.png deleted file mode 100644 index 14800d8..0000000 Binary files a/assets/telus.png and /dev/null differ diff --git a/assets/thumb-down.png b/assets/thumb-down.png deleted file mode 100755 index 36d396b..0000000 Binary files a/assets/thumb-down.png and /dev/null differ diff --git a/assets/thumb-up.png b/assets/thumb-up.png deleted file mode 100755 index 47756f1..0000000 Binary files a/assets/thumb-up.png and /dev/null differ diff --git a/assets/var-shipping-example.jpg b/assets/var-shipping-example.jpg deleted file mode 100755 index 0502abf..0000000 Binary files a/assets/var-shipping-example.jpg and /dev/null differ diff --git a/exercises/1-hello.html b/exercises/1-hello.html new file mode 100755 index 0000000..7bd27b2 --- /dev/null +++ b/exercises/1-hello.html @@ -0,0 +1,15 @@ + + + + + Hello JavaScript + + + + + + + \ No newline at end of file diff --git a/exercises/2-shipping-info-solution.html b/exercises/2-shipping-info-solution.html new file mode 100755 index 0000000..82c4bca --- /dev/null +++ b/exercises/2-shipping-info-solution.html @@ -0,0 +1,24 @@ + + + Shipping Label + + + + + + + diff --git a/exercises/2-shipping-info.html b/exercises/2-shipping-info.html new file mode 100755 index 0000000..af5c55a --- /dev/null +++ b/exercises/2-shipping-info.html @@ -0,0 +1,25 @@ + + + Shipping Label + + + + + + + diff --git a/exercises/3-shopping-cart-solution.html b/exercises/3-shopping-cart-solution.html new file mode 100644 index 0000000..11fbb09 --- /dev/null +++ b/exercises/3-shopping-cart-solution.html @@ -0,0 +1,25 @@ + + + JavaScript example! + + + + + diff --git a/exercises/3-shopping-cart.html b/exercises/3-shopping-cart.html new file mode 100644 index 0000000..846b55b --- /dev/null +++ b/exercises/3-shopping-cart.html @@ -0,0 +1,37 @@ + + + Shopping Cart + + + + + diff --git a/exercises/4-methods-solution.html b/exercises/4-methods-solution.html new file mode 100644 index 0000000..4caaf96 --- /dev/null +++ b/exercises/4-methods-solution.html @@ -0,0 +1,21 @@ + + + JavaScript Methods + + + + + \ No newline at end of file diff --git a/exercises/4-methods.html b/exercises/4-methods.html new file mode 100644 index 0000000..86004c7 --- /dev/null +++ b/exercises/4-methods.html @@ -0,0 +1,21 @@ + + + JavaScript Methods + + + + + \ No newline at end of file diff --git a/exercises/5-update-quantities-solution.html b/exercises/5-update-quantities-solution.html new file mode 100755 index 0000000..5abb2aa --- /dev/null +++ b/exercises/5-update-quantities-solution.html @@ -0,0 +1,39 @@ + + + Update Quantities + + + + +
+ +
+ + + +
+ + Quantity +
+ + + + diff --git a/exercises/5-update-quantities.html b/exercises/5-update-quantities.html new file mode 100755 index 0000000..02a85a5 --- /dev/null +++ b/exercises/5-update-quantities.html @@ -0,0 +1,24 @@ + + + Update Quantities + + + + +
+ +
+ + + +
+ + Quantity +
+ + + + diff --git a/exercises/6-conditional-quantities-solution.html b/exercises/6-conditional-quantities-solution.html new file mode 100644 index 0000000..e6abaa7 --- /dev/null +++ b/exercises/6-conditional-quantities-solution.html @@ -0,0 +1,52 @@ + + + Update Quantities + + + + +
+ +
+ + + +
+ + Quantity + + +
+ + + + diff --git a/exercises/6-conditional-quantities.html b/exercises/6-conditional-quantities.html new file mode 100644 index 0000000..4bd2c5b --- /dev/null +++ b/exercises/6-conditional-quantities.html @@ -0,0 +1,44 @@ + + + Update Quantities + + + + +
+ +
+ + + +
+ + Quantity + + +
+ + + + diff --git a/exercises/chicken-wings.jpg b/exercises/chicken-wings.jpg deleted file mode 100755 index c476df4..0000000 Binary files a/exercises/chicken-wings.jpg and /dev/null differ diff --git a/exercises/exercises.css b/exercises/exercises.css new file mode 100644 index 0000000..6d1266a --- /dev/null +++ b/exercises/exercises.css @@ -0,0 +1,40 @@ +/* + Exercises: + 5-update-quantities.html + 6-conditional-quantities.html +*/ + +.quantities { + width: 200px; + text-align: center; + border: 2px solid #ccc; + padding: 20px; + margin: 40px auto; + font-size: 20px; +} +.quantities button { + margin: 20px 2px 5px; + font-size: 16px; + border: none; + padding: 6px 10px; + border-radius: 2px; + outline: none; + cursor: pointer; + border: 1px solid #ddd; + background: #eee; +} +.quantities button:hover { + border: 1px solid white; +} +.quantities input { + width: 40px; + margin: 10px 0 10px 5px; + font-size: 14px; +} + +.quantities .btn-checkout { + background: lightblue; + text-transform: uppercase; + font-size: 14px; +} + diff --git a/exercises/external-javascript.html b/exercises/external-javascript.html deleted file mode 100755 index 6aa0acd..0000000 --- a/exercises/external-javascript.html +++ /dev/null @@ -1,9 +0,0 @@ - - - JavaScript example! - - - -
This is an example.
- - \ No newline at end of file diff --git a/exercises/hello-javascript.html b/exercises/hello-javascript.html deleted file mode 100755 index bb8e40b..0000000 --- a/exercises/hello-javascript.html +++ /dev/null @@ -1,9 +0,0 @@ - - - Hello JavaScript - - \ No newline at end of file diff --git a/exercises/jquery-effects.html b/exercises/jquery-effects.html deleted file mode 100755 index ab03ee5..0000000 --- a/exercises/jquery-effects.html +++ /dev/null @@ -1,55 +0,0 @@ - - - jQuery Effects - - - - -
-

jQuery effects

-

http://api.jquery.com/category/effects/

- - - -
-
- - \ No newline at end of file diff --git a/exercises/jquery-javascript.html b/exercises/jquery-javascript.html deleted file mode 100755 index 5ba1803..0000000 --- a/exercises/jquery-javascript.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - jQuery and JavaScript - - - - - -
- -
- - - - - -
- Quantity - -
-
- Total Cost: - -
-
- - - -
- - - - - - diff --git a/exercises/jquery-javascript.js b/exercises/jquery-javascript.js deleted file mode 100755 index c43065a..0000000 --- a/exercises/jquery-javascript.js +++ /dev/null @@ -1,47 +0,0 @@ -// 1. Add jQuery's document.ready function - - - /* 2. Use jQuery to reference the elements by class, - add a click event and passing the corresponding function on the click */ - - - - - // Start quantity at 0 - var quantity = 0; - - // JavaScript functions, no need to changes these - function addItem(){ - quantity = quantity + 1; - refreshTotal(); - } - - function removeItem(){ - if ( quantity > 0 ) { - quantity = quantity - 1; - } else { - // do nothing - } - refreshTotal(); - } - - function checkout() { - if ( quantity <= 0 ) { - alert( "Sorry, you don't have anything in your cart!" ); - } else { - alert( "Thank you for your order!" ); - } - } - - function refreshTotal() { - // calculate the totalCost with a fixed price of $20. - var totalCost = quantity * 20; - // then update the quantity text field - document.getElementById('updateQuantity').value = quantity; - // update the total cost text field - document.getElementById('updateTotal').value = "$" + totalCost; - } - - - - diff --git a/exercises/mini-exercise-2.html b/exercises/mini-exercise-2.html deleted file mode 100755 index 8455908..0000000 --- a/exercises/mini-exercise-2.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -
-
- -
- Quantity - -
- - - \ No newline at end of file diff --git a/exercises/pizza-factory.jpg b/exercises/pizza-factory.jpg deleted file mode 100755 index 510a750..0000000 Binary files a/exercises/pizza-factory.jpg and /dev/null differ diff --git a/exercises/pizzaMaking.html b/exercises/pizzaMaking.html deleted file mode 100755 index bf55a6d..0000000 --- a/exercises/pizzaMaking.html +++ /dev/null @@ -1,25 +0,0 @@ - - - Ladies Making Pizza By Code - - -

Hello, may I have your order?

- - - -

- - - \ No newline at end of file diff --git a/exercises/scripts.js b/exercises/scripts.js deleted file mode 100755 index 0e8a1a4..0000000 --- a/exercises/scripts.js +++ /dev/null @@ -1,2 +0,0 @@ -// JavaScript Document -alert("This dialog box is being triggered from an external JavaScript file."); \ No newline at end of file diff --git a/exercises/shopping-cart.css b/exercises/shopping-cart.css deleted file mode 100755 index e9a69e9..0000000 --- a/exercises/shopping-cart.css +++ /dev/null @@ -1,130 +0,0 @@ -/*font-family: 'Fascinate', cursive; -font-family: 'Titan One', cursive;*/ -body { - margin: 0; - padding: 0; - font-family: Verdana, Arial, sans-serif; -} -header { - padding-left: 95px; -} -h1 { - color: #B1009A; - font: 70px 'Fascinate', cursive; - margin: 5px 0; - float: left; -} -h2 { - font: normal 18px Georgia, serif; - padding: 30px 0 0 20px; - float: left; -} -#container { - margin: 0 auto; - width: 960px; -} - - -#shoppingForm { - width: 960px; -} -fieldset { - margin: 0; - padding: 0; -} -legend { - padding-top: 20px; -} - -#productListings { - float: left; - width: 680px; - margin-bottom: 40px; - font-size: 12px; -} - #productListings .item { - float: left; - padding: 10px; - width: 195px; - } - #productListings .item ul { - list-style-type: none; - padding: 0; - margin: 0; - } - #productListings .item ul li { - display: inline-block; - padding: 2px 0; - } - #productListings .item img { - border: 1px solid #CCC; - } - #productListings .item input#updateQuantity { - width: 15px; - height: 10px; - } - #productListings fieldset { - border: 2px solid #B1009A; - margin-bottom: 10px; - padding: 10px 14px; - } - -#additionalInfo { - float: right; - border: 2px solid #CCC; - font-size: 14px; - padding: 20px; - width: 220px; - margin-bottom: 15px; -} - #additionalInfo fieldset { - border: none; - padding: 0; - margin: 0; - } - #additionalInfo h3 { - padding-top: 0; - margin: 0 0 10px; - font: 21px 'Titan One',cursive; - } - #additionalInfo #shippingInfo label, #additionalInfo #billingInfo label, #additionalInfo #finalTotal label { - float: left; - margin-bottom: 4px; - padding-top: 3px; - width: 90px; - } - #additionalInfo #shippingInfo input, #additionalInfo #billingInfo input, #additionalInfo #finalTotal input { - margin-bottom: 5px; - width: 120px; - } - #additionalInfo #shippingInfo, #additionalInfo #billingInfo { - margin-bottom: 20px; - } - #additionalInfo button { - float: right; - } - - #additionalInfo label#same_as_billing_label { - padding-top: 0; - width: 115px; - padding-bottom: 5px; - } - #additionalInfo input#same_as_billing { - width: 25px; - margin-bottom: 15px; - } - #additionalInfo .non-editable label { - color: #ccc; - } - #additionalInfo .non-editable label#same_as_billing_label { - color: #000; - } - -input.readonly { - border: 1px solid #ccc; -} - -button { - -} - diff --git a/exercises/shopping_cart_final.html b/exercises/shopping_cart_final.html deleted file mode 100755 index 4124f29..0000000 --- a/exercises/shopping_cart_final.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - Planet Robot - - - - - - - -
-
-

Planet Robots

-
-
-
-
-
-
    -
  • -
  • Transformers Ear buds
  • -
  • $17.99 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Gold Robot USB
  • -
  • $25.00 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Robots & Ninjas Nesting Dolls
  • -
  • $13.99 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Plush Android
  • -
  • $9.99 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Salt & Pepper Shakers
  • -
  • $24.99 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Stencil & Pen Kit
  • -
  • $8.99 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • T-shirt
  • -
  • $24.99 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Tea Infuser
  • -
  • $10.00 - - -
  • -
  • Quantity
  • -
-
-
-
    -
  • -
  • Wrapping paper
  • -
  • $5.99 - - -
  • -
  • Quantity
  • -
-
-
-
- - -
-
-

Your shopping cart

- - -
-
- -
-
-

Shipping Info

- - -
- - -
- - -
- - -
- - -
-
-
- - \ No newline at end of file diff --git a/exercises/shopping_cart_products_final.html b/exercises/shopping_cart_products_final.html deleted file mode 100755 index 1a40b67..0000000 --- a/exercises/shopping_cart_products_final.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - Planet Robot - Shipping - - - - - - - - -
-

Special members only sale!

-

Enter in your secret passcode here to see the great prices:

-
- - -
-
- -
-
-
-
    -
  • -
  • Transformers Ear buds
  • -
  • $17.99
  • -
-
-
-
    -
  • -
  • Gold Robot USB
  • -
  • $25.00
  • -
-
-
-
    -
  • -
  • Robots & Ninjas Nesting Dolls
  • -
  • $13.99
  • -
-
-
-
    -
  • -
  • Plush Android
  • -
  • $9.99
  • -
-
-
-
    -
  • -
  • Salt & Pepper Shakers
  • -
  • $24.99
  • -
-
-
-
    -
  • -
  • Stencil & Pen Kit
  • -
  • $8.99
  • -
-
-
-
    -
  • -
  • T-shirt
  • -
  • $24.99
  • -
-
-
-
    -
  • -
  • Tea Infuser
  • -
  • $10.00
  • -
-
-
-
    -
  • -
  • Wrapping paper
  • -
  • $5.99
  • -
-
-
-
- - - \ No newline at end of file diff --git a/exercises/shopping_cart_products_start.html b/exercises/shopping_cart_products_start.html deleted file mode 100755 index befd676..0000000 --- a/exercises/shopping_cart_products_start.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - Planet Robot - Shipping - - - - - - - - -
-

Special members only sale!

-

Enter in your secret passcode here to see the great prices:

-
- - -
-
- -
-
-
-
    -
  • -
  • Transformers Ear buds
  • -
  • $17.99
  • -
-
-
-
    -
  • -
  • Gold Robot USB
  • -
  • $25.00
  • -
-
-
-
    -
  • -
  • Robots & Ninjas Nesting Dolls
  • -
  • $13.99
  • -
-
-
-
    -
  • -
  • Plush Android
  • -
  • $9.99
  • -
-
-
-
    -
  • -
  • Salt & Pepper Shakers
  • -
  • $24.99
  • -
-
-
-
    -
  • -
  • Stencil & Pen Kit
  • -
  • $8.99
  • -
-
-
-
    -
  • -
  • T-shirt
  • -
  • $24.99
  • -
-
-
-
    -
  • -
  • Tea Infuser
  • -
  • $10.00
  • -
-
-
-
    -
  • -
  • Wrapping paper
  • -
  • $5.99
  • -
-
-
-
- - - \ No newline at end of file diff --git a/exercises/shopping_cart_shipping_final.html b/exercises/shopping_cart_shipping_final.html deleted file mode 100755 index 74ac2b0..0000000 --- a/exercises/shopping_cart_shipping_final.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - Planet Robot - Shipping - - - - - - - - - - -
- -
-

Billing Info

- - - -
- - -
- - -
- - - -
- -
-

Shipping Info

- - - -
- - - -
- - -
- - -
- - - -
- - - -
- - - \ No newline at end of file diff --git a/exercises/shopping_cart_shipping_start.html b/exercises/shopping_cart_shipping_start.html deleted file mode 100755 index 6bd9929..0000000 --- a/exercises/shopping_cart_shipping_start.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - Planet Robot - Shipping - - - - - - - - - - -
- -
-

Billing Info

- - - -
- - -
- - -
- - - -
- -
-

Shipping Info

- - - -
- - - -
- - -
- - -
- - - -
- - - -
- - - \ No newline at end of file diff --git a/exercises/slides.css b/exercises/slides.css deleted file mode 100755 index c302c84..0000000 --- a/exercises/slides.css +++ /dev/null @@ -1,44 +0,0 @@ -/* Slide: Who loves LadiesLearningCode? */ -#loveLLC button, #loveLLC #update { - float: left; - font-size: 13px; line-height: 20px; -} -#loveLLC button img { - float: left; - padding-right: 5px; -} -#loveLLC #update { - border: 1px solid #ccc; - margin: 2px 0 0 4px; - padding: 2px 6px 0; - float: left; -} - - -/* Slide: Mini-exercise #2, Slide: Mini-exercise #5 */ -.item { - width: 200px; - text-align: center; - border: 1px solid #ccc; - padding: 5px 5px 20px; - margin: 0 auto; -} - .item button { - margin-bottom: 5px; - } - .item input#updateQuantity { - width: 22px; - } - .item input#updateTotal { - width: 66px; - } - - -/* Slide: While Loop in Action */ -table#temperature { -border: 1px solid #C12AAA; - } - table#temperature tr td { - border: 1px solid #C12AAA; - padding: 4px; - } \ No newline at end of file diff --git a/exercises/solutions/chicken-wings.jpg b/exercises/solutions/chicken-wings.jpg deleted file mode 100755 index c476df4..0000000 Binary files a/exercises/solutions/chicken-wings.jpg and /dev/null differ diff --git a/exercises/solutions/complex-form-validation-org.txt b/exercises/solutions/complex-form-validation-org.txt deleted file mode 100755 index c50c371..0000000 --- a/exercises/solutions/complex-form-validation-org.txt +++ /dev/null @@ -1,37 +0,0 @@ - - -Name: - -
-Address: - -
-City: - -
-Postal Code: - -
-
- \ No newline at end of file diff --git a/exercises/solutions/complex-form-validation.txt b/exercises/solutions/complex-form-validation.txt deleted file mode 100755 index 5d2a585..0000000 --- a/exercises/solutions/complex-form-validation.txt +++ /dev/null @@ -1,35 +0,0 @@ - - -Name: - -
-Address: - -
-City: - -
-Postal Code: - -
-
- \ No newline at end of file diff --git a/exercises/solutions/form-validation-org.txt b/exercises/solutions/form-validation-org.txt deleted file mode 100755 index 45a260b..0000000 --- a/exercises/solutions/form-validation-org.txt +++ /dev/null @@ -1,24 +0,0 @@ - - -Address: - -
-
- \ No newline at end of file diff --git a/exercises/solutions/form-validation.txt b/exercises/solutions/form-validation.txt deleted file mode 100755 index e9d9054..0000000 --- a/exercises/solutions/form-validation.txt +++ /dev/null @@ -1,27 +0,0 @@ - - -Address: - -
-
- \ No newline at end of file diff --git a/exercises/solutions/jquery-effects.html b/exercises/solutions/jquery-effects.html deleted file mode 100755 index 2bda440..0000000 --- a/exercises/solutions/jquery-effects.html +++ /dev/null @@ -1,56 +0,0 @@ - - - jQuery Effects - - - - - -
-

jQuery effects

-

http://api.jquery.com/category/effects/

- - - -
-
- - \ No newline at end of file diff --git a/exercises/solutions/jquery-effects.js b/exercises/solutions/jquery-effects.js deleted file mode 100755 index 5afdb02..0000000 --- a/exercises/solutions/jquery-effects.js +++ /dev/null @@ -1,27 +0,0 @@ -$(document).ready(function(){ - - $('.hide').click(function(){ - $('#box').hide(); - }); - - $('.show').click(function(){ - $('#box').show(); - }); - - $('.fade').click(function(){ - $('#box').fadeOut(); - }); - - $('.toggle').click(function(){ - $('#box').toggle(); - }); - - $('.slide-up').click(function(){ - $('#box').slideUp(); - }); - - $('.slide-toggle').click(function(){ - $('#box').slideToggle(); - }); - -}); \ No newline at end of file diff --git a/exercises/solutions/jquery-javascript.html b/exercises/solutions/jquery-javascript.html deleted file mode 100755 index 02925c7..0000000 --- a/exercises/solutions/jquery-javascript.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - jQuery and JavaScript - - - - - -
- -
- - - - - -
- Quantity - -
-
- Total Cost: - -
-
- - - -
- - - - - - diff --git a/exercises/solutions/jquery-javascript.js b/exercises/solutions/jquery-javascript.js deleted file mode 100755 index 42cdeab..0000000 --- a/exercises/solutions/jquery-javascript.js +++ /dev/null @@ -1,60 +0,0 @@ -$(document).ready(function(){ - - /* Using jQuery to reference the elements by class, - adding a click event and passing the function on click */ - - // Referencing the button with the 'add' class - $(".add").click(function(){ - //call the appropriate function - addItem(); - }); - - $(".removeItem").click(function(){ - removeItem(); - }); - - $(".checkout").click(function(){ - checkout(); - }); - - - // Start quantity at 0 - var quantity = 0; - - // JavaScript functions - function addItem(){ - quantity = quantity + 1; - refreshTotal(); - } - - function removeItem(){ - if ( quantity > 0 ) { - quantity = quantity - 1; - } else { - // do nothing - } - refreshTotal(); - } - - function checkout() { - if ( quantity <= 0 ) { - alert( "Sorry, you don't have anything in your cart!" ); - } else { - alert( "Thank you for your order!" ); - } - } - - function refreshTotal() { - // calculate the totalCost with a fixed price of $20. - var totalCost = quantity * 20; - // then update the quantity text field - document.getElementById('updateQuantity').value = quantity; - // update the total cost text field - document.getElementById('updateTotal').value = "$" + totalCost; - } - -});//closes the document.ready - - - - diff --git a/exercises/solutions/quantities-org.txt b/exercises/solutions/quantities-org.txt deleted file mode 100755 index 4ddf460..0000000 --- a/exercises/solutions/quantities-org.txt +++ /dev/null @@ -1,46 +0,0 @@ - - - -
- -
- - -
- Quantity - -
-
\ No newline at end of file diff --git a/exercises/solutions/quantities.txt b/exercises/solutions/quantities.txt deleted file mode 100755 index a414341..0000000 --- a/exercises/solutions/quantities.txt +++ /dev/null @@ -1,46 +0,0 @@ - - - -
- -
- - -
- Quantity - -
-
\ No newline at end of file diff --git a/exercises/solutions/quantity-check-org.txt b/exercises/solutions/quantity-check-org.txt deleted file mode 100755 index 6f12ad3..0000000 --- a/exercises/solutions/quantity-check-org.txt +++ /dev/null @@ -1,66 +0,0 @@ - - -
- -
- - -
- Quantity - -
-
- Total Cost: - -
-
- -
\ No newline at end of file diff --git a/exercises/solutions/quantity-check.txt b/exercises/solutions/quantity-check.txt deleted file mode 100755 index 7e04716..0000000 --- a/exercises/solutions/quantity-check.txt +++ /dev/null @@ -1,73 +0,0 @@ - - -
- -
- - -
- Quantity - -
-
- Total Cost: - -
-
- -
\ No newline at end of file diff --git a/exercises/solutions/simple-shipping-label-org.txt b/exercises/solutions/simple-shipping-label-org.txt deleted file mode 100755 index b586b3c..0000000 --- a/exercises/solutions/simple-shipping-label-org.txt +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/exercises/solutions/simple-shipping-label.txt b/exercises/solutions/simple-shipping-label.txt deleted file mode 100755 index a0aa8bb..0000000 --- a/exercises/solutions/simple-shipping-label.txt +++ /dev/null @@ -1,18 +0,0 @@ - \ No newline at end of file diff --git a/exercises/solutions/totals-and-discounts-org.txt b/exercises/solutions/totals-and-discounts-org.txt deleted file mode 100755 index a7ba08c..0000000 --- a/exercises/solutions/totals-and-discounts-org.txt +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/exercises/solutions/totals-and-discounts.txt b/exercises/solutions/totals-and-discounts.txt deleted file mode 100755 index 17c54e8..0000000 --- a/exercises/solutions/totals-and-discounts.txt +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/exercises/solutions/wingMaking.html b/exercises/solutions/wingMaking.html deleted file mode 100755 index 9136d2c..0000000 --- a/exercises/solutions/wingMaking.html +++ /dev/null @@ -1,26 +0,0 @@ - - - Ladies Making Wings By Code - - - -

Hello, may I have your order?

- - - -

chicken wings

- - - \ No newline at end of file diff --git a/exercises/wingMaking.html b/exercises/wingMaking.html deleted file mode 100755 index 24c3add..0000000 --- a/exercises/wingMaking.html +++ /dev/null @@ -1,17 +0,0 @@ - - - Ladies Making Wings By Code - - -

Hello, may I have your order?

- - - -

- - - \ No newline at end of file diff --git a/framework/css/a11y/plugin.css b/framework/css/a11y/plugin.css new file mode 100644 index 0000000..fcbd45d --- /dev/null +++ b/framework/css/a11y/plugin.css @@ -0,0 +1,77 @@ +/** + * CSSS A11y Plugin + * + * - Resets focus indicator to be visible on `Tab` key press + * - Removes `outline` for slides when they receive focus + * - Includes helper classes + * + * @author Scott Vinkle + * @version 0.1.0 + * @license MIT License + */ + +/* Reset focus indicator styles */ +a:focus { + outline: 1px dotted #212121 !important; + outline: 5px auto -webkit-focus-ring-color !important; +} + +/* Removes flash of focus indicator when slide receives focus */ +.slide[tabindex="-1"]:focus { + outline: none; +} + +/* `.visuallyhidden` helper class definition + https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css#L141 +*/ +.visuallyhidden { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + white-space: nowrap; + width: 1px; +} + +/* `.focusable` helper class definition + https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css#L159 +*/ +.visuallyhidden.focusable:active, +.visuallyhidden.focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + white-space: inherit; + width: auto; +} + +/* List styles */ +.a11y-controls__list { + bottom: 90px; + list-style-type: none; + margin: 0; + padding: 0; + position: absolute; + right: 64px; +} + +/* List item styles */ +.a11y-controls__item { + margin: 0; + padding: 0; + position: absolute; + right: 0; + top: 0; +} + +/* Reset list item `before` styles */ +.a11y-controls__item::before { + content: ''; + margin: 0; + padding: 0; +} diff --git a/framework/css/fonts.css b/framework/css/fonts.css new file mode 100644 index 0000000..62ed850 --- /dev/null +++ b/framework/css/fonts.css @@ -0,0 +1,30 @@ +@font-face { + font-family: 'Montserrat'; + font-style: normal; + font-weight: 400; + src: local('Montserrat-Regular'), url(../fonts/montserrat-regular.woff2) format('woff2'); +} +@font-face { + font-family: 'Montserrat'; + font-style: normal; + font-weight: 700; + src: local('Montserrat-Bold'), url(../fonts/montserrat-bold.woff2) format('woff2'); +} +@font-face { + font-family: 'Pacifico'; + font-style: normal; + font-weight: 400; + src: local('Pacifico Regular'), local('Pacifico-Regular'), url(../fonts/pacifico.woff2) format('woff2'); +} +@font-face { + font-family: 'Quicksand'; + font-style: normal; + font-weight: 400; + src: local('Quicksand Regular'), local('Quicksand-Regular'), url(../fonts/quicksand.woff2) format('woff2'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 300; + src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/opensans.woff2) format('woff2'); +} diff --git a/framework/css/highlightjs/docco.css b/framework/css/highlightjs/docco.css new file mode 100755 index 0000000..b4ad1e5 --- /dev/null +++ b/framework/css/highlightjs/docco.css @@ -0,0 +1,135 @@ +/* +Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars) +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #000; + background: #f8f8ff; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.diff .hljs-header, +.hljs-javadoc { + color: #408080; + font-style: italic; +} + +.hljs-keyword, +.assignment, +.hljs-literal, +.css .rule .hljs-keyword, +.hljs-winutils, +.javascript .hljs-title, +.lisp .hljs-title, +.hljs-subst { + color: #954121; +} + +.hljs-number, +.hljs-hexcolor { + color: #40a070; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.hljs-dartdoc, +.tex .hljs-formula { + color: #219161; +} + +.hljs-title, +.hljs-id { + color: #19469d; +} +.hljs-params { + color: #00f; +} + +.javascript .hljs-title, +.lisp .hljs-title, +.hljs-subst { + font-weight: normal; +} + +.hljs-class .hljs-title, +.haskell .hljs-label, +.tex .hljs-command { + color: #458; + font-weight: bold; +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal; +} + +.hljs-attribute, +.hljs-variable, +.instancevar, +.lisp .hljs-body { + color: #008080; +} + +.hljs-regexp { + color: #b68; +} + +.hljs-class { + color: #458; + font-weight: bold; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.ruby .hljs-symbol .hljs-keyword, +.ruby .hljs-symbol .keymethods, +.lisp .hljs-keyword, +.tex .hljs-special, +.input_number { + color: #990073; +} + +.builtin, +.constructor, +.hljs-built_in, +.lisp .hljs-title { + color: #0086b3; +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + background: #fdd; +} + +.hljs-addition { + background: #dfd; +} + +.diff .hljs-change { + background: #0086b3; +} + +.hljs-chunk { + color: #aaa; +} + +.tex .hljs-formula { + opacity: 0.5; +} diff --git a/framework/css/highlightjs/foundation.css b/framework/css/highlightjs/foundation.css new file mode 100755 index 0000000..5407dc2 --- /dev/null +++ b/framework/css/highlightjs/foundation.css @@ -0,0 +1,136 @@ +/* +Description: Foundation 4 docs style for highlight.js +Author: Dan Allen +Website: http://foundation.zurb.com/docs/ +Version: 1.0 +Date: 2013-04-02 +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #eee; + -webkit-text-size-adjust: none; +} + +.hljs-header, +.hljs-decorator, +.hljs-annotation { + color: #000077; +} + +.hljs-horizontal_rule, +.hljs-link_url, +.hljs-emphasis, +.hljs-attribute { + color: #070; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-link_label, +.hljs-strong, +.hljs-value, +.hljs-string, +.scss .hljs-value .hljs-string { + color: #d14; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-blockquote, +.hljs-comment { + color: #998; + font-style: italic; +} + +.asciidoc .hljs-title, +.hljs-function .hljs-title { + color: #900; +} + +.hljs-class { + color: #458; +} + +.hljs-id, +.hljs-pseudo, +.hljs-constant, +.hljs-hexcolor { + color: teal; +} + +.hljs-variable { + color: #336699; +} + +.hljs-bullet, +.hljs-javadoc { + color: #997700; +} + +.hljs-pi, +.hljs-doctype { + color: #3344bb; +} + +.hljs-code, +.hljs-number { + color: #099; +} + +.hljs-important { + color: #f00; +} + +.smartquote, +.hljs-label { + color: #970; +} + +.hljs-preprocessor, +.hljs-pragma { + color: #579; +} + +.hljs-reserved, +.hljs-keyword, +.scss .hljs-value { + color: #000; +} + +.hljs-regexp { + background-color: #fff0ff; + color: #880088; +} + +.hljs-symbol { + color: #990073; +} + +.hljs-symbol .hljs-string { + color: #a60; +} + +.hljs-tag { + color: #007700; +} + +.hljs-at_rule, +.hljs-at_rule .hljs-keyword { + color: #088; +} + +.hljs-at_rule .hljs-preprocessor { + color: #808; +} + +.scss .hljs-tag, +.scss .hljs-attribute { + color: #339; +} diff --git a/framework/css/highlightjs/github.css b/framework/css/highlightjs/github.css new file mode 100755 index 0000000..9b4f3aa --- /dev/null +++ b/framework/css/highlightjs/github.css @@ -0,0 +1,124 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.diff .hljs-header, +.hljs-javadoc { + color: #998; + font-style: italic; +} + +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.nginx .hljs-title, +.hljs-subst, +.hljs-request, +.hljs-status { + color: #333; + font-weight: bold; +} + +.hljs-number, +.hljs-hexcolor, +.ruby .hljs-constant { + color: #008080; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.hljs-dartdoc, +.tex .hljs-formula { + color: #d14; +} + +.hljs-title, +.hljs-id, +.scss .hljs-preprocessor { + color: #900; + font-weight: bold; +} + +.hljs-list .hljs-keyword, +.hljs-subst { + font-weight: normal; +} + +.hljs-class .hljs-title, +.hljs-type, +.vhdl .hljs-literal, +.tex .hljs-command { + color: #458; + font-weight: bold; +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal; +} + +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body { + color: #008080; +} + +.hljs-regexp { + color: #009926; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.lisp .hljs-keyword, +.clojure .hljs-keyword, +.scheme .hljs-keyword, +.tex .hljs-special, +.hljs-prompt { + color: #990073; +} + +.hljs-built_in { + color: #0086b3; +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + background: #fdd; +} + +.hljs-addition { + background: #dfd; +} + +.diff .hljs-change { + background: #0086b3; +} + +.hljs-chunk { + color: #aaa; +} diff --git a/framework/css/highlightjs/googlecode.css b/framework/css/highlightjs/googlecode.css new file mode 100755 index 0000000..84be5f2 --- /dev/null +++ b/framework/css/highlightjs/googlecode.css @@ -0,0 +1,147 @@ +/* + +Google Code style (c) Aahan Krish + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: white; + color: black; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.hljs-javadoc { + color: #800; +} + +.hljs-keyword, +.method, +.hljs-list .hljs-keyword, +.nginx .hljs-title, +.hljs-tag .hljs-title, +.setting .hljs-value, +.hljs-winutils, +.tex .hljs-command, +.http .hljs-title, +.hljs-request, +.hljs-status { + color: #008; +} + +.hljs-envvar, +.tex .hljs-special { + color: #660; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.hljs-regexp, +.coffeescript .hljs-attribute { + color: #080; +} + +.hljs-sub .hljs-identifier, +.hljs-pi, +.hljs-tag, +.hljs-tag .hljs-keyword, +.hljs-decorator, +.ini .hljs-title, +.hljs-shebang, +.hljs-prompt, +.hljs-hexcolor, +.hljs-rules .hljs-value, +.hljs-literal, +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-number, +.css .hljs-function, +.clojure .hljs-attribute { + color: #066; +} + +.hljs-class .hljs-title, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc, +.hljs-dartdoc, +.hljs-type, +.hljs-typename, +.hljs-tag .hljs-attribute, +.hljs-doctype, +.hljs-class .hljs-id, +.hljs-built_in, +.setting, +.hljs-params, +.hljs-variable { + color: #606; +} + +.css .hljs-tag, +.hljs-rules .hljs-property, +.hljs-pseudo, +.hljs-subst { + color: #000; +} + +.css .hljs-class, +.css .hljs-id { + color: #9b703f; +} + +.hljs-value .hljs-important { + color: #ff7700; + font-weight: bold; +} + +.hljs-rules .hljs-keyword { + color: #c5af75; +} + +.hljs-annotation, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #9b859d; +} + +.hljs-preprocessor, +.hljs-preprocessor *, +.hljs-pragma { + color: #444; +} + +.tex .hljs-formula { + background-color: #eee; + font-style: italic; +} + +.diff .hljs-header, +.hljs-chunk { + color: #808080; + font-weight: bold; +} + +.diff .hljs-change { + background-color: #bccff9; +} + +.hljs-addition { + background-color: #baeeba; +} + +.hljs-deletion { + background-color: #ffc8bd; +} + +.hljs-comment .hljs-yardoctag { + font-weight: bold; +} diff --git a/framework/css/highlightjs/monokai.css b/framework/css/highlightjs/monokai.css new file mode 100644 index 0000000..f4f3b24 --- /dev/null +++ b/framework/css/highlightjs/monokai.css @@ -0,0 +1,66 @@ +/* + +Zenburn style from voldmar.ru (c) Vladimir Epifanov +based on dark.css by Ivan Sagalaev + +*/ + +pre code { + display: block; + padding: 0.5em; + background: #272822; + color: white; +} + +.tag:nth-child(2) { + color: #fff; +} + +/* pink */ +.tag .title, +.css .tag { + color: #F92772; +} + +/* green */ +.tag .attribute, +.css .class, +.css .id, +.css .pseudo, +.function .title { + color: #A6E22D; +} + +/* yellow */ +.tag .value, +.string { + color: #E6DB74; +} + +/* blue */ +.rule .attribute, +.tag .value, +.rule .value, +.keyword { + color: #66D9EF; +} + +/* purple */ +.number, +.literal, +.rule .value .hexcolor { + color: #AE81FF; +} + +/* orange */ +.value .function, +.important, +.function .params { + color: #FD9720; +} + +/* grey */ + +.comment { + color: #75715E; +} \ No newline at end of file diff --git a/framework/css/highlightjs/vs.css b/framework/css/highlightjs/vs.css new file mode 100755 index 0000000..4b5a106 --- /dev/null +++ b/framework/css/highlightjs/vs.css @@ -0,0 +1,93 @@ +/* + +Visual Studio-like style based on original C# coloring by Jason Diamond + +*/ +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: white; + color: black; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.hljs-annotation, +.diff .hljs-header, +.hljs-chunk, +.apache .hljs-cbracket { + color: #008000; +} + +.hljs-keyword, +.hljs-id, +.hljs-built_in,.css +.smalltalk .hljs-class, +.hljs-winutils, +.bash .hljs-variable, +.tex .hljs-command, +.hljs-request, +.hljs-status, +.nginx .hljs-title, +.xml .hljs-tag, +.xml .hljs-tag .hljs-value { + color: #00f; +} + +.hljs-string, +.hljs-title, +.hljs-parent, +.hljs-tag .hljs-value, +.hljs-rules .hljs-value, +.ruby .hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.hljs-template_tag, +.django .hljs-variable, +.hljs-addition, +.hljs-flow, +.hljs-stream, +.apache .hljs-tag, +.hljs-date, +.tex .hljs-formula, +.coffeescript .hljs-attribute { + color: #a31515; +} + +.ruby .hljs-string, +.hljs-decorator, +.hljs-filter .hljs-argument, +.hljs-localvars, +.hljs-array, +.hljs-attr_selector, +.hljs-pseudo, +.hljs-pi, +.hljs-doctype, +.hljs-deletion, +.hljs-envvar, +.hljs-shebang, +.hljs-preprocessor, +.hljs-pragma, +.userType, +.apache .hljs-sqbracket, +.nginx .hljs-built_in, +.tex .hljs-special, +.hljs-prompt { + color: #2b91af; +} + +.hljs-phpdoc, +.hljs-dartdoc, +.hljs-javadoc, +.hljs-xmlDocTag { + color: #808080; +} + +.hljs-type, +.hljs-typename { font-weight: bold; } + +.vhdl .hljs-string { color: #666666; } +.vhdl .hljs-literal { color: #a31515; } +.vhdl .hljs-attribute { color: #00b0e8; } + +.xml .hljs-attribute { color: #f00; } diff --git a/framework/css/highlightjs/xcode.css b/framework/css/highlightjs/xcode.css new file mode 100755 index 0000000..0b0f8eb --- /dev/null +++ b/framework/css/highlightjs/xcode.css @@ -0,0 +1,158 @@ +/* + +XCode style (c) Angel Garcia + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #fff; + color: black; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.hljs-javadoc { + color: #006a00; +} + +.hljs-keyword, +.hljs-literal, +.nginx .hljs-title { + color: #aa0d91; +} +.method, +.hljs-list .hljs-title, +.hljs-tag .hljs-title, +.setting .hljs-value, +.hljs-winutils, +.tex .hljs-command, +.http .hljs-title, +.hljs-request, +.hljs-status { + color: #008; +} + +.hljs-envvar, +.tex .hljs-special { + color: #660; +} + +.hljs-string { + color: #c41a16; +} +.hljs-tag .hljs-value, +.hljs-cdata, +.hljs-filter .hljs-argument, +.hljs-attr_selector, +.apache .hljs-cbracket, +.hljs-date, +.hljs-regexp { + color: #080; +} + +.hljs-sub .hljs-identifier, +.hljs-pi, +.hljs-tag, +.hljs-tag .hljs-keyword, +.hljs-decorator, +.ini .hljs-title, +.hljs-shebang, +.hljs-prompt, +.hljs-hexcolor, +.hljs-rules .hljs-value, +.hljs-symbol, +.hljs-symbol .hljs-string, +.hljs-number, +.css .hljs-function, +.hljs-function .hljs-title, +.coffeescript .hljs-attribute { + color: #1c00cf; +} + +.hljs-class .hljs-title, +.smalltalk .hljs-class, +.hljs-javadoctag, +.hljs-yardoctag, +.hljs-phpdoc, +.hljs-dartdoc, +.hljs-type, +.hljs-typename, +.hljs-tag .hljs-attribute, +.hljs-doctype, +.hljs-class .hljs-id, +.hljs-built_in, +.setting, +.hljs-params, +.clojure .hljs-attribute { + color: #5c2699; +} + +.hljs-variable { + color: #3f6e74; +} +.css .hljs-tag, +.hljs-rules .hljs-property, +.hljs-pseudo, +.hljs-subst { + color: #000; +} + +.css .hljs-class, +.css .hljs-id { + color: #9b703f; +} + +.hljs-value .hljs-important { + color: #ff7700; + font-weight: bold; +} + +.hljs-rules .hljs-keyword { + color: #c5af75; +} + +.hljs-annotation, +.apache .hljs-sqbracket, +.nginx .hljs-built_in { + color: #9b859d; +} + +.hljs-preprocessor, +.hljs-preprocessor *, +.hljs-pragma { + color: #643820; +} + +.tex .hljs-formula { + background-color: #eee; + font-style: italic; +} + +.diff .hljs-header, +.hljs-chunk { + color: #808080; + font-weight: bold; +} + +.diff .hljs-change { + background-color: #bccff9; +} + +.hljs-addition { + background-color: #baeeba; +} + +.hljs-deletion { + background-color: #ffc8bd; +} + +.hljs-comment .hljs-yardoctag { + font-weight: bold; +} + +.method .hljs-id { + color: #000; +} diff --git a/framework/css/slideshow.css b/framework/css/slideshow.css new file mode 100755 index 0000000..a620989 --- /dev/null +++ b/framework/css/slideshow.css @@ -0,0 +1,391 @@ +/** + Basic CSS so that the slideshow script functions as a slideshow + @author Lea Verou + @version 1.0 + + Don't alter - CSS slide deck needs it to work + https://github.com/LeaVerou/csss + */ + +/** + * "Variables" + */ +.slide, +.delayed, +.delayed-children > * { + transition:.5s; + transition-property: transform, opacity, left, top, right, bottom, background; +} + +/** + * Styles + */ + + html, body { + height: 100%; + } + + body { + margin: 0; + } + +.slide { + display: none; + position:absolute; + top:0; + right:0; + bottom:0; + left:0; + z-index:1; + + /*font-size:250%; + line-height:1.6;*/ +} + + .slide.previous, + .slide:target, + .slide.next { + display: block; + visibility: hidden; + overflow:hidden; + } + + .slide:target { + z-index:100; + opacity:1; + visibility: visible; + overflow: visible; +} + +/** + Slide numbers + */ +#indicator { + position: absolute; + top: .05in; + right: .5em; + z-index: 1010; + + font-size: .15in; + color: white; + background: rgba(0,0,0,.25); + font-weight: 900; + text-shadow: .05em .05em .1em black; + text-align: center; + padding: .1em .3em 0; + min-width: 1.6em; + box-sizing: border-box; + border-radius: 999px; +} + +/** + On-screen navigation + */ +#onscreen-nav { + z-index: 1010; + position: absolute; + bottom: 0; + left: 0; + right: 0; + padding: 0 1em 1em; + font-size: 150%; + opacity: 0; + transition: 1s opacity; +} + +@media (-webkit-min-device-pixel-ratio: 2) { + #onscreen-nav { + opacity: 1; + } +} + +#onscreen-nav:hover { + opacity: 1; +} + + #onscreen-nav:not(:hover) button { + margin-top: -1.5em; + pointer-events: none; + } + + button.onscreen-nav { + float: right; + padding: .2em .5em; + border: 0; + border-radius: .3em; + background: rgba(0,0,0,.5); + color: white; + text-shadow: 0 -.05em .05em black; + text-transform: uppercase; + cursor: pointer; + } + + button.onscreen-nav:hover { + background: black; + } + + button.onscreen-nav.prev { + float: left; + } + +/* If there's nothing selected, show the first */ +.slide:first-child { + z-index:2; +} + +/* Delayed items that are shown incrementally after the slide is */ +.delayed, +.delayed-children > * { + opacity: 0; +} + +.delayed.displayed, +.delayed-children > .displayed { + opacity: .3; +} + +.delayed.current, +.delayed-children > .current, +.delayed.displayed.non-dismissable, +.delayed-children > .displayed.non-dismissable, /* non-dismissable name is deprecated */ +.delayed.displayed.persistent, +.delayed-children > .displayed.persistent, +.delayed-children.persistent > .displayed { + opacity: 1; +} + +/** + iframe slides + */ +.iframe.slide { + padding: 0 !important; + background: white; + text-align: center; +} + + .iframe.slide > h1 { + position: absolute; + bottom: 0; right: 0; left: 0; + background: rgba(0,0,0,.5); + font-size: 100%; + } + + .iframe.slide > h1 > a { + display: inline-block; + padding: .2em .5em; + + color: white; + text-align: center; + text-decoration: none; + text-shadow: 0 -.05em .05em black; + } + + /* .slide > iframe:only-of-type, */ + iframe.csss-import { + position: absolute; + top: 0; + left: 0; + border: 0; + width: 100%; + height: 100%; + margin: 0; + } + +iframe.csss-import { + +} + +iframe.csss-import:not(.show) { + z-index: -1; + visibility: hidden; +} + +iframe.csss-import.show { + visibility: visible; + z-index: 101; +} + +/** + Show thumbnails + */ + +.show-thumbnails { + overflow-x: hidden; +} + +.show-thumbnails .slide, +.presenter .slide.next { + width: 1024px; + height: 768px; + box-sizing: border-box; + + float: left; + overflow: hidden; + position: static; + opacity: 1; + margin:-292px -395px; + cursor: pointer; + + transform: scale(.2, .2); + transition:1s transform; +} + +.show-thumbnails.headers-only .slide { + display: none; +} + +.show-thumbnails.headers-only header.slide { + display: block; +} + +.show-thumbnails .slide .delayed, +.presenter .slide:target + .slide .delayed { + opacity: 1; +} + +.show-thumbnails .slide:hover, +.show-thumbnails .slide:target, +.presenter .slide:target + .slide { + outline: 20px solid rgba(255, 255, 255, .6); + outline-radius:5px; + + box-shadow: 5px 5px 10px black; +} + +.show-thumbnails .slide:target { + outline-color: rgba(255, 255, 255, .3); +} + +.show-thumbnails .slide:target:hover { + outline-color: rgba(255, 255, 255, .9); +} + +/* Display titles */ +.show-thumbnails .slide[data-title]:after { + content: attr(data-title); + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: .1em 0; + background: rgba(0,0,0,.5); + color: white; + font-size: 250%; + text-align: center; + text-shadow: .05em .05em .1em black; + transform: none; +} + +/* Hide all elements in slide by hitting Ctrl + J or Shift + J */ +.hide-elements .slide:target > * { + opacity: 0; + transition:.5s; +} + +/* Timer */ + +#timer { + position:absolute; + top:0; + left:0; + z-index:101; + width:0%; + height:16px; + line-height: 16px; + padding: 0 5px; + background:rgba(0,0,0,.5); + overflow: hidden; + text-align: right; + box-sizing: border-box; + transition: linear; +} + + #timer:before { + content: 'Progress '; + text-transform: uppercase; + color: white; + font-size: 9px; + } + +#timer.end { + width: 100%; +} + +#timer.end.overtime { + width: 0%; + left: auto; + right: 0; +} + +/* Presenter & projector views */ + +.projector #timer { + display: none; +} + +.presenter-notes { + display: none; + position: fixed; + right: 230px; + bottom: 0; + left: 0; + max-height: 6em; + overflow: auto; + padding: .6em 1em; + font-size: 60%; + line-height: 1.3; + font-weight: normal; + resize:vertical; + background: rgba(255, 255, 255, .5); + color: black; + text-shadow: 0 1px white; + box-shadow: .1em .1em .3em rgba(0,0,0,.5) inset; +} + +.presenter .slide.next { + position: fixed; + top: auto; + right: 0; + bottom: 0; + left: auto; + z-index: 100; +} + +.presenter .slide:target > .presenter-notes { + display: block; +} + + +/** + Responsive improvements for Instructor Notes + @author Stacie DaPonte + @version 1.0 + + stacie.daponte@canadalearningcode.ca + Twitter: @staciedev + */ + + .slide{ + word-wrap: break-word; + } + +@media screen and (max-width: 376px){ + body .slide { + padding: 45px 5%; + } + body * { + font-size: 85%; + } + body h1{ + font-size: 2.6rem; + } + body h2{ + font-size: 2.4rem; + } + body table h2{ + font-size: 1.5rem; + } + body code{ + font-size: 126%; + } +} diff --git a/framework/css/styles.css b/framework/css/styles.css new file mode 100644 index 0000000..8ec7042 --- /dev/null +++ b/framework/css/styles.css @@ -0,0 +1,2 @@ +*,*:before,*:after{box-sizing:border-box}html{font-size:62.5%}@media (min-width: 1401px){html{font-size:70%}}body{padding:0;margin:0;font-size:3.2rem;line-height:1.4;font-family:"Montserrat",sans-serif;color:#444;border-top:4px solid #b109aa;-webkit-font-smoothing:antialiased;background:#ecf0f1}strong{font-weight:700;color:black}h1{font-family:"Quicksand",sans-serif;letter-spacing:-0.05em;text-transform:uppercase;margin:0 0 25px;color:#b109aa;font-size:4rem}.title h1{font-size:7.5rem;font-weight:400}h1 code{font-size:inherit;color:inherit;font-family:inherit;background:transparent}h2,h3{margin:0}h2+p,h2+ul,h2+ol,h3+p,h3+ul,h3+ol{margin-top:6px}h2{font-size:3.2rem}h3{font-size:2.88rem}a{outline:none;color:inherit}a:hover{color:#b109aa;text-decoration:none}hr{border:none;border-top:1px solid #bdc3c7;clear:both;margin:30px 0 0;display:inline-block;width:100%}hr+p{margin-top:16px}p{margin-bottom:0}p+h2{margin-top:30px}iframe{margin-top:15px}ol>li,ul>li{margin-bottom:6px}ol ol,ol ul,ul ol,ul ul{margin-top:6px;font-size:2.88rem}ul{padding:0}ul>li{margin-left:24px;list-style-type:none}ul>li:before{content:"\203A";font-family:"Quicksand",sans-serif;font-weight:bold;margin-left:-19px;padding-right:10px}p+ul,p+ol{margin-top:20px}.nested-list>ul{margin-left:-24px}.nested-list>ul>li:before{content:"";margin-left:-10px}.nested-list>ul ol,.nested-list>ul ul{width:90%;margin-bottom:25px}.nested-list .resources+ul>li{margin-left:35px}.nested-list .resources+ul>li:before{content:"\203A"}.two-col-list>ul,.two-col-list>ol{overflow:hidden}.two-col-list>ul>li,.two-col-list>ol>li{width:45%;float:left;margin-left:4px}.two-col-list>ul>li:first-child,.two-col-list>ol>li:first-child{margin-right:5%}.two-col-list>ul>li:before,.two-col-list>ol>li:before{content:"";margin-left:-12px}.two-col-list>.resources+ul>li{width:100%;margin-left:12px}.two-col-list>.resources+ul>li:before{content:"\203A"}table{border-spacing:0;border-collapse:collapse}table pre{margin:0}table code{background:transparent}table .hljs{border:none;background:transparent}table img{width:100%}th,td{border:1px solid #bdc3c7;padding:10px}th{text-align:left;font-weight:normal}.two-col-table td{width:50%}.note,.small-type .note,.resources,.resources+*{line-height:1.3;font-size:2.4rem !important}.note code,.small-type .note code,.resources code,.resources+* code{font-size:inherit}.resources,.resources+*{margin-top:2px}.resources{margin-bottom:5px}.resources+ul li{margin-bottom:0}.left{float:left}.left+ul{padding-left:10px}img.left,iframe.left{margin-right:30px}img.right,iframe.right{margin-left:30px}.right{float:right}.centered{text-align:center}.centered-media img,.centered-media iframe{margin:0 auto;display:block}.cursive{font-family:"Pacifico",cursive;color:#b109aa}.highlight em,a.highlight{color:#b109aa;font-size:106%;padding-right:2px}.small-type p,.small-type ul,.small-type ol{font-size:2.88rem;line-height:1.3}[class^="col-"],[class*="col-"]{float:left;margin-right:2%}[class^="col-"]:last-child,[class*="col-"]:last-child{margin-right:0}.col-2{width:48%}.col-3{width:32%}.col-narrow{width:38%}.col-wide{width:60%}.slide{padding:45px 64px;background-size:cover;height:100%;width:100%;max-width:1600px;margin:0 auto}.slide:after{content:" ";display:block;height:200px}.slide img{max-width:100%}.slide.centered{text-align:center}.slide.centered img{width:60%}.slide .logo{width:350px}.slide .logo-stacked{width:150px}#indicator{top:15px;right:20px;font-size:20px;text-shadow:none;color:#b109aa;background:white;padding:2px 8px}.side-by-side img{width:49%;display:inline-block;vertical-align:top}.slide.title{transform-style:preserve-3d;padding-left:8%;padding-right:8%;background:#222}.slide.title h1,.slide.title h2{position:relative;text-align:center;top:40%;transform:translateY(-40%)}.slide.title h1{margin-bottom:0px;line-height:1.1}.slide.title h2{color:#fff;letter-spacing:0.05rem;font-size:4rem;font-family:"Quicksand",sans-serif;text-transform:uppercase}#timer{height:4px;line-height:4px;background:#000}#timer:before{content:""}.edit{float:left;background:#FFEFD5;border-right:1px solid #ffc86f;border-bottom:1px solid #ffc86f;font-size:11px;padding:6px 14px;position:relative;bottom:-20px;left:1px;margin-bottom:-25px;text-transform:uppercase;font-weight:bold}p textarea.snippet{margin-top:-15px;margin-bottom:-10px}p .edit{margin-top:-34px}textarea.snippet{width:100%;border:1px solid #222;padding:35px 12px 12px;margin:15px 0;font-size:20px !important;font-family:Andale Mono, Monaco, monospace;line-height:1.4}textarea.snippet+.example{margin-top:0}.example,blockquote{font-size:2.88rem;margin:15px 0}.example p,blockquote p{margin:10px}.example{border:1px solid #bdc3c7;padding:5px 10px}blockquote{background:#fff;border:3px solid rgba(177,9,170,0.2)}.delayed.displayed,.delayed-children>.displayed{opacity:1}.heading-bg span{background:rgba(177,9,170,0.8);border-radius:5px;padding:0 10px 0 6px;box-decoration-break:clone}.heading-bg span.light{background:rgba(255,255,255,0.6)}.heading-bg span.dark,.heading-bg span.light{color:#222}.welcome.slide{padding:0}.welcome .logo-stacked{margin-right:50px}.welcome h1,.welcome .instructions{padding:30px 64px}.welcome .instructions p{margin:0;line-height:1.32}.welcome h1{background:#111;line-height:1;margin:0;font-size:55px}.welcome h2{float:left;color:black;width:21%;font-family:"Quicksand",sans-serif;color:#b109aa;text-transform:uppercase;font-size:30px}.welcome ol,.welcome ul{float:left;width:79%;margin:0}.welcome ol ul,.welcome ol ol,.welcome ul ul,.welcome ul ol{float:none;width:100%}.welcome ol.connected li:before,.welcome ul.connected li:before{content:""}.welcome ol.downloads>li,.welcome ul.downloads>li{margin-bottom:15px}.slide.intro h1,.slide.intro h2,.slide.last h1,.slide.last h2{font-weight:400}.slide.intro h1,.slide.last h1{font-size:7.5rem}.slide.intro h2,.slide.last h2{font-size:4rem}.slide.intro .instructor,.slide.last .instructor{border-radius:50%;max-width:225px;float:left;margin-right:30px}.slide.intro .cursive,.slide.last .cursive{margin-left:-5px}.slide.intro ul li,.slide.last ul li{margin:0}.slide.intro ul li:before,.slide.last ul li:before{content:""}.slide.intro:after{height:0px}.slide.intro h1,.slide.intro h2{color:#fff}.slide.intro h1{margin-bottom:10px}.slide.intro a{color:white}.slide.intro footer a{color:#b109aa}.slide.last .heading-bg{font-family:"Quicksand",sans-serif;text-transform:uppercase;color:white;margin-bottom:20px}.slide.last .attribution{position:absolute;bottom:15px;font-size:1.6rem}.sponsor{position:absolute;bottom:45px;right:40px;text-align:right;font-size:20px;color:white}.sponsor img{width:300px;margin-right:-9px}footer{position:fixed;bottom:0;width:100%;background:white;font-size:1.6rem}footer p{margin:6px 10px 0 8px}footer .arrow{color:#b109aa}footer img{margin-bottom:-5px}.slide.intro footer{margin:0 -64px}.table-of-contents{font-size:2.88rem}.table-of-contents li{margin-bottom:2px}.table-of-contents a{color:#222}.table-of-contents a:hover{color:#b109aa}pre{margin:18px 0 12px;white-space:pre-wrap}pre code{overflow-y:auto;font-size:2.4rem}pre+pre{margin-top:15px}pre+h2{margin-top:25px}pre+hr{margin-top:35px}code{color:#555;padding:0 8px;display:inline-block;background:white;font-size:3.52rem;border-radius:4px;position:relative;top:-2px}@-moz-document url-prefix(){code{font-size:3rem}}.highlighted-tags strong{background:#ddd;padding:5px;color:black;display:inline-block;font-weight:bold}.highlighted-tags strong [class^="hljs-"]{color:black;font-weight:bold}.hljs{padding:12px;border-radius:2px;border:1px solid #bdc3c7;word-wrap:break-word}.hljs-doctype,.hljs-comment{color:#990}.php .hljs-preprocessor{color:green}.presenter-notes{bottom:0;width:100%;background:rgba(255,255,255,0.9);font-size:18px;margin:0;max-height:inherit}.presenter-notes p{margin-top:0}.slide.intro{background:linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),url(../img/banner-home1.jpg) no-repeat;background-size:cover}.steps img{vertical-align:top;margin:0 20px 40px 10px;width:275px}.triad img{float:left;margin-right:20px;width:40%}.llc-loves button{font-size:18px;padding:10px;cursor:pointer}.llc-loves img{vertical-align:middle}.llc-loves #update{margin-left:5px}.exercise .quantities{background:white;width:200px;text-align:center;border:2px solid #ccc;padding:20px 5px;margin-right:40px;font-size:20px;float:left}.exercise .quantities button{margin:5px 2px;font-size:16px}.exercise .quantities input{width:40px;margin:10px 0 0 5px;font-size:14px}.comparison-table{border:none;background-color:#2b303b;color:#dfe1e8;padding:10px;font-size:2.4rem;float:left;margin-bottom:20px}.comparison-table th,.comparison-table td{border:none}.comparison-table td{padding:6px 10px}.comparison-table tr:nth-child(2n){background-color:#343d46}.btn-image{background-color:transparent;border:0;cursor:pointer} +/*# sourceMappingURL=styles.css.map */ diff --git a/framework/css/styles.css.map b/framework/css/styles.css.map new file mode 100644 index 0000000..b8530a3 --- /dev/null +++ b/framework/css/styles.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": "AASA,kBAAqB,CACnB,UAAU,CAAE,UAAU,CAExB,IAAK,CACH,SAAS,CAAE,KAAK,CAEhB,0BAA2B,CAH7B,IAAK,CAID,SAAS,CAAE,GAAG,EAGlB,IAAK,CACH,OAAO,CAAE,CAAC,CACV,MAAM,CAAE,CAAC,CACT,SAAS,CCGa,MAAM,CDF5B,WAAW,CCSW,GAAG,CDRzB,WAAW,CCFW,uBAAU,CDGhC,KAAK,CChBiB,IAAI,CDiB1B,UAAU,CAAE,iBAAmB,CAC/B,sBAAsB,CAAE,WAAW,CACnC,UAAU,CAAE,OAAO,CAGrB,MAAO,CACL,WAAW,CAAE,GAAG,CAChB,KAAK,CAAE,KAAK,CAGd,EAAG,CACD,WAAW,CChBW,sBAAU,CDiBhC,cAAc,CAAE,OAAO,CACvB,cAAc,CAAE,SAAS,CACzB,MAAM,CAAE,QAAQ,CAChB,KAAK,CCnCiB,OAAO,CDoC7B,SAAS,CCba,IAAM,CDe5B,SAAS,CACP,SAAS,CCfW,MAAM,CDgB1B,WAAW,CAAE,GAAG,CAElB,OAAK,CACH,SAAS,CAAE,OAAO,CAClB,KAAK,CAAE,OAAO,CACd,WAAW,CAAE,OAAO,CACpB,UAAU,CAAE,WAAW,CAG3B,KAAO,CACL,MAAM,CAAE,CAAC,CAET,iCAEK,CACH,UAAU,CAAE,GAAG,CAGnB,EAAG,CACD,SAAS,CClCa,MAAe,CDoCvC,EAAG,CACD,SAAS,CAAE,OAA0B,CAGvC,CAAE,CACA,OAAO,CAAE,IAAI,CACb,KAAK,CAAE,OAAO,CAEd,OAAQ,CACN,KAAK,CCtEe,OAAO,CDuE3B,eAAe,CAAE,IAAI,CAIzB,EAAG,CACD,MAAM,CAAE,IAAI,CACZ,UAAU,CAAE,iBAAqB,CACjC,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,QAAQ,CAChB,OAAO,CAAE,YAAY,CACrB,KAAK,CAAE,IAAI,CAEX,IAAI,CACF,UAAU,CAAE,IAAI,CAIpB,CAAE,CACA,aAAa,CAAE,CAAC,CAEhB,IAAK,CACH,UAAU,CAAE,IAAI,CAIpB,MAAO,CACL,UAAU,CAAE,IAAI,CAOhB,WAAK,CACH,aAAa,CAAE,GAAG,CAEpB,uBAAO,CACL,UAAU,CAAE,GAAG,CACf,SAAS,CCzFW,OAAqB,CD4F7C,EAAG,CACD,OAAO,CAAE,CAAC,CAEV,KAAK,CACH,WAAW,CAAE,IAAI,CACjB,eAAe,CAAE,IAAI,CAErB,YAAS,CACP,OAAO,CAAE,OAAO,CAChB,WAAW,CC1GO,sBAAU,CD2G5B,WAAW,CAAE,IAAI,CACjB,WAAW,CAAE,KAAK,CAClB,aAAa,CAAE,IAAI,CAIzB,SACO,CACL,UAAU,CAAE,IAAI,CAIhB,eAAK,CACH,WAAW,CAAE,KAAK,CAElB,yBAAY,CACV,OAAO,CAAE,EAAE,CACX,WAAW,CAAE,KAAK,CAEpB,qCAAO,CACL,KAAK,CAAE,GAAG,CACV,aAAa,CAAE,IAAI,CAIrB,6BAAK,CACH,WAAW,CAAE,IAAI,CAEjB,oCAAS,CACP,OAAO,CAAE,OAAO,CAOtB,iCAAO,CACL,QAAQ,CAAE,MAAM,CAEhB,uCAAK,CACH,KAAK,CAAE,GAAG,CACV,KAAK,CAAE,IAAI,CACX,WAAW,CAAE,GAAG,CAEhB,+DAAc,CACZ,YAAY,CAAE,EAAE,CAElB,qDAAS,CACP,OAAO,CAAE,EAAE,CACX,WAAW,CAAE,KAAK,CAKtB,8BAAK,CACH,KAAK,CAAE,IAAI,CACX,WAAW,CAAE,IAAI,CAEjB,qCAAS,CACP,OAAO,CAAE,OAAO,CAMxB,KAAM,CACJ,cAAc,CAAE,CAAC,CACjB,eAAe,CAAE,QAAQ,CAEzB,SAAI,CACF,MAAM,CAAE,CAAC,CAEX,UAAK,CACH,UAAU,CAAE,WAAW,CAEzB,WAAM,CACJ,MAAM,CAAE,IAAI,CACZ,UAAU,CAAE,WAAW,CAE1B,SAAI,CACH,KAAK,CAAE,IAAI,CAGb,KAAO,CACL,MAAM,CAAE,iBAAqB,CAC7B,OAAO,CAAE,IAAI,CAEf,EAAG,CACD,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,MAAM,CAGnB,iBAAiB,CACf,KAAK,CAAE,GAAG,CAKd,+CAGe,CACb,WAAW,CAAE,GAAG,CAChB,SAAS,CAAE,iBAAwB,CAEnC,mEAAK,CACH,SAAS,CAAE,OAAO,CAGtB,uBACe,CACb,UAAU,CAAE,GAAG,CAEjB,UAAW,CACT,aAAa,CAAE,GAAG,CAElB,gBAAQ,CACN,aAAa,CAAE,CAAC,CAIpB,KAAM,CACJ,KAAK,CAAE,IAAI,CAEX,QAAK,CACH,YAAY,CAAE,IAAI,CAGtB,oBACY,CACV,YAAY,CAAE,IAAI,CAEpB,sBACa,CACX,WAAW,CAAE,IAAI,CAGnB,MAAO,CACL,KAAK,CAAE,KAAK,CAEd,SAAU,CACR,UAAU,CAAE,MAAM,CAGlB,0CACO,CACL,MAAM,CAAE,MAAM,CACd,OAAO,CAAE,KAAK,CAGlB,QAAS,CACP,WAAW,CChQW,kBAAS,CDiQ/B,KAAK,CClRiB,OAAO,CDoR/B,yBACY,CACV,KAAK,CCtRiB,OAAO,CDuR7B,SAAS,CAAE,IAAI,CACf,aAAa,CAAE,GAAG,CAGlB,2CAAU,CACR,SAAS,CCxQW,OAAqB,CDyQzC,WAAW,CAAE,GAAG,CAIpB,+BACe,CACb,KAAK,CAAE,IAAI,CACX,YAAY,CAAE,EAAE,CAEhB,qDAAa,CACX,YAAY,CAAE,CAAC,CAGnB,MAAO,CACL,KAAK,CAAE,GAAG,CAEZ,MAAO,CACL,KAAK,CAAE,GAAG,CAEZ,WAAY,CACV,KAAK,CAAE,GAAG,CAEZ,SAAU,CACR,KAAK,CAAE,GAAG,CAQZ,MAAO,CACL,OAAO,CAAE,SAAS,CAClB,eAAe,CAAE,KAAK,CACtB,MAAM,CAAE,IAAI,CACZ,KAAK,CAAE,IAAI,CACX,SAAS,CAAE,MAAM,CACjB,MAAM,CAAE,MAAM,CAKd,YAAQ,CACN,OAAO,CAAE,GAAG,CACZ,OAAO,CAAE,KAAK,CACd,MAAM,CAAE,KAAK,CAEf,UAAI,CACF,SAAS,CAAE,IAAI,CAEjB,eAAW,CACT,UAAU,CAAE,MAAM,CAElB,mBAAI,CACF,KAAK,CAAE,GAAG,CAGd,YAAM,CACJ,KAAK,CAAE,KAAK,CAEd,oBAAc,CACZ,KAAK,CAAE,KAAK,CAKhB,UAAW,CACT,GAAG,CAAE,IAAI,CACT,KAAK,CAAE,IAAI,CACX,SAAS,CAAE,IAAI,CACf,WAAW,CAAE,IAAI,CACjB,KAAK,CCpWiB,OAAO,CDqW7B,UAAU,CAAE,KAAK,CACjB,OAAO,CAAE,OAAO,CAKhB,iBAAI,CACF,KAAK,CAAE,GAAG,CACV,OAAO,CAAE,YAAY,CACrB,cAAc,CAAE,GAAG,CAKvB,YAAa,CACX,eAAe,CAAE,WAAW,CAC5B,YAAY,CAAE,EAAE,CAChB,aAAa,CAAE,EAAE,CACjB,UAAU,CCrXY,IAAI,CDuX1B,+BAAO,CACL,QAAQ,CAAE,QAAQ,CAClB,UAAU,CAAE,MAAM,CAClB,GAAG,CAAE,GAAG,CACR,SAAS,CAAE,gBAAgB,CAE7B,eAAG,CACD,aAAa,CAAE,GAAG,CAClB,WAAW,CAAE,GAAG,CAElB,eAAG,CACD,KAAK,CC/Xe,IAAI,CDgYxB,cAAc,CAAE,OAAO,CACvB,SAAS,CC/WW,IAAM,CDgX1B,WAAW,CAAE,sBAAsB,CACnC,cAAc,CAAE,SAAS,CAK7B,MAAO,CACL,MAAM,CAAE,GAAG,CACX,WAAW,CAAE,GAAG,CAChB,UAAU,CC/YY,IAAI,CDiZ1B,aAAS,CACP,OAAO,CAAE,EAAE,CAKf,KAAM,CACJ,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,OAAO,CACnB,YAAY,CAAE,iBAA6B,CAC3C,aAAa,CAAE,iBAA6B,CAC5C,SAAS,CAAE,IAAI,CACf,OAAO,CAAE,QAAQ,CACjB,QAAQ,CAAE,QAAQ,CAClB,MAAM,CAAE,KAAK,CACb,IAAI,CAAE,GAAG,CACT,aAAa,CAAE,KAAK,CACpB,cAAc,CAAE,SAAS,CACzB,WAAW,CAAE,IAAI,CAGjB,kBAAiB,CACf,UAAU,CAAE,KAAK,CACjB,aAAa,CAAE,KAAK,CAEtB,OAAM,CACJ,UAAU,CAAE,KAAK,CAGrB,gBAAiB,CACf,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,cAAc,CACtB,OAAO,CAAE,cAAc,CACvB,MAAM,CAAE,MAAM,CACd,SAAS,CAAE,eAAc,CACzB,WAAW,CAAE,8BAA8B,CAC3C,WAAW,CAAE,GAAG,CAEhB,yBAAW,CACT,UAAU,CAAE,CAAC,CAKjB,mBACW,CACT,SAAS,CC5aa,OAAqB,CD6a3C,MAAM,CAAE,MAAM,CAEd,uBAAE,CACA,MAAM,CAAE,IAAI,CAGhB,QAAS,CACP,MAAM,CAAE,iBAAqB,CAC7B,OAAO,CAAE,QAAQ,CAEnB,UAAW,CACT,UAAU,CAAE,IAAI,CAChB,MAAM,CAAE,6BACV,CAGA,+CAC+B,CAC3B,OAAO,CAAE,CAAC,CAeZ,gBAAK,CACH,UAAU,CAAE,mBAAoB,CAChC,aAAa,CAAE,GAAG,CAClB,OAAO,CAAE,YAAY,CACrB,oBAAoB,CAAE,KAAK,CAE3B,sBAAQ,CACN,UAAU,CAAE,qBAAiB,CAE/B,4CAAgB,CACd,KAAK,CC1ea,IAAI,CDmf1B,cAAQ,CACN,OAAO,CAAE,CAAC,CAEZ,sBAAc,CACZ,YAAY,CAAE,IAAI,CAEpB,kCACc,CACZ,OAAO,CAAE,SAAS,CAEpB,wBAAgB,CACd,MAAM,CAAE,CAAC,CACT,WAAW,CAAE,IAAI,CAEnB,WAAG,CACD,UAAU,CAAE,IAAI,CAChB,WAAW,CAAE,CAAC,CACd,MAAM,CAAE,CAAC,CACT,SAAS,CAAE,IAAI,CAEjB,WAAG,CACD,KAAK,CAAE,IAAI,CACX,KAAK,CAAE,KAAK,CACZ,KAAK,CAAE,GAAG,CACV,WAAW,CC9fS,sBAAU,CD+f9B,KAAK,CC9gBe,OAAO,CD+gB3B,cAAc,CAAE,SAAS,CACzB,SAAS,CAAE,IAAI,CAEjB,uBAAO,CACL,KAAK,CAAE,IAAI,CACX,KAAK,CAAE,GAAG,CACV,MAAM,CAAE,CAAC,CAET,2DAAO,CACL,KAAK,CAAE,IAAI,CACX,KAAK,CAAE,IAAI,CAEb,+DAAsB,CACpB,OAAO,CAAE,EAAE,CAEb,iDAAiB,CACf,aAAa,CAAE,IAAI,CAQvB,6DAAO,CACL,WAAW,CAAE,GAAG,CAElB,8BAAG,CACD,SAAS,CCnhBW,MAAM,CDqhB5B,8BAAG,CACD,SAAS,CCvhBW,IAAM,CDyhB5B,gDAAY,CACV,aAAa,CAAE,GAAG,CAClB,SAAS,CAAE,KAAK,CAChB,KAAK,CAAE,IAAI,CACX,YAAY,CAAE,IAAI,CAEpB,0CAAS,CACP,WAAW,CAAE,IAAI,CAEnB,oCAAM,CACJ,MAAM,CAAE,CAAC,CAET,kDAAS,CAAE,OAAO,CAAE,EAAE,CAIxB,kBAAQ,CACN,MAAM,CAAE,GAAG,CAEb,+BAAO,CACL,KAAK,CC/jBe,IAAI,CDikB1B,eAAG,CACD,aAAa,CAAE,IAAI,CAErB,cAAE,CACA,KAAK,CAAE,KAAK,CAEd,qBAAS,CACP,KAAK,CC7kBe,OAAO,CDilB7B,uBAAY,CACV,WAAW,CCnkBS,sBAAU,CDokB9B,cAAc,CAAE,SAAS,CACzB,KAAK,CAAE,KAAK,CACZ,aAAa,CAAE,IAAI,CAErB,wBAAa,CACX,QAAQ,CAAE,QAAQ,CAClB,MAAM,CAAE,IAAI,CACZ,SAAS,CCpkBW,MAAqB,CDukB7C,QAAS,CACP,QAAQ,CAAE,QAAQ,CAClB,MAAM,CAAE,IAAI,CACZ,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,KAAK,CACjB,SAAS,CAAE,IAAI,CACf,KAAK,CAAE,KAAK,CAEZ,YAAI,CACF,KAAK,CAAE,KAAK,CACZ,YAAY,CAAE,IAAI,CAItB,MAAO,CACL,QAAQ,CAAE,KAAK,CACf,MAAM,CAAE,CAAC,CACT,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,KAAK,CACjB,SAAS,CC1lBa,MAAqB,CD4lB3C,QAAE,CACA,MAAM,CAAE,cAAc,CAExB,aAAO,CACL,KAAK,CCtnBe,OAAO,CDwnB7B,UAAI,CACF,aAAa,CAAE,IAAI,CAIrB,mBAAO,CACL,MAAM,CAAE,OAAO,CAOnB,kBAAmB,CACjB,SAAS,CClnBa,OAAqB,CDonB3C,qBAAG,CACD,aAAa,CAAE,GAAG,CAEpB,oBAAE,CACA,KAAK,CC1oBe,IAAI,CD4oBxB,0BAAQ,CACN,KAAK,CC/oBa,OAAO,CDupB/B,GAAI,CACF,MAAM,CAAE,WAAW,CACnB,WAAW,CAAE,QAAQ,CAErB,QAAK,CACH,UAAU,CAAE,IAAI,CAChB,SAAS,CCxoBW,MAAsB,CD2oB5C,OAAM,CACJ,UAAU,CAAE,IAAI,CAElB,MAAK,CACH,UAAU,CAAE,IAAI,CAElB,MAAK,CACH,UAAU,CAAE,IAAI,CAGpB,IAAK,CACH,KAAK,CAAE,IAAI,CACX,OAAO,CAAE,KAAK,CACd,OAAO,CAAE,YAAY,CACrB,UAAU,CAAE,KAAK,CACjB,SAAS,CAAE,OAAqB,CAChC,aAAa,CAAE,GAAG,CAClB,QAAQ,CAAE,QAAQ,CAClB,GAAG,CAAE,IAAI,CAGX,2BAIC,CAHC,IAAK,CACH,SAAS,CAAE,IAAqB,EAKpC,wBAAyB,CACvB,UAAU,CAAE,IAAI,CAChB,OAAO,CAAE,GAAG,CACZ,KAAK,CAAE,KAAK,CACZ,OAAO,CAAE,YAAY,CACrB,WAAW,CAAE,IAAI,CAEjB,yCAAgB,CACd,KAAK,CAAE,KAAK,CACZ,WAAW,CAAE,IAAI,CAKrB,KAAM,CACJ,OAAO,CAAE,IAAI,CACb,aAAa,CAAE,GAAG,CAClB,MAAM,CAAE,iBAAqB,CAC7B,SAAS,CAAE,UAAU,CAEvB,2BACc,CACZ,KAAK,CAAE,IAAI,CAEb,uBAAwB,CACtB,KAAK,CAAE,KAAK,CAMd,gBAAiB,CACf,MAAM,CAAE,CAAC,CACT,KAAK,CAAE,IAAI,CACX,UAAU,CAAE,qBAAuB,CACnC,SAAS,CAAE,IAAI,CACf,MAAM,CAAE,CAAC,CACT,UAAU,CAAE,OAAO,CAEnB,kBAAE,CACA,UAAU,CAAE,CAAC,CExuBjB,YAAa,CACX,UAAU,CAAE,wFAEsC,CAClD,eAAe,CAAE,KAAK,CAItB,UAAI,CACF,cAAc,CAAE,GAAG,CACnB,MAAM,CAAE,gBAAgB,CACxB,KAAK,CAAE,KAAK,CAId,UAAI,CACF,KAAK,CAAE,IAAI,CACX,YAAY,CAAE,IAAI,CAClB,KAAK,CAAE,GAAG,CAIZ,iBAAO,CACL,SAAS,CAAE,IAAI,CACf,OAAO,CAAE,IAAI,CACb,MAAM,CAAE,OAAO,CAEjB,cAAI,CACF,cAAc,CAAE,MAAM,CAExB,kBAAQ,CACN,WAAW,CAAE,GAAG,CAKlB,qBAAY,CACV,UAAU,CAAE,KAAK,CAClB,KAAK,CAAE,KAAK,CACZ,UAAU,CAAE,MAAM,CAClB,MAAM,CAAE,cAAc,CACtB,OAAO,CAAE,QAAQ,CACjB,YAAY,CAAE,IAAI,CAClB,SAAS,CAAE,IAAI,CACd,KAAK,CAAE,IAAI,CAEb,4BAAmB,CAClB,MAAM,CAAE,OAAO,CACf,SAAS,CAAE,IAAI,CAEhB,2BAAkB,CACjB,KAAK,CAAE,IAAI,CACX,MAAM,CAAE,YAAY,CACpB,SAAS,CAAE,IAAI,CAIlB,iBAAkB,CAChB,MAAM,CAAE,IAAI,CACZ,gBAAgB,CAAE,OAAO,CACzB,KAAK,CAAE,OAAO,CACd,OAAO,CAAE,IAAI,CACb,SAAS,CAAE,MAAM,CACjB,KAAK,CAAE,IAAI,CACX,aAAa,CAAE,IAAI,CAEnB,yCAAO,CACL,MAAM,CAAE,IAAI,CAEd,oBAAG,CACD,OAAO,CAAE,QAAQ,CAEnB,kCAAiB,CACf,gBAAgB,CAAE,OAAO,CAI7B,UAAW,CACT,gBAAgB,CAAE,WAAW,CAC7B,MAAM,CAAE,CAAC,CACT,MAAM,CAAE,OAAO", +"sources": ["../sass/_theme.scss","../sass/_base.scss","../sass/_workshop.scss"], +"names": [], +"file": "styles.css" +} \ No newline at end of file diff --git a/framework/fonts/montserrat-bold.woff2 b/framework/fonts/montserrat-bold.woff2 new file mode 100644 index 0000000..4f41337 Binary files /dev/null and b/framework/fonts/montserrat-bold.woff2 differ diff --git a/framework/fonts/montserrat-regular.woff2 b/framework/fonts/montserrat-regular.woff2 new file mode 100644 index 0000000..48e2381 Binary files /dev/null and b/framework/fonts/montserrat-regular.woff2 differ diff --git a/framework/fonts/opensans-light.woff2 b/framework/fonts/opensans-light.woff2 new file mode 100644 index 0000000..cf3ec55 Binary files /dev/null and b/framework/fonts/opensans-light.woff2 differ diff --git a/framework/fonts/opensans.woff2 b/framework/fonts/opensans.woff2 new file mode 100644 index 0000000..059a48d Binary files /dev/null and b/framework/fonts/opensans.woff2 differ diff --git a/framework/fonts/pacifico.woff2 b/framework/fonts/pacifico.woff2 new file mode 100644 index 0000000..fedac95 Binary files /dev/null and b/framework/fonts/pacifico.woff2 differ diff --git a/framework/fonts/quicksand.woff2 b/framework/fonts/quicksand.woff2 new file mode 100644 index 0000000..85676ed Binary files /dev/null and b/framework/fonts/quicksand.woff2 differ diff --git a/framework/img/banner-home1.jpg b/framework/img/banner-home1.jpg new file mode 100755 index 0000000..a2fd5ab Binary files /dev/null and b/framework/img/banner-home1.jpg differ diff --git a/framework/img/banner-home2.jpg b/framework/img/banner-home2.jpg new file mode 100755 index 0000000..4b6fd7d Binary files /dev/null and b/framework/img/banner-home2.jpg differ diff --git a/framework/img/banner-home3.jpg b/framework/img/banner-home3.jpg new file mode 100755 index 0000000..9163fab Binary files /dev/null and b/framework/img/banner-home3.jpg differ diff --git a/framework/img/banner-home4.jpg b/framework/img/banner-home4.jpg new file mode 100755 index 0000000..7993353 Binary files /dev/null and b/framework/img/banner-home4.jpg differ diff --git a/framework/img/cc-by-nc.png b/framework/img/cc-by-nc.png new file mode 100644 index 0000000..84fe83c Binary files /dev/null and b/framework/img/cc-by-nc.png differ diff --git a/framework/img/cc-by-nc.svg b/framework/img/cc-by-nc.svg new file mode 100644 index 0000000..76b3f87 --- /dev/null +++ b/framework/img/cc-by-nc.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/img/favicon.ico b/framework/img/favicon.ico new file mode 100644 index 0000000..0a64fe2 Binary files /dev/null and b/framework/img/favicon.ico differ diff --git a/framework/img/llc-fullcolour.png b/framework/img/llc-fullcolour.png new file mode 100644 index 0000000..80829dd Binary files /dev/null and b/framework/img/llc-fullcolour.png differ diff --git a/framework/img/llc-logo-stacked-white.png b/framework/img/llc-logo-stacked-white.png new file mode 100644 index 0000000..4aa06fb Binary files /dev/null and b/framework/img/llc-logo-stacked-white.png differ diff --git a/framework/img/llc-logo-white.png b/framework/img/llc-logo-white.png new file mode 100644 index 0000000..ab67b72 Binary files /dev/null and b/framework/img/llc-logo-white.png differ diff --git a/framework/img/llc-wide-fullcolour.png b/framework/img/llc-wide-fullcolour.png new file mode 100644 index 0000000..d75b817 Binary files /dev/null and b/framework/img/llc-wide-fullcolour.png differ diff --git a/framework/img/telus-logo-white.svg b/framework/img/telus-logo-white.svg new file mode 100644 index 0000000..37e1340 --- /dev/null +++ b/framework/img/telus-logo-white.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/AngryBirds.png b/framework/img/workshop/AngryBirds.png similarity index 100% rename from assets/AngryBirds.png rename to framework/img/workshop/AngryBirds.png diff --git a/assets/Chrome-Experiments-Arcade-Fire.gif b/framework/img/workshop/Chrome-Experiments-Arcade-Fire.gif similarity index 100% rename from assets/Chrome-Experiments-Arcade-Fire.gif rename to framework/img/workshop/Chrome-Experiments-Arcade-Fire.gif diff --git a/framework/img/workshop/ChromeConsole.png b/framework/img/workshop/ChromeConsole.png new file mode 100755 index 0000000..bf58229 Binary files /dev/null and b/framework/img/workshop/ChromeConsole.png differ diff --git a/assets/ChromeInspector.gif b/framework/img/workshop/ChromeInspector.gif similarity index 100% rename from assets/ChromeInspector.gif rename to framework/img/workshop/ChromeInspector.gif diff --git a/assets/LLC_sketch.gif b/framework/img/workshop/LLC_sketch.gif similarity index 100% rename from assets/LLC_sketch.gif rename to framework/img/workshop/LLC_sketch.gif diff --git a/framework/img/workshop/atom-core-settings.png b/framework/img/workshop/atom-core-settings.png new file mode 100644 index 0000000..e8277e7 Binary files /dev/null and b/framework/img/workshop/atom-core-settings.png differ diff --git a/framework/img/workshop/atom-editor-settings.png b/framework/img/workshop/atom-editor-settings.png new file mode 100644 index 0000000..06a6ea9 Binary files /dev/null and b/framework/img/workshop/atom-editor-settings.png differ diff --git a/framework/img/workshop/atom-logo.png b/framework/img/workshop/atom-logo.png new file mode 100644 index 0000000..e168a15 Binary files /dev/null and b/framework/img/workshop/atom-logo.png differ diff --git a/framework/img/workshop/atom-preferences.jpg b/framework/img/workshop/atom-preferences.jpg new file mode 100644 index 0000000..fde6fbd Binary files /dev/null and b/framework/img/workshop/atom-preferences.jpg differ diff --git a/framework/img/workshop/atom-soft-wrap.png b/framework/img/workshop/atom-soft-wrap.png new file mode 100644 index 0000000..ceeb22b Binary files /dev/null and b/framework/img/workshop/atom-soft-wrap.png differ diff --git a/framework/img/workshop/backend-front-end-server.gif b/framework/img/workshop/backend-front-end-server.gif new file mode 100755 index 0000000..387e434 Binary files /dev/null and b/framework/img/workshop/backend-front-end-server.gif differ diff --git a/framework/img/workshop/backend-front-end.gif b/framework/img/workshop/backend-front-end.gif new file mode 100755 index 0000000..2e79ff8 Binary files /dev/null and b/framework/img/workshop/backend-front-end.gif differ diff --git a/framework/img/workshop/banner-home.jpg b/framework/img/workshop/banner-home.jpg new file mode 100755 index 0000000..3d95529 Binary files /dev/null and b/framework/img/workshop/banner-home.jpg differ diff --git a/assets/bento_box_real.jpg b/framework/img/workshop/bento_box_real.jpg similarity index 100% rename from assets/bento_box_real.jpg rename to framework/img/workshop/bento_box_real.jpg diff --git a/framework/img/workshop/boxes.jpg b/framework/img/workshop/boxes.jpg new file mode 100755 index 0000000..95f2b2b Binary files /dev/null and b/framework/img/workshop/boxes.jpg differ diff --git a/framework/img/workshop/brackets-logo.png b/framework/img/workshop/brackets-logo.png new file mode 100755 index 0000000..6681372 Binary files /dev/null and b/framework/img/workshop/brackets-logo.png differ diff --git a/assets/browser-blocks.jpg b/framework/img/workshop/browser-blocks.jpg similarity index 100% rename from assets/browser-blocks.jpg rename to framework/img/workshop/browser-blocks.jpg diff --git a/assets/browser-fieldset-div.jpg b/framework/img/workshop/browser-fieldset-div.jpg similarity index 100% rename from assets/browser-fieldset-div.jpg rename to framework/img/workshop/browser-fieldset-div.jpg diff --git a/framework/img/workshop/browser-war-illustration.jpg b/framework/img/workshop/browser-war-illustration.jpg new file mode 100755 index 0000000..6a999ae Binary files /dev/null and b/framework/img/workshop/browser-war-illustration.jpg differ diff --git a/assets/browser-window.jpg b/framework/img/workshop/browser-window.jpg similarity index 100% rename from assets/browser-window.jpg rename to framework/img/workshop/browser-window.jpg diff --git a/framework/img/workshop/cc-by-nc.svg b/framework/img/workshop/cc-by-nc.svg new file mode 100755 index 0000000..76b3f87 --- /dev/null +++ b/framework/img/workshop/cc-by-nc.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/img/workshop/code-function-refactor.gif b/framework/img/workshop/code-function-refactor.gif new file mode 100755 index 0000000..351d06a Binary files /dev/null and b/framework/img/workshop/code-function-refactor.gif differ diff --git a/framework/img/workshop/codeeditorsidebar.png b/framework/img/workshop/codeeditorsidebar.png new file mode 100755 index 0000000..01baa8d Binary files /dev/null and b/framework/img/workshop/codeeditorsidebar.png differ diff --git a/framework/img/workshop/computer-diagram-os-languages.gif b/framework/img/workshop/computer-diagram-os-languages.gif new file mode 100755 index 0000000..5cb7ea5 Binary files /dev/null and b/framework/img/workshop/computer-diagram-os-languages.gif differ diff --git a/framework/img/workshop/computer-diagram-os-languages.png b/framework/img/workshop/computer-diagram-os-languages.png new file mode 100755 index 0000000..ede3869 Binary files /dev/null and b/framework/img/workshop/computer-diagram-os-languages.png differ diff --git a/framework/img/workshop/console-number.gif b/framework/img/workshop/console-number.gif new file mode 100755 index 0000000..ef6c0c3 Binary files /dev/null and b/framework/img/workshop/console-number.gif differ diff --git a/framework/img/workshop/console-string.gif b/framework/img/workshop/console-string.gif new file mode 100755 index 0000000..8d15909 Binary files /dev/null and b/framework/img/workshop/console-string.gif differ diff --git a/assets/Map.png b/framework/img/workshop/directions.png similarity index 100% rename from assets/Map.png rename to framework/img/workshop/directions.png diff --git a/framework/img/workshop/downloadslides.gif b/framework/img/workshop/downloadslides.gif new file mode 100755 index 0000000..f2778ea Binary files /dev/null and b/framework/img/workshop/downloadslides.gif differ diff --git a/framework/img/workshop/editor-add-project-1.jpg b/framework/img/workshop/editor-add-project-1.jpg new file mode 100644 index 0000000..399572e Binary files /dev/null and b/framework/img/workshop/editor-add-project-1.jpg differ diff --git a/assets/egg-carton.jpeg b/framework/img/workshop/egg-carton.jpeg similarity index 100% rename from assets/egg-carton.jpeg rename to framework/img/workshop/egg-carton.jpeg diff --git a/framework/img/workshop/exampleslideshow.png b/framework/img/workshop/exampleslideshow.png new file mode 100755 index 0000000..e910996 Binary files /dev/null and b/framework/img/workshop/exampleslideshow.png differ diff --git a/framework/img/workshop/favicon.ico b/framework/img/workshop/favicon.ico new file mode 100755 index 0000000..0a64fe2 Binary files /dev/null and b/framework/img/workshop/favicon.ico differ diff --git a/framework/img/workshop/florida-elago.jpg b/framework/img/workshop/florida-elago.jpg new file mode 100755 index 0000000..0f04030 Binary files /dev/null and b/framework/img/workshop/florida-elago.jpg differ diff --git a/framework/img/workshop/hi-rawbot.jpg b/framework/img/workshop/hi-rawbot.jpg new file mode 100755 index 0000000..ef940f4 Binary files /dev/null and b/framework/img/workshop/hi-rawbot.jpg differ diff --git a/framework/img/workshop/hi-rawbot.png b/framework/img/workshop/hi-rawbot.png new file mode 100755 index 0000000..f3fc4e7 Binary files /dev/null and b/framework/img/workshop/hi-rawbot.png differ diff --git a/framework/img/workshop/java-javascript-rawbot.png b/framework/img/workshop/java-javascript-rawbot.png new file mode 100755 index 0000000..afd4e8e Binary files /dev/null and b/framework/img/workshop/java-javascript-rawbot.png differ diff --git a/framework/img/workshop/javascript-gears.gif b/framework/img/workshop/javascript-gears.gif new file mode 100755 index 0000000..985e43e Binary files /dev/null and b/framework/img/workshop/javascript-gears.gif differ diff --git a/framework/img/workshop/llc-logo.png b/framework/img/workshop/llc-logo.png new file mode 100755 index 0000000..df0d544 Binary files /dev/null and b/framework/img/workshop/llc-logo.png differ diff --git a/assets/llcodedotcom_viewsource.gif b/framework/img/workshop/llcodedotcom_viewsource.gif similarity index 100% rename from assets/llcodedotcom_viewsource.gif rename to framework/img/workshop/llcodedotcom_viewsource.gif diff --git a/framework/img/workshop/logo-llc-white.png b/framework/img/workshop/logo-llc-white.png new file mode 100755 index 0000000..c2917f5 Binary files /dev/null and b/framework/img/workshop/logo-llc-white.png differ diff --git a/framework/img/workshop/logo-llc.png b/framework/img/workshop/logo-llc.png new file mode 100755 index 0000000..ccbf137 Binary files /dev/null and b/framework/img/workshop/logo-llc.png differ diff --git a/framework/img/workshop/name-text-rawbot.gif b/framework/img/workshop/name-text-rawbot.gif new file mode 100755 index 0000000..4573ec6 Binary files /dev/null and b/framework/img/workshop/name-text-rawbot.gif differ diff --git a/framework/img/workshop/new-chrome-logo.png b/framework/img/workshop/new-chrome-logo.png new file mode 100755 index 0000000..ca2a97b Binary files /dev/null and b/framework/img/workshop/new-chrome-logo.png differ diff --git a/assets/no-while-loop.jpg b/framework/img/workshop/no-while-loop.jpg similarity index 100% rename from assets/no-while-loop.jpg rename to framework/img/workshop/no-while-loop.jpg diff --git a/framework/img/workshop/object-bento-box-2.png b/framework/img/workshop/object-bento-box-2.png new file mode 100755 index 0000000..d200178 Binary files /dev/null and b/framework/img/workshop/object-bento-box-2.png differ diff --git a/framework/img/workshop/object-bento-box.png b/framework/img/workshop/object-bento-box.png new file mode 100755 index 0000000..3e611da Binary files /dev/null and b/framework/img/workshop/object-bento-box.png differ diff --git a/framework/img/workshop/planet-robot-website.png b/framework/img/workshop/planet-robot-website.png new file mode 100755 index 0000000..d703d3c Binary files /dev/null and b/framework/img/workshop/planet-robot-website.png differ diff --git a/framework/img/workshop/profile-generic.jpg b/framework/img/workshop/profile-generic.jpg new file mode 100755 index 0000000..f280cdf Binary files /dev/null and b/framework/img/workshop/profile-generic.jpg differ diff --git a/framework/img/workshop/rawbot-binary.png b/framework/img/workshop/rawbot-binary.png new file mode 100755 index 0000000..ea03bb0 Binary files /dev/null and b/framework/img/workshop/rawbot-binary.png differ diff --git a/framework/img/workshop/rawbot-computers.png b/framework/img/workshop/rawbot-computers.png new file mode 100755 index 0000000..e72544f Binary files /dev/null and b/framework/img/workshop/rawbot-computers.png differ diff --git a/framework/img/workshop/rawbot-directions.png b/framework/img/workshop/rawbot-directions.png new file mode 100755 index 0000000..110bedf Binary files /dev/null and b/framework/img/workshop/rawbot-directions.png differ diff --git a/framework/img/workshop/rawbot-face.png b/framework/img/workshop/rawbot-face.png new file mode 100755 index 0000000..00b2c30 Binary files /dev/null and b/framework/img/workshop/rawbot-face.png differ diff --git a/framework/img/workshop/rawbot-hint.png b/framework/img/workshop/rawbot-hint.png new file mode 100755 index 0000000..0646199 Binary files /dev/null and b/framework/img/workshop/rawbot-hint.png differ diff --git a/framework/img/workshop/rawbot-important.png b/framework/img/workshop/rawbot-important.png new file mode 100755 index 0000000..5c397eb Binary files /dev/null and b/framework/img/workshop/rawbot-important.png differ diff --git a/framework/img/workshop/rawbot-losing-memory.png b/framework/img/workshop/rawbot-losing-memory.png new file mode 100755 index 0000000..dff8324 Binary files /dev/null and b/framework/img/workshop/rawbot-losing-memory.png differ diff --git a/framework/img/workshop/rawbot-reminder.png b/framework/img/workshop/rawbot-reminder.png new file mode 100755 index 0000000..2db044e Binary files /dev/null and b/framework/img/workshop/rawbot-reminder.png differ diff --git a/framework/img/workshop/rawbot-run.png b/framework/img/workshop/rawbot-run.png new file mode 100755 index 0000000..4ca62c1 Binary files /dev/null and b/framework/img/workshop/rawbot-run.png differ diff --git a/framework/img/workshop/remember-name-rawbot.gif b/framework/img/workshop/remember-name-rawbot.gif new file mode 100755 index 0000000..40a4aa0 Binary files /dev/null and b/framework/img/workshop/remember-name-rawbot.gif differ diff --git a/framework/img/workshop/say-hi-rawbot.png b/framework/img/workshop/say-hi-rawbot.png new file mode 100755 index 0000000..f3fc4e7 Binary files /dev/null and b/framework/img/workshop/say-hi-rawbot.png differ diff --git a/framework/img/workshop/say-my-name-rawbot.png b/framework/img/workshop/say-my-name-rawbot.png new file mode 100755 index 0000000..5c7c203 Binary files /dev/null and b/framework/img/workshop/say-my-name-rawbot.png differ diff --git a/framework/img/workshop/sublime-text-logo.png b/framework/img/workshop/sublime-text-logo.png new file mode 100755 index 0000000..b62b8c1 Binary files /dev/null and b/framework/img/workshop/sublime-text-logo.png differ diff --git a/framework/img/workshop/syntax-conditional.gif b/framework/img/workshop/syntax-conditional.gif new file mode 100755 index 0000000..11b846b Binary files /dev/null and b/framework/img/workshop/syntax-conditional.gif differ diff --git a/framework/img/workshop/syntax-for.gif b/framework/img/workshop/syntax-for.gif new file mode 100755 index 0000000..543cca4 Binary files /dev/null and b/framework/img/workshop/syntax-for.gif differ diff --git a/framework/img/workshop/syntax-function.gif b/framework/img/workshop/syntax-function.gif new file mode 100755 index 0000000..84ad8d1 Binary files /dev/null and b/framework/img/workshop/syntax-function.gif differ diff --git a/framework/img/workshop/syntax-object.gif b/framework/img/workshop/syntax-object.gif new file mode 100755 index 0000000..947d828 Binary files /dev/null and b/framework/img/workshop/syntax-object.gif differ diff --git a/framework/img/workshop/syntax-variable-assign.gif b/framework/img/workshop/syntax-variable-assign.gif new file mode 100755 index 0000000..dacc174 Binary files /dev/null and b/framework/img/workshop/syntax-variable-assign.gif differ diff --git a/framework/img/workshop/syntax-while.gif b/framework/img/workshop/syntax-while.gif new file mode 100755 index 0000000..715aa2c Binary files /dev/null and b/framework/img/workshop/syntax-while.gif differ diff --git a/framework/img/workshop/the_console_x.jpg b/framework/img/workshop/the_console_x.jpg new file mode 100755 index 0000000..d080ed7 Binary files /dev/null and b/framework/img/workshop/the_console_x.jpg differ diff --git a/assets/thenewdesignguidelines-pull.gif b/framework/img/workshop/thenewdesignguidelines-pull.gif similarity index 100% rename from assets/thenewdesignguidelines-pull.gif rename to framework/img/workshop/thenewdesignguidelines-pull.gif diff --git a/assets/thenewdesignguidelines.gif b/framework/img/workshop/thenewdesignguidelines.gif similarity index 100% rename from assets/thenewdesignguidelines.gif rename to framework/img/workshop/thenewdesignguidelines.gif diff --git a/framework/img/workshop/update-quantities.png b/framework/img/workshop/update-quantities.png new file mode 100644 index 0000000..2d1541b Binary files /dev/null and b/framework/img/workshop/update-quantities.png differ diff --git a/framework/img/workshop/var-shipping-example.jpg b/framework/img/workshop/var-shipping-example.jpg new file mode 100755 index 0000000..0e34417 Binary files /dev/null and b/framework/img/workshop/var-shipping-example.jpg differ diff --git a/framework/img/workshop/variable-rice.png b/framework/img/workshop/variable-rice.png new file mode 100755 index 0000000..81799b2 Binary files /dev/null and b/framework/img/workshop/variable-rice.png differ diff --git a/framework/img/workshop/victory-dance.gif b/framework/img/workshop/victory-dance.gif new file mode 100644 index 0000000..efa59c9 Binary files /dev/null and b/framework/img/workshop/victory-dance.gif differ diff --git a/framework/img/workshop/vs-code-logo.png b/framework/img/workshop/vs-code-logo.png new file mode 100644 index 0000000..822582b Binary files /dev/null and b/framework/img/workshop/vs-code-logo.png differ diff --git a/framework/img/workshop/web-triad-css.png b/framework/img/workshop/web-triad-css.png new file mode 100755 index 0000000..0b3ce9d Binary files /dev/null and b/framework/img/workshop/web-triad-css.png differ diff --git a/framework/img/workshop/web-triad-html.png b/framework/img/workshop/web-triad-html.png new file mode 100755 index 0000000..828697c Binary files /dev/null and b/framework/img/workshop/web-triad-html.png differ diff --git a/framework/img/workshop/web-triad-javascript.gif b/framework/img/workshop/web-triad-javascript.gif new file mode 100755 index 0000000..1da6adb Binary files /dev/null and b/framework/img/workshop/web-triad-javascript.gif differ diff --git a/assets/while-loop.jpg b/framework/img/workshop/while-loop.jpg similarity index 100% rename from assets/while-loop.jpg rename to framework/img/workshop/while-loop.jpg diff --git a/src/codemirror/mode/python/LICENSE.txt b/framework/license.txt similarity index 96% rename from src/codemirror/mode/python/LICENSE.txt rename to framework/license.txt index 918866b..4631509 100755 --- a/src/codemirror/mode/python/LICENSE.txt +++ b/framework/license.txt @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2010 Timothy Farrell +Copyright (c) 2010 Lea Verou Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/framework/psds/backend-frond-end-gif.psd b/framework/psds/backend-frond-end-gif.psd new file mode 100755 index 0000000..a35da21 Binary files /dev/null and b/framework/psds/backend-frond-end-gif.psd differ diff --git a/framework/psds/backend-frond-end-server-gif.psd b/framework/psds/backend-frond-end-server-gif.psd new file mode 100755 index 0000000..7acfeab Binary files /dev/null and b/framework/psds/backend-frond-end-server-gif.psd differ diff --git a/framework/psds/backend-frond-end.psd b/framework/psds/backend-frond-end.psd new file mode 100755 index 0000000..69a6563 Binary files /dev/null and b/framework/psds/backend-frond-end.psd differ diff --git a/framework/psds/bentobox.psd b/framework/psds/bentobox.psd new file mode 100755 index 0000000..31991ea Binary files /dev/null and b/framework/psds/bentobox.psd differ diff --git a/framework/psds/bentobox2.psd b/framework/psds/bentobox2.psd new file mode 100755 index 0000000..f68f847 Binary files /dev/null and b/framework/psds/bentobox2.psd differ diff --git a/framework/psds/boolean_syntax.psd b/framework/psds/boolean_syntax.psd new file mode 100755 index 0000000..e08e955 Binary files /dev/null and b/framework/psds/boolean_syntax.psd differ diff --git a/framework/psds/browser.psd b/framework/psds/browser.psd new file mode 100755 index 0000000..c0abbf9 Binary files /dev/null and b/framework/psds/browser.psd differ diff --git a/framework/psds/computerdiagram.psd b/framework/psds/computerdiagram.psd new file mode 100755 index 0000000..7f23349 Binary files /dev/null and b/framework/psds/computerdiagram.psd differ diff --git a/framework/psds/computers.psd b/framework/psds/computers.psd new file mode 100755 index 0000000..d1f058f Binary files /dev/null and b/framework/psds/computers.psd differ diff --git a/framework/psds/function-refactor.psd b/framework/psds/function-refactor.psd new file mode 100755 index 0000000..6730bc4 Binary files /dev/null and b/framework/psds/function-refactor.psd differ diff --git a/framework/psds/hi-rawbot.psd b/framework/psds/hi-rawbot.psd new file mode 100755 index 0000000..207d235 Binary files /dev/null and b/framework/psds/hi-rawbot.psd differ diff --git a/exercises/assets/images.psd b/framework/psds/images.psd similarity index 100% rename from exercises/assets/images.psd rename to framework/psds/images.psd diff --git a/framework/psds/javascriptgears.psd b/framework/psds/javascriptgears.psd new file mode 100755 index 0000000..f648d2c Binary files /dev/null and b/framework/psds/javascriptgears.psd differ diff --git a/framework/psds/objectsyntax.psd b/framework/psds/objectsyntax.psd new file mode 100755 index 0000000..51aa00a Binary files /dev/null and b/framework/psds/objectsyntax.psd differ diff --git a/framework/psds/rawbot-computers.psd b/framework/psds/rawbot-computers.psd new file mode 100755 index 0000000..4422c27 Binary files /dev/null and b/framework/psds/rawbot-computers.psd differ diff --git a/framework/psds/rawbot-important.png b/framework/psds/rawbot-important.png new file mode 100755 index 0000000..ca1a031 Binary files /dev/null and b/framework/psds/rawbot-important.png differ diff --git a/framework/psds/rawbot-speechbubble.psd b/framework/psds/rawbot-speechbubble.psd new file mode 100755 index 0000000..919c3ae Binary files /dev/null and b/framework/psds/rawbot-speechbubble.psd differ diff --git a/framework/psds/rice.psd b/framework/psds/rice.psd new file mode 100755 index 0000000..697172a Binary files /dev/null and b/framework/psds/rice.psd differ diff --git a/framework/psds/syntax.psd b/framework/psds/syntax.psd new file mode 100755 index 0000000..b1c2c90 Binary files /dev/null and b/framework/psds/syntax.psd differ diff --git a/framework/psds/textgif.psd b/framework/psds/textgif.psd new file mode 100755 index 0000000..e0b630a Binary files /dev/null and b/framework/psds/textgif.psd differ diff --git a/framework/psds/variablesyntax.psd b/framework/psds/variablesyntax.psd new file mode 100755 index 0000000..9b6ec75 Binary files /dev/null and b/framework/psds/variablesyntax.psd differ diff --git a/framework/sass/_base.scss b/framework/sass/_base.scss new file mode 100644 index 0000000..51169e6 --- /dev/null +++ b/framework/sass/_base.scss @@ -0,0 +1,52 @@ +//--------------- +// VARIABLES +//--------------- + +// Colours +//--------------- +$llc-pink: #b109aa; +$black: #000; +$gray-dark: #222; +$gray: #444; +$gray-light: #bdc3c7; +$white: #fff; + + +// Typography +//--------------- +// Font families +$quicksand: 'Quicksand', sans-serif; +$pacifico: 'Pacifico', cursive; +$open-sans: 'Open Sans', sans-serif; +$monserrat: 'Montserrat', sans-serif; +$heading-font: $quicksand; +$base-font: $monserrat; +$cursive: $pacifico; + +$font-size-base: 3.2rem; +$font-size-sm: $font-size-base * 0.9; // 90% +$font-size-xsm: $font-size-base * 0.75; +$font-size-footnote: $font-size-base * 0.5; +$font-size-heading: 4.0rem; +$font-size-heading-lg: 7.5rem; +$font-size-heading-sm: $font-size-base; +$line-height: 1.4; + + +//--------------- +// MIXINS +//--------------- +@mixin list-reset { + margin: 0; + padding: 0; + list-style-type: none; +} + +/* http://css-tricks.com/snippets/css/clear-fix/ */ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} diff --git a/framework/sass/_theme.scss b/framework/sass/_theme.scss new file mode 100644 index 0000000..6070dd1 --- /dev/null +++ b/framework/sass/_theme.scss @@ -0,0 +1,766 @@ +/* + Slideshow theme for Ladies Learning Code + @author Christina Truong | christinatruong.com + @version 2.0 +*/ + +/* Global styles +-----------------*/ +/* apply a natural box layout model to all elements */ +*, *:before, *:after { + box-sizing: border-box; +} +html { + font-size: 62.5%; + + @media (min-width: 1401px) { + font-size: 70%; + } +} +body { + padding: 0; + margin: 0; + font-size: $font-size-base; + line-height: $line-height; + font-family: $base-font; + color: $gray; + border-top: 4px solid $llc-pink; + -webkit-font-smoothing: antialiased; + background: #ecf0f1; +} + +strong { + font-weight: 700; + color: black; +} + +h1 { + font-family: $heading-font; + letter-spacing: -0.05em; + text-transform: uppercase; + margin: 0 0 25px; + color: $llc-pink; + font-size: $font-size-heading; + + .title & { + font-size: $font-size-heading-lg; + font-weight: 400; + } + code { + font-size: inherit; + color: inherit; + font-family: inherit; + background: transparent; + } +} +h2, h3 { + margin: 0; + + + p, + + ul, + + ol { + margin-top: 6px; + } +} +h2 { + font-size: $font-size-heading-sm; +} +h3 { + font-size: $font-size-heading-sm * .9; +} + +a { + outline: none; + color: inherit; + + &:hover { + color: $llc-pink; + text-decoration: none; + } +} + +hr { + border: none; + border-top: 1px solid $gray-light; + clear: both; + margin: 30px 0 0; + display: inline-block; + width: 100%; + + + p { + margin-top: 16px; + } +} + +p { + margin-bottom: 0; + + + h2 { + margin-top: 30px; + } +} + +iframe { + margin-top: 15px; +} + + +// List styles +//---------------- +ol, ul { + > li { + margin-bottom: 6px; + } + ol, ul { + margin-top: 6px; + font-size: $font-size-sm; + } +} +ul { + padding: 0; + + > li { + margin-left: 24px; + list-style-type: none; + + &:before { + content: "\203A"; // › symbol + font-family: $quicksand; + font-weight: bold; + margin-left: -19px; + padding-right: 10px; + } + } +} +p + ul, +p + ol { + margin-top: 20px; +} + +.nested-list { + > ul { + margin-left: -24px; + + > li:before { + content: ""; + margin-left: -10px; + } + ol, ul { + width: 90%; + margin-bottom: 25px; + } + } + .resources + ul { + > li { + margin-left: 35px; + + &:before { + content: "\203A"; + } + } + } +} + +.two-col-list > { + ul, ol { + overflow: hidden; + + > li { + width: 45%; + float: left; + margin-left: 4px; + + &:first-child { + margin-right: 5%; + } + &:before { + content: ""; + margin-left: -12px; + } + } + } + .resources + ul { + > li { + width: 100%; + margin-left: 12px; + + &:before { + content: "\203A"; + } + } + } +} + +table { + border-spacing: 0; + border-collapse: collapse; + + pre { + margin: 0; + } + code { + background: transparent; + } + .hljs { + border: none; + background: transparent; + } + img { + width: 100%; + } +} +th, td { + border: 1px solid $gray-light; + padding: 10px; +} +th { + text-align: left; + font-weight: normal; +} +td { + .two-col-table & { + width: 50%; + } +} + +// Helper classes and content styles +.note, +.small-type .note, +.resources, +.resources + * { + line-height: 1.3; + font-size: $font-size-xsm!important; + + code { + font-size: inherit; + } +} +.resources, +.resources + * { + margin-top: 2px; +} +.resources { + margin-bottom: 5px; + + + ul li { + margin-bottom: 0; + } +} + +.left { + float: left; + + + ul { + padding-left: 10px; + } +} +img.left, +iframe.left { + margin-right: 30px; +} +img.right, +iframe.right { + margin-left: 30px; +} + +.right { + float: right; +} +.centered { + text-align: center; +} +.centered-media { + img, + iframe { + margin: 0 auto; + display: block; + } +} +.cursive { + font-family: $cursive; + color: $llc-pink; +} +.highlight em, +a.highlight { + color: $llc-pink; + font-size: 106%; + padding-right: 2px; +} +.small-type { + p, ul, ol { + font-size: $font-size-sm; + line-height: 1.3; + } +} + +[class^="col-"], +[class*="col-"]{ + float: left; + margin-right: 2%; + + &:last-child { + margin-right: 0; + } +} +.col-2 { + width: 48%; +} +.col-3 { + width: 32%; +} +.col-narrow { + width: 38%; +} +.col-wide { + width: 60%; +} + + + + +/* Base styles for slides +--------------------------*/ +.slide { + padding: 45px 64px; + background-size: cover; + height: 100%; + width: 100%; + max-width: 1600px; + margin: 0 auto; + + // Adds extra space to the bottom of the slides to allow + // presenters to scroll the page up so people in the back + // of the room can see the bottom of the slides. + &:after { + content: " "; + display: block; + height: 200px; + } + img { + max-width: 100%; + } + &.centered { + text-align: center; + + img { + width: 60%; + } + } + .logo { + width: 350px; + } + .logo-stacked { + width: 150px; + } +} + +//slide number +#indicator { + top: 15px; + right: 20px; + font-size: 20px; + text-shadow: none; + color: $llc-pink; + background: white; + padding: 2px 8px; +} + +/* For two column screenshots */ +.side-by-side { + img { + width: 49%; + display: inline-block; + vertical-align: top; + } +} + +/* vertical align heading */ +.slide.title { + transform-style: preserve-3d; + padding-left: 8%; + padding-right: 8%; + background: $gray-dark; + + h1, h2 { + position: relative; + text-align: center; + top: 40%; + transform: translateY(-40%); + } + h1 { + margin-bottom: 0px; + line-height: 1.1; + } + h2 { + color: $white; + letter-spacing: 0.05rem; + font-size: $font-size-heading; + font-family: "Quicksand",sans-serif; + text-transform: uppercase; + } +} + +/* Progress Bar */ +#timer { + height: 4px; + line-height: 4px; + background: $black; + + &:before { + content: ""; + } +} + +/* textarea for dynamic CSS demos */ +.edit { + float: left; + background: #FFEFD5; + border-right: 1px solid darken(#FFEFD5, 20); + border-bottom: 1px solid darken(#FFEFD5, 20); + font-size: 11px; + padding: 6px 14px; + position: relative; + bottom: -20px; + left: 1px; + margin-bottom: -25px; + text-transform: uppercase; + font-weight: bold; +} +p { + textarea.snippet { + margin-top: -15px; + margin-bottom: -10px; + } + .edit { + margin-top: -34px; + } +} +textarea.snippet { + width: 100%; + border: 1px solid #222; + padding: 35px 12px 12px;; + margin: 15px 0; + font-size: 20px!important; + font-family: Andale Mono, Monaco, monospace; + line-height: 1.4; + + + .example { + margin-top: 0; + } +} + +/* Creates border for slide examples */ +.example, +blockquote { + font-size: $font-size-sm; + margin: 15px 0; + + p { + margin: 10px; + } +} +.example { + border: 1px solid $gray-light; + padding: 5px 10px; +} +blockquote { + background: #fff; + border: 3px solid $llc-pink +} + +/* Incremental slides */ +.delayed.displayed, +.delayed-children > .displayed { + opacity: 1; +} + +/* +Background color style for headings +Use spans wrap inside of a heading for div. +e.g. +

+ + Welcome to
+ Ladies Learning Code! +
+

+*/ +.heading-bg { + span { + background: rgba($llc-pink, 0.8); + border-radius: 5px; + padding: 0 10px 0 6px; + box-decoration-break: clone; + + &.light { + background: rgba($white, 0.6); + } + &.dark, &.light { + color: $gray-dark; + } + } +} + +/* Pre-workshop & intro slides +-----------------------------*/ +/* welcome / 1st slide */ +.welcome { + &.slide { + padding: 0; + } + .logo-stacked { + margin-right: 50px; + } + h1, + .instructions { + padding: 30px 64px; + } + .instructions p { + margin: 0; + line-height: 1.32; + } + h1 { + background: #111; + line-height: 1; + margin: 0; + font-size: 55px; + } + h2 { + float: left; + color: black; + width: 21%; + font-family: $quicksand; + color: $llc-pink; + text-transform: uppercase; + font-size: 30px; + } + ol, ul { + float: left; + width: 79%; + margin: 0; + + ul, ol { + float: none; + width: 100%; + } + &.connected li:before { + content: ""; + } + &.downloads > li { + margin-bottom: 15px; + } + } +} + +/* Instructor Info */ +.slide.intro, +.slide.last { + h1, h2 { + font-weight: 400; + } + h1 { + font-size: $font-size-heading-lg; + } + h2 { + font-size: $font-size-heading; + } + .instructor { + border-radius: 50%; + max-width: 225px; + float: left; + margin-right: 30px; + } + .cursive { + margin-left: -5px; + } + ul li { + margin: 0; + + &:before { content: ""; } + } +} +.slide.intro { + &:after { + height: 0px; + } + h1, h2 { + color: $white; + } + h1 { + margin-bottom: 10px; + } + a { + color: white; + } + footer a { + color: $llc-pink; + } +} +.slide.last { + .heading-bg { + font-family: $heading-font; + text-transform: uppercase; + color: white; + margin-bottom: 20px; + } + .attribution { + position: absolute; + bottom: 15px; + font-size: $font-size-footnote; + } +} +.sponsor { + position: absolute; + bottom: 45px; + right: 40px; + text-align: right; + font-size: 20px; + color: white; + + img { + width: 300px; + margin-right: -9px; + } +} +/* copyright & footer info */ +footer { + position: fixed; + bottom: 0; + width: 100%; + background: white; + font-size: $font-size-footnote; + + p { + margin: 6px 10px 0 8px; + } + .arrow { + color: $llc-pink; + } + img { + margin-bottom: -5px; + } +} +.slide.intro { + footer { + margin: 0 -64px; + } +} + + +/* Table of contents +---------------------*/ +.table-of-contents { + font-size: $font-size-sm; + + li { + margin-bottom: 2px; + } + a { + color: $gray-dark; + + &:hover { + color: $llc-pink; + } + } +} + + +/* code blocks +-----------------------------*/ +pre { + margin: 18px 0 12px; + white-space: pre-wrap; + + code { + overflow-y: auto; + font-size: $font-size-xsm; + // font-family: Andale Mono, Monaco, monospace; + } + + pre { + margin-top: 15px; + } + + h2 { + margin-top: 25px; + } + + hr { + margin-top: 35px; + } +} +code { + color: #555; + padding: 0 8px; + display: inline-block; + background: white; + font-size: $font-size-base * 1.1; + border-radius: 4px; + position: relative; + top: -2px; +} +/* Targets only firefox */ +@-moz-document url-prefix() { + code { + font-size: $font-size-base - 0.2; + } +} + +//code samples +.highlighted-tags strong { + background: #ddd; + padding: 5px; + color: black; + display: inline-block; + font-weight: bold; + + [class^="hljs-"]{ + color: black; + font-weight: bold; + } +} + +/* highlight.js customizations */ +.hljs { + padding: 12px; + border-radius: 2px; + border: 1px solid $gray-light; + word-wrap: break-word; +} +.hljs-doctype, +.hljs-comment { + color: #990; +} +.php .hljs-preprocessor { + color: green; +} + +.hljs { + border: 1px solid $gray; +} + +.hljs-comment { + color: #727272; +} + +.hljs-doctype { + color: #000080; +} + +.hljs-attribute, +.hljs-number { + color: #027d7d; +} + + +/* presenter notes overrides +-----------------------------*/ +.presenter-notes { + bottom: 0; + width: 100%; + background: rgba(255, 255, 255, .9); + font-size: 18px; + margin: 0; + max-height: inherit; + + p { + margin-top: 0; + } +} diff --git a/framework/sass/_workshop.scss b/framework/sass/_workshop.scss new file mode 100644 index 0000000..d390ad8 --- /dev/null +++ b/framework/sass/_workshop.scss @@ -0,0 +1,84 @@ +/* Styles specific to this workshop +------------------------------------*/ +.slide.intro { + background: linear-gradient(rgba($black, 0.7), + rgba($black, 0.7)), + url(../img/banner-home1.jpg) no-repeat; + background-size: cover; +} + +.steps { + img { + vertical-align: top; + margin: 0 20px 40px 10px; + width: 275px; + } +} +.triad { + img { + float: left; + margin-right: 20px; + width: 40%; + } +} +.llc-loves { + button { + font-size: 18px; + padding: 10px; + cursor: pointer; + } + img { + vertical-align: middle; + } + #update { + margin-left: 5px; + } +} + +.exercise { + .quantities { + background: white; + width: 200px; + text-align: center; + border: 2px solid #ccc; + padding: 20px 5px; + margin-right: 40px; + font-size: 20px; + float: left; + } + .quantities button { + margin: 5px 2px; + font-size: 16px; + } + .quantities input { + width: 40px; + margin: 10px 0 0 5px; + font-size: 14px; + } +} + +.comparison-table { + border: none; + background-color: #2b303b; + color: #dfe1e8; + padding: 10px; + font-size: 2.4rem; + float: left; + margin-bottom: 20px; + + th, td { + border: none; + } + td { + padding: 6px 10px; + } + tr:nth-child(2n) { + background-color: #343d46; + } +} + +.btn-image { + background-color: transparent; + border: 0; + cursor: pointer; +} diff --git a/framework/sass/styles.scss b/framework/sass/styles.scss new file mode 100644 index 0000000..9aa0d30 --- /dev/null +++ b/framework/sass/styles.scss @@ -0,0 +1,6 @@ +@import "base", + "theme", + "workshop"; + +// Make sure to run Autoprefixer to automatically add vendor prefixes +// to the compiled CSS file using the compiler of your choice. \ No newline at end of file diff --git a/framework/scripts/classList.js b/framework/scripts/classList.js new file mode 100755 index 0000000..f6adebd --- /dev/null +++ b/framework/scripts/classList.js @@ -0,0 +1,116 @@ +/* + * classList.js: Implements a cross-browser element.classList getter. + * 2010-09-06 + * + * By Eli Grey, http://eligrey.com + * Public Domain. + * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + */ + +"use strict"; + +if (typeof Element !== "undefined") { + +(function () { + +var + classListProp = "classList" + , protoProp = "prototype" + , elemCtrProto = Element[protoProp] + , objCtr = Object +; +if (!objCtr.hasOwnProperty.call(elemCtrProto, classListProp)) { + var + strTrim = String[protoProp].trim || function () { + return this.replace(/^\s+|\s+$/g, ""); + } + , arrIndexOf = Array[protoProp].indexOf || function (item) { + for (var i = 0, len = this.length; i < len; i++) { + if (i in this && this[i] === item) { + return i; + } + } + return -1; + } + , checkTokenAndGetIndex = function (classList, token) { + if (token === "") { + throw "SYNTAX_ERR"; + } + if (/\s/.test(token)) { + throw "INVALID_CHARACTER_ERR"; + } + return arrIndexOf.call(classList, token); + } + , ClassList = function (elem) { + var + trimmedClasses = strTrim.call(elem.className) + , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [] + ; + for (var i = 0, len = classes.length; i < len; i++) { + this.push(classes[i]); + } + this.updateClassName = function () { + elem.className = this.toString(); + }; + } + , classListProto = ClassList[protoProp] = [] + , classListGetter = function () { + return new ClassList(this); + } + ; + classListProto.item = function (i) { + return this[i] || null; + }; + classListProto.contains = function (token) { + token += ""; + return checkTokenAndGetIndex(this, token) !== -1; + }; + classListProto.add = function (token) { + token += ""; + if (checkTokenAndGetIndex(this, token) === -1) { + this.push(token); + this.updateClassName(); + } + }; + classListProto.remove = function (token) { + token += ""; + var index = checkTokenAndGetIndex(this, token); + if (index !== -1) { + this.splice(index, 1); + this.updateClassName(); + } + }; + classListProto.toggle = function (token) { + token += ""; + if (checkTokenAndGetIndex(this, token) === -1) { + this.add(token); + } else { + this.remove(token); + } + }; + classListProto.toString = function () { + return this.join(" "); + }; + + if (objCtr.defineProperty) { + var classListDescriptor = { + get: classListGetter + , enumerable: true + , configurable: true + }; + try { + objCtr.defineProperty(elemCtrProto, classListProp, classListDescriptor); + } catch (ex) { // IE 8 doesn't support enumerable:true + if (ex.number === -0x7FF5EC54) { + classListDescriptor.enumerable = false; + objCtr.defineProperty(elemCtrProto, classListProp, classListDescriptor); + } + } + } else if (objCtr[protoProp].__defineGetter__) { + elemCtrProto.__defineGetter__(classListProp, classListGetter); + } +} + +}()); + +} \ No newline at end of file diff --git a/framework/scripts/jquery-1.11.0.min.js b/framework/scripts/jquery-1.11.0.min.js new file mode 100644 index 0000000..73f33fb --- /dev/null +++ b/framework/scripts/jquery-1.11.0.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f +}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n(" - - - diff --git a/src/codemirror/demo/resize.html b/src/codemirror/demo/resize.html deleted file mode 100755 index a21ece6..0000000 --- a/src/codemirror/demo/resize.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - CodeMirror 2: Autoresize Demo - - - - - - - - - -

CodeMirror 2: Autoresize demo

- - - -

By setting a few CSS properties, CodeMirror can be made to -automatically resize to fit its content.

- - - - - diff --git a/src/codemirror/demo/runmode.html b/src/codemirror/demo/runmode.html deleted file mode 100755 index 3ae7331..0000000 --- a/src/codemirror/demo/runmode.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - CodeMirror 2: Mode Runner Demo - - - - - - - - -

CodeMirror 2: Mode Runner Demo

- -
- -

-
-    
-
-    

Running a CodeMirror mode outside of the editor. - The CodeMirror.runMode function, defined - in lib/runmode.js takes the following arguments:

- -
-
text (string)
-
The document to run through the highlighter.
-
mode (mode spec)
-
The mode to use (must be loaded as normal).
-
output (function or DOM node)
-
If this is a function, it will be called for each token with - two arguments, the token's text and the token's style class (may - be null for unstyled tokens). If it is a DOM node, - the tokens will be converted to span elements as in - an editor, and inserted into the node - (through innerHTML).
-
- - - diff --git a/src/codemirror/demo/search.html b/src/codemirror/demo/search.html deleted file mode 100755 index 2a3bbee..0000000 --- a/src/codemirror/demo/search.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - CodeMirror 2: Search/Replace Demo - - - - - - - - - -

CodeMirror 2: Search/Replace Demo

- - - - or - it by - - - - -

Demonstration of search/replace functionality and marking - text.

- - - diff --git a/src/codemirror/demo/theme.html b/src/codemirror/demo/theme.html deleted file mode 100755 index 183daf1..0000000 --- a/src/codemirror/demo/theme.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - CodeMirror 2: Theme Demo - - - - - - - - - - - - - - -

CodeMirror 2: Theme demo

- - - -

Select a theme: -

- - - - diff --git a/src/codemirror/index.html b/src/codemirror/index.html deleted file mode 100755 index 394b0b6..0000000 --- a/src/codemirror/index.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - CodeMirror - - - - - - - -

{ } CodeMirror

- -
-/* In-browser code editing
-   made bearable */
-
- -
- -

CodeMirror is a JavaScript library that can - be used to create a relatively pleasant editor interface for - code-like content ― computer programs, HTML markup, and - similar. If a mode has been written for the language you are - editing, the code will be coloured, and the editor will optionally - help you with indentation.

- -

This is the project page for CodeMirror 2, the currently more - actively developed, and recommended - version. CodeMirror 1 is still available - from here.

- - - -

Getting the code

- -

All of CodeMirror is released under a MIT-style license. To get it, you can download - the latest - release or the current development - snapshot as zip files. To create a custom minified script file, - you can use the compression API.

- -

We use git for version control. - The main repository can be fetched in this way:

- -
git clone http://marijnhaverbeke.nl/git/codemirror2
- -

CodeMirror can also be found on GitHub at marijnh/CodeMirror2. - If you plan to hack on the code and contribute patches, the best way - to do it is to create a GitHub fork, and send pull requests.

- -

Documentation

- -

The manual is your first stop for - learning how to use this library. It starts with a quick explanation - of how to use the editor, and then describes all of the (many) - options and methods that CodeMirror exposes.

- -

For those who want to learn more about the code, there is - an overview of the internals available. - The source code - itself is, for the most part, also well commented.

- -

Support and bug reports

- -

There is - a Google - group (a sort of mailing list/newsgroup thing) for discussion - and news related to CodeMirror. Reporting bugs is best done - on github. - You can also e-mail me - directly: Marijn - Haverbeke.

- -

Supported browsers

- -

The following browsers are able to run CodeMirror:

- -
    -
  • Firefox 2 or higher
  • -
  • Chrome, any version
  • -
  • Safari 3 or higher
  • -
  • Internet Explorer 6 or higher
  • -
  • Opera 9 or higher (with some key-handling problems on OS X)
  • -
- -

I am not actively testing against every new browser release, and - vendors have a habit of introducing bugs all the time, so I am - relying on the community to tell me when something breaks. - See here for information on how to contact - me.

- -
- -
- - Download the latest release - -

Make a donation

- -
    -
  • Paypal
  • -
  • Bank
  • -
- - - -

Releases:

- -

26-09-2011: Version 2.15:

-

Fix bug that snuck into 2.14: Clicking the - character that currently has the cursor didn't re-focus the - editor.

- -

26-09-2011: Version 2.14:

- - -

23-08-2011: Version 2.13:

- - -

25-07-2011: Version 2.12:

-
    -
  • Add a SPARQL mode.
  • -
  • Fix bug with cursor jumping around in an unfocused editor in IE.
  • -
  • Allow key and mouse events to bubble out of the editor. Ignore widget clicks.
  • -
  • Solve cursor flakiness after undo/redo.
  • -
  • Fix block-reindent ignoring the last few lines.
  • -
  • Fix parsing of multi-line attrs in XML mode.
  • -
  • Use innerHTML for HTML-escaping.
  • -
  • Some fixes to indentation in C-like mode.
  • -
  • Shrink horiz scrollbars when long lines removed.
  • -
  • Fix width feedback loop bug that caused the width of an inner DIV to shrink.
  • -
- -

04-07-2011: Version 2.11:

-
    -
  • Add a Scheme mode.
  • -
  • Add a replace method to search cursors, for cursor-preserving replacements.
  • -
  • Make the C-like mode mode more customizeable.
  • -
  • Update XML mode to spot mismatched tags.
  • -
  • Add getStateAfter API and compareState mode API methods for finer-grained mode magic.
  • -
  • Add a getScrollerElement API method to manipulate the scrolling DIV.
  • -
  • Fix drag-and-drop for Firefox.
  • -
  • Add a C# configuration for the C-like mode.
  • -
  • Add full-screen editing and mode-changing demos.
  • -
- -

07-06-2011: Version 2.1:

-

Add - a theme system - (demo). Note that this is not - backwards-compatible—you'll have to update your styles and - modes!

- -

07-06-2011: Version 2.02:

-
    -
  • Add a Lua mode.
  • -
  • Fix reverse-searching for a regexp.
  • -
  • Empty lines can no longer break highlighting.
  • -
  • Rework scrolling model (the outer wrapper no longer does the scrolling).
  • -
  • Solve horizontal jittering on long lines.
  • -
  • Add runmode.js.
  • -
  • Immediately re-highlight text when typing.
  • -
  • Fix problem with 'sticking' horizontal scrollbar.
  • -
- -

26-05-2011: Version 2.01:

-
    -
  • Add a Smalltalk mode.
  • -
  • Add a reStructuredText mode.
  • -
  • Add a Python mode.
  • -
  • Add a PL/SQL mode.
  • -
  • coordsChar now works
  • -
  • Fix a problem where onCursorActivity interfered with onChange.
  • -
  • Fix a number of scrolling and mouse-click-position glitches.
  • -
  • Pass information about the changed lines to onChange.
  • -
  • Support cmd-up/down on OS X.
  • -
  • Add triple-click line selection.
  • -
  • Don't handle shift when changing the selection through the API.
  • -
  • Support "nocursor" mode for readOnly option.
  • -
  • Add an onHighlightComplete option.
  • -
  • Fix the context menu for Firefox.
  • -
- -

Older releases...

- -
- -
 
- - - - - - - - - diff --git a/src/codemirror/internals.html b/src/codemirror/internals.html deleted file mode 100755 index 89e6aeb..0000000 --- a/src/codemirror/internals.html +++ /dev/null @@ -1,389 +0,0 @@ - - - - CodeMirror: Internals - - - - - - - -

{ } CodeMirror

- -
-/* (Re-) Implementing A Syntax-
-   Highlighting Editor in JavaScript */
-
- -
- -

- Topic: JavaScript, code editor implementation
- Author: Marijn Haverbeke
- Date: March 2nd 2011 -

- -

This is a followup to -my Brutal Odyssey to the -Dark Side of the DOM Tree story. That one describes the -mind-bending process of implementing (what would become) CodeMirror 1. -This one describes the internals of CodeMirror 2, a complete rewrite -and rethink of the old code base. I wanted to give this piece another -Hunter Thompson copycat subtitle, but somehow that would be out of -place—the process this time around was one of straightforward -engineering, requiring no serious mind-bending whatsoever.

- -

So, what is wrong with CodeMirror 1? I'd estimate, by mailing list -activity and general search-engine presence, that it has been -integrated into about a thousand systems by now. The most prominent -one, since a few weeks, -being Google -code's project hosting. It works, and it's being used widely. - -

Still, I did not start replacing it because I was bored. CodeMirror -1 was heavily reliant on designMode -or contentEditable (depending on the browser). Neither of -these are well specified (HTML5 tries -to specify -their basics), and, more importantly, they tend to be one of the more -obscure and buggy areas of browser functionality—CodeMirror, by using -this functionality in a non-typical way, was constantly running up -against browser bugs. WebKit wouldn't show an empty line at the end of -the document, and in some releases would suddenly get unbearably slow. -Firefox would show the cursor in the wrong place. Internet Explorer -would insist on linkifying everything that looked like a URL or email -address, a behaviour that can't be turned off. Some bugs I managed to -work around (which was often a frustrating, painful process), others, -such as the Firefox cursor placement, I gave up on, and had to tell -user after user that they were known problems, but not something I -could help.

- -

Also, there is the fact that designMode (which seemed -to be less buggy than contentEditable in Webkit and -Firefox, and was thus used by CodeMirror 1 in those browsers) requires -a frame. Frames are another tricky area. It takes some effort to -prevent getting tripped up by domain restrictions, they don't -initialize synchronously, behave strangely in response to the back -button, and, on several browsers, can't be moved around the DOM -without having them re-initialize. They did provide a very nice way to -namespace the library, though—CodeMirror 1 could freely pollute the -namespace inside the frame.

- -

Finally, working with an editable document means working with -selection in arbitrary DOM structures. Internet Explorer (8 and -before) has an utterly different (and awkward) selection API than all -of the other browsers, and even among the different implementations of -document.selection, details about how exactly a selection -is represented vary quite a bit. Add to that the fact that Opera's -selection support tended to be very buggy until recently, and you can -imagine why CodeMirror 1 contains 700 lines of selection-handling -code.

- -

And that brings us to the main issue with the CodeMirror 1 -code base: The proportion of browser-bug-workarounds to real -application code was getting dangerously high. By building on top of a -few dodgy features, I put the system in a vulnerable position—any -incompatibility and bugginess in these features, I had to paper over -with my own code. Not only did I have to do some serious stunt-work to -get it to work on older browsers (as detailed in the -previous story), things -also kept breaking in newly released versions, requiring me to come up -with new scary hacks in order to keep up. This was starting -to lose its appeal.

- -

General Approach

- -

What CodeMirror 2 does is try to sidestep most of the hairy hacks -that came up in version 1. I owe a lot to the -ACE editor for inspiration on how to -approach this.

- -

I absolutely did not want to be completely reliant on key events to -generate my input. Every JavaScript programmer knows that key event -information is horrible and incomplete. Some people (most awesomely -Mihai Bazon with Ymacs) have been able -to build more or less functioning editors by directly reading key -events, but it takes a lot of work (the kind of never-ending, fragile -work I described earlier), and will never be able to properly support -things like multi-keystoke international character input.

- -

So what I do is focus a hidden textarea, and let the browser -believe that the user is typing into that. What we show to the user is -a DOM structure we built to represent his document. If this is updated -quickly enough, and shows some kind of believable cursor, it feels -like a real text-input control.

- -

Another big win is that this DOM representation does not have to -span the whole document. Some CodeMirror 1 users insisted that they -needed to put a 30 thousand line XML document into CodeMirror. Putting -all that into the DOM takes a while, especially since, for some -reason, an editable DOM tree is slower than a normal one on most -browsers. If we have full control over what we show, we must only -ensure that the visible part of the document has been added, and can -do the rest only when needed. (Fortunately, the onscroll -event works almost the same on all browsers, and lends itself well to -displaying things only as they are scrolled into view.)

- -

Input

- -

ACE uses its hidden textarea only as a text input shim, and does -all cursor movement and things like text deletion itself by directly -handling key events. CodeMirror's way is to let the browser do its -thing as much as possible, and not, for example, define its own set of -key bindings. One way to do this would have been to have the whole -document inside the hidden textarea, and after each key event update -the display DOM to reflect what's in that textarea.

- -

That'd be simple, but it is not realistic. For even medium-sized -document the editor would be constantly munging huge strings, and get -terribly slow. What CodeMirror 2 does is put the current selection, -along with an extra line on the top and on the bottom, into the -textarea.

- -

This means that the arrow keys (and their ctrl-variations), home, -end, etcetera, do not have to be handled specially. We just read the -cursor position in the textarea, and update our cursor to match it. -Also, copy and paste work pretty much for free, and people get their -native key bindings, without any special work on my part. For example, -I have emacs key bindings configured for Chrome and Firefox. There is -no way for a script to detect this.

- -

Of course, since only a small part of the document sits in the -textarea, keys like page up and ctrl-end won't do the right thing. -CodeMirror is catching those events and handling them itself.

- -

Selection

- -

Getting and setting the selection range of a textarea in modern -browsers is trivial—you just use the selectionStart -and selectionEnd properties. On IE you have to do some -insane stuff with temporary ranges and compensating for the fact that -moving the selection by a 'character' will treat \r\n as a single -character, but even there it is possible to build functions that -reliably set and get the selection range.

- -

But consider this typical case: When I'm somewhere in my document, -press shift, and press the up arrow, something gets selected. Then, if -I, still holding shift, press the up arrow again, the top of my -selection is adjusted. The selection remembers where its head -and its anchor are, and moves the head when we shift-move. -This is a generally accepted property of selections, and done right by -every editing component built in the past twenty years.

- -

But not something that the browser selection APIs expose.

- -

Great. So when someone creates an 'upside-down' selection, the next -time CodeMirror has to update the textarea, it'll re-create the -selection as an 'upside-up' selection, with the anchor at the top, and -the next cursor motion will behave in an unexpected way—our second -up-arrow press in the example above will not do anything, since it is -interpreted in exactly the same way as the first.

- -

No problem. We'll just, ehm, detect that the selection is -upside-down (you can tell by the way it was created), and then, when -an upside-down selection is present, and a cursor-moving key is -pressed in combination with shift, we quickly collapse the selection -in the textarea to its start, allow the key to take effect, and then -combine its new head with its old anchor to get the real -selection.

- -

In short, scary hacks could not be avoided entirely in CodeMirror -2.

- -

And, the observant reader might ask, how do you even know that a -key combo is a cursor-moving combo, if you claim you support any -native key bindings? Well, we don't, but we can learn. The editor -keeps a set known cursor-movement combos (initialized to the -predictable defaults), and updates this set when it observes that -pressing a certain key had (only) the effect of moving the cursor. -This, of course, doesn't work if the first time the key is used was -for extending an inverted selection, but it works most of the -time.

- -

Intelligent Updating

- -

One thing that always comes up when you have a complicated internal -state that's reflected in some user-visible external representation -(in this case, the displayed code and the textarea's content) is -keeping the two in sync. The naive way is to just update the display -every time you change your state, but this is not only error prone -(you'll forget), it also easily leads to duplicate work on big, -composite operations. Then you start passing around flags indicating -whether the display should be updated in an attempt to be efficient -again and, well, at that point you might as well give up completely.

- -

I did go down that road, but then switched to a much simpler model: -simply keep track of all the things that have been changed during an -action, and then, only at the end, use this information to update the -user-visible display.

- -

CodeMirror uses a concept of operations, which start by -calling a specific set-up function that clears the state and end by -calling another function that reads this state and does the required -updating. Most event handlers, and all the user-visible methods that -change state are wrapped like this. There's a method -called operation that accepts a function, and returns -another function that wraps the given function as an operation.

- -

It's trivial to extend this (as CodeMirror does) to detect nesting, -and, when an operation is started inside an operation, simply -increment the nesting count, and only do the updating when this count -reaches zero again.

- -

If we have a set of changed ranges and know the currently shown -range, we can (with some awkward code to deal with the fact that -changes can add and remove lines, so we're dealing with a changing -coordinate system) construct a map of the ranges that were left -intact. We can then compare this map with the part of the document -that's currently visible (based on scroll offset and editor height) to -determine whether something needs to be updated.

- -

CodeMirror uses two update algorithms—a full refresh, where it just -discards the whole part of the DOM that contains the edited text and -rebuilds it, and a patch algorithm, where it uses the information -about changed and intact ranges to update only the out-of-date parts -of the DOM. When more than 30 percent (which is the current heuristic, -might change) of the lines need to be updated, the full refresh is -chosen (since it's faster to do than painstakingly finding and -updating all the changed lines), in the other case it does the -patching (so that, if you scroll a line or select another character, -the whole screen doesn't have to be re-rendered).

- -

All updating uses innerHTML rather than direct DOM -manipulation, since that still seems to be by far the fastest way to -build documents. There's a per-line function that combines the -highlighting, marking, and -selection info for that line into a snippet of HTML. The patch updater -uses this to reset individual lines, the refresh updater builds an -HTML chunk for the whole visible document at once, and then uses a -single innerHTML update to do the refresh.

- -

Parsers can be Simple

- -

When I wrote CodeMirror 1, I -thought interruptable -parsers were a hugely scary and complicated thing, and I used a -bunch of heavyweight abstractions to keep this supposed complexity -under control: parsers -were iterators -that consumed input from another iterator, and used funny -closure-resetting tricks to copy and resume themselves.

- -

This made for a rather nice system, in that parsers formed strictly -separate modules, and could be composed in predictable ways. -Unfortunately, it was quite slow (stacking three or four iterators on -top of each other), and extremely intimidating to people not used to a -functional programming style.

- -

With a few small changes, however, we can keep all those -advantages, but simplify the API and make the whole thing less -indirect and inefficient. CodeMirror -2's mode API uses explicit state -objects, and makes the parser/tokenizer a function that simply takes a -state and a character stream abstraction, advances the stream one -token, and returns the way the token should be styled. This state may -be copied, optionally in a mode-defined way, in order to be able to -continue a parse at a given point. Even someone who's never touched a -lambda in his life can understand this approach. Additionally, far -fewer objects are allocated in the course of parsing now.

- -

The biggest speedup comes from the fact that the parsing no longer -has to touch the DOM though. In CodeMirror 1, on an older browser, you -could see the parser work its way through the document, -managing some twenty lines in each 50-millisecond time slice it got. It -was reading its input from the DOM, and updating the DOM as it went -along, which any experienced JavaScript programmer will immediately -spot as a recipe for slowness. In CodeMirror 2, the parser usually -finishes the whole document in a single 100-millisecond time slice—it -manages some 1500 lines during that time on Chrome. All it has to do -is munge strings, so there is no real reason for it to be slow -anymore.

- -

What Gives?

- -

Given all this, what can you expect from CodeMirror 2? First, the -good:

- -
    - -
  • Small. the base library is some 32k when minified -now, 12k when gzipped. It's smaller than its own logo.
  • - -
  • Lightweight. CodeMirror 2 initializes very -quickly, and does almost no work when it is not focused. This means -you can treat it almost like a textarea, have multiple instances on a -page without trouble.
  • - -
  • Huge document support. Since highlighting is -really fast, and no DOM structure is being built for non-visible -content, you don't have to worry about locking up your browser when a -user enters a megabyte-sized document.
  • - -
  • Extended API. Some things kept coming up in the -mailing list, such as marking pieces of text or lines, which were -extremely hard to do with CodeMirror 1. The new version has proper -support for these built in.
  • - -
  • Tab support. Tabs inside editable documents were, -for some reason, a no-go. At least six different people announced they -were going to add tab support to CodeMirror 1, none survived (I mean, -none delivered a working version). CodeMirror 2 no longer removes tabs -from your document.
  • - -
  • Sane styling. iframe nodes aren't -really known for respecting document flow. Now that an editor instance -is a plain div element, it is much easier to size it to -fit the surrounding elements. You don't even have to make it scroll if -you do not want to.
  • - -
- -

Then, the bad:

- -
    - -
  • No line-wrapping. I'd have liked to get -line-wrapping to work, but it doesn't match the model I'm using very -well. It is important that cursor movement in the textarea matches -what you see on the screen, and it seems to be impossible to have the -lines wrapped the same in the textarea and the normal DOM.
  • - -
  • Some cursor flakiness. The textarea hack does not -really do justice to the complexity of cursor handling—a selection is -typically more than just an offset into a string. For example, if you -use the up and down arrow keys to move to a shorter line and then -back, you'll end up in your old position in most editor controls, but -CodeMirror 2 currently doesn't remember the 'real' cursor column in -this case. These can be worked around on a case-by-case basis, but -I haven't put much energy into that yet.
  • - -
  • Limited interaction with the editable panel. -Since the element you're looking at is not a real editable panel, -native browser behaviour for editable controls doesn't work -automatically. Through a lot of event glue code, I've managed to make -drag and drop work pretty well, have context menus work on most -browsers (except Opera). Middle-click paste on Firefox in Linux is -broken until someone finds a way to intercept it.
  • - -
- -
- -
 
- - diff --git a/src/codemirror/lib/codemirror.css b/src/codemirror/lib/codemirror.css deleted file mode 100755 index aea1574..0000000 --- a/src/codemirror/lib/codemirror.css +++ /dev/null @@ -1,68 +0,0 @@ -.CodeMirror { - line-height: 1em; - font-family: monospace; -} - -.CodeMirror-scroll { - overflow: auto; - height: 300px; - /* This is needed to prevent an IE[67] bug where the scrolled content - is visible outside of the scrolling box. */ - position: relative; -} - -.CodeMirror-gutter { - position: absolute; left: 0; top: 0; - z-index: 10; - background-color: #f7f7f7; - border-right: 1px solid #eee; - min-width: 2em; - height: 100%; -} -.CodeMirror-gutter-text { - color: #aaa; - text-align: right; - padding: .4em .2em .4em .4em; -} -.CodeMirror-lines { - padding: .4em; -} - -.CodeMirror pre { - -moz-border-radius: 0; - -webkit-border-radius: 0; - -o-border-radius: 0; - border-radius: 0; - border-width: 0; margin: 0; padding: 0; background: transparent; - font-family: inherit; - font-size: inherit; - padding: 0; margin: 0; - white-space: pre; - word-wrap: normal; -} - -.CodeMirror textarea { - font-family: inherit !important; - font-size: inherit !important; -} - -.CodeMirror-cursor { - z-index: 10; - position: absolute; - visibility: hidden; - border-left: 1px solid black !important; -} -.CodeMirror-focused .CodeMirror-cursor { - visibility: visible; -} - -span.CodeMirror-selected { - background: #ccc !important; - color: HighlightText !important; -} -.CodeMirror-focused span.CodeMirror-selected { - background: Highlight !important; -} - -.CodeMirror-matchingbracket {color: #0f0 !important;} -.CodeMirror-nonmatchingbracket {color: #f22 !important;} diff --git a/src/codemirror/lib/codemirror.js b/src/codemirror/lib/codemirror.js deleted file mode 100755 index d6fd586..0000000 --- a/src/codemirror/lib/codemirror.js +++ /dev/null @@ -1,2197 +0,0 @@ -// All functions that need access to the editor's state live inside -// the CodeMirror function. Below that, at the bottom of the file, -// some utilities are defined. - -// CodeMirror is the only global var we claim -var CodeMirror = (function() { - // This is the function that produces an editor instance. It's - // closure is used to store the editor state. - function CodeMirror(place, givenOptions) { - // Determine effective options based on given values and defaults. - var options = {}, defaults = CodeMirror.defaults; - for (var opt in defaults) - if (defaults.hasOwnProperty(opt)) - options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt]; - - var targetDocument = options["document"]; - // The element in which the editor lives. - var wrapper = targetDocument.createElement("div"); - wrapper.className = "CodeMirror"; - // This mess creates the base DOM structure for the editor. - wrapper.innerHTML = - '
' + // Wraps and hides input textarea - '
' + - '
' + - '
' + // Set to the height of the text, causes scrolling - '
' + - '
' + // Moved around its parent to cover visible view - '
' + - // Provides positioning relative to (visible) text origin - '
' + - '
 
' + // Absolutely positioned blinky cursor - '
' + // This DIV contains the actual code - '
'; - if (place.appendChild) place.appendChild(wrapper); else place(wrapper); - // I've never seen more elegant code in my life. - var inputDiv = wrapper.firstChild, input = inputDiv.firstChild, - scroller = wrapper.lastChild, code = scroller.firstChild, - measure = code.firstChild, mover = measure.nextSibling, - gutter = mover.firstChild, gutterText = gutter.firstChild, - lineSpace = gutter.nextSibling.firstChild, - cursor = lineSpace.firstChild, lineDiv = cursor.nextSibling; - if (options.tabindex != null) input.tabindex = options.tabindex; - if (!options.gutter && !options.lineNumbers) gutter.style.display = "none"; - - // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval. - var poll = new Delayed(), highlight = new Delayed(), blinker; - - // mode holds a mode API object. lines an array of Line objects - // (see Line constructor), work an array of lines that should be - // parsed, and history the undo history (instance of History - // constructor). - var mode, lines = [new Line("")], work, history = new History(), focused; - loadMode(); - // The selection. These are always maintained to point at valid - // positions. Inverted is used to remember that the user is - // selecting bottom-to-top. - var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false}; - // Selection-related flags. shiftSelecting obviously tracks - // whether the user is holding shift. reducedSelection is a hack - // to get around the fact that we can't create inverted - // selections. See below. - var shiftSelecting, reducedSelection, lastClick, lastDoubleClick; - // Variables used by startOperation/endOperation to track what - // happened during the operation. - var updateInput, changes, textChanged, selectionChanged, leaveInputAlone, gutterDirty; - // Current visible range (may be bigger than the view window). - var showingFrom = 0, showingTo = 0, lastHeight = 0, curKeyId = null; - // editing will hold an object describing the things we put in the - // textarea, to help figure out whether something changed. - // bracketHighlighted is used to remember that a backet has been - // marked. - var editing, bracketHighlighted; - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - var maxLine = "", maxWidth; - - // Initialize the content. - operation(function(){setValue(options.value || ""); updateInput = false;})(); - - // Register our event handlers. - connect(scroller, "mousedown", operation(onMouseDown)); - connect(lineSpace, "dragstart", onDragStart); - // Gecko browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for Gecko. - if (!gecko) connect(scroller, "contextmenu", onContextMenu); - connect(scroller, "scroll", function() { - updateDisplay([]); - if (options.fixedGutter) gutter.style.left = scroller.scrollLeft + "px"; - if (options.onScroll) options.onScroll(instance); - }); - connect(window, "resize", function() {updateDisplay(true);}); - connect(input, "keyup", operation(onKeyUp)); - connect(input, "keydown", operation(onKeyDown)); - connect(input, "keypress", operation(onKeyPress)); - connect(input, "focus", onFocus); - connect(input, "blur", onBlur); - - connect(scroller, "dragenter", e_stop); - connect(scroller, "dragover", e_stop); - connect(scroller, "drop", operation(onDrop)); - connect(scroller, "paste", function(){focusInput(); fastPoll();}); - connect(input, "paste", function(){fastPoll();}); - connect(input, "cut", function(){fastPoll();}); - - // IE throws unspecified error in certain cases, when - // trying to access activeElement before onload - var hasFocus; try { hasFocus = (targetDocument.activeElement == input); } catch(e) { } - if (hasFocus) setTimeout(onFocus, 20); - else onBlur(); - - function isLine(l) {return l >= 0 && l < lines.length;} - // The instance object that we'll return. Mostly calls out to - // local functions in the CodeMirror function. Some do some extra - // range checking and/or clipping. operation is used to wrap the - // call so that changes it makes are tracked, and the display is - // updated afterwards. - var instance = wrapper.CodeMirror = { - getValue: getValue, - setValue: operation(setValue), - getSelection: getSelection, - replaceSelection: operation(replaceSelection), - focus: function(){focusInput(); onFocus(); fastPoll();}, - setOption: function(option, value) { - options[option] = value; - if (option == "lineNumbers" || option == "gutter" || option == "firstLineNumber") - operation(gutterChanged)(); - else if (option == "mode" || option == "indentUnit") loadMode(); - else if (option == "readOnly" && value == "nocursor") input.blur(); - else if (option == "theme") scroller.className = scroller.className.replace(/cm-s-\w+/, "cm-s-" + value); - }, - getOption: function(option) {return options[option];}, - undo: operation(undo), - redo: operation(redo), - indentLine: operation(function(n, dir) { - if (isLine(n)) indentLine(n, dir == null ? "smart" : dir ? "add" : "subtract"); - }), - historySize: function() {return {undo: history.done.length, redo: history.undone.length};}, - matchBrackets: operation(function(){matchBrackets(true);}), - getTokenAt: function(pos) { - pos = clipPos(pos); - return lines[pos.line].getTokenAt(mode, getStateBefore(pos.line), pos.ch); - }, - getStateAfter: function(line) { - line = clipLine(line == null ? lines.length - 1: line); - return getStateBefore(line + 1); - }, - cursorCoords: function(start){ - if (start == null) start = sel.inverted; - return pageCoords(start ? sel.from : sel.to); - }, - charCoords: function(pos){return pageCoords(clipPos(pos));}, - coordsChar: function(coords) { - var off = eltOffset(lineSpace); - var line = clipLine(Math.min(lines.length - 1, showingFrom + Math.floor((coords.y - off.top) / lineHeight()))); - return clipPos({line: line, ch: charFromX(clipLine(line), coords.x - off.left)}); - }, - getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);}, - markText: operation(function(a, b, c){return operation(markText(a, b, c));}), - setMarker: operation(addGutterMarker), - clearMarker: operation(removeGutterMarker), - setLineClass: operation(setLineClass), - lineInfo: lineInfo, - addWidget: function(pos, node, scroll, vert, horiz) { - pos = localCoords(clipPos(pos)); - var top = pos.yBot, left = pos.x; - node.style.position = "absolute"; - code.appendChild(node); - if (vert == "over") top = pos.y; - else if (vert == "near") { - var vspace = Math.max(scroller.offsetHeight, lines.length * lineHeight()), - hspace = Math.max(code.clientWidth, lineSpace.clientWidth) - paddingLeft(); - if (pos.yBot + node.offsetHeight > vspace && pos.y > node.offsetHeight) - top = pos.y - node.offsetHeight; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = (top + paddingTop()) + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = code.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (code.clientWidth - node.offsetWidth) / 2; - node.style.left = (left + paddingLeft()) + "px"; - } - if (scroll) - scrollIntoView(left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - lineCount: function() {return lines.length;}, - getCursor: function(start) { - if (start == null) start = sel.inverted; - return copyPos(start ? sel.from : sel.to); - }, - somethingSelected: function() {return !posEq(sel.from, sel.to);}, - setCursor: operation(function(line, ch) { - if (ch == null && typeof line.line == "number") setCursor(line.line, line.ch); - else setCursor(line, ch); - }), - setSelection: operation(function(from, to) {setSelection(clipPos(from), clipPos(to || from));}), - getLine: function(line) {if (isLine(line)) return lines[line].text;}, - setLine: operation(function(line, text) { - if (isLine(line)) replaceRange(text, {line: line, ch: 0}, {line: line, ch: lines[line].text.length}); - }), - removeLine: operation(function(line) { - if (isLine(line)) replaceRange("", {line: line, ch: 0}, clipPos({line: line+1, ch: 0})); - }), - replaceRange: operation(replaceRange), - getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));}, - - operation: function(f){return operation(f)();}, - refresh: function(){updateDisplay(true);}, - getInputField: function(){return input;}, - getWrapperElement: function(){return wrapper;}, - getScrollerElement: function(){return scroller;}, - getGutterElement: function(){return gutter;} - }; - - function setValue(code) { - history = null; - var top = {line: 0, ch: 0}; - updateLines(top, {line: lines.length - 1, ch: lines[lines.length-1].text.length}, - splitLines(code), top, top); - history = new History(); - updateInput = true; - } - function getValue(code) { - var text = []; - for (var i = 0, l = lines.length; i < l; ++i) - text.push(lines[i].text); - return text.join("\n"); - } - - function onMouseDown(e) { - // Check whether this is a click in a widget - for (var n = e_target(e); n != wrapper; n = n.parentNode) - if (n.parentNode == code && n != mover) return; - - // First, see if this is a click in the gutter - for (var n = e_target(e); n != wrapper; n = n.parentNode) - if (n.parentNode == gutterText) { - if (options.onGutterClick) - options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom, e); - return e_preventDefault(e); - } - - var start = posFromMouse(e); - - switch (e_button(e)) { - case 3: - if (gecko && !mac) onContextMenu(e); - return; - case 2: - if (start) setCursor(start.line, start.ch, true); - return; - } - // For button 1, if it was clicked inside the editor - // (posFromMouse returning non-null), we have to adjust the - // selection. - if (!start) {if (e_target(e) == scroller) e_preventDefault(e); return;} - - if (!focused) onFocus(); - - var now = +new Date; - if (lastDoubleClick > now - 400) { - e_preventDefault(e); - return selectLine(start.line); - } else if (lastClick > now - 400) { - lastDoubleClick = now; - e_preventDefault(e); - return selectWordAt(start); - } else { lastClick = now; } - - var last = start, going; - if (dragAndDrop && !posEq(sel.from, sel.to) && - !posLess(start, sel.from) && !posLess(sel.to, start)) { - // Let the drag handler handle this. - return; - } - e_preventDefault(e); - setCursor(start.line, start.ch, true); - - function extend(e) { - var cur = posFromMouse(e, true); - if (cur && !posEq(cur, last)) { - if (!focused) onFocus(); - last = cur; - setSelectionUser(start, cur); - updateInput = false; - var visible = visibleLines(); - if (cur.line >= visible.to || cur.line < visible.from) - going = setTimeout(operation(function(){extend(e);}), 150); - } - } - - var move = connect(targetDocument, "mousemove", operation(function(e) { - clearTimeout(going); - e_preventDefault(e); - extend(e); - }), true); - var up = connect(targetDocument, "mouseup", operation(function(e) { - clearTimeout(going); - var cur = posFromMouse(e); - if (cur) setSelectionUser(start, cur); - e_preventDefault(e); - focusInput(); - updateInput = true; - move(); up(); - }), true); - } - function onDrop(e) { - e.preventDefault(); - var pos = posFromMouse(e, true), files = e.dataTransfer.files; - if (!pos || options.readOnly) return; - if (files && files.length && window.FileReader && window.File) { - function loadFile(file, i) { - var reader = new FileReader; - reader.onload = function() { - text[i] = reader.result; - if (++read == n) replaceRange(text.join(""), clipPos(pos), clipPos(pos)); - }; - reader.readAsText(file); - } - var n = files.length, text = Array(n), read = 0; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } - else { - try { - var text = e.dataTransfer.getData("Text"); - if (text) replaceRange(text, pos, pos); - } - catch(e){} - } - } - function onDragStart(e) { - var txt = getSelection(); - // This will reset escapeElement - htmlEscape(txt); - e.dataTransfer.setDragImage(escapeElement, 0, 0); - e.dataTransfer.setData("Text", txt); - } - function onKeyDown(e) { - if (!focused) onFocus(); - - var code = e.keyCode; - // IE does strange things with escape. - if (ie && code == 27) { e.returnValue = false; } - // Tries to detect ctrl on non-mac, cmd on mac. - var mod = (mac ? e.metaKey : e.ctrlKey) && !e.altKey, anyMod = e.ctrlKey || e.altKey || e.metaKey; - if (code == 16 || e.shiftKey) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from); - else shiftSelecting = null; - // First give onKeyEvent option a chance to handle this. - if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; - - if (code == 33 || code == 34) {scrollPage(code == 34); return e_preventDefault(e);} // page up/down - if (mod && ((code == 36 || code == 35) || // ctrl-home/end - mac && (code == 38 || code == 40))) { // cmd-up/down - scrollEnd(code == 36 || code == 38); return e_preventDefault(e); - } - if (mod && code == 65) {selectAll(); return e_preventDefault(e);} // ctrl-a - if (!options.readOnly) { - if (!anyMod && code == 13) {return;} // enter - if (!anyMod && code == 9 && handleTab(e.shiftKey)) return e_preventDefault(e); // tab - if (mod && code == 90) {undo(); return e_preventDefault(e);} // ctrl-z - if (mod && ((e.shiftKey && code == 90) || code == 89)) {redo(); return e_preventDefault(e);} // ctrl-shift-z, ctrl-y - } - if (code == 36) { if (options.smartHome) { smartHome(); return e_preventDefault(e); } } - - // Key id to use in the movementKeys map. We also pass it to - // fastPoll in order to 'self learn'. We need this because - // reducedSelection, the hack where we collapse the selection to - // its start when it is inverted and a movement key is pressed - // (and later restore it again), shouldn't be used for - // non-movement keys. - curKeyId = (mod ? "c" : "") + (e.altKey ? "a" : "") + code; - if (sel.inverted && movementKeys[curKeyId] === true) { - var range = selRange(input); - if (range) { - reducedSelection = {anchor: range.start}; - setSelRange(input, range.start, range.start); - } - } - // Don't save the key as a movementkey unless it had a modifier - if (!mod && !e.altKey) curKeyId = null; - fastPoll(curKeyId); - } - function onKeyUp(e) { - if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; - if (reducedSelection) { - reducedSelection = null; - updateInput = true; - } - if (e.keyCode == 16) shiftSelecting = null; - } - function onKeyPress(e) { - if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; - if (options.electricChars && mode.electricChars) { - var ch = String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode); - if (mode.electricChars.indexOf(ch) > -1) - setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 50); - } - var code = e.keyCode; - // Re-stop tab and enter. Necessary on some browsers. - if (code == 13) {if (!options.readOnly) handleEnter(); e_preventDefault(e);} - else if (!e.ctrlKey && !e.altKey && !e.metaKey && code == 9 && options.tabMode != "default") e_preventDefault(e); - else fastPoll(curKeyId); - } - - function onFocus() { - if (options.readOnly == "nocursor") return; - if (!focused) { - if (options.onFocus) options.onFocus(instance); - focused = true; - if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1) - wrapper.className += " CodeMirror-focused"; - if (!leaveInputAlone) prepareInput(); - } - slowPoll(); - restartBlink(); - } - function onBlur() { - if (focused) { - if (options.onBlur) options.onBlur(instance); - focused = false; - wrapper.className = wrapper.className.replace(" CodeMirror-focused", ""); - } - clearInterval(blinker); - setTimeout(function() {if (!focused) shiftSelecting = null;}, 150); - } - - // Replace the range from from to to by the strings in newText. - // Afterwards, set the selection to selFrom, selTo. - function updateLines(from, to, newText, selFrom, selTo) { - if (history) { - var old = []; - for (var i = from.line, e = to.line + 1; i < e; ++i) old.push(lines[i].text); - history.addChange(from.line, newText.length, old); - while (history.done.length > options.undoDepth) history.done.shift(); - } - updateLinesNoUndo(from, to, newText, selFrom, selTo); - } - function unredoHelper(from, to) { - var change = from.pop(); - if (change) { - var replaced = [], end = change.start + change.added; - for (var i = change.start; i < end; ++i) replaced.push(lines[i].text); - to.push({start: change.start, added: change.old.length, old: replaced}); - var pos = clipPos({line: change.start + change.old.length - 1, - ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])}); - updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: lines[end-1].text.length}, change.old, pos, pos); - updateInput = true; - } - } - function undo() {unredoHelper(history.done, history.undone);} - function redo() {unredoHelper(history.undone, history.done);} - - function updateLinesNoUndo(from, to, newText, selFrom, selTo) { - var recomputeMaxLength = false, maxLineLength = maxLine.length; - for (var i = from.line; i <= to.line; ++i) { - if (lines[i].text.length == maxLineLength) {recomputeMaxLength = true; break;} - } - - var nlines = to.line - from.line, firstLine = lines[from.line], lastLine = lines[to.line]; - // First adjust the line structure, taking some care to leave highlighting intact. - if (firstLine == lastLine) { - if (newText.length == 1) - firstLine.replace(from.ch, to.ch, newText[0]); - else { - lastLine = firstLine.split(to.ch, newText[newText.length-1]); - var spliceargs = [from.line + 1, nlines]; - firstLine.replace(from.ch, firstLine.text.length, newText[0]); - for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i])); - spliceargs.push(lastLine); - lines.splice.apply(lines, spliceargs); - } - } - else if (newText.length == 1) { - firstLine.replace(from.ch, firstLine.text.length, newText[0] + lastLine.text.slice(to.ch)); - lines.splice(from.line + 1, nlines); - } - else { - var spliceargs = [from.line + 1, nlines - 1]; - firstLine.replace(from.ch, firstLine.text.length, newText[0]); - lastLine.replace(0, to.ch, newText[newText.length-1]); - for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i])); - lines.splice.apply(lines, spliceargs); - } - - - for (var i = from.line, e = i + newText.length; i < e; ++i) { - var l = lines[i].text; - if (l.length > maxLineLength) { - maxLine = l; maxLineLength = l.length; maxWidth = null; - recomputeMaxLength = false; - } - } - if (recomputeMaxLength) { - maxLineLength = 0; maxLine = ""; maxWidth = null; - for (var i = 0, e = lines.length; i < e; ++i) { - var l = lines[i].text; - if (l.length > maxLineLength) { - maxLineLength = l.length; maxLine = l; - } - } - } - - // Add these lines to the work array, so that they will be - // highlighted. Adjust work lines if lines were added/removed. - var newWork = [], lendiff = newText.length - nlines - 1; - for (var i = 0, l = work.length; i < l; ++i) { - var task = work[i]; - if (task < from.line) newWork.push(task); - else if (task > to.line) newWork.push(task + lendiff); - } - if (newText.length < 5) { - highlightLines(from.line, from.line + newText.length); - newWork.push(from.line + newText.length); - } else { - newWork.push(from.line); - } - work = newWork; - startWorker(100); - // Remember that these lines changed, for updating the display - changes.push({from: from.line, to: to.line + 1, diff: lendiff}); - textChanged = {from: from, to: to, text: newText}; - - // Update the selection - function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;} - setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line)); - - // Make sure the scroll-size div has the correct height. - code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px"; - } - - function replaceRange(code, from, to) { - from = clipPos(from); - if (!to) to = from; else to = clipPos(to); - code = splitLines(code); - function adjustPos(pos) { - if (posLess(pos, from)) return pos; - if (!posLess(to, pos)) return end; - var line = pos.line + code.length - (to.line - from.line) - 1; - var ch = pos.ch; - if (pos.line == to.line) - ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0)); - return {line: line, ch: ch}; - } - var end; - replaceRange1(code, from, to, function(end1) { - end = end1; - return {from: adjustPos(sel.from), to: adjustPos(sel.to)}; - }); - return end; - } - function replaceSelection(code, collapse) { - replaceRange1(splitLines(code), sel.from, sel.to, function(end) { - if (collapse == "end") return {from: end, to: end}; - else if (collapse == "start") return {from: sel.from, to: sel.from}; - else return {from: sel.from, to: end}; - }); - } - function replaceRange1(code, from, to, computeSel) { - var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length; - var newSel = computeSel({line: from.line + code.length - 1, ch: endch}); - updateLines(from, to, code, newSel.from, newSel.to); - } - - function getRange(from, to) { - var l1 = from.line, l2 = to.line; - if (l1 == l2) return lines[l1].text.slice(from.ch, to.ch); - var code = [lines[l1].text.slice(from.ch)]; - for (var i = l1 + 1; i < l2; ++i) code.push(lines[i].text); - code.push(lines[l2].text.slice(0, to.ch)); - return code.join("\n"); - } - function getSelection() { - return getRange(sel.from, sel.to); - } - - var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll - function slowPoll() { - if (pollingFast) return; - poll.set(2000, function() { - startOperation(); - readInput(); - if (focused) slowPoll(); - endOperation(); - }); - } - function fastPoll(keyId) { - var missed = false; - pollingFast = true; - function p() { - startOperation(); - var changed = readInput(); - if (changed && keyId) { - if (changed == "moved" && movementKeys[keyId] == null) movementKeys[keyId] = true; - if (changed == "changed") movementKeys[keyId] = false; - } - if (!changed && !missed) {missed = true; poll.set(80, p);} - else {pollingFast = false; slowPoll();} - endOperation(); - } - poll.set(20, p); - } - - // Inspects the textarea, compares its state (content, selection) - // to the data in the editing variable, and updates the editor - // content or cursor if something changed. - function readInput() { - if (leaveInputAlone || !focused) return; - var changed = false, text = input.value, sr = selRange(input); - if (!sr) return false; - var changed = editing.text != text, rs = reducedSelection; - var moved = changed || sr.start != editing.start || sr.end != (rs ? editing.start : editing.end); - if (!moved && !rs) return false; - if (changed) { - shiftSelecting = reducedSelection = null; - if (options.readOnly) {updateInput = true; return "changed";} - } - - // Compute selection start and end based on start/end offsets in textarea - function computeOffset(n, startLine) { - var pos = 0; - for (;;) { - var found = text.indexOf("\n", pos); - if (found == -1 || (text.charAt(found-1) == "\r" ? found - 1 : found) >= n) - return {line: startLine, ch: n - pos}; - ++startLine; - pos = found + 1; - } - } - var from = computeOffset(sr.start, editing.from), - to = computeOffset(sr.end, editing.from); - // Here we have to take the reducedSelection hack into account, - // so that you can, for example, press shift-up at the start of - // your selection and have the right thing happen. - if (rs) { - var head = sr.start == rs.anchor ? to : from; - var tail = shiftSelecting ? sel.to : sr.start == rs.anchor ? from : to; - if (sel.inverted = posLess(head, tail)) { from = head; to = tail; } - else { reducedSelection = null; from = tail; to = head; } - } - - // In some cases (cursor on same line as before), we don't have - // to update the textarea content at all. - if (from.line == to.line && from.line == sel.from.line && from.line == sel.to.line && !shiftSelecting) - updateInput = false; - - // Magic mess to extract precise edited range from the changed - // string. - if (changed) { - var start = 0, end = text.length, len = Math.min(end, editing.text.length); - var c, line = editing.from, nl = -1; - while (start < len && (c = text.charAt(start)) == editing.text.charAt(start)) { - ++start; - if (c == "\n") {line++; nl = start;} - } - var ch = nl > -1 ? start - nl : start, endline = editing.to - 1, edend = editing.text.length; - for (;;) { - c = editing.text.charAt(edend); - if (text.charAt(end) != c) {++end; ++edend; break;} - if (c == "\n") endline--; - if (edend <= start || end <= start) break; - --end; --edend; - } - var nl = editing.text.lastIndexOf("\n", edend - 1), endch = nl == -1 ? edend : edend - nl - 1; - updateLines({line: line, ch: ch}, {line: endline, ch: endch}, splitLines(text.slice(start, end)), from, to); - if (line != endline || from.line != line) updateInput = true; - } - else setSelection(from, to); - - editing.text = text; editing.start = sr.start; editing.end = sr.end; - return changed ? "changed" : moved ? "moved" : false; - } - - // Set the textarea content and selection range to match the - // editor state. - function prepareInput() { - var text = []; - var from = Math.max(0, sel.from.line - 1), to = Math.min(lines.length, sel.to.line + 2); - for (var i = from; i < to; ++i) text.push(lines[i].text); - text = input.value = text.join(lineSep); - var startch = sel.from.ch, endch = sel.to.ch; - for (var i = from; i < sel.from.line; ++i) - startch += lineSep.length + lines[i].text.length; - for (var i = from; i < sel.to.line; ++i) - endch += lineSep.length + lines[i].text.length; - editing = {text: text, from: from, to: to, start: startch, end: endch}; - setSelRange(input, startch, reducedSelection ? startch : endch); - } - function focusInput() { - if (options.readOnly != "nocursor") input.focus(); - } - - function scrollEditorIntoView() { - if (!cursor.getBoundingClientRect) return; - var rect = cursor.getBoundingClientRect(); - var winH = window.innerHeight || document.body.offsetHeight || document.documentElement.offsetHeight; - if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView(); - } - function scrollCursorIntoView() { - var cursor = localCoords(sel.inverted ? sel.from : sel.to); - return scrollIntoView(cursor.x, cursor.y, cursor.x, cursor.yBot); - } - function scrollIntoView(x1, y1, x2, y2) { - var pl = paddingLeft(), pt = paddingTop(), lh = lineHeight(); - y1 += pt; y2 += pt; x1 += pl; x2 += pl; - var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true; - if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1 - 2*lh); scrolled = true;} - else if (y2 > screentop + screen) {scroller.scrollTop = y2 + lh - screen; scrolled = true;} - - var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft; - var gutterw = options.fixedGutter ? gutter.clientWidth : 0; - if (x1 < screenleft + gutterw) { - if (x1 < 50) x1 = 0; - scroller.scrollLeft = Math.max(0, x1 - 10 - gutterw); - scrolled = true; - } - else if (x2 > screenw + screenleft) { - scroller.scrollLeft = x2 + 10 - screenw; - scrolled = true; - if (x2 > code.clientWidth) result = false; - } - if (scrolled && options.onScroll) options.onScroll(instance); - return result; - } - - function visibleLines() { - var lh = lineHeight(), top = scroller.scrollTop - paddingTop(); - return {from: Math.min(lines.length, Math.max(0, Math.floor(top / lh))), - to: Math.min(lines.length, Math.ceil((top + scroller.clientHeight) / lh))}; - } - // Uses a set of changes plus the current scroll position to - // determine which DOM updates have to be made, and makes the - // updates. - function updateDisplay(changes) { - if (!scroller.clientWidth) { - showingFrom = showingTo = 0; - return; - } - // First create a range of theoretically intact lines, and punch - // holes in that using the change info. - var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}]; - for (var i = 0, l = changes.length || 0; i < l; ++i) { - var change = changes[i], intact2 = [], diff = change.diff || 0; - for (var j = 0, l2 = intact.length; j < l2; ++j) { - var range = intact[j]; - if (change.to <= range.from) - intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart}); - else if (range.to <= change.from) - intact2.push(range); - else { - if (change.from > range.from) - intact2.push({from: range.from, to: change.from, domStart: range.domStart}); - if (change.to < range.to) - intact2.push({from: change.to + diff, to: range.to + diff, - domStart: range.domStart + (change.to - range.from)}); - } - } - intact = intact2; - } - - // Then, determine which lines we'd want to see, and which - // updates have to be made to get there. - var visible = visibleLines(); - var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)), - to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)), - updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0; - - for (var i = 0, l = intact.length; i < l; ++i) { - var range = intact[i]; - if (range.to <= from) continue; - if (range.from >= to) break; - if (range.domStart > domPos || range.from > pos) { - updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos}); - changedLines += range.from - pos; - } - pos = range.to; - domPos = range.domStart + (range.to - range.from); - } - if (domPos != domEnd || pos != to) { - changedLines += Math.abs(to - pos); - updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos}); - if (to - pos != domEnd - domPos) gutterDirty = true; - } - - if (!updates.length) return; - lineDiv.style.display = "none"; - // If more than 30% of the screen needs update, just do a full - // redraw (which is quicker than patching) - if (changedLines > (visible.to - visible.from) * .3) - refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length)); - // Otherwise, only update the stuff that needs updating. - else - patchDisplay(updates); - lineDiv.style.display = ""; - - // Position the mover div to align with the lines it's supposed - // to be showing (which will cover the visible display) - var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight; - showingFrom = from; showingTo = to; - mover.style.top = (from * lineHeight()) + "px"; - if (different) { - lastHeight = scroller.clientHeight; - code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px"; - } - if (different || gutterDirty) updateGutter(); - - if (maxWidth == null) maxWidth = stringWidth(maxLine); - if (maxWidth > scroller.clientWidth) { - lineSpace.style.width = maxWidth + "px"; - // Needed to prevent odd wrapping/hiding of widgets placed in here. - code.style.width = ""; - code.style.width = scroller.scrollWidth + "px"; - } else { - lineSpace.style.width = code.style.width = ""; - } - - // Since this is all rather error prone, it is honoured with the - // only assertion in the whole file. - if (lineDiv.childNodes.length != showingTo - showingFrom) - throw new Error("BAD PATCH! " + JSON.stringify(updates) + " size=" + (showingTo - showingFrom) + - " nodes=" + lineDiv.childNodes.length); - updateCursor(); - } - - function refreshDisplay(from, to) { - var html = [], start = {line: from, ch: 0}, inSel = posLess(sel.from, start) && !posLess(sel.to, start); - for (var i = from; i < to; ++i) { - var ch1 = null, ch2 = null; - if (inSel) { - ch1 = 0; - if (sel.to.line == i) {inSel = false; ch2 = sel.to.ch;} - } - else if (sel.from.line == i) { - if (sel.to.line == i) {ch1 = sel.from.ch; ch2 = sel.to.ch;} - else {inSel = true; ch1 = sel.from.ch;} - } - html.push(lines[i].getHTML(ch1, ch2, true)); - } - lineDiv.innerHTML = html.join(""); - } - function patchDisplay(updates) { - // Slightly different algorithm for IE (badInnerHTML), since - // there .innerHTML on PRE nodes is dumb, and discards - // whitespace. - var sfrom = sel.from.line, sto = sel.to.line, off = 0, - scratch = badInnerHTML && targetDocument.createElement("div"); - for (var i = 0, e = updates.length; i < e; ++i) { - var rec = updates[i]; - var extra = (rec.to - rec.from) - rec.domSize; - var nodeAfter = lineDiv.childNodes[rec.domStart + rec.domSize + off] || null; - if (badInnerHTML) - for (var j = Math.max(-extra, rec.domSize); j > 0; --j) - lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild); - else if (extra) { - for (var j = Math.max(0, extra); j > 0; --j) - lineDiv.insertBefore(targetDocument.createElement("pre"), nodeAfter); - for (var j = Math.max(0, -extra); j > 0; --j) - lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild); - } - var node = lineDiv.childNodes[rec.domStart + off], inSel = sfrom < rec.from && sto >= rec.from; - for (var j = rec.from; j < rec.to; ++j) { - var ch1 = null, ch2 = null; - if (inSel) { - ch1 = 0; - if (sto == j) {inSel = false; ch2 = sel.to.ch;} - } - else if (sfrom == j) { - if (sto == j) {ch1 = sel.from.ch; ch2 = sel.to.ch;} - else {inSel = true; ch1 = sel.from.ch;} - } - if (badInnerHTML) { - scratch.innerHTML = lines[j].getHTML(ch1, ch2, true); - lineDiv.insertBefore(scratch.firstChild, nodeAfter); - } - else { - node.innerHTML = lines[j].getHTML(ch1, ch2, false); - node.className = lines[j].className || ""; - node = node.nextSibling; - } - } - off += extra; - } - } - - function updateGutter() { - if (!options.gutter && !options.lineNumbers) return; - var hText = mover.offsetHeight, hEditor = scroller.clientHeight; - gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px"; - var html = []; - for (var i = showingFrom; i < Math.max(showingTo, showingFrom + 1); ++i) { - var marker = lines[i].gutterMarker; - var text = options.lineNumbers ? i + options.firstLineNumber : null; - if (marker && marker.text) - text = marker.text.replace("%N%", text != null ? text : ""); - else if (text == null) - text = "\u00a0"; - html.push((marker && marker.style ? '
' : "
"), text, "
"); - } - gutter.style.display = "none"; - gutterText.innerHTML = html.join(""); - var minwidth = String(lines.length).length, firstNode = gutterText.firstChild, val = eltText(firstNode), pad = ""; - while (val.length + pad.length < minwidth) pad += "\u00a0"; - if (pad) firstNode.insertBefore(targetDocument.createTextNode(pad), firstNode.firstChild); - gutter.style.display = ""; - lineSpace.style.marginLeft = gutter.offsetWidth + "px"; - gutterDirty = false; - } - function updateCursor() { - var head = sel.inverted ? sel.from : sel.to, lh = lineHeight(); - var x = charX(head.line, head.ch); - var top = head.line * lh - scroller.scrollTop; - inputDiv.style.top = Math.max(Math.min(top, scroller.offsetHeight), 0) + "px"; - inputDiv.style.left = (x - scroller.scrollLeft) + "px"; - if (posEq(sel.from, sel.to)) { - cursor.style.top = (head.line - showingFrom) * lh + "px"; - cursor.style.left = x + "px"; - cursor.style.display = ""; - } - else cursor.style.display = "none"; - } - - function setSelectionUser(from, to) { - var sh = shiftSelecting && clipPos(shiftSelecting); - if (sh) { - if (posLess(sh, from)) from = sh; - else if (posLess(to, sh)) to = sh; - } - setSelection(from, to); - } - // Update the selection. Last two args are only used by - // updateLines, since they have to be expressed in the line - // numbers before the update. - function setSelection(from, to, oldFrom, oldTo) { - if (posEq(sel.from, from) && posEq(sel.to, to)) return; - if (posLess(to, from)) {var tmp = to; to = from; from = tmp;} - - if (posEq(from, to)) sel.inverted = false; - else if (posEq(from, sel.to)) sel.inverted = false; - else if (posEq(to, sel.from)) sel.inverted = true; - - // Some ugly logic used to only mark the lines that actually did - // see a change in selection as changed, rather than the whole - // selected range. - if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;} - if (posEq(from, to)) { - if (!posEq(sel.from, sel.to)) - changes.push({from: oldFrom, to: oldTo + 1}); - } - else if (posEq(sel.from, sel.to)) { - changes.push({from: from.line, to: to.line + 1}); - } - else { - if (!posEq(from, sel.from)) { - if (from.line < oldFrom) - changes.push({from: from.line, to: Math.min(to.line, oldFrom) + 1}); - else - changes.push({from: oldFrom, to: Math.min(oldTo, from.line) + 1}); - } - if (!posEq(to, sel.to)) { - if (to.line < oldTo) - changes.push({from: Math.max(oldFrom, from.line), to: oldTo + 1}); - else - changes.push({from: Math.max(from.line, oldTo), to: to.line + 1}); - } - } - sel.from = from; sel.to = to; - selectionChanged = true; - } - function setCursor(line, ch, user) { - var pos = clipPos({line: line, ch: ch || 0}); - (user ? setSelectionUser : setSelection)(pos, pos); - } - - function clipLine(n) {return Math.max(0, Math.min(n, lines.length-1));} - function clipPos(pos) { - if (pos.line < 0) return {line: 0, ch: 0}; - if (pos.line >= lines.length) return {line: lines.length-1, ch: lines[lines.length-1].text.length}; - var ch = pos.ch, linelen = lines[pos.line].text.length; - if (ch == null || ch > linelen) return {line: pos.line, ch: linelen}; - else if (ch < 0) return {line: pos.line, ch: 0}; - else return pos; - } - - function scrollPage(down) { - var linesPerPage = Math.floor(scroller.clientHeight / lineHeight()), head = sel.inverted ? sel.from : sel.to; - setCursor(head.line + (Math.max(linesPerPage - 1, 1) * (down ? 1 : -1)), head.ch, true); - } - function scrollEnd(top) { - var pos = top ? {line: 0, ch: 0} : {line: lines.length - 1, ch: lines[lines.length-1].text.length}; - setSelectionUser(pos, pos); - } - function selectAll() { - var endLine = lines.length - 1; - setSelection({line: 0, ch: 0}, {line: endLine, ch: lines[endLine].text.length}); - } - function selectWordAt(pos) { - var line = lines[pos.line].text; - var start = pos.ch, end = pos.ch; - while (start > 0 && /\w/.test(line.charAt(start - 1))) --start; - while (end < line.length && /\w/.test(line.charAt(end))) ++end; - setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end}); - } - function selectLine(line) { - setSelectionUser({line: line, ch: 0}, {line: line, ch: lines[line].text.length}); - } - function handleEnter() { - replaceSelection("\n", "end"); - if (options.enterMode != "flat") - indentLine(sel.from.line, options.enterMode == "keep" ? "prev" : "smart"); - } - function handleTab(shift) { - function indentSelected(mode) { - if (posEq(sel.from, sel.to)) return indentLine(sel.from.line, mode); - var e = sel.to.line - (sel.to.ch ? 0 : 1); - for (var i = sel.from.line; i <= e; ++i) indentLine(i, mode); - } - shiftSelecting = null; - switch (options.tabMode) { - case "default": - return false; - case "indent": - indentSelected("smart"); - break; - case "classic": - if (posEq(sel.from, sel.to)) { - if (shift) indentLine(sel.from.line, "smart"); - else replaceSelection("\t", "end"); - break; - } - case "shift": - indentSelected(shift ? "subtract" : "add"); - break; - } - return true; - } - function smartHome() { - var firstNonWS = Math.max(0, lines[sel.from.line].text.search(/\S/)); - setCursor(sel.from.line, sel.from.ch <= firstNonWS && sel.from.ch ? 0 : firstNonWS, true); - } - - function indentLine(n, how) { - if (how == "smart") { - if (!mode.indent) how = "prev"; - else var state = getStateBefore(n); - } - - var line = lines[n], curSpace = line.indentation(), curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (how == "prev") { - if (n) indentation = lines[n-1].indentation(); - else indentation = 0; - } - else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length)); - else if (how == "add") indentation = curSpace + options.indentUnit; - else if (how == "subtract") indentation = curSpace - options.indentUnit; - indentation = Math.max(0, indentation); - var diff = indentation - curSpace; - - if (!diff) { - if (sel.from.line != n && sel.to.line != n) return; - var indentString = curSpaceString; - } - else { - var indentString = "", pos = 0; - if (options.indentWithTabs) - for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} - while (pos < indentation) {++pos; indentString += " ";} - } - - replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}); - } - - function loadMode() { - mode = CodeMirror.getMode(options, options.mode); - for (var i = 0, l = lines.length; i < l; ++i) - lines[i].stateAfter = null; - work = [0]; - startWorker(); - } - function gutterChanged() { - var visible = options.gutter || options.lineNumbers; - gutter.style.display = visible ? "" : "none"; - if (visible) gutterDirty = true; - else lineDiv.parentNode.style.marginLeft = 0; - } - - function markText(from, to, className) { - from = clipPos(from); to = clipPos(to); - var accum = []; - function add(line, from, to, className) { - var line = lines[line], mark = line.addMark(from, to, className); - mark.line = line; - accum.push(mark); - } - if (from.line == to.line) add(from.line, from.ch, to.ch, className); - else { - add(from.line, from.ch, null, className); - for (var i = from.line + 1, e = to.line; i < e; ++i) - add(i, 0, null, className); - add(to.line, 0, to.ch, className); - } - changes.push({from: from.line, to: to.line + 1}); - return function() { - var start, end; - for (var i = 0; i < accum.length; ++i) { - var mark = accum[i], found = indexOf(lines, mark.line); - mark.line.removeMark(mark); - if (found > -1) { - if (start == null) start = found; - end = found; - } - } - if (start != null) changes.push({from: start, to: end + 1}); - }; - } - - function addGutterMarker(line, text, className) { - if (typeof line == "number") line = lines[clipLine(line)]; - line.gutterMarker = {text: text, style: className}; - gutterDirty = true; - return line; - } - function removeGutterMarker(line) { - if (typeof line == "number") line = lines[clipLine(line)]; - line.gutterMarker = null; - gutterDirty = true; - } - function setLineClass(line, className) { - if (typeof line == "number") { - var no = line; - line = lines[clipLine(line)]; - } - else { - var no = indexOf(lines, line); - if (no == -1) return null; - } - if (line.className != className) { - line.className = className; - changes.push({from: no, to: no + 1}); - } - return line; - } - - function lineInfo(line) { - if (typeof line == "number") { - var n = line; - line = lines[line]; - if (!line) return null; - } - else { - var n = indexOf(lines, line); - if (n == -1) return null; - } - var marker = line.gutterMarker; - return {line: n, text: line.text, markerText: marker && marker.text, markerClass: marker && marker.style}; - } - - function stringWidth(str) { - measure.innerHTML = "
x
"; - measure.firstChild.firstChild.firstChild.nodeValue = str; - return measure.firstChild.firstChild.offsetWidth || 10; - } - // These are used to go from pixel positions to character - // positions, taking varying character widths into account. - function charX(line, pos) { - if (pos == 0) return 0; - measure.innerHTML = "
" + lines[line].getHTML(null, null, false, pos) + "
"; - return measure.firstChild.firstChild.offsetWidth; - } - function charFromX(line, x) { - if (x <= 0) return 0; - var lineObj = lines[line], text = lineObj.text; - function getX(len) { - measure.innerHTML = "
" + lineObj.getHTML(null, null, false, len) + "
"; - return measure.firstChild.firstChild.offsetWidth; - } - var from = 0, fromX = 0, to = text.length, toX; - // Guess a suitable upper bound for our search. - var estimated = Math.min(to, Math.ceil(x / stringWidth("x"))); - for (;;) { - var estX = getX(estimated); - if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2)); - else {toX = estX; to = estimated; break;} - } - if (x > toX) return to; - // Try to guess a suitable lower bound as well. - estimated = Math.floor(to * 0.8); estX = getX(estimated); - if (estX < x) {from = estimated; fromX = estX;} - // Do a binary search between these bounds. - for (;;) { - if (to - from <= 1) return (toX - x > x - fromX) ? from : to; - var middle = Math.ceil((from + to) / 2), middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX;} - else {from = middle; fromX = middleX;} - } - } - - function localCoords(pos, inLineWrap) { - var lh = lineHeight(), line = pos.line - (inLineWrap ? showingFrom : 0); - return {x: charX(pos.line, pos.ch), y: line * lh, yBot: (line + 1) * lh}; - } - function pageCoords(pos) { - var local = localCoords(pos, true), off = eltOffset(lineSpace); - return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot}; - } - - function lineHeight() { - var nlines = lineDiv.childNodes.length; - if (nlines) return (lineDiv.offsetHeight / nlines) || 1; - measure.innerHTML = "
x
"; - return measure.firstChild.offsetHeight || 1; - } - function paddingTop() {return lineSpace.offsetTop;} - function paddingLeft() {return lineSpace.offsetLeft;} - - function posFromMouse(e, liberal) { - var offW = eltOffset(scroller, true), x, y; - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX; y = e.clientY; } catch (e) { return null; } - // This is a mess of a heuristic to try and determine whether a - // scroll-bar was clicked or not, and to return null if one was - // (and !liberal). - if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight)) - return null; - var offL = eltOffset(lineSpace, true); - var line = showingFrom + Math.floor((y - offL.top) / lineHeight()); - return clipPos({line: line, ch: charFromX(clipLine(line), x - offL.left)}); - } - function onContextMenu(e) { - var pos = posFromMouse(e); - if (!pos || window.opera) return; // Opera is difficult. - if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) - operation(setCursor)(pos.line, pos.ch); - - var oldCSS = input.style.cssText; - inputDiv.style.position = "absolute"; - input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; " + - "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - leaveInputAlone = true; - var val = input.value = getSelection(); - focusInput(); - setSelRange(input, 0, input.value.length); - function rehide() { - var newVal = splitLines(input.value).join("\n"); - if (newVal != val) operation(replaceSelection)(newVal, "end"); - inputDiv.style.position = "relative"; - input.style.cssText = oldCSS; - leaveInputAlone = false; - prepareInput(); - slowPoll(); - } - - if (gecko) { - e_stop(e); - var mouseup = connect(window, "mouseup", function() { - mouseup(); - setTimeout(rehide, 20); - }, true); - } - else { - setTimeout(rehide, 50); - } - } - - // Cursor-blinking - function restartBlink() { - clearInterval(blinker); - var on = true; - cursor.style.visibility = ""; - blinker = setInterval(function() { - cursor.style.visibility = (on = !on) ? "" : "hidden"; - }, 650); - } - - var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - function matchBrackets(autoclear) { - var head = sel.inverted ? sel.from : sel.to, line = lines[head.line], pos = head.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; - if (!match) return; - var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles; - for (var off = pos + 1, i = 0, e = st.length; i < e; i+=2) - if ((off -= st[i].length) <= 0) {var style = st[i+1]; break;} - - var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; - function scan(line, from, to) { - if (!line.text) return; - var st = line.styles, pos = forward ? 0 : line.text.length - 1, cur; - for (var i = forward ? 0 : st.length - 2, e = forward ? st.length : -2; i != e; i += 2*d) { - var text = st[i]; - if (st[i+1] != null && st[i+1] != style) {pos += d * text.length; continue;} - for (var j = forward ? 0 : text.length - 1, te = forward ? text.length : -1; j != te; j += d, pos+=d) { - if (pos >= from && pos < to && re.test(cur = text.charAt(j))) { - var match = matching[cur]; - if (match.charAt(1) == ">" == forward) stack.push(cur); - else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; - else if (!stack.length) return {pos: pos, match: true}; - } - } - } - } - for (var i = head.line, e = forward ? Math.min(i + 100, lines.length) : Math.max(-1, i - 100); i != e; i+=d) { - var line = lines[i], first = i == head.line; - var found = scan(line, first && forward ? pos + 1 : 0, first && !forward ? pos : line.text.length); - if (found) break; - } - if (!found) found = {pos: null, match: false}; - var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style), - two = found.pos != null - ? markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style) - : function() {}; - var clear = operation(function(){one(); two();}); - if (autoclear) setTimeout(clear, 800); - else bracketHighlighted = clear; - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(n) { - var minindent, minline; - for (var search = n, lim = n - 40; search > lim; --search) { - if (search == 0) return 0; - var line = lines[search-1]; - if (line.stateAfter) return search; - var indented = line.indentation(); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - function getStateBefore(n) { - var start = findStartLine(n), state = start && lines[start-1].stateAfter; - if (!state) state = startState(mode); - else state = copyState(mode, state); - for (var i = start; i < n; ++i) { - var line = lines[i]; - line.highlight(mode, state); - line.stateAfter = copyState(mode, state); - } - if (n < lines.length && !lines[n].stateAfter) work.push(n); - return state; - } - function highlightLines(start, end) { - var state = getStateBefore(start); - for (var i = start; i < end; ++i) { - var line = lines[i]; - line.highlight(mode, state); - line.stateAfter = copyState(mode, state); - } - } - function highlightWorker() { - var end = +new Date + options.workTime; - var foundWork = work.length; - while (work.length) { - if (!lines[showingFrom].stateAfter) var task = showingFrom; - else var task = work.pop(); - if (task >= lines.length) continue; - var start = findStartLine(task), state = start && lines[start-1].stateAfter; - if (state) state = copyState(mode, state); - else state = startState(mode); - - var unchanged = 0, compare = mode.compareStates, realChange = false; - for (var i = start, l = lines.length; i < l; ++i) { - var line = lines[i], hadState = line.stateAfter; - if (+new Date > end) { - work.push(i); - startWorker(options.workDelay); - if (realChange) changes.push({from: task, to: i + 1}); - return; - } - var changed = line.highlight(mode, state); - if (changed) realChange = true; - line.stateAfter = copyState(mode, state); - if (compare) { - if (hadState && compare(hadState, state)) break; - } else { - if (changed !== false || !hadState) unchanged = 0; - else if (++unchanged > 3) break; - } - } - if (realChange) changes.push({from: task, to: i + 1}); - } - if (foundWork && options.onHighlightComplete) - options.onHighlightComplete(instance); - } - function startWorker(time) { - if (!work.length) return; - highlight.set(time, operation(highlightWorker)); - } - - // Operations are used to wrap changes in such a way that each - // change won't have to update the cursor and display (which would - // be awkward, slow, and error-prone), but instead updates are - // batched and then all combined and executed at once. - function startOperation() { - updateInput = null; changes = []; textChanged = selectionChanged = false; - } - function endOperation() { - var reScroll = false; - if (selectionChanged) reScroll = !scrollCursorIntoView(); - if (changes.length) updateDisplay(changes); - else { - if (selectionChanged) updateCursor(); - if (gutterDirty) updateGutter(); - } - if (reScroll) scrollCursorIntoView(); - if (selectionChanged) {scrollEditorIntoView(); restartBlink();} - - // updateInput can be set to a boolean value to force/prevent an - // update. - if (focused && !leaveInputAlone && - (updateInput === true || (updateInput !== false && selectionChanged))) - prepareInput(); - - if (selectionChanged && options.matchBrackets) - setTimeout(operation(function() { - if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;} - matchBrackets(false); - }), 20); - var tc = textChanged; // textChanged can be reset by cursoractivity callback - if (selectionChanged && options.onCursorActivity) - options.onCursorActivity(instance); - if (tc && options.onChange && instance) - options.onChange(instance, tc); - } - var nestedOperation = 0; - function operation(f) { - return function() { - if (!nestedOperation++) startOperation(); - try {var result = f.apply(this, arguments);} - finally {if (!--nestedOperation) endOperation();} - return result; - }; - } - - function SearchCursor(query, pos, caseFold) { - this.atOccurrence = false; - if (caseFold == null) caseFold = typeof query == "string" && query == query.toLowerCase(); - - if (pos && typeof pos == "object") pos = clipPos(pos); - else pos = {line: 0, ch: 0}; - this.pos = {from: pos, to: pos}; - - // The matches method is filled in based on the type of query. - // It takes a position and a direction, and returns an object - // describing the next occurrence of the query, or null if no - // more matches were found. - if (typeof query != "string") // Regexp match - this.matches = function(reverse, pos) { - if (reverse) { - var line = lines[pos.line].text.slice(0, pos.ch), match = line.match(query), start = 0; - while (match) { - var ind = line.indexOf(match[0]); - start += ind; - line = line.slice(ind + 1); - var newmatch = line.match(query); - if (newmatch) match = newmatch; - else break; - start++; - } - } - else { - var line = lines[pos.line].text.slice(pos.ch), match = line.match(query), - start = match && pos.ch + line.indexOf(match[0]); - } - if (match) - return {from: {line: pos.line, ch: start}, - to: {line: pos.line, ch: start + match[0].length}, - match: match}; - }; - else { // String query - if (caseFold) query = query.toLowerCase(); - var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;}; - var target = query.split("\n"); - // Different methods for single-line and multi-line queries - if (target.length == 1) - this.matches = function(reverse, pos) { - var line = fold(lines[pos.line].text), len = query.length, match; - if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1) - : (match = line.indexOf(query, pos.ch)) != -1) - return {from: {line: pos.line, ch: match}, - to: {line: pos.line, ch: match + len}}; - }; - else - this.matches = function(reverse, pos) { - var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(lines[ln].text); - var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match)); - if (reverse ? offsetA >= pos.ch || offsetA != match.length - : offsetA <= pos.ch || offsetA != line.length - match.length) - return; - for (;;) { - if (reverse ? !ln : ln == lines.length - 1) return; - line = fold(lines[ln += reverse ? -1 : 1].text); - match = target[reverse ? --idx : ++idx]; - if (idx > 0 && idx < target.length - 1) { - if (line != match) return; - else continue; - } - var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length); - if (reverse ? offsetB != line.length - match.length : offsetB != match.length) - return; - var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB}; - return {from: reverse ? end : start, to: reverse ? start : end}; - } - }; - } - } - - SearchCursor.prototype = { - findNext: function() {return this.find(false);}, - findPrevious: function() {return this.find(true);}, - - find: function(reverse) { - var self = this, pos = clipPos(reverse ? this.pos.from : this.pos.to); - function savePosAndFail(line) { - var pos = {line: line, ch: 0}; - self.pos = {from: pos, to: pos}; - self.atOccurrence = false; - return false; - } - - for (;;) { - if (this.pos = this.matches(reverse, pos)) { - this.atOccurrence = true; - return this.pos.match || true; - } - if (reverse) { - if (!pos.line) return savePosAndFail(0); - pos = {line: pos.line-1, ch: lines[pos.line-1].text.length}; - } - else { - if (pos.line == lines.length - 1) return savePosAndFail(lines.length); - pos = {line: pos.line+1, ch: 0}; - } - } - }, - - from: function() {if (this.atOccurrence) return copyPos(this.pos.from);}, - to: function() {if (this.atOccurrence) return copyPos(this.pos.to);}, - - replace: function(newText) { - var self = this; - if (this.atOccurrence) - operation(function() { - self.pos.to = replaceRange(newText, self.pos.from, self.pos.to); - })(); - } - }; - - for (var ext in extensions) - if (extensions.propertyIsEnumerable(ext) && - !instance.propertyIsEnumerable(ext)) - instance[ext] = extensions[ext]; - return instance; - } // (end of function CodeMirror) - - // The default configuration options. - CodeMirror.defaults = { - value: "", - mode: null, - theme: "default", - indentUnit: 2, - indentWithTabs: false, - tabMode: "classic", - enterMode: "indent", - electricChars: true, - onKeyEvent: null, - lineNumbers: false, - gutter: false, - fixedGutter: false, - firstLineNumber: 1, - readOnly: false, - smartHome: true, - onChange: null, - onCursorActivity: null, - onGutterClick: null, - onHighlightComplete: null, - onFocus: null, onBlur: null, onScroll: null, - matchBrackets: false, - workTime: 100, - workDelay: 200, - undoDepth: 40, - tabindex: null, - document: window.document - }; - - // Known modes, by name and by MIME - var modes = {}, mimeModes = {}; - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - modes[name] = mode; - }; - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - CodeMirror.getMode = function(options, spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) - spec = mimeModes[spec]; - if (typeof spec == "string") - var mname = spec, config = {}; - else if (spec != null) - var mname = spec.name, config = spec; - var mfactory = modes[mname]; - if (!mfactory) { - if (window.console) console.warn("No mode " + mname + " found, falling back to plain text."); - return CodeMirror.getMode(options, "text/plain"); - } - return mfactory(options, config || {}); - }; - CodeMirror.listModes = function() { - var list = []; - for (var m in modes) - if (modes.propertyIsEnumerable(m)) list.push(m); - return list; - }; - CodeMirror.listMIMEs = function() { - var list = []; - for (var m in mimeModes) - if (mimeModes.propertyIsEnumerable(m)) list.push({mime: m, mode: mimeModes[m]}); - return list; - }; - - var extensions = {}; - CodeMirror.defineExtension = function(name, func) { - extensions[name] = func; - }; - - CodeMirror.fromTextArea = function(textarea, options) { - if (!options) options = {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabindex) - options.tabindex = textarea.tabindex; - - function save() {textarea.value = instance.getValue();} - if (textarea.form) { - // Deplorable hack to make the submit method do the right thing. - var rmSubmit = connect(textarea.form, "submit", save, true); - if (typeof textarea.form.submit == "function") { - var realSubmit = textarea.form.submit; - function wrappedSubmit() { - save(); - textarea.form.submit = realSubmit; - textarea.form.submit(); - textarea.form.submit = wrappedSubmit; - } - textarea.form.submit = wrappedSubmit; - } - } - - textarea.style.display = "none"; - var instance = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - instance.save = save; - instance.toTextArea = function() { - save(); - textarea.parentNode.removeChild(instance.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - rmSubmit(); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - return instance; - }; - - // Utility functions for working with state. Exported because modes - // sometimes need to do this. - function copyState(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - } - CodeMirror.startState = startState; - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - } - CodeMirror.copyState = copyState; - - // The character stream used by a mode's parser. - function StringStream(string) { - this.pos = this.start = 0; - this.string = string; - } - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos);}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return countColumn(this.string, this.start);}, - indentation: function() {return countColumn(this.string);}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} - if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } - else { - var match = this.string.slice(this.pos).match(pattern); - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);} - }; - CodeMirror.StringStream = StringStream; - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - function Line(text, styles) { - this.styles = styles || [text, null]; - this.stateAfter = null; - this.text = text; - this.marked = this.gutterMarker = this.className = null; - } - Line.prototype = { - // Replace a piece of a line, keeping the styles around it intact. - replace: function(from, to, text) { - var st = [], mk = this.marked; - copyStyles(0, from, this.styles, st); - if (text) st.push(text, null); - copyStyles(to, this.text.length, this.styles, st); - this.styles = st; - this.text = this.text.slice(0, from) + text + this.text.slice(to); - this.stateAfter = null; - if (mk) { - var diff = text.length - (to - from), end = this.text.length; - function fix(n) {return n <= Math.min(to, to + diff) ? n : n + diff;} - for (var i = 0; i < mk.length; ++i) { - var mark = mk[i], del = false; - if (mark.from >= end) del = true; - else {mark.from = fix(mark.from); if (mark.to != null) mark.to = fix(mark.to);} - if (del || mark.from >= mark.to) {mk.splice(i, 1); i--;} - } - } - }, - // Split a line in two, again keeping styles intact. - split: function(pos, textBefore) { - var st = [textBefore, null]; - copyStyles(pos, this.text.length, this.styles, st); - return new Line(textBefore + this.text.slice(pos), st); - }, - addMark: function(from, to, style) { - var mk = this.marked, mark = {from: from, to: to, style: style}; - if (this.marked == null) this.marked = []; - this.marked.push(mark); - this.marked.sort(function(a, b){return a.from - b.from;}); - return mark; - }, - removeMark: function(mark) { - var mk = this.marked; - if (!mk) return; - for (var i = 0; i < mk.length; ++i) - if (mk[i] == mark) {mk.splice(i, 1); break;} - }, - // Run the given mode's parser over a line, update the styles - // array, which contains alternating fragments of text and CSS - // classes. - highlight: function(mode, state) { - var stream = new StringStream(this.text), st = this.styles, pos = 0; - var changed = false, curWord = st[0], prevWord; - if (this.text == "" && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - var substr = this.text.slice(stream.start, stream.pos); - stream.start = stream.pos; - if (pos && st[pos-1] == style) - st[pos-2] += substr; - else if (substr) { - if (!changed && (st[pos+1] != style || (pos && st[pos-2] != prevWord))) changed = true; - st[pos++] = substr; st[pos++] = style; - prevWord = curWord; curWord = st[pos]; - } - // Give up when line is ridiculously long - if (stream.pos > 5000) { - st[pos++] = this.text.slice(stream.pos); st[pos++] = null; - break; - } - } - if (st.length != pos) {st.length = pos; changed = true;} - if (pos && st[pos-2] != prevWord) changed = true; - // Short lines with simple highlights return null, and are - // counted as changed by the driver because they are likely to - // highlight the same way in various contexts. - return changed || (st.length < 5 && this.text.length < 10 ? null : false); - }, - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(mode, state, ch) { - var txt = this.text, stream = new StringStream(txt); - while (stream.pos < ch && !stream.eol()) { - stream.start = stream.pos; - var style = mode.token(stream, state); - } - return {start: stream.start, - end: stream.pos, - string: stream.current(), - className: style || null, - state: state}; - }, - indentation: function() {return countColumn(this.text);}, - // Produces an HTML fragment for the line, taking selection, - // marking, and highlighting into account. - getHTML: function(sfrom, sto, includePre, endAt) { - var html = []; - if (includePre) - html.push(this.className ? '
': "
");
-      function span(text, style) {
-        if (!text) return;
-        if (style) html.push('', htmlEscape(text), "");
-        else html.push(htmlEscape(text));
-      }
-      var st = this.styles, allText = this.text, marked = this.marked;
-      if (sfrom == sto) sfrom = null;
-      var len = allText.length;
-      if (endAt != null) len = Math.min(endAt, len);
-
-      if (!allText && endAt == null)
-        span(" ", sfrom != null && sto == null ? "CodeMirror-selected" : null);
-      else if (!marked && sfrom == null)
-        for (var i = 0, ch = 0; ch < len; i+=2) {
-          var str = st[i], style = st[i+1], l = str.length;
-          if (ch + l > len) str = str.slice(0, len - ch);
-          ch += l;
-          span(str, style && "cm-" + style);
-        }
-      else {
-        var pos = 0, i = 0, text = "", style, sg = 0;
-        var markpos = -1, mark = null;
-        function nextMark() {
-          if (marked) {
-            markpos += 1;
-            mark = (markpos < marked.length) ? marked[markpos] : null;
-          }
-        }
-        nextMark();
-        while (pos < len) {
-          var upto = len;
-          var extraStyle = "";
-          if (sfrom != null) {
-            if (sfrom > pos) upto = sfrom;
-            else if (sto == null || sto > pos) {
-              extraStyle = " CodeMirror-selected";
-              if (sto != null) upto = Math.min(upto, sto);
-            }
-          }
-          while (mark && mark.to != null && mark.to <= pos) nextMark();
-          if (mark) {
-            if (mark.from > pos) upto = Math.min(upto, mark.from);
-            else {
-              extraStyle += " " + mark.style;
-              if (mark.to != null) upto = Math.min(upto, mark.to);
-            }
-          }
-          for (;;) {
-            var end = pos + text.length;
-            var appliedStyle = style;
-            if (extraStyle) appliedStyle = style ? style + extraStyle : extraStyle;
-            span(end > upto ? text.slice(0, upto - pos) : text, appliedStyle);
-            if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
-            pos = end;
-            text = st[i++]; style = "cm-" + st[i++];
-          }
-        }
-        if (sfrom != null && sto == null) span(" ", "CodeMirror-selected");
-      }
-      if (includePre) html.push("
"); - return html.join(""); - } - }; - // Utility used by replace and split above - function copyStyles(from, to, source, dest) { - for (var i = 0, pos = 0, state = 0; pos < to; i+=2) { - var part = source[i], end = pos + part.length; - if (state == 0) { - if (end > from) dest.push(part.slice(from - pos, Math.min(part.length, to - pos)), source[i+1]); - if (end >= from) state = 1; - } - else if (state == 1) { - if (end > to) dest.push(part.slice(0, to - pos), source[i+1]); - else dest.push(part, source[i+1]); - } - pos = end; - } - } - - // The history object 'chunks' changes that are made close together - // and at almost the same time into bigger undoable units. - function History() { - this.time = 0; - this.done = []; this.undone = []; - } - History.prototype = { - addChange: function(start, added, old) { - this.undone.length = 0; - var time = +new Date, last = this.done[this.done.length - 1]; - if (time - this.time > 400 || !last || - last.start > start + added || last.start + last.added < start - last.added + last.old.length) - this.done.push({start: start, added: added, old: old}); - else { - var oldoff = 0; - if (start < last.start) { - for (var i = last.start - start - 1; i >= 0; --i) - last.old.unshift(old[i]); - last.added += last.start - start; - last.start = start; - } - else if (last.start < start) { - oldoff = start - last.start; - added += oldoff; - } - for (var i = last.added - oldoff, e = old.length; i < e; ++i) - last.old.push(old[i]); - if (last.added < added) last.added = added; - } - this.time = time; - } - }; - - function stopMethod() {e_stop(this);} - // Ensure an event has a stop method. - function addStop(event) { - if (!event.stop) event.stop = stopMethod; - return event; - } - - function e_preventDefault(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - } - function e_stopPropagation(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - if (e.which) return e.which; - else if (e.button & 1) return 1; - else if (e.button & 2) return 3; - else if (e.button & 4) return 2; - } - - // Event handler registration. If disconnect is true, it'll return a - // function that unregisters the handler. - function connect(node, type, handler, disconnect) { - function wrapHandler(event) {handler(event || window.event);} - if (typeof node.addEventListener == "function") { - node.addEventListener(type, wrapHandler, false); - if (disconnect) return function() {node.removeEventListener(type, wrapHandler, false);}; - } - else { - node.attachEvent("on" + type, wrapHandler); - if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);}; - } - } - - function Delayed() {this.id = null;} - Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; - - // Some IE versions don't preserve whitespace when setting the - // innerHTML of a PRE tag. - var badInnerHTML = (function() { - var pre = document.createElement("pre"); - pre.innerHTML = " "; return !pre.innerHTML; - })(); - - // Detect drag-and-drop - var dragAndDrop = (function() { - // IE8 has ondragstart and ondrop properties, but doesn't seem to - // actually support ondragstart the way it's supposed to work. - if (/MSIE [1-8]\b/.test(navigator.userAgent)) return false; - var div = document.createElement('div'); - return "ondragstart" in div && "ondrop" in div; - })(); - - var gecko = /gecko\/\d{7}/i.test(navigator.userAgent); - var ie = /MSIE \d/.test(navigator.userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - - var lineSep = "\n"; - // Feature-detect whether newlines in textareas are converted to \r\n - (function () { - var te = document.createElement("textarea"); - te.value = "foo\nbar"; - if (te.value.indexOf("\r") > -1) lineSep = "\r\n"; - }()); - - var tabSize = 8; - var mac = /Mac/.test(navigator.platform); - var movementKeys = {}; - for (var i = 35; i <= 40; ++i) - movementKeys[i] = movementKeys["c" + i] = true; - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - function countColumn(string, end) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = 0, n = 0; i < end; ++i) { - if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); - else ++n; - } - return n; - } - - function computedStyle(elt) { - if (elt.currentStyle) return elt.currentStyle; - return window.getComputedStyle(elt, null); - } - // Find the position of an element by following the offsetParent chain. - // If screen==true, it returns screen (rather than page) coordinates. - function eltOffset(node, screen) { - var doc = node.ownerDocument.body; - var x = 0, y = 0, skipDoc = false; - for (var n = node; n; n = n.offsetParent) { - x += n.offsetLeft; y += n.offsetTop; - if (screen && computedStyle(n).position == "fixed") - skipDoc = true; - } - var e = screen && !skipDoc ? null : doc; - for (var n = node.parentNode; n != e; n = n.parentNode) - if (n.scrollLeft != null) { x -= n.scrollLeft; y -= n.scrollTop;} - return {left: x, top: y}; - } - // Get a node's text content. - function eltText(node) { - return node.textContent || node.innerText || node.nodeValue || ""; - } - - // Operations on {line, ch} objects. - function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} - function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} - function copyPos(x) {return {line: x.line, ch: x.ch};} - - var escapeElement = document.createElement("div"); - function htmlEscape(str) { - escapeElement.innerText = escapeElement.textContent = str; - return escapeElement.innerHTML; - } - CodeMirror.htmlEscape = htmlEscape; - - // Used to position the cursor after an undo/redo by finding the - // last edited character. - function editEnd(from, to) { - if (!to) return from ? from.length : 0; - if (!from) return to.length; - for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j) - if (from.charAt(i) != to.charAt(j)) break; - return j + 1; - } - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLines, selRange, setSelRange; - if ("\n\nb".split(/\n/).length != 3) - splitLines = function(string) { - var pos = 0, nl, result = []; - while ((nl = string.indexOf("\n", pos)) > -1) { - result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl)); - pos = nl + 1; - } - result.push(string.slice(pos)); - return result; - }; - else - splitLines = function(string){return string.split(/\r?\n/);}; - CodeMirror.splitLines = splitLines; - - // Sane model of finding and setting the selection in a textarea - if (window.getSelection) { - selRange = function(te) { - try {return {start: te.selectionStart, end: te.selectionEnd};} - catch(e) {return null;} - }; - if (safari) - // On Safari, selection set with setSelectionRange are in a sort - // of limbo wrt their anchor. If you press shift-left in them, - // the anchor is put at the end, and the selection expanded to - // the left. If you press shift-right, the anchor ends up at the - // front. This is not what CodeMirror wants, so it does a - // spurious modify() call to get out of limbo. - setSelRange = function(te, start, end) { - if (start == end) - te.setSelectionRange(start, end); - else { - te.setSelectionRange(start, end - 1); - window.getSelection().modify("extend", "forward", "character"); - } - }; - else - setSelRange = function(te, start, end) { - try {te.setSelectionRange(start, end);} - catch(e) {} // Fails on Firefox when textarea isn't part of the document - }; - } - // IE model. Don't ask. - else { - selRange = function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {return null;} - if (!range || range.parentElement() != te) return null; - var val = te.value, len = val.length, localRange = te.createTextRange(); - localRange.moveToBookmark(range.getBookmark()); - var endRange = te.createTextRange(); - endRange.collapse(false); - - if (localRange.compareEndPoints("StartToEnd", endRange) > -1) - return {start: len, end: len}; - - var start = -localRange.moveStart("character", -len); - for (var i = val.indexOf("\r"); i > -1 && i < start; i = val.indexOf("\r", i+1), start++) {} - - if (localRange.compareEndPoints("EndToEnd", endRange) > -1) - return {start: start, end: len}; - - var end = -localRange.moveEnd("character", -len); - for (var i = val.indexOf("\r"); i > -1 && i < end; i = val.indexOf("\r", i+1), end++) {} - return {start: start, end: end}; - }; - setSelRange = function(te, start, end) { - var range = te.createTextRange(); - range.collapse(true); - var endrange = range.duplicate(); - var newlines = 0, txt = te.value; - for (var pos = txt.indexOf("\n"); pos > -1 && pos < start; pos = txt.indexOf("\n", pos + 1)) - ++newlines; - range.move("character", start - newlines); - for (; pos > -1 && pos < end; pos = txt.indexOf("\n", pos + 1)) - ++newlines; - endrange.move("character", end - newlines); - range.setEndPoint("EndToEnd", endrange); - range.select(); - }; - } - - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - return CodeMirror; -})(); diff --git a/src/codemirror/lib/overlay.js b/src/codemirror/lib/overlay.js deleted file mode 100755 index c4cdf9f..0000000 --- a/src/codemirror/lib/overlay.js +++ /dev/null @@ -1,51 +0,0 @@ -// Utility function that allows modes to be combined. The mode given -// as the base argument takes care of most of the normal mode -// functionality, but a second (typically simple) mode is used, which -// can override the style of text. Both modes get to parse all of the -// text, but when both assign a non-null style to a piece of code, the -// overlay wins, unless the combine argument was true, in which case -// the styles are combined. - -CodeMirror.overlayParser = function(base, overlay, combine) { - return { - startState: function() { - return { - base: CodeMirror.startState(base), - overlay: CodeMirror.startState(overlay), - basePos: 0, baseCur: null, - overlayPos: 0, overlayCur: null - }; - }, - copyState: function(state) { - return { - base: CodeMirror.copyState(base, state.base), - overlay: CodeMirror.copyState(overlay, state.overlay), - basePos: state.basePos, baseCur: null, - overlayPos: state.overlayPos, overlayCur: null - }; - }, - - token: function(stream, state) { - if (stream.start == state.basePos) { - state.baseCur = base.token(stream, state.base); - state.basePos = stream.pos; - } - if (stream.start == state.overlayPos) { - stream.pos = stream.start; - state.overlayCur = overlay.token(stream, state.overlay); - state.overlayPos = stream.pos; - } - stream.pos = Math.min(state.basePos, state.overlayPos); - if (stream.eol()) state.basePos = state.overlayPos = 0; - - if (state.overlayCur == null) return state.baseCur; - if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; - else return state.overlayCur; - }, - - indent: function(state, textAfter) { - return base.indent(state.base, textAfter); - }, - electricChars: base.electricChars - }; -}; diff --git a/src/codemirror/lib/runmode.js b/src/codemirror/lib/runmode.js deleted file mode 100755 index 163e720..0000000 --- a/src/codemirror/lib/runmode.js +++ /dev/null @@ -1,27 +0,0 @@ -CodeMirror.runMode = function(string, modespec, callback) { - var mode = CodeMirror.getMode({indentUnit: 2}, modespec); - var isNode = callback.nodeType == 1; - if (isNode) { - var node = callback, accum = []; - callback = function(string, style) { - if (string == "\n") - accum.push("
"); - else if (style) - accum.push("" + CodeMirror.htmlEscape(string) + ""); - else - accum.push(CodeMirror.htmlEscape(string)); - } - } - var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); - for (var i = 0, e = lines.length; i < e; ++i) { - if (i) callback("\n"); - var stream = new CodeMirror.StringStream(lines[i]); - while (!stream.eol()) { - var style = mode.token(stream, state); - callback(stream.current(), style); - stream.start = stream.pos; - } - } - if (isNode) - node.innerHTML = accum.join(""); -}; diff --git a/src/codemirror/manual.html b/src/codemirror/manual.html deleted file mode 100755 index 2d9f0f1..0000000 --- a/src/codemirror/manual.html +++ /dev/null @@ -1,869 +0,0 @@ - - - - CodeMirror: User Manual - - - - - - - -

{ } CodeMirror

- -
-/* User manual and
-   reference guide */
-
- -
- -

Overview

- -

CodeMirror is a code-editor component that can be embedded in - Web pages. It provides only the editor component, no - accompanying buttons - (see CodeMirror - UI for a drop-in button bar), auto-completion, or other IDE - functionality. It does provide a rich API on top of which such - functionality can be straightforwardly implemented.

- -

CodeMirror works with language-specific modes. Modes are - JavaScript programs that help color (and optionally indent) text - written in a given language. The distribution comes with a few - modes (see the mode/ directory), and it isn't hard - to write new ones for other languages.

- -

Basic Usage

- -

The easiest way to use CodeMirror is to simply load the script - and style sheet found under lib/ in the distribution, - plus a mode script from one of the mode/ directories - and a theme stylesheet from theme/. (See - also the compression helper.) For - example:

- -
<script src="lib/codemirror.js"></script>
-<link rel="stylesheet" href="lib/codemirror.css">
-<script src="mode/javascript/javascript.js"></script>
-<link rel="stylesheet" href="theme/default.css">
- -

(If you use a theme other than default.css, you - also have to specify the - theme option.) Having - done this, an editor instance can be created like this:

- -
var myCodeMirror = CodeMirror(document.body);
- -

The editor will be appended to the document body, will start - empty, and will use the mode that we loaded. To have more control - over the new editor, a configuration object can be passed - to CodeMirror as a second argument:

- -
var myCodeMirror = CodeMirror(document.body, {
-  value: "function myScript(){return 100;}\n",
-  mode:  "javascript"
-});
- -

This will initialize the editor with a piece of code already in - it, and explicitly tell it to use the JavaScript mode (which is - useful when multiple modes are loaded). - See below for a full discussion of the - configuration options that CodeMirror accepts.

- -

In cases where you don't want to append the editor to an - element, and need more control over the way it is inserted, the - first argument to the CodeMirror function can also - be a function that, when given a DOM element, inserts it into the - document somewhere. This could be used to, for example, replace a - textarea with a real editor:

- -
var myCodeMirror = CodeMirror(function(elt) {
-  myTextArea.parentNode.replaceChild(elt, myTextArea);
-}, {value: myTextArea.value});
- -

However, for this use case, which is a common way to use - CodeMirror, the library provides a much more powerful - shortcut:

- -
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
- -

This will, among other things, ensure that the textarea's value - is updated when the form (if it is part of a form) is submitted. - See the API reference for a full - description of this method.

- -

Configuration

- -

Both the CodeMirror function and - its fromTextArea method take as second (optional) - argument an object containing configuration options. Any option - not supplied like this will be taken - from CodeMirror.defaults, an object containing the - default options. You can update this object to change the defaults - on your page.

- -

Options are not checked in any way, so setting bogus option - values is bound to lead to odd errors.

- -

Note: CodeMirror - 2 does not support - line-wrapping. I would have very much liked to support it, but it - combines extremely poorly with the way the editor is - implemented.

- -

These are the supported options:

- -
-
value (string)
-
The starting value of the editor.
- -
mode (string or object)
-
The mode to use. When not given, this will default to the - first mode that was loaded. It may be a string, which either - simply names the mode or is - a MIME type - associated with the mode. Alternatively, it may be an object - containing configuration options for the mode, with - a name property that names the mode (for - example {name: "javascript", json: true}). The demo - pages for each mode contain information about what configuration - parameters the mode supports. You can ask CodeMirror which modes - and MIME types are loaded with - the CodeMirror.listModes - and CodeMirror.listMIMEs functions.
- -
theme (string)
-
The theme to style the editor with. You must make sure the - CSS file defining the corresponding .cm-s-[name] - styles is loaded (see - the theme directory in the - distribution).
- -
indentUnit (integer)
-
How many spaces a block (whatever that means in the edited - language) should be indented. The default is 2.
- -
indentWithTabs (boolean)
-
Whether, when indenting, the first N*8 spaces should be - replaced by N tabs. Default is false.
- -
tabMode (string)
-
Determines what happens when the user presses the tab key. - Must be one of the following: -
-
"classic" (the default)
-
When nothing is selected, insert a tab. Otherwise, - behave like the "shift" mode. (When shift is - held, this behaves like the "indent" mode.)
-
"shift"
-
Indent all selected lines by - one indentUnit. - If shift was held while pressing tab, un-indent all selected - lines one unit.
-
"indent"
-
Indent the line the 'correctly', based on its syntactic - context. Only works if the - mode supports it.
-
"default"
-
Do not capture tab presses, let the browser apply its - default behaviour (which usually means it skips to the next - control).
-
- -
enterMode (string)
-
Determines whether and how new lines are indented when the - enter key is pressed. The following modes are supported: -
-
"indent" (the default)
-
Use the mode's indentation rules to give the new line - the correct indentation.
-
"keep"
-
Indent the line the same as the previous line.
-
"flat"
-
Do not indent the new line.
-
- -
electricChars (boolean)
-
Configures whether the editor should re-indent the current - line when a character is typed that might change its proper - indentation (only works if the mode supports indentation). - Default is true.
- -
smartHome (boolean)
-
Configures whether the home key takes you to the first - non-whitespace character (unless already there) or to the start - of the line. On by default.
- -
lineNumbers (boolean)
-
Whether to show line numbers to the left of the editor.
- -
firstLineNumber (integer)
-
At which number to start counting lines. Default is 1.
- -
gutter (boolean)
-
Can be used to force a 'gutter' (empty space on the left of - the editor) to be shown even when no line numbers are active. - This is useful for setting markers.
- -
fixedGutter (boolean)
-
When enabled (off by default), this will make the gutter - stay visible when the document is scrolled horizontally.
- -
readOnly (boolean)
-
This disables editing of the editor content by the user. - (Changes through API functions will still be possible.) If you - also want to disable the cursor, use "nocursor" as - a value for this option, instead of true.
- -
onChange (function)
-
When given, this function will be called every time the - content of the editor is changed. It will be given the editor - instance as only argument.
- -
onCursorActivity (function)
-
Like onChange, but will also be called when the - cursor moves without any changes being made.
- -
onGutterClick (function)
-
When given, will be called whenever the editor gutter (the - line-number area) is clicked. Will be given the editor instance - as first argument, the (zero-based) number of the line that was - clicked as second argument, and the raw mousedown - event object as third argument.
- -
onFocus, onBlur (function)
-
The given functions will be called whenever the editor is - focused or unfocused.
- -
onScroll (function)
-
When given, will be called whenever the editor is - scrolled.
- -
onHighlightComplete (function)
-
Whenever the editor's content has been fully highlighted, - this function (if given) will be called. It'll be given a single - argument, the editor instance.
- -
matchBrackets (boolean)
-
Determines whether brackets are matched whenever the cursor - is moved next to a bracket.
- -
workTime, workDelay (number)
-
Highlighting is done by a pseudo background-thread that will - work for workTime milliseconds, and then use - timeout to sleep for workDelay milliseconds. The - defaults are 200 and 300, you can change these options to make - the highlighting more or less aggressive.
- -
undoDepth (integer)
-
The maximum number of undo levels that the editor stores. - Defaults to 40.
- -
tabindex (integer)
-
The tab - index to assign to the editor. If not given, no tab index - will be assigned.
- -
document (DOM document)
-
Use this if you want to display the editor in another DOM. - By default it will use the global document - object.
- -
onKeyEvent (function)
-
This provides a rather low-level hook into CodeMirror's key - handling. If provided, this function will be called on - every keydown, keyup, - and keypress event that CodeMirror captures. It - will be passed two arguments, the editor instance and the key - event. This key event is pretty much the raw key event, except - that a stop() method is always added to it. You - could feed it to, for example, jQuery.Event to - further normalize it.
This function can inspect the key - event, and handle it if it wants to. It may return true to tell - CodeMirror to ignore the event. Be wary that, on some browsers, - stopping a keydown does not stop - the keypress from firing, whereas on others it - does. If you respond to an event, you should probably inspect - its type property and only do something when it - is keydown (or keypress for actions - that need character data).
-
- -

Customized Styling

- -

Up to a certain extent, CodeMirror's look can be changed by - modifying style sheet files. The style sheets supplied by modes - simply provide the colors for that mode, and can be adapted in a - very straightforward way. To style the editor itself, it is - possible to alter or override the styles defined - in codemirror.css.

- -

Some care must be taken there, since a lot of the rules in this - file are necessary to have CodeMirror function properly. Adjusting - colors should be safe, of course, and with some care a lot of - other things can be changed as well. The CSS classes defined in - this file serve the following roles:

- -
-
CodeMirror
-
The outer element of the editor. This should be used for - borders and positioning. Can also be used to set styles that - should hold for everything inside the editor (such as font - and font size), or to set a background.
- -
CodeMirror-scroll
-
This determines whether the editor scrolls (overflow: - auto + fixed height). By default, it does. Giving - this height: auto; overflow: visible; will cause - the editor to resize to fit its content.
- -
CodeMirror-focused
-
Whenever the editor is focused, the top element gets this - class. This is used to hide the cursor and give the selection a - different color when the editor is not focused.
- -
CodeMirror-gutter
-
Use this for giving a background or a border to the editor - gutter. Don't set any padding here, - use CodeMirror-gutter-text for that. By default, - the gutter is 'fluid', meaning it will adjust its width to the - maximum line number or line marker width. You can also set a - fixed width if you want.
- -
CodeMirror-gutter-text
-
Used to style the actual line numbers. For the numbers to - line up, you must make sure that the font in the gutter is the - same as the one in the rest of the editor, so you should - probably only set font style and size in - the CodeMirror class.
- -
CodeMirror-lines
-
The visible lines. If this has vertical - padding, CodeMirror-gutter should have the same - padding.
- -
CodeMirror-cursor
-
The cursor is a block element that is absolutely positioned. - You can make it look whichever way you want.
- -
CodeMirror-selected
-
The selection is represented by span elements - with this class.
- -
CodeMirror-matchingbracket, - CodeMirror-nonmatchingbracket
-
These are used to style matched (or unmatched) brackets.
-
- -

The actual lines, as well as the cursor, are represented - by pre elements. By default no text styling (such as - bold) that might change line height is applied. If you do want - such effects, you'll have to give CodeMirror pre a - fixed height. Also, you must still take care that character width - is constant.

- -

If your page's style sheets do funky things to - all div or pre elements (you probably - shouldn't do that), you'll have to define rules to cancel these - effects out again for elements under the CodeMirror - class.

- -

Programming API

- -

A lot of CodeMirror features are only available through its API. - This has the disadvantage that you need to do work to enable them, - and the advantage that CodeMirror will fit seamlessly into your - application.

- -

Whenever points in the document are represented, the API uses - objects with line and ch properties. - Both are zero-based. CodeMirror makes sure to 'clip' any positions - passed by client code so that they fit inside the document, so you - shouldn't worry too much about sanitizing your coordinates. If you - give ch a value of null, or don't - specify it, it will be replaced with the length of the specified - line.

- -
-
getValue() → string
-
Get the current editor content.
-
setValue(string)
-
Set the editor content.
- -
getSelection() → string
-
Get the currently selected code.
-
replaceSelection(string)
-
Replace the selection with the given string.
- -
focus()
-
Give the editor focus.
- -
setOption(option, value)
-
Change the configuration of the editor. option - should the name of an option, - and value should be a valid value for that - option.
-
getOption(option) → value
-
Retrieves the current value of the given option for this - editor instance.
- -
cursorCoords(start) → object
-
Returns an {x, y, yBot} object containing the - coordinates of the cursor relative to the top-left corner of the - page. yBot is the coordinate of the bottom of the - cursor. start is a boolean indicating whether you - want the start or the end of the selection.
-
charCoords(pos) → object
-
Like cursorCoords, but returns the position of - an arbitrary characters. pos should be - a {line, ch} object.
-
coordsChar(object) → pos
-
Given an {x, y} object (in page coordinates), - returns the {line, ch} position that corresponds to - it.
- -
undo()
-
Undo one edit (if any undo events are stored).
-
redo()
-
Redo one undone edit.
-
historySize() → object
-
Returns an object with {undo, redo} properties, - both of which hold integers, indicating the amount of stored - undo and redo operations.
- -
indentLine(line, dir)
-
Reset the given line's indentation to the indentation - prescribed by the mode. If the second argument is given, - indentation will be increased (if dir is true) or - decreased (if false) by an indent - unit instead.
- -
getSearchCursor(query, start, caseFold) → cursor
-
Used to implement search/replace - functionality. query can be a regular expression or - a string (only strings will match across lines—if they contain - newlines). start provides the starting position of - the search. It can be a {line, ch} object, or can - be left off to default to the start of the - document. caseFold is only relevant when matching a - string. It will cause the search to be case-insensitive. A - search cursor has the following methods: -
-
findNext(), findPrevious() → boolean
-
Search forward or backward from the current position. - The return value indicates whether a match was found. If - matching a regular expression, the return value will be the - array returned by the match method, in case you - want to extract matched groups.
-
from(), to() → object
-
These are only valid when the last call - to findNext or findPrevious did - not return false. They will return {line, ch} - objects pointing at the start and end of the match.
-
replace(text)
-
Replaces the currently found match with the given text - and adjusts the cursor position to reflect the - replacement.
-
- -
getTokenAt(pos) → object
-
Retrieves information about the token the current mode found - at the given position (a {line, ch} object). The - returned object has the following properties: -
-
start
The character (on the given line) at which the token starts.
-
end
The character at which the token ends.
-
string
The token's string.
-
className
The class the mode assigned - to the token. (Can be null when no class was assigned.)
-
state
The mode's state at the end of this token.
-
- -
markText(from, to, className) → function
-
Can be used to mark a range of text with a specific CSS - class name. from and to should - be {line, ch} objects. The method will return a - function that can be called to remove the marking.
- -
setMarker(line, text, className) → lineHandle
-
Add a gutter marker for the given line. Gutter markers are - shown in the line-number area (instead of the number for this - line). Both text and className are - optional. Setting text to a Unicode character like - ● tends to give a nice effect. To put a picture in the gutter, - set text to a space and className to - something that sets a background image. If you - specify text, the given text (which may contain - HTML) will, by default, replace the line number for that line. - If this is not what you want, you can include the - string %N% in the text, which will be replaced by - the line number.
-
clearMarker(line)
-
Clears a marker created - with setMarker. line can be either a - number or a handle returned by setMarker (since a - number may now refer to a different line if something was added - or deleted).
-
setLineClass(line, className) → lineHandle
-
Set a CSS class name for the given line. line - can be a number or a line handle (as returned - by setMarker or this function). - Pass null to clear the class for a line.
- -
lineInfo(line) → object
-
Returns the line number, text content, and marker status of - the given line, which can be either a number or a handle - returned by setMarker. The returned object has the - structure {line, text, markerText, markerClass}.
- -
addWidget(pos, node, scrollIntoView)
-
Puts node, which should be an absolutely - positioned DOM node, into the editor, positioned right below the - given {line, ch} position. - When scrollIntoView is true, the editor will ensure - that the entire node is visible (if possible). To remove the - widget again, simply use DOM methods (move it somewhere else, or - call removeChild on its parent).
- -
matchBrackets()
-
Force matching-bracket-highlighting to happen.
- -
lineCount() → number
-
Get the number of lines in the editor.
- -
getCursor(start) → object
-
start is a boolean indicating whether the start - or the end of the selection must be retrieved. If it is not - given, the current cursor pos, i.e. the side of the selection - that would move if you pressed an arrow key, is chosen. - A {line, ch} object will be returned.
-
somethingSelected() → boolean
-
Return true if any text is selected.
-
setCursor(pos)
-
Set the cursor position. You can either pass a - single {line, ch} object, or the line and the - character as two separate parameters.
-
setSelection(start, end)
-
Set the selection range. start - and end should be {line, ch} objects.
- -
getLine(n) → string
-
Get the content of line n.
-
setLine(n, text)
-
Set the content of line n.
-
removeLine(n)
-
Remove the given line from the document.
- -
getRange(from, to) → string -
Get the text between the given points in the editor, which - should be {line, ch} objects.
-
replaceRange(string, from, to)
-
Replace the part of the document between from - and to with the given string. from - and to must be {line, ch} - objects. to can be left off to simply insert the - string at position from.
-
- -

The following are more low-level methods:

- -
-
operation(func) → result
-
CodeMirror internally buffers changes and only updates its - DOM structure after it has finished performing some operation. - If you need to perform a lot of operations on a CodeMirror - instance, you can call this method with a function argument. It - will call the function, buffering up all changes, and only doing - the expensive update after the function returns. This can be a - lot faster. The return value from this method will be the return - value of your function.
- -
refresh()
-
If your code does something to change the size of the editor - element (window resizes are already listened for), or unhides - it, you should probably follow up by calling this method to - ensure CodeMirror is still looking as intended.
- -
getInputField() → textarea
-
Returns the hiden textarea used to read input.
-
getWrapperElement() → node
-
Returns the DOM node that represents the editor. Remove this - from your tree to delete an editor instance.
-
getScrollerElement() → node
-
Returns the DOM node that is responsible for the sizing and - the scrolling of the editor. You can change - the height and width styles of this - element to resize an editor. (You might have to call - the refresh method - afterwards.)
-
getGutterElement() → node
-
Fetches the DOM node that represents the editor gutter.
- -
getStateAfter(line) → state
-
Returns the mode's parser state, if any, at the end of the - given line number. If no line number is given, the state at the - end of the document is returned. This can be useful for storing - parsing errors in the state, or getting other kinds of - contextual information for a line.
-
- -

Finally, the CodeMirror object - itself has a method fromTextArea. This takes a - textarea DOM node as first argument and an optional configuration - object as second. It will replace the textarea with a CodeMirror - instance, and wire up the form of that textarea (if any) to make - sure the editor contents are put into the textarea when the form - is submitted. A CodeMirror instance created this way has two - additional methods:

- -
-
save()
-
Copy the content of the editor into the textarea.
- -
toTextArea()
-
Remove the editor, and restore the original textarea (with - the editor's current content).
-
- -

If you want define extra methods in terms - of the CodeMirror API, is it possible to - use CodeMirror.defineExtension(name, value). This - will cause the given value (usually a method) to be added to all - CodeMirror instances created from then on.

- -

Writing CodeMirror Modes

- -

Modes typically consist of a JavaScript file and a CSS file. - The CSS file (see, for - example javascript.css) - defines the classes that will be used to style the syntactic - elements of the code, and the script contains the logic to - actually assign these classes to the right pieces of text.

- -

You'll usually want to use some kind of prefix for your CSS - classes, so that they are unlikely to clash with other classes, - both those used by other modes and those defined by the page in - which CodeMirror is embedded.

- -

The mode script should - call CodeMirror.defineMode to register itself with - CodeMirror. This function takes two arguments. The first should be - the name of the mode, for which you should use a lowercase string, - preferably one that is also the name of the files that define the - mode (i.e. "xml" is defined xml.js). The - second argument should be a function that, given a CodeMirror - configuration object (the thing passed to - the CodeMirror function) and a mode configuration - object (as in the mode - option), returns a mode object.

- -

Typically, you should use this second argument - to defineMode as your module scope function (modes - should not leak anything into the global scope!), i.e. write your - whole mode inside this function.

- -

The main responsibility of a mode script is parsing - the content of the editor. Depending on the language and the - amount of functionality desired, this can be done in really easy - or extremely complicated ways. Some parsers can be stateless, - meaning that they look at one element (token) of the code - at a time, with no memory of what came before. Most, however, will - need to remember something. This is done by using a state - object, which is an object that can be mutated every time a - new token is read.

- -

Modes that use a state must define - a startState method on their mode object. This is a - function of no arguments that produces a state object to be used - at the start of a document.

- -

The most important part of a mode object is - its token(stream, state) method. All modes must - define this method. It should read one token from the stream it is - given as an argument, optionally update its state, and return a - style string, or null for tokens that do not have to - be styled. For your styles, you can either use the 'standard' ones - defined in the themes (without the cm- prefix), or - define your own (as the diff - mode does) and have people include a custom theme for your - mode.

- -

The stream object encapsulates a line of code - (tokens may never span lines) and our current position in that - line. It has the following API:

- -
-
eol() → boolean
-
Returns true only if the stream is at the end of the - line.
-
sol() → boolean
-
Returns true only if the stream is at the start of the - line.
- -
peek() → character
-
Returns the next character in the stream without advancing - it. Will return undefined at the end of the - line.
-
next() → character
-
Returns the next character in the stream and advances it. - Also returns undefined when no more characters are - available.
- -
eat(match) → character
-
match can be a character, a regular expression, - or a function that takes a character and returns a boolean. If - the next character in the stream 'matches' the given argument, - it is consumed and returned. Otherwise, undefined - is returned.
-
eatWhile(match) → boolean
-
Repeatedly calls eat with the given argument, - until it fails. Returns true if any characters were eaten.
-
eatSpace() → boolean
-
Shortcut for eatWhile when matching - white-space.
-
skipToEnd()
-
Moves the position to the end of the line.
-
skipTo(ch) → boolean
-
Skips to the next occurrence of the given character, if - found. Returns true if the character was found.
-
match(pattern, consume, caseFold) → boolean
-
Act like a - multi-character eat—if consume is true - or not given—or a look-ahead that doesn't update the stream - position—if it is false. pattern can be either a - string or a regular expression starting with ^. - When it is a string, caseFold can be set to true to - make the match case-insensitive. When successfully matching a - regular expression, the returned value will be the array - returned by match, in case you need to extract - matched groups.
- -
backUp(n)
-
Backs up the stream n characters. Backing it up - further than the start of the current token will cause things to - break, so be careful.
-
column() → integer
-
Returns the column (taking into account tabs) at which the - current token starts. Can be used to find out whether a token - starts a new line.
-
indentation() → integer
-
Tells you how far the current line has been indented, in - spaces. Corrects for tab characters.
- -
current() → string
-
Get the string between the start of the current token and - the current stream position.
-
- -

By default, blank lines are simply skipped when - tokenizing a document. For languages that have significant blank - lines, you can define a blankLine(state) method on - your mode that will get called whenever a blank line is passed - over, so that it can update the parser state.

- -

Because state object are mutated, and CodeMirror - needs to keep valid versions of a state around so that it can - restart a parse at any line, copies must be made of state objects. - The default algorithm used is that a new state object is created, - which gets all the properties of the old object. Any properties - which hold arrays get a copy of these arrays (since arrays tend to - be used as mutable stacks). When this is not correct, for example - because a mode mutates non-array properties of its state object, a - mode object should define a copyState method, - which is given a state and should return a safe copy of that - state.

- -

By default, CodeMirror will stop re-parsing - a document as soon as it encounters a few lines that were - highlighted the same in the old parse as in the new one. It is - possible to provide an explicit way to test whether a state is - equivalent to another one, which CodeMirror will use (instead of - the unchanged-lines heuristic) to decide when to stop - highlighting. You do this by providing - a compareStates method on your mode object, which - takes two state arguments and returns a boolean indicating whether - they are equivalent. See the XML mode, which uses this to provide - reliable highlighting of bad closing tags, as an example.

- -

If you want your mode to provide smart indentation - (see entermode - and tabMode when they - have a value of "indent"), you must define - an indent(state, textAfter) method on your mode - object.

- -

The indentation method should inspect the given state object, - and optionally the textAfter string, which contains - the text on the line that is being indented, and return an - integer, the amount of spaces to indent. It should usually take - the indentUnit - option into account.

- -

Finally, a mode may define - an electricChars property, which should hold a string - containing all the characters that should trigger the behaviour - described for - the electricChars - option.

- -

So, to summarize, a mode must provide - a token method, and it may - provide startState, copyState, - and indent methods. For an example of a trivial mode, - see the diff mode, for a more - involved example, see - the JavaScript - mode.

- -

Sometimes, it is useful for modes to nest—to have one - mode delegate work to another mode. An example of this kind of - mode is the mixed-mode HTML - mode. To implement such nesting, it is usually necessary to - create mode objects and copy states yourself. To create a mode - object, there are CodeMirror.getMode(options, - parserConfig), where the first argument is a configuration - object as passed to the mode constructor function, and the second - argument is a mode specification as in - the mode option. To copy a - state object, call CodeMirror.copyState(mode, state), - where mode is the mode that created the given - state.

- -

To make indentation work properly in a nested parser, it is - advisable to give the startState method of modes that - are intended to be nested an optional argument that provides the - base indentation for the block of code. The JavaScript and CSS - parser do this, for example, to allow JavaScript and CSS code - inside the mixed-mode HTML mode to be properly indented.

- -

Finally, it is possible to associate your mode, or a certain - configuration of your mode, with - a MIME type. For - example, the JavaScript mode associates itself - with text/javascript, and its JSON variant - with application/json. To do this, - call CodeMirror.defineMIME(mime, modeSpec), - where modeSpec can be a string or object specifying a - mode, as in the mode - option.

- -
- -
 
- - - diff --git a/src/codemirror/mode/clike/clike.js b/src/codemirror/mode/clike/clike.js deleted file mode 100755 index 08b443a..0000000 --- a/src/codemirror/mode/clike/clike.js +++ /dev/null @@ -1,247 +0,0 @@ -CodeMirror.defineMode("clike", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "word"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -(function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "auto if break int case long char register continue return default short do sizeof " + - "double static else struct entry switch extern typedef float union for unsigned " + - "goto while enum void const signed volatile"; - - function cppHook(stream, state) { - if (!state.startOfLine) return false; - stream.skipToEnd(); - return "meta"; - } - - // C#-style strings where "" escapes a quote. - function tokenAtString(stream, state) { - var next; - while ((next = stream.next()) != null) { - if (next == '"' && !stream.eat('"')) { - state.tokenize = null; - break; - } - } - return "string"; - } - - CodeMirror.defineMIME("text/x-csrc", { - name: "clike", - keywords: words(cKeywords), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null"), - hooks: {"#": cppHook} - }); - CodeMirror.defineMIME("text/x-c++src", { - name: "clike", - keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + - "static_cast typeid catch operator template typename class friend private " + - "this using const_cast inline public throw virtual delete mutable protected " + - "wchar_t"), - blockKeywords: words("catch class do else finally for if struct switch try while"), - atoms: words("true false null"), - hooks: {"#": cppHook} - }); - CodeMirror.defineMIME("text/x-java", { - name: "clike", - keywords: words("abstract assert boolean break byte case catch char class const continue default " + - "do double else enum extends final finally float for goto if implements import " + - "instanceof int interface long native new package private protected public " + - "return short static strictfp super switch synchronized this throw throws transient " + - "try void volatile while"), - blockKeywords: words("catch class do else finally for if switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - CodeMirror.defineMIME("text/x-csharp", { - name: "clike", - keywords: words("abstract as base bool break byte case catch char checked class const continue decimal" + - " default delegate do double else enum event explicit extern finally fixed float for" + - " foreach goto if implicit in int interface internal is lock long namespace new object" + - " operator out override params private protected public readonly ref return sbyte sealed short" + - " sizeof stackalloc static string struct switch this throw try typeof uint ulong unchecked" + - " unsafe ushort using virtual void volatile while add alias ascending descending dynamic from get" + - " global group into join let orderby partial remove select set value var yield"), - blockKeywords: words("catch class do else finally for foreach if struct switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - if (stream.eat('"')) { - state.tokenize = tokenAtString; - return tokenAtString(stream, state); - } - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - CodeMirror.defineMIME("text/x-groovy", { - name: "clike", - keywords: words("abstract as assert boolean break byte case catch char class const continue def default " + - "do double else enum extends final finally float for goto if implements import " + - "in instanceof int interface long native new package property private protected public " + - "return short static strictfp super switch synchronized this throw throws transient " + - "try void volatile while"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); -}()); diff --git a/src/codemirror/mode/clike/index.html b/src/codemirror/mode/clike/index.html deleted file mode 100755 index 89241c0..0000000 --- a/src/codemirror/mode/clike/index.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - CodeMirror 2: C-like mode - - - - - - - - -

CodeMirror 2: C-like mode

- -
- - - -

Simple mode that tries to handle C-like languages as well as it - can. Takes two configuration parameters: keywords, an - object whose property names are the keywords in the language, - and useCPP, which determines whether C preprocessor - directives are recognized.

- -

MIME types defined: text/x-csrc - (C code), text/x-c++src (C++ - code), text/x-java (Java - code), text/x-groovy (Groovy code).

- - diff --git a/src/codemirror/mode/clojure/clojure.js b/src/codemirror/mode/clojure/clojure.js deleted file mode 100755 index a951589..0000000 --- a/src/codemirror/mode/clojure/clojure.js +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Author: Hans Engel - * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) - */ -CodeMirror.defineMode("clojure", function (config, mode) { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", TAG = "tag", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD="keyword"; - var INDENT_WORD_SKIP = 2, KEYWORDS_SKIP = 1; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var atoms = makeKeywords("true false nil"); - - var keywords = makeKeywords( - // Control structures - "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle" + - - // Built-ins - "* *1 *2 *3 *agent* *allow-unresolved-vars* *assert *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - / < <= = == > >= accessor aclone agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? extend extend-protocol extend-type extends? extenders false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reify reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq"); - - var indentKeys = makeKeywords( - // Built-ins - "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch" + - - // Binding forms - "let letfn binding loop for doseq dotimes when-let if-let" + - - // Data structures - "defstruct struct-map assoc" + - - // clojure.test - "testing deftest" + - - // contrib - "handler-case handle dotrace deftrace"); - - var tests = { - digit: /\d/, - digit_or_colon: /[\d:]/, - hex: /[0-9a-fA-F]/, - sign: /[+-]/, - exponent: /[eE]/, - keyword_char: /[^\s\(\[\;\)\]]/, - basic: /[\w\$_\-]/, - lang_keyword: /[\w*+!\-_?:\/]/ - }; - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - function isNumber(ch, stream){ - // hex - if ( ch === '0' && 'x' == stream.peek().toLowerCase() ) { - stream.eat('x'); - stream.eatWhile(tests.hex); - return true; - } - - // leading sign - if ( ch == '+' || ch == '-' ) { - stream.eat(tests.sign); - ch = stream.next(); - } - - if ( tests.digit.test(ch) ) { - stream.eat(ch); - stream.eatWhile(tests.digit); - - if ( '.' == stream.peek() ) { - stream.eat('.'); - stream.eatWhile(tests.digit); - } - - if ( 'e' == stream.peek().toLowerCase() ) { - stream.eat(tests.exponent); - stream.eat(tests.sign); - stream.eatWhile(tests.digit); - } - - return true; - } - - return false; - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in string mode - break; - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { - returnType = ATOM; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(); - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(tests.keyword_char)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - } - } else if ( ch == ":" ) { - stream.eatWhile(tests.lang_keyword); - return TAG; - } else { - stream.eatWhile(tests.basic); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else if ( atoms && atoms.propertyIsEnumerable(stream.current()) ) { - returnType = ATOM; - } else returnType = null; - } - } - - return returnType; - }, - - indent: function (state, textAfter) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-clojure", "clojure"); diff --git a/src/codemirror/mode/clojure/index.html b/src/codemirror/mode/clojure/index.html deleted file mode 100755 index e9cc3e7..0000000 --- a/src/codemirror/mode/clojure/index.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - CodeMirror 2: Clojure mode - - - - - - - - -

CodeMirror 2: Clojure mode

-
- - -

MIME types defined: text/x-clojure.

- - - diff --git a/src/codemirror/mode/coffeescript/LICENSE b/src/codemirror/mode/coffeescript/LICENSE deleted file mode 100755 index 977e284..0000000 --- a/src/codemirror/mode/coffeescript/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2011 Jeff Pickhardt -Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/src/codemirror/mode/coffeescript/coffeescript.js b/src/codemirror/mode/coffeescript/coffeescript.js deleted file mode 100755 index d4d5723..0000000 --- a/src/codemirror/mode/coffeescript/coffeescript.js +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Link to the project's GitHub page: - * https://github.com/pickhardt/coffeescript-codemirror-mode - */ -CodeMirror.defineMode('coffeescript', function(conf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"); - var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var wordOperators = wordRegexp(['and', 'or', 'not', - 'is', 'isnt', 'in', - 'instanceof', 'typeof']); - var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else', - 'switch', 'try', 'catch', 'finally', 'class']; - var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete', - 'do', 'in', 'of', 'new', 'return', 'then', - 'this', 'throw', 'when', 'until']; - - var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); - - indentKeywords = wordRegexp(indentKeywords); - - - var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])"); - var regexPrefixes = new RegExp("^(/{3}|/)"); - var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no']; - var constants = wordRegexp(commonConstants); - - // Tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - var scopeOffset = state.scopes[0].offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) { - return 'indent'; - } else if (lineOffset < scopeOffset) { - return 'dedent'; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle comments - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - // Handle number literals - if (stream.match(/^-?[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { - floatLiteral = true; - } - if (stream.match(/^-?\d+\.\d*/)) { - floatLiteral = true; - } - if (stream.match(/^-?\.\d+/)) { - floatLiteral = true; - } - if (floatLiteral) { - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^-?0x[0-9a-f]+/i)) { - intLiteral = true; - } - // Decimal - if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^-?0(?![\dx])/i)) { - intLiteral = true; - } - if (intLiteral) { - return 'number'; - } - } - - // Handle strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenFactory(stream.current(), 'string'); - return state.tokenize(stream, state); - } - // Handle regex literals - if (stream.match(regexPrefixes)) { - if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division - state.tokenize = tokenFactory(stream.current(), 'string-2'); - return state.tokenize(stream, state); - } else { - stream.backUp(1); - } - } - - // Handle operators and delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return 'punctuation'; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return 'punctuation'; - } - - if (stream.match(constants)) { - return 'atom'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenFactory(delimiter, outclass) { - var delim_re = new RegExp(delimiter); - var singleline = delimiter.length == 1; - - return function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\/\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return outclass; - } - } else if (stream.match(delim_re)) { - state.tokenize = tokenBase; - return outclass; - } else { - stream.eat(/['"\/]/); - } - } - if (singleline) { - if (conf.mode.singleLineStringErrors) { - outclass = ERRORCLASS - } else { - state.tokenize = tokenBase; - } - } - return outclass; - }; - } - - function indent(stream, state, type) { - type = type || 'coffee'; - var indentUnit = 0; - if (type === 'coffee') { - for (var i = 0; i < state.scopes.length; i++) { - if (state.scopes[i].type === 'coffee') { - indentUnit = state.scopes[i].offset + conf.indentUnit; - break; - } - } - } else { - indentUnit = stream.column() + stream.current().length; - } - state.scopes.unshift({ - offset: indentUnit, - type: type - }); - } - - function dedent(stream, state) { - if (state.scopes.length == 1) return; - if (state.scopes[0].type === 'coffee') { - var _indent = stream.indentation(); - var _indent_index = -1; - for (var i = 0; i < state.scopes.length; ++i) { - if (_indent === state.scopes[i].offset) { - _indent_index = i; - break; - } - } - if (_indent_index === -1) { - return true; - } - while (state.scopes[0].offset !== _indent) { - state.scopes.shift(); - } - return false - } else { - state.scopes.shift(); - return false; - } - } - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - // Handle properties - if (current === '@') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable-2'; - } else { - return ERRORCLASS; - } - } - - // Handle scope changes. - if (current === 'return') { - state.dedent += 1; - } - if (((current === '->' || current === '=>') && - !state.lambda && - state.scopes[0].type == 'coffee' && - stream.peek() === '') - || style === 'indent') { - indent(stream, state); - } - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); - } - if (indentKeywords.exec(current)){ - indent(stream, state); - } - if (current == 'then'){ - dedent(stream, state); - } - - - if (style === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') { - if (state.scopes.length > 1) state.scopes.shift(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset:basecolumn || 0, type:'coffee'}], - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (stream.eol() && stream.lambda) { - state.lambda = false; - } - - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) { - return 0; - } - - return state.scopes[0].offset; - } - - }; - return external; -}); - -CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript'); diff --git a/src/codemirror/mode/coffeescript/index.html b/src/codemirror/mode/coffeescript/index.html deleted file mode 100755 index c1984df..0000000 --- a/src/codemirror/mode/coffeescript/index.html +++ /dev/null @@ -1,722 +0,0 @@ - - - - CodeMirror 2: CoffeeScript mode - - - - - - - - -

CodeMirror 2: CoffeeScript mode

-
- - -

MIME types defined: text/x-coffeescript.

- -

The CoffeeScript mode was written by Jeff Pickhardt (license).

- - - diff --git a/src/codemirror/mode/css/css.js b/src/codemirror/mode/css/css.js deleted file mode 100755 index 45170a3..0000000 --- a/src/codemirror/mode/css/css.js +++ /dev/null @@ -1,124 +0,0 @@ -CodeMirror.defineMode("css", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (/[,.+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (/[;{}:\[\]]/.test(ch)) { - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("variable", "variable"); - } - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = "number"; - else if (!context || context == "@media{") style = "tag"; - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/css", "css"); diff --git a/src/codemirror/mode/css/index.html b/src/codemirror/mode/css/index.html deleted file mode 100755 index 7d01e36..0000000 --- a/src/codemirror/mode/css/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - CodeMirror 2: CSS mode - - - - - - - - -

CodeMirror 2: CSS mode

-
- - -

MIME types defined: text/css.

- - - diff --git a/src/codemirror/mode/diff/diff.css b/src/codemirror/mode/diff/diff.css deleted file mode 100755 index 16f8d33..0000000 --- a/src/codemirror/mode/diff/diff.css +++ /dev/null @@ -1,3 +0,0 @@ -.cm-s-default span.cm-rangeinfo {color: #a0b;} -.cm-s-default span.cm-minus {color: #a22;} -.cm-s-default span.cm-plus {color: #2b2;} diff --git a/src/codemirror/mode/diff/diff.js b/src/codemirror/mode/diff/diff.js deleted file mode 100755 index 725bb2c..0000000 --- a/src/codemirror/mode/diff/diff.js +++ /dev/null @@ -1,13 +0,0 @@ -CodeMirror.defineMode("diff", function() { - return { - token: function(stream) { - var ch = stream.next(); - stream.skipToEnd(); - if (ch == "+") return "plus"; - if (ch == "-") return "minus"; - if (ch == "@") return "rangeinfo"; - } - }; -}); - -CodeMirror.defineMIME("text/x-diff", "diff"); diff --git a/src/codemirror/mode/diff/index.html b/src/codemirror/mode/diff/index.html deleted file mode 100755 index 2748f2f..0000000 --- a/src/codemirror/mode/diff/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - CodeMirror 2: Diff mode - - - - - - - - -

CodeMirror 2: Diff mode

-
- - -

MIME types defined: text/x-diff.

- - - diff --git a/src/codemirror/mode/haskell/haskell.js b/src/codemirror/mode/haskell/haskell.js deleted file mode 100755 index aac5041..0000000 --- a/src/codemirror/mode/haskell/haskell.js +++ /dev/null @@ -1,242 +0,0 @@ -CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) { - - function switchState(source, setState, f) { - setState(f); - return f(source, setState); - } - - // These should all be Unicode extended, as per the Haskell 2010 report - var smallRE = /[a-z_]/; - var largeRE = /[A-Z]/; - var digitRE = /[0-9]/; - var hexitRE = /[0-9A-Fa-f]/; - var octitRE = /[0-7]/; - var idRE = /[a-z_A-Z0-9']/; - var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; - var specialRE = /[(),;[\]`{}]/; - var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer - - function normal(source, setState) { - if (source.eatWhile(whiteCharRE)) { - return null; - } - - var ch = source.next(); - if (specialRE.test(ch)) { - if (ch == '{' && source.eat('-')) { - var t = "comment"; - if (source.eat('#')) { - t = "meta"; - } - return switchState(source, setState, ncomment(t, 1)); - } - return null; - } - - if (ch == '\'') { - if (source.eat('\\')) { - source.next(); // should handle other escapes here - } - else { - source.next(); - } - if (source.eat('\'')) { - return "string"; - } - return "error"; - } - - if (ch == '"') { - return switchState(source, setState, stringLiteral); - } - - if (largeRE.test(ch)) { - source.eatWhile(idRE); - if (source.eat('.')) { - return "qualifier"; - } - return "variable-2"; - } - - if (smallRE.test(ch)) { - source.eatWhile(idRE); - return "variable"; - } - - if (digitRE.test(ch)) { - if (ch == '0') { - if (source.eat(/[xX]/)) { - source.eatWhile(hexitRE); // should require at least 1 - return "integer"; - } - if (source.eat(/[oO]/)) { - source.eatWhile(octitRE); // should require at least 1 - return "number"; - } - } - source.eatWhile(digitRE); - var t = "number"; - if (source.eat('.')) { - t = "number"; - source.eatWhile(digitRE); // should require at least 1 - } - if (source.eat(/[eE]/)) { - t = "number"; - source.eat(/[-+]/); - source.eatWhile(digitRE); // should require at least 1 - } - return t; - } - - if (symbolRE.test(ch)) { - if (ch == '-' && source.eat(/-/)) { - source.eatWhile(/-/); - if (!source.eat(symbolRE)) { - source.skipToEnd(); - return "comment"; - } - } - var t = "variable"; - if (ch == ':') { - t = "variable-2"; - } - source.eatWhile(symbolRE); - return t; - } - - return "error"; - } - - function ncomment(type, nest) { - if (nest == 0) { - return normal; - } - return function(source, setState) { - var currNest = nest; - while (!source.eol()) { - var ch = source.next(); - if (ch == '{' && source.eat('-')) { - ++currNest; - } - else if (ch == '-' && source.eat('}')) { - --currNest; - if (currNest == 0) { - setState(normal); - return type; - } - } - } - setState(ncomment(type, currNest)); - return type; - } - } - - function stringLiteral(source, setState) { - while (!source.eol()) { - var ch = source.next(); - if (ch == '"') { - setState(normal); - return "string"; - } - if (ch == '\\') { - if (source.eol() || source.eat(whiteCharRE)) { - setState(stringGap); - return "string"; - } - if (source.eat('&')) { - } - else { - source.next(); // should handle other escapes here - } - } - } - setState(normal); - return "error"; - } - - function stringGap(source, setState) { - if (source.eat('\\')) { - return switchState(source, setState, stringLiteral); - } - source.next(); - setState(normal); - return "error"; - } - - - var wellKnownWords = (function() { - var wkw = {}; - function setType(t) { - return function () { - for (var i = 0; i < arguments.length; i++) - wkw[arguments[i]] = t; - } - } - - setType("keyword")( - "case", "class", "data", "default", "deriving", "do", "else", "foreign", - "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", - "module", "newtype", "of", "then", "type", "where", "_"); - - setType("keyword")( - "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); - - setType("builtin")( - "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", - "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); - - setType("builtin")( - "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", - "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", - "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", - "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", - "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", - "String", "True"); - - setType("builtin")( - "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", - "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", - "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", - "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", - "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", - "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", - "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", - "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", - "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", - "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", - "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", - "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", - "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", - "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", - "otherwise", "pi", "pred", "print", "product", "properFraction", - "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", - "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", - "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", - "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", - "sequence", "sequence_", "show", "showChar", "showList", "showParen", - "showString", "shows", "showsPrec", "significand", "signum", "sin", - "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", - "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", - "toRational", "truncate", "uncurry", "undefined", "unlines", "until", - "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", - "zip3", "zipWith", "zipWith3"); - - return wkw; - })(); - - - - return { - startState: function () { return { f: normal }; }, - copyState: function (s) { return { f: s.f }; }, - - token: function(stream, state) { - var t = state.f(stream, function(s) { state.f = s; }); - var w = stream.current(); - return (w in wellKnownWords) ? wellKnownWords[w] : t; - } - }; - -}); - -CodeMirror.defineMIME("text/x-haskell", "haskell"); diff --git a/src/codemirror/mode/haskell/index.html b/src/codemirror/mode/haskell/index.html deleted file mode 100755 index 6ea7f5e..0000000 --- a/src/codemirror/mode/haskell/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - CodeMirror 2: Haskell mode - - - - - - - - -

CodeMirror 2: Haskell mode

- -
- - - -

MIME types defined: text/x-haskell.

- - diff --git a/src/codemirror/mode/htmlmixed/htmlmixed.js b/src/codemirror/mode/htmlmixed/htmlmixed.js deleted file mode 100755 index fa30a13..0000000 --- a/src/codemirror/mode/htmlmixed/htmlmixed.js +++ /dev/null @@ -1,79 +0,0 @@ -CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); - var jsMode = CodeMirror.getMode(config, "javascript"); - var cssMode = CodeMirror.getMode(config, "css"); - - function html(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if (style == "tag" && stream.current() == ">" && state.htmlState.context) { - if (/^script$/i.test(state.htmlState.context.tagName)) { - state.token = javascript; - state.localState = jsMode.startState(htmlMode.indent(state.htmlState, "")); - state.mode = "javascript"; - } - else if (/^style$/i.test(state.htmlState.context.tagName)) { - state.token = css; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - state.mode = "css"; - } - } - return style; - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat); - if (close > -1) stream.backUp(cur.length - close); - return style; - } - function javascript(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.curState = null; - state.mode = "html"; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*script\s*>/, - jsMode.token(stream, state.localState)); - } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = null; - state.mode = "html"; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); - } - - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localState: null, mode: "html", htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState); - return {token: state.token, localState: local, mode: state.mode, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == html || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.token == javascript) - return jsMode.indent(state.localState, textAfter); - else - return cssMode.indent(state.localState, textAfter); - }, - - electricChars: "/{}:" - } -}); - -CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/src/codemirror/mode/htmlmixed/index.html b/src/codemirror/mode/htmlmixed/index.html deleted file mode 100755 index 6d62b35..0000000 --- a/src/codemirror/mode/htmlmixed/index.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - CodeMirror 2: HTML mixed mode - - - - - - - - - - - -

CodeMirror 2: HTML mixed mode

-
- - -

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

- -

MIME types defined: text/html - (redefined, only takes effect if you load this parser after the - XML parser).

- - - diff --git a/src/codemirror/mode/javascript/index.html b/src/codemirror/mode/javascript/index.html deleted file mode 100755 index 2454c81..0000000 --- a/src/codemirror/mode/javascript/index.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - CodeMirror 2: JavaScript mode - - - - - - - - -

CodeMirror 2: JavaScript mode

- -
- - - -

JavaScript mode supports a single configuration - option, json, which will set the mode to expect JSON - data rather than a JavaScript program.

- -

MIME types defined: text/javascript, application/json.

- - diff --git a/src/codemirror/mode/javascript/javascript.js b/src/codemirror/mode/javascript/javascript.js deleted file mode 100755 index d3f9289..0000000 --- a/src/codemirror/mode/javascript/javascript.js +++ /dev/null @@ -1,352 +0,0 @@ -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var jsonMode = parserConfig.json; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - return { - "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, - "var": kw("var"), "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom - }; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function nextUntilUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) - return false; - escaped = !escaped && next == "\\"; - } - return escaped; - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") - return chain(stream, state, jsTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) - return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/); - return ret("number", "number"); - } - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, jsTokenComment); - } - else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (state.reAllowed) { - nextUntilUnescaped(stream, "/"); - stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla - return ret("regexp", "string"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("error", "error"); - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - else { - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return known ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - - function jsTokenString(quote) { - return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) - state.tokenize = jsTokenBase; - return ret("string", "string"); - }; - } - - function jsTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - var state = cx.state; - if (state.context) { - cx.marked = "def"; - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return; - state.localVars = {name: varname, next: state.localVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: {name: "arguments"}}; - function pushcontext() { - if (!cx.state.context) cx.state.localVars = defaultVars; - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info) - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - return function expecting(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(arguments.callee); - }; - } - - function statement(type) { - if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); - if (type == ";") return cont(); - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), - poplex, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); - if (type == "function") return cont(functiondef); - if (type == "keyword c") return cont(expression); - if (type == "(") return cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator); - if (type == "operator") return cont(expression); - if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); - if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); - return cont(); - } - function maybeoperator(type, value) { - if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); - if (type == "operator") return cont(expression); - if (type == ";") return; - if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); - if (type == ".") return cont(property, maybeoperator); - if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperator, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type) { - if (type == "variable") cx.marked = "property"; - if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") return cont(what, proceed); - if (type == end) return cont(); - return cont(expect(end)); - } - return function commaSeparated(type) { - if (type == end) return cont(); - else return pass(what, proceed); - }; - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function vardef1(type, value) { - if (type == "variable"){register(value); return cont(vardef2);} - return cont(); - } - function vardef2(type, value) { - if (value == "=") return cont(expression, vardef2); - if (type == ",") return cont(vardef1); - } - function forspec1(type) { - if (type == "var") return cont(vardef1, forspec2); - if (type == ";") return pass(forspec2); - if (type == "variable") return cont(formaybein); - return pass(forspec2); - } - function formaybein(type, value) { - if (value == "in") return cont(expression); - return cont(maybeoperator, forspec2); - } - function forspec2(type, value) { - if (type == ";") return cont(forspec3); - if (value == "in") return cont(expression); - return cont(expression, expect(";"), forspec3); - } - function forspec3(type) { - if (type != ")") cont(expression); - } - function functiondef(type, value) { - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); - } - function funarg(type, value) { - if (type == "variable") {register(value); return cont();} - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: jsTokenBase, - reAllowed: true, - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: null, - context: null, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.reAllowed = type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/); - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize != jsTokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + 4; - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "stat" || type == "form") return lexical.indented + indentUnit; - else if (lexical.info == "switch" && !closing) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricChars: ":{}" - }; -}); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); diff --git a/src/codemirror/mode/jinja2/index.html b/src/codemirror/mode/jinja2/index.html deleted file mode 100755 index ffb06e8..0000000 --- a/src/codemirror/mode/jinja2/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - CodeMirror 2: Jinja2 mode - - - - - - - - -

CodeMirror 2: Jinja2 mode

-
- - - diff --git a/src/codemirror/mode/jinja2/jinja2.js b/src/codemirror/mode/jinja2/jinja2.js deleted file mode 100755 index 75419d8..0000000 --- a/src/codemirror/mode/jinja2/jinja2.js +++ /dev/null @@ -1,42 +0,0 @@ -CodeMirror.defineMode("jinja2", function(config, parserConf) { - var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", - "loop", "none", "self", "super", "if", "as", "not", "and", - "else", "import", "with", "without", "context"]; - keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - var ch = stream.next(); - if (ch == "{") { - if (ch = stream.eat(/\{|%|#/)) { - stream.eat("-"); - state.tokenize = inTag(ch); - return "tag"; - } - } - } - function inTag (close) { - if (close == "{") { - close = "}"; - } - return function (stream, state) { - var ch = stream.next(); - if ((ch == close || (ch == "-" && stream.eat(close))) - && stream.eat("}")) { - state.tokenize = tokenBase; - return "tag"; - } - if (stream.match(keywords)) { - return "keyword"; - } - return close == "#" ? "comment" : "string"; - }; - } - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; -}); diff --git a/src/codemirror/mode/lua/index.html b/src/codemirror/mode/lua/index.html deleted file mode 100755 index 532973a..0000000 --- a/src/codemirror/mode/lua/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - CodeMirror 2: Lua mode - - - - - - - - -

CodeMirror 2: Lua mode

-
- - -

Loosely based on Franciszek - Wawrzak's CodeMirror - 1 mode. One configuration parameter is - supported, specials, to which you can provide an - array of strings to have those identifiers highlighted with - the lua-special style.

-

MIME types defined: text/x-lua.

- - - diff --git a/src/codemirror/mode/lua/lua.js b/src/codemirror/mode/lua/lua.js deleted file mode 100755 index f96737a..0000000 --- a/src/codemirror/mode/lua/lua.js +++ /dev/null @@ -1,140 +0,0 @@ -// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's -// CodeMirror 1 mode. -// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting - -CodeMirror.defineMode("lua", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - function prefixRE(words) { - return new RegExp("^(?:" + words.join("|") + ")", "i"); - } - function wordRE(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var specials = wordRE(parserConfig.specials || []); - - // long list of standard functions from lua manual - var builtins = wordRE([ - "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", - "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", - "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", - - "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", - - "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", - "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", - "debug.setupvalue","debug.traceback", - - "close","flush","lines","read","seek","setvbuf","write", - - "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", - "io.stdout","io.tmpfile","io.type","io.write", - - "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", - "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", - "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", - "math.sqrt","math.tan","math.tanh", - - "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", - "os.time","os.tmpname", - - "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", - "package.seeall", - - "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", - "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", - - "table.concat","table.insert","table.maxn","table.remove","table.sort" - ]); - var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", - "true","function", "end", "if", "then", "else", "do", - "while", "repeat", "until", "for", "in", "local" ]); - - var indentTokens = wordRE(["function", "if","repeat","for","while", "\\(", "{"]); - var dedentTokens = wordRE(["end", "until", "\\)", "}"]); - var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); - - function readBracket(stream) { - var level = 0; - while (stream.eat("=")) ++level; - stream.eat("["); - return level; - } - - function normal(stream, state) { - var ch = stream.next(); - if (ch == "-" && stream.eat("-")) { - if (stream.eat("[")) - return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); - stream.skipToEnd(); - return "comment"; - } - if (ch == "\"" || ch == "'") - return (state.cur = string(ch))(stream, state); - if (ch == "[" && /[\[=]/.test(stream.peek())) - return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); - if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return "number"; - } - if (/[\w_]/.test(ch)) { - stream.eatWhile(/[\w\\\-_.]/); - return "variable"; - } - return null; - } - - function bracketed(level, style) { - return function(stream, state) { - var curlev = null, ch; - while ((ch = stream.next()) != null) { - if (curlev == null) {if (ch == "]") curlev = 0;} - else if (ch == "=") ++curlev; - else if (ch == "]" && curlev == level) { state.cur = normal; break; } - else curlev = null; - } - return style; - }; - } - - function string(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.cur = normal; - return "string"; - }; - } - - return { - startState: function(basecol) { - return {basecol: basecol || 0, indentDepth: 0, cur: normal}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.cur(stream, state); - var word = stream.current(); - if (style == "variable") { - if (keywords.test(word)) style = "keyword"; - else if (builtins.test(word)) style = "builtin"; - else if (specials.test(word)) style = "variable-2"; - } - if ((style != "lua-comment") && (style != "lua-string")){ - if (indentTokens.test(word)) ++state.indentDepth; - else if (dedentTokens.test(word)) --state.indentDepth; - } - return style; - }, - - indent: function(state, textAfter) { - var closing = dedentPartial.test(textAfter); - return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); - } - }; -}); - -CodeMirror.defineMIME("text/x-lua", "lua"); diff --git a/src/codemirror/mode/markdown/index.html b/src/codemirror/mode/markdown/index.html deleted file mode 100755 index 106b545..0000000 --- a/src/codemirror/mode/markdown/index.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - CodeMirror 2: Markdown mode - - - - - - - - - - -

CodeMirror 2: Markdown mode

- - -
- - - -

MIME types defined: text/x-markdown.

- - - diff --git a/src/codemirror/mode/markdown/markdown.css b/src/codemirror/mode/markdown/markdown.css deleted file mode 100755 index c053e3f..0000000 --- a/src/codemirror/mode/markdown/markdown.css +++ /dev/null @@ -1,10 +0,0 @@ -.cm-s-default span.cm-header {color: #2f2f4f; font-weight:bold;} -.cm-s-default span.cm-code {color: #666;} -.cm-s-default span.cm-quote {color: #090;} -.cm-s-default span.cm-list {color: #a50;} -.cm-s-default span.cm-hr {color: #999;} -.cm-s-default span.cm-linktext {color: #00c; text-decoration: underline;} -.cm-s-default span.cm-linkhref {color: #00c;} -.cm-s-default span.cm-em {font-style: italic;} -.cm-s-default span.cm-strong {font-weight: bold;} -.cm-s-default span.cm-emstrong {font-style: italic; font-weight: bold;} diff --git a/src/codemirror/mode/markdown/markdown.js b/src/codemirror/mode/markdown/markdown.js deleted file mode 100755 index 75f0a63..0000000 --- a/src/codemirror/mode/markdown/markdown.js +++ /dev/null @@ -1,230 +0,0 @@ -CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var htmlMode = CodeMirror.getMode(cmCfg, { name: 'xml', htmlMode: true }); - - var header = 'header' - , code = 'code' - , quote = 'quote' - , list = 'list' - , hr = 'hr' - , linktext = 'linktext' - , linkhref = 'linkhref' - , em = 'em' - , strong = 'strong' - , emstrong = 'emstrong'; - - var hrRE = /^[*-=_]/ - , ulRE = /^[*-+]\s+/ - , olRE = /^[0-9]\.\s+/ - , headerRE = /^(?:\={3,}|-{3,})$/ - , codeRE = /^(k:\t|\s{4,})/ - , textRE = /^[^\[*_\\<>`]+/; - - function switchInline(stream, state, f) { - state.f = state.inline = f; - return f(stream, state); - } - - function switchBlock(stream, state, f) { - state.f = state.block = f; - return f(stream, state); - } - - - // Blocks - - function blockNormal(stream, state) { - if (stream.match(codeRE)) { - stream.skipToEnd(); - return code; - } - - if (stream.eatSpace()) { - return null; - } - - if (stream.peek() === '#' || stream.match(headerRE)) { - stream.skipToEnd(); - return header; - } - if (stream.eat('>')) { - state.indentation++; - return quote; - } - if (stream.peek() === '<') { - return switchBlock(stream, state, htmlBlock); - } - if (stream.peek() === '[') { - return switchInline(stream, state, footnoteLink); - } - if (hrRE.test(stream.peek())) { - var re = new RegExp('(?:\s*['+stream.peek()+']){3,}$'); - if (stream.match(re, true)) { - return hr; - } - } - - var match; - if (match = stream.match(ulRE, true) || stream.match(olRE, true)) { - state.indentation += match[0].length; - return list; - } - - return switchInline(stream, state, state.inline); - } - - function htmlBlock(stream, state) { - var type = htmlMode.token(stream, state.htmlState); - if (stream.eol() && !state.htmlState.context) { - state.block = blockNormal; - } - return type; - } - - - // Inline - - function inlineNormal(stream, state) { - function getType() { - return state.strong ? (state.em ? emstrong : strong) - : (state.em ? em : null); - } - - if (stream.match(textRE, true)) { - return getType(); - } - - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return getType(); - } - if (ch === '`') { - return switchInline(stream, state, inlineElement(code, '`')); - } - if (ch === '<') { - return switchInline(stream, state, inlineElement(linktext, '>')); - } - if (ch === '[') { - return switchInline(stream, state, linkText); - } - - var t = getType(); - if (ch === '*' || ch === '_') { - if (stream.eat(ch)) { - return (state.strong = !state.strong) ? getType() : t; - } - return (state.em = !state.em) ? getType() : t; - } - - return getType(); - } - - function linkText(stream, state) { - while (!stream.eol()) { - var ch = stream.next(); - if (ch === '\\') stream.next(); - if (ch === ']') { - state.inline = state.f = linkHref; - return linktext; - } - } - return linktext; - } - - function linkHref(stream, state) { - stream.eatSpace(); - var ch = stream.next(); - if (ch === '(' || ch === '[') { - return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']')); - } - return 'error'; - } - - function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, true)) { - state.f = footnoteUrl; - return linktext; - } - return switchInline(stream, state, inlineNormal); - } - - function footnoteUrl(stream, state) { - stream.eatSpace(); - stream.match(/^[^\s]+/, true); - state.f = state.inline = inlineNormal; - return linkhref; - } - - function inlineElement(type, endChar, next) { - next = next || inlineNormal; - return function(stream, state) { - while (!stream.eol()) { - var ch = stream.next(); - if (ch === '\\') stream.next(); - if (ch === endChar) { - state.inline = state.f = next; - return type; - } - } - return type; - }; - } - - return { - startState: function() { - return { - f: blockNormal, - - block: blockNormal, - htmlState: htmlMode.startState(), - indentation: 0, - - inline: inlineNormal, - em: false, - strong: false - }; - }, - - copyState: function(s) { - return { - f: s.f, - - block: s.block, - htmlState: CodeMirror.copyState(htmlMode, s.htmlState), - indentation: s.indentation, - - inline: s.inline, - em: s.em, - strong: s.strong - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.f = state.block; - var previousIndentation = state.indentation - , currentIndentation = 0; - while (previousIndentation > 0) { - if (stream.eat(' ')) { - previousIndentation--; - currentIndentation++; - } else if (previousIndentation >= 4 && stream.eat('\t')) { - previousIndentation -= 4; - currentIndentation += 4; - } else { - break; - } - } - state.indentation = currentIndentation; - - if (currentIndentation > 0) return null; - } - return state.f(stream, state); - } - }; - -}); - -CodeMirror.defineMIME("text/x-markdown", "markdown"); diff --git a/src/codemirror/mode/ntriples/index.html b/src/codemirror/mode/ntriples/index.html deleted file mode 100755 index 128112c..0000000 --- a/src/codemirror/mode/ntriples/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - CodeMirror 2: NTriples mode - - - - - - - - -

CodeMirror 2: NTriples mode

-
- - - - -

MIME types defined: text/n-triples.

- - diff --git a/src/codemirror/mode/ntriples/ntriples.js b/src/codemirror/mode/ntriples/ntriples.js deleted file mode 100755 index 3b6cb41..0000000 --- a/src/codemirror/mode/ntriples/ntriples.js +++ /dev/null @@ -1,172 +0,0 @@ -/********************************************************** -* This script provides syntax highlighting support for -* the Ntriples format. -* Ntriples format specification: -* http://www.w3.org/TR/rdf-testcases/#ntriples -***********************************************************/ - -/* - The following expression defines the defined ASF grammar transitions. - - pre_subject -> - { - ( writing_subject_uri | writing_bnode_uri ) - -> pre_predicate - -> writing_predicate_uri - -> pre_object - -> writing_object_uri | writing_object_bnode | - ( - writing_object_literal - -> writing_literal_lang | writing_literal_type - ) - -> post_object - -> BEGIN - } otherwise { - -> ERROR - } -*/ -CodeMirror.defineMode("ntriples", function() { - - Location = { - PRE_SUBJECT : 0, - WRITING_SUB_URI : 1, - WRITING_BNODE_URI : 2, - PRE_PRED : 3, - WRITING_PRED_URI : 4, - PRE_OBJ : 5, - WRITING_OBJ_URI : 6, - WRITING_OBJ_BNODE : 7, - WRITING_OBJ_LITERAL : 8, - WRITING_LIT_LANG : 9, - WRITING_LIT_TYPE : 10, - POST_OBJ : 11, - ERROR : 12 - }; - function transitState(currState, c) { - var currLocation = currState.location; - var ret; - - // Opening. - if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; - else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; - else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; - else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; - else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; - else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; - - // Closing. - else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; - else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; - - // Closing typed and language literal. - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; - - // Spaces. - else if( c == ' ' && - ( - currLocation == Location.PRE_SUBJECT || - currLocation == Location.PRE_PRED || - currLocation == Location.PRE_OBJ || - currLocation == Location.POST_OBJ - ) - ) ret = currLocation; - - // Reset. - else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; - - // Error - else ret = Location.ERROR; - - currState.location=ret; - } - - untilSpace = function(c) { return c != ' '; }; - untilEndURI = function(c) { return c != '>'; }; - return { - startState: function() { - return { - location : Location.PRE_SUBJECT, - uris : [], - anchors : [], - bnodes : [], - langs : [], - types : [] - }; - }, - token: function(stream, state) { - var ch = stream.next(); - if(ch == '<') { - transitState(state, ch); - var parsedURI = ''; - stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); - state.uris.push(parsedURI); - if( stream.match('#', false) ) return 'variable'; - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if(ch == '#') { - var parsedAnchor = ''; - stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false}); - state.anchors.push(parsedAnchor); - return 'variable-2'; - } - if(ch == '>') { - transitState(state, '>'); - return 'variable'; - } - if(ch == '_') { - transitState(state, ch); - var parsedBNode = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); - state.bnodes.push(parsedBNode); - stream.next(); - transitState(state, ' '); - return 'builtin'; - } - if(ch == '"') { - transitState(state, ch); - stream.eatWhile( function(c) { return c != '"'; } ); - stream.next(); - if( stream.peek() != '@' && stream.peek() != '^' ) { - transitState(state, '"'); - } - return 'string'; - } - if( ch == '@' ) { - transitState(state, '@'); - var parsedLang = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); - state.langs.push(parsedLang); - stream.next(); - transitState(state, ' '); - return 'string-2'; - } - if( ch == '^' ) { - stream.next(); - transitState(state, '^'); - var parsedType = ''; - stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); - state.types.push(parsedType); - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if( ch == ' ' ) { - transitState(state, ch); - } - if( ch == '.' ) { - transitState(state, ch); - } - } - }; -}); - -CodeMirror.defineMIME("text/n-triples", "ntriples"); diff --git a/src/codemirror/mode/pascal/LICENSE b/src/codemirror/mode/pascal/LICENSE deleted file mode 100755 index 8e3747e..0000000 --- a/src/codemirror/mode/pascal/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2011 souceLair - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/codemirror/mode/pascal/index.html b/src/codemirror/mode/pascal/index.html deleted file mode 100755 index f8f59e2..0000000 --- a/src/codemirror/mode/pascal/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - CodeMirror 2: Pascal mode - - - - - - - - -

CodeMirror 2: Pascal mode

- -
- - - -

MIME types defined: text/x-pascal.

- - diff --git a/src/codemirror/mode/pascal/pascal.js b/src/codemirror/mode/pascal/pascal.js deleted file mode 100755 index 86c6f71..0000000 --- a/src/codemirror/mode/pascal/pascal.js +++ /dev/null @@ -1,138 +0,0 @@ -CodeMirror.defineMode("pascal", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words("and array begin case const div do downto else end file for forward integer " + - "boolean char function goto if in label mod nil not of or packed procedure " + - "program record repeat set string then to type until var while with"); - var blockKeywords = words("case do else for if switch while struct then of"); - var atoms = {"null": true}; - - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "#" && state.startOfLine) { - stream.skipToEnd(); - return "meta"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (ch == "(" && stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "word"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" ) - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == ctx.type) popContext(state); - else if ( ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-pascal", "pascal"); diff --git a/src/codemirror/mode/php/index.html b/src/codemirror/mode/php/index.html deleted file mode 100755 index 9e545c9..0000000 --- a/src/codemirror/mode/php/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - CodeMirror 2: PHP mode - - - - - - - - - - - - -

CodeMirror 2: PHP mode

- -
- - - -

Simple HTML/PHP mode based on - the C-like mode. Depends on XML, - JavaScript, CSS, and C-like modes.

- -

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

- - diff --git a/src/codemirror/mode/php/php.js b/src/codemirror/mode/php/php.js deleted file mode 100755 index 00655be..0000000 --- a/src/codemirror/mode/php/php.js +++ /dev/null @@ -1,116 +0,0 @@ -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - function heredoc(delim) { - return function(stream, state) { - if (stream.match(delim)) state.tokenize = null; - else stream.skipToEnd(); - return "string"; - } - } - var phpConfig = { - name: "clike", - keywords: keywords("abstract and array as break case catch cfunction class clone const continue declare " + - "default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends " + - "final for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw try use var while xor return" + - "die echo empty exit eval include include_once isset list require require_once print unset"), - blockKeywords: keywords("catch do else elseif for foreach if switch try while"), - atoms: keywords("true false null TRUE FALSE NULL"), - multiLineStrings: true, - hooks: { - "$": function(stream, state) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/</; - state.mode = 'php'; - } - else if (style == "tag" && stream.current() == ">" && state.curState.context) { - if (/^script$/i.test(state.curState.context.tagName)) { - state.curMode = jsMode; - state.curState = jsMode.startState(htmlMode.indent(state.curState, "")); - state.curClose = /^<\/\s*script\s*>/i; - state.mode = 'javascript'; - } - else if (/^style$/i.test(state.curState.context.tagName)) { - state.curMode = cssMode; - state.curState = cssMode.startState(htmlMode.indent(state.curState, "")); - state.curClose = /^<\/\s*style\s*>/i; - state.mode = 'css'; - } - } - return style; - } - else if (stream.match(state.curClose, false)) { - state.curMode = htmlMode; - state.curState = state.html; - state.curClose = null; - state.mode = 'html'; - return dispatch(stream, state); - } - else return state.curMode.token(stream, state.curState); - } - - return { - startState: function() { - var html = htmlMode.startState(); - return {html: html, - php: phpMode.startState(), - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? phpMode.startState() : html, - curClose: parserConfig.startOpen ? /^\?>/ : null, - mode: parserConfig.startOpen ? 'php' : 'html'} - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curState == html) cur = htmlNew; - else if (state.curState == php) cur = phpNew; - else cur = CodeMirror.copyState(state.curMode, state.curState); - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, curClose: state.curClose}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - electricChars: "/{}:" - } - }); - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -})(); diff --git a/src/codemirror/mode/plsql/index.html b/src/codemirror/mode/plsql/index.html deleted file mode 100755 index 8c7bf7c..0000000 --- a/src/codemirror/mode/plsql/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - CodeMirror 2: Oracle PL/SQL mode - - - - - - - - -

CodeMirror 2: Oracle PL/SQL mode

- -
- - - -

- Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course). -

- -

MIME type defined: text/x-plsql - (PLSQL code) - diff --git a/src/codemirror/mode/plsql/plsql.js b/src/codemirror/mode/plsql/plsql.js deleted file mode 100755 index a2ac2e8..0000000 --- a/src/codemirror/mode/plsql/plsql.js +++ /dev/null @@ -1,217 +0,0 @@ -CodeMirror.defineMode("plsql", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords, - functions = parserConfig.functions, - types = parserConfig.types, - sqlplus = parserConfig.sqlplus, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - // start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) - return ret(ch); - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return ret("number", "number"); - } - // multi line comment or simple operator? - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // single line comment or simple operator? - else if (ch == "-") { - if (stream.eat("-")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // pl/sql variable? - else if (ch == "@" || ch == "$") { - stream.eatWhile(/[\w\d\$_]/); - return ret("word", "variable"); - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - else { - // get the whole word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "keyword"); - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "builtin"); - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-2"); - // is it one of the listed sqlplus keywords? - if (sqlplus && sqlplus.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-3"); - // default: just a "word" - return ret("word", "plsql-word"); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return ret("string", "plsql-string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "plsql-comment"); - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "abort accept access add all alter and any array arraylen as asc assert assign at attributes audit " + - "authorization avg " + - "base_table begin between binary_integer body boolean by " + - "case cast char char_base check close cluster clusters colauth column comment commit compress connect " + - "connected constant constraint crash create current currval cursor " + - "data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete " + - "desc digits dispose distinct do drop " + - "else elsif enable end entry escape exception exception_init exchange exclusive exists exit external " + - "fast fetch file for force form from function " + - "generic goto grant group " + - "having " + - "identified if immediate in increment index indexes indicator initial initrans insert interface intersect " + - "into is " + - "key " + - "level library like limited local lock log logging long loop " + - "master maxextents maxtrans member minextents minus mislabel mode modify multiset " + - "new next no noaudit nocompress nologging noparallel not nowait number_base " + - "object of off offline on online only open option or order out " + - "package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior " + - "private privileges procedure public " + - "raise range raw read rebuild record ref references refresh release rename replace resource restrict return " + - "returning reverse revoke rollback row rowid rowlabel rownum rows run " + - "savepoint schema segment select separate session set share snapshot some space split sql start statement " + - "storage subtype successful synonym " + - "tabauth table tables tablespace task terminate then to trigger truncate type " + - "union unique unlimited unrecoverable unusable update use using " + - "validate value values variable view views " + - "when whenever where while with work"; - - var cFunctions = "abs acos add_months ascii asin atan atan2 average " + - "bfilename " + - "ceil chartorowid chr concat convert cos cosh count " + - "decode deref dual dump dup_val_on_index " + - "empty error exp " + - "false floor found " + - "glb greatest " + - "hextoraw " + - "initcap instr instrb isopen " + - "last_day least lenght lenghtb ln lower lpad ltrim lub " + - "make_ref max min mod months_between " + - "new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower " + - "nls_sort nls_upper nlssort no_data_found notfound null nvl " + - "others " + - "power " + - "rawtohex reftohex round rowcount rowidtochar rpad rtrim " + - "sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate " + - "tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc " + - "uid upper user userenv " + - "variance vsize"; - - var cTypes = "bfile blob " + - "character clob " + - "dec " + - "float " + - "int integer " + - "mlslabel " + - "natural naturaln nchar nclob number numeric nvarchar2 " + - "real rowtype " + - "signtype smallint string " + - "varchar varchar2"; - - var cSqlplus = "appinfo arraysize autocommit autoprint autorecovery autotrace " + - "blockterminator break btitle " + - "cmdsep colsep compatibility compute concat copycommit copytypecheck " + - "define describe " + - "echo editfile embedded escape exec execute " + - "feedback flagger flush " + - "heading headsep " + - "instance " + - "linesize lno loboffset logsource long longchunksize " + - "markup " + - "native newpage numformat numwidth " + - "pagesize pause pno " + - "recsep recsepchar release repfooter repheader " + - "serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber " + - "sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix " + - "tab term termout time timing trimout trimspool ttitle " + - "underline " + - "verify version " + - "wrap"; - - CodeMirror.defineMIME("text/x-plsql", { - name: "plsql", - keywords: keywords(cKeywords), - functions: keywords(cFunctions), - types: keywords(cTypes), - sqlplus: keywords(cSqlplus) - }); -}()); diff --git a/src/codemirror/mode/python/index.html b/src/codemirror/mode/python/index.html deleted file mode 100755 index 1c36643..0000000 --- a/src/codemirror/mode/python/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - CodeMirror 2: Python mode - - - - - - - - -

CodeMirror 2: Python mode

- -
- -

Configuration Options:

-
    -
  • version - 2/3 - The version of Python to recognize. Default is 2.
  • -
  • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
  • -
- -

MIME types defined: text/x-python.

- - diff --git a/src/codemirror/mode/python/python.js b/src/codemirror/mode/python/python.js deleted file mode 100755 index 4f60d9e..0000000 --- a/src/codemirror/mode/python/python.js +++ /dev/null @@ -1,320 +0,0 @@ -CodeMirror.defineMode("python", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']); - var commonkeywords = ['as', 'assert', 'break', 'class', 'continue', - 'def', 'del', 'elif', 'else', 'except', 'finally', - 'for', 'from', 'global', 'if', 'import', - 'lambda', 'pass', 'raise', 'return', - 'try', 'while', 'with', 'yield']; - var commontypes = ['bool', 'classmethod', 'complex', 'dict', 'enumerate', - 'float', 'frozenset', 'int', 'list', 'object', - 'property', 'reversed', 'set', 'slice', 'staticmethod', - 'str', 'super', 'tuple', 'type']; - var py2 = {'types': ['basestring', 'buffer', 'file', 'long', 'unicode', - 'xrange'], - 'keywords': ['exec', 'print']}; - var py3 = {'types': ['bytearray', 'bytes', 'filter', 'map', 'memoryview', - 'open', 'range', 'zip'], - 'keywords': ['nonlocal']}; - - if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) { - commonkeywords = commonkeywords.concat(py3.keywords); - commontypes = commontypes.concat(py3.types); - var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); - } else { - commonkeywords = commonkeywords.concat(py2.keywords); - commontypes = commontypes.concat(py2.types); - var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); - } - var keywords = wordRegexp(commonkeywords); - var types = wordRegexp(commontypes); - - var indentInfo = null; - - // tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - var scopeOffset = state.scopes[0].offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) { - indentInfo = 'indent'; - } else if (lineOffset < scopeOffset) { - indentInfo = 'dedent'; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } - // Binary - if (stream.match(/^0b[01]+/i)) { intLiteral = true; } - // Octal - if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - - if (stream.match(types)) { - return 'builtin'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { - delimiter = delimiter.substr(1); - } - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return OUTCLASS; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - function indent(stream, state, type) { - type = type || 'py'; - var indentUnit = 0; - if (type === 'py') { - for (var i = 0; i < state.scopes.length; ++i) { - if (state.scopes[i].type === 'py') { - indentUnit = state.scopes[i].offset + conf.indentUnit; - break; - } - } - } else { - indentUnit = stream.column() + stream.current().length; - } - state.scopes.unshift({ - offset: indentUnit, - type: type - }); - } - - function dedent(stream, state) { - if (state.scopes.length == 1) return; - if (state.scopes[0].type === 'py') { - var _indent = stream.indentation(); - var _indent_index = -1; - for (var i = 0; i < state.scopes.length; ++i) { - if (_indent === state.scopes[i].offset) { - _indent_index = i; - break; - } - } - if (_indent_index === -1) { - return true; - } - while (state.scopes[0].offset !== _indent) { - state.scopes.shift(); - } - return false - } else { - state.scopes.shift(); - return false; - } - } - - function tokenLexer(stream, state) { - indentInfo = null; - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - // Handle decorators - if (current === '@') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable' - || current === '@staticmethod' - || current === '@classmethod') { - return 'meta'; - } else { - return ERRORCLASS; - } - } - - // Handle scope changes. - if (current === 'pass' || current === 'return') { - state.dedent += 1; - } - if ((current === ':' && !state.lambda && state.scopes[0].type == 'py') - || indentInfo === 'indent') { - indent(stream, state); - } - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') { - if (state.scopes.length > 1) state.scopes.shift(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset:basecolumn || 0, type:'py'}], - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (stream.eol() && stream.lambda) { - state.lambda = false; - } - - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) { - return 0; - } - - return state.scopes[0].offset; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/x-python", "python"); diff --git a/src/codemirror/mode/r/LICENSE b/src/codemirror/mode/r/LICENSE deleted file mode 100755 index 2510ae1..0000000 --- a/src/codemirror/mode/r/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011, Ubalo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Ubalo, Inc nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/codemirror/mode/r/index.html b/src/codemirror/mode/r/index.html deleted file mode 100755 index 8ba3ef1..0000000 --- a/src/codemirror/mode/r/index.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - CodeMirror 2: R mode - - - - - - - - -

CodeMirror 2: R mode

-
- - -

MIME types defined: text/x-rsrc.

- -

Development of the CodeMirror R mode was kindly sponsored - by Ubalo, who hold - the license.

- - - diff --git a/src/codemirror/mode/r/r.js b/src/codemirror/mode/r/r.js deleted file mode 100755 index 53647f2..0000000 --- a/src/codemirror/mode/r/r.js +++ /dev/null @@ -1,141 +0,0 @@ -CodeMirror.defineMode("r", function(config) { - function wordObj(str) { - var words = str.split(" "), res = {}; - for (var i = 0; i < words.length; ++i) res[words[i]] = true; - return res; - } - var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); - var builtins = wordObj("list quote bquote eval return call parse deparse"); - var keywords = wordObj("if else repeat while function for in next break"); - var blockkeywords = wordObj("if else repeat while function for"); - var opChars = /[+\-*\/^<>=!&|~$:]/; - var curPunc; - - function tokenBase(stream, state) { - curPunc = null; - var ch = stream.next(); - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "0" && stream.eat("x")) { - stream.eatWhile(/[\da-f]/i); - return "number"; - } else if (ch == "." && stream.eat(/\d/)) { - stream.match(/\d*(?:e[+\-]?\d+)?/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); - return "number"; - } else if (ch == "'" || ch == '"') { - state.tokenize = tokenString(ch); - return "string"; - } else if (ch == "." && stream.match(/.[.\d]+/)) { - return "keyword"; - } else if (/[\w\.]/.test(ch) && ch != "_") { - stream.eatWhile(/[\w\.]/); - var word = stream.current(); - if (atoms.propertyIsEnumerable(word)) return "atom"; - if (keywords.propertyIsEnumerable(word)) { - if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block"; - return "keyword"; - } - if (builtins.propertyIsEnumerable(word)) return "builtin"; - return "variable"; - } else if (ch == "%") { - if (stream.skipTo("%")) stream.next(); - return "variable-2"; - } else if (ch == "<" && stream.eat("-")) { - return "arrow"; - } else if (ch == "=" && state.ctx.argList) { - return "arg-is"; - } else if (opChars.test(ch)) { - if (ch == "$") return "dollar"; - stream.eatWhile(opChars); - return "operator"; - } else if (/[\(\){}\[\];]/.test(ch)) { - curPunc = ch; - if (ch == ";") return "semi"; - return null; - } else { - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - if (stream.eat("\\")) { - var ch = stream.next(); - if (ch == "x") stream.match(/^[a-f0-9]{2}/i); - else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); - else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); - else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); - else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); - return "string-2"; - } else { - var next; - while ((next = stream.next()) != null) { - if (next == quote) { state.tokenize = tokenBase; break; } - if (next == "\\") { stream.backUp(1); break; } - } - return "string"; - } - }; - } - - function push(state, type, stream) { - state.ctx = {type: type, - indent: state.indent, - align: null, - column: stream.column(), - prev: state.ctx}; - } - function pop(state) { - state.indent = state.ctx.indent; - state.ctx = state.ctx.prev; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - ctx: {type: "top", - indent: -config.indentUnit, - align: false}, - indent: 0, - afterIdent: false}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.ctx.align == null) state.ctx.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style != "comment" && state.ctx.align == null) state.ctx.align = true; - - var ctype = state.ctx.type; - if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); - if (curPunc == "{") push(state, "}", stream); - else if (curPunc == "(") { - push(state, ")", stream); - if (state.afterIdent) state.ctx.argList = true; - } - else if (curPunc == "[") push(state, "]", stream); - else if (curPunc == "block") push(state, "block", stream); - else if (curPunc == ctype) pop(state); - state.afterIdent = style == "variable" || style == "keyword"; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, - closing = firstChar == ctx.type; - if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indent + (closing ? 0 : config.indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/x-rsrc", "r"); diff --git a/src/codemirror/mode/rst/index.html b/src/codemirror/mode/rst/index.html deleted file mode 100755 index 0831dff..0000000 --- a/src/codemirror/mode/rst/index.html +++ /dev/null @@ -1,526 +0,0 @@ - - - - CodeMirror 2: reStructuredText mode - - - - - - - - -

CodeMirror 2: reStructuredText mode

- -
- - -

The reStructuredText mode supports one configuration parameter:

-
-
verbatim (string)
-
A name or MIME type of a mode that will be used for highlighting - verbatim blocks. By default, reStructuredText mode uses uniform color - for whole block of verbatim text if no mode is given.
-
-

If python mode is available (not a part of CodeMirror 2 yet), - it will be used for highlighting blocks containing Python/IPython terminal - sessions (blocks starting with >>> (for Python) or - In [num]: (for IPython). - -

MIME types defined: text/x-rst.

- - - diff --git a/src/codemirror/mode/rst/rst.css b/src/codemirror/mode/rst/rst.css deleted file mode 100755 index 235a5d8..0000000 --- a/src/codemirror/mode/rst/rst.css +++ /dev/null @@ -1,75 +0,0 @@ -.cm-s-default span.cm-emphasis { - font-style: italic; -} - -.cm-s-default span.cm-strong { - font-weight: bold; -} - -.cm-s-default span.cm-interpreted { - color: #33cc66; -} - -.cm-s-default span.cm-inline { - color: #3399cc; -} - -.cm-s-default span.cm-role { - color: #666699; -} - -.cm-s-default span.cm-list { - color: #cc0099; - font-weight: bold; -} - -.cm-s-default span.cm-body { - color: #6699cc; -} - -.cm-s-default span.cm-verbatim { - color: #3366ff; -} - -.cm-s-default span.cm-comment { - color: #aa7700; -} - -.cm-s-default span.cm-directive { - font-weight: bold; - color: #3399ff; -} - -.cm-s-default span.cm-hyperlink { - font-weight: bold; - color: #3366ff; -} - -.cm-s-default span.cm-footnote { - font-weight: bold; - color: #3333ff; -} - -.cm-s-default span.cm-citation { - font-weight: bold; - color: #3300ff; -} - -.cm-s-default span.cm-replacement { - color: #9933cc; -} - -.cm-s-default span.cm-section { - font-weight: bold; - color: #cc0099; -} - -.cm-s-default span.cm-directive-marker { - font-weight: bold; - color: #3399ff; -} - -.cm-s-default span.cm-verbatim-marker { - font-weight: bold; - color: #9900ff; -} diff --git a/src/codemirror/mode/rst/rst.js b/src/codemirror/mode/rst/rst.js deleted file mode 100755 index eecc5be..0000000 --- a/src/codemirror/mode/rst/rst.js +++ /dev/null @@ -1,333 +0,0 @@ -CodeMirror.defineMode('rst', function(config, options) { - function setState(state, fn, ctx) { - state.fn = fn; - setCtx(state, ctx); - } - - function setCtx(state, ctx) { - state.ctx = ctx || {}; - } - - function setNormal(state, ch) { - if (ch && (typeof ch !== 'string')) { - var str = ch.current(); - ch = str[str.length-1]; - } - - setState(state, normal, {back: ch}); - } - - function hasMode(mode) { - if (mode) { - var modes = CodeMirror.listModes(); - - for (var i in modes) { - if (modes[i] == mode) { - return true; - } - } - } - - return false; - } - - function getMode(mode) { - if (hasMode(mode)) { - return CodeMirror.getMode(config, mode); - } else { - return null; - } - } - - var verbatimMode = getMode(options.verbatim); - var pythonMode = getMode('python'); - - var reSection = /^[!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/; - var reDirective = /^\s*\w([-:.\w]*\w)?::(\s|$)/; - var reHyperlink = /^\s*_[\w-]+:(\s|$)/; - var reFootnote = /^\s*\[(\d+|#)\](\s|$)/; - var reCitation = /^\s*\[[A-Za-z][\w-]*\](\s|$)/; - var reFootnoteRef = /^\[(\d+|#)\]_/; - var reCitationRef = /^\[[A-Za-z][\w-]*\]_/; - var reDirectiveMarker = /^\.\.(\s|$)/; - var reVerbatimMarker = /^::\s*$/; - var rePreInline = /^[-\s"([{/:.,;!?\\_]/; - var reEnumeratedList = /^\s*((\d+|[A-Za-z#])[.)]|\((\d+|[A-Z-a-z#])\))\s/; - var reBulletedList = /^\s*[-\+\*]\s/; - var reExamples = /^\s+(>>>|In \[\d+\]:)\s/; - - function normal(stream, state) { - var ch, sol, i; - - if (stream.eat(/\\/)) { - ch = stream.next(); - setNormal(state, ch); - return null; - } - - sol = stream.sol(); - - if (sol && (ch = stream.eat(reSection))) { - for (i = 0; stream.eat(ch); i++); - - if (i >= 3 && stream.match(/^\s*$/)) { - setNormal(state, null); - return 'section'; - } else { - stream.backUp(i + 1); - } - } - - if (sol && stream.match(reDirectiveMarker)) { - if (!stream.eol()) { - setState(state, directive); - } - - return 'directive-marker'; - } - - if (stream.match(reVerbatimMarker)) { - if (!verbatimMode) { - setState(state, verbatim); - } else { - var mode = verbatimMode; - - setState(state, verbatim, { - mode: mode, - local: mode.startState() - }); - } - - return 'verbatim-marker'; - } - - if (sol && stream.match(reExamples, false)) { - if (!pythonMode) { - setState(state, verbatim); - return 'verbatim-marker'; - } else { - var mode = pythonMode; - - setState(state, verbatim, { - mode: mode, - local: mode.startState() - }); - - return null; - } - } - - if (sol && (stream.match(reEnumeratedList) || - stream.match(reBulletedList))) { - setNormal(state, stream); - return 'list'; - } - - function testBackward(re) { - return sol || !state.ctx.back || re.test(state.ctx.back); - } - - function testForward(re) { - return stream.eol() || stream.match(re, false); - } - - function testInline(re) { - return stream.match(re) && testBackward(/\W/) && testForward(/\W/); - } - - if (testInline(reFootnoteRef)) { - setNormal(state, stream); - return 'footnote'; - } - - if (testInline(reCitationRef)) { - setNormal(state, stream); - return 'citation'; - } - - ch = stream.next(); - - if (testBackward(rePreInline)) { - if ((ch === ':' || ch === '|') && stream.eat(/\S/)) { - var token; - - if (ch === ':') { - token = 'role'; - } else { - token = 'replacement'; - } - - setState(state, inline, { - ch: ch, - wide: false, - prev: null, - token: token - }); - - return token; - } - - if (ch === '*' || ch === '`') { - var orig = ch, - wide = false; - - ch = stream.next(); - - if (ch == orig) { - wide = true; - ch = stream.next(); - } - - if (ch && !/\s/.test(ch)) { - var token; - - if (orig === '*') { - token = wide ? 'strong' : 'emphasis'; - } else { - token = wide ? 'inline' : 'interpreted'; - } - - setState(state, inline, { - ch: orig, // inline() has to know what to search for - wide: wide, // are we looking for `ch` or `chch` - prev: null, // terminator must not be preceeded with whitespace - token: token // I don't want to recompute this all the time - }); - - return token; - } - } - } - - setNormal(state, ch); - return null; - } - - function inline(stream, state) { - var ch = stream.next(), - token = state.ctx.token; - - function finish(ch) { - state.ctx.prev = ch; - return token; - } - - if (ch != state.ctx.ch) { - return finish(ch); - } - - if (/\s/.test(state.ctx.prev)) { - return finish(ch); - } - - if (state.ctx.wide) { - ch = stream.next(); - - if (ch != state.ctx.ch) { - return finish(ch); - } - } - - if (!stream.eol() && !rePostInline.test(stream.peek())) { - if (state.ctx.wide) { - stream.backUp(1); - } - - return finish(ch); - } - - setState(state, normal); - setNormal(state, ch); - - return token; - } - - function directive(stream, state) { - var token = null; - - if (stream.match(reDirective)) { - token = 'directive'; - } else if (stream.match(reHyperlink)) { - token = 'hyperlink'; - } else if (stream.match(reFootnote)) { - token = 'footnote'; - } else if (stream.match(reCitation)) { - token = 'citation'; - } else { - stream.eatSpace(); - - if (stream.eol()) { - setNormal(state, stream); - return null; - } else { - stream.skipToEnd(); - setState(state, comment); - return 'comment'; - } - } - - setState(state, body, {start: true}); - return token; - } - - function body(stream, state) { - var token = 'body'; - - if (!state.ctx.start || stream.sol()) { - return block(stream, state, token); - } - - stream.skipToEnd(); - setCtx(state); - - return token; - } - - function comment(stream, state) { - return block(stream, state, 'comment'); - } - - function verbatim(stream, state) { - if (!verbatimMode) { - return block(stream, state, 'verbatim'); - } else { - if (stream.sol()) { - if (!stream.eatSpace()) { - setNormal(state, stream); - } - - return null; - } - - return verbatimMode.token(stream, state.ctx.local); - } - } - - function block(stream, state, token) { - if (stream.eol() || stream.eatSpace()) { - stream.skipToEnd(); - return token; - } else { - setNormal(state, stream); - return null; - } - } - - return { - startState: function() { - return {fn: normal, ctx: {}}; - }, - - copyState: function(state) { - return {fn: state.fn, ctx: state.ctx}; - }, - - token: function(stream, state) { - var token = state.fn(stream, state); - return token; - } - }; -}); - -CodeMirror.defineMIME("text/x-rst", "rst"); diff --git a/src/codemirror/mode/ruby/LICENSE b/src/codemirror/mode/ruby/LICENSE deleted file mode 100755 index ac09fc4..0000000 --- a/src/codemirror/mode/ruby/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011, Ubalo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Ubalo, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/codemirror/mode/ruby/index.html b/src/codemirror/mode/ruby/index.html deleted file mode 100755 index babc37e..0000000 --- a/src/codemirror/mode/ruby/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - CodeMirror 2: Ruby mode - - - - - - - - -

CodeMirror 2: Ruby mode

-
- - -

MIME types defined: text/x-ruby.

- -

Development of the CodeMirror Ruby mode was kindly sponsored - by Ubalo, who hold - the license.

- - - diff --git a/src/codemirror/mode/ruby/ruby.js b/src/codemirror/mode/ruby/ruby.js deleted file mode 100755 index ddc1a65..0000000 --- a/src/codemirror/mode/ruby/ruby.js +++ /dev/null @@ -1,195 +0,0 @@ -CodeMirror.defineMode("ruby", function(config, parserConfig) { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", - "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", - "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", - "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", - "caller", "lambda", "proc", "public", "protected", "private", "require", "load", - "require_relative", "extend", "autoload" - ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then", - "unless", "catch", "loop", "proc"]); - var dedentWords = wordObj(["end", "until"]); - var matching = {"[": "]", "{": "}", "(": ")"}; - var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - curPunc = null; - if (stream.sol() && stream.match("=begin") && stream.eol()) { - state.tokenize.push(readBlockComment); - return "comment"; - } - if (stream.eatSpace()) return null; - var ch = stream.next(); - if (ch == "`" || ch == "'" || ch == '"' || ch == "/") { - return chain(readQuoted(ch, "string", ch == '"'), stream, state); - } else if (ch == "%") { - var style, embed = false; - if (stream.eat("s")) style = "atom"; - else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; } - else if (stream.eat(/[wxqr]/)) style = "string"; - var delim = stream.eat(/[^\w\s]/); - if (!delim) return "operator"; - if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; - return chain(readQuoted(delim, style, embed, true), stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "<" && stream.eat("<")) { - stream.eat("-"); - stream.eat(/[\'\"\`]/); - var match = stream.match(/^\w+/); - stream.eat(/[\'\"\`]/); - if (match) return chain(readHereDoc(match[0]), stream, state); - return null; - } else if (ch == "0") { - if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); - else if (stream.eat("b")) stream.eatWhile(/[01]/); - else stream.eatWhile(/[0-7]/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); - return "number"; - } else if (ch == "?") { - while (stream.match(/^\\[CM]-/)) {} - if (stream.eat("\\")) stream.eatWhile(/\w/); - else stream.next(); - return "string"; - } else if (ch == ":") { - if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); - if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); - stream.eatWhile(/[\w\?]/); - return "atom"; - } else if (ch == "@") { - stream.eat("@"); - stream.eatWhile(/[\w\?]/); - return "variable-2"; - } else if (ch == "$") { - stream.next(); - stream.eatWhile(/[\w\?]/); - return "variable-3"; - } else if (/\w/.test(ch)) { - stream.eatWhile(/[\w\?]/); - if (stream.eat(":")) return "atom"; - return "ident"; - } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { - curPunc = "|"; - return null; - } else if (/[\(\)\[\]{}\\;]/.test(ch)) { - curPunc = ch; - return null; - } else if (ch == "-" && stream.eat(">")) { - return "arrow"; - } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); - return "operator"; - } else { - return null; - } - } - - function tokenBaseUntilBrace() { - var depth = 1; - return function(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - }; - } - function readQuoted(quote, style, embed, unescaped) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - if (embed && ch == "#" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace(arguments.callee)); - break; - } - escaped = !escaped && ch == "\\"; - } - return style; - }; - } - function readHereDoc(phrase) { - return function(stream, state) { - if (stream.match(phrase)) state.tokenize.pop(); - else stream.skipToEnd(); - return "string"; - }; - } - function readBlockComment(stream, state) { - if (stream.sol() && stream.match("=end") && stream.eol()) - state.tokenize.pop(); - stream.skipToEnd(); - return "comment"; - } - - return { - startState: function() { - return {tokenize: [tokenBase], - indented: 0, - context: {type: "top", indented: -config.indentUnit}, - continuedLine: false, - lastTok: null, - varList: false}; - }, - - token: function(stream, state) { - if (stream.sol()) state.indented = stream.indentation(); - var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; - if (style == "ident") { - var word = stream.current(); - style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : /^[A-Z]/.test(word) ? "tag" - : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" - : "variable"; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if (word == "if" && stream.column() == stream.indentation()) kwtype = "indent"; - } - if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style; - if (curPunc == "|") state.varList = !state.varList; - - if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) - state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; - else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) - state.context = state.context.prev; - - if (stream.eol()) - state.continuedLine = (curPunc == "\\" || style == "operator"); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0); - var ct = state.context; - var closing = ct.type == matching[firstChar] || - ct.type == "keyword" && /^(?:end|until|else|elsif|when)\b/.test(textAfter); - return ct.indented + (closing ? 0 : config.indentUnit) + - (state.continuedLine ? config.indentUnit : 0); - } - }; -}); - -CodeMirror.defineMIME("text/x-ruby", "ruby"); diff --git a/src/codemirror/mode/scheme/index.html b/src/codemirror/mode/scheme/index.html deleted file mode 100755 index 3240232..0000000 --- a/src/codemirror/mode/scheme/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - CodeMirror 2: Scheme mode - - - - - - - - -

CodeMirror 2: Scheme mode

-
- - -

MIME types defined: text/x-scheme.

- - - diff --git a/src/codemirror/mode/scheme/scheme.js b/src/codemirror/mode/scheme/scheme.js deleted file mode 100755 index caf78db..0000000 --- a/src/codemirror/mode/scheme/scheme.js +++ /dev/null @@ -1,202 +0,0 @@ -/** - * Author: Koh Zi Han, based on implementation by Koh Zi Chun - */ -CodeMirror.defineMode("scheme", function (config, mode) { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD="keyword"; - var INDENT_WORD_SKIP = 2, KEYWORDS_SKIP = 1; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); - var indentKeys = makeKeywords("define let letrec let* lambda"); - - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - /** - * Scheme numbers are complicated unfortunately. - * Checks if we're looking at a number, which might be possibly a fraction. - * Also checks that it is not part of a longer identifier. Returns true/false accordingly. - */ - function isNumber(ch, stream){ - if(/[0-9]/.exec(ch) != null){ - stream.eatWhile(/[0-9]/); - stream.eat(/\//); - stream.eatWhile(/[0-9]/); - if (stream.eol() || !(/[a-zA-Z\-\_\/]/.exec(stream.peek()))) return true; - stream.backUp(stream.current().length - 1); // undo all the eating - } - return false; - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - sExprComment: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in scheme-string mode - break; - case "comment": // comment parsing mode - var next, maybeEnd = false; - while ((next = stream.next()) != null) { - if (next == "#" && maybeEnd) { - - state.mode = false; - break; - } - maybeEnd = (next == "|"); - } - returnType = COMMENT; - break; - case "s-expr-comment": // s-expr commenting mode - state.mode = false; - if(stream.peek() == "(" || stream.peek() == "["){ - // actually start scheme s-expr commenting mode - state.sExprComment = 0; - }else{ - // if not we just comment the entire of the next token - stream.eatWhile(/[^/s]/); // eat non spaces - returnType = COMMENT; - break; - } - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - - } else if (ch == "'") { - returnType = ATOM; - } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment - state.mode = "comment"; // toggle to comment mode - returnType = COMMENT; - } else if (stream.eat(/[tf]/)) { // #t/#f (atom) - returnType = ATOM; - } else if (stream.eat(';')) { // S-Expr comment - state.mode = "s-expr-comment"; - returnType = COMMENT; - } - - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "-"){ - - if(!isNaN(parseInt(stream.peek()))){ - stream.eatWhile(/[\/0-9]/); - returnType = NUMBER; - }else{ - returnType = null; - } - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(); - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - if(typeof state.sExprComment == "number") state.sExprComment++; - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - - if(typeof state.sExprComment == "number"){ - if(--state.sExprComment == 0){ - returnType = COMMENT; // final closing bracket - state.sExprComment = false; // turn off s-expr commenting mode - } - } - } - } else { - stream.eatWhile(/[\w\$_\-]/); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - }else returnType = null; - } - } - return (typeof state.sExprComment == "number") ? COMMENT : returnType; - }, - - indent: function (state, textAfter) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-scheme", "scheme"); \ No newline at end of file diff --git a/src/codemirror/mode/smalltalk/index.html b/src/codemirror/mode/smalltalk/index.html deleted file mode 100755 index 67cb22b..0000000 --- a/src/codemirror/mode/smalltalk/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - CodeMirror 2: Smalltalk mode - - - - - - - - -

CodeMirror 2: Smalltalk mode

- -
- - - -

Simple Smalltalk mode.

- -

MIME types defined: text/x-stsrc.

- - diff --git a/src/codemirror/mode/smalltalk/smalltalk.js b/src/codemirror/mode/smalltalk/smalltalk.js deleted file mode 100755 index a5b14e1..0000000 --- a/src/codemirror/mode/smalltalk/smalltalk.js +++ /dev/null @@ -1,122 +0,0 @@ -CodeMirror.defineMode("smalltalk", function(config, parserConfig) { - var keywords = {"true": 1, "false": 1, nil: 1, self: 1, "super": 1, thisContext: 1}; - var indentUnit = config.indentUnit; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') - return chain(stream, state, tokenComment(ch)); - else if (ch == "'") - return chain(stream, state, tokenString(ch)); - else if (ch == "#") { - stream.eatWhile(/[\w\$_]/); - return ret("string", "string"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/) - return ret("number", "number"); - } - else if (/[\[\]()]/.test(ch)) { - return ret(ch, null); - } - else { - stream.eatWhile(/[\w\$_]/); - if (keywords && keywords.propertyIsEnumerable(stream.current())) return ret("keyword", "keyword"); - return ret("word", "variable"); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped)) - state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - function tokenComment(quote) { - return function(stream, state) { - var next, end = false; - while ((next = stream.next()) != null) { - if (next == quote) {end = true; break;} - } - if (end) - state.tokenize = tokenBase; - return ret("comment", "comment"); - }; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if (type == "[") pushContext(state, stream.column(), "]"); - else if (type == "(") pushContext(state, stream.column(), ")"); - else if (type == ctx.type) popContext(state); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type; - if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "]" - }; -}); - -CodeMirror.defineMIME("text/x-stsrc", {name: "smalltalk"}); diff --git a/src/codemirror/mode/sparql/index.html b/src/codemirror/mode/sparql/index.html deleted file mode 100755 index a0e2f4e..0000000 --- a/src/codemirror/mode/sparql/index.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - CodeMirror 2: SPARQL mode - - - - - - - - -

CodeMirror 2: SPARQL mode

-
- - -

MIME types defined: application/x-sparql-query.

- - - diff --git a/src/codemirror/mode/sparql/sparql.js b/src/codemirror/mode/sparql/sparql.js deleted file mode 100755 index ceb5294..0000000 --- a/src/codemirror/mode/sparql/sparql.js +++ /dev/null @@ -1,143 +0,0 @@ -CodeMirror.defineMode("sparql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "isblank", "isliteral", "union", "a"]); - var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", - "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", - "graph", "by", "asc", "desc"]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(), type; - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("application/x-sparql-query", "sparql"); diff --git a/src/codemirror/mode/stex/index.html b/src/codemirror/mode/stex/index.html deleted file mode 100755 index 7a27d11..0000000 --- a/src/codemirror/mode/stex/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - CodeMirror 2: sTeX mode - - - - - - - - -

CodeMirror 2: sTeX mode

-
- - -

MIME types defined: text/stex.

- - - diff --git a/src/codemirror/mode/stex/stex.js b/src/codemirror/mode/stex/stex.js deleted file mode 100755 index bb47fb4..0000000 --- a/src/codemirror/mode/stex/stex.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) - * Licence: MIT - */ - -CodeMirror.defineMode("stex", function(cmCfg, modeCfg) -{ - function pushCommand(state, command) { - state.cmdState.push(command); - } - - function peekCommand(state) { - if (state.cmdState.length>0) - return state.cmdState[state.cmdState.length-1]; - else - return null; - } - - function popCommand(state) { - if (state.cmdState.length>0) { - var plug = state.cmdState.pop(); - plug.closeBracket(); - } - } - - function applyMostPowerful(state) { - var context = state.cmdState; - for (var i = context.length - 1; i >= 0; i--) { - var plug = context[i]; - if (plug.name=="DEFAULT") - continue; - return plug.styleIdentifier(); - } - return null; - } - - function addPluginPattern(pluginName, cmdStyle, brackets, styles) { - return function () { - this.name=pluginName; - this.bracketNo = 0; - this.style=cmdStyle; - this.styles = styles; - this.brackets = brackets; - - this.styleIdentifier = function(content) { - if (this.bracketNo<=this.styles.length) - return this.styles[this.bracketNo-1]; - else - return null; - }; - this.openBracket = function(content) { - this.bracketNo++; - return "bracket"; - }; - this.closeBracket = function(content) { - }; - } - } - - var plugins = new Array(); - - plugins["importmodule"] = addPluginPattern("importmodule", "tag", "{[", ["string", "builtin"]); - plugins["documentclass"] = addPluginPattern("documentclass", "tag", "{[", ["", "atom"]); - plugins["usepackage"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - plugins["begin"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - plugins["end"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - - plugins["DEFAULT"] = function () { - this.name="DEFAULT"; - this.style="tag"; - - this.styleIdentifier = function(content) { - }; - this.openBracket = function(content) { - }; - this.closeBracket = function(content) { - }; - }; - - function setState(state, f) { - state.f = f; - } - - function normal(source, state) { - if (source.match(/^\\[a-z]+/)) { - var cmdName = source.current(); - cmdName = cmdName.substr(1, cmdName.length-1); - var plug = plugins[cmdName]; - if (typeof(plug) == 'undefined') { - plug = plugins["DEFAULT"]; - } - plug = new plug(); - pushCommand(state, plug); - setState(state, beginParams); - return plug.style; - } - - var ch = source.next(); - if (ch == "%") { - setState(state, inCComment); - return "comment"; - } - else if (ch=='}' || ch==']') { - plug = peekCommand(state); - if (plug) { - plug.closeBracket(ch); - setState(state, beginParams); - } else - return "error"; - return "bracket"; - } else if (ch=='{' || ch=='[') { - plug = plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - return "bracket"; - } - else if (/\d/.test(ch)) { - source.eatWhile(/[\w.%]/); - return "atom"; - } - else { - source.eatWhile(/[\w-_]/); - return applyMostPowerful(state); - } - } - - function inCComment(source, state) { - source.skipToEnd(); - setState(state, normal); - return "comment"; - } - - function beginParams(source, state) { - var ch = source.peek(); - if (ch == '{' || ch == '[') { - var lastPlug = peekCommand(state); - var style = lastPlug.openBracket(ch); - source.eat(ch); - setState(state, normal); - return "bracket"; - } - if (/[ \t\r]/.test(ch)) { - source.eat(ch); - return null; - } - setState(state, normal); - lastPlug = peekCommand(state); - if (lastPlug) { - popCommand(state); - } - return normal(source, state); - } - - return { - startState: function() { return { f:normal, cmdState:[] }; }, - copyState: function(s) { return { f: s.f, cmdState: s.cmdState.slice(0, s.cmdState.length) }; }, - - token: function(stream, state) { - var t = state.f(stream, state); - var w = stream.current(); - return t; - } - }; -}); - - -CodeMirror.defineMIME("text/x-stex", "stex"); diff --git a/src/codemirror/mode/velocity/index.html b/src/codemirror/mode/velocity/index.html deleted file mode 100755 index 7ab63ec..0000000 --- a/src/codemirror/mode/velocity/index.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - CodeMirror 2: Velocity mode - - - - - - - - -

CodeMirror 2: Velocity mode

-
- - -

MIME types defined: text/velocity.

- - - diff --git a/src/codemirror/mode/velocity/velocity.js b/src/codemirror/mode/velocity/velocity.js deleted file mode 100755 index 0b80c75..0000000 --- a/src/codemirror/mode/velocity/velocity.js +++ /dev/null @@ -1,146 +0,0 @@ -CodeMirror.defineMode("velocity", function(config) { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var indentUnit = config.indentUnit - var keywords = parseWords("#end #else #break #stop #[[ #]] " + - "#{end} #{else} #{break} #{stop}"); - var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + - "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); - var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount"); - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - var multiLineStrings =true; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - // start of string? - if ((ch == '"' || ch == "'") && state.inParams) - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment? - else if (ch == "#" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - // unparsed content? - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - return chain(stream, state, tokenUnparsed); - } - // single line comment? - else if (ch == "#" && stream.eat("#")) { - stream.skipToEnd(); - return "comment"; - } - // variable? - else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); - // is it one of the specials? - if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { - return "keyword"; - } - else { - state.beforeParams = true; - return "builtin"; - } - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the whole word - stream.eatWhile(/[\w\$_{}]/); - var word = stream.current().toLowerCase(); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(word) || - stream.current().match(/^#[a-z0-9_]+ *$/i) && stream.peek()=="(") { - state.beforeParams = true; - return "keyword"; - } - // default: just a "word" - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/velocity", "velocity"); diff --git a/src/codemirror/mode/xml/index.html b/src/codemirror/mode/xml/index.html deleted file mode 100755 index 122848a..0000000 --- a/src/codemirror/mode/xml/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - CodeMirror 2: XML mode - - - - - - - - -

CodeMirror 2: XML mode

-
- -

The XML mode supports two configuration parameters:

-
-
htmlMode (boolean)
-
This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as br) do not require a closing tag.
-
alignCDATA (boolean)
-
Setting this to true will force the opening tag of CDATA - blocks to not be indented.
-
- -

MIME types defined: application/xml, text/html.

- - diff --git a/src/codemirror/mode/xml/xml.js b/src/codemirror/mode/xml/xml.js deleted file mode 100755 index cb7cf97..0000000 --- a/src/codemirror/mode/xml/xml.js +++ /dev/null @@ -1,231 +0,0 @@ -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true, - "meta": true, "col": true, "frame": true, "base": true, "area": true}, - doNotIndent: {"pre": true, "!cdata": true}, - allowUnquoted: true - } : {autoSelfClosers: {}, doNotIndent: {"!cdata": true}, allowUnquoted: false}; - var alignCDATA = parserConfig.alignCDATA; - - // Return variables for tokenizers - var tagName, type; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } - else if (stream.match("--")) return chain(inBlock("comment", "-->")); - else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(inBlock("meta", ">")); - } - else return null; - } - else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } - else { - type = stream.eat("/") ? "closeTag" : "openTag"; - stream.eatSpace(); - tagName = ""; - var c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - state.tokenize = inTag; - return "tag"; - } - } - else if (ch == "&") { - stream.eatWhile(/[^;]/); - stream.eat(";"); - return "atom"; - } - else { - stream.eatWhile(/[^&<]/); - return null; - } - } - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag"; - } - else if (ch == "=") { - type = "equals"; - return null; - } - else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - return state.tokenize(stream, state); - } - else { - stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/); - return "word"; - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - }; - } - - var curState, setStyle; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushContext(tagName, startOfLine) { - var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); - curState.context = { - prev: curState.context, - tagName: tagName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; - } - function popContext() { - if (curState.context) curState.context = curState.context.prev; - } - - function element(type) { - if (type == "openTag") {curState.tagName = tagName; return cont(attributes, endtag(curState.startOfLine));} - else if (type == "closeTag") { - var err = false; - if (curState.context) { - err = curState.context.tagName != tagName; - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endclosetag(err)); - } - else if (type == "string") { - if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata"); - if (curState.tokenize == inText) popContext(); - return cont(); - } - else return cont(); - } - function endtag(startOfLine) { - return function(type) { - if (type == "selfcloseTag" || - (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) - return cont(); - if (type == "endTag") {pushContext(curState.tagName, startOfLine); return cont();} - return cont(); - }; - } - function endclosetag(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endTag") { popContext(); return cont(); } - setStyle = "error"; - return cont(arguments.callee); - } - } - - function attributes(type) { - if (type == "word") {setStyle = "attribute"; return cont(attributes);} - if (type == "equals") return cont(attvalue, attributes); - return pass(); - } - function attvalue(type) { - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();} - if (type == "string") return cont(attvaluemaybe); - return pass(); - } - function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); - } - - return { - startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.startOfLine = true; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - - setStyle = type = tagName = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - curState = state; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } - } - state.startOfLine = false; - return setStyle || style; - }, - - indent: function(state, textAfter) { - var context = state.context; - if (context && context.noIndent) return 0; - if (alignCDATA && / - - - CodeMirror 2: Pure XML mode - - - - - - - - -

CodeMirror 2: XML mode

-
- - -

This is my XML parser, based on the original:

-
    -
  • No html mode - this is pure xml
  • -
  • Illegal attributes and element names are errors
  • -
  • Attributes must have a value
  • -
  • XML declaration supported (e.g.: <?xml version="1.0" encoding="utf-8" standalone="no" ?>)
  • -
  • CDATA and comment blocks are not indented (except for their start-tag)
  • -
  • Better handling of errors per line with the state object - provides good infrastructure for extending it
  • -
- -

What's missing:

-
    -
  • Make sure only a single root element exists at the document level
  • -
  • Multi-line attributes should NOT indent
  • -
  • Start tags are not painted red when they have no matching end tags (is this really wrong?)
  • -
- -

MIME types defined: application/xml, text/xml.

- -

@author: Dror BG (deebug dot dev at gmail dot com)
-

@date: August, 2011
-

@github: https://github.com/deebugger/CodeMirror2

- -

MIME types defined: application/xml, text/xml.

- - diff --git a/src/codemirror/mode/xmlpure/xmlpure.js b/src/codemirror/mode/xmlpure/xmlpure.js deleted file mode 100755 index c55a717..0000000 --- a/src/codemirror/mode/xmlpure/xmlpure.js +++ /dev/null @@ -1,481 +0,0 @@ -/** - * xmlpure.js - * - * Building upon and improving the CodeMirror 2 XML parser - * @author: Dror BG (deebug.dev@gmail.com) - * @date: August, 2011 - */ - -CodeMirror.defineMode("xmlpure", function(config, parserConfig) { - // constants - var STYLE_ERROR = "error"; - var STYLE_INSTRUCTION = "comment"; - var STYLE_COMMENT = "comment"; - var STYLE_ELEMENT_NAME = "tag"; - var STYLE_ATTRIBUTE = "attribute"; - var STYLE_WORD = "string"; - var STYLE_TEXT = "atom"; - - var TAG_INSTRUCTION = "!instruction"; - var TAG_CDATA = "!cdata"; - var TAG_COMMENT = "!comment"; - var TAG_TEXT = "!text"; - - var doNotIndent = { - "!cdata": true, - "!comment": true, - "!text": true, - "!instruction": true - }; - - // options - var indentUnit = config.indentUnit; - - /////////////////////////////////////////////////////////////////////////// - // helper functions - - // chain a parser to another parser - function chain(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - } - - // parse a block (comment, CDATA or text) - function inBlock(style, terminator, nextTokenize) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - popContext(state); - state.tokenize = nextTokenize; - break; - } - stream.next(); - } - return style; - }; - } - - // go down a level in the document - // (hint: look at who calls this function to know what the contexts are) - function pushContext(state, tagName) { - var noIndent = doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.doIndent); - var newContext = { - tagName: tagName, - prev: state.context, - indent: state.context ? state.context.indent + indentUnit : 0, - lineNumber: state.lineNumber, - indented: state.indented, - noIndent: noIndent - }; - state.context = newContext; - } - - // go up a level in the document - function popContext(state) { - if (state.context) { - var oldContext = state.context; - state.context = oldContext.prev; - return oldContext; - } - - // we shouldn't be here - it means we didn't have a context to pop - return null; - } - - // return true if the current token is seperated from the tokens before it - // which means either this is the start of the line, or there is at least - // one space or tab character behind the token - // otherwise returns false - function isTokenSeparated(stream) { - return stream.sol() || - stream.string.charAt(stream.start - 1) == " " || - stream.string.charAt(stream.start - 1) == "\t"; - } - - /////////////////////////////////////////////////////////////////////////// - // context: document - // - // an XML document can contain: - // - a single declaration (if defined, it must be the very first line) - // - exactly one root element - // @todo try to actually limit the number of root elements to 1 - // - zero or more comments - function parseDocument(stream, state) { - if(stream.eat("<")) { - if(stream.eat("?")) { - // processing instruction - pushContext(state, TAG_INSTRUCTION); - state.tokenize = parseProcessingInstructionStartTag; - return STYLE_INSTRUCTION; - } else if(stream.match("!--")) { - // new context: comment - pushContext(state, TAG_COMMENT); - return chain(stream, state, inBlock(STYLE_COMMENT, "-->", parseDocument)); - } else if(stream.eatSpace() || stream.eol() ) { - stream.skipToEnd(); - return STYLE_ERROR; - } else { - // element - state.tokenize = parseElementTagName; - return STYLE_ELEMENT_NAME; - } - } - - // error on line - stream.skipToEnd(); - return STYLE_ERROR; - } - - /////////////////////////////////////////////////////////////////////////// - // context: XML element start-tag or end-tag - // - // - element start-tag can contain attributes - // - element start-tag may self-close (or start an element block if it doesn't) - // - element end-tag can contain only the tag name - function parseElementTagName(stream, state) { - // get the name of the tag - var startPos = stream.pos; - if(stream.match(/^[a-zA-Z_:][-a-zA-Z0-9_:.]*/)) { - // element start-tag - var tagName = stream.string.substring(startPos, stream.pos); - pushContext(state, tagName); - state.tokenize = parseElement; - return STYLE_ELEMENT_NAME; - } else if(stream.match(/^\/[a-zA-Z_:][-a-zA-Z0-9_:.]*( )*>/)) { - // element end-tag - var endTagName = stream.string.substring(startPos + 1, stream.pos - 1).trim(); - var oldContext = popContext(state); - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - if(oldContext == null || endTagName != oldContext.tagName) { - // the start and end tag names should match - error - return STYLE_ERROR; - } - return STYLE_ELEMENT_NAME; - } else { - // no tag name - error - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - stream.eatWhile(/[^>]/); - stream.eat(">"); - return STYLE_ERROR; - } - - stream.skipToEnd(); - return null; - } - - function parseElement(stream, state) { - if(stream.match(/^\/>/)) { - // self-closing tag - popContext(state); - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - return STYLE_ELEMENT_NAME; - } else if(stream.eat(/^>/)) { - state.tokenize = parseElementBlock; - return STYLE_ELEMENT_NAME; - } else if(isTokenSeparated(stream) && stream.match(/^[a-zA-Z_:][-a-zA-Z0-9_:.]*( )*=/)) { - // attribute - state.tokenize = parseAttribute; - return STYLE_ATTRIBUTE; - } - - // no other options - this is an error - state.tokenize = state.context == null ? parseDocument : parseDocument; - stream.eatWhile(/[^>]/); - stream.eat(">"); - return STYLE_ERROR; - } - - /////////////////////////////////////////////////////////////////////////// - // context: attribute - // - // attribute values may contain everything, except: - // - the ending quote (with ' or ") - this marks the end of the value - // - the character "<" - should never appear - // - ampersand ("&") - unless it starts a reference: a string that ends with a semi-colon (";") - // ---> note: this parser is lax in what may be put into a reference string, - // ---> consult http://www.w3.org/TR/REC-xml/#NT-Reference if you want to make it tighter - function parseAttribute(stream, state) { - var quote = stream.next(); - if(quote != "\"" && quote != "'") { - // attribute must be quoted - stream.skipToEnd(); - state.tokenize = parseElement; - return STYLE_ERROR; - } - - state.tokParams.quote = quote; - state.tokenize = parseAttributeValue; - return STYLE_WORD; - } - - // @todo: find out whether this attribute value spans multiple lines, - // and if so, push a context for it in order not to indent it - // (or something of the sort..) - function parseAttributeValue(stream, state) { - var ch = ""; - while(!stream.eol()) { - ch = stream.next(); - if(ch == state.tokParams.quote) { - // end quote found - state.tokenize = parseElement; - return STYLE_WORD; - } else if(ch == "<") { - // can't have less-than signs in an attribute value, ever - stream.skipToEnd() - state.tokenize = parseElement; - return STYLE_ERROR; - } else if(ch == "&") { - // reference - look for a semi-colon, or return error if none found - ch = stream.next(); - - // make sure that semi-colon isn't right after the ampersand - if(ch == ';') { - stream.skipToEnd() - state.tokenize = parseElement; - return STYLE_ERROR; - } - - // make sure no less-than characters slipped in - while(!stream.eol() && ch != ";") { - if(ch == "<") { - // can't have less-than signs in an attribute value, ever - stream.skipToEnd() - state.tokenize = parseElement; - return STYLE_ERROR; - } - ch = stream.next(); - } - if(stream.eol() && ch != ";") { - // no ampersand found - error - stream.skipToEnd(); - state.tokenize = parseElement; - return STYLE_ERROR; - } - } - } - - // attribute value continues to next line - return STYLE_WORD; - } - - /////////////////////////////////////////////////////////////////////////// - // context: element block - // - // a block can contain: - // - elements - // - text - // - CDATA sections - // - comments - function parseElementBlock(stream, state) { - if(stream.eat("<")) { - if(stream.match("?")) { - pushContext(state, TAG_INSTRUCTION); - state.tokenize = parseProcessingInstructionStartTag; - return STYLE_INSTRUCTION; - } else if(stream.match("!--")) { - // new context: comment - pushContext(state, TAG_COMMENT); - return chain(stream, state, inBlock(STYLE_COMMENT, "-->", - state.context == null ? parseDocument : parseElementBlock)); - } else if(stream.match("![CDATA[")) { - // new context: CDATA section - pushContext(state, TAG_CDATA); - return chain(stream, state, inBlock(STYLE_TEXT, "]]>", - state.context == null ? parseDocument : parseElementBlock)); - } else if(stream.eatSpace() || stream.eol() ) { - stream.skipToEnd(); - return STYLE_ERROR; - } else { - // element - state.tokenize = parseElementTagName; - return STYLE_ELEMENT_NAME; - } - } else { - // new context: text - pushContext(state, TAG_TEXT); - state.tokenize = parseText; - return null; - } - - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - stream.skipToEnd(); - return null; - } - - function parseText(stream, state) { - stream.eatWhile(/[^<]/); - if(!stream.eol()) { - // we cannot possibly be in the document context, - // just inside an element block - popContext(state); - state.tokenize = parseElementBlock; - } - return STYLE_TEXT; - } - - /////////////////////////////////////////////////////////////////////////// - // context: XML processing instructions - // - // XML processing instructions (PIs) allow documents to contain instructions for applications. - // PI format: - // - 'name' can be anything other than 'xml' (case-insensitive) - // - 'data' can be anything which doesn't contain '?>' - // XML declaration is a special PI (see XML declaration context below) - function parseProcessingInstructionStartTag(stream, state) { - if(stream.match("xml", true, true)) { - // xml declaration - if(state.lineNumber > 1 || stream.pos > 5) { - state.tokenize = parseDocument; - stream.skipToEnd(); - return STYLE_ERROR; - } else { - state.tokenize = parseDeclarationVersion; - return STYLE_INSTRUCTION; - } - } - - // regular processing instruction - if(isTokenSeparated(stream) || stream.match("?>")) { - // we have a space after the start-tag, or nothing but the end-tag - // either way - error! - state.tokenize = parseDocument; - stream.skipToEnd(); - return STYLE_ERROR; - } - - state.tokenize = parseProcessingInstructionBody; - return STYLE_INSTRUCTION; - } - - function parseProcessingInstructionBody(stream, state) { - stream.eatWhile(/[^?]/); - if(stream.eat("?")) { - if(stream.eat(">")) { - popContext(state); - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - } - } - return STYLE_INSTRUCTION; - } - - - /////////////////////////////////////////////////////////////////////////// - // context: XML declaration - // - // XML declaration is of the following format: - // - // - must start at the first character of the first line - // - may span multiple lines - // - must include 'version' - // - may include 'encoding' and 'standalone' (in that order after 'version') - // - attribute names must be lowercase - // - cannot contain anything else on the line - function parseDeclarationVersion(stream, state) { - state.tokenize = parseDeclarationEncoding; - - if(isTokenSeparated(stream) && stream.match(/^version( )*=( )*"([a-zA-Z0-9_.:]|\-)+"/)) { - return STYLE_INSTRUCTION; - } - stream.skipToEnd(); - return STYLE_ERROR; - } - - function parseDeclarationEncoding(stream, state) { - state.tokenize = parseDeclarationStandalone; - - if(isTokenSeparated(stream) && stream.match(/^encoding( )*=( )*"[A-Za-z]([A-Za-z0-9._]|\-)*"/)) { - return STYLE_INSTRUCTION; - } - return null; - } - - function parseDeclarationStandalone(stream, state) { - state.tokenize = parseDeclarationEndTag; - - if(isTokenSeparated(stream) && stream.match(/^standalone( )*=( )*"(yes|no)"/)) { - return STYLE_INSTRUCTION; - } - return null; - } - - function parseDeclarationEndTag(stream, state) { - state.tokenize = parseDocument; - - if(stream.match("?>") && stream.eol()) { - popContext(state); - return STYLE_INSTRUCTION; - } - stream.skipToEnd(); - return STYLE_ERROR; - } - - /////////////////////////////////////////////////////////////////////////// - // returned object - return { - electricChars: "/", - - startState: function() { - return { - tokenize: parseDocument, - tokParams: {}, - lineNumber: 0, - lineError: false, - context: null, - indented: 0 - }; - }, - - token: function(stream, state) { - if(stream.sol()) { - // initialize a new line - state.lineNumber++; - state.lineError = false; - state.indented = stream.indentation(); - } - - // eat all (the spaces) you can - if(stream.eatSpace()) return null; - - // run the current tokenize function, according to the state - var style = state.tokenize(stream, state); - - // is there an error somewhere in the line? - state.lineError = (state.lineError || style == "error"); - - return style; - }, - - blankLine: function(state) { - // blank lines are lines too! - state.lineNumber++; - state.lineError = false; - }, - - indent: function(state, textAfter) { - if(state.context) { - if(state.context.noIndent == true) { - // do not indent - no return value at all - return; - } - if(textAfter.match(/^<\/.*/)) { - // eng-tag - indent back to last context - return state.context.indent; - } - // indent to last context + regular indent unit - return state.context.indent + indentUnit; - } - return 0; - }, - - compareStates: function(a, b) { - if (a.indented != b.indented) return false; - for (var ca = a.context, cb = b.context; ; ca = ca.prev, cb = cb.prev) { - if (!ca || !cb) return ca == cb; - if (ca.tagName != cb.tagName) return false; - } - } - }; -}); - -CodeMirror.defineMIME("application/xml", "purexml"); -CodeMirror.defineMIME("text/xml", "purexml"); diff --git a/src/codemirror/mode/yaml/index.html b/src/codemirror/mode/yaml/index.html deleted file mode 100755 index e8d04d1..0000000 --- a/src/codemirror/mode/yaml/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - CodeMirror 2: YAML mode - - - - - - - - -

CodeMirror 2: YAML mode

-
- - -

MIME types defined: text/x-yaml.

- - - diff --git a/src/codemirror/mode/yaml/yaml.js b/src/codemirror/mode/yaml/yaml.js deleted file mode 100755 index 59e2641..0000000 --- a/src/codemirror/mode/yaml/yaml.js +++ /dev/null @@ -1,95 +0,0 @@ -CodeMirror.defineMode("yaml", function() { - - var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; - var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); - - return { - token: function(stream, state) { - var ch = stream.peek(); - var esc = state.escaped; - state.escaped = false; - /* comments */ - if (ch == "#") { stream.skipToEnd(); return "comment"; } - if (state.literal && stream.indentation() > state.keyCol) { - stream.skipToEnd(); return "string"; - } else if (state.literal) { state.literal = false; } - if (stream.sol()) { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - /* document start */ - if(stream.match(/---/)) { return "def"; } - /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } - /* array list item */ - if (stream.match(/\s*-\s+/)) { return 'meta'; } - } - /* pairs (associative arrays) -> key */ - if (!state.pair && stream.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i)) { - state.pair = true; - state.keyCol = stream.indentation(); - return "atom"; - } - if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } - - /* inline pairs/lists */ - if (stream.match(/^(\{|\}|\[|\])/)) { - if (ch == '{') - state.inlinePairs++; - else if (ch == '}') - state.inlinePairs--; - else if (ch == '[') - state.inlineList++; - else - state.inlineList--; - return 'meta'; - } - - /* list seperator */ - if (state.inlineList > 0 && !esc && ch == ',') { - stream.next(); - return 'meta'; - } - /* pairs seperator */ - if (state.inlinePairs > 0 && !esc && ch == ',') { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - stream.next(); - return 'meta'; - } - - /* start of value of a pair */ - if (state.pairStart) { - /* block literals */ - if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; - /* references */ - if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } - /* numbers */ - if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } - if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } - /* keywords */ - if (stream.match(keywordRegex)) { return 'keyword'; } - } - - /* nothing found, continue */ - state.pairStart = false; - state.escaped = (ch == '\\'); - stream.next(); - return null; - }, - startState: function() { - return { - pair: false, - pairStart: false, - keyCol: 0, - inlinePairs: 0, - inlineList: 0, - literal: false, - escaped: false - }; - } - }; -}); - -CodeMirror.defineMIME("text/x-yaml", "yaml"); diff --git a/src/codemirror/oldrelease.html b/src/codemirror/oldrelease.html deleted file mode 100755 index 8607a4d..0000000 --- a/src/codemirror/oldrelease.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - CodeMirror - - - - - - - -

{ } CodeMirror

- -
-/* Old release history */
-
-
- -

28-03-2011: Version 2.0:

-

CodeMirror 2 is a complete rewrite that's - faster, smaller, simpler to use, and less dependent on browser - quirks. See this - and this - for more information. - -

28-03-2011: Version 1.0:

-
    -
  • Fix error when debug history overflows.
  • -
  • Refine handling of C# verbatim strings.
  • -
  • Fix some issues with JavaScript indentation.
  • -
- -

22-02-2011: Version 2.0 beta 2:

-

Somewhate more mature API, lots of bugs shaken out. - -

17-02-2011: Version 0.94:

-
    -
  • tabMode: "spaces" was modified slightly (now indents when something is selected).
  • -
  • Fixes a bug that would cause the selection code to break on some IE versions.
  • -
  • Disabling spell-check on WebKit browsers now works.
  • -
- -

08-02-2011: Version 2.0 beta 1:

-

CodeMirror 2 is a complete rewrite of - CodeMirror, no longer depending on an editable frame.

- -

19-01-2011: Version 0.93:

-
    -
  • Added a Regular Expression parser.
  • -
  • Fixes to the PHP parser.
  • -
  • Support for regular expression in search/replace.
  • -
  • Add save method to instances created with fromTextArea.
  • -
  • Add support for MS T-SQL in the SQL parser.
  • -
  • Support use of CSS classes for highlighting brackets.
  • -
  • Fix yet another hang with line-numbering in hidden editors.
  • -
- -

17-12-2010: Version 0.92:

-
    -
  • Make CodeMirror work in XHTML documents.
  • -
  • Fix bug in handling of backslashes in Python strings.
  • -
  • The styleNumbers option is now officially - supported and documented.
  • -
  • onLineNumberClick option added.
  • -
  • More consistent names onLoad and - onCursorActivity callbacks. Old names still work, but - are deprecated.
  • -
  • Add a Freemarker mode.
  • -
- -

11-11-2010: Version 0.91:

-
    -
  • Adds support for Java.
  • -
  • Small additions to the PHP and SQL parsers.
  • -
  • Work around various Webkit issues.
  • -
  • Fix toTextArea to update the code in the textarea.
  • -
  • Add a noScriptCaching option (hack to ease development).
  • -
  • Make sub-modes of HTML mixed mode configurable.
  • -
- -

02-10-2010: Version 0.9:

-
    -
  • Add support for searching backwards.
  • -
  • There are now parsers for Scheme, XQuery, and OmetaJS.
  • -
  • Makes height: "dynamic" more robust.
  • -
  • Fixes bug where paste did not work on OS X.
  • -
  • Add a enterMode and electricChars options to make indentation even more customizable.
  • -
  • Add firstLineNumber option.
  • -
  • Fix bad handling of @media rules by the CSS parser.
  • -
  • Take a new, more robust approach to working around the invisible-last-line bug in WebKit.
  • -
- -

22-07-2010: Version 0.8:

-
    -
  • Add a cursorCoords method to find the screen - coordinates of the cursor.
  • -
  • A number of fixes and support for more syntax in the PHP parser.
  • -
  • Fix indentation problem with JSON-mode JS parser in Webkit.
  • -
  • Add a minification UI.
  • -
  • Support a height: dynamic mode, where the editor's - height will adjust to the size of its content.
  • -
  • Better support for IME input mode.
  • -
  • Fix JavaScript parser getting confused when seeing a no-argument - function call.
  • -
  • Have CSS parser see the difference between selectors and other - identifiers.
  • -
  • Fix scrolling bug when pasting in a horizontally-scrolled - editor.
  • -
  • Support toTextArea method in instances created with - fromTextArea.
  • -
  • Work around new Opera cursor bug that causes the cursor to jump - when pressing backspace at the end of a line.
  • -
- -

27-04-2010: Version - 0.67:

-

More consistent page-up/page-down behaviour - across browsers. Fix some issues with hidden editors looping forever - when line-numbers were enabled. Make PHP parser parse - "\\" correctly. Have jumpToLine work on - line handles, and add cursorLine function to fetch the - line handle where the cursor currently is. Add new - setStylesheet function to switch style-sheets in a - running editor.

- -

01-03-2010: Version - 0.66:

-

Adds removeLine method to API. - Introduces the PLSQL parser. - Marks XML errors by adding (rather than replacing) a CSS class, so - that they can be disabled by modifying their style. Fixes several - selection bugs, and a number of small glitches.

- -

12-11-2009: Version - 0.65:

-

Add support for having both line-wrapping and - line-numbers turned on, make paren-highlighting style customisable - (markParen and unmarkParen config - options), work around a selection bug that Opera - reintroduced in version 10.

- -

23-10-2009: Version - 0.64:

-

Solves some issues introduced by the - paste-handling changes from the previous release. Adds - setSpellcheck, setTextWrapping, - setIndentUnit, setUndoDepth, - setTabMode, and setLineNumbers to - customise a running editor. Introduces an SQL parser. Fixes a few small - problems in the Python - parser. And, as usual, add workarounds for various newly discovered - browser incompatibilities.

- -

31-08-2009: Version -0.63:

-

Overhaul of paste-handling (less fragile), fixes for several -serious IE8 issues (cursor jumping, end-of-document bugs) and a number -of small problems.

- -

30-05-2009: Version -0.62:

-

Introduces Python -and Lua parsers. Add -setParser (on-the-fly mode changing) and -clearHistory methods. Make parsing passes time-based -instead of lines-based (see the passTime option).

- - diff --git a/src/codemirror/test/index.html b/src/codemirror/test/index.html deleted file mode 100755 index ce40a7d..0000000 --- a/src/codemirror/test/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - CodeMirror 2: Test Suite - - - - - - - - -

CodeMirror 2: Test Suite

- -

A limited set of programmatic sanity tests for CodeMirror.

- -

-
-    
-
-    
-  
-
diff --git a/src/codemirror/test/test.js b/src/codemirror/test/test.js
deleted file mode 100755
index f3d5441..0000000
--- a/src/codemirror/test/test.js
+++ /dev/null
@@ -1,249 +0,0 @@
-var tests = [];
-
-test("fromTextArea", function() {
-  var te = document.getElementById("code");
-  te.value = "CONTENT";
-  var cm = CodeMirror.fromTextArea(te);
-  is(!te.offsetHeight);
-  eq(cm.getValue(), "CONTENT");
-  cm.setValue("foo\nbar");
-  eq(cm.getValue(), "foo\nbar");
-  cm.save();
-  is(/^foo\r?\nbar$/.test(te.value));
-  cm.setValue("xxx");
-  cm.toTextArea();
-  is(te.offsetHeight);
-  eq(te.value, "xxx");
-});
-
-testCM("getRange", function(cm) {
-  eq(cm.getLine(0), "1234");
-  eq(cm.getLine(1), "5678");
-  eq(cm.getLine(2), null);
-  eq(cm.getLine(-1), null);
-  eq(cm.getRange({line: 0, ch: 0}, {line: 0, ch: 3}), "123");
-  eq(cm.getRange({line: 0, ch: -1}, {line: 0, ch: 200}), "1234");
-  eq(cm.getRange({line: 0, ch: 2}, {line: 1, ch: 2}), "34\n56");
-  eq(cm.getRange({line: 1, ch: 2}, {line: 100, ch: 0}), "78");
-}, {value: "1234\n5678"});
-
-testCM("replaceRange", function(cm) {
-  eq(cm.getValue(), "");
-  cm.replaceRange("foo\n", {line: 0, ch: 0});
-  eq(cm.getValue(), "foo\n");
-  cm.replaceRange("a\nb", {line: 0, ch: 1});
-  eq(cm.getValue(), "fa\nboo\n");
-  eq(cm.lineCount(), 3);
-  cm.replaceRange("xyzzy", {line: 0, ch: 0}, {line: 1, ch: 1});
-  eq(cm.getValue(), "xyzzyoo\n");
-  cm.replaceRange("abc", {line: 0, ch: 0}, {line: 10, ch: 0});
-  eq(cm.getValue(), "abc");
-  eq(cm.lineCount(), 1);
-});
-
-testCM("selection", function(cm) {
-  cm.setSelection({line: 0, ch: 4}, {line: 2, ch: 2});
-  is(cm.somethingSelected());
-  eq(cm.getSelection(), "11\n222222\n33");
-  eqPos(cm.getCursor(false), {line: 2, ch: 2});
-  eqPos(cm.getCursor(true), {line: 0, ch: 4});
-  cm.setSelection({line: 1, ch: 0});
-  is(!cm.somethingSelected());
-  eq(cm.getSelection(), "");
-  eqPos(cm.getCursor(true), {line: 1, ch: 0});
-  cm.replaceSelection("abc");
-  eq(cm.getSelection(), "abc");
-  eq(cm.getValue(), "111111\nabc222222\n333333");
-  cm.replaceSelection("def", "end");
-  eq(cm.getSelection(), "");
-  eqPos(cm.getCursor(true), {line: 1, ch: 3});
-  cm.setCursor({line: 2, ch: 1});
-  eqPos(cm.getCursor(true), {line: 2, ch: 1});
-  cm.setCursor(1, 2);
-  eqPos(cm.getCursor(true), {line: 1, ch: 2});
-}, {value: "111111\n222222\n333333"});
-
-testCM("lines", function(cm) {
-  eq(cm.getLine(0), "111111");
-  eq(cm.getLine(1), "222222");
-  eq(cm.getLine(-1), null);
-  cm.removeLine(1);
-  cm.setLine(1, "abc");
-  eq(cm.getValue(), "111111\nabc");
-}, {value: "111111\n222222\n333333"});
-
-testCM("indent", function(cm) {
-  cm.indentLine(1);
-  eq(cm.getLine(1), "   blah();");
-  cm.setOption("indentUnit", 8);
-  cm.indentLine(1);
-  eq(cm.getLine(1), "\tblah();");
-}, {value: "if (x) {\nblah();\n}", indentUnit: 3, indentWithTabs: true});
-
-test("defaults", function() {
-  var olddefaults = CodeMirror.defaults, defs = CodeMirror.defaults = {};
-  for (var opt in olddefaults) defs[opt] = olddefaults[opt];
-  defs.indentUnit = 5;
-  defs.value = "uu";
-  defs.enterMode = "keep";
-  defs.tabindex = 55;
-  var place = document.getElementById("testground"), cm = CodeMirror(place);
-  try {
-    eq(cm.getOption("indentUnit"), 5);
-    cm.setOption("indentUnit", 10);
-    eq(defs.indentUnit, 5);
-    eq(cm.getValue(), "uu");
-    eq(cm.getOption("enterMode"), "keep");
-    eq(cm.getInputField().tabindex, 55);
-  }
-  finally {
-    CodeMirror.defaults = olddefaults;
-    place.removeChild(cm.getWrapperElement());
-  }
-});
-
-testCM("lineInfo", function(cm) {
-  eq(cm.lineInfo(-1), null);
-  var lh = cm.setMarker(1, "FOO", "bar");
-  var info = cm.lineInfo(1);
-  eq(info.text, "222222");
-  eq(info.markerText, "FOO");
-  eq(info.markerClass, "bar");
-  eq(info.line, 1);
-  eq(cm.lineInfo(2).markerText, null);
-  cm.clearMarker(lh);
-  eq(cm.lineInfo(1).markerText, null);
-}, {value: "111111\n222222\n333333"});
-
-testCM("coords", function(cm) {
-  var scroller = cm.getWrapperElement().getElementsByClassName("CodeMirror-scroll")[0];
-  scroller.style.height = "100px";
-  var content = [];
-  for (var i = 0; i < 200; ++i) content.push("------------------------------" + i);
-  cm.setValue(content.join("\n"));
-  var top = cm.charCoords({line: 0, ch: 0});
-  var bot = cm.charCoords({line: 200, ch: 30});
-  is(top.x < bot.x);
-  is(top.y < bot.y);
-  is(top.y < top.yBot);
-  scroller.scrollTop = 100;
-  cm.refresh();
-  var top2 = cm.charCoords({line: 0, ch: 0});
-  is(top.y > top2.y);
-  eq(top.x, top2.x);
-});
-
-testCM("coordsChar", function(cm) {
-  var content = [];
-  for (var i = 0; i < 70; ++i) content.push("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
-  cm.setValue(content.join("\n"));
-  for (var x = 0; x < 35; x += 2) {
-    for (var y = 0; y < 70; y += 5) {
-      cm.setCursor(y, x);
-      var pos = cm.coordsChar(cm.charCoords({line: y, ch: x}));
-      eq(pos.line, y);
-      eq(pos.ch, x);
-    }
-  }
-});
-
-testCM("undo", function(cm) {
-  cm.setLine(0, "def");
-  eq(cm.historySize().undo, 1);
-  cm.undo();
-  eq(cm.getValue(), "abc");
-  eq(cm.historySize().undo, 0);
-  eq(cm.historySize().redo, 1);
-  cm.redo();
-  eq(cm.getValue(), "def");
-  eq(cm.historySize().undo, 1);
-  eq(cm.historySize().redo, 0);
-  cm.setValue("1\n\n\n2");
-  eq(cm.historySize().undo, 0);
-  for (var i = 0; i < 20; ++i) {
-    cm.replaceRange("a", {line: 0, ch: 0});
-    cm.replaceRange("b", {line: 3, ch: 0});
-  }
-  eq(cm.historySize().undo, 40);
-  for (var i = 0; i < 38; ++i) cm.undo();
-  eq(cm.historySize().undo, 2);
-  eq(cm.historySize().redo, 38);
-  eq(cm.getValue(), "a1\n\n\nb2");
-  cm.setOption("undoDepth", 10);
-  for (var i = 0; i < 20; ++i) {
-    cm.replaceRange("a", {line: 0, ch: 0});
-    cm.replaceRange("b", {line: 3, ch: 0});
-  }
-  eq(cm.historySize().undo, 10);
-}, {value: "abc"});
-
-testCM("undoMultiLine", function(cm) {
-  cm.replaceRange("x", {line:0, ch: 0});
-  cm.replaceRange("y", {line:1, ch: 0});
-  cm.undo();
-  eq(cm.getValue(), "abc\ndef\nghi");
-  cm.replaceRange("y", {line:1, ch: 0});
-  cm.replaceRange("x", {line:0, ch: 0});
-  cm.undo();
-  eq(cm.getValue(), "abc\ndef\nghi");
-  cm.replaceRange("y", {line:2, ch: 0});
-  cm.replaceRange("x", {line:1, ch: 0});
-  cm.replaceRange("z", {line:2, ch: 0});
-  cm.undo();
-  eq(cm.getValue(), "abc\ndef\nghi");
-}, {value: "abc\ndef\nghi"});
-
-// Scaffolding
-
-function htmlEscape(str) {
-  return str.replace(/[<&]/g, function(str) {return str == "&" ? "&" : "<";});
-}
-function forEach(arr, f) {
-  for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
-}
-
-function Failure(why) {this.message = why;}
-
-function test(name, run) {tests.push({name: name, func: run});}
-function testCM(name, run, opts) {
-  test(name, function() {
-    var place = document.getElementById("testground"), cm = CodeMirror(place, opts);
-    try {run(cm);}
-    finally {place.removeChild(cm.getWrapperElement());}
-  });
-}
-
-function runTests() {
-  var failures = [], run = 0;
-  for (var i = 0; i < tests.length; ++i) {
-    var test = tests[i];
-    try {test.func();}
-    catch(e) {
-      if (e instanceof Failure)
-        failures.push({type: "failure", test: test.name, text: e.message});
-      else
-        failures.push({type: "error", test: test.name, text: e.toString()});
-    }
-    run++;
-  }
-  var html = [run + " tests run."];
-  if (failures.length)
-    forEach(failures, function(fail) {
-      html.push(fail.test + ': ' + htmlEscape(fail.text) + "");
-    });
-  else html.push('All passed.');
-  document.getElementById("output").innerHTML = html.join("\n");
-}
-
-function eq(a, b, msg) {
-  if (a != b) throw new Failure(a + " != " + b + (msg ? " (" + msg + ")" : ""));
-}
-function eqPos(a, b, msg) {
-  eq(a.line, b.line, msg);
-  eq(a.ch, b.ch, msg);
-}
-function is(a, msg) {
-  if (!a) throw new Failure("assertion failed" + (msg ? " (" + msg + ")" : ""));
-}
-
-window.onload = runTests;
diff --git a/src/codemirror/theme/cobalt.css b/src/codemirror/theme/cobalt.css
deleted file mode 100755
index ba47da8..0000000
--- a/src/codemirror/theme/cobalt.css
+++ /dev/null
@@ -1,17 +0,0 @@
-.cm-s-cobalt { background: #002240; color: white; }
-.cm-s-cobalt span.CodeMirror-selected { background: #b36539 !important; }
-.cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
-.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
-.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
-
-.cm-s-cobalt span.cm-comment { color: #08f; }
-.cm-s-cobalt span.cm-atom { color: #845dc4; }
-.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
-.cm-s-cobalt span.cm-keyword { color: #ffee80; }
-.cm-s-cobalt span.cm-string { color: #3ad900; }
-.cm-s-cobalt span.cm-meta { color: #ff9d00; }
-.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
-.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
-.cm-s-cobalt span.cm-error { color: #9d1e15; }
-.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
-.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
diff --git a/src/codemirror/theme/default.css b/src/codemirror/theme/default.css
deleted file mode 100755
index e68f0fb..0000000
--- a/src/codemirror/theme/default.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.cm-s-default span.cm-keyword {color: #708;}
-.cm-s-default span.cm-atom {color: #219;}
-.cm-s-default span.cm-number {color: #164;}
-.cm-s-default span.cm-def {color: #00f;}
-.cm-s-default span.cm-variable {color: black;}
-.cm-s-default span.cm-variable-2 {color: #05a;}
-.cm-s-default span.cm-variable-3 {color: #0a5;}
-.cm-s-default span.cm-property {color: black;}
-.cm-s-default span.cm-operator {color: black;}
-.cm-s-default span.cm-comment {color: #a50;}
-.cm-s-default span.cm-string {color: #a11;}
-.cm-s-default span.cm-string-2 {color: #f50;}
-.cm-s-default span.cm-meta {color: #555;}
-.cm-s-default span.cm-error {color: #f00;}
-.cm-s-default span.cm-qualifier {color: #555;}
-.cm-s-default span.cm-builtin {color: #30a;}
-.cm-s-default span.cm-bracket {color: #cc7;}
-.cm-s-default span.cm-tag {color: #170;}
-.cm-s-default span.cm-attribute {color: #00c;}
diff --git a/src/codemirror/theme/eclipse.css b/src/codemirror/theme/eclipse.css
deleted file mode 100755
index 0ec8d9a..0000000
--- a/src/codemirror/theme/eclipse.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.cm-s-eclipse span.cm-meta {color: #FF1717;}
-.cm-s-eclipse span.cm-keyword { font-weight: bold; color: #7F0055; }
-.cm-s-eclipse span.cm-atom {color: #219;}
-.cm-s-eclipse span.cm-number {color: #164;}
-.cm-s-eclipse span.cm-def {color: #00f;}
-.cm-s-eclipse span.cm-variable {color: black;}
-.cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
-.cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
-.cm-s-eclipse span.cm-property {color: black;}
-.cm-s-eclipse span.cm-operator {color: black;}
-.cm-s-eclipse span.cm-comment {color: #3F7F5F;}
-.cm-s-eclipse span.cm-string {color: #2A00FF;}
-.cm-s-eclipse span.cm-string-2 {color: #f50;}
-.cm-s-eclipse span.cm-error {color: #f00;}
-.cm-s-eclipse span.cm-qualifier {color: #555;}
-.cm-s-eclipse span.cm-builtin {color: #30a;}
-.cm-s-eclipse span.cm-bracket {color: #cc7;}
-.cm-s-eclipse span.cm-tag {color: #170;}
-.cm-s-eclipse span.cm-attribute {color: #00c;}
-
-.CodeMirror-matchingbracket{
-	border:1px solid grey;
-	color:black !important;;
-}
\ No newline at end of file
diff --git a/src/codemirror/theme/elegant.css b/src/codemirror/theme/elegant.css
deleted file mode 100755
index 171683f..0000000
--- a/src/codemirror/theme/elegant.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
-.cm-s-elegant span.cm-comment {color: #262;font-style: italic;}
-.cm-s-elegant span.cm-meta {color: #555;font-style: italic;}
-.cm-s-elegant span.cm-variable {color: black;}
-.cm-s-elegant span.cm-variable-2 {color: #b11;}
-.cm-s-elegant span.cm-qualifier {color: #555;}
-.cm-s-elegant span.cm-keyword {color: #730;}
-.cm-s-elegant span.cm-builtin {color: #30a;}
-.cm-s-elegant span.cm-error {background-color: #fdd;}
diff --git a/src/codemirror/theme/neat.css b/src/codemirror/theme/neat.css
deleted file mode 100755
index 10d22c9..0000000
--- a/src/codemirror/theme/neat.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.cm-s-neat span.cm-comment { color: #a86; }
-.cm-s-neat span.cm-keyword { font-weight: bold; color: blue; }
-.cm-s-neat span.cm-string { color: #a22; }
-.cm-s-neat span.cm-builtin { font-weight: bold; color: #077; }
-.cm-s-neat span.cm-special { font-weight: bold; color: #0aa; }
-.cm-s-neat span.cm-variable { color: black; }
-.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
-.cm-s-neat span.cm-meta {color: #555;}
diff --git a/src/codemirror/theme/night.css b/src/codemirror/theme/night.css
deleted file mode 100755
index a84ec4f..0000000
--- a/src/codemirror/theme/night.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Loosely based on the Midnight Textmate theme */
-
-.cm-s-night { background: #0a001f; color: #f8f8f8; }
-.cm-s-night span.CodeMirror-selected { background: #a8f !important; }
-.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
-.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
-.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
-
-.cm-s-night span.cm-comment { color: #6900a1; }
-.cm-s-night span.cm-atom { color: #845dc4; }
-.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
-.cm-s-night span.cm-keyword { color: #599eff; }
-.cm-s-night span.cm-string { color: #37f14a; }
-.cm-s-night span.cm-meta { color: #7678e2; }
-.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
-.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
-.cm-s-night span.cm-error { color: #9d1e15; }
-.cm-s-night span.cm-bracket { color: #8da6ce; }
-.cm-s-night span.cm-comment { color: #6900a1; }
-.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
diff --git a/src/css/coderdeck.css b/src/css/coderdeck.css
deleted file mode 100755
index 40a3b83..0000000
--- a/src/css/coderdeck.css
+++ /dev/null
@@ -1,390 +0,0 @@
-html, body {
-  -webkit-font-smoothing: antialiased;
-  color: #222;
-  margin: 0;
-  padding: 0;
-  background: url(../../assets/ladieslearningcode-125x125.gif) 10px -10px no-repeat;
-  /*border-top: 7px #b1009a solid;*/
-}
-h1, h2, h3 {
-  /*text-transform: uppercase;*/
-}
-.deck-container em {
-  font-weight: 600;
-}
-.deck-container #presentation {
-	margin-top: 15px;
-}
-.deck-container {
-  /*font-family: 'Istok Web', Arial, sans-serif;*/
-  font-family: 'Open Sans', Arial, sans-serif;
-  font-weight: 400;
-  font-size: 1em;
-  padding: 0; /* overriding deck.coder.css */
-  padding-left: 5px; /* use 145px if using LLC logo */
-}
-.deck-container h1, .deck-container h2, .deck-container h3 {
-	color: #B1009A;
-  /*font-family: 'Podkova', Arial, sans-serif;*/
-}
-.deck-container strong {
-	color: #2E2E2E;
-}
-
-
-.deck-container .slide {
-  background: #fff;
-  width: 940px;
-  /*height: 100%;*/ /* allow vertical scrolling -- espeically when there's lots of code */
-  min-height: 475px;
-  border: 3px solid #b1009a;
-  border-radius: 10px;
-  -moz-border-radius: 10px;
-  margin: 0 auto;
-  padding: 30px 50px 40px 50px;
-}
-
-/* Added so code editor areas won't resize in height */
-.CodeMirror-scroll {
-  height: auto !important;
-  overflow-y: hidden;
-  overflow-x: auto;
-  width: 100%;
-  min-height: 200px;
-}
-
-.coder-destination {
-  bottom: auto !important;
-  top: 0 !important;
-}
-
-.deck-container .slide-title {
-  font-size: 1em;
-  text-align: center; 
-}
-.deck-container .slide-title .workshop_title {
-  margin: 90px 0 0 0;
-}
-.deck-container .slide-title .download_link {
-  font-size: 1.3em; 
-  letter-spacing: 0.05em;
-}
-.deck-container .slide-title .download_link a {
-  font-size: 1.3em;
-  font-weight: bold;
-  letter-spacing: 0.03em;
-  text-decoration: none;
-}
-
-/*.deck-container .instructor_holder {
-  width: 560px;
-  margin: 70px auto 0 auto;
-}
-.deck-container .instructor_holder h2 {
-  text-transform: uppercase;
-  font-size: 2em;
-  margin-bottom: 1.5em;
-}
-.deck-container .instructor_holder div {
-  width: 50%;
-  float: left;
-}*/
-
-/*.deck-container .slide-title h1 {
-  font-size: 4em;
-  font-weight: 400;
-  letter-spacing: -0.04em;
-  text-transform: none;
-  position: static;
-  top: 0%;
-}*/
-
-.deck-container .slide-list h2 {
-  font-size: 3.5em;
-  padding-bottom: .07em;
-  margin-bottom: .1em;
-  margin-top: 0;
-}
-.deck-container .slide-list h3 {
-  font-size: 2em;
-  margin-bottom: .1em; 
-}
-.deck-container .slide-list ul, .deck-container .slide-list p {
-  font-size: 1.8em;	
-}
-.deck-container .slide-list ul {
-  margin-left: 1em;
-  /*list-style-type: square;*/
- 	margin-bottom: 0.6em;
-}
-.deck-container .slide-list li {
-  padding-left: .5em;
-  line-height: 1.2em;
-}
-.deck-container .slide-list li ul {
-	margin-bottom: 0;
-}
-.deck-container .slide-list li li {
-  font-size: 0.5em;
-}
-
-.deck-container .slide-subhead h1 {
-  font-size: 4em;
-  line-height: 1em;
-  margin: 0px;
-  padding: 2em 0 0.5em 0;
-  position: static;
-  -webkit-transform: none;
-  -moz-transform: none;
-  -ms-transform: none;
-  -o-transform: none;
-  transform: none;
-  text-transform: none;
-  top: 0%;
-}
-.deck-container .slide-subhead h2 {
-  font-size: 2em;
-  text-align: center;
-  margin: 0px;
-  padding: 0px;
-  padding-top: .1em; 
-}
-.deck-container .slide-subhead p {
-  font-size: 2em;
-  text-align: center;
-}
-
-/*.deck-container h1 {
-  font-weight: 700;
-  letter-spacing: -0.04em;
-  font-size: 4em;
-  line-height: .9em;
-  text-transform: none;
-  padding-top: 7em;
-}*/
-.deck-container h2 {
-  font-weight: 400;
-  border: none;
-  padding-top: 0;
-}
-.deck-container h3 {
-  font-weight: 800;
-}
-.deck-container .slide > pre {
-  padding:10px;
-  border-color: #ccc;
-  font-size: 1.2em;
-}
-.deck-container code {
-  color: #888; 
-}
-.deck-container blockquote {
-  font-size: 2em;
-  font-style: italic;
-  padding: 1em 2em;
-  color: #000;
-  border-left: 5px solid #d3502c; 
-}
-.deck-container blockquote p {
-  margin: 0; 
-}
-.deck-container blockquote cite {
-  font-size: .5em;
-  font-style: normal;
-  font-weight: bold;
-  color: #888; 
-}
-.deck-container ::-moz-selection, .deck-container ::selection {
-  background: #7E006E;
-  color: #fff; 
-}
-.deck-container a, .deck-container a:hover, .deck-container a:focus, .deck-container a:active, .deck-container a:visited {
-  color: #444;
-  text-decoration: underline; 
-}
-.deck-container a:hover, .deck-container a:focus {
-  color: #b1009a; 
-  text-decoration: none; 
-}
-.deck-container .deck-prev-link, .deck-container .deck-next-link {
-  background: #d3502c;
-  font-family: serif; 
-}
-.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited {
-  color: #fff; 
-}
-.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus {
-  background: #bf0000;
-  text-decoration: none; 
-}
-.deck-container .deck-status {
-  font-size: 0.6666em; 
-}
-.deck-container.deck-menu .slide {
-  background: #eee; 
-}
-.deck-container.deck-menu .deck-current {
-  background: #ddf; 
-}
-
-/* Logical Operators table */
-table.comparison-table {
-	width: 460px;
-}
-table.comparison-table tr {
-	border: 1px solid #000;
-}
-table.comparison-table tr td, table.comparison-table tr th {
-	padding: 5px 10px;
-}
-
-
-.deck-container img {
- display: inline;
-}
-
-.deck-container ol {
-  font-size: 1.8em;	
-}
-
-.centered {
-  text-align: center;
-}
-
-.vertically_centered {
-  position: absolute;
-  top:30%;
-  left: 40%;
-}
-
-.sidenote {
-  font-size: 17px !important; 
-    line-height: 18px;
-}
-
-.stickynote {
-  border: 1px solid #ccc;
-  background: url(../assets/icon-note.jpg) top left no-repeat;
-}
-.contains_sidebyside_icons {
-  width: 400px;
-  margin: 0 auto !important;
-}
-
-.sidebyside_download_icon {
-  float: left;
-  width: 200px;
-  text-align: center;
-}
-
-.keyword {
-  color: #B1009A;
-  font-weight: 600!important;
-  font-style: italic !important;
-}
-
-.deck-container .reminders {
-	background: url("../../assets/icon-reminder.jpg") no-repeat;
-	font-size: 1.2em;
-	min-height: 60px;
-	padding: 8px 0 0 90px;
-}
-.deck-container .reminders p {
-	font-size: 1em;
-}
-	.deck-container .reminders.single-line p, 
-	.deck-container .hint.single-line p {
-		padding-top: 10px;
-		margin-bottom: 0;
-	}
-span.marker {
- 	position: absolute;
- 	top: 8px;
-    right: 15px;
-    font-size: 1.3em;    
-}
-.assignment {
-	font-weight: 900;
-	color: red;
-}
-
-.hint {
-	font-style: italic;
-}
-
-.deck-container .hint {
-	background: url("../../assets/icon-hint.jpg") no-repeat;
-	font-size: 1.2em;
-	min-height: 60px;
-	padding: 8px 0 0 90px;
-}
-.deck-container .hint p {
-	font-size: 1em;
-}
-
-.var {
-	color: #770088;
-}	
-
-.highlight {
-	background-color: #FF9;
-}
-
-.smaller {
-  font-size: 0.5em !important;
-}
-
-.solution-link {
-  text-align: center;
-  padding-top: 20px !important;
-  font-size: 17px !important;
-}
-
-.show-hint {
-  color: #B1009A;
-  font-size: 16px !important;
-  font-style: italic !important;
-  cursor: pointer;
-}
-
-.hint-solution {
-  display: none;
-  color: #888;
-  font-size: 16px !important;
-  font-style: italic !important;
-}
-
-/* Styles for specific slides */
-.deck-container .get-started {
-  padding: 30px 110px 0;
-}
-  .deck-container .get-started h2 {
-    margin-bottom: 20px;
-  }
-  .deck-container .get-started a {
-    margin-top: 40px;
-    display: inline-block;
-  }
-
-.deck-container .intro h1 {
-  top: 120px;
-  font-size: 60px;
-}
-  .deck-container .intro .instructor_holder {
-    margin-top: 180px;
-  }
-  .instructor_holder img {
-    border-radius: 50%;
-  }
-  .instructor_holder a {
-    text-decoration: none;
-  }
-
-.csstransforms .deck-container h1.welcome {
-  top: 34%;
-}
-.deck-container p.sponsor {
-  text-align: center;
-  margin-top: 30%;
-}
-
diff --git a/src/css/deck.coder.css b/src/css/deck.coder.css
deleted file mode 100755
index 55c160f..0000000
--- a/src/css/deck.coder.css
+++ /dev/null
@@ -1,67 +0,0 @@
-
-.deck-container {
-  width:auto;
-  padding:0 10%;
-
-}
-
-.deck-container .coder-wrapper {
-  width:100%; 
-  position:relative;
-  border:1px solid #CCC;
-  border-radius: 15px;
-  padding: 5px 0px;
-  box-shadow: 4px 4px 10px #CCC;
-}  
-
-.deck-container .coder-editor-wrapper { 
-  padding:5px 1%;
-  border-right:1px solid #CCC;
-}
-
-.deck-container .coder-editor-wrapper pre {
-  font-family: monospace, sans-serif;
-  font-size:18px;
-}
-
-.deck-container .coder-destination { 
-  display:none;
-  padding:5px 1%;
-}
-
-
-.deck-container .coder-wrapper-split .coder-editor-wrapper { 
-  width:48%;
-}
-
-
-.deck-container .coder-wrapper-split .coder-destination { 
-  padding:5px 1%;
-  position:absolute; left:50%; bottom:0px;
-  width:48%;
-
-}
-
-.deck-container .coder-wrapper .coder-buttons {
-  position:absolute;
-  top:5px;
-  z-index:100;
-  right: 3%;
-
-}
-
-.deck-container .coder-wrapper .coder-buttons button {
-	border:none;
-	border-radius:8px;
-	padding:8px 12px;
-	color:white;
-	font-size:14px;
-	background-color:#CCC;
-	margin-left:5px;
-	
-
-}
-
-.deck-container .coder-wrapper-split .coder-buttons {
-  right: 53%;
-}
diff --git a/src/css/prettify.css b/src/css/prettify.css
deleted file mode 100755
index d44b3a2..0000000
--- a/src/css/prettify.css
+++ /dev/null
@@ -1 +0,0 @@
-.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
\ No newline at end of file
diff --git a/src/deck.coder.js b/src/deck.coder.js
deleted file mode 100755
index d26a138..0000000
--- a/src/deck.coder.js
+++ /dev/null
@@ -1,323 +0,0 @@
-/*!
- Copyright (c) 2011 Cykod LLC
- Dual licensed under the MIT license and the GPL license
-*/
-
-
-/*
-This module adds a code editor that shows up in individual slides
-*/
-
-
-
-(function($, deck, window, undefined) {
-  var $d = $(document),
-    $window = $(window),
-    savedGistData = {};
-
-  function unsanitize(str) {
-   return addScript(str).replace(/</g,'<').replace(/>/g,'>');
-  }
-
-  function addScript(str) {
-   return str.replace(/SCRIPTEND/g,'').replace(/SCRIPT/g,'
-
-
-
-
-
- -
- - - - - - - - - - - - - - diff --git a/src/deck.js/core/deck.core.js b/src/deck.js/core/deck.core.js deleted file mode 100755 index f91d3c9..0000000 --- a/src/deck.js/core/deck.core.js +++ /dev/null @@ -1,461 +0,0 @@ -/*! -Deck JS - deck.core - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -The deck.core module provides all the basic functionality for creating and -moving through a deck. It does so by applying classes to indicate the state of -the deck and its slides, allowing CSS to take care of the visual representation -of each state. It also provides methods for navigating the deck and inspecting -its state, as well as basic key bindings for going to the next and previous -slides. More functionality is provided by wholly separate extension modules -that use the API provided by core. -*/ -(function($, deck, document, undefined) { - var slides, // Array of all the uh, slides... - current, // Array index of the current slide - - events = { - /* - This event fires whenever the current slide changes, whether by way of - next, prev, or go. The callback function is passed two parameters, from - and to, equal to the indices of the old slide and the new slide - respectively. - - $(document).bind('deck.change', function(event, from, to) { - alert('Moving from slide ' + from + ' to ' + to); - }); - */ - change: 'deck.change', - - /* - This event fires at the end of deck initialization. Extensions should - implement any code that relies on user extensible options (key bindings, - element selectors, classes) within a handler for this event. Native - events associated with Deck JS should be scoped under a .deck event - namespace, as with the example below: - - var $d = $(document); - $.deck.defaults.keys.myExtensionKeycode = 70; // 'h' - $d.bind('deck.init', function() { - $d.bind('keydown.deck', function(event) { - if (event.which === $.deck.getOptions().keys.myExtensionKeycode) { - // Rock out - } - }); - }); - */ - initialize: 'deck.init' - }, - - options = {}, - $d = $(document), - - /* - Internal function. Updates slide and container classes based on which - slide is the current slide. - */ - updateStates = function() { - var oc = options.classes, - osc = options.selectors.container, - $container = $(osc), - old = $container.data('onSlide'), - $all = $(); - - // Container state - $container.removeClass(oc.onPrefix + old) - .addClass(oc.onPrefix + current) - .data('onSlide', current); - - // Remove and re-add child-current classes for nesting - $('.' + oc.current).parentsUntil(osc).removeClass(oc.childCurrent); - slides[current].parentsUntil(osc).addClass(oc.childCurrent); - - // Remove previous states - $.each(slides, function(i, el) { - $all = $all.add(el); - }); - $all.removeClass([ - oc.before, - oc.previous, - oc.current, - oc.next, - oc.after - ].join(" ")); - - // Add new states back in - slides[current].addClass(oc.current); - if (current > 0) { - slides[current-1].addClass(oc.previous); - } - if (current + 1 < slides.length) { - slides[current+1].addClass(oc.next); - } - if (current > 1) { - $.each(slides.slice(0, current - 1), function(i, el) { - el.addClass(oc.before); - }); - } - if (current + 2 < slides.length) { - $.each(slides.slice(current+2), function(i, el) { - el.addClass(oc.after); - }); - } - }, - - /* Methods exposed in the jQuery.deck namespace */ - methods = { - - /* - jQuery.deck(selector, options) - - selector: string | jQuery | array - options: object, optional - - Initializes the deck, using each element matched by selector as a slide. - May also be passed an array of string selectors or jQuery objects, in - which case each selector in the array is considered a slide. The second - parameter is an optional options object which will extend the default - values. - - $.deck('.slide'); - - or - - $.deck([ - '#first-slide', - '#second-slide', - '#etc' - ]); - */ - init: function(elements, opts) { - var startTouch, - $c, - tolerance, - esp = function(e) { - e.stopPropagation(); - }; - - options = $.extend(true, {}, $[deck].defaults, opts); - slides = []; - current = 0; - $c = $[deck]('getContainer'); - tolerance = options.touch.swipeTolerance; - - // Hide the deck while states are being applied to kill transitions - $c.addClass(options.classes.loading); - - // Fill slides array depending on parameter type - if ($.isArray(elements)) { - $.each(elements, function(i, e) { - slides.push($(e)); - }); - } - else { - $(elements).each(function(i, e) { - slides.push($(e)); - }); - } - - /* Remove any previous bindings, and rebind key events */ - $d.unbind('keydown.deck').bind('keydown.deck', function(e) { - if (e.which === options.keys.next || $.inArray(e.which, options.keys.next) > -1) { - methods.next(); - e.preventDefault(); - } - else if (e.which === options.keys.previous || $.inArray(e.which, options.keys.previous) > -1) { - methods.prev(); - e.preventDefault(); - } - }); - - /* Bind touch events for swiping between slides on touch devices */ - $c.unbind('touchstart.deck').bind('touchstart.deck', function(e) { - if (!startTouch) { - startTouch = $.extend({}, e.originalEvent.targetTouches[0]); - } - }) - .unbind('touchmove.deck').bind('touchmove.deck', function(e) { - $.each(e.originalEvent.changedTouches, function(i, t) { - if (startTouch && t.identifier === startTouch.identifier) { - if (t.screenX - startTouch.screenX > tolerance || t.screenY - startTouch.screenY > tolerance) { - $[deck]('prev'); - startTouch = undefined; - } - else if (t.screenX - startTouch.screenX < -1 * tolerance || t.screenY - startTouch.screenY < -1 * tolerance) { - $[deck]('next'); - startTouch = undefined; - } - return false; - } - }); - e.preventDefault(); - }) - .unbind('touchend.deck').bind('touchend.deck', function(t) { - $.each(t.originalEvent.changedTouches, function(i, t) { - if (startTouch && t.identifier === startTouch.identifier) { - startTouch = undefined; - } - }); - }) - .scrollLeft(0).scrollTop(0) - /* Stop propagation of key events within editable elements of slides */ - .undelegate('input, textarea, select, button, meter, progress, [contentEditable]', 'keydown', esp) - .delegate('input, textarea, select, button, meter, progress, [contentEditable]', 'keydown', esp); - - /* - Kick iframe videos, which dont like to redraw w/ transforms. - Remove this if Webkit ever fixes it. - */ - $.each(slides, function(i, $el) { - $el.unbind('webkitTransitionEnd.deck').bind('webkitTransitionEnd.deck', - function(event) { - if ($el.hasClass($[deck]('getOptions').classes.current)) { - var embeds = $(this).find('iframe').css('opacity', 0); - window.setTimeout(function() { - embeds.css('opacity', 1); - }, 100); - } - }); - }); - - updateStates(); - - // Show deck again now that slides are in place - $c.removeClass(options.classes.loading); - $d.trigger(events.initialize); - }, - - /* - jQuery.deck('go', index) - - index: integer - - Moves to the slide at the specified index. Index is 0-based, so - $.deck('go', 0); will move to the first slide. If index is out of bounds - or not a number the call is ignored. - */ - go: function(index) { - if (typeof index != 'number' || index < 0 || index >= slides.length) return; - - $d.trigger(events.change, [current, index]); - current = index; - updateStates(); - }, - - /* - jQuery.deck('next') - - Moves to the next slide. If the last slide is already active, the call - is ignored. - */ - next: function() { - methods.go(current+1); - }, - - /* - jQuery.deck('prev') - - Moves to the previous slide. If the first slide is already active, the - call is ignored. - */ - prev: function() { - methods.go(current-1); - }, - - /* - jQuery.deck('getSlide', index) - - index: integer, optional - - Returns a jQuery object containing the slide at index. If index is not - specified, the current slide is returned. - */ - getSlide: function(index) { - var i = typeof index !== 'undefined' ? index : current; - if (typeof i != 'number' || i < 0 || i >= slides.length) return null; - return slides[i]; - }, - - /* - jQuery.deck('getSlides') - - Returns all slides as an array of jQuery objects. - */ - getSlides: function() { - return slides; - }, - - /* - jQuery.deck('getContainer') - - Returns a jQuery object containing the deck container as defined by the - container option. - */ - getContainer: function() { - return $(options.selectors.container); - }, - - /* - jQuery.deck('getOptions') - - Returns the options object for the deck, including any overrides that - were defined at initialization. - */ - getOptions: function() { - return options; - }, - - /* - jQuery.deck('extend', name, method) - - name: string - method: function - - Adds method to the deck namespace with the key of name. This doesn’t - give access to any private member data — public methods must still be - used within method — but lets extension authors piggyback on the deck - namespace rather than pollute jQuery. - - $.deck('extend', 'alert', function(msg) { - alert(msg); - }); - - // Alerts 'boom' - $.deck('alert', 'boom'); - */ - extend: function(name, method) { - methods[name] = method; - } - }; - - /* jQuery extension */ - $[deck] = function(method, arg) { - if (methods[method]) { - return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); - } - else { - return methods.init(method, arg); - } - }; - - /* - The default settings object for a deck. All deck extensions should extend - this object to add defaults for any of their options. - - options.classes.after - This class is added to all slides that appear after the 'next' slide. - - options.classes.before - This class is added to all slides that appear before the 'previous' - slide. - - options.classes.childCurrent - This class is added to all elements in the DOM tree between the - 'current' slide and the deck container. For standard slides, this is - mostly seen and used for nested slides. - - options.classes.current - This class is added to the current slide. - - options.classes.loading - This class is applied to the deck container during loading phases and is - primarily used as a way to short circuit transitions between states - where such transitions are distracting or unwanted. For example, this - class is applied during deck initialization and then removed to prevent - all the slides from appearing stacked and transitioning into place - on load. - - options.classes.next - This class is added to the slide immediately following the 'current' - slide. - - options.classes.onPrefix - This prefix, concatenated with the current slide index, is added to the - deck container as you change slides. - - options.classes.previous - This class is added to the slide immediately preceding the 'current' - slide. - - options.selectors.container - Elements matched by this CSS selector will be considered the deck - container. The deck container is used to scope certain states of the - deck, as with the onPrefix option, or with extensions such as deck.goto - and deck.menu. - - options.keys.next - The numeric keycode used to go to the next slide. - - options.keys.previous - The numeric keycode used to go to the previous slide. - - options.touch.swipeTolerance - The number of pixels the users finger must travel to produce a swipe - gesture. - */ - $[deck].defaults = { - classes: { - after: 'deck-after', - before: 'deck-before', - childCurrent: 'deck-child-current', - current: 'deck-current', - loading: 'deck-loading', - next: 'deck-next', - onPrefix: 'on-slide-', - previous: 'deck-previous' - }, - - selectors: { - container: '.deck-container' - }, - - keys: { - // enter, space, page down, right arrow, down arrow, - next: [13, 32, 34, 39, 40], - // backspace, page up, left arrow, up arrow - previous: [8, 33, 37, 38] - }, - - touch: { - swipeTolerance: 60 - } - }; - - $d.ready(function() { - $('html').addClass('ready'); - }); - - /* - FF + Transforms + Flash video don't get along... - Firefox will reload and start playing certain videos after a - transform. Blanking the src when a previously shown slide goes out - of view prevents this. - */ - $d.bind('deck.change', function(e, from, to) { - var oldFrames = $[deck]('getSlide', from).find('iframe'), - newFrames = $[deck]('getSlide', to).find('iframe'); - - oldFrames.each(function() { - var $this = $(this), - curSrc = $this.attr('src'); - - if(curSrc) { - $this.data('deck-src', curSrc).attr('src', ''); - } - }); - - newFrames.each(function() { - var $this = $(this), - originalSrc = $this.data('deck-src'); - - if (originalSrc) { - $this.attr('src', originalSrc); - } - }); - }); -})(jQuery, 'deck', document); diff --git a/src/deck.js/core/deck.core.scss b/src/deck.js/core/deck.core.scss deleted file mode 100755 index ed82964..0000000 --- a/src/deck.js/core/deck.core.scss +++ /dev/null @@ -1,431 +0,0 @@ -html { - height:100%; -} - -.deck-container { - position:relative; - height:100%; - width:70%; - margin:0 auto; - padding:0 48px; - font-size:16px; - line-height:1.25; - overflow:hidden; - - .js & { - visibility:hidden; - } - - .ready & { - visibility:visible; - } - - .touch & { - -webkit-text-size-adjust:none; - } - - /* Resets and base styles from HTML5 Boilerplate */ - div, span, object, iframe, - h1, h2, h3, h4, h5, h6, p, blockquote, pre, - abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, - small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, - fieldset, form, label, legend, - table, caption, tbody, tfoot, thead, tr, th, td, - article, aside, canvas, details, figcaption, figure, - footer, header, hgroup, menu, nav, section, summary, - time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; - } - - article, aside, details, figcaption, figure, - footer, header, hgroup, menu, nav, section { - display: block; - } - - blockquote, q { - quotes:none; - - &:before, &:after { - content:""; - content:none; - } - } - - ins { - background-color:#ff9; - color:#000; - text-decoration:none; - } - - mark { - background-color:#ff9; - color:#000; - font-style:italic; - font-weight:bold; - } - - del { - text-decoration:line-through; - } - - abbr[title], dfn[title] { - border-bottom:1px dotted; - cursor:help; - } - - table { - border-collapse:collapse; - border-spacing:0; - } - - hr { - display:block; - height:1px; - border:0; - border-top:1px solid #ccc; - margin:1em 0; - padding:0; - } - - input, select { - vertical-align:middle; - } - - select, input, textarea, button { - font:99% sans-serif; - } - - pre, code, kbd, samp { - font-family:monospace, sans-serif; - } - - a { - -webkit-tap-highlight-color:rgba(0,0,0,0); - - &:hover, &:active { - outline:none; - } - } - - ul, ol { - margin-left:2em; - vertical-align:top; - } - - ol { - list-style-type:decimal; - } - - nav { - ul, li { - margin:0; - list-style:none; - list-style-image:none; - } - } - - small { - font-size:85%; - } - - strong, th { - font-weight:bold; - } - - td { - vertical-align:top; - } - - sub, sup { - font-size:75%; - line-height:0; - position:relative; - } - - sup { - top:-0.5em; - } - - sub { bottom: -0.25em; } - - textarea { - overflow:auto; - } - - legend { - .ie6 &, .ie7 & { - margin-left:-7px; - } - } - - input[type="radio"] { - vertical-align:text-bottom; - } - - input[type="checkbox"] { - vertical-align:bottom; - } - - .ie7 input[type="checkbox"] { - vertical-align:baseline; - } - - .ie6 input { - vertical-align:text-bottom; - } - - label, input[type="button"], input[type="submit"], input[type="image"], button { - cursor:pointer; - } - - button, input, select, textarea { - margin: 0; - } - - input, textarea { - &:invalid { - border-radius:1px; - -moz-box-shadow:0px 0px 5px red; - -webkit-box-shadow:0px 0px 5px red; - box-shadow: 0px 0px 5px red; - - .no-boxshadow { - background-color: #f0dddd; - } - } - } - - button { - width:auto; - overflow:visible; - } - - .ie7 & img { - -ms-interpolation-mode: bicubic; } - - &, select, input, textarea { - color:#444; - } - - a { - color:#607890; - - &:hover, &:focus { - color:#036; - } - - &:link { - -webkit-tap-highlight-color: #fff; - } - } - /* End HTML5 Boilerplate adaptations */ - - h1 { - font-size:4.5em; - font-weight:bold; - text-align:center; - padding-top:1em; - - .csstransforms & { - padding:0 48px; - position:absolute; - left:0; - right:0; - top:50%; - -webkit-transform:translate3d(0, -50%, 0); - -moz-transform:translate(0, -50%); - -ms-transform:translate(0, -50%); - -o-transform:translate(0, -50%); - transform:translate3d(0, -50%, 0); - } - } - - h2 { - font-size:2.25em; - font-weight:bold; - padding-top:.5em; - margin:0 0 .66666em 0; - border-bottom:3px solid #888; - } - - h3 { - font-size:1.4375em; - font-weight:bold; - margin-bottom:.30435em; - } - - h4 { - font-size:1.25em; - font-weight:bold; - margin-bottom:.25em; - } - - h5 { - font-size:1.125em; - font-weight:bold; - margin-bottom:.2222em; - } - - h6 { - font-size:1em; - font-weight:bold; - } - - img, iframe, video { - display:block; - max-width:100%; - } - - video, iframe, img { - display:block; - margin:0 auto; - } - - p, blockquote, iframe, img, ul, ol, pre, video { - margin-bottom:1em; - } - - pre { - white-space:pre; - white-space:pre-wrap; - word-wrap:break-word; - padding: 1em; - border:1px solid #888; - } - - em { - font-style:italic; - } - - li { - padding:.25em 0; - vertical-align:middle; - } - - &.deck-loading { - display:none; - } -} - -.slide { - width:auto; - min-height:100%; - position:relative; -} - -.deck-before, .deck-previous, .deck-next, .deck-after { - position:absolute; - left:-999em; - top:-999em; -} - -.deck-current { - z-index:2; -} - -.slide .slide { - visibility:hidden; - position:static; - min-height:0; -} - -.deck-child-current { - position:static; - z-index:2; - - .slide { - visibility:hidden; - } - - .deck-previous, .deck-before, .deck-current { - visibility:visible; - } -} - -body.deck-container { - overflow:visible; -} - -@media all and (orientation:portrait) { - -} - -@media all and (orientation:landscape) { - -} - -@media screen and (max-device-width: 480px) { - - /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */ -} - - -@media print { - * { - background: transparent !important; - color: black !important; - text-shadow: none !important; - filter:none !important; - -ms-filter: none !important; - -webkit-box-reflect:none !important; - -moz-box-reflect:none !important; - -webkit-box-shadow:none !important; - -moz-box-shadow:none !important; - box-shadow:none !important; - - :before, :after { - display:none !important; - } -} - a, a:visited { color: #444 !important; text-decoration: underline; } - a[href]:after { content: " (" attr(href) ")"; } - abbr[title]:after { content: " (" attr(title) ")"; } - .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } - pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } - thead { display: table-header-group; } - tr, img { page-break-inside: avoid; } - @page { margin: 0.5cm; } - p, h2, h3 { orphans: 3; widows: 3; } - h2, h3{ page-break-after: avoid; } - - .slide { - position:static !important; - visibility:visible !important; - display:block !important; - -webkit-transform:none !important; - -moz-transform:none !important; - -o-transform:none !important; - -ms-transform:none !important; - transform:none !important; - } - - h1 { - -webkit-transform:none !important; - -moz-transform:none !important; - -o-transform:none !important; - -ms-transform:none !important; - transform:none !important; - padding:0 !important; - position:static !important; - } - - .deck-container > .slide { - page-break-after: always; - } - - .deck-container { - width:100% !important; - height:auto !important; - padding:0 !important; - display:block !important; - } - - script { - display:none; - } -} diff --git a/src/deck.js/extensions/goto/deck.goto.css b/src/deck.js/extensions/goto/deck.goto.css deleted file mode 100755 index 4d04dd2..0000000 --- a/src/deck.js/extensions/goto/deck.goto.css +++ /dev/null @@ -1,41 +0,0 @@ -.deck-container .goto-form { - position: absolute; - z-index: 3; - bottom: 10px; - left: 50%; - height: 1.75em; - margin: 0 0 0 -7.125em; - line-height: 1.75em; - padding: 0.625em; - display: none; - background: #ccc; - overflow: hidden; -} -.borderradius .deck-container .goto-form { - -webkit-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; -} -.deck-container .goto-form label { - font-weight: bold; -} -.deck-container .goto-form label, .deck-container .goto-form input { - display: inline-block; - font-family: inherit; -} - -.deck-goto .goto-form { - display: block; -} - -#goto-slide { - width: 4.375em; - margin: 0 0.625em; - height: 1.4375em; -} - -@media print { - .goto-form, #goto-slide { - display: none !important; - } -} diff --git a/src/deck.js/extensions/goto/deck.goto.html b/src/deck.js/extensions/goto/deck.goto.html deleted file mode 100755 index da96066..0000000 --- a/src/deck.js/extensions/goto/deck.goto.html +++ /dev/null @@ -1,6 +0,0 @@ - -
- - - - \ No newline at end of file diff --git a/src/deck.js/extensions/goto/deck.goto.js b/src/deck.js/extensions/goto/deck.goto.js deleted file mode 100755 index 702c057..0000000 --- a/src/deck.js/extensions/goto/deck.goto.js +++ /dev/null @@ -1,118 +0,0 @@ -/*! -Deck JS - deck.goto - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -This module adds the necessary methods and key bindings to show and hide a form -for jumping to any slide number in the deck (and processes that form -accordingly). The form-showing state is indicated by the presence of a class on -the deck container. -*/ -(function($, deck, undefined) { - var $d = $(document); - - /* - Extends defaults/options. - - options.classes.goto - This class is added to the deck container when showing the Go To Slide - form. - - options.selectors.gotoForm - The element that matches this selector is the form that is submitted - when a user hits enter after typing a slide number in the gotoInput - element. - - options.selectors.gotoInput - The element that matches this selector is the text input field for - entering a slide number in the Go To Slide form. - - options.keys.goto - The numeric keycode used to toggle between showing and hiding the Go To - Slide form. - */ - $.extend(true, $[deck].defaults, { - classes: { - goto: 'deck-goto' - }, - - selectors: { - gotoForm: '.goto-form', - gotoInput: '#goto-slide' - }, - - keys: { - goto: 71 // g - } - }); - - /* - jQuery.deck('showGoTo') - - Shows the Go To Slide form by adding the class specified by the goto class - option to the deck container. - */ - $[deck]('extend', 'showGoTo', function() { - $[deck]('getContainer').addClass($[deck]('getOptions').classes.goto); - $($[deck]('getOptions').selectors.gotoInput).focus(); - }); - - /* - jQuery.deck('hideGoTo') - - Hides the Go To Slide form by removing the class specified by the goto class - option from the deck container. - */ - $[deck]('extend', 'hideGoTo', function() { - $[deck]('getContainer').removeClass($[deck]('getOptions').classes.goto); - $($[deck]('getOptions').selectors.gotoInput).blur(); - }); - - /* - jQuery.deck('toggleGoTo') - - Toggles between showing and hiding the Go To Slide form. - */ - $[deck]('extend', 'toggleGoTo', function() { - $[deck]($[deck]('getContainer').hasClass($[deck]('getOptions').classes.goto) ? 'hideGoTo' : 'showGoTo'); - }); - - $d.bind('deck.init', function() { - // Bind key events - $d.unbind('keydown.deckgoto').bind('keydown.deckgoto', function(e) { - var key = $[deck]('getOptions').keys.goto; - - if (e.which === key ||$.inArray(e.which, key) > -1) { - e.preventDefault(); - $[deck]('toggleGoTo'); - } - }); - - // Process form submittal, go to the slide entered - $($[deck]('getOptions').selectors.gotoForm) - .unbind('submit.deckgoto') - .bind('submit.deckgoto', function(e) { - var $field = ($($[deck]('getOptions').selectors.gotoInput)), - i = parseInt($field.val(), 10); - - if (!($.isNaN(i) || i < 1 || i > $[deck]('getSlides').length)) { - $[deck]('go', i - 1); - $[deck]('hideGoTo'); - $field.val(''); - } - - e.preventDefault(); - }); - - $($[deck]('getOptions').selectors.gotoInput) - .unbind('keydown.deckgoto') - .bind('keydown.deckgoto', function(e) { - e.stopPropagation(); - }); - }); -})(jQuery, 'deck'); - diff --git a/src/deck.js/extensions/goto/deck.goto.scss b/src/deck.js/extensions/goto/deck.goto.scss deleted file mode 100755 index b25d13b..0000000 --- a/src/deck.js/extensions/goto/deck.goto.scss +++ /dev/null @@ -1,46 +0,0 @@ -.deck-container { - .goto-form { - position:absolute; - z-index:3; - bottom:10px; - left:50%; - height:1.75em; - margin:0 0 0 -7.125em; - line-height:1.75em; - padding:0.625em; - display:none; - background:#ccc; - overflow:hidden; - - .borderradius & { - -webkit-border-radius:10px; - -moz-border-radius:10px; - border-radius:10px; - } - - label { - font-weight:bold; - } - - label, input { - display:inline-block; - font-family:inherit; - } - } -} - -.deck-goto .goto-form { - display:block; -} - -#goto-slide { - width:4.375em; - margin:0 0.625em; - height:1.4375em; -} - -@media print { - .goto-form, #goto-slide { - display:none !important; - } -} \ No newline at end of file diff --git a/src/deck.js/extensions/hash/deck.hash.css b/src/deck.js/extensions/hash/deck.hash.css deleted file mode 100755 index 28f0732..0000000 --- a/src/deck.js/extensions/hash/deck.hash.css +++ /dev/null @@ -1,13 +0,0 @@ -.deck-container .deck-permalink { - display: none; - position: absolute; - z-index: 4; - bottom: 30px; - right: 0; - width: 48px; - text-align: center; -} - -.no-history .deck-container:hover .deck-permalink { - display: block; -} diff --git a/src/deck.js/extensions/hash/deck.hash.html b/src/deck.js/extensions/hash/deck.hash.html deleted file mode 100755 index 102579c..0000000 --- a/src/deck.js/extensions/hash/deck.hash.html +++ /dev/null @@ -1,2 +0,0 @@ - -# \ No newline at end of file diff --git a/src/deck.js/extensions/hash/deck.hash.js b/src/deck.js/extensions/hash/deck.hash.js deleted file mode 100755 index c2200ee..0000000 --- a/src/deck.js/extensions/hash/deck.hash.js +++ /dev/null @@ -1,113 +0,0 @@ -/*! -Deck JS - deck.hash - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -This module adds deep linking to individual slides, enables internal links -to slides within decks, and updates the address bar with the hash as the user -moves through the deck. A permalink anchor is also updated. Standard themes -hide this link in browsers that support the History API, and show it for -those that do not. Slides that do not have an id are assigned one according to -the hashPrefix option. -*/ -(function ($, deck, window, undefined) { - var $d = $(document), - $window = $(window), - - /* Collection of internal fragment links in the deck */ - $internals, - - /* - Internal only function. Given a string, extracts the id from the hash, - matches it to the appropriate slide, and navigates there. - */ - goByHash = function(str) { - var id = str.substr(str.indexOf("#") + 1), - slides = $[deck]('getSlides'); - - $.each(slides, function(i, $el) { - if ($el.attr('id') === id) { - $[deck]('go', i); - return false; - } - }); - - // If we don't set these to 0 the container scrolls due to hashchange - $[deck]('getContainer').scrollLeft(0).scrollTop(0); - }; - - /* - Extends defaults/options. - - options.selectors.hashLink - The element matching this selector has its href attribute updated to - the hash of the current slide as the user navigates through the deck. - - options.hashPrefix - Every slide that does not have an id is assigned one at initialization. - Assigned ids take the form of hashPrefix + slideIndex, e.g., slide-0, - slide-12, etc. - */ - $.extend(true, $[deck].defaults, { - selectors: { - hashLink: '.deck-permalink' - }, - - hashPrefix: 'slide-' - }); - - - $d.bind('deck.init', function() { - $internals = $(); - - $.each($[deck]('getSlides'), function(i, $el) { - var hash; - - /* Hand out ids to the unfortunate slides born without them */ - if (!$el.attr('id')) { - $el.attr('id', $[deck]('getOptions').hashPrefix + i); - } - - hash ='#' + $el.attr('id'); - - /* Deep link to slides on init */ - if (hash === window.location.hash) { - $[deck]('go', i); - } - - /* Add internal links to this slide */ - $internals = $internals.add('a[href="' + hash + '"]'); - }); - - if (!Modernizr.hashchange) { - /* Set up internal links using click for the poor browsers - without a hashchange event. */ - $internals.unbind('click.deckhash').bind('click.deckhash', function(e) { - goByHash($(this).attr('href')); - }); - } - }) - /* Update permalink and address bar on a slide change */ - .bind('deck.change', function(e, from, to) { - var hash = '#' + $[deck]('getSlide', to).attr('id'); - - $($[deck]('getOptions').selectors.hashLink).attr('href', hash); - if (Modernizr.history) { - window.history.replaceState({}, "", hash); - } - }); - - /* Deals with internal links in modern browsers */ - $window.bind('hashchange.deckhash', function(e) { - if (e.originalEvent && e.originalEvent.newURL) { - goByHash(e.originalEvent.newURL); - } - else { - goByHash(window.location.hash); - } - }); -})(jQuery, 'deck', this); \ No newline at end of file diff --git a/src/deck.js/extensions/hash/deck.hash.scss b/src/deck.js/extensions/hash/deck.hash.scss deleted file mode 100755 index 03b412d..0000000 --- a/src/deck.js/extensions/hash/deck.hash.scss +++ /dev/null @@ -1,15 +0,0 @@ -.deck-container { - .deck-permalink { - display:none; - position:absolute; - z-index:4; - bottom:30px; - right:0; - width:48px; - text-align:center; - } -} - -.no-history .deck-container:hover .deck-permalink { - display:block; -} \ No newline at end of file diff --git a/src/deck.js/extensions/menu/deck.menu.css b/src/deck.js/extensions/menu/deck.menu.css deleted file mode 100755 index 58c5c39..0000000 --- a/src/deck.js/extensions/menu/deck.menu.css +++ /dev/null @@ -1,24 +0,0 @@ -.deck-menu > .slide { - float: left; - width: 22%; - height: 22%; - min-height: 0; - margin: 1%; - font-size: 0.22em; - overflow: hidden; - padding: 0 0.5%; -} -.deck-menu .slide { - background: #eee; - position: relative; - left: 0; - top: 0; - visibility: visible; - cursor: pointer; -} -.deck-menu iframe, .deck-menu img, .deck-menu video { - max-width: 100%; -} -.deck-menu .deck-current, .no-touch .deck-menu .slide:hover { - background: #ddf; -} diff --git a/src/deck.js/extensions/menu/deck.menu.js b/src/deck.js/extensions/menu/deck.menu.js deleted file mode 100755 index 26b9f69..0000000 --- a/src/deck.js/extensions/menu/deck.menu.js +++ /dev/null @@ -1,127 +0,0 @@ -/*! -Deck JS - deck.menu - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -This module adds the methods and key binding to show and hide a menu of all -slides in the deck. The deck menu state is indicated by the presence of a class -on the deck container. -*/ -(function($, deck, undefined) { - var $d = $(document); - - /* - Extends defaults/options. - - options.classes.menu - This class is added to the deck container when showing the slide menu. - - options.keys.menu - The numeric keycode used to toggle between showing and hiding the slide - menu. - - options.touch.doubletapWindow - Two consecutive touch events within this number of milliseconds will - be considered a double tap, and will toggle the menu on touch devices. - */ - $.extend(true, $[deck].defaults, { - classes: { - menu: 'deck-menu' - }, - - keys: { - menu: 77 // m - }, - - touch: { - doubletapWindow: 400 - } - }); - - /* - jQuery.deck('showMenu') - - Shows the slide menu by adding the class specified by the menu class option - to the deck container. - */ - $[deck]('extend', 'showMenu', function() { - $[deck]('getContainer').addClass($[deck]('getOptions').classes.menu); - $[deck]('getContainer').scrollTop($[deck]('getSlide').offset().top); - }); - - /* - jQuery.deck('hideMenu') - - Hides the slide menu by removing the class specified by the menu class - option from the deck container. - */ - $[deck]('extend', 'hideMenu', function() { - $[deck]('getContainer').removeClass($[deck]('getOptions').classes.menu); - $[deck]('getContainer').scrollTop(0); - }); - - /* - jQuery.deck('toggleMenu') - - Toggles between showing and hiding the slide menu. - */ - $[deck]('extend', 'toggleMenu', function() { - $[deck]('getContainer').hasClass($[deck]('getOptions').classes.menu) ? - $[deck]('hideMenu') : $[deck]('showMenu'); - }); - - $d.bind('deck.init', function() { - var opts = $[deck]('getOptions'), - touchEndTime = 0, - currentSlide; - - // Bind key events - $d.unbind('keydown.deckmenu').bind('keydown.deckmenu', function(e) { - if (e.which === opts.keys.menu || $.inArray(e.which, opts.keys.menu) > -1) { - $[deck]('toggleMenu'); - e.preventDefault(); - } - }); - - // Double tap to toggle slide menu for touch devices - $[deck]('getContainer').unbind('touchstart.deckmenu').bind('touchstart.deckmenu', function(e) { - currentSlide = $[deck]('getSlide'); - }) - .unbind('touchend.deckmenu').bind('touchend.deckmenu', function(e) { - var now = Date.now(); - - // Ignore this touch event if it caused a nav change (swipe) - if (currentSlide !== $[deck]('getSlide')) return; - - if (now - touchEndTime < opts.touch.doubletapWindow) { - $[deck]('toggleMenu'); - e.preventDefault(); - } - touchEndTime = now; - }); - - // Selecting slides from the menu - $.each($[deck]('getSlides'), function(i, $s) { - $s.unbind('click.deckmenu').bind('click.deckmenu', function(e) { - if (!$[deck]('getContainer').hasClass(opts.classes.menu)) return; - - $[deck]('go', i); - $[deck]('hideMenu'); - e.stopPropagation(); - e.preventDefault(); - }); - }); - }) - .bind('deck.change', function(e, from, to) { - var container = $[deck]('getContainer'); - - if (container.hasClass($[deck]('getOptions').classes.menu)) { - container.scrollTop($[deck]('getSlide', to).offset().top); - } - }); -})(jQuery, 'deck'); - diff --git a/src/deck.js/extensions/menu/deck.menu.scss b/src/deck.js/extensions/menu/deck.menu.scss deleted file mode 100755 index bc6e621..0000000 --- a/src/deck.js/extensions/menu/deck.menu.scss +++ /dev/null @@ -1,29 +0,0 @@ -.deck-menu { - > .slide { - float:left; - width:22%; - height:22%; - min-height:0; - margin:1%; - font-size:0.22em; - overflow:hidden; - padding:0 0.5%; - } - - .slide { - background:#eee; - position:relative; - left:0; - top:0; - visibility:visible; - cursor:pointer; - } - - iframe, img, video { - max-width:100%; - } - - .deck-current, .no-touch & .slide:hover { - background:#ddf; - } -} \ No newline at end of file diff --git a/src/deck.js/extensions/navigation/deck.navigation.css b/src/deck.js/extensions/navigation/deck.navigation.css deleted file mode 100755 index e1ebad8..0000000 --- a/src/deck.js/extensions/navigation/deck.navigation.css +++ /dev/null @@ -1,43 +0,0 @@ -.deck-container .deck-prev-link, .deck-container .deck-next-link { - display: none; - position: absolute; - z-index: 3; - top: 50%; - width: 32px; - height: 32px; - margin-top: -16px; - font-size: 20px; - font-weight: bold; - line-height: 32px; - vertical-align: middle; - text-align: center; - text-decoration: none; - color: #fff; - background: #888; -} -.borderradius .deck-container .deck-prev-link, .borderradius .deck-container .deck-next-link { - -webkit-border-radius: 16px; - -moz-border-radius: 16px; - border-radius: 16px; -} -.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited { - color: #fff; -} -.deck-container .deck-prev-link { - left: 8px; -} -.deck-container .deck-next-link { - right: 8px; -} -.deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link { - display: block; -} -.deck-container:hover .deck-prev-link.deck-nav-disabled, .touch .deck-container:hover .deck-prev-link, .deck-container:hover .deck-next-link.deck-nav-disabled, .touch .deck-container:hover .deck-next-link { - display: none; -} - -@media print { - .deck-prev-link, .deck-next-link { - display: none !important; - } -} diff --git a/src/deck.js/extensions/navigation/deck.navigation.html b/src/deck.js/extensions/navigation/deck.navigation.html deleted file mode 100755 index c756624..0000000 --- a/src/deck.js/extensions/navigation/deck.navigation.html +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/deck.js/extensions/navigation/deck.navigation.js b/src/deck.js/extensions/navigation/deck.navigation.js deleted file mode 100755 index b4f95b8..0000000 --- a/src/deck.js/extensions/navigation/deck.navigation.js +++ /dev/null @@ -1,83 +0,0 @@ -/*! -Deck JS - deck.navigation - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -This module adds clickable previous and next links to the deck. -*/ -(function($, deck, undefined) { - var $d = $(document); - - /* - Extends defaults/options. - - options.classes.navDisabled - This class is added to a navigation link when that action is disabled. - It is added to the previous link when on the first slide, and to the - next link when on the last slide. - - options.selectors.nextLink - The elements that match this selector will move the deck to the next - slide when clicked. - - options.selectors.previousLink - The elements that match this selector will move to deck to the previous - slide when clicked. - */ - $.extend(true, $[deck].defaults, { - classes: { - navDisabled: 'deck-nav-disabled' - }, - - selectors: { - nextLink: '.deck-next-link', - previousLink: '.deck-prev-link' - } - }); - - $d.bind('deck.init', function() { - var opts = $[deck]('getOptions'), - nextSlide = $[deck]('getSlide', 1), - nextId = nextSlide ? nextSlide.attr('id') : undefined; - - // Setup prev/next link events - $(opts.selectors.previousLink) - .unbind('click.decknavigation') - .bind('click.decknavigation', function(e) { - $[deck]('prev'); - e.preventDefault(); - }); - - $(opts.selectors.nextLink) - .unbind('click.decknavigation') - .bind('click.decknavigation', function(e) { - $[deck]('next'); - e.preventDefault(); - }); - - // Start on first slide, previous link is disabled, set next link href - $(opts.selectors.previousLink).addClass(opts.classes.navDisabled); - $(opts.selectors.nextLink).attr('href', '#' + (nextId ? nextId : '')); - }) - /* Updates link hrefs, and disabled states if last/first slide */ - .bind('deck.change', function(e, from, to) { - var opts = $[deck]('getOptions'), - last = $[deck]('getSlides').length - 1, - prevSlide = $[deck]('getSlide', to - 1), - nextSlide = $[deck]('getSlide', to + 1), - prevId = prevSlide ? prevSlide.attr('id') : undefined; - nextId = nextSlide ? nextSlide.attr('id') : undefined; - - $(opts.selectors.previousLink) - .toggleClass(opts.classes.navDisabled, !to) - .attr('href', '#' + (prevId ? prevId : '')); - $(opts.selectors.nextLink) - .toggleClass(opts.classes.navDisabled, to === last) - .attr('href', '#' + (nextId ? nextId : '')); - }); -})(jQuery, 'deck'); - diff --git a/src/deck.js/extensions/navigation/deck.navigation.scss b/src/deck.js/extensions/navigation/deck.navigation.scss deleted file mode 100755 index 815602f..0000000 --- a/src/deck.js/extensions/navigation/deck.navigation.scss +++ /dev/null @@ -1,56 +0,0 @@ -@mixin border-radius($r) { - -webkit-border-radius:$r; - -moz-border-radius:$r; - border-radius:$r; -} - -.deck-container { - .deck-prev-link, .deck-next-link { - display:none; - position:absolute; - z-index:3; - top:50%; - width:32px; - height:32px; - margin-top:-16px; - font-size:20px; - font-weight:bold; - line-height:32px; - vertical-align:middle; - text-align:center; - text-decoration:none; - color:#fff; - background:#888; - - .borderradius & { - @include border-radius(16px); - } - - &:hover, &:focus, &:active, &:visited { - color:#fff; - } - } - - .deck-prev-link { - left:8px; - } - - .deck-next-link { - right:8px; - } - - &:hover .deck-prev-link, &:hover .deck-next-link { - display:block; - - &.deck-nav-disabled, .touch & { - display:none; - } - } -} - - -@media print { - .deck-prev-link, .deck-next-link { - display:none !important; - } -} diff --git a/src/deck.js/extensions/scale/deck.scale.css b/src/deck.js/extensions/scale/deck.scale.css deleted file mode 100755 index ce1d088..0000000 --- a/src/deck.js/extensions/scale/deck.scale.css +++ /dev/null @@ -1,16 +0,0 @@ -.csstransforms .deck-container.deck-scale { - width: auto; - -webkit-transform-origin: 50% 0; - -moz-transform-origin: 50% 0; - -o-transform-origin: 50% 0; - -ms-transform-origin: 50% 0; - transform-origin: 50% 0; -} -.csstransforms .deck-container.deck-scale.deck-menu { - width: 70%; - -webkit-transform: none !important; - -moz-transform: none !important; - -o-transform: none !important; - -ms-transform: none !important; - transform: none !important; -} diff --git a/src/deck.js/extensions/scale/deck.scale.js b/src/deck.js/extensions/scale/deck.scale.js deleted file mode 100755 index b0db9c3..0000000 --- a/src/deck.js/extensions/scale/deck.scale.js +++ /dev/null @@ -1,155 +0,0 @@ -/*! -Deck JS - deck.scale - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -This module adds automatic scaling to the deck. It should only be used on -standalone decks where the body is the deck container. Slides are scaled down -using CSS transforms to fit within the browser window. If the browser window -is big enough to hold the slides without scaling, no scaling occurs. The user -can disable and enable scaling with a keyboard shortcut. - -Note: CSS transforms make Flash videos render incorrectly. Presenters that -need to use video will want to disable scaling to play them. HTML5 video -works fine. -*/ -(function($, deck, window, undefined) { - var $d = $(document), - $w = $(window), - baseHeight, // Value to scale against - timer, // Timeout id for debouncing - - /* - Internal function to do all the dirty work of scaling the deck container. - */ - scaleDeck = function() { - var obh = $[deck]('getOptions').baseHeight, - $container = $[deck]('getContainer'), - height = $w.height(), - slides = $[deck]('getSlides'), - scale, - transform; - - // Don't scale if scaling disabled - if (!$container.hasClass($[deck]('getOptions').classes.scale)) { - scale = 1; - } - else { - // Use tallest slide as base height if not set manually - baseHeight = obh ? obh : (function() { - var greatest = 0; - - $.each(slides, function(i, $slide) { - greatest = Math.max(greatest, $slide.outerHeight()); - }); - - return greatest; - })(); - - scale = height / baseHeight; - } - - // Scale, but don't scale up - transform = scale >= 1 ? 'none' : 'scale(' + scale + ')'; - $.each('Webkit Moz O ms Khtml'.split(' '), function(i, prefix) { - $container.css(prefix + 'Transform', transform); - }); - }; - - /* - Extends defaults/options. - - options.classes.scale - This class is added to the deck container when scaling is enabled. - It is enabled by default when the module is included. - - options.keys.scale - The numeric keycode used to toggle enabling and disabling scaling. - - options.baseHeight - When baseheight is falsy, as it is by default, the deck is scaled - in proportion to the height of the slides. You may instead specify - a height, and the deck will be scaled against this height regardless - of the actual content height. - - options.scaleDebounce - Scaling on the browser resize event is debounced. This number is the - threshold in milliseconds. You can learn more about debouncing here: - http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ - - */ - $.extend(true, $[deck].defaults, { - classes: { - scale: 'deck-scale' - }, - - keys: { - scale: 83 // s - }, - - baseHeight: null, - scaleDebounce: 200 - }); - - /* - jQuery.deck('disableScale') - - Disables scaling and removes the scale class from the deck container. - */ - $[deck]('extend', 'disableScale', function() { - $[deck]('getContainer').removeClass($[deck]('getOptions').classes.scale); - scaleDeck(); - }); - - /* - jQuery.deck('enableScale') - - Enables scaling and adds the scale class to the deck container. - */ - $[deck]('extend', 'enableScale', function() { - $[deck]('getContainer').addClass($[deck]('getOptions').classes.scale); - scaleDeck(); - }); - - /* - jQuery.deck('toggleScale') - - Toggles between enabling and disabling scaling. - */ - $[deck]('extend', 'toggleScale', function() { - var $c = $[deck]('getContainer'); - $[deck]($c.hasClass($[deck]('getOptions').classes.scale) ? - 'disableScale' : 'enableScale'); - }); - - $d.bind('deck.init', function() { - var opts = $[deck]('getOptions'); - - // Scaling enabled at start - $[deck]('getContainer').addClass(opts.classes.scale); - - // Debounce the resize scaling - $w.unbind('resize.deckscale').bind('resize.deckscale', function() { - window.clearTimeout(timer); - timer = window.setTimeout(scaleDeck, opts.scaleDebounce); - }) - // Scale once on load, in case images or something change layout - .unbind('load.deckscale').bind('load.deckscale', scaleDeck); - - // Bind key events - $d.unbind('keydown.deckscale').bind('keydown.deckscale', function(e) { - if (e.which === opts.keys.scale || $.inArray(e.which, opts.keys.scale) > -1) { - $[deck]('toggleScale'); - e.preventDefault(); - } - }); - - // Scale once on init - scaleDeck(); - }); -})(jQuery, 'deck', this); - diff --git a/src/deck.js/extensions/scale/deck.scale.scss b/src/deck.js/extensions/scale/deck.scale.scss deleted file mode 100755 index 4b39f11..0000000 --- a/src/deck.js/extensions/scale/deck.scale.scss +++ /dev/null @@ -1,17 +0,0 @@ -.csstransforms .deck-container.deck-scale { - width:auto; - -webkit-transform-origin: 50% 0; - -moz-transform-origin: 50% 0; - -o-transform-origin: 50% 0; - -ms-transform-origin: 50% 0; - transform-origin: 50% 0; - - &.deck-menu { - width:70%; - -webkit-transform:none !important; - -moz-transform:none !important; - -o-transform:none !important; - -ms-transform:none !important; - transform:none !important; - } -} \ No newline at end of file diff --git a/src/deck.js/extensions/status/deck.status.css b/src/deck.js/extensions/status/deck.status.css deleted file mode 100755 index 259aa44..0000000 --- a/src/deck.js/extensions/status/deck.status.css +++ /dev/null @@ -1,14 +0,0 @@ -.deck-container .deck-status { - position: absolute; - bottom: 10px; - right: 5px; - color: #888; - z-index: 3; - margin: 0; -} - -@media print { - .deck-status { - display: none; - } -} diff --git a/src/deck.js/extensions/status/deck.status.html b/src/deck.js/extensions/status/deck.status.html deleted file mode 100755 index 310a025..0000000 --- a/src/deck.js/extensions/status/deck.status.html +++ /dev/null @@ -1,6 +0,0 @@ - -

- - / - -

\ No newline at end of file diff --git a/src/deck.js/extensions/status/deck.status.js b/src/deck.js/extensions/status/deck.status.js deleted file mode 100755 index 0ed90a0..0000000 --- a/src/deck.js/extensions/status/deck.status.js +++ /dev/null @@ -1,42 +0,0 @@ -/*! -Deck JS - deck.status - v1.0 -Copyright (c) 2011 Caleb Troughton -Dual licensed under the MIT license and GPL license. -https://github.com/imakewebthings/deck.js/blob/master/MIT-license.txt -https://github.com/imakewebthings/deck.js/blob/master/GPL-license.txt -*/ - -/* -This module adds a (current)/(total) style status indicator to the deck. -*/ -(function($, deck, undefined) { - var $d = $(document); - - /* - Extends defaults/options. - - options.selectors.statusCurrent - The element matching this selector displays the current slide number. - - options.selectors.statusTotal - The element matching this selector displays the total number of slides. - */ - $.extend(true, $[deck].defaults, { - selectors: { - statusCurrent: '.deck-status-current', - statusTotal: '.deck-status-total' - } - }); - - $d.bind('deck.init', function() { - // Start on first slide - $($[deck]('getOptions').selectors.statusCurrent).text(1); - // Set total slides once - $($[deck]('getOptions').selectors.statusTotal).text($[deck]('getSlides').length); - }) - /* Update current slide number with each change event */ - .bind('deck.change', function(e, from, to) { - $($[deck]('getOptions').selectors.statusCurrent).text(to + 1); - }); -})(jQuery, 'deck'); - diff --git a/src/deck.js/extensions/status/deck.status.scss b/src/deck.js/extensions/status/deck.status.scss deleted file mode 100755 index e5e0edd..0000000 --- a/src/deck.js/extensions/status/deck.status.scss +++ /dev/null @@ -1,16 +0,0 @@ -.deck-container { - .deck-status { - position:absolute; - bottom:10px; - right:5px; - color:#888; - z-index:3; - margin:0; - } -} - -@media print { - .deck-status { - display:none; - } -} \ No newline at end of file diff --git a/src/deck.js/introduction/index.html b/src/deck.js/introduction/index.html deleted file mode 100755 index fefd908..0000000 --- a/src/deck.js/introduction/index.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - Getting Started with deck.js - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Themes

- - - - - - -
- -
-

Getting Started with deck.js

-
- -
-

How to Make a Deck

-
    -
  1. -

    Write Slides

    -

    Slide content is simple HTML.

    -
  2. -
  3. -

    Choose Themes

    -

    One for slide styles and one for deck transitions.

    -
  4. -
  5. -

    Include Extensions

    -

    Add extra functionality to your deck, or leave it stripped down.

    -
  6. -
-
- -
-

The Markup

-

Slides are just HTML elements with a class of slide.

-
<section class="slide">
-   <h2>How to Make a Deck</h2>
-   <ol>
-      <li>
-         <h3>Write Slides</h3>
-         <p>Slide content is simple HTML.</p>
-      </li>
-      <li>
-         <h3>Choose Themes</h3>
-         <p>One for slide styles and one for deck transitions.</p>
-      </li>
-      …
-   </ol>
-</section>
-
- -
-

Style Themes

-

Customizes the colors, typography, and layout of slide content.

-
<link rel="stylesheet" href="/path/to/css/style-theme.css">
-

Transition Themes

-

Defines transitions between slides using CSS3 transitions. Less capable browsers fall back to cutaways. But you aren’t using those browsers to give your presentations, are you…

-
<link rel="stylesheet" href="/path/to/css/transition-theme.css">
-
- -
-

Extensions

-

Core gives you basic slide functionality with left and right arrow navigation, but you may want more. Here are the ones included in this deck:

- -
    -
  • - deck.goto: Adds a shortcut key to jump to any slide number. Hit g, type in the slide number, and hit enter. -
  • - -
  • - deck.hash: Enables internal linking within slides, deep linking to individual slides, and updates the address bar & a permalink anchor with each slide change. -
  • - -
  • - deck.menu: Adds a menu view, letting you see all slides in a grid. Hit m to toggle to menu view, continue navigating your deck, and hit m to return to normal view. Touch devices can double-tap the deck to switch between views. -
  • - -
  • - deck.navigation: Adds clickable left and right buttons for the less keyboard inclined. -
  • - -
  • - deck.status: Adds a page number indicator. (current/total) -
  • -
- -

Each extension folder in the download package contains the necessary JavaScript, CSS, and HTML files. For a complete list of extension modules included in deck.js, check out the documentation.

-
- -
-

Nested Slides

-

That last slide had a few steps. To create substeps in slides, just nest them:

-
<section class="slide">
-  <h2>Extensions</h2>
-  <p>Core gives you basic slide functionality...</p>		
-  <ul>
-     <li class="slide">
-        <h3>deck.goto</h3>
-        <p>Adds a shortcut key to jump to any slide number...</p>
-     </li>
-     <li class="slide">...</li>	
-     <li class="slide">...</li>
-     <li class="slide">...</li>
-  </ul>
-</section>
-
- -
-

Other Elements: Images

- Kitties -
<img src="http://placekitten.com/600/375" alt="Kitties">
-
- -
-

Other Elements: Blockquotes

-
-

Food is an important part of a balanced diet.

-

Fran Lebowitz

-
-
<blockquote cite="http://example.org">
-  <p>Food is an important part of a balanced diet.</p>
-  <p><cite>Fran Lebowitz</cite></p>
-</blockquote>
-
- - -
-

Other Elements: Video Embeds

-

Embed videos from your favorite online video service or with an HTML5 video element.

- - - -
<iframe src="http://player.vimeo.com/video/1063136?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0"></iframe>
-
- -
-

Digging Deeper

-

If you want to learn about making your own themes, extending deck.js, and more, check out the documentation.

-
- - - - -

- - / - -

- -
- - - - - -# - - - - - - - - - - - - - - - - - - - diff --git a/src/deck.js/introduction/introduction.css b/src/deck.js/introduction/introduction.css deleted file mode 100755 index eaf13ca..0000000 --- a/src/deck.js/introduction/introduction.css +++ /dev/null @@ -1,55 +0,0 @@ -.deck-container .theme-menu { - display: none; - position: fixed; - z-index: 3; - bottom: 10px; - left: 10px; - height: 20px; - line-height: 20px; - padding: 5px; - border: 1px solid #ddd; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - overflow: hidden; - background: #fff; - font-family: sans-serif; - color: #888; -} -.js .deck-container .theme-menu { - display: block; -} -.deck-container .theme-menu h2 { - float: left; - font-size: 20px; - border: 0; - padding: 5px 10px; - margin: 0; - height: 20px; - position: relative; - top: -5px; - left: -5px; - background: #ccc; - color: #444; - text-shadow: none; - font-family: sans-serif; - font-weight: bold; -} -.deck-container .theme-menu label { - float: left; - display: block; - font-size: 12px; - vertical-align: baseline; - margin: 0 4px 0 15px; -} -.deck-container .theme-menu select { - float: left; - display: block; - font-size: 14px; -} - -@media print { - .theme-menu { - display: none !important; - } -} diff --git a/src/deck.js/introduction/introduction.js b/src/deck.js/introduction/introduction.js deleted file mode 100755 index df37aeb..0000000 --- a/src/deck.js/introduction/introduction.js +++ /dev/null @@ -1,13 +0,0 @@ -$(function() { - // Deck initialization - $.deck('.slide'); - - $('#style-themes').change(function() { - $('#style-theme-link').attr('href', $(this).val()); - }); - - $('#transition-themes').change(function() { - $('#transition-theme-link').attr('href', $(this).val()); - }); -}); - diff --git a/src/deck.js/introduction/introduction.scss b/src/deck.js/introduction/introduction.scss deleted file mode 100755 index 94325b1..0000000 --- a/src/deck.js/introduction/introduction.scss +++ /dev/null @@ -1,62 +0,0 @@ -.deck-container { - .theme-menu { - display:none; - position:fixed; - z-index:3; - bottom:10px; - left:10px; - height:20px; - line-height:20px; - padding:5px; - border:1px solid #ddd; - -webkit-border-radius:5px; - -moz-border-radius:5px; - border-radius:5px; - overflow:hidden; - background:#fff; - font-family:sans-serif; - color:#888; - - .js & { - display:block; - } - - h2 { - float:left; - font-size:20px; - border:0; - padding:5px 10px; - margin:0; - height:20px; - position:relative; - top:-5px; - left:-5px; - background:#ccc; - color:#444; - text-shadow:none; - font-family:sans-serif; - font-weight:bold; - } - - label { - float:left; - display:block; - font-size:12px; - vertical-align:baseline; - margin:0 4px 0 15px; - } - - select { - float:left; - display:block; - font-size:14px; - } - } -} - -@media print { - .theme-menu { - display:none !important; - } -} - diff --git a/src/deck.js/jquery-1.6.4.min.js b/src/deck.js/jquery-1.6.4.min.js deleted file mode 100755 index 628ed9b..0000000 --- a/src/deck.js/jquery-1.6.4.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ -(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/src/deck.js/modernizr.custom.js b/src/deck.js/modernizr.custom.js deleted file mode 100755 index 964fb40..0000000 --- a/src/deck.js/modernizr.custom.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Modernizr 2.0.6 (Custom Build) | MIT & BSD - * Contains: fontface | backgroundsize | borderimage | borderradius | boxshadow | flexbox | hsla | multiplebgs | opacity | rgba | textshadow | cssanimations | csscolumns | generatedcontent | cssgradients | cssreflections | csstransforms | csstransforms3d | csstransitions | applicationcache | canvas | canvastext | draganddrop | hashchange | history | audio | video | indexeddb | input | inputtypes | localstorage | postmessage | sessionstorage | websockets | websqldatabase | webworkers | geolocation | inlinesvg | smil | svg | svgclippaths | touch | webgl | iepp | cssclasses | addtest | teststyles | testprop | testallprops | hasevent | prefixes | domprefixes | load - */ -;window.Modernizr=function(a,b,c){function H(){e.input=function(a){for(var b=0,c=a.length;b",a,""].join(""),k.id=i,k.innerHTML+=f,g.appendChild(k),h=c(k,a),k.parentNode.removeChild(k);return!!h},w=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),x,y={}.hasOwnProperty,z;!C(y,c)&&!C(y.call,c)?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)};var G=function(c,d){var f=c.join(""),g=d.length;v(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||j.touch.offsetTop===9,e.csstransforms3d=j.csstransforms3d.offsetLeft===9,e.generatedcontent=j.generatedcontent.offsetHeight>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",o.join("touch-enabled),("),i,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",o.join("transform-3d),("),i,")","{#csstransforms3d{left:9px;position:absolute}}"].join(""),['#generatedcontent:after{content:"',m,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!C(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return e.touch},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){return w("dragstart")&&w("drop")},r.websockets=function(){for(var b=-1,c=p.length;++b";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var I in r)z(r,I)&&(x=I.toLowerCase(),e[x]=r[I](),u.push((e[x]?"":"no-")+x));e.input||H(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return;b=typeof b=="boolean"?b:!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},A(""),j=l=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function s(a){var b=-1;while(++b -
- -
-
-
-
- -
- -
- -

- - / - -

- -
- - - -
- \ No newline at end of file diff --git a/src/deck.js/test/fixtures/iframe_simple.html b/src/deck.js/test/fixtures/iframe_simple.html deleted file mode 100755 index a64e9c0..0000000 --- a/src/deck.js/test/fixtures/iframe_simple.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -Simple Iframe - - diff --git a/src/deck.js/test/fixtures/iframes.html b/src/deck.js/test/fixtures/iframes.html deleted file mode 100755 index ccbd179..0000000 --- a/src/deck.js/test/fixtures/iframes.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
- -
-
- -
- -
- -
- -
- -
- -
- -
- -

- - / - -

- -
- - - -
-
diff --git a/src/deck.js/test/fixtures/standard.html b/src/deck.js/test/fixtures/standard.html deleted file mode 100755 index 1adc57f..0000000 --- a/src/deck.js/test/fixtures/standard.html +++ /dev/null @@ -1,41 +0,0 @@ -
-
- -
- -
- -
- -
- - Previous - Next - -

- - / - -

- -
- - - -
- - # - Internal Test Link -
- -
-
- -
- -
- -
- -
-
\ No newline at end of file diff --git a/src/deck.js/test/index.html b/src/deck.js/test/index.html deleted file mode 100755 index ddd265b..0000000 --- a/src/deck.js/test/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - deck.js - Jasmine Test Runner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/deck.js/test/lib/jasmine-html.js b/src/deck.js/test/lib/jasmine-html.js deleted file mode 100755 index 7383401..0000000 --- a/src/deck.js/test/lib/jasmine-html.js +++ /dev/null @@ -1,190 +0,0 @@ -jasmine.TrivialReporter = function(doc) { - this.document = doc || document; - this.suiteDivs = {}; - this.logRunningSpecs = false; -}; - -jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { - var el = document.createElement(type); - - for (var i = 2; i < arguments.length; i++) { - var child = arguments[i]; - - if (typeof child === 'string') { - el.appendChild(document.createTextNode(child)); - } else { - if (child) { el.appendChild(child); } - } - } - - for (var attr in attrs) { - if (attr == "className") { - el[attr] = attrs[attr]; - } else { - el.setAttribute(attr, attrs[attr]); - } - } - - return el; -}; - -jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { - var showPassed, showSkipped; - - this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' }, - this.createDom('div', { className: 'banner' }, - this.createDom('div', { className: 'logo' }, - this.createDom('span', { className: 'title' }, "Jasmine"), - this.createDom('span', { className: 'version' }, runner.env.versionString())), - this.createDom('div', { className: 'options' }, - "Show ", - showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), - showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), - this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") - ) - ), - - this.runnerDiv = this.createDom('div', { className: 'runner running' }, - this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), - this.runnerMessageSpan = this.createDom('span', {}, "Running..."), - this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) - ); - - this.document.body.appendChild(this.outerDiv); - - var suites = runner.suites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - var suiteDiv = this.createDom('div', { className: 'suite' }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), - this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); - this.suiteDivs[suite.id] = suiteDiv; - var parentDiv = this.outerDiv; - if (suite.parentSuite) { - parentDiv = this.suiteDivs[suite.parentSuite.id]; - } - parentDiv.appendChild(suiteDiv); - } - - this.startedAt = new Date(); - - var self = this; - showPassed.onclick = function(evt) { - if (showPassed.checked) { - self.outerDiv.className += ' show-passed'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); - } - }; - - showSkipped.onclick = function(evt) { - if (showSkipped.checked) { - self.outerDiv.className += ' show-skipped'; - } else { - self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); - } - }; -}; - -jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { - var results = runner.results(); - var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; - this.runnerDiv.setAttribute("class", className); - //do it twice for IE - this.runnerDiv.setAttribute("className", className); - var specs = runner.specs(); - var specCount = 0; - for (var i = 0; i < specs.length; i++) { - if (this.specFilter(specs[i])) { - specCount++; - } - } - var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); - message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; - this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); - - this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); -}; - -jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { - var results = suite.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.totalCount === 0) { // todo: change this to check results.skipped - status = 'skipped'; - } - this.suiteDivs[suite.id].className += " " + status; -}; - -jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { - if (this.logRunningSpecs) { - this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); - } -}; - -jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { - var results = spec.results(); - var status = results.passed() ? 'passed' : 'failed'; - if (results.skipped) { - status = 'skipped'; - } - var specDiv = this.createDom('div', { className: 'spec ' + status }, - this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), - this.createDom('a', { - className: 'description', - href: '?spec=' + encodeURIComponent(spec.getFullName()), - title: spec.getFullName() - }, spec.description)); - - - var resultItems = results.getItems(); - var messagesDiv = this.createDom('div', { className: 'messages' }); - for (var i = 0; i < resultItems.length; i++) { - var result = resultItems[i]; - - if (result.type == 'log') { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); - } else if (result.type == 'expect' && result.passed && !result.passed()) { - messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); - - if (result.trace.stack) { - messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); - } - } - } - - if (messagesDiv.childNodes.length > 0) { - specDiv.appendChild(messagesDiv); - } - - this.suiteDivs[spec.suite.id].appendChild(specDiv); -}; - -jasmine.TrivialReporter.prototype.log = function() { - var console = jasmine.getGlobal().console; - if (console && console.log) { - if (console.log.apply) { - console.log.apply(console, arguments); - } else { - console.log(arguments); // ie fix: console.log.apply doesn't exist on ie - } - } -}; - -jasmine.TrivialReporter.prototype.getLocation = function() { - return this.document.location; -}; - -jasmine.TrivialReporter.prototype.specFilter = function(spec) { - var paramMap = {}; - var params = this.getLocation().search.substring(1).split('&'); - for (var i = 0; i < params.length; i++) { - var p = params[i].split('='); - paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); - } - - if (!paramMap.spec) { - return true; - } - return spec.getFullName().indexOf(paramMap.spec) === 0; -}; diff --git a/src/deck.js/test/lib/jasmine-jquery.js b/src/deck.js/test/lib/jasmine-jquery.js deleted file mode 100755 index 4f7357d..0000000 --- a/src/deck.js/test/lib/jasmine-jquery.js +++ /dev/null @@ -1,288 +0,0 @@ -var readFixtures = function() { - return jasmine.getFixtures().proxyCallTo_('read', arguments); -}; - -var preloadFixtures = function() { - jasmine.getFixtures().proxyCallTo_('preload', arguments); -}; - -var loadFixtures = function() { - jasmine.getFixtures().proxyCallTo_('load', arguments); -}; - -var setFixtures = function(html) { - jasmine.getFixtures().set(html); -}; - -var sandbox = function(attributes) { - return jasmine.getFixtures().sandbox(attributes); -}; - -var spyOnEvent = function(selector, eventName) { - jasmine.JQuery.events.spyOn(selector, eventName); -} - -jasmine.getFixtures = function() { - return jasmine.currentFixtures_ = jasmine.currentFixtures_ || new jasmine.Fixtures(); -}; - -jasmine.Fixtures = function() { - this.containerId = 'jasmine-fixtures'; - this.fixturesCache_ = {}; - this.fixturesPath = 'spec/javascripts/fixtures'; -}; - -jasmine.Fixtures.prototype.set = function(html) { - this.cleanUp(); - this.createContainer_(html); -}; - -jasmine.Fixtures.prototype.preload = function() { - this.read.apply(this, arguments); -}; - -jasmine.Fixtures.prototype.load = function() { - this.cleanUp(); - this.createContainer_(this.read.apply(this, arguments)); -}; - -jasmine.Fixtures.prototype.read = function() { - var htmlChunks = []; - - var fixtureUrls = arguments; - for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) { - htmlChunks.push(this.getFixtureHtml_(fixtureUrls[urlIndex])); - } - - return htmlChunks.join(''); -}; - -jasmine.Fixtures.prototype.clearCache = function() { - this.fixturesCache_ = {}; -}; - -jasmine.Fixtures.prototype.cleanUp = function() { - jQuery('#' + this.containerId).remove(); -}; - -jasmine.Fixtures.prototype.sandbox = function(attributes) { - var attributesToSet = attributes || {}; - return jQuery('
').attr(attributesToSet); -}; - -jasmine.Fixtures.prototype.createContainer_ = function(html) { - var container; - if(html instanceof jQuery) { - container = jQuery('
'); - container.html(html); - } else { - container = '
' + html + '
' - } - jQuery('body').append(container); -}; - -jasmine.Fixtures.prototype.getFixtureHtml_ = function(url) { - if (typeof this.fixturesCache_[url] == 'undefined') { - this.loadFixtureIntoCache_(url); - } - return this.fixturesCache_[url]; -}; - -jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) { - var self = this; - var url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl; - jQuery.ajax({ - async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded - cache: false, - dataType: 'html', - url: url, - success: function(data) { - self.fixturesCache_[relativeUrl] = data; - }, - error: function(jqXHR, status, errorThrown) { - throw Error('Fixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + errorThrown.message + ')'); - } - }); -}; - -jasmine.Fixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) { - return this[methodName].apply(this, passedArguments); -}; - - -jasmine.JQuery = function() {}; - -jasmine.JQuery.browserTagCaseIndependentHtml = function(html) { - return jQuery('
').append(html).html(); -}; - -jasmine.JQuery.elementToString = function(element) { - return jQuery('
').append(element.clone()).html(); -}; - -jasmine.JQuery.matchersClass = {}; - -(function(namespace) { - var data = { - spiedEvents: {}, - handlers: [] - }; - - namespace.events = { - spyOn: function(selector, eventName) { - var handler = function(e) { - data.spiedEvents[[selector, eventName]] = e; - }; - jQuery(selector).bind(eventName, handler); - data.handlers.push(handler); - }, - - wasTriggered: function(selector, eventName) { - return !!(data.spiedEvents[[selector, eventName]]); - }, - - cleanUp: function() { - data.spiedEvents = {}; - data.handlers = []; - } - } -})(jasmine.JQuery); - -(function(){ - var jQueryMatchers = { - toHaveClass: function(className) { - return this.actual.hasClass(className); - }, - - toBeVisible: function() { - return this.actual.is(':visible'); - }, - - toBeHidden: function() { - return this.actual.is(':hidden'); - }, - - toBeSelected: function() { - return this.actual.is(':selected'); - }, - - toBeChecked: function() { - return this.actual.is(':checked'); - }, - - toBeEmpty: function() { - return this.actual.is(':empty'); - }, - - toExist: function() { - return this.actual.size() > 0; - }, - - toHaveAttr: function(attributeName, expectedAttributeValue) { - return hasProperty(this.actual.attr(attributeName), expectedAttributeValue); - }, - - toHaveId: function(id) { - return this.actual.attr('id') == id; - }, - - toHaveHtml: function(html) { - return this.actual.html() == jasmine.JQuery.browserTagCaseIndependentHtml(html); - }, - - toHaveText: function(text) { - if (text && jQuery.isFunction(text.test)) { - return text.test(this.actual.text()); - } else { - return this.actual.text() == text; - } - }, - - toHaveValue: function(value) { - return this.actual.val() == value; - }, - - toHaveData: function(key, expectedValue) { - return hasProperty(this.actual.data(key), expectedValue); - }, - - toBe: function(selector) { - return this.actual.is(selector); - }, - - toContain: function(selector) { - return this.actual.find(selector).size() > 0; - }, - - toBeDisabled: function(selector){ - return this.actual.is(':disabled'); - }, - - // tests the existence of a specific event binding - toHandle: function(eventName) { - var events = this.actual.data("events"); - return events && events[eventName].length > 0; - }, - - // tests the existence of a specific event binding + handler - toHandleWith: function(eventName, eventHandler) { - var stack = this.actual.data("events")[eventName]; - var i; - for (i = 0; i < stack.length; i++) { - if (stack[i].handler == eventHandler) { - return true; - } - } - return false; - } - }; - - var hasProperty = function(actualValue, expectedValue) { - if (expectedValue === undefined) { - return actualValue !== undefined; - } - return actualValue == expectedValue; - }; - - var bindMatcher = function(methodName) { - var builtInMatcher = jasmine.Matchers.prototype[methodName]; - - jasmine.JQuery.matchersClass[methodName] = function() { - if (this.actual instanceof jQuery) { - var result = jQueryMatchers[methodName].apply(this, arguments); - this.actual = jasmine.JQuery.elementToString(this.actual); - return result; - } - - if (builtInMatcher) { - return builtInMatcher.apply(this, arguments); - } - - return false; - }; - }; - - for(var methodName in jQueryMatchers) { - bindMatcher(methodName); - } -})(); - -beforeEach(function() { - this.addMatchers(jasmine.JQuery.matchersClass); - this.addMatchers({ - toHaveBeenTriggeredOn: function(selector) { - this.message = function() { - return [ - "Expected event " + this.actual + " to have been triggered on" + selector, - "Expected event " + this.actual + " not to have been triggered on" + selector - ]; - }; - return jasmine.JQuery.events.wasTriggered(selector, this.actual); - } - }) -}); - -afterEach(function() { - jasmine.getFixtures().cleanUp(); - jasmine.JQuery.events.cleanUp(); -}); diff --git a/src/deck.js/test/lib/jasmine.css b/src/deck.js/test/lib/jasmine.css deleted file mode 100755 index 6583fe7..0000000 --- a/src/deck.js/test/lib/jasmine.css +++ /dev/null @@ -1,166 +0,0 @@ -body { - font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; -} - - -.jasmine_reporter a:visited, .jasmine_reporter a { - color: #303; -} - -.jasmine_reporter a:hover, .jasmine_reporter a:active { - color: blue; -} - -.run_spec { - float:right; - padding-right: 5px; - font-size: .8em; - text-decoration: none; -} - -.jasmine_reporter { - margin: 0 5px; -} - -.banner { - color: #303; - background-color: #fef; - padding: 5px; -} - -.logo { - float: left; - font-size: 1.1em; - padding-left: 5px; -} - -.logo .version { - font-size: .6em; - padding-left: 1em; -} - -.runner.running { - background-color: yellow; -} - - -.options { - text-align: right; - font-size: .8em; -} - - - - -.suite { - border: 1px outset gray; - margin: 5px 0; - padding-left: 1em; -} - -.suite .suite { - margin: 5px; -} - -.suite.passed { - background-color: #dfd; -} - -.suite.failed { - background-color: #fdd; -} - -.spec { - margin: 5px; - padding-left: 1em; - clear: both; -} - -.spec.failed, .spec.passed, .spec.skipped { - padding-bottom: 5px; - border: 1px solid gray; -} - -.spec.failed { - background-color: #fbb; - border-color: red; -} - -.spec.passed { - background-color: #bfb; - border-color: green; -} - -.spec.skipped { - background-color: #bbb; -} - -.messages { - border-left: 1px dashed gray; - padding-left: 1em; - padding-right: 1em; -} - -.passed { - background-color: #cfc; - display: none; -} - -.failed { - background-color: #fbb; -} - -.skipped { - color: #777; - background-color: #eee; - display: none; -} - - -/*.resultMessage {*/ - /*white-space: pre;*/ -/*}*/ - -.resultMessage span.result { - display: block; - line-height: 2em; - color: black; -} - -.resultMessage .mismatch { - color: black; -} - -.stackTrace { - white-space: pre; - font-size: .8em; - margin-left: 10px; - max-height: 5em; - overflow: auto; - border: 1px inset red; - padding: 1em; - background: #eef; -} - -.finished-at { - padding-left: 1em; - font-size: .6em; -} - -.show-passed .passed, -.show-skipped .skipped { - display: block; -} - - -#jasmine_content { - position:fixed; - right: 100%; -} - -.runner { - border: 1px solid gray; - display: block; - margin: 5px 0; - padding: 2px 0 2px 10px; -} diff --git a/src/deck.js/test/lib/jasmine.js b/src/deck.js/test/lib/jasmine.js deleted file mode 100755 index e96e0a7..0000000 --- a/src/deck.js/test/lib/jasmine.js +++ /dev/null @@ -1,2477 +0,0 @@ -var isCommonJS = typeof window == "undefined"; - -/** - * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. - * - * @namespace - */ -var jasmine = {}; -if (isCommonJS) exports.jasmine = jasmine; -/** - * @private - */ -jasmine.unimplementedMethod_ = function() { - throw new Error("unimplemented method"); -}; - -/** - * Use jasmine.undefined instead of undefined, since undefined is just - * a plain old variable and may be redefined by somebody else. - * - * @private - */ -jasmine.undefined = jasmine.___undefined___; - -/** - * Show diagnostic messages in the console if set to true - * - */ -jasmine.VERBOSE = false; - -/** - * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. - * - */ -jasmine.DEFAULT_UPDATE_INTERVAL = 250; - -/** - * Default timeout interval in milliseconds for waitsFor() blocks. - */ -jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; - -jasmine.getGlobal = function() { - function getGlobal() { - return this; - } - - return getGlobal(); -}; - -/** - * Allows for bound functions to be compared. Internal use only. - * - * @ignore - * @private - * @param base {Object} bound 'this' for the function - * @param name {Function} function to find - */ -jasmine.bindOriginal_ = function(base, name) { - var original = base[name]; - if (original.apply) { - return function() { - return original.apply(base, arguments); - }; - } else { - // IE support - return jasmine.getGlobal()[name]; - } -}; - -jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); -jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); -jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); -jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); - -jasmine.MessageResult = function(values) { - this.type = 'log'; - this.values = values; - this.trace = new Error(); // todo: test better -}; - -jasmine.MessageResult.prototype.toString = function() { - var text = ""; - for (var i = 0; i < this.values.length; i++) { - if (i > 0) text += " "; - if (jasmine.isString_(this.values[i])) { - text += this.values[i]; - } else { - text += jasmine.pp(this.values[i]); - } - } - return text; -}; - -jasmine.ExpectationResult = function(params) { - this.type = 'expect'; - this.matcherName = params.matcherName; - this.passed_ = params.passed; - this.expected = params.expected; - this.actual = params.actual; - this.message = this.passed_ ? 'Passed.' : params.message; - - var trace = (params.trace || new Error(this.message)); - this.trace = this.passed_ ? '' : trace; -}; - -jasmine.ExpectationResult.prototype.toString = function () { - return this.message; -}; - -jasmine.ExpectationResult.prototype.passed = function () { - return this.passed_; -}; - -/** - * Getter for the Jasmine environment. Ensures one gets created - */ -jasmine.getEnv = function() { - var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); - return env; -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isArray_ = function(value) { - return jasmine.isA_("Array", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isString_ = function(value) { - return jasmine.isA_("String", value); -}; - -/** - * @ignore - * @private - * @param value - * @returns {Boolean} - */ -jasmine.isNumber_ = function(value) { - return jasmine.isA_("Number", value); -}; - -/** - * @ignore - * @private - * @param {String} typeName - * @param value - * @returns {Boolean} - */ -jasmine.isA_ = function(typeName, value) { - return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; -}; - -/** - * Pretty printer for expecations. Takes any object and turns it into a human-readable string. - * - * @param value {Object} an object to be outputted - * @returns {String} - */ -jasmine.pp = function(value) { - var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); - stringPrettyPrinter.format(value); - return stringPrettyPrinter.string; -}; - -/** - * Returns true if the object is a DOM Node. - * - * @param {Object} obj object to check - * @returns {Boolean} - */ -jasmine.isDomNode = function(obj) { - return obj.nodeType > 0; -}; - -/** - * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. - * - * @example - * // don't care about which function is passed in, as long as it's a function - * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); - * - * @param {Class} clazz - * @returns matchable object of the type clazz - */ -jasmine.any = function(clazz) { - return new jasmine.Matchers.Any(clazz); -}; - -/** - * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. - * - * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine - * expectation syntax. Spies can be checked if they were called or not and what the calling params were. - * - * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). - * - * Spies are torn down at the end of every spec. - * - * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. - * - * @example - * // a stub - * var myStub = jasmine.createSpy('myStub'); // can be used anywhere - * - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // actual foo.not will not be called, execution stops - * spyOn(foo, 'not'); - - // foo.not spied upon, execution will continue to implementation - * spyOn(foo, 'not').andCallThrough(); - * - * // fake example - * var foo = { - * not: function(bool) { return !bool; } - * } - * - * // foo.not(val) will return val - * spyOn(foo, 'not').andCallFake(function(value) {return value;}); - * - * // mock example - * foo.not(7 == 7); - * expect(foo.not).toHaveBeenCalled(); - * expect(foo.not).toHaveBeenCalledWith(true); - * - * @constructor - * @see spyOn, jasmine.createSpy, jasmine.createSpyObj - * @param {String} name - */ -jasmine.Spy = function(name) { - /** - * The name of the spy, if provided. - */ - this.identity = name || 'unknown'; - /** - * Is this Object a spy? - */ - this.isSpy = true; - /** - * The actual function this spy stubs. - */ - this.plan = function() { - }; - /** - * Tracking of the most recent call to the spy. - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy.mostRecentCall.args = [1, 2]; - */ - this.mostRecentCall = {}; - - /** - * Holds arguments for each call to the spy, indexed by call count - * @example - * var mySpy = jasmine.createSpy('foo'); - * mySpy(1, 2); - * mySpy(7, 8); - * mySpy.mostRecentCall.args = [7, 8]; - * mySpy.argsForCall[0] = [1, 2]; - * mySpy.argsForCall[1] = [7, 8]; - */ - this.argsForCall = []; - this.calls = []; -}; - -/** - * Tells a spy to call through to the actual implemenatation. - * - * @example - * var foo = { - * bar: function() { // do some stuff } - * } - * - * // defining a spy on an existing property: foo.bar - * spyOn(foo, 'bar').andCallThrough(); - */ -jasmine.Spy.prototype.andCallThrough = function() { - this.plan = this.originalValue; - return this; -}; - -/** - * For setting the return value of a spy. - * - * @example - * // defining a spy from scratch: foo() returns 'baz' - * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); - * - * // defining a spy on an existing property: foo.bar() returns 'baz' - * spyOn(foo, 'bar').andReturn('baz'); - * - * @param {Object} value - */ -jasmine.Spy.prototype.andReturn = function(value) { - this.plan = function() { - return value; - }; - return this; -}; - -/** - * For throwing an exception when a spy is called. - * - * @example - * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' - * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); - * - * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' - * spyOn(foo, 'bar').andThrow('baz'); - * - * @param {String} exceptionMsg - */ -jasmine.Spy.prototype.andThrow = function(exceptionMsg) { - this.plan = function() { - throw exceptionMsg; - }; - return this; -}; - -/** - * Calls an alternate implementation when a spy is called. - * - * @example - * var baz = function() { - * // do some stuff, return something - * } - * // defining a spy from scratch: foo() calls the function baz - * var foo = jasmine.createSpy('spy on foo').andCall(baz); - * - * // defining a spy on an existing property: foo.bar() calls an anonymnous function - * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); - * - * @param {Function} fakeFunc - */ -jasmine.Spy.prototype.andCallFake = function(fakeFunc) { - this.plan = fakeFunc; - return this; -}; - -/** - * Resets all of a spy's the tracking variables so that it can be used again. - * - * @example - * spyOn(foo, 'bar'); - * - * foo.bar(); - * - * expect(foo.bar.callCount).toEqual(1); - * - * foo.bar.reset(); - * - * expect(foo.bar.callCount).toEqual(0); - */ -jasmine.Spy.prototype.reset = function() { - this.wasCalled = false; - this.callCount = 0; - this.argsForCall = []; - this.calls = []; - this.mostRecentCall = {}; -}; - -jasmine.createSpy = function(name) { - - var spyObj = function() { - spyObj.wasCalled = true; - spyObj.callCount++; - var args = jasmine.util.argsToArray(arguments); - spyObj.mostRecentCall.object = this; - spyObj.mostRecentCall.args = args; - spyObj.argsForCall.push(args); - spyObj.calls.push({object: this, args: args}); - return spyObj.plan.apply(this, arguments); - }; - - var spy = new jasmine.Spy(name); - - for (var prop in spy) { - spyObj[prop] = spy[prop]; - } - - spyObj.reset(); - - return spyObj; -}; - -/** - * Determines whether an object is a spy. - * - * @param {jasmine.Spy|Object} putativeSpy - * @returns {Boolean} - */ -jasmine.isSpy = function(putativeSpy) { - return putativeSpy && putativeSpy.isSpy; -}; - -/** - * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something - * large in one call. - * - * @param {String} baseName name of spy class - * @param {Array} methodNames array of names of methods to make spies - */ -jasmine.createSpyObj = function(baseName, methodNames) { - if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { - throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); - } - var obj = {}; - for (var i = 0; i < methodNames.length; i++) { - obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); - } - return obj; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the current spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.log = function() { - var spec = jasmine.getEnv().currentSpec; - spec.log.apply(spec, arguments); -}; - -/** - * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. - * - * @example - * // spy example - * var foo = { - * not: function(bool) { return !bool; } - * } - * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops - * - * @see jasmine.createSpy - * @param obj - * @param methodName - * @returns a Jasmine spy that can be chained with all spy methods - */ -var spyOn = function(obj, methodName) { - return jasmine.getEnv().currentSpec.spyOn(obj, methodName); -}; -if (isCommonJS) exports.spyOn = spyOn; - -/** - * Creates a Jasmine spec that will be added to the current suite. - * - * // TODO: pending tests - * - * @example - * it('should be true', function() { - * expect(true).toEqual(true); - * }); - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var it = function(desc, func) { - return jasmine.getEnv().it(desc, func); -}; -if (isCommonJS) exports.it = it; - -/** - * Creates a disabled Jasmine spec. - * - * A convenience method that allows existing specs to be disabled temporarily during development. - * - * @param {String} desc description of this specification - * @param {Function} func defines the preconditions and expectations of the spec - */ -var xit = function(desc, func) { - return jasmine.getEnv().xit(desc, func); -}; -if (isCommonJS) exports.xit = xit; - -/** - * Starts a chain for a Jasmine expectation. - * - * It is passed an Object that is the actual value and should chain to one of the many - * jasmine.Matchers functions. - * - * @param {Object} actual Actual value to test against and expected value - */ -var expect = function(actual) { - return jasmine.getEnv().currentSpec.expect(actual); -}; -if (isCommonJS) exports.expect = expect; - -/** - * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. - * - * @param {Function} func Function that defines part of a jasmine spec. - */ -var runs = function(func) { - jasmine.getEnv().currentSpec.runs(func); -}; -if (isCommonJS) exports.runs = runs; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -var waits = function(timeout) { - jasmine.getEnv().currentSpec.waits(timeout); -}; -if (isCommonJS) exports.waits = waits; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); -}; -if (isCommonJS) exports.waitsFor = waitsFor; - -/** - * A function that is called before each spec in a suite. - * - * Used for spec setup, including validating assumptions. - * - * @param {Function} beforeEachFunction - */ -var beforeEach = function(beforeEachFunction) { - jasmine.getEnv().beforeEach(beforeEachFunction); -}; -if (isCommonJS) exports.beforeEach = beforeEach; - -/** - * A function that is called after each spec in a suite. - * - * Used for restoring any state that is hijacked during spec execution. - * - * @param {Function} afterEachFunction - */ -var afterEach = function(afterEachFunction) { - jasmine.getEnv().afterEach(afterEachFunction); -}; -if (isCommonJS) exports.afterEach = afterEach; - -/** - * Defines a suite of specifications. - * - * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared - * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization - * of setup in some tests. - * - * @example - * // TODO: a simple suite - * - * // TODO: a simple suite with a nested describe block - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var describe = function(description, specDefinitions) { - return jasmine.getEnv().describe(description, specDefinitions); -}; -if (isCommonJS) exports.describe = describe; - -/** - * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. - * - * @param {String} description A string, usually the class under test. - * @param {Function} specDefinitions function that defines several specs. - */ -var xdescribe = function(description, specDefinitions) { - return jasmine.getEnv().xdescribe(description, specDefinitions); -}; -if (isCommonJS) exports.xdescribe = xdescribe; - - -// Provide the XMLHttpRequest class for IE 5.x-6.x: -jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { - function tryIt(f) { - try { - return f(); - } catch(e) { - } - return null; - } - - var xhr = tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.6.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP.3.0"); - }) || - tryIt(function() { - return new ActiveXObject("Msxml2.XMLHTTP"); - }) || - tryIt(function() { - return new ActiveXObject("Microsoft.XMLHTTP"); - }); - - if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); - - return xhr; -} : XMLHttpRequest; -/** - * @namespace - */ -jasmine.util = {}; - -/** - * Declare that a child class inherit it's prototype from the parent class. - * - * @private - * @param {Function} childClass - * @param {Function} parentClass - */ -jasmine.util.inherit = function(childClass, parentClass) { - /** - * @private - */ - var subclass = function() { - }; - subclass.prototype = parentClass.prototype; - childClass.prototype = new subclass(); -}; - -jasmine.util.formatException = function(e) { - var lineNumber; - if (e.line) { - lineNumber = e.line; - } - else if (e.lineNumber) { - lineNumber = e.lineNumber; - } - - var file; - - if (e.sourceURL) { - file = e.sourceURL; - } - else if (e.fileName) { - file = e.fileName; - } - - var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); - - if (file && lineNumber) { - message += ' in ' + file + ' (line ' + lineNumber + ')'; - } - - return message; -}; - -jasmine.util.htmlEscape = function(str) { - if (!str) return str; - return str.replace(/&/g, '&') - .replace(//g, '>'); -}; - -jasmine.util.argsToArray = function(args) { - var arrayOfArgs = []; - for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); - return arrayOfArgs; -}; - -jasmine.util.extend = function(destination, source) { - for (var property in source) destination[property] = source[property]; - return destination; -}; - -/** - * Environment for Jasmine - * - * @constructor - */ -jasmine.Env = function() { - this.currentSpec = null; - this.currentSuite = null; - this.currentRunner_ = new jasmine.Runner(this); - - this.reporter = new jasmine.MultiReporter(); - - this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; - this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; - this.lastUpdate = 0; - this.specFilter = function() { - return true; - }; - - this.nextSpecId_ = 0; - this.nextSuiteId_ = 0; - this.equalityTesters_ = []; - - // wrap matchers - this.matchersClass = function() { - jasmine.Matchers.apply(this, arguments); - }; - jasmine.util.inherit(this.matchersClass, jasmine.Matchers); - - jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); -}; - - -jasmine.Env.prototype.setTimeout = jasmine.setTimeout; -jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; -jasmine.Env.prototype.setInterval = jasmine.setInterval; -jasmine.Env.prototype.clearInterval = jasmine.clearInterval; - -/** - * @returns an object containing jasmine version build info, if set. - */ -jasmine.Env.prototype.version = function () { - if (jasmine.version_) { - return jasmine.version_; - } else { - throw new Error('Version not set'); - } -}; - -/** - * @returns string containing jasmine version build info, if set. - */ -jasmine.Env.prototype.versionString = function() { - if (!jasmine.version_) { - return "version unknown"; - } - - var version = this.version(); - var versionString = version.major + "." + version.minor + "." + version.build; - if (version.release_candidate) { - versionString += ".rc" + version.release_candidate - } - versionString += " revision " + version.revision; - return versionString; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSpecId = function () { - return this.nextSpecId_++; -}; - -/** - * @returns a sequential integer starting at 0 - */ -jasmine.Env.prototype.nextSuiteId = function () { - return this.nextSuiteId_++; -}; - -/** - * Register a reporter to receive status updates from Jasmine. - * @param {jasmine.Reporter} reporter An object which will receive status updates. - */ -jasmine.Env.prototype.addReporter = function(reporter) { - this.reporter.addReporter(reporter); -}; - -jasmine.Env.prototype.execute = function() { - this.currentRunner_.execute(); -}; - -jasmine.Env.prototype.describe = function(description, specDefinitions) { - var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); - - var parentSuite = this.currentSuite; - if (parentSuite) { - parentSuite.add(suite); - } else { - this.currentRunner_.add(suite); - } - - this.currentSuite = suite; - - var declarationError = null; - try { - specDefinitions.call(suite); - } catch(e) { - declarationError = e; - } - - if (declarationError) { - this.it("encountered a declaration exception", function() { - throw declarationError; - }); - } - - this.currentSuite = parentSuite; - - return suite; -}; - -jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { - if (this.currentSuite) { - this.currentSuite.beforeEach(beforeEachFunction); - } else { - this.currentRunner_.beforeEach(beforeEachFunction); - } -}; - -jasmine.Env.prototype.currentRunner = function () { - return this.currentRunner_; -}; - -jasmine.Env.prototype.afterEach = function(afterEachFunction) { - if (this.currentSuite) { - this.currentSuite.afterEach(afterEachFunction); - } else { - this.currentRunner_.afterEach(afterEachFunction); - } - -}; - -jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { - return { - execute: function() { - } - }; -}; - -jasmine.Env.prototype.it = function(description, func) { - var spec = new jasmine.Spec(this, this.currentSuite, description); - this.currentSuite.add(spec); - this.currentSpec = spec; - - if (func) { - spec.runs(func); - } - - return spec; -}; - -jasmine.Env.prototype.xit = function(desc, func) { - return { - id: this.nextSpecId(), - runs: function() { - } - }; -}; - -jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { - if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { - return true; - } - - a.__Jasmine_been_here_before__ = b; - b.__Jasmine_been_here_before__ = a; - - var hasKey = function(obj, keyName) { - return obj !== null && obj[keyName] !== jasmine.undefined; - }; - - for (var property in b) { - if (!hasKey(a, property) && hasKey(b, property)) { - mismatchKeys.push("expected has key '" + property + "', but missing from actual."); - } - } - for (property in a) { - if (!hasKey(b, property) && hasKey(a, property)) { - mismatchKeys.push("expected missing key '" + property + "', but present in actual."); - } - } - for (property in b) { - if (property == '__Jasmine_been_here_before__') continue; - if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { - mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); - } - } - - if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { - mismatchValues.push("arrays were not the same length"); - } - - delete a.__Jasmine_been_here_before__; - delete b.__Jasmine_been_here_before__; - return (mismatchKeys.length === 0 && mismatchValues.length === 0); -}; - -jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { - mismatchKeys = mismatchKeys || []; - mismatchValues = mismatchValues || []; - - for (var i = 0; i < this.equalityTesters_.length; i++) { - var equalityTester = this.equalityTesters_[i]; - var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); - if (result !== jasmine.undefined) return result; - } - - if (a === b) return true; - - if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { - return (a == jasmine.undefined && b == jasmine.undefined); - } - - if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { - return a === b; - } - - if (a instanceof Date && b instanceof Date) { - return a.getTime() == b.getTime(); - } - - if (a instanceof jasmine.Matchers.Any) { - return a.matches(b); - } - - if (b instanceof jasmine.Matchers.Any) { - return b.matches(a); - } - - if (jasmine.isString_(a) && jasmine.isString_(b)) { - return (a == b); - } - - if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { - return (a == b); - } - - if (typeof a === "object" && typeof b === "object") { - return this.compareObjects_(a, b, mismatchKeys, mismatchValues); - } - - //Straight check - return (a === b); -}; - -jasmine.Env.prototype.contains_ = function(haystack, needle) { - if (jasmine.isArray_(haystack)) { - for (var i = 0; i < haystack.length; i++) { - if (this.equals_(haystack[i], needle)) return true; - } - return false; - } - return haystack.indexOf(needle) >= 0; -}; - -jasmine.Env.prototype.addEqualityTester = function(equalityTester) { - this.equalityTesters_.push(equalityTester); -}; -/** No-op base class for Jasmine reporters. - * - * @constructor - */ -jasmine.Reporter = function() { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportRunnerResults = function(runner) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecStarting = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.reportSpecResults = function(spec) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.Reporter.prototype.log = function(str) { -}; - -/** - * Blocks are functions with executable code that make up a spec. - * - * @constructor - * @param {jasmine.Env} env - * @param {Function} func - * @param {jasmine.Spec} spec - */ -jasmine.Block = function(env, func, spec) { - this.env = env; - this.func = func; - this.spec = spec; -}; - -jasmine.Block.prototype.execute = function(onComplete) { - try { - this.func.apply(this.spec); - } catch (e) { - this.spec.fail(e); - } - onComplete(); -}; -/** JavaScript API reporter. - * - * @constructor - */ -jasmine.JsApiReporter = function() { - this.started = false; - this.finished = false; - this.suites_ = []; - this.results_ = {}; -}; - -jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { - this.started = true; - var suites = runner.topLevelSuites(); - for (var i = 0; i < suites.length; i++) { - var suite = suites[i]; - this.suites_.push(this.summarize_(suite)); - } -}; - -jasmine.JsApiReporter.prototype.suites = function() { - return this.suites_; -}; - -jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { - var isSuite = suiteOrSpec instanceof jasmine.Suite; - var summary = { - id: suiteOrSpec.id, - name: suiteOrSpec.description, - type: isSuite ? 'suite' : 'spec', - children: [] - }; - - if (isSuite) { - var children = suiteOrSpec.children(); - for (var i = 0; i < children.length; i++) { - summary.children.push(this.summarize_(children[i])); - } - } - return summary; -}; - -jasmine.JsApiReporter.prototype.results = function() { - return this.results_; -}; - -jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { - return this.results_[specId]; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { - this.finished = true; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { - this.results_[spec.id] = { - messages: spec.results().getItems(), - result: spec.results().failedCount > 0 ? "failed" : "passed" - }; -}; - -//noinspection JSUnusedLocalSymbols -jasmine.JsApiReporter.prototype.log = function(str) { -}; - -jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ - var results = {}; - for (var i = 0; i < specIds.length; i++) { - var specId = specIds[i]; - results[specId] = this.summarizeResult_(this.results_[specId]); - } - return results; -}; - -jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ - var summaryMessages = []; - var messagesLength = result.messages.length; - for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { - var resultMessage = result.messages[messageIndex]; - summaryMessages.push({ - text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, - passed: resultMessage.passed ? resultMessage.passed() : true, - type: resultMessage.type, - message: resultMessage.message, - trace: { - stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined - } - }); - } - - return { - result : result.result, - messages : summaryMessages - }; -}; - -/** - * @constructor - * @param {jasmine.Env} env - * @param actual - * @param {jasmine.Spec} spec - */ -jasmine.Matchers = function(env, actual, spec, opt_isNot) { - this.env = env; - this.actual = actual; - this.spec = spec; - this.isNot = opt_isNot || false; - this.reportWasCalled_ = false; -}; - -// todo: @deprecated as of Jasmine 0.11, remove soon [xw] -jasmine.Matchers.pp = function(str) { - throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); -}; - -// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] -jasmine.Matchers.prototype.report = function(result, failing_message, details) { - throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); -}; - -jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { - for (var methodName in prototype) { - if (methodName == 'report') continue; - var orig = prototype[methodName]; - matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); - } -}; - -jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { - return function() { - var matcherArgs = jasmine.util.argsToArray(arguments); - var result = matcherFunction.apply(this, arguments); - - if (this.isNot) { - result = !result; - } - - if (this.reportWasCalled_) return result; - - var message; - if (!result) { - if (this.message) { - message = this.message.apply(this, arguments); - if (jasmine.isArray_(message)) { - message = message[this.isNot ? 1 : 0]; - } - } else { - var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); - message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; - if (matcherArgs.length > 0) { - for (var i = 0; i < matcherArgs.length; i++) { - if (i > 0) message += ","; - message += " " + jasmine.pp(matcherArgs[i]); - } - } - message += "."; - } - } - var expectationResult = new jasmine.ExpectationResult({ - matcherName: matcherName, - passed: result, - expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], - actual: this.actual, - message: message - }); - this.spec.addMatcherResult(expectationResult); - return jasmine.undefined; - }; -}; - - - - -/** - * toBe: compares the actual to the expected using === - * @param expected - */ -jasmine.Matchers.prototype.toBe = function(expected) { - return this.actual === expected; -}; - -/** - * toNotBe: compares the actual to the expected using !== - * @param expected - * @deprecated as of 1.0. Use not.toBe() instead. - */ -jasmine.Matchers.prototype.toNotBe = function(expected) { - return this.actual !== expected; -}; - -/** - * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. - * - * @param expected - */ -jasmine.Matchers.prototype.toEqual = function(expected) { - return this.env.equals_(this.actual, expected); -}; - -/** - * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual - * @param expected - * @deprecated as of 1.0. Use not.toNotEqual() instead. - */ -jasmine.Matchers.prototype.toNotEqual = function(expected) { - return !this.env.equals_(this.actual, expected); -}; - -/** - * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes - * a pattern or a String. - * - * @param expected - */ -jasmine.Matchers.prototype.toMatch = function(expected) { - return new RegExp(expected).test(this.actual); -}; - -/** - * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch - * @param expected - * @deprecated as of 1.0. Use not.toMatch() instead. - */ -jasmine.Matchers.prototype.toNotMatch = function(expected) { - return !(new RegExp(expected).test(this.actual)); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeDefined = function() { - return (this.actual !== jasmine.undefined); -}; - -/** - * Matcher that compares the actual to jasmine.undefined. - */ -jasmine.Matchers.prototype.toBeUndefined = function() { - return (this.actual === jasmine.undefined); -}; - -/** - * Matcher that compares the actual to null. - */ -jasmine.Matchers.prototype.toBeNull = function() { - return (this.actual === null); -}; - -/** - * Matcher that boolean not-nots the actual. - */ -jasmine.Matchers.prototype.toBeTruthy = function() { - return !!this.actual; -}; - - -/** - * Matcher that boolean nots the actual. - */ -jasmine.Matchers.prototype.toBeFalsy = function() { - return !this.actual; -}; - - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called. - */ -jasmine.Matchers.prototype.toHaveBeenCalled = function() { - if (arguments.length > 0) { - throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to have been called.", - "Expected spy " + this.actual.identity + " not to have been called." - ]; - }; - - return this.actual.wasCalled; -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ -jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was not called. - * - * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead - */ -jasmine.Matchers.prototype.wasNotCalled = function() { - if (arguments.length > 0) { - throw new Error('wasNotCalled does not take arguments'); - } - - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy " + this.actual.identity + " to not have been called.", - "Expected spy " + this.actual.identity + " to have been called." - ]; - }; - - return !this.actual.wasCalled; -}; - -/** - * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. - * - * @example - * - */ -jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - this.message = function() { - if (this.actual.callCount === 0) { - // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw] - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.", - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was." - ]; - } else { - return [ - "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall), - "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall) - ]; - } - }; - - return this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; - -/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ -jasmine.Matchers.prototype.wasNotCalledWith = function() { - var expectedArgs = jasmine.util.argsToArray(arguments); - if (!jasmine.isSpy(this.actual)) { - throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); - } - - this.message = function() { - return [ - "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", - "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" - ]; - }; - - return !this.env.contains_(this.actual.argsForCall, expectedArgs); -}; - -/** - * Matcher that checks that the expected item is an element in the actual Array. - * - * @param {Object} expected - */ -jasmine.Matchers.prototype.toContain = function(expected) { - return this.env.contains_(this.actual, expected); -}; - -/** - * Matcher that checks that the expected item is NOT an element in the actual Array. - * - * @param {Object} expected - * @deprecated as of 1.0. Use not.toNotContain() instead. - */ -jasmine.Matchers.prototype.toNotContain = function(expected) { - return !this.env.contains_(this.actual, expected); -}; - -jasmine.Matchers.prototype.toBeLessThan = function(expected) { - return this.actual < expected; -}; - -jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { - return this.actual > expected; -}; - -/** - * Matcher that checks that the expected item is equal to the actual item - * up to a given level of decimal precision (default 2). - * - * @param {Number} expected - * @param {Number} precision - */ -jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { - if (!(precision === 0)) { - precision = precision || 2; - } - var multiplier = Math.pow(10, precision); - var actual = Math.round(this.actual * multiplier); - expected = Math.round(expected * multiplier); - return expected == actual; -}; - -/** - * Matcher that checks that the expected exception was thrown by the actual. - * - * @param {String} expected - */ -jasmine.Matchers.prototype.toThrow = function(expected) { - var result = false; - var exception; - if (typeof this.actual != 'function') { - throw new Error('Actual is not a function'); - } - try { - this.actual(); - } catch (e) { - exception = e; - } - if (exception) { - result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); - } - - var not = this.isNot ? "not " : ""; - - this.message = function() { - if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { - return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); - } else { - return "Expected function to throw an exception."; - } - }; - - return result; -}; - -jasmine.Matchers.Any = function(expectedClass) { - this.expectedClass = expectedClass; -}; - -jasmine.Matchers.Any.prototype.matches = function(other) { - if (this.expectedClass == String) { - return typeof other == 'string' || other instanceof String; - } - - if (this.expectedClass == Number) { - return typeof other == 'number' || other instanceof Number; - } - - if (this.expectedClass == Function) { - return typeof other == 'function' || other instanceof Function; - } - - if (this.expectedClass == Object) { - return typeof other == 'object'; - } - - return other instanceof this.expectedClass; -}; - -jasmine.Matchers.Any.prototype.toString = function() { - return ''; -}; - -/** - * @constructor - */ -jasmine.MultiReporter = function() { - this.subReporters_ = []; -}; -jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); - -jasmine.MultiReporter.prototype.addReporter = function(reporter) { - this.subReporters_.push(reporter); -}; - -(function() { - var functionNames = [ - "reportRunnerStarting", - "reportRunnerResults", - "reportSuiteResults", - "reportSpecStarting", - "reportSpecResults", - "log" - ]; - for (var i = 0; i < functionNames.length; i++) { - var functionName = functionNames[i]; - jasmine.MultiReporter.prototype[functionName] = (function(functionName) { - return function() { - for (var j = 0; j < this.subReporters_.length; j++) { - var subReporter = this.subReporters_[j]; - if (subReporter[functionName]) { - subReporter[functionName].apply(subReporter, arguments); - } - } - }; - })(functionName); - } -})(); -/** - * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults - * - * @constructor - */ -jasmine.NestedResults = function() { - /** - * The total count of results - */ - this.totalCount = 0; - /** - * Number of passed results - */ - this.passedCount = 0; - /** - * Number of failed results - */ - this.failedCount = 0; - /** - * Was this suite/spec skipped? - */ - this.skipped = false; - /** - * @ignore - */ - this.items_ = []; -}; - -/** - * Roll up the result counts. - * - * @param result - */ -jasmine.NestedResults.prototype.rollupCounts = function(result) { - this.totalCount += result.totalCount; - this.passedCount += result.passedCount; - this.failedCount += result.failedCount; -}; - -/** - * Adds a log message. - * @param values Array of message parts which will be concatenated later. - */ -jasmine.NestedResults.prototype.log = function(values) { - this.items_.push(new jasmine.MessageResult(values)); -}; - -/** - * Getter for the results: message & results. - */ -jasmine.NestedResults.prototype.getItems = function() { - return this.items_; -}; - -/** - * Adds a result, tracking counts (total, passed, & failed) - * @param {jasmine.ExpectationResult|jasmine.NestedResults} result - */ -jasmine.NestedResults.prototype.addResult = function(result) { - if (result.type != 'log') { - if (result.items_) { - this.rollupCounts(result); - } else { - this.totalCount++; - if (result.passed()) { - this.passedCount++; - } else { - this.failedCount++; - } - } - } - this.items_.push(result); -}; - -/** - * @returns {Boolean} True if everything below passed - */ -jasmine.NestedResults.prototype.passed = function() { - return this.passedCount === this.totalCount; -}; -/** - * Base class for pretty printing for expectation results. - */ -jasmine.PrettyPrinter = function() { - this.ppNestLevel_ = 0; -}; - -/** - * Formats a value in a nice, human-readable string. - * - * @param value - */ -jasmine.PrettyPrinter.prototype.format = function(value) { - if (this.ppNestLevel_ > 40) { - throw new Error('jasmine.PrettyPrinter: format() nested too deeply!'); - } - - this.ppNestLevel_++; - try { - if (value === jasmine.undefined) { - this.emitScalar('undefined'); - } else if (value === null) { - this.emitScalar('null'); - } else if (value === jasmine.getGlobal()) { - this.emitScalar(''); - } else if (value instanceof jasmine.Matchers.Any) { - this.emitScalar(value.toString()); - } else if (typeof value === 'string') { - this.emitString(value); - } else if (jasmine.isSpy(value)) { - this.emitScalar("spy on " + value.identity); - } else if (value instanceof RegExp) { - this.emitScalar(value.toString()); - } else if (typeof value === 'function') { - this.emitScalar('Function'); - } else if (typeof value.nodeType === 'number') { - this.emitScalar('HTMLNode'); - } else if (value instanceof Date) { - this.emitScalar('Date(' + value + ')'); - } else if (value.__Jasmine_been_here_before__) { - this.emitScalar(''); - } else if (jasmine.isArray_(value) || typeof value == 'object') { - value.__Jasmine_been_here_before__ = true; - if (jasmine.isArray_(value)) { - this.emitArray(value); - } else { - this.emitObject(value); - } - delete value.__Jasmine_been_here_before__; - } else { - this.emitScalar(value.toString()); - } - } finally { - this.ppNestLevel_--; - } -}; - -jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { - for (var property in obj) { - if (property == '__Jasmine_been_here_before__') continue; - fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && - obj.__lookupGetter__(property) !== null) : false); - } -}; - -jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; -jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; - -jasmine.StringPrettyPrinter = function() { - jasmine.PrettyPrinter.call(this); - - this.string = ''; -}; -jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); - -jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { - this.append(value); -}; - -jasmine.StringPrettyPrinter.prototype.emitString = function(value) { - this.append("'" + value + "'"); -}; - -jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { - this.append('[ '); - for (var i = 0; i < array.length; i++) { - if (i > 0) { - this.append(', '); - } - this.format(array[i]); - } - this.append(' ]'); -}; - -jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { - var self = this; - this.append('{ '); - var first = true; - - this.iterateObject(obj, function(property, isGetter) { - if (first) { - first = false; - } else { - self.append(', '); - } - - self.append(property); - self.append(' : '); - if (isGetter) { - self.append(''); - } else { - self.format(obj[property]); - } - }); - - this.append(' }'); -}; - -jasmine.StringPrettyPrinter.prototype.append = function(value) { - this.string += value; -}; -jasmine.Queue = function(env) { - this.env = env; - this.blocks = []; - this.running = false; - this.index = 0; - this.offset = 0; - this.abort = false; -}; - -jasmine.Queue.prototype.addBefore = function(block) { - this.blocks.unshift(block); -}; - -jasmine.Queue.prototype.add = function(block) { - this.blocks.push(block); -}; - -jasmine.Queue.prototype.insertNext = function(block) { - this.blocks.splice((this.index + this.offset + 1), 0, block); - this.offset++; -}; - -jasmine.Queue.prototype.start = function(onComplete) { - this.running = true; - this.onComplete = onComplete; - this.next_(); -}; - -jasmine.Queue.prototype.isRunning = function() { - return this.running; -}; - -jasmine.Queue.LOOP_DONT_RECURSE = true; - -jasmine.Queue.prototype.next_ = function() { - var self = this; - var goAgain = true; - - while (goAgain) { - goAgain = false; - - if (self.index < self.blocks.length && !this.abort) { - var calledSynchronously = true; - var completedSynchronously = false; - - var onComplete = function () { - if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { - completedSynchronously = true; - return; - } - - if (self.blocks[self.index].abort) { - self.abort = true; - } - - self.offset = 0; - self.index++; - - var now = new Date().getTime(); - if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { - self.env.lastUpdate = now; - self.env.setTimeout(function() { - self.next_(); - }, 0); - } else { - if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { - goAgain = true; - } else { - self.next_(); - } - } - }; - self.blocks[self.index].execute(onComplete); - - calledSynchronously = false; - if (completedSynchronously) { - onComplete(); - } - - } else { - self.running = false; - if (self.onComplete) { - self.onComplete(); - } - } - } -}; - -jasmine.Queue.prototype.results = function() { - var results = new jasmine.NestedResults(); - for (var i = 0; i < this.blocks.length; i++) { - if (this.blocks[i].results) { - results.addResult(this.blocks[i].results()); - } - } - return results; -}; - - -/** - * Runner - * - * @constructor - * @param {jasmine.Env} env - */ -jasmine.Runner = function(env) { - var self = this; - self.env = env; - self.queue = new jasmine.Queue(env); - self.before_ = []; - self.after_ = []; - self.suites_ = []; -}; - -jasmine.Runner.prototype.execute = function() { - var self = this; - if (self.env.reporter.reportRunnerStarting) { - self.env.reporter.reportRunnerStarting(this); - } - self.queue.start(function () { - self.finishCallback(); - }); -}; - -jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.splice(0,0,beforeEachFunction); -}; - -jasmine.Runner.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.splice(0,0,afterEachFunction); -}; - - -jasmine.Runner.prototype.finishCallback = function() { - this.env.reporter.reportRunnerResults(this); -}; - -jasmine.Runner.prototype.addSuite = function(suite) { - this.suites_.push(suite); -}; - -jasmine.Runner.prototype.add = function(block) { - if (block instanceof jasmine.Suite) { - this.addSuite(block); - } - this.queue.add(block); -}; - -jasmine.Runner.prototype.specs = function () { - var suites = this.suites(); - var specs = []; - for (var i = 0; i < suites.length; i++) { - specs = specs.concat(suites[i].specs()); - } - return specs; -}; - -jasmine.Runner.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Runner.prototype.topLevelSuites = function() { - var topLevelSuites = []; - for (var i = 0; i < this.suites_.length; i++) { - if (!this.suites_[i].parentSuite) { - topLevelSuites.push(this.suites_[i]); - } - } - return topLevelSuites; -}; - -jasmine.Runner.prototype.results = function() { - return this.queue.results(); -}; -/** - * Internal representation of a Jasmine specification, or test. - * - * @constructor - * @param {jasmine.Env} env - * @param {jasmine.Suite} suite - * @param {String} description - */ -jasmine.Spec = function(env, suite, description) { - if (!env) { - throw new Error('jasmine.Env() required'); - } - if (!suite) { - throw new Error('jasmine.Suite() required'); - } - var spec = this; - spec.id = env.nextSpecId ? env.nextSpecId() : null; - spec.env = env; - spec.suite = suite; - spec.description = description; - spec.queue = new jasmine.Queue(env); - - spec.afterCallbacks = []; - spec.spies_ = []; - - spec.results_ = new jasmine.NestedResults(); - spec.results_.description = description; - spec.matchersClass = null; -}; - -jasmine.Spec.prototype.getFullName = function() { - return this.suite.getFullName() + ' ' + this.description + '.'; -}; - - -jasmine.Spec.prototype.results = function() { - return this.results_; -}; - -/** - * All parameters are pretty-printed and concatenated together, then written to the spec's output. - * - * Be careful not to leave calls to jasmine.log in production code. - */ -jasmine.Spec.prototype.log = function() { - return this.results_.log(arguments); -}; - -jasmine.Spec.prototype.runs = function (func) { - var block = new jasmine.Block(this.env, func, this); - this.addToQueue(block); - return this; -}; - -jasmine.Spec.prototype.addToQueue = function (block) { - if (this.queue.isRunning()) { - this.queue.insertNext(block); - } else { - this.queue.add(block); - } -}; - -/** - * @param {jasmine.ExpectationResult} result - */ -jasmine.Spec.prototype.addMatcherResult = function(result) { - this.results_.addResult(result); -}; - -jasmine.Spec.prototype.expect = function(actual) { - var positive = new (this.getMatchersClass_())(this.env, actual, this); - positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); - return positive; -}; - -/** - * Waits a fixed time period before moving to the next block. - * - * @deprecated Use waitsFor() instead - * @param {Number} timeout milliseconds to wait - */ -jasmine.Spec.prototype.waits = function(timeout) { - var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); - this.addToQueue(waitsFunc); - return this; -}; - -/** - * Waits for the latchFunction to return true before proceeding to the next block. - * - * @param {Function} latchFunction - * @param {String} optional_timeoutMessage - * @param {Number} optional_timeout - */ -jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { - var latchFunction_ = null; - var optional_timeoutMessage_ = null; - var optional_timeout_ = null; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - switch (typeof arg) { - case 'function': - latchFunction_ = arg; - break; - case 'string': - optional_timeoutMessage_ = arg; - break; - case 'number': - optional_timeout_ = arg; - break; - } - } - - var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); - this.addToQueue(waitsForFunc); - return this; -}; - -jasmine.Spec.prototype.fail = function (e) { - var expectationResult = new jasmine.ExpectationResult({ - passed: false, - message: e ? jasmine.util.formatException(e) : 'Exception', - trace: { stack: e.stack } - }); - this.results_.addResult(expectationResult); -}; - -jasmine.Spec.prototype.getMatchersClass_ = function() { - return this.matchersClass || this.env.matchersClass; -}; - -jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { - var parent = this.getMatchersClass_(); - var newMatchersClass = function() { - parent.apply(this, arguments); - }; - jasmine.util.inherit(newMatchersClass, parent); - jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); - this.matchersClass = newMatchersClass; -}; - -jasmine.Spec.prototype.finishCallback = function() { - this.env.reporter.reportSpecResults(this); -}; - -jasmine.Spec.prototype.finish = function(onComplete) { - this.removeAllSpies(); - this.finishCallback(); - if (onComplete) { - onComplete(); - } -}; - -jasmine.Spec.prototype.after = function(doAfter) { - if (this.queue.isRunning()) { - this.queue.add(new jasmine.Block(this.env, doAfter, this)); - } else { - this.afterCallbacks.unshift(doAfter); - } -}; - -jasmine.Spec.prototype.execute = function(onComplete) { - var spec = this; - if (!spec.env.specFilter(spec)) { - spec.results_.skipped = true; - spec.finish(onComplete); - return; - } - - this.env.reporter.reportSpecStarting(this); - - spec.env.currentSpec = spec; - - spec.addBeforesAndAftersToQueue(); - - spec.queue.start(function () { - spec.finish(onComplete); - }); -}; - -jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { - var runner = this.env.currentRunner(); - var i; - - for (var suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); - } - } - for (i = 0; i < runner.before_.length; i++) { - this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); - } - for (i = 0; i < this.afterCallbacks.length; i++) { - this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); - } - for (suite = this.suite; suite; suite = suite.parentSuite) { - for (i = 0; i < suite.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); - } - } - for (i = 0; i < runner.after_.length; i++) { - this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); - } -}; - -jasmine.Spec.prototype.explodes = function() { - throw 'explodes function should not have been called'; -}; - -jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { - if (obj == jasmine.undefined) { - throw "spyOn could not find an object to spy upon for " + methodName + "()"; - } - - if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { - throw methodName + '() method does not exist'; - } - - if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { - throw new Error(methodName + ' has already been spied upon'); - } - - var spyObj = jasmine.createSpy(methodName); - - this.spies_.push(spyObj); - spyObj.baseObj = obj; - spyObj.methodName = methodName; - spyObj.originalValue = obj[methodName]; - - obj[methodName] = spyObj; - - return spyObj; -}; - -jasmine.Spec.prototype.removeAllSpies = function() { - for (var i = 0; i < this.spies_.length; i++) { - var spy = this.spies_[i]; - spy.baseObj[spy.methodName] = spy.originalValue; - } - this.spies_ = []; -}; - -/** - * Internal representation of a Jasmine suite. - * - * @constructor - * @param {jasmine.Env} env - * @param {String} description - * @param {Function} specDefinitions - * @param {jasmine.Suite} parentSuite - */ -jasmine.Suite = function(env, description, specDefinitions, parentSuite) { - var self = this; - self.id = env.nextSuiteId ? env.nextSuiteId() : null; - self.description = description; - self.queue = new jasmine.Queue(env); - self.parentSuite = parentSuite; - self.env = env; - self.before_ = []; - self.after_ = []; - self.children_ = []; - self.suites_ = []; - self.specs_ = []; -}; - -jasmine.Suite.prototype.getFullName = function() { - var fullName = this.description; - for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { - fullName = parentSuite.description + ' ' + fullName; - } - return fullName; -}; - -jasmine.Suite.prototype.finish = function(onComplete) { - this.env.reporter.reportSuiteResults(this); - this.finished = true; - if (typeof(onComplete) == 'function') { - onComplete(); - } -}; - -jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { - beforeEachFunction.typeName = 'beforeEach'; - this.before_.unshift(beforeEachFunction); -}; - -jasmine.Suite.prototype.afterEach = function(afterEachFunction) { - afterEachFunction.typeName = 'afterEach'; - this.after_.unshift(afterEachFunction); -}; - -jasmine.Suite.prototype.results = function() { - return this.queue.results(); -}; - -jasmine.Suite.prototype.add = function(suiteOrSpec) { - this.children_.push(suiteOrSpec); - if (suiteOrSpec instanceof jasmine.Suite) { - this.suites_.push(suiteOrSpec); - this.env.currentRunner().addSuite(suiteOrSpec); - } else { - this.specs_.push(suiteOrSpec); - } - this.queue.add(suiteOrSpec); -}; - -jasmine.Suite.prototype.specs = function() { - return this.specs_; -}; - -jasmine.Suite.prototype.suites = function() { - return this.suites_; -}; - -jasmine.Suite.prototype.children = function() { - return this.children_; -}; - -jasmine.Suite.prototype.execute = function(onComplete) { - var self = this; - this.queue.start(function () { - self.finish(onComplete); - }); -}; -jasmine.WaitsBlock = function(env, timeout, spec) { - this.timeout = timeout; - jasmine.Block.call(this, env, null, spec); -}; - -jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); - -jasmine.WaitsBlock.prototype.execute = function (onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); - } - this.env.setTimeout(function () { - onComplete(); - }, this.timeout); -}; -/** - * A block which waits for some condition to become true, with timeout. - * - * @constructor - * @extends jasmine.Block - * @param {jasmine.Env} env The Jasmine environment. - * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. - * @param {Function} latchFunction A function which returns true when the desired condition has been met. - * @param {String} message The message to display if the desired condition hasn't been met within the given time period. - * @param {jasmine.Spec} spec The Jasmine spec. - */ -jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { - this.timeout = timeout || env.defaultTimeoutInterval; - this.latchFunction = latchFunction; - this.message = message; - this.totalTimeSpentWaitingForLatch = 0; - jasmine.Block.call(this, env, null, spec); -}; -jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); - -jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; - -jasmine.WaitsForBlock.prototype.execute = function(onComplete) { - if (jasmine.VERBOSE) { - this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); - } - var latchFunctionResult; - try { - latchFunctionResult = this.latchFunction.apply(this.spec); - } catch (e) { - this.spec.fail(e); - onComplete(); - return; - } - - if (latchFunctionResult) { - onComplete(); - } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { - var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); - this.spec.fail({ - name: 'timeout', - message: message - }); - - this.abort = true; - onComplete(); - } else { - this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; - var self = this; - this.env.setTimeout(function() { - self.execute(onComplete); - }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); - } -}; -// Mock setTimeout, clearTimeout -// Contributed by Pivotal Computer Systems, www.pivotalsf.com - -jasmine.FakeTimer = function() { - this.reset(); - - var self = this; - self.setTimeout = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); - return self.timeoutsMade; - }; - - self.setInterval = function(funcToCall, millis) { - self.timeoutsMade++; - self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); - return self.timeoutsMade; - }; - - self.clearTimeout = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - - self.clearInterval = function(timeoutKey) { - self.scheduledFunctions[timeoutKey] = jasmine.undefined; - }; - -}; - -jasmine.FakeTimer.prototype.reset = function() { - this.timeoutsMade = 0; - this.scheduledFunctions = {}; - this.nowMillis = 0; -}; - -jasmine.FakeTimer.prototype.tick = function(millis) { - var oldMillis = this.nowMillis; - var newMillis = oldMillis + millis; - this.runFunctionsWithinRange(oldMillis, newMillis); - this.nowMillis = newMillis; -}; - -jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { - var scheduledFunc; - var funcsToRun = []; - for (var timeoutKey in this.scheduledFunctions) { - scheduledFunc = this.scheduledFunctions[timeoutKey]; - if (scheduledFunc != jasmine.undefined && - scheduledFunc.runAtMillis >= oldMillis && - scheduledFunc.runAtMillis <= nowMillis) { - funcsToRun.push(scheduledFunc); - this.scheduledFunctions[timeoutKey] = jasmine.undefined; - } - } - - if (funcsToRun.length > 0) { - funcsToRun.sort(function(a, b) { - return a.runAtMillis - b.runAtMillis; - }); - for (var i = 0; i < funcsToRun.length; ++i) { - try { - var funcToRun = funcsToRun[i]; - this.nowMillis = funcToRun.runAtMillis; - funcToRun.funcToCall(); - if (funcToRun.recurring) { - this.scheduleFunction(funcToRun.timeoutKey, - funcToRun.funcToCall, - funcToRun.millis, - true); - } - } catch(e) { - } - } - this.runFunctionsWithinRange(oldMillis, nowMillis); - } -}; - -jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { - this.scheduledFunctions[timeoutKey] = { - runAtMillis: this.nowMillis + millis, - funcToCall: funcToCall, - recurring: recurring, - timeoutKey: timeoutKey, - millis: millis - }; -}; - -/** - * @namespace - */ -jasmine.Clock = { - defaultFakeTimer: new jasmine.FakeTimer(), - - reset: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.reset(); - }, - - tick: function(millis) { - jasmine.Clock.assertInstalled(); - jasmine.Clock.defaultFakeTimer.tick(millis); - }, - - runFunctionsWithinRange: function(oldMillis, nowMillis) { - jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); - }, - - scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { - jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); - }, - - useMock: function() { - if (!jasmine.Clock.isInstalled()) { - var spec = jasmine.getEnv().currentSpec; - spec.after(jasmine.Clock.uninstallMock); - - jasmine.Clock.installMock(); - } - }, - - installMock: function() { - jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; - }, - - uninstallMock: function() { - jasmine.Clock.assertInstalled(); - jasmine.Clock.installed = jasmine.Clock.real; - }, - - real: { - setTimeout: jasmine.getGlobal().setTimeout, - clearTimeout: jasmine.getGlobal().clearTimeout, - setInterval: jasmine.getGlobal().setInterval, - clearInterval: jasmine.getGlobal().clearInterval - }, - - assertInstalled: function() { - if (!jasmine.Clock.isInstalled()) { - throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); - } - }, - - isInstalled: function() { - return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; - }, - - installed: null -}; -jasmine.Clock.installed = jasmine.Clock.real; - -//else for IE support -jasmine.getGlobal().setTimeout = function(funcToCall, millis) { - if (jasmine.Clock.installed.setTimeout.apply) { - return jasmine.Clock.installed.setTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.setTimeout(funcToCall, millis); - } -}; - -jasmine.getGlobal().setInterval = function(funcToCall, millis) { - if (jasmine.Clock.installed.setInterval.apply) { - return jasmine.Clock.installed.setInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.setInterval(funcToCall, millis); - } -}; - -jasmine.getGlobal().clearTimeout = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearTimeout.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearTimeout(timeoutKey); - } -}; - -jasmine.getGlobal().clearInterval = function(timeoutKey) { - if (jasmine.Clock.installed.clearTimeout.apply) { - return jasmine.Clock.installed.clearInterval.apply(this, arguments); - } else { - return jasmine.Clock.installed.clearInterval(timeoutKey); - } -}; - -jasmine.version_= { - "major": 1, - "minor": 1, - "build": 0, - "revision": 1308965645, - "release_candidate": 2 -}; diff --git a/src/deck.js/test/settings.js b/src/deck.js/test/settings.js deleted file mode 100755 index 7ba223d..0000000 --- a/src/deck.js/test/settings.js +++ /dev/null @@ -1,3 +0,0 @@ -// SETTINGS, VARS, UTILITY FUNCTIONS -jasmine.getFixtures().fixturesPath = 'fixtures'; -var defaults = $.deck.defaults; diff --git a/src/deck.js/test/spec.core.js b/src/deck.js/test/spec.core.js deleted file mode 100755 index 03b31e3..0000000 --- a/src/deck.js/test/spec.core.js +++ /dev/null @@ -1,377 +0,0 @@ -// Go tests, go -describe('Deck JS', function() { - describe('standard html structure', function() { - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - }); - - describe('init(selector)', function() { - it('should create slides', function() { - $.deck('.slide'); - expect($.deck('getSlides').length).toEqual($('.slide').length); - }); - }); - - describe('init([selectors])', function() { - it('should create slides', function() { - $.deck([ - '.slide1', - '.slide2', - '.slide3', - '.slide4', - '.slide5' - ]); - expect($.deck('getSlides').length).toEqual($('.slide').length); - }); - }); - - describe('navigation functions', function() { - beforeEach(function() { - $.deck('.slide'); - }); - - describe('go(i)', function() { - it('should go to the i slide (0 based index)', function() { - $.deck('go', 3); - expect($.deck('getSlide')).toHaveClass('slide4'); - }); - - it('should go nowhere if i is NaN', function() { - $.deck('go', 'foobar'); - expect($.deck('getSlide')).toHaveClass('slide1'); - }); - - it('should go nowhere if i is out of bounds', function() { - $.deck('go', 5); - expect($.deck('getSlide')).toHaveClass('slide1'); - }); - }); - - describe('next()', function() { - it('should go to the next slide', function() { - $.deck('next'); - expect($.deck('getSlide')).toHaveClass('slide2'); - }); - - it('should go nowhere if on the last slide', function() { - $.deck('go', 4); - $.deck('next'); - expect($.deck('getSlide')).toHaveClass('slide5'); - }); - }); - - describe('prev()', function() { - it('should go to the previous slide', function() { - $.deck('go', 2); - $.deck('prev'); - expect($.deck('getSlide')).toHaveClass('slide2'); - }); - - it('should go nowhere if on the first slide', function() { - $.deck('prev'); - expect($.deck('getSlide')).toHaveClass('slide1'); - }); - }); - }); - - describe('getters', function() { - beforeEach(function() { - $.deck('.slide'); - }); - - describe('getSlide()', function() { - it('should get the current slide', function() { - expect($.deck('getSlide')).toHaveClass('slide1'); - $.deck('go', 2); - expect($.deck('getSlide')).toHaveClass('slide3'); - }); - }); - - describe('getSlide(i)', function() { - it('should get slide number i (0 based index)', function() { - expect($.deck('getSlide', 1)).toHaveClass('slide2'); - expect($.deck('getSlide', 3)).toHaveClass('slide4'); - }); - - it('should return null if i is NaN', function() { - expect($.deck('getSlide', 'barfoo')).toBeNull(); - }); - - it('should return null if i is out of bounds', function() { - expect($.deck('getSlide', 6)).toBeNull(); - }); - }); - - describe('getSlides()', function() { - it('should return an array of jQuery objects for each slide', function() { - var expectation = [], - slides = $.deck('getSlides'); - $('.slide').each(function() { - expectation.push($(this)); - }); - expect(slides).toEqual(expectation); - }); - }); - - describe('getContainer()', function() { - it('should return a jQuery object with the container element(s)', function() { - expect($.deck('getContainer')).toBe(defaults.selectors.container); - }); - }); - - describe('getOptions()', function() { - it('should return the current options object', function() { - expect($.deck('getOptions')).toEqual(defaults); - }); - }); - }); - - describe('container states', function() { - beforeEach(function() { - $.deck('.slide'); - }); - - it('should start at state 0', function() { - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '0'); - }); - - it('should change states with the slide number', function() { - $.deck('next'); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '1'); - $.deck('go', 3); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '3'); - $.deck('prev'); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.onPrefix + '2'); - }); - }); - - describe('options object', function() { - var $d = $(document); - - beforeEach(function() { - $.deck('.alt-slide', { - classes: { - after: 'alt-after', - before: 'alt-before', - current: 'alt-current', - onPrefix: 'alt-on-', - next: 'alt-next', - previous: 'alt-prev' - }, - - selectors: { - container: '.alt-container' - }, - - keys: { - next: 87, - previous: 69 - } - }); - }); - - describe('classes', function() { - it('should use the specified after class', function() { - expect($('.alt-slide3, .alt-slide4, .alt-slide5')).toHaveClass('alt-after'); - }); - - it('should use the specified before class', function() { - $.deck('go', 4); - expect($('.alt-slide1, .alt-slide2, .alt-slide3')).toHaveClass('alt-before'); - }); - - it('should use the specified container class', function() { - $.deck('go', 2); - expect($('.alt-container')).toHaveClass('alt-on-2'); - }); - - it('should use the specified current class', function() { - expect($.deck('getSlide')).toHaveClass('alt-current'); - }); - - it('should use the specified next class', function() { - expect($('.alt-slide2')).toHaveClass('alt-next'); - }); - - it('should use the specified previous class', function() { - $.deck('next'); - expect($('.alt-slide1')).toHaveClass('alt-prev'); - }); - }); - - describe('key bindings', function() { - var e; - - beforeEach(function() { - e = jQuery.Event('keydown.deck'); - }); - - it('should go to the next slide using the specified key', function() { - e.which = 87; // 'w' - $d.trigger(e); - expect($.deck('getSlide')).toHaveClass('alt-slide2'); - }); - - it('should go to the previous slide using the specified key', function() { - $.deck('next'); - e.which = 69; // 'e' - $d.trigger(e); - expect($.deck('getSlide')).toHaveClass('alt-slide1'); - }); - - it('should not trigger events that originate within editable elements', function() { - e = jQuery.Event('keydown'); - e.which = 87; - $('.alt-slide1 input').trigger(e); - expect($.deck('getSlide')).toHaveClass('alt-slide1'); - }); - }); - }); - - describe('events', function() { - var $d = $(document); - - beforeEach(function() { - $.deck('.slide'); - $.deck('go', 1); - spyOnEvent($d, 'deck.change'); - }); - - describe('deck.change', function() { - it('should fire on go(i)', function() { - $.deck('go', 3); - expect('deck.change').toHaveBeenTriggeredOn($d); - }); - - it('should fire on next()', function() { - $.deck('next'); - expect('deck.change').toHaveBeenTriggeredOn($d); - }); - - it('should fire on prev()', function() { - $.deck('prev'); - expect('deck.change').toHaveBeenTriggeredOn($d); - }); - - it('should pass parameters with from and to indices', function() { - var f = function(e, from, to) { - expect(from).toEqual(1); - expect(to).toEqual(3); - }; - - $d.bind('deck.change', f); - $.deck('go', 3); - $d.unbind('deck.change', f); - }); - }); - }); - }); - - describe('complex html structure', function() { - beforeEach(function() { - loadFixtures('complex.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - $.deck([ - '.slide1', - '.slide2', - '.slide3', - '.slide4', - '.slide5', - '.slide6', - '.slide7', - '.slide8', - '.slide9', - '.slide10', - ]); - $.deck('go', 2); - }); - - describe('compound state classes', function() { - it('should apply current class', function() { - $('.slide3').each(function(i, el) { - expect($(el)).toHaveClass(defaults.classes.current); - }); - }); - - it('should apply previous class', function() { - $('.slide2').each(function(i, el) { - expect($(el)).toHaveClass(defaults.classes.previous); - }); - }); - - it('should apply next class', function() { - $('.slide4').each(function(i, el) { - expect($(el)).toHaveClass(defaults.classes.next); - }); - }); - - it('should apply before class', function() { - $('.slide1').each(function(i, el) { - expect($(el)).toHaveClass(defaults.classes.before); - }); - }); - - it('should apply after class', function() { - $('.slide5, .slide6, .slide7, .slide8, .slide9, .slide10').each(function(i, el) { - expect($(el)).toHaveClass(defaults.classes.after); - }); - }); - - it('should apply child-current class', function() { - expect($('.slide2').not('.slide10')).toHaveClass(defaults.classes.childCurrent); - }); - }); - - it('should remove old state classes', function() { - $.deck('go', 4); - expect($('.slide3').not('.slide5')).not.toHaveClass(defaults.classes.current); - expect($('.slide2').not('.slide4')).not.toHaveClass(defaults.classes.previous); - expect($('.slide4').not('.slide6')).not.toHaveClass(defaults.classes.next); - }); - }); - - describe('iframes', function() { - beforeEach(function() { - loadFixtures('iframes.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - $.deck([ - '.slide1', - '.slide2', - '.slide3', - '.slide4', - '.slide5', - '.slide6', - '.slide7', - '.slide8', - '.slide9', - '.slide10', - ]); - - }); - - it('should remove/restore iframe sources when leaving/entering a slide', function() { - $.deck('go', 4); - expect($.deck('getSlide').find('iframe').attr('src')).toEqual('iframe_simple.html'); - $.deck('next'); - expect($('.slide5').find('iframe').attr('src')).toEqual(''); - $.deck('prev'); - expect($('.slide5').find('iframe').attr('src')).toEqual('iframe_simple.html'); - }); - - it('should not store blank iframe sources', function() { - $.deck('go', 6); - $.deck('next'); - expect($.deck('getSlide').find('iframe').data('src')).toBeUndefined(); - }); - }); -}); diff --git a/src/deck.js/test/spec.goto.js b/src/deck.js/test/spec.goto.js deleted file mode 100755 index a65c927..0000000 --- a/src/deck.js/test/spec.goto.js +++ /dev/null @@ -1,107 +0,0 @@ -describe('Deck JS Quick Go-To', function() { - var $d = $(document); - - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - $.deck('.slide'); - }); - - describe('showGoTo()', function() { - it('should show the go-to helper', function() { - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto); - $.deck('showGoTo'); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto); - }); - - it('should focus the go-to input', function() { - $.deck('showGoTo'); - expect($(defaults.selectors.gotoInput)[0]).toEqual(document.activeElement); - }); - }); - - describe('hideGoTo()', function() { - beforeEach(function() { - $.deck('showGoTo'); - $.deck('hideGoTo'); - }); - - it('should hide the go-to helper', function() { - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto); - }); - - it('should blur the go-to input', function() { - expect($(defaults.selectors.gotoInput)[0]).not.toEqual(document.activeElement); - }); - }); - - describe('toggleGoTo()', function() { - it('should toggle the go-to helper on and off', function() { - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto); - $.deck('toggleGoTo'); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto); - $.deck('toggleGoTo'); - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto); - }); - }); - - describe('Go-To submit', function() { - beforeEach(function() { - $.deck('showGoTo'); - }); - - it('should hide the go-to helper', function() { - $(defaults.selectors.gotoInput).val('3'); - $(defaults.selectors.gotoForm).submit(); - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto); - }); - - it('should go to the slide entered', function() { - $(defaults.selectors.gotoInput).val('3'); - $(defaults.selectors.gotoForm).submit(); - expect($.deck('getSlide')).toEqual($.deck('getSlide'), 2); - }); - - it('should go nowhere if a number is not entered', function() { - $(defaults.selectors.gotoInput).val(''); - $(defaults.selectors.gotoForm).submit(); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto); - expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0); - }); - - it('should go nowhere if the number is negative', function() { - $(defaults.selectors.gotoInput).val('-2'); - $(defaults.selectors.gotoForm).submit(); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto); - expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0); - }); - - it('should go nowhere if the number is greater than the number of slides', function() { - $(defaults.selectors.gotoInput).val('9'); - $(defaults.selectors.gotoForm).submit(); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto); - expect($.deck('getSlide')).toEqual($.deck('getSlide'), 0); - }); - }); - - describe('key bindings', function() { - var e; - - beforeEach(function() { - e = jQuery.Event('keydown.deckgoto'); - }); - - it('should toggle the go-to helper if the specified key is pressed', function() { - e.which = 71; // g - $d.trigger(e); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.goto); - $d.trigger(e); - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.goto); - }); - }); -}); \ No newline at end of file diff --git a/src/deck.js/test/spec.hash.js b/src/deck.js/test/spec.hash.js deleted file mode 100755 index 57b4016..0000000 --- a/src/deck.js/test/spec.hash.js +++ /dev/null @@ -1,60 +0,0 @@ -describe('Deck JS Hash Extension', function() { - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - $.deck('.slide'); - }); - - it('should assign ids to slides that do not have them', function() { - var slides = $.deck('getSlides'); - $.each(slides, function(i, $e) { - expect($e.attr('id')).toBeTruthy(); - }); - }); - - it('should update the href on slide change', function() { - var $hashLink = $(defaults.selectors.hashLink); - $.deck('go', 3); - expect($hashLink).toHaveAttr('href', '#slide-3'); - }); - - it('should use existing ids if they exist', function() { - var $hashLink = $(defaults.selectors.hashLink); - $.deck('go', 1); - expect($hashLink).toHaveAttr('href', '#custom-id'); - }); - - it('should update the URL on slide change (if supported)', function() { - if (Modernizr.history) { - $.deck('go', 3); - expect(window.location.hash).toEqual('#slide-3'); - } - }); - - it('should deep link to slide on deck init', function() { - window.location.hash = "#slide-3"; - $.deck('.slide'); - expect($.deck('getSlide')).toHaveId('slide-3'); - }); - - it('should follow internal hash links using hashchange (if supported)', function() { - if (Modernizr.hashchange) { - window.location.hash = "#slide-3"; - - // Hashchange event doesn't fire right when the hash changes? - waitsFor(function() { - return $.deck('getSlide').attr('id') === 'slide-3'; - }, 'hash to change to slide-3', 2000); - } - }); - - it('should follow internal hash links on click', function() { - /* Triggered clicks dont generate hashchanges, so until I find - a way to do this in an automated fashion, needs to be hand tested. */ - }); -}); \ No newline at end of file diff --git a/src/deck.js/test/spec.menu.js b/src/deck.js/test/spec.menu.js deleted file mode 100755 index 79e3848..0000000 --- a/src/deck.js/test/spec.menu.js +++ /dev/null @@ -1,56 +0,0 @@ -describe('Deck JS Menu', function() { - var $d = $(document); - - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - $.deck('.slide'); - }); - - describe('showMenu()', function() { - it('should show the menu', function() { - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.menu); - $.deck('showMenu'); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.menu); - }); - }); - - describe('hideMenu()', function() { - it('should hide the menu', function() { - $.deck('showMenu'); - $.deck('hideMenu'); - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.menu); - }); - }); - - describe('toggleMenu()', function() { - it('should toggle menu on and off', function() { - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.menu); - $.deck('toggleMenu'); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.menu); - $.deck('toggleMenu'); - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.menu); - }); - }); - - describe('key bindings', function() { - var e; - - beforeEach(function() { - e = jQuery.Event('keydown.deckmenu'); - }); - - it('should toggle the menu if the specified key is pressed', function() { - e.which = 77; // m - $d.trigger(e); - expect($(defaults.selectors.container)).toHaveClass(defaults.classes.menu); - $d.trigger(e); - expect($(defaults.selectors.container)).not.toHaveClass(defaults.classes.menu); - }); - }); -}); \ No newline at end of file diff --git a/src/deck.js/test/spec.navigation.js b/src/deck.js/test/spec.navigation.js deleted file mode 100755 index aef6f74..0000000 --- a/src/deck.js/test/spec.navigation.js +++ /dev/null @@ -1,45 +0,0 @@ -describe('Deck JS Navigation Buttons', function() { - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - $.deck('.slide'); - }); - - it('should go to the next slide if next link is clicked', function() { - $(defaults.selectors.nextLink).click(); - expect($.deck('getSlide')).toHaveClass('slide2'); - }); - - it('should go to the previous slide if previous link is clicked', function() { - $.deck('go', 2); - $(defaults.selectors.previousLink).click(); - expect($.deck('getSlide')).toHaveClass('slide2'); - }); - - it('should add the disabled class to the previous link if on first slide', function() { - expect($(defaults.selectors.previousLink)).toHaveClass(defaults.classes.navDisabled); - $(defaults.selectors.nextLink).click(); - expect($(defaults.selectors.previousLink)).not.toHaveClass(defaults.classes.navDisabled); - $(defaults.selectors.previousLink).click(); - expect($(defaults.selectors.previousLink)).toHaveClass(defaults.classes.navDisabled); - }); - - it('should add the disabled class to the next link if on last slide', function() { - expect($(defaults.selectors.nextLink)).not.toHaveClass(defaults.classes.navDisabled); - $.deck('go', $.deck('getSlides').length - 1); - expect($(defaults.selectors.nextLink)).toHaveClass(defaults.classes.navDisabled); - }); - - it('should update the links hrefs with real fragment ids', function() { - expect($(defaults.selectors.previousLink)).toHaveAttr('href', '#'); - expect($(defaults.selectors.nextLink)).toHaveAttr('href', '#custom-id'); - $.deck('go', 2); - expect($(defaults.selectors.previousLink)).toHaveAttr('href', '#custom-id'); - expect($(defaults.selectors.nextLink)).toHaveAttr('href', '#slide-3'); - }); -}); \ No newline at end of file diff --git a/src/deck.js/test/spec.scale.js b/src/deck.js/test/spec.scale.js deleted file mode 100755 index 0976ba1..0000000 --- a/src/deck.js/test/spec.scale.js +++ /dev/null @@ -1,57 +0,0 @@ -describe('Deck JS Status Indicator', function() { - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - $.deck('.slide'); - }); - - it('should start with scaling enabled', function() { - expect($.deck('getContainer')).toHaveClass(defaults.classes.scale); - }); - - describe('disableScale()', function() { - it('should remove the scale class from the container', function() { - $.deck('disableScale'); - expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale); - }); - }); - - describe('enableScale()', function() { - it('should add the scale class to the container', function() { - $.deck('disableScale'); - $.deck('enableScale'); - expect($.deck('getContainer')).toHaveClass(defaults.classes.scale); - }); - }); - - describe('toggleScale()', function() { - it('should toggle between adding and removing the scale class', function() { - $.deck('toggleScale'); - expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale); - $.deck('toggleScale'); - expect($.deck('getContainer')).toHaveClass(defaults.classes.scale); - }); - }); - - describe('key bindings', function() { - var e, - $d = $(document); - - beforeEach(function() { - e = jQuery.Event('keydown.deckscale'); - }); - - it('should toggle scaling if the specified key is pressed', function() { - e.which = 83; // s - $d.trigger(e); - expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale); - $d.trigger(e); - expect($.deck('getContainer')).toHaveClass(defaults.classes.scale); - }); - }); -}); \ No newline at end of file diff --git a/src/deck.js/test/spec.status.js b/src/deck.js/test/spec.status.js deleted file mode 100755 index fdfd7ad..0000000 --- a/src/deck.js/test/spec.status.js +++ /dev/null @@ -1,25 +0,0 @@ -describe('Deck JS Status Indicator', function() { - beforeEach(function() { - loadFixtures('standard.html'); - if (Modernizr.history) { - history.replaceState({}, "", "#") - } - else { - window.location.hash = '#'; - } - $.deck('.slide'); - }); - - it('should show the correct total number of slides', function() { - expect($(defaults.selectors.statusTotal)).toHaveText($.deck('getSlides').length); - }); - - it('should start at 1 of X', function() { - expect($(defaults.selectors.statusCurrent)).toHaveText(1); - }); - - it('should update to the correct number on slide change', function() { - $.deck('go', 2); - expect($(defaults.selectors.statusCurrent)).toHaveText('3'); - }); -}); \ No newline at end of file diff --git a/src/deck.js/themes/style/neon.css b/src/deck.js/themes/style/neon.css deleted file mode 100755 index c652dea..0000000 --- a/src/deck.js/themes/style/neon.css +++ /dev/null @@ -1,114 +0,0 @@ -.deck-container { - font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; - font-size: 1.25em; - color: #aaa; - background: #000; -} -.deck-container .slide { - background: #000; -} -.deck-container h1 { - color: #0af; - font-weight: normal; - font-weight: 100; - text-shadow: 0 0 50px #0af, 0 0 3px #fff; -} -.deck-container h2 { - color: #af0; - border-bottom-color: #ccc; - font-weight: normal; - font-weight: 100; - text-shadow: 0 0 15px #af0, 0 0 2px #fff; - border-bottom: 1px solid #333; -} -.deck-container h3 { - color: #fff; - font-weight: normal; - font-weight: 100; - text-shadow: 0 0 10px #fff, 0 0 2px #fff; -} -.deck-container pre { - border-color: #333; -} -.deck-container pre code { - color: #fff; -} -.deck-container code { - color: #f0a; -} -.deck-container blockquote { - font-size: 2em; - padding: 1em 2em; - color: #fff; - border-left: 5px solid #fff; -} -.deck-container blockquote p { - margin: 0; -} -.deck-container blockquote cite { - font-size: .5em; - font-style: normal; - font-weight: normal; - font-weight: 100; - color: #aaa; - text-shadow: 0 0 15px #fff, 0 0 2px #fff; -} -.deck-container ::-moz-selection { - background: #a0f; -} -.deck-container ::selection { - background: #a0f; -} -.deck-container a, .deck-container a:hover, .deck-container a:focus, .deck-container a:active, .deck-container a:visited { - color: #f0a; - text-decoration: none; -} -.deck-container a:hover, .deck-container a:focus { - text-decoration: underline; -} -.deck-container .deck-prev-link, .deck-container .deck-next-link { - background: #f0a; - text-shadow: 0 0 3px #fff; -} -.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited { - color: #fff; -} -.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus { - text-decoration: none; -} -.boxshadow .deck-container .deck-prev-link:hover, .boxshadow .deck-container .deck-prev-link:focus, .boxshadow .deck-container .deck-next-link:hover, .boxshadow .deck-container .deck-next-link:focus { - -webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff; - -moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff; - box-shadow: 0 0 20px #f0a, 0 0 5px #fff; -} -.deck-container .deck-status { - font-size: 0.6666em; -} -.deck-container .goto-form { - background: #000; - border: 1px solid #f0a; -} -.deck-container .goto-form label { - color: #fff; -} -.deck-container.deck-menu .slide { - background: #333; -} -.deck-container.deck-menu .deck-current { - background: #444; -} -.boxshadow .deck-container.deck-menu .deck-current { - background: #000; - -webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff; - -moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff; - box-shadow: 0 0 20px #f0a, 0 0 5px #fff; -} -.no-touch .deck-container.deck-menu .slide:hover { - background: #444; -} -.no-touch.boxshadow .deck-container.deck-menu .slide:hover { - background: #000; - -webkit-box-shadow: 0 0 20px #f0a, 0 0 5px #fff; - -moz-box-shadow: 0 0 20px #f0a, 0 0 5px #fff; - box-shadow: 0 0 20px #f0a, 0 0 5px #fff; -} diff --git a/src/deck.js/themes/style/neon.scss b/src/deck.js/themes/style/neon.scss deleted file mode 100755 index 5a35b75..0000000 --- a/src/deck.js/themes/style/neon.scss +++ /dev/null @@ -1,139 +0,0 @@ -.deck-container { - font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; - font-size:1.25em; - color:#aaa; - background:#000; - - .slide { - background:#000; - } - - h1 { - color:#0af; - font-weight:normal; - font-weight:100; - text-shadow:0 0 50px #0af, 0 0 3px #fff; - } - - h2 { - color:#af0; - border-bottom-color:#ccc; - font-weight:normal; - font-weight:100; - text-shadow:0 0 15px #af0, 0 0 2px #fff; - border-bottom:1px solid #333; - } - - h3 { - color:#fff; - font-weight:normal; - font-weight:100; - text-shadow:0 0 10px #fff, 0 0 2px #fff; - } - - pre { - border-color:#333; - - code { - color:#fff; - } - } - - code { - color:#f0a; - } - - blockquote { - font-size:2em; - padding:1em 2em; - color:#fff; - border-left:5px solid #fff; - - p { - margin:0; - } - - cite { - font-size:.5em; - font-style:normal; - font-weight:normal; - font-weight:100; - color:#aaa; - text-shadow:0 0 15px #fff, 0 0 2px #fff; - } - } - - ::-moz-selection{ background:#a0f; } - ::selection { background:#a0f; } - - a { - &, &:hover, &:focus, &:active, &:visited { - color:#f0a; - text-decoration:none; - } - - &:hover, &:focus { - text-decoration:underline; - } - } - - .deck-prev-link, .deck-next-link { - background:#f0a; - text-shadow:0 0 3px #fff; - - &, &:hover, &:focus, &:active, &:visited { - color:#fff; - } - - &:hover, &:focus { - text-decoration:none; - - .boxshadow & { - -webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff; - -moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff; - box-shadow:0 0 20px #f0a, 0 0 5px #fff; - } - } - } - - .deck-status { - font-size:0.6666em; - } - - .goto-form { - background:#000; - border:1px solid #f0a; - - label { - color:#fff; - } - } - - &.deck-menu { - .slide { - background:#333; - } - - .deck-current { - background:#444; - - .boxshadow & { - background:#000; - -webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff; - -moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff; - box-shadow:0 0 20px #f0a, 0 0 5px #fff; - } - } - - .no-touch & .slide:hover { - background:#444; - } - - .no-touch.boxshadow & .slide:hover { - background:#000; - -webkit-box-shadow:0 0 20px #f0a, 0 0 5px #fff; - -moz-box-shadow:0 0 20px #f0a, 0 0 5px #fff; - box-shadow:0 0 20px #f0a, 0 0 5px #fff; - } - } -} diff --git a/src/deck.js/themes/style/swiss.css b/src/deck.js/themes/style/swiss.css deleted file mode 100755 index 5439297..0000000 --- a/src/deck.js/themes/style/swiss.css +++ /dev/null @@ -1,75 +0,0 @@ -.deck-container { - font-family: "Helvetica Neue", sans-serif; - font-size: 1.25em; - background: #fff; -} -.deck-container .slide { - background: #fff; -} -.deck-container h1 { - color: #000; -} -.deck-container h2 { - color: #c00; - border-bottom-color: #ccc; -} -.deck-container h3 { - color: #888; -} -.deck-container pre { - border-color: #ccc; -} -.deck-container code { - color: #888; -} -.deck-container blockquote { - font-size: 2em; - font-style: italic; - padding: 1em 2em; - color: #000; - border-left: 5px solid #ccc; -} -.deck-container blockquote p { - margin: 0; -} -.deck-container blockquote cite { - font-size: .5em; - font-style: normal; - font-weight: bold; - color: #888; -} -.deck-container ::-moz-selection { - background: #c00; - color: #fff; -} -.deck-container ::selection { - background: #c00; - color: #fff; -} -.deck-container a, .deck-container a:hover, .deck-container a:focus, .deck-container a:active, .deck-container a:visited { - color: #c00; - text-decoration: none; -} -.deck-container a:hover, .deck-container a:focus { - text-decoration: underline; -} -.deck-container .deck-prev-link, .deck-container .deck-next-link { - background: #ccc; - font-family: serif; -} -.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited { - color: #fff; -} -.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus { - background: #c00; - text-decoration: none; -} -.deck-container .deck-status { - font-size: 0.6666em; -} -.deck-container.deck-menu .slide { - background: #eee; -} -.deck-container.deck-menu .deck-current, .no-touch .deck-container.deck-menu .slide:hover { - background: #ddf; -} diff --git a/src/deck.js/themes/style/swiss.scss b/src/deck.js/themes/style/swiss.scss deleted file mode 100755 index f3ecffc..0000000 --- a/src/deck.js/themes/style/swiss.scss +++ /dev/null @@ -1,91 +0,0 @@ -.deck-container { - font-family: "Helvetica Neue", sans-serif; - font-size:1.25em; - background:#fff; - - .slide { - background:#fff; - } - - h1 { - color:#000; - } - - h2 { - color:#c00; - border-bottom-color:#ccc; - } - - h3 { - color:#888; - } - - pre { - border-color:#ccc; - } - - code { - color:#888; - } - - blockquote { - font-size:2em; - font-style:italic; - padding:1em 2em; - color:#000; - border-left:5px solid #ccc; - - p { - margin:0; - } - - cite { - font-size:.5em; - font-style:normal; - font-weight:bold; - color:#888; - } - } - - ::-moz-selection{ background:#c00; color:#fff; } - ::selection { background:#c00; color:#fff; } - - a { - &, &:hover, &:focus, &:active, &:visited { - color:#c00; - text-decoration:none; - } - - &:hover, &:focus { - text-decoration:underline; - } - } - - .deck-prev-link, .deck-next-link { - background:#ccc; - font-family:serif; // sans-serif arrows x-browser fail - - &, &:hover, &:focus, &:active, &:visited { - color:#fff; - } - - &:hover, &:focus { - background:#c00; - text-decoration:none; - } - } - - .deck-status { - font-size:0.6666em; - } - - &.deck-menu { - .slide { - background:#eee; - } - - .deck-current, .no-touch & .slide:hover { - background:#ddf; - } - } -} diff --git a/src/deck.js/themes/style/web-2.0.css b/src/deck.js/themes/style/web-2.0.css deleted file mode 100755 index a5da81a..0000000 --- a/src/deck.js/themes/style/web-2.0.css +++ /dev/null @@ -1,187 +0,0 @@ -.deck-container { - font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; - font-size: 1.25em; - background: #f4fafe; - /* Old browsers */ - background: -moz-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); - /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4fafe), color-stop(100%, #ccf0f0)); - /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); - /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); - /* Opera11.10+ */ - background: -ms-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); - /* IE10+ */ - background: linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); - /* W3C */ - background-attachment: fixed; -} -.deck-container > .slide { - text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5); -} -.deck-container h1, .deck-container h2, .deck-container h3, .deck-container h4, .deck-container h5, .deck-container h6 { - font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; -} -.deck-container h1 { - color: #08455f; -} -.deck-container h2 { - color: #0b7495; - border-bottom: 0; -} -.cssreflections .deck-container h2 { - line-height: 1; - -webkit-box-reflect: below -0.556em -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7, rgba(255, 255, 255, 0.1)), to(transparent)); - -moz-box-reflect: below -0.556em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255, 255, 255, 0.3) 100%); -} -.deck-container h3 { - color: #000; -} -.deck-container pre { - border-color: #cde; - background: #fff; - position: relative; - /* http://nicolasgallagher.com/css-drop-shadows-without-images/ */ -} -.borderradius .deck-container pre { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.csstransforms.boxshadow .deck-container pre:before, .csstransforms.boxshadow .deck-container pre:after { - content: ""; - position: absolute; - z-index: -1; - bottom: 15px; - width: 50%; - height: 20%; - max-width: 300px; - -webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); - -moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); - box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); -} -.csstransforms.boxshadow .deck-container pre:before { - left: 10px; - -webkit-transform: rotate(-3deg); - -moz-transform: rotate(-3deg); - -ms-transform: rotate(-3deg); - -o-transform: rotate(-3deg); - transform: rotate(-3deg); -} -.csstransforms.boxshadow .deck-container pre:after { - right: 10px; - -webkit-transform: rotate(3deg); - -moz-transform: rotate(3deg); - -ms-transform: rotate(3deg); - -o-transform: rotate(3deg); - transform: rotate(3deg); -} -.deck-container code { - color: #789; -} -.deck-container blockquote { - font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; - font-size: 2em; - padding: 1em 2em .5em 2em; - color: #000; - background: #fff; - position: relative; - border: 1px solid #cde; -} -.borderradius .deck-container blockquote { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.boxshadow .deck-container blockquote:after { - content: ""; - position: absolute; - z-index: -1; - top: 10px; - bottom: 10px; - left: 0; - right: 50%; - -moz-border-radius: 10px/100px; - border-radius: 10px/100px; - -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6); - -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6); - box-shadow: 0 0 15px rgba(0, 0, 0, 0.6); -} -.deck-container blockquote p { - margin: 0; -} -.deck-container blockquote cite { - font-size: .5em; - font-style: normal; - font-weight: bold; - color: #888; -} -.deck-container blockquote:before { - content: "“"; - position: absolute; - top: 0; - left: 0; - font-size: 5em; - line-height: 1; - color: #ccf0f0; - z-index: 1; -} -.deck-container .borderradius img { - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.deck-container ::-moz-selection { - background: #08455f; - color: #fff; -} -.deck-container ::selection { - background: #08455f; - color: #fff; -} -.deck-container a, .deck-container a:hover, .deck-container a:focus, .deck-container a:active, .deck-container a:visited { - color: #599; - text-decoration: none; -} -.deck-container a:hover, .deck-container a:focus { - text-decoration: underline; -} -.deck-container .deck-prev-link, .deck-container .deck-next-link { - background: #fff; - opacity: 0.5; -} -.deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited { - color: #599; -} -.deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus { - opacity: 1; - text-decoration: none; -} -.deck-container .deck-status { - font-size: 0.6666em; -} -.deck-container.deck-menu .slide { - background: transparent; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.rgba .deck-container.deck-menu .slide { - background: rgba(0, 0, 0, 0.1); -} -.deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu .slide.deck-current, .no-touch .deck-container.deck-menu .slide:hover { - background: #fff; -} -.deck-container .goto-form { - background: #fff; - border: 1px solid #cde; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.boxshadow .deck-container .goto-form { - -webkit-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - -moz-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; -} diff --git a/src/deck.js/themes/style/web-2.0.scss b/src/deck.js/themes/style/web-2.0.scss deleted file mode 100755 index de417f1..0000000 --- a/src/deck.js/themes/style/web-2.0.scss +++ /dev/null @@ -1,214 +0,0 @@ -@mixin border-radius($r) { - -webkit-border-radius:$r; - -moz-border-radius:$r; - border-radius:$r; -} - -@mixin rotate($deg) { - -webkit-transform:rotate($deg); - -moz-transform:rotate($deg); - -ms-transform:rotate($deg); - -o-transform:rotate($deg); - transform:rotate($deg); -} - -@mixin box-shadow($x, $y, $blur, $color) { - -webkit-box-shadow:$x $y $blur $color; - -moz-box-shadow:$x $y $blur $color; - box-shadow:$x $y $blur $color; -} - - -.deck-container { - font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; - font-size:1.25em; - background: rgb(244,250,254); /* Old browsers */ - background: -moz-linear-gradient(top, rgba(244,250,254,1) 0%, rgba(204,240,240,1) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(244,250,254,1)), color-stop(100%,rgba(204,240,240,1))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* IE10+ */ - background: linear-gradient(top, rgba(244,250,254,1) 0%,rgba(204,240,240,1) 100%); /* W3C */ - background-attachment: fixed; - - > .slide { - text-shadow:1px 1px 1px rgba(255,255,255,.5); - } - - h1, h2, h3, h4, h5, h6 { - font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; - } - - h1 { - color:#08455f; - } - - h2 { - color:#0b7495; - border-bottom:0; - - .cssreflections & { - line-height:1; - -webkit-box-reflect:below -0.5555em -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7, rgba(255,255,255,.1)), to(transparent)); - -moz-box-reflect:below -0.5555em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255,255,255,.3) 100%); - } - } - - h3 { - color:#000; - } - - pre { - border-color:#cde; - background:#fff; - position:relative; - - .borderradius & { - @include border-radius(5px); - } - - /* http://nicolasgallagher.com/css-drop-shadows-without-images/ */ - .csstransforms.boxshadow & { - &:before, &:after { - content:""; - position:absolute; - z-index:-1; - bottom:15px; - width:50%; - height:20%; - max-width:300px; - @include box-shadow(0, 15px, 10px, rgba(0, 0, 0, 0.7)); - } - - &:before { - left:10px; - @include rotate(-3deg); - } - - &:after { - right:10px; - @include rotate(3deg); - } - } - } - - code { - color:#789; - } - - blockquote { - font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; - font-size:2em; - padding:1em 2em .5em 2em; - color:#000; - background:#fff; - position:relative; - border:1px solid #cde; - - .borderradius & { - @include border-radius(5px); - } - - .boxshadow & { - &:after { - content:""; - position:absolute; - z-index:-1; - top: 10px; - bottom: 10px; - left: 0; - right: 50%; - -moz-border-radius: 10px / 100px; - border-radius: 10px / 100px; - @include box-shadow(0, 0, 15px, rgba(0,0,0,0.6)); - } - } - - p { - margin:0; - } - - cite { - font-size:.5em; - font-style:normal; - font-weight:bold; - color:#888; - } - - &:before { - content:"“"; - position:absolute; - top:0; - left:0; - font-size:5em; - line-height:1; - color:#ccf0f0; - z-index:1; - } - } - - .borderradius img { - @include border-radius(5px); - } - - ::-moz-selection{ background:#08455f; color:#fff; } - ::selection { background:#08455f; color:#fff; } - - a { - &, &:hover, &:focus, &:active, &:visited { - color:#599; - text-decoration:none; - } - - &:hover, &:focus { - text-decoration:underline; - } - } - - .deck-prev-link, .deck-next-link { - background:#fff; - opacity:0.5; - - &, &:hover, &:focus, &:active, &:visited { - color:#599; - } - - &:hover, &:focus { - opacity:1; - text-decoration:none; - } - } - - .deck-status { - font-size:0.6666em; - } - - &.deck-menu { - .slide { - background:transparent; - @include border-radius(5px); - - .rgba & { - background:rgba(0,0,0,.1); - } - - &.deck-current, .rgba &.deck-current, .no-touch &:hover { - background:#fff; - } - } - } - - .goto-form { - background:#fff; - border:1px solid #cde; - @include border-radius(5px); - - .boxshadow & { - -webkit-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - -moz-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - } - } -} - - diff --git a/src/deck.js/themes/transition/fade.css b/src/deck.js/themes/transition/fade.css deleted file mode 100755 index f3793f3..0000000 --- a/src/deck.js/themes/transition/fade.css +++ /dev/null @@ -1,44 +0,0 @@ -.csstransitions.csstransforms .deck-container .slide { - -webkit-transition: opacity 500ms ease-in-out 0ms; - -moz-transition: opacity 500ms ease-in-out 0ms; - -ms-transition: opacity 500ms ease-in-out 0ms; - -o-transition: opacity 500ms ease-in-out 0ms; - transition: opacity 500ms ease-in-out 0ms; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide { - position: absolute; - top: 0; - left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - width: 100%; - padding: 0 48px; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide { - position: relative; - left: 0; - top: 0; - opacity: 0; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-before, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-previous { - opacity: 0.4; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-current { - opacity: 1; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after { - opacity: 0; - pointer-events: none; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide { - visibility: visible; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current { - opacity: 1; - visibility: visible; - pointer-events: auto; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current .deck-after { - visibility: hidden; -} diff --git a/src/deck.js/themes/transition/fade.scss b/src/deck.js/themes/transition/fade.scss deleted file mode 100755 index c5af7e7..0000000 --- a/src/deck.js/themes/transition/fade.scss +++ /dev/null @@ -1,70 +0,0 @@ -@mixin translate($x: 0, $y: 0, $z: 0) { - -webkit-transform:translate3d($x, $y, $z); - -moz-transform:translate($x, $y); - -ms-transform:translate($x, $y); - -o-transform:translate($x, $y); - transform:translate3d($x, $y, $z); -} - -@mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) { - -webkit-transition:$prop $duration $easing $delay; - -moz-transition:$prop $duration $easing $delay; - -ms-transition:$prop $duration $easing $delay; - -o-transition:$prop $duration $easing $delay; - transition:$prop $duration $easing $delay; -} - -.csstransitions.csstransforms { - .deck-container .slide { - @include transition(opacity, 500ms); - } - - .deck-container:not(.deck-menu) { - > .slide { - position:absolute; - top:0; - left:0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - width:100%; - padding:0 48px; - - .slide { - position:relative; - left:0; - top:0; - opacity:0; - } - - .deck-before, .deck-previous { - opacity:0.4; - } - - .deck-current { - opacity:1; - } - } - - > .deck-previous, > .deck-before, > .deck-next, > .deck-after { - opacity:0; - pointer-events:none; - } - - > .deck-before, > .deck-previous { - .slide { - visibility:visible; - } - } - - > .deck-child-current { - opacity:1; - visibility:visible; - pointer-events:auto; - - .deck-next, .deck-after { - visibility:hidden; - } - } - } -} diff --git a/src/deck.js/themes/transition/horizontal-slide.css b/src/deck.js/themes/transition/horizontal-slide.css deleted file mode 100755 index a768d61..0000000 --- a/src/deck.js/themes/transition/horizontal-slide.css +++ /dev/null @@ -1,79 +0,0 @@ -.csstransitions.csstransforms { - overflow-x: hidden; -} -.csstransitions.csstransforms .deck-container > .slide { - -webkit-transition: -webkit-transform 500ms ease-in-out; - -moz-transition: -moz-transform 500ms ease-in-out; - -ms-transition: -ms-transform 500ms ease-in-out; - -o-transition: -o-transform 500ms ease-in-out; - transition: transform 500ms ease-in-out; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide { - position: absolute; - top: 0; - left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - width: 100%; - padding: 0 48px; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide { - position: relative; - left: 0; - top: 0; - -webkit-transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -moz-transition: -moz-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -ms-transition: -ms-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -o-transition: -o-transform 500ms ease-in-out, opacity 500ms ease-in-out; - transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after { - visibility: visible; - -webkit-transform: translate3d(200%, 0, 0); - -moz-transform: translate(200%, 0); - -ms-transform: translate(200%, 0); - -o-transform: translate(200%, 0); - transform: translate3d(200%, 0, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-before, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-previous { - opacity: 0.4; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous { - -webkit-transform: translate3d(-200%, 0, 0); - -moz-transform: translate(-200%, 0); - -ms-transform: translate(-200%, 0); - -o-transform: translate(-200%, 0); - transform: translate3d(-200%, 0, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before { - -webkit-transform: translate3d(-400%, 0, 0); - -moz-transform: translate(-400%, 0); - -ms-transform: translate(-400%, 0); - -o-transform: translate(-400%, 0); - transform: translate3d(-400%, 0, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next { - -webkit-transform: translate3d(200%, 0, 0); - -moz-transform: translate(200%, 0); - -ms-transform: translate(200%, 0); - -o-transform: translate(200%, 0); - transform: translate3d(200%, 0, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after { - -webkit-transform: translate3d(400%, 0, 0); - -moz-transform: translate(400%, 0); - -ms-transform: translate(400%, 0); - -o-transform: translate(400%, 0); - transform: translate3d(400%, 0, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide { - visibility: visible; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current { - -webkit-transform: none; - -moz-transform: none; - -ms-transform: none; - -o-transform: none; - transform: none; -} diff --git a/src/deck.js/themes/transition/horizontal-slide.scss b/src/deck.js/themes/transition/horizontal-slide.scss deleted file mode 100755 index 90a30a0..0000000 --- a/src/deck.js/themes/transition/horizontal-slide.scss +++ /dev/null @@ -1,94 +0,0 @@ -@mixin translate($x: 0, $y: 0, $z: 0) { - -webkit-transform:translate3d($x, $y, $z); - -moz-transform:translate($x, $y); - -ms-transform:translate($x, $y); - -o-transform:translate($x, $y); - transform:translate3d($x, $y, $z); -} - -@mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) { - -webkit-transition:$prop $duration $easing $delay; - -moz-transition:$prop $duration $easing $delay; - -ms-transition:$prop $duration $easing $delay; - -o-transition:$prop $duration $easing $delay; - transition:$prop $duration $easing $delay; -} - -@mixin transform($val) { - -webkit-transform:$val; - -moz-transform:$val; - -ms-transform:$val; - -o-transform:$val; - transform:$val; -} - -.csstransitions.csstransforms { - overflow-x:hidden; - - .deck-container > .slide { - -webkit-transition:-webkit-transform 500ms ease-in-out; - -moz-transition:-moz-transform 500ms ease-in-out; - -ms-transition:-ms-transform 500ms ease-in-out; - -o-transition:-o-transform 500ms ease-in-out; - transition:transform 500ms ease-in-out; - } - - .deck-container:not(.deck-menu) { - > .slide { - position:absolute; - top:0; - left:0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - width:100%; - padding:0 48px; - - .slide { - position:relative; - left:0; - top:0; - -webkit-transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -moz-transition:-moz-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -ms-transition:-ms-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -o-transition:-o-transform 500ms ease-in-out, opacity 500ms ease-in-out; - transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; - } - - .deck-next, .deck-after { - visibility:visible; - @include translate(200%); - } - - .deck-before, .deck-previous { - opacity:0.4; - } - } - - > .deck-previous { - @include translate(-200%); - } - - > .deck-before { - @include translate(-400%); - } - - > .deck-next { - @include translate(200%); - } - - > .deck-after { - @include translate(400%); - } - - > .deck-before, > .deck-previous { - .slide { - visibility:visible; - } - } - - > .deck-child-current { - @include transform(none); - } - } -} \ No newline at end of file diff --git a/src/deck.js/themes/transition/vertical-slide.css b/src/deck.js/themes/transition/vertical-slide.css deleted file mode 100755 index f9c02ec..0000000 --- a/src/deck.js/themes/transition/vertical-slide.css +++ /dev/null @@ -1,97 +0,0 @@ -.csstransitions.csstransforms .deck-container { - overflow-y: hidden; -} -.csstransitions.csstransforms .deck-container > .slide { - -webkit-transition: -webkit-transform 500ms ease-in-out; - -moz-transition: -moz-transform 500ms ease-in-out; - -ms-transition: -ms-transform 500ms ease-in-out; - -o-transition: -o-transform 500ms ease-in-out; - transition: transform 500ms ease-in-out; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide { - position: absolute; - top: 0; - left: 0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - width: 100%; - padding: 0 48px; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .slide { - position: relative; - left: 0; - top: 0; - -webkit-transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -moz-transition: -moz-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -ms-transition: -ms-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -o-transition: -o-transform 500ms ease-in-out, opacity 500ms ease-in-out; - transition: -webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-next, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-after { - visibility: visible; - -webkit-transform: translate3d(0, 1600px, 0); - -moz-transform: translate(0, 1600px); - -ms-transform: translate(0, 1600px); - -o-transform: translate(0, 1600px); - transform: translate3d(0, 1600px, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-before, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .slide .deck-previous { - opacity: 0.4; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous { - -webkit-transform: translate3d(0, -200%, 0); - -moz-transform: translate(0, -200%); - -ms-transform: translate(0, -200%); - -o-transform: translate(0, -200%); - transform: translate3d(0, -200%, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before { - -webkit-transform: translate3d(0, -400%, 0); - -moz-transform: translate(0, -400%); - -ms-transform: translate(0, -400%); - -o-transform: translate(0, -400%); - transform: translate3d(0, -400%, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-next { - -webkit-transform: translate3d(0, 200%, 0); - -moz-transform: translate(0, 200%); - -ms-transform: translate(0, 200%); - -o-transform: translate(0, 200%); - transform: translate3d(0, 200%, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-after { - -webkit-transform: translate3d(0, 400%, 0); - -moz-transform: translate(0, 400%); - -ms-transform: translate(0, 400%); - -o-transform: translate(0, 400%); - transform: translate3d(0, 400%, 0); -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-before .slide, .csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-previous .slide { - visibility: visible; -} -.csstransitions.csstransforms .deck-container:not(.deck-menu) > .deck-child-current { - -webkit-transform: none; - -moz-transform: none; - -ms-transform: none; - -o-transform: none; - transform: none; -} -.csstransitions.csstransforms .deck-prev-link { - left: auto; - right: 8px; - top: 59px; - -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); - -ms-transform: rotate(90deg); - -o-transform: rotate(90deg); - transform: rotate(90deg); -} -.csstransitions.csstransforms .deck-next-link { - top: 99px; - -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); - -ms-transform: rotate(90deg); - -o-transform: rotate(90deg); - transform: rotate(90deg); -} diff --git a/src/deck.js/themes/transition/vertical-slide.scss b/src/deck.js/themes/transition/vertical-slide.scss deleted file mode 100755 index 7277316..0000000 --- a/src/deck.js/themes/transition/vertical-slide.scss +++ /dev/null @@ -1,116 +0,0 @@ -@mixin translate($x: 0, $y: 0, $z: 0) { - -webkit-transform:translate3d($x, $y, $z); - -moz-transform:translate($x, $y); - -ms-transform:translate($x, $y); - -o-transform:translate($x, $y); - transform:translate3d($x, $y, $z); -} - -@mixin rotate($deg) { - -webkit-transform:rotate($deg); - -moz-transform:rotate($deg); - -ms-transform:rotate($deg); - -o-transform:rotate($deg); - transform:rotate($deg); -} - -@mixin transition($prop, $duration, $easing: ease-in-out, $delay: 0ms) { - -webkit-transition:$prop $duration $easing $delay; - -moz-transition:$prop $duration $easing $delay; - -ms-transition:$prop $duration $easing $delay; - -o-transition:$prop $duration $easing $delay; - transition:$prop $duration $easing $delay; -} - -@mixin transform($val) { - -webkit-transform:$val; - -moz-transform:$val; - -ms-transform:$val; - -o-transform:$val; - transform:$val; -} - -.csstransitions.csstransforms { - .deck-container { - overflow-y:hidden; - - > .slide { - -webkit-transition:-webkit-transform 500ms ease-in-out; - -moz-transition:-moz-transform 500ms ease-in-out; - -ms-transition:-ms-transform 500ms ease-in-out; - -o-transition:-o-transform 500ms ease-in-out; - transition:transform 500ms ease-in-out; - } - } - - .deck-container:not(.deck-menu) { - > .slide { - position:absolute; - top:0; - left:0; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - width:100%; - padding:0 48px; - - .slide { - position:relative; - left:0; - top:0; - -webkit-transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -moz-transition:-moz-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -ms-transition:-ms-transform 500ms ease-in-out, opacity 500ms ease-in-out; - -o-transition:-o-transform 500ms ease-in-out, opacity 500ms ease-in-out; - transition:-webkit-transform 500ms ease-in-out, opacity 500ms ease-in-out; - } - - .deck-next, .deck-after { - visibility:visible; - @include translate(0, 1600px); - } - - .deck-before, .deck-previous { - opacity:0.4; - } - } - - > .deck-previous { - @include translate(0, -200%); - } - - > .deck-before { - @include translate(0, -400%); - } - - > .deck-next { - @include translate(0, 200%); - } - - > .deck-after { - @include translate(0, 400%); - } - - > .deck-before, > .deck-previous { - .slide { - visibility:visible; - } - } - - > .deck-child-current { - @include transform(none); - } - } - - .deck-prev-link { - left:auto; - right:8px; - top:59px; - @include rotate(90deg); - } - - .deck-next-link { - top:99px; - @include rotate(90deg); - } -} \ No newline at end of file diff --git a/src/intro.js b/src/intro.js deleted file mode 100755 index 44a4df4..0000000 --- a/src/intro.js +++ /dev/null @@ -1,37 +0,0 @@ - -/*! - * CoderDeck v@VERSION - * http://coderdeck.com/ - * - * Copyright 2011, Cykod LLC - * Dual licensed under the MIT or GPL Version 2 licenses. - * - * Includes deck.js - * http://imakewebthings.github.com/deck.js/ - * Copyright 2011, 2011 Caleb Troughton - * Released under the MIT, BSD, and GPL Licenses. - * - * Includes codemirror - * http://codemirror.net/ - * Copyright (C) 2011 by Marijn Haverbeke - * Released under the MIT license - * - * includes jQuery Templates Plugin 1.0.0pre - * http://github.com/jquery/jquery-tmpl - * Copyright Software Freedom Conservancy, Inc. - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes jQuery and portions of jQuery build process - * http://jquery.com/ - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Inclues Prettify - * http://code.google.com/p/google-code-prettify/ - * Licensed under the Apache 2.0 license - * - * Date: - */ - diff --git a/src/jquery.min.js b/src/jquery.min.js deleted file mode 100755 index 48590ec..0000000 --- a/src/jquery.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * jQuery JavaScript Library v1.6.2 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Jun 30 14:16:56 2011 -0400 - */ -(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. -shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j -)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/src/jquery.tmpl.min.js b/src/jquery.tmpl.min.js deleted file mode 100755 index 7438b2c..0000000 --- a/src/jquery.tmpl.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * jQuery Templates Plugin 1.0.0pre - * http://github.com/jquery/jquery-tmpl - * Requires jQuery 1.4.2 - * - * Copyright Software Freedom Conservancy, Inc. - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - */ -(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(d,m,k){if(d[0]&&a.isArray(d[0])){var g=a.makeArray(arguments),h=d[0],j=h.length,i=0,f;while(i").join(">").split('"').join(""").split("'").join("'")}});a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){b={}},afterManip:function(f,b,d){var e=b.nodeType===11?a.makeArray(b.childNodes):b.nodeType===1?[b]:[];d.call(f,b);m(e);c++}});function j(e,g,f){var b,c=f?a.map(f,function(a){return typeof a==="string"?e.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+e.key+'" $2'):a:j(a,e,a._ctnt)}):e;if(g)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(f,c,e,d){b=a(e).get();m(b);if(c)b=k(c).concat(b);if(d)b=b.concat(k(d))});return b?b:k(c)}function k(c){var b=document.createElement("div");b.innerHTML=c;return a.makeArray(b.childNodes)}function o(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(m,l,k,g,b,c,d){var j=a.tmpl.tag[k],i,e,f;if(!j)throw"Unknown template tag: "+k;i=j._default||[];if(c&&!/\w$/.test(b)){b+=c;c=""}if(b){b=h(b);d=d?","+h(d)+")":c?")":"";e=c?b.indexOf(".")>-1?b+h(c):"("+b+").call($item"+d:b;f=c?e:"(typeof("+b+")==='function'?("+b+").call($item):("+b+"))"}else f=e=i.$1||"null";g=h(g);return"');"+j[l?"close":"open"].split("$notnull_1").join(b?"typeof("+b+")!=='undefined' && ("+b+")!=null":"true").split("$1a").join(f).split("$1").join(e).split("$2").join(g||i.$2||"")+"__.push('"})+"');}return __;")}function n(c,b){c._wrap=j(c,true,a.isArray(b)?b:[q.test(b)?b:a(b).html()]).join("")}function h(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(b){var a=document.createElement("div");a.appendChild(b.cloneNode(true));return a.innerHTML}function m(o){var n="_"+c,k,j,l={},e,p,h;for(e=0,p=o.length;e=0;h--)m(j[h]);m(k)}function m(j){var p,h=j,k,e,m;if(m=j.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(p=h.getAttribute(d)));if(p!==m){h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0;if(!(e=b[m])){e=f[m];e=g(e,b[h]||f[h]);e.key=++i;b[i]=e}c&&o(m)}j.removeAttribute(d)}else if(c&&(e=a.data(j,"tmplItem"))){o(e.key);b[e.key]=e;h=a.data(j.parentNode,"tmplItem");h=h?h.key:0}if(e){k=e;while(k&&k.key!=h){k.nodes.push(j);k=k.parent}delete e._ctnt;delete e._wrap;a.data(j,"tmplItem",e)}function o(a){a=a+n;e=l[a]=l[a]||g(e,b[e.parent.key+n]||e.parent)}}}function u(a,d,c,b){if(!a)return l.pop();l.push({_:a,tmpl:d,item:this,data:c,options:b})}function w(d,c,b){return a.tmpl(a.template(d),c,b,this)}function x(b,d){var c=b.options||{};c.wrapped=d;return a.tmpl(a.template(b.tmpl),b.data,c,b.item)}function v(d,c){var b=this._wrap;return a.map(a(a.isArray(b)?b.join(""):b).filter(d||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function t(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]);a(b).remove()}})(jQuery); \ No newline at end of file diff --git a/src/modernizr.js b/src/modernizr.js deleted file mode 100755 index f9e57c8..0000000 --- a/src/modernizr.js +++ /dev/null @@ -1,1116 +0,0 @@ -/*! - * Modernizr v2.0.6 - * http://www.modernizr.com - * - * Copyright (c) 2009-2011 Faruk Ates, Paul Irish, Alex Sexton - * Dual-licensed under the BSD or MIT licenses: www.modernizr.com/license/ - */ - -/* - * Modernizr tests which native CSS3 and HTML5 features are available in - * the current UA and makes the results available to you in two ways: - * as properties on a global Modernizr object, and as classes on the - * element. This information allows you to progressively enhance - * your pages with a granular level of control over the experience. - * - * Modernizr has an optional (not included) conditional resource loader - * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). - * To get a build that includes Modernizr.load(), as well as choosing - * which tests to include, go to www.modernizr.com/download/ - * - * Authors Faruk Ates, Paul Irish, Alex Sexton, - * Contributors Ryan Seddon, Ben Alman - */ - -window.Modernizr = (function( window, document, undefined ) { - - var version = '2.0.6', - - Modernizr = {}, - - // option for enabling the HTML classes to be added - enableClasses = true, - - docElement = document.documentElement, - docHead = document.head || document.getElementsByTagName('head')[0], - - /** - * Create our "modernizr" element that we do most feature tests on. - */ - mod = 'modernizr', - modElem = document.createElement(mod), - mStyle = modElem.style, - - /** - * Create the input element for various Web Forms feature tests. - */ - inputElem = document.createElement('input'), - - smile = ':)', - - toString = Object.prototype.toString, - - // List of property values to set for css tests. See ticket #21 - prefixes = ' -webkit- -moz- -o- -ms- -khtml- '.split(' '), - - // Following spec is to expose vendor-specific style properties as: - // elem.style.WebkitBorderRadius - // and the following would be incorrect: - // elem.style.webkitBorderRadius - - // Webkit ghosts their properties in lowercase but Opera & Moz do not. - // Microsoft foregoes prefixes entirely <= IE8, but appears to - // use a lowercase `ms` instead of the correct `Ms` in IE9 - - // More here: http://github.com/Modernizr/Modernizr/issues/issue/21 - domPrefixes = 'Webkit Moz O ms Khtml'.split(' '), - - ns = {'svg': 'http://www.w3.org/2000/svg'}, - - tests = {}, - inputs = {}, - attrs = {}, - - classes = [], - - featureName, // used in testing loop - - - // Inject element with style element and some CSS rules - injectElementWithStyles = function( rule, callback, nodes, testnames ) { - - var style, ret, node, - div = document.createElement('div'); - - if ( parseInt(nodes, 10) ) { - // In order not to give false positives we create a node for each test - // This also allows the method to scale for unspecified uses - while ( nodes-- ) { - node = document.createElement('div'); - node.id = testnames ? testnames[nodes] : mod + (nodes + 1); - div.appendChild(node); - } - } - - // '].join(''); - div.id = mod; - div.innerHTML += style; - docElement.appendChild(div); - - ret = callback(div, rule); - div.parentNode.removeChild(div); - - return !!ret; - - }, - - - // adapted from matchMedia polyfill - // by Scott Jehl and Paul Irish - // gist.github.com/786768 - testMediaQuery = function( mq ) { - - if ( window.matchMedia ) { - return matchMedia(mq).matches; - } - - var bool; - - injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { - bool = (window.getComputedStyle ? - getComputedStyle(node, null) : - node.currentStyle)['position'] == 'absolute'; - }); - - return bool; - - }, - - - /** - * isEventSupported determines if a given element supports the given event - * function from http://yura.thinkweb2.com/isEventSupported/ - */ - isEventSupported = (function() { - - var TAGNAMES = { - 'select': 'input', 'change': 'input', - 'submit': 'form', 'reset': 'form', - 'error': 'img', 'load': 'img', 'abort': 'img' - }; - - function isEventSupported( eventName, element ) { - - element = element || document.createElement(TAGNAMES[eventName] || 'div'); - eventName = 'on' + eventName; - - // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those - var isSupported = eventName in element; - - if ( !isSupported ) { - // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element - if ( !element.setAttribute ) { - element = document.createElement('div'); - } - if ( element.setAttribute && element.removeAttribute ) { - element.setAttribute(eventName, ''); - isSupported = is(element[eventName], 'function'); - - // If property was created, "remove it" (by setting value to `undefined`) - if ( !is(element[eventName], undefined) ) { - element[eventName] = undefined; - } - element.removeAttribute(eventName); - } - } - - element = null; - return isSupported; - } - return isEventSupported; - })(); - - // hasOwnProperty shim by kangax needed for Safari 2.0 support - var _hasOwnProperty = ({}).hasOwnProperty, hasOwnProperty; - if ( !is(_hasOwnProperty, undefined) && !is(_hasOwnProperty.call, undefined) ) { - hasOwnProperty = function (object, property) { - return _hasOwnProperty.call(object, property); - }; - } - else { - hasOwnProperty = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ - return ((property in object) && is(object.constructor.prototype[property], undefined)); - }; - } - - /** - * setCss applies given styles to the Modernizr DOM node. - */ - function setCss( str ) { - mStyle.cssText = str; - } - - /** - * setCssAll extrapolates all vendor-specific css strings. - */ - function setCssAll( str1, str2 ) { - return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); - } - - /** - * is returns a boolean for if typeof obj is exactly type. - */ - function is( obj, type ) { - return typeof obj === type; - } - - /** - * contains returns a boolean for if substr is found within str. - */ - function contains( str, substr ) { - return !!~('' + str).indexOf(substr); - } - - /** - * testProps is a generic CSS / DOM property test; if a browser supports - * a certain property, it won't return undefined for it. - * A supported CSS property returns empty string when its not yet set. - */ - function testProps( props, prefixed ) { - for ( var i in props ) { - if ( mStyle[ props[i] ] !== undefined ) { - return prefixed == 'pfx' ? props[i] : true; - } - } - return false; - } - - /** - * testPropsAll tests a list of DOM properties we want to check against. - * We specify literally ALL possible (known and/or likely) properties on - * the element including the non-vendor prefixed one, for forward- - * compatibility. - */ - function testPropsAll( prop, prefixed ) { - - var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1), - props = (prop + ' ' + domPrefixes.join(ucProp + ' ') + ucProp).split(' '); - - return testProps(props, prefixed); - } - - /** - * testBundle tests a list of CSS features that require element and style injection. - * By bundling them together we can reduce the need to touch the DOM multiple times. - */ - /*>>testBundle*/ - var testBundle = (function( styles, tests ) { - var style = styles.join(''), - len = tests.length; - - injectElementWithStyles(style, function( node, rule ) { - var style = document.styleSheets[document.styleSheets.length - 1], - // IE8 will bork if you create a custom build that excludes both fontface and generatedcontent tests. - // So we check for cssRules and that there is a rule available - // More here: https://github.com/Modernizr/Modernizr/issues/288 & https://github.com/Modernizr/Modernizr/issues/293 - cssText = style.cssRules && style.cssRules[0] ? style.cssRules[0].cssText : style.cssText || "", - children = node.childNodes, hash = {}; - - while ( len-- ) { - hash[children[len].id] = children[len]; - } - - /*>>touch*/ Modernizr['touch'] = ('ontouchstart' in window) || hash['touch'].offsetTop === 9; /*>>touch*/ - /*>>csstransforms3d*/ Modernizr['csstransforms3d'] = hash['csstransforms3d'].offsetLeft === 9; /*>>csstransforms3d*/ - /*>>generatedcontent*/Modernizr['generatedcontent'] = hash['generatedcontent'].offsetHeight >= 1; /*>>generatedcontent*/ - /*>>fontface*/ Modernizr['fontface'] = /src/i.test(cssText) && - cssText.indexOf(rule.split(' ')[0]) === 0; /*>>fontface*/ - }, len, tests); - - })([ - // Pass in styles to be injected into document - /*>>fontface*/ '@font-face {font-family:"font";src:url("https://")}' /*>>fontface*/ - - /*>>touch*/ ,['@media (',prefixes.join('touch-enabled),('),mod,')', - '{#touch{top:9px;position:absolute}}'].join('') /*>>touch*/ - - /*>>csstransforms3d*/ ,['@media (',prefixes.join('transform-3d),('),mod,')', - '{#csstransforms3d{left:9px;position:absolute}}'].join('')/*>>csstransforms3d*/ - - /*>>generatedcontent*/,['#generatedcontent:after{content:"',smile,'";visibility:hidden}'].join('') /*>>generatedcontent*/ - ], - [ - /*>>fontface*/ 'fontface' /*>>fontface*/ - /*>>touch*/ ,'touch' /*>>touch*/ - /*>>csstransforms3d*/ ,'csstransforms3d' /*>>csstransforms3d*/ - /*>>generatedcontent*/,'generatedcontent' /*>>generatedcontent*/ - - ]);/*>>testBundle*/ - - - /** - * Tests - * ----- - */ - - tests['flexbox'] = function() { - /** - * setPrefixedValueCSS sets the property of a specified element - * adding vendor prefixes to the VALUE of the property. - * @param {Element} element - * @param {string} property The property name. This will not be prefixed. - * @param {string} value The value of the property. This WILL be prefixed. - * @param {string=} extra Additional CSS to append unmodified to the end of - * the CSS string. - */ - function setPrefixedValueCSS( element, property, value, extra ) { - property += ':'; - element.style.cssText = (property + prefixes.join(value + ';' + property)).slice(0, -property.length) + (extra || ''); - } - - /** - * setPrefixedPropertyCSS sets the property of a specified element - * adding vendor prefixes to the NAME of the property. - * @param {Element} element - * @param {string} property The property name. This WILL be prefixed. - * @param {string} value The value of the property. This will not be prefixed. - * @param {string=} extra Additional CSS to append unmodified to the end of - * the CSS string. - */ - function setPrefixedPropertyCSS( element, property, value, extra ) { - element.style.cssText = prefixes.join(property + ':' + value + ';') + (extra || ''); - } - - var c = document.createElement('div'), - elem = document.createElement('div'); - - setPrefixedValueCSS(c, 'display', 'box', 'width:42px;padding:0;'); - setPrefixedPropertyCSS(elem, 'box-flex', '1', 'width:10px;'); - - c.appendChild(elem); - docElement.appendChild(c); - - var ret = elem.offsetWidth === 42; - - c.removeChild(elem); - docElement.removeChild(c); - - return ret; - }; - - // On the S60 and BB Storm, getContext exists, but always returns undefined - // http://github.com/Modernizr/Modernizr/issues/issue/97/ - - tests['canvas'] = function() { - var elem = document.createElement('canvas'); - return !!(elem.getContext && elem.getContext('2d')); - }; - - tests['canvastext'] = function() { - return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); - }; - - // This WebGL test may false positive. - // But really it's quite impossible to know whether webgl will succeed until after you create the context. - // You might have hardware that can support a 100x100 webgl canvas, but will not support a 1000x1000 webgl - // canvas. So this feature inference is weak, but intentionally so. - - // It is known to false positive in FF4 with certain hardware and the iPad 2. - - tests['webgl'] = function() { - return !!window.WebGLRenderingContext; - }; - - /* - * The Modernizr.touch test only indicates if the browser supports - * touch events, which does not necessarily reflect a touchscreen - * device, as evidenced by tablets running Windows 7 or, alas, - * the Palm Pre / WebOS (touch) phones. - * - * Additionally, Chrome (desktop) used to lie about its support on this, - * but that has since been rectified: http://crbug.com/36415 - * - * We also test for Firefox 4 Multitouch Support. - * - * For more info, see: http://modernizr.github.com/Modernizr/touch.html - */ - - tests['touch'] = function() { - return Modernizr['touch']; - }; - - /** - * geolocation tests for the new Geolocation API specification. - * This test is a standards compliant-only test; for more complete - * testing, including a Google Gears fallback, please see: - * http://code.google.com/p/geo-location-javascript/ - * or view a fallback solution using google's geo API: - * http://gist.github.com/366184 - */ - tests['geolocation'] = function() { - return !!navigator.geolocation; - }; - - // Per 1.6: - // This used to be Modernizr.crosswindowmessaging but the longer - // name has been deprecated in favor of a shorter and property-matching one. - // The old API is still available in 1.6, but as of 2.0 will throw a warning, - // and in the first release thereafter disappear entirely. - tests['postmessage'] = function() { - return !!window.postMessage; - }; - - // Web SQL database detection is tricky: - - // In chrome incognito mode, openDatabase is truthy, but using it will - // throw an exception: http://crbug.com/42380 - // We can create a dummy database, but there is no way to delete it afterwards. - - // Meanwhile, Safari users can get prompted on any database creation. - // If they do, any page with Modernizr will give them a prompt: - // http://github.com/Modernizr/Modernizr/issues/closed#issue/113 - - // We have chosen to allow the Chrome incognito false positive, so that Modernizr - // doesn't litter the web with these test databases. As a developer, you'll have - // to account for this gotcha yourself. - tests['websqldatabase'] = function() { - var result = !!window.openDatabase; - /* if (result){ - try { - result = !!openDatabase( mod + "testdb", "1.0", mod + "testdb", 2e4); - } catch(e) { - } - } */ - return result; - }; - - // Vendors had inconsistent prefixing with the experimental Indexed DB: - // - Webkit's implementation is accessible through webkitIndexedDB - // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB - // For speed, we don't test the legacy (and beta-only) indexedDB - tests['indexedDB'] = function() { - for ( var i = -1, len = domPrefixes.length; ++i < len; ){ - if ( window[domPrefixes[i].toLowerCase() + 'IndexedDB'] ){ - return true; - } - } - return !!window.indexedDB; - }; - - // documentMode logic from YUI to filter out IE8 Compat Mode - // which false positives. - tests['hashchange'] = function() { - return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); - }; - - // Per 1.6: - // This used to be Modernizr.historymanagement but the longer - // name has been deprecated in favor of a shorter and property-matching one. - // The old API is still available in 1.6, but as of 2.0 will throw a warning, - // and in the first release thereafter disappear entirely. - tests['history'] = function() { - return !!(window.history && history.pushState); - }; - - tests['draganddrop'] = function() { - return isEventSupported('dragstart') && isEventSupported('drop'); - }; - - // Mozilla is targeting to land MozWebSocket for FF6 - // bugzil.la/659324 - tests['websockets'] = function() { - for ( var i = -1, len = domPrefixes.length; ++i < len; ){ - if ( window[domPrefixes[i] + 'WebSocket'] ){ - return true; - } - } - return 'WebSocket' in window; - }; - - - // http://css-tricks.com/rgba-browser-support/ - tests['rgba'] = function() { - // Set an rgba() color and check the returned value - - setCss('background-color:rgba(150,255,150,.5)'); - - return contains(mStyle.backgroundColor, 'rgba'); - }; - - tests['hsla'] = function() { - // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, - // except IE9 who retains it as hsla - - setCss('background-color:hsla(120,40%,100%,.5)'); - - return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); - }; - - tests['multiplebgs'] = function() { - // Setting multiple images AND a color on the background shorthand property - // and then querying the style.background property value for the number of - // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! - - setCss('background:url(https://),url(https://),red url(https://)'); - - // If the UA supports multiple backgrounds, there should be three occurrences - // of the string "url(" in the return value for elemStyle.background - - return /(url\s*\(.*?){3}/.test(mStyle.background); - }; - - - // In testing support for a given CSS property, it's legit to test: - // `elem.style[styleName] !== undefined` - // If the property is supported it will return an empty string, - // if unsupported it will return undefined. - - // We'll take advantage of this quick test and skip setting a style - // on our modernizr element, but instead just testing undefined vs - // empty string. - - - tests['backgroundsize'] = function() { - return testPropsAll('backgroundSize'); - }; - - tests['borderimage'] = function() { - return testPropsAll('borderImage'); - }; - - - // Super comprehensive table about all the unique implementations of - // border-radius: http://muddledramblings.com/table-of-css3-border-radius-compliance - - tests['borderradius'] = function() { - return testPropsAll('borderRadius'); - }; - - // WebOS unfortunately false positives on this test. - tests['boxshadow'] = function() { - return testPropsAll('boxShadow'); - }; - - // FF3.0 will false positive on this test - tests['textshadow'] = function() { - return document.createElement('div').style.textShadow === ''; - }; - - - tests['opacity'] = function() { - // Browsers that actually have CSS Opacity implemented have done so - // according to spec, which means their return values are within the - // range of [0.0,1.0] - including the leading zero. - - setCssAll('opacity:.55'); - - // The non-literal . in this regex is intentional: - // German Chrome returns this value as 0,55 - // https://github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 - return /^0.55$/.test(mStyle.opacity); - }; - - - tests['cssanimations'] = function() { - return testPropsAll('animationName'); - }; - - - tests['csscolumns'] = function() { - return testPropsAll('columnCount'); - }; - - - tests['cssgradients'] = function() { - /** - * For CSS Gradients syntax, please see: - * http://webkit.org/blog/175/introducing-css-gradients/ - * https://developer.mozilla.org/en/CSS/-moz-linear-gradient - * https://developer.mozilla.org/en/CSS/-moz-radial-gradient - * http://dev.w3.org/csswg/css3-images/#gradients- - */ - - var str1 = 'background-image:', - str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', - str3 = 'linear-gradient(left top,#9f9, white);'; - - setCss( - (str1 + prefixes.join(str2 + str1) + prefixes.join(str3 + str1)).slice(0, -str1.length) - ); - - return contains(mStyle.backgroundImage, 'gradient'); - }; - - - tests['cssreflections'] = function() { - return testPropsAll('boxReflect'); - }; - - - tests['csstransforms'] = function() { - return !!testProps(['transformProperty', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform']); - }; - - - tests['csstransforms3d'] = function() { - - var ret = !!testProps(['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']); - - // Webkit’s 3D transforms are passed off to the browser's own graphics renderer. - // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in - // some conditions. As a result, Webkit typically recognizes the syntax but - // will sometimes throw a false positive, thus we must do a more thorough check: - if ( ret && 'webkitPerspective' in docElement.style ) { - - // Webkit allows this media query to succeed only if the feature is enabled. - // `@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }` - ret = Modernizr['csstransforms3d']; - } - return ret; - }; - - - tests['csstransitions'] = function() { - return testPropsAll('transitionProperty'); - }; - - - /*>>fontface*/ - // @font-face detection routine by Diego Perini - // http://javascript.nwbox.com/CSSSupport/ - tests['fontface'] = function() { - return Modernizr['fontface']; - }; - /*>>fontface*/ - - // CSS generated content detection - tests['generatedcontent'] = function() { - return Modernizr['generatedcontent']; - }; - - - - // These tests evaluate support of the video/audio elements, as well as - // testing what types of content they support. - // - // We're using the Boolean constructor here, so that we can extend the value - // e.g. Modernizr.video // true - // Modernizr.video.ogg // 'probably' - // - // Codec values from : http://github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 - // thx to NielsLeenheer and zcorpan - - // Note: in FF 3.5.1 and 3.5.0, "no" was a return value instead of empty string. - // Modernizr does not normalize for that. - - tests['video'] = function() { - var elem = document.createElement('video'), - bool = false; - - // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('video/ogg; codecs="theora"'); - - // Workaround required for IE9, which doesn't report video support without audio codec specified. - // bug 599718 @ msft connect - var h264 = 'video/mp4; codecs="avc1.42E01E'; - bool.h264 = elem.canPlayType(h264 + '"') || elem.canPlayType(h264 + ', mp4a.40.2"'); - - bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"'); - } - - } catch(e) { } - - return bool; - }; - - tests['audio'] = function() { - var elem = document.createElement('audio'), - bool = false; - - try { - if ( bool = !!elem.canPlayType ) { - bool = new Boolean(bool); - bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"'); - bool.mp3 = elem.canPlayType('audio/mpeg;'); - - // Mimetypes accepted: - // https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - // http://bit.ly/iphoneoscodecs - bool.wav = elem.canPlayType('audio/wav; codecs="1"'); - bool.m4a = elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;'); - } - } catch(e) { } - - return bool; - }; - - - // Firefox has made these tests rather unfun. - - // In FF4, if disabled, window.localStorage should === null. - - // Normally, we could not test that directly and need to do a - // `('localStorage' in window) && ` test first because otherwise Firefox will - // throw http://bugzil.la/365772 if cookies are disabled - - // However, in Firefox 4 betas, if dom.storage.enabled == false, just mentioning - // the property will throw an exception. http://bugzil.la/599479 - // This looks to be fixed for FF4 Final. - - // Because we are forced to try/catch this, we'll go aggressive. - - // FWIW: IE8 Compat mode supports these features completely: - // http://www.quirksmode.org/dom/html5.html - // But IE8 doesn't support either with local files - - tests['localstorage'] = function() { - try { - return !!localStorage.getItem; - } catch(e) { - return false; - } - }; - - tests['sessionstorage'] = function() { - try { - return !!sessionStorage.getItem; - } catch(e){ - return false; - } - }; - - - tests['webworkers'] = function() { - return !!window.Worker; - }; - - - tests['applicationcache'] = function() { - return !!window.applicationCache; - }; - - - // Thanks to Erik Dahlstrom - tests['svg'] = function() { - return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; - }; - - // specifically for SVG inline in HTML, not within XHTML - // test page: paulirish.com/demo/inline-svg - tests['inlinesvg'] = function() { - var div = document.createElement('div'); - div.innerHTML = ''; - return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; - }; - - // Thanks to F1lt3r and lucideer, ticket #35 - tests['smil'] = function() { - return !!document.createElementNS && /SVG/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); - }; - - tests['svgclippaths'] = function() { - // Possibly returns a false positive in Safari 3.2? - return !!document.createElementNS && /SVG/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); - }; - - // input features and input types go directly onto the ret object, bypassing the tests loop. - // Hold this guy to execute in a moment. - function webforms() { - // Run through HTML5's new input attributes to see if the UA understands any. - // We're using f which is the element created early on - // Mike Taylr has created a comprehensive resource for testing these attributes - // when applied to all input types: - // http://miketaylr.com/code/input-type-attr.html - // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary - - // Only input placeholder is tested while textarea's placeholder is not. - // Currently Safari 4 and Opera 11 have support only for the input placeholder - // Both tests are available in feature-detects/forms-placeholder.js - Modernizr['input'] = (function( props ) { - for ( var i = 0, len = props.length; i < len; i++ ) { - attrs[ props[i] ] = !!(props[i] in inputElem); - } - return attrs; - })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); - - // Run through HTML5's new input types to see if the UA understands any. - // This is put behind the tests runloop because it doesn't return a - // true/false like all the other tests; instead, it returns an object - // containing each input type with its corresponding true/false value - - // Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/ - Modernizr['inputtypes'] = (function(props) { - - for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { - - inputElem.setAttribute('type', inputElemType = props[i]); - bool = inputElem.type !== 'text'; - - // We first check to see if the type we give it sticks.. - // If the type does, we feed it a textual value, which shouldn't be valid. - // If the value doesn't stick, we know there's input sanitization which infers a custom UI - if ( bool ) { - - inputElem.value = smile; - inputElem.style.cssText = 'position:absolute;visibility:hidden;'; - - if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { - - docElement.appendChild(inputElem); - defaultView = document.defaultView; - - // Safari 2-4 allows the smiley as a value, despite making a slider - bool = defaultView.getComputedStyle && - defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && - // Mobile android web browser has false positive, so must - // check the height to see if the widget is actually there. - (inputElem.offsetHeight !== 0); - - docElement.removeChild(inputElem); - - } else if ( /^(search|tel)$/.test(inputElemType) ){ - // Spec doesnt define any special parsing or detectable UI - // behaviors so we pass these through as true - - // Interestingly, opera fails the earlier test, so it doesn't - // even make it here. - - } else if ( /^(url|email)$/.test(inputElemType) ) { - // Real url and email support comes with prebaked validation. - bool = inputElem.checkValidity && inputElem.checkValidity() === false; - - } else if ( /^color$/.test(inputElemType) ) { - // chuck into DOM and force reflow for Opera bug in 11.00 - // github.com/Modernizr/Modernizr/issues#issue/159 - docElement.appendChild(inputElem); - docElement.offsetWidth; - bool = inputElem.value != smile; - docElement.removeChild(inputElem); - - } else { - // If the upgraded input compontent rejects the :) text, we got a winner - bool = inputElem.value != smile; - } - } - - inputs[ props[i] ] = !!bool; - } - return inputs; - })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); - } - - - // End of test definitions - // ----------------------- - - - - // Run through all tests and detect their support in the current UA. - // todo: hypothetically we could be doing an array of tests and use a basic loop here. - for ( var feature in tests ) { - if ( hasOwnProperty(tests, feature) ) { - // run the test, throw the return value into the Modernizr, - // then based on that boolean, define an appropriate className - // and push it into an array of classes we'll join later. - featureName = feature.toLowerCase(); - Modernizr[featureName] = tests[feature](); - - classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); - } - } - - // input tests need to run. - Modernizr.input || webforms(); - - - /** - * addTest allows the user to define their own feature tests - * the result will be added onto the Modernizr object, - * as well as an appropriate className set on the html element - * - * @param feature - String naming the feature - * @param test - Function returning true if feature is supported, false if not - */ - Modernizr.addTest = function ( feature, test ) { - if ( typeof feature == "object" ) { - for ( var key in feature ) { - if ( hasOwnProperty( feature, key ) ) { - Modernizr.addTest( key, feature[ key ] ); - } - } - } else { - - feature = feature.toLowerCase(); - - if ( Modernizr[feature] !== undefined ) { - // we're going to quit if you're trying to overwrite an existing test - // if we were to allow it, we'd do this: - // var re = new RegExp("\\b(no-)?" + feature + "\\b"); - // docElement.className = docElement.className.replace( re, '' ); - // but, no rly, stuff 'em. - return; - } - - test = typeof test == "boolean" ? test : !!test(); - - docElement.className += ' ' + (test ? '' : 'no-') + feature; - Modernizr[feature] = test; - - } - - return Modernizr; // allow chaining. - }; - - - // Reset modElem.cssText to nothing to reduce memory footprint. - setCss(''); - modElem = inputElem = null; - - //>>BEGIN IEPP - // Enable HTML 5 elements for styling (and printing) in IE. - if ( window.attachEvent && (function(){ var elem = document.createElement('div'); - elem.innerHTML = ''; - return elem.childNodes.length !== 1; })() ) { - - // iepp v2 by @jon_neal & afarkas : github.com/aFarkas/iepp/ - (function(win, doc) { - win.iepp = win.iepp || {}; - var iepp = win.iepp, - elems = iepp.html5elements || 'abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video', - elemsArr = elems.split('|'), - elemsArrLen = elemsArr.length, - elemRegExp = new RegExp('(^|\\s)('+elems+')', 'gi'), - tagRegExp = new RegExp('<(\/*)('+elems+')', 'gi'), - filterReg = /^\s*[\{\}]\s*$/, - ruleRegExp = new RegExp('(^|[^\\n]*?\\s)('+elems+')([^\\n]*)({[\\n\\w\\W]*?})', 'gi'), - docFrag = doc.createDocumentFragment(), - html = doc.documentElement, - head = html.firstChild, - bodyElem = doc.createElement('body'), - styleElem = doc.createElement('style'), - printMedias = /print|all/, - body; - function shim(doc) { - var a = -1; - while (++a < elemsArrLen) - // Use createElement so IE allows HTML5-named elements in a document - doc.createElement(elemsArr[a]); - } - - iepp.getCSS = function(styleSheetList, mediaType) { - if(styleSheetList+'' === undefined){return '';} - var a = -1, - len = styleSheetList.length, - styleSheet, - cssTextArr = []; - while (++a < len) { - styleSheet = styleSheetList[a]; - //currently no test for disabled/alternate stylesheets - if(styleSheet.disabled){continue;} - mediaType = styleSheet.media || mediaType; - // Get css from all non-screen stylesheets and their imports - if (printMedias.test(mediaType)) cssTextArr.push(iepp.getCSS(styleSheet.imports, mediaType), styleSheet.cssText); - //reset mediaType to all with every new *not imported* stylesheet - mediaType = 'all'; - } - return cssTextArr.join(''); - }; - - iepp.parseCSS = function(cssText) { - var cssTextArr = [], - rule; - while ((rule = ruleRegExp.exec(cssText)) != null){ - // Replace all html5 element references with iepp substitute classnames - cssTextArr.push(( (filterReg.exec(rule[1]) ? '\n' : rule[1]) +rule[2]+rule[3]).replace(elemRegExp, '$1.iepp_$2')+rule[4]); - } - return cssTextArr.join('\n'); - }; - - iepp.writeHTML = function() { - var a = -1; - body = body || doc.body; - while (++a < elemsArrLen) { - var nodeList = doc.getElementsByTagName(elemsArr[a]), - nodeListLen = nodeList.length, - b = -1; - while (++b < nodeListLen) - if (nodeList[b].className.indexOf('iepp_') < 0) - // Append iepp substitute classnames to all html5 elements - nodeList[b].className += ' iepp_'+elemsArr[a]; - } - docFrag.appendChild(body); - html.appendChild(bodyElem); - // Write iepp substitute print-safe document - bodyElem.className = body.className; - bodyElem.id = body.id; - // Replace HTML5 elements with which is print-safe and shouldn't conflict since it isn't part of html5 - bodyElem.innerHTML = body.innerHTML.replace(tagRegExp, '<$1font'); - }; - - - iepp._beforePrint = function() { - // Write iepp custom print CSS - styleElem.styleSheet.cssText = iepp.parseCSS(iepp.getCSS(doc.styleSheets, 'all')); - iepp.writeHTML(); - }; - - iepp.restoreHTML = function(){ - // Undo everything done in onbeforeprint - bodyElem.innerHTML = ''; - html.removeChild(bodyElem); - html.appendChild(body); - }; - - iepp._afterPrint = function(){ - // Undo everything done in onbeforeprint - iepp.restoreHTML(); - styleElem.styleSheet.cssText = ''; - }; - - - - // Shim the document and iepp fragment - shim(doc); - shim(docFrag); - - // - if(iepp.disablePP){return;} - - // Add iepp custom print style element - head.insertBefore(styleElem, head.firstChild); - styleElem.media = 'print'; - styleElem.className = 'iepp-printshim'; - win.attachEvent( - 'onbeforeprint', - iepp._beforePrint - ); - win.attachEvent( - 'onafterprint', - iepp._afterPrint - ); - })(window, document); - } - //>>END IEPP - - // Assign private properties to the return object with prefix - Modernizr._version = version; - - // expose these for the plugin API. Look in the source for how to join() them against your input - Modernizr._prefixes = prefixes; - Modernizr._domPrefixes = domPrefixes; - - // Modernizr.mq tests a given media query, live against the current state of the window - // A few important notes: - // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false - // * A max-width or orientation query will be evaluated against the current state, which may change later. - // * You must specify values. Eg. If you are testing support for the min-width media query use: - // Modernizr.mq('(min-width:0)') - // usage: - // Modernizr.mq('only screen and (max-width:768)') - Modernizr.mq = testMediaQuery; - - // Modernizr.hasEvent() detects support for a given event, with an optional element to test on - // Modernizr.hasEvent('gesturestart', elem) - Modernizr.hasEvent = isEventSupported; - - // Modernizr.testProp() investigates whether a given style property is recognized - // Note that the property names must be provided in the camelCase variant. - // Modernizr.testProp('pointerEvents') - Modernizr.testProp = function(prop){ - return testProps([prop]); - }; - - // Modernizr.testAllProps() investigates whether a given style property, - // or any of its vendor-prefixed variants, is recognized - // Note that the property names must be provided in the camelCase variant. - // Modernizr.testAllProps('boxSizing') - Modernizr.testAllProps = testPropsAll; - - - - // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards - // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) - Modernizr.testStyles = injectElementWithStyles; - - - // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input - // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' - - // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. - // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: - // - // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); - - // If you're trying to ascertain which transition end event to bind to, you might do something like... - // - // var transEndEventNames = { - // 'WebkitTransition' : 'webkitTransitionEnd', - // 'MozTransition' : 'transitionend', - // 'OTransition' : 'oTransitionEnd', - // 'msTransition' : 'msTransitionEnd', // maybe? - // 'transition' : 'transitionEnd' - // }, - // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; - - Modernizr.prefixed = function(prop){ - return testPropsAll(prop, 'pfx'); - }; - - - - // Remove "no-js" class from element, if it exists: - docElement.className = docElement.className.replace(/\bno-js\b/, '') - - // Add the new classes to the element. - + (enableClasses ? ' js ' + classes.join(' ') : ''); - - return Modernizr; - -})(this, this.document); diff --git a/src/prettify.js b/src/prettify.js deleted file mode 100755 index 93e5aac..0000000 --- a/src/prettify.js +++ /dev/null @@ -1,1393 +0,0 @@ - - -// Copyright (C) 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -/** - * @fileoverview - * some functions for browser-side pretty printing of code contained in html. - * - *

- * For a fairly comprehensive set of languages see the - * README - * file that came with this source. At a minimum, the lexer should work on a - * number of languages including C and friends, Java, Python, Bash, SQL, HTML, - * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk - * and a subset of Perl, but, because of commenting conventions, doesn't work on - * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class. - *

- * Usage:

    - *
  1. include this source file in an html page via - * {@code } - *
  2. define style rules. See the example page for examples. - *
  3. mark the {@code
    } and {@code } tags in your source with
    - *    {@code class=prettyprint.}
    - *    You can also use the (html deprecated) {@code } tag, but the pretty
    - *    printer needs to do more substantial DOM manipulations to support that, so
    - *    some css styles may not be preserved.
    - * </ol>
    - * That's it.  I wanted to keep the API as simple as possible, so there's no
    - * need to specify which language the code is in, but if you wish, you can add
    - * another class to the {@code <pre>} or {@code <code>} element to specify the
    - * language, as in {@code <pre class="prettyprint lang-java">}.  Any class that
    - * starts with "lang-" followed by a file extension, specifies the file type.
    - * See the "lang-*.js" files in this directory for code that implements
    - * per-language file handlers.
    - * <p>
    - * Change log:<br>
    - * cbeust, 2006/08/22
    - * <blockquote>
    - *   Java annotations (start with "@") are now captured as literals ("lit")
    - * </blockquote>
    - * @requires console
    - */
    -
    -// JSLint declarations
    -/*global console, document, navigator, setTimeout, window */
    -
    -/**
    - * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
    - * UI events.
    - * If set to {@code false}, {@code prettyPrint()} is synchronous.
    - */
    -window['PR_SHOULD_USE_CONTINUATION'] = true;
    -
    -/** the number of characters between tab columns */
    -window['PR_TAB_WIDTH'] = 8;
    -
    -/** Contains functions for creating and registering new language handlers.
    -  * @type {Object}
    -  */
    -window['PR']
    -
    -/** Pretty print a chunk of code.
    -  *
    -  * @param {string} sourceCodeHtml code as html
    -  * @return {string} code as html, but prettier
    -  */
    -  = window['prettyPrintOne']
    -/** Find all the {@code <pre>} and {@code <code>} tags in the DOM with
    -  * {@code class=prettyprint} and prettify them.
    -  * @param {Function?} opt_whenDone if specified, called when the last entry
    -  *     has been finished.
    -  */
    -  = window['prettyPrint'] = void 0;
    -
    -
    -(function () {
    -  // Keyword lists for various languages.
    -  var FLOW_CONTROL_KEYWORDS =
    -      "break continue do else for if return while ";
    -  var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
    -      "double enum extern float goto int long register short signed sizeof " +
    -      "static struct switch typedef union unsigned void volatile ";
    -  var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
    -      "new operator private protected public this throw true try typeof ";
    -  var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
    -      "concept concept_map const_cast constexpr decltype " +
    -      "dynamic_cast explicit export friend inline late_check " +
    -      "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
    -      "template typeid typename using virtual wchar_t where ";
    -  var JAVA_KEYWORDS = COMMON_KEYWORDS +
    -      "abstract boolean byte extends final finally implements import " +
    -      "instanceof null native package strictfp super synchronized throws " +
    -      "transient ";
    -  var CSHARP_KEYWORDS = JAVA_KEYWORDS +
    -      "as base by checked decimal delegate descending dynamic event " +
    -      "fixed foreach from group implicit in interface internal into is lock " +
    -      "object out override orderby params partial readonly ref sbyte sealed " +
    -      "stackalloc string select uint ulong unchecked unsafe ushort var ";
    -  var COFFEE_KEYWORDS = "all and by catch class else extends false finally " +
    -      "for if in is isnt loop new no not null of off on or return super then " +
    -      "true try unless until when while yes ";
    -  var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
    -      "debugger eval export function get null set undefined var with " +
    -      "Infinity NaN ";
    -  var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
    -      "goto if import last local my next no our print package redo require " +
    -      "sub undef unless until use wantarray while BEGIN END ";
    -  var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
    -      "elif except exec finally from global import in is lambda " +
    -      "nonlocal not or pass print raise try with yield " +
    -      "False True None ";
    -  var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
    -      " defined elsif end ensure false in module next nil not or redo rescue " +
    -      "retry self super then true undef unless until when yield BEGIN END ";
    -  var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
    -      "function in local set then until ";
    -  var ALL_KEYWORDS = (
    -      CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
    -      PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
    -
    -  // token style names.  correspond to css classes
    -  /** token style for a string literal */
    -  var PR_STRING = 'str';
    -  /** token style for a keyword */
    -  var PR_KEYWORD = 'kwd';
    -  /** token style for a comment */
    -  var PR_COMMENT = 'com';
    -  /** token style for a type */
    -  var PR_TYPE = 'typ';
    -  /** token style for a literal value.  e.g. 1, null, true. */
    -  var PR_LITERAL = 'lit';
    -  /** token style for a punctuation string. */
    -  var PR_PUNCTUATION = 'pun';
    -  /** token style for a punctuation string. */
    -  var PR_PLAIN = 'pln';
    -
    -  /** token style for an sgml tag. */
    -  var PR_TAG = 'tag';
    -  /** token style for a markup declaration such as a DOCTYPE. */
    -  var PR_DECLARATION = 'dec';
    -  /** token style for embedded source. */
    -  var PR_SOURCE = 'src';
    -  /** token style for an sgml attribute name. */
    -  var PR_ATTRIB_NAME = 'atn';
    -  /** token style for an sgml attribute value. */
    -  var PR_ATTRIB_VALUE = 'atv';
    -
    -  /**
    -   * A class that indicates a section of markup that is not code, e.g. to allow
    -   * embedding of line numbers within code listings.
    -   */
    -  var PR_NOCODE = 'nocode';
    -
    -  /** A set of tokens that can precede a regular expression literal in
    -    * javascript.
    -    * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
    -    * list, but I've removed ones that might be problematic when seen in
    -    * languages that don't support regular expression literals.
    -    *
    -    * <p>Specifically, I've removed any keywords that can't precede a regexp
    -    * literal in a syntactically legal javascript program, and I've removed the
    -    * "in" keyword since it's not a keyword in many languages, and might be used
    -    * as a count of inches.
    -    *
    -    * <p>The link a above does not accurately describe EcmaScript rules since
    -    * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
    -    * very well in practice.
    -    *
    -    * @private
    -    */
    -  var REGEXP_PRECEDER_PATTERN = function () {
    -      var preceders = [
    -          "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
    -          "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
    -          "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
    -          "<", "<<", "<<=", "<=", "=", "==", "===", ">",
    -          ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
    -          "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
    -          "||=", "~" /* handles =~ and !~ */,
    -          "break", "case", "continue", "delete",
    -          "do", "else", "finally", "instanceof",
    -          "return", "throw", "try", "typeof"
    -          ];
    -      var pattern = '(?:^^|[+-]';
    -      for (var i = 0; i < preceders.length; ++i) {
    -        pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
    -      }
    -      pattern += ')\\s*';  // matches at end, and matches empty string
    -      return pattern;
    -      // CAVEAT: this does not properly handle the case where a regular
    -      // expression immediately follows another since a regular expression may
    -      // have flags for case-sensitivity and the like.  Having regexp tokens
    -      // adjacent is not valid in any language I'm aware of, so I'm punting.
    -      // TODO: maybe style special characters inside a regexp as punctuation.
    -    }();
    -
    -  
    -  /**
    -   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
    -   * matches the union of the sets of strings matched by the input RegExp.
    -   * Since it matches globally, if the input strings have a start-of-input
    -   * anchor (/^.../), it is ignored for the purposes of unioning.
    -   * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
    -   * @return {RegExp} a global regex.
    -   */
    -  function combinePrefixPatterns(regexs) {
    -    var capturedGroupIndex = 0;
    -  
    -    var needToFoldCase = false;
    -    var ignoreCase = false;
    -    for (var i = 0, n = regexs.length; i < n; ++i) {
    -      var regex = regexs[i];
    -      if (regex.ignoreCase) {
    -        ignoreCase = true;
    -      } else if (/[a-z]/i.test(regex.source.replace(
    -                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
    -        needToFoldCase = true;
    -        ignoreCase = false;
    -        break;
    -      }
    -    }
    -  
    -    function decodeEscape(charsetPart) {
    -      if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
    -      switch (charsetPart.charAt(1)) {
    -        case 'b': return 8;
    -        case 't': return 9;
    -        case 'n': return 0xa;
    -        case 'v': return 0xb;
    -        case 'f': return 0xc;
    -        case 'r': return 0xd;
    -        case 'u': case 'x':
    -          return parseInt(charsetPart.substring(2), 16)
    -              || charsetPart.charCodeAt(1);
    -        case '0': case '1': case '2': case '3': case '4':
    -        case '5': case '6': case '7':
    -          return parseInt(charsetPart.substring(1), 8);
    -        default: return charsetPart.charCodeAt(1);
    -      }
    -    }
    -  
    -    function encodeEscape(charCode) {
    -      if (charCode < 0x20) {
    -        return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
    -      }
    -      var ch = String.fromCharCode(charCode);
    -      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
    -        ch = '\\' + ch;
    -      }
    -      return ch;
    -    }
    -  
    -    function caseFoldCharset(charSet) {
    -      var charsetParts = charSet.substring(1, charSet.length - 1).match(
    -          new RegExp(
    -              '\\\\u[0-9A-Fa-f]{4}'
    -              + '|\\\\x[0-9A-Fa-f]{2}'
    -              + '|\\\\[0-3][0-7]{0,2}'
    -              + '|\\\\[0-7]{1,2}'
    -              + '|\\\\[\\s\\S]'
    -              + '|-'
    -              + '|[^-\\\\]',
    -              'g'));
    -      var groups = [];
    -      var ranges = [];
    -      var inverse = charsetParts[0] === '^';
    -      for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
    -        var p = charsetParts[i];
    -        switch (p) {
    -          case '\\B': case '\\b':
    -          case '\\D': case '\\d':
    -          case '\\S': case '\\s':
    -          case '\\W': case '\\w':
    -            groups.push(p);
    -            continue;
    -        }
    -        var start = decodeEscape(p);
    -        var end;
    -        if (i + 2 < n && '-' === charsetParts[i + 1]) {
    -          end = decodeEscape(charsetParts[i + 2]);
    -          i += 2;
    -        } else {
    -          end = start;
    -        }
    -        ranges.push([start, end]);
    -        // If the range might intersect letters, then expand it.
    -        if (!(end < 65 || start > 122)) {
    -          if (!(end < 65 || start > 90)) {
    -            ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
    -          }
    -          if (!(end < 97 || start > 122)) {
    -            ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
    -          }
    -        }
    -      }
    -  
    -      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
    -      // -> [[1, 12], [14, 14], [16, 17]]
    -      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });
    -      var consolidatedRanges = [];
    -      var lastRange = [NaN, NaN];
    -      for (var i = 0; i < ranges.length; ++i) {
    -        var range = ranges[i];
    -        if (range[0] <= lastRange[1] + 1) {
    -          lastRange[1] = Math.max(lastRange[1], range[1]);
    -        } else {
    -          consolidatedRanges.push(lastRange = range);
    -        }
    -      }
    -  
    -      var out = ['['];
    -      if (inverse) { out.push('^'); }
    -      out.push.apply(out, groups);
    -      for (var i = 0; i < consolidatedRanges.length; ++i) {
    -        var range = consolidatedRanges[i];
    -        out.push(encodeEscape(range[0]));
    -        if (range[1] > range[0]) {
    -          if (range[1] + 1 > range[0]) { out.push('-'); }
    -          out.push(encodeEscape(range[1]));
    -        }
    -      }
    -      out.push(']');
    -      return out.join('');
    -    }
    -  
    -    function allowAnywhereFoldCaseAndRenumberGroups(regex) {
    -      // Split into character sets, escape sequences, punctuation strings
    -      // like ('(', '(?:', ')', '^'), and runs of characters that do not
    -      // include any of the above.
    -      var parts = regex.source.match(
    -          new RegExp(
    -              '(?:'
    -              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set
    -              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape
    -              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape
    -              + '|\\\\[0-9]+'  // a back-reference or octal escape
    -              + '|\\\\[^ux0-9]'  // other escape sequence
    -              + '|\\(\\?[:!=]'  // start of a non-capturing group
    -              + '|[\\(\\)\\^]'  // start/emd of a group, or line start
    -              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters
    -              + ')',
    -              'g'));
    -      var n = parts.length;
    -  
    -      // Maps captured group numbers to the number they will occupy in
    -      // the output or to -1 if that has not been determined, or to
    -      // undefined if they need not be capturing in the output.
    -      var capturedGroups = [];
    -  
    -      // Walk over and identify back references to build the capturedGroups
    -      // mapping.
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        var p = parts[i];
    -        if (p === '(') {
    -          // groups are 1-indexed, so max group index is count of '('
    -          ++groupIndex;
    -        } else if ('\\' === p.charAt(0)) {
    -          var decimalValue = +p.substring(1);
    -          if (decimalValue && decimalValue <= groupIndex) {
    -            capturedGroups[decimalValue] = -1;
    -          }
    -        }
    -      }
    -  
    -      // Renumber groups and reduce capturing groups to non-capturing groups
    -      // where possible.
    -      for (var i = 1; i < capturedGroups.length; ++i) {
    -        if (-1 === capturedGroups[i]) {
    -          capturedGroups[i] = ++capturedGroupIndex;
    -        }
    -      }
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        var p = parts[i];
    -        if (p === '(') {
    -          ++groupIndex;
    -          if (capturedGroups[groupIndex] === undefined) {
    -            parts[i] = '(?:';
    -          }
    -        } else if ('\\' === p.charAt(0)) {
    -          var decimalValue = +p.substring(1);
    -          if (decimalValue && decimalValue <= groupIndex) {
    -            parts[i] = '\\' + capturedGroups[groupIndex];
    -          }
    -        }
    -      }
    -  
    -      // Remove any prefix anchors so that the output will match anywhere.
    -      // ^^ really does mean an anchored match though.
    -      for (var i = 0, groupIndex = 0; i < n; ++i) {
    -        if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
    -      }
    -  
    -      // Expand letters to groups to handle mixing of case-sensitive and
    -      // case-insensitive patterns if necessary.
    -      if (regex.ignoreCase && needToFoldCase) {
    -        for (var i = 0; i < n; ++i) {
    -          var p = parts[i];
    -          var ch0 = p.charAt(0);
    -          if (p.length >= 2 && ch0 === '[') {
    -            parts[i] = caseFoldCharset(p);
    -          } else if (ch0 !== '\\') {
    -            // TODO: handle letters in numeric escapes.
    -            parts[i] = p.replace(
    -                /[a-zA-Z]/g,
    -                function (ch) {
    -                  var cc = ch.charCodeAt(0);
    -                  return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
    -                });
    -          }
    -        }
    -      }
    -  
    -      return parts.join('');
    -    }
    -  
    -    var rewritten = [];
    -    for (var i = 0, n = regexs.length; i < n; ++i) {
    -      var regex = regexs[i];
    -      if (regex.global || regex.multiline) { throw new Error('' + regex); }
    -      rewritten.push(
    -          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
    -    }
    -  
    -    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
    -  }
    -
    -
    -  /**
    -   * Split markup into a string of source code and an array mapping ranges in
    -   * that string to the text nodes in which they appear.
    -   *
    -   * <p>
    -   * The HTML DOM structure:</p>
    -   * <pre>
    -   * (Element   "p"
    -   *   (Element "b"
    -   *     (Text  "print "))       ; #1
    -   *   (Text    "'Hello '")      ; #2
    -   *   (Element "br")            ; #3
    -   *   (Text    "  + 'World';")) ; #4
    -   * </pre>
    -   * <p>
    -   * corresponds to the HTML
    -   * {@code <p><b>print </b>'Hello '<br>  + 'World';</p>}.</p>
    -   *
    -   * <p>
    -   * It will produce the output:</p>
    -   * <pre>
    -   * {
    -   *   source: "print 'Hello '\n  + 'World';",
    -   *   //                 1         2
    -   *   //       012345678901234 5678901234567
    -   *   spans: [0, #1, 6, #2, 14, #3, 15, #4]
    -   * }
    -   * </pre>
    -   * <p>
    -   * where #1 is a reference to the {@code "print "} text node above, and so
    -   * on for the other text nodes.
    -   * </p>
    -   *
    -   * <p>
    -   * The {@code} spans array is an array of pairs.  Even elements are the start
    -   * indices of substrings, and odd elements are the text nodes (or BR elements)
    -   * that contain the text for those substrings.
    -   * Substrings continue until the next index or the end of the source.
    -   * </p>
    -   *
    -   * @param {Node} node an HTML DOM subtree containing source-code.
    -   * @return {Object} source code and the text nodes in which they occur.
    -   */
    -  function extractSourceSpans(node) {
    -    var nocode = /(?:^|\s)nocode(?:\s|$)/;
    -  
    -    var chunks = [];
    -    var length = 0;
    -    var spans = [];
    -    var k = 0;
    -  
    -    var whitespace;
    -    if (node.currentStyle) {
    -      whitespace = node.currentStyle.whiteSpace;
    -    } else if (window.getComputedStyle) {
    -      whitespace = document.defaultView.getComputedStyle(node, null)
    -          .getPropertyValue('white-space');
    -    }
    -    var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
    -  
    -    function walk(node) {
    -      switch (node.nodeType) {
    -        case 1:  // Element
    -          if (nocode.test(node.className)) { return; }
    -          for (var child = node.firstChild; child; child = child.nextSibling) {
    -            walk(child);
    -          }
    -          var nodeName = node.nodeName;
    -          if ('BR' === nodeName || 'LI' === nodeName) {
    -            chunks[k] = '\n';
    -            spans[k << 1] = length++;
    -            spans[(k++ << 1) | 1] = node;
    -          }
    -          break;
    -        case 3: case 4:  // Text
    -          var text = node.nodeValue;
    -          if (text.length) {
    -            if (!isPreformatted) {
    -              text = text.replace(/[ \t\r\n]+/g, ' ');
    -            } else {
    -              text = text.replace(/\r\n?/g, '\n');  // Normalize newlines.
    -            }
    -            // TODO: handle tabs here?
    -            chunks[k] = text;
    -            spans[k << 1] = length;
    -            length += text.length;
    -            spans[(k++ << 1) | 1] = node;
    -          }
    -          break;
    -      }
    -    }
    -  
    -    walk(node);
    -  
    -    return {
    -      source: chunks.join('').replace(/\n$/, ''),
    -      spans: spans
    -    };
    -  }
    -
    -
    -  /**
    -   * Apply the given language handler to sourceCode and add the resulting
    -   * decorations to out.
    -   * @param {number} basePos the index of sourceCode within the chunk of source
    -   *    whose decorations are already present on out.
    -   */
    -  function appendDecorations(basePos, sourceCode, langHandler, out) {
    -    if (!sourceCode) { return; }
    -    var job = {
    -      source: sourceCode,
    -      basePos: basePos
    -    };
    -    langHandler(job);
    -    out.push.apply(out, job.decorations);
    -  }
    -
    -  /** Given triples of [style, pattern, context] returns a lexing function,
    -    * The lexing function interprets the patterns to find token boundaries and
    -    * returns a decoration list of the form
    -    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
    -    * where index_n is an index into the sourceCode, and style_n is a style
    -    * constant like PR_PLAIN.  index_n-1 <= index_n, and style_n-1 applies to
    -    * all characters in sourceCode[index_n-1:index_n].
    -    *
    -    * The stylePatterns is a list whose elements have the form
    -    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
    -    *
    -    * Style is a style constant like PR_PLAIN, or can be a string of the
    -    * form 'lang-FOO', where FOO is a language extension describing the
    -    * language of the portion of the token in $1 after pattern executes.
    -    * E.g., if style is 'lang-lisp', and group 1 contains the text
    -    * '(hello (world))', then that portion of the token will be passed to the
    -    * registered lisp handler for formatting.
    -    * The text before and after group 1 will be restyled using this decorator
    -    * so decorators should take care that this doesn't result in infinite
    -    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks
    -    * something like ['lang-js', /<[s]cript>(.+?)<\/script>/].  This may match
    -    * '<script>foo()<\/script>', which would cause the current decorator to
    -    * be called with '<script>' which would not match the same rule since
    -    * group 1 must not be empty, so it would be instead styled as PR_TAG by
    -    * the generic tag rule.  The handler registered for the 'js' extension would
    -    * then be called with 'foo()', and finally, the current decorator would
    -    * be called with '<\/script>' which would not match the original rule and
    -    * so the generic tag rule would identify it as a tag.
    -    *
    -    * Pattern must only match prefixes, and if it matches a prefix, then that
    -    * match is considered a token with the same style.
    -    *
    -    * Context is applied to the last non-whitespace, non-comment token
    -    * recognized.
    -    *
    -    * Shortcut is an optional string of characters, any of which, if the first
    -    * character, gurantee that this pattern and only this pattern matches.
    -    *
    -    * @param {Array} shortcutStylePatterns patterns that always start with
    -    *   a known character.  Must have a shortcut string.
    -    * @param {Array} fallthroughStylePatterns patterns that will be tried in
    -    *   order if the shortcut ones fail.  May have shortcuts.
    -    *
    -    * @return {function (Object)} a
    -    *   function that takes source code and returns a list of decorations.
    -    */
    -  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
    -    var shortcuts = {};
    -    var tokenizer;
    -    (function () {
    -      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
    -      var allRegexs = [];
    -      var regexKeys = {};
    -      for (var i = 0, n = allPatterns.length; i < n; ++i) {
    -        var patternParts = allPatterns[i];
    -        var shortcutChars = patternParts[3];
    -        if (shortcutChars) {
    -          for (var c = shortcutChars.length; --c >= 0;) {
    -            shortcuts[shortcutChars.charAt(c)] = patternParts;
    -          }
    -        }
    -        var regex = patternParts[1];
    -        var k = '' + regex;
    -        if (!regexKeys.hasOwnProperty(k)) {
    -          allRegexs.push(regex);
    -          regexKeys[k] = null;
    -        }
    -      }
    -      allRegexs.push(/[\0-\uffff]/);
    -      tokenizer = combinePrefixPatterns(allRegexs);
    -    })();
    -
    -    var nPatterns = fallthroughStylePatterns.length;
    -    var notWs = /\S/;
    -
    -    /**
    -     * Lexes job.source and produces an output array job.decorations of style
    -     * classes preceded by the position at which they start in job.source in
    -     * order.
    -     *
    -     * @param {Object} job an object like {@code
    -     *    source: {string} sourceText plain text,
    -     *    basePos: {int} position of job.source in the larger chunk of
    -     *        sourceCode.
    -     * }
    -     */
    -    var decorate = function (job) {
    -      var sourceCode = job.source, basePos = job.basePos;
    -      /** Even entries are positions in source in ascending order.  Odd enties
    -        * are style markers (e.g., PR_COMMENT) that run from that position until
    -        * the end.
    -        * @type {Array.<number|string>}
    -        */
    -      var decorations = [basePos, PR_PLAIN];
    -      var pos = 0;  // index into sourceCode
    -      var tokens = sourceCode.match(tokenizer) || [];
    -      var styleCache = {};
    -
    -      for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
    -        var token = tokens[ti];
    -        var style = styleCache[token];
    -        var match = void 0;
    -
    -        var isEmbedded;
    -        if (typeof style === 'string') {
    -          isEmbedded = false;
    -        } else {
    -          var patternParts = shortcuts[token.charAt(0)];
    -          if (patternParts) {
    -            match = token.match(patternParts[1]);
    -            style = patternParts[0];
    -          } else {
    -            for (var i = 0; i < nPatterns; ++i) {
    -              patternParts = fallthroughStylePatterns[i];
    -              match = token.match(patternParts[1]);
    -              if (match) {
    -                style = patternParts[0];
    -                break;
    -              }
    -            }
    -
    -            if (!match) {  // make sure that we make progress
    -              style = PR_PLAIN;
    -            }
    -          }
    -
    -          isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
    -          if (isEmbedded && !(match && typeof match[1] === 'string')) {
    -            isEmbedded = false;
    -            style = PR_SOURCE;
    -          }
    -
    -          if (!isEmbedded) { styleCache[token] = style; }
    -        }
    -
    -        var tokenStart = pos;
    -        pos += token.length;
    -
    -        if (!isEmbedded) {
    -          decorations.push(basePos + tokenStart, style);
    -        } else {  // Treat group 1 as an embedded block of source code.
    -          var embeddedSource = match[1];
    -          var embeddedSourceStart = token.indexOf(embeddedSource);
    -          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
    -          if (match[2]) {
    -            // If embeddedSource can be blank, then it would match at the
    -            // beginning which would cause us to infinitely recurse on the
    -            // entire token, so we catch the right context in match[2].
    -            embeddedSourceEnd = token.length - match[2].length;
    -            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
    -          }
    -          var lang = style.substring(5);
    -          // Decorate the left of the embedded source
    -          appendDecorations(
    -              basePos + tokenStart,
    -              token.substring(0, embeddedSourceStart),
    -              decorate, decorations);
    -          // Decorate the embedded source
    -          appendDecorations(
    -              basePos + tokenStart + embeddedSourceStart,
    -              embeddedSource,
    -              langHandlerForExtension(lang, embeddedSource),
    -              decorations);
    -          // Decorate the right of the embedded section
    -          appendDecorations(
    -              basePos + tokenStart + embeddedSourceEnd,
    -              token.substring(embeddedSourceEnd),
    -              decorate, decorations);
    -        }
    -      }
    -      job.decorations = decorations;
    -    };
    -    return decorate;
    -  }
    -
    -  /** returns a function that produces a list of decorations from source text.
    -    *
    -    * This code treats ", ', and ` as string delimiters, and \ as a string
    -    * escape.  It does not recognize perl's qq() style strings.
    -    * It has no special handling for double delimiter escapes as in basic, or
    -    * the tripled delimiters used in python, but should work on those regardless
    -    * although in those cases a single string literal may be broken up into
    -    * multiple adjacent string literals.
    -    *
    -    * It recognizes C, C++, and shell style comments.
    -    *
    -    * @param {Object} options a set of optional parameters.
    -    * @return {function (Object)} a function that examines the source code
    -    *     in the input job and builds the decoration list.
    -    */
    -  function sourceDecorator(options) {
    -    var shortcutStylePatterns = [], fallthroughStylePatterns = [];
    -    if (options['tripleQuotedStrings']) {
    -      // '''multi-line-string''', 'single-line-string', and double-quoted
    -      shortcutStylePatterns.push(
    -          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
    -           null, '\'"']);
    -    } else if (options['multiLineStrings']) {
    -      // 'multi-line-string', "multi-line-string"
    -      shortcutStylePatterns.push(
    -          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
    -           null, '\'"`']);
    -    } else {
    -      // 'single-line-string', "single-line-string"
    -      shortcutStylePatterns.push(
    -          [PR_STRING,
    -           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
    -           null, '"\'']);
    -    }
    -    if (options['verbatimStrings']) {
    -      // verbatim-string-literal production from the C# grammar.  See issue 93.
    -      fallthroughStylePatterns.push(
    -          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
    -    }
    -    var hc = options['hashComments'];
    -    if (hc) {
    -      if (options['cStyleComments']) {
    -        if (hc > 1) {  // multiline hash comments
    -          shortcutStylePatterns.push(
    -              [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
    -        } else {
    -          // Stop C preprocessor declarations at an unclosed open comment
    -          shortcutStylePatterns.push(
    -              [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
    -               null, '#']);
    -        }
    -        fallthroughStylePatterns.push(
    -            [PR_STRING,
    -             /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
    -             null]);
    -      } else {
    -        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
    -      }
    -    }
    -    if (options['cStyleComments']) {
    -      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
    -      fallthroughStylePatterns.push(
    -          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
    -    }
    -    if (options['regexLiterals']) {
    -      var REGEX_LITERAL = (
    -          // A regular expression literal starts with a slash that is
    -          // not followed by * or / so that it is not confused with
    -          // comments.
    -          '/(?=[^/*])'
    -          // and then contains any number of raw characters,
    -          + '(?:[^/\\x5B\\x5C]'
    -          // escape sequences (\x5C),
    -          +    '|\\x5C[\\s\\S]'
    -          // or non-nesting character sets (\x5B\x5D);
    -          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
    -          // finally closed by a /.
    -          + '/');
    -      fallthroughStylePatterns.push(
    -          ['lang-regex',
    -           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
    -           ]);
    -    }
    -
    -    var keywords = options['keywords'].replace(/^\s+|\s+$/g, '');
    -    if (keywords.length) {
    -      fallthroughStylePatterns.push(
    -          [PR_KEYWORD,
    -           new RegExp('^(?:' + keywords.replace(/\s+/g, '|') + ')\\b'), null]);
    -    }
    -
    -    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);
    -    fallthroughStylePatterns.push(
    -        // TODO(mikesamuel): recognize non-latin letters and numerals in idents
    -        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],
    -        [PR_TYPE,        /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null],
    -        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],
    -        [PR_LITERAL,
    -         new RegExp(
    -             '^(?:'
    -             // A hex number
    -             + '0x[a-f0-9]+'
    -             // or an octal or decimal number,
    -             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
    -             // possibly in scientific notation
    -             + '(?:e[+\\-]?\\d+)?'
    -             + ')'
    -             // with an optional modifier like UL for unsigned long
    -             + '[a-z]*', 'i'),
    -         null, '0123456789'],
    -        // Don't treat escaped quotes in bash as starting strings.  See issue 144.
    -        [PR_PLAIN,       /^\\[\s\S]?/, null],
    -        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]);
    -
    -    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
    -  }
    -
    -  var decorateSource = sourceDecorator({
    -        'keywords': ALL_KEYWORDS,
    -        'hashComments': true,
    -        'cStyleComments': true,
    -        'multiLineStrings': true,
    -        'regexLiterals': true
    -      });
    -
    -  /**
    -   * Given a DOM subtree, wraps it in a list, and puts each line into its own
    -   * list item.
    -   *
    -   * @param {Node} node modified in place.  Its content is pulled into an
    -   *     HTMLOListElement, and each line is moved into a separate list item.
    -   *     This requires cloning elements, so the input might not have unique
    -   *     IDs after numbering.
    -   */
    -  function numberLines(node, opt_startLineNum) {
    -    var nocode = /(?:^|\s)nocode(?:\s|$)/;
    -    var lineBreak = /\r\n?|\n/;
    -  
    -    var document = node.ownerDocument;
    -  
    -    var whitespace;
    -    if (node.currentStyle) {
    -      whitespace = node.currentStyle.whiteSpace;
    -    } else if (window.getComputedStyle) {
    -      whitespace = document.defaultView.getComputedStyle(node, null)
    -          .getPropertyValue('white-space');
    -    }
    -    // If it's preformatted, then we need to split lines on line breaks
    -    // in addition to <BR>s.
    -    var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
    -  
    -    var li = document.createElement('LI');
    -    while (node.firstChild) {
    -      li.appendChild(node.firstChild);
    -    }
    -    // An array of lines.  We split below, so this is initialized to one
    -    // un-split line.
    -    var listItems = [li];
    -  
    -    function walk(node) {
    -      switch (node.nodeType) {
    -        case 1:  // Element
    -          if (nocode.test(node.className)) { break; }
    -          if ('BR' === node.nodeName) {
    -            breakAfter(node);
    -            // Discard the <BR> since it is now flush against a </LI>.
    -            if (node.parentNode) {
    -              node.parentNode.removeChild(node);
    -            }
    -          } else {
    -            for (var child = node.firstChild; child; child = child.nextSibling) {
    -              walk(child);
    -            }
    -          }
    -          break;
    -        case 3: case 4:  // Text
    -          if (isPreformatted) {
    -            var text = node.nodeValue;
    -            var match = text.match(lineBreak);
    -            if (match) {
    -              var firstLine = text.substring(0, match.index);
    -              node.nodeValue = firstLine;
    -              var tail = text.substring(match.index + match[0].length);
    -              if (tail) {
    -                var parent = node.parentNode;
    -                parent.insertBefore(
    -                    document.createTextNode(tail), node.nextSibling);
    -              }
    -              breakAfter(node);
    -              if (!firstLine) {
    -                // Don't leave blank text nodes in the DOM.
    -                node.parentNode.removeChild(node);
    -              }
    -            }
    -          }
    -          break;
    -      }
    -    }
    -  
    -    // Split a line after the given node.
    -    function breakAfter(lineEndNode) {
    -      // If there's nothing to the right, then we can skip ending the line
    -      // here, and move root-wards since splitting just before an end-tag
    -      // would require us to create a bunch of empty copies.
    -      while (!lineEndNode.nextSibling) {
    -        lineEndNode = lineEndNode.parentNode;
    -        if (!lineEndNode) { return; }
    -      }
    -  
    -      function breakLeftOf(limit, copy) {
    -        // Clone shallowly if this node needs to be on both sides of the break.
    -        var rightSide = copy ? limit.cloneNode(false) : limit;
    -        var parent = limit.parentNode;
    -        if (parent) {
    -          // We clone the parent chain.
    -          // This helps us resurrect important styling elements that cross lines.
    -          // E.g. in <i>Foo<br>Bar</i>
    -          // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
    -          var parentClone = breakLeftOf(parent, 1);
    -          // Move the clone and everything to the right of the original
    -          // onto the cloned parent.
    -          var next = limit.nextSibling;
    -          parentClone.appendChild(rightSide);
    -          for (var sibling = next; sibling; sibling = next) {
    -            next = sibling.nextSibling;
    -            parentClone.appendChild(sibling);
    -          }
    -        }
    -        return rightSide;
    -      }
    -  
    -      var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
    -  
    -      // Walk the parent chain until we reach an unattached LI.
    -      for (var parent;
    -           // Check nodeType since IE invents document fragments.
    -           (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
    -        copiedListItem = parent;
    -      }
    -      // Put it on the list of lines for later processing.
    -      listItems.push(copiedListItem);
    -    }
    -  
    -    // Split lines while there are lines left to split.
    -    for (var i = 0;  // Number of lines that have been split so far.
    -         i < listItems.length;  // length updated by breakAfter calls.
    -         ++i) {
    -      walk(listItems[i]);
    -    }
    -  
    -    // Make sure numeric indices show correctly.
    -    if (opt_startLineNum === (opt_startLineNum|0)) {
    -      listItems[0].setAttribute('value', opt_startLineNum);
    -    }
    -  
    -    var ol = document.createElement('OL');
    -    ol.className = 'linenums';
    -    var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
    -    for (var i = 0, n = listItems.length; i < n; ++i) {
    -      li = listItems[i];
    -      // Stick a class on the LIs so that stylesheets can
    -      // color odd/even rows, or any other row pattern that
    -      // is co-prime with 10.
    -      li.className = 'L' + ((i + offset) % 10);
    -      if (!li.firstChild) {
    -        li.appendChild(document.createTextNode('\xA0'));
    -      }
    -      ol.appendChild(li);
    -    }
    -  
    -    node.appendChild(ol);
    -  }
    -
    -  /**
    -   * Breaks {@code job.source} around style boundaries in {@code job.decorations}
    -   * and modifies {@code job.sourceNode} in place.
    -   * @param {Object} job like <pre>{
    -   *    source: {string} source as plain text,
    -   *    spans: {Array.<number|Node>} alternating span start indices into source
    -   *       and the text node or element (e.g. {@code <BR>}) corresponding to that
    -   *       span.
    -   *    decorations: {Array.<number|string} an array of style classes preceded
    -   *       by the position at which they start in job.source in order
    -   * }</pre>
    -   * @private
    -   */
    -  function recombineTagsAndDecorations(job) {
    -    var isIE = /\bMSIE\b/.test(navigator.userAgent);
    -    var newlineRe = /\n/g;
    -  
    -    var source = job.source;
    -    var sourceLength = source.length;
    -    // Index into source after the last code-unit recombined.
    -    var sourceIndex = 0;
    -  
    -    var spans = job.spans;
    -    var nSpans = spans.length;
    -    // Index into spans after the last span which ends at or before sourceIndex.
    -    var spanIndex = 0;
    -  
    -    var decorations = job.decorations;
    -    var nDecorations = decorations.length;
    -    // Index into decorations after the last decoration which ends at or before sourceIndex.
    -    var decorationIndex = 0;
    -  
    -    // Simplify decorations.
    -    var decPos = 0;
    -    for (var i = 0; i < nDecorations;) {
    -      // Skip over any zero-length decorations.
    -      var startPos = decorations[i];
    -      var start = i;
    -      while (start + 2 < nDecorations && decorations[start + 2] === startPos) {
    -        start += 2;
    -      }
    -      // Conflate all adjacent decorations that use the same style.
    -      var startDec = decorations[start + 1];
    -      var end = start + 2;
    -      while (end + 2 <= nDecorations
    -             && (decorations[end + 1] === startDec
    -                 || decorations[end] === decorations[end + 2])) {
    -        end += 2;
    -      }
    -      decorations[decPos++] = startPos;
    -      decorations[decPos++] = startDec;
    -      i = end;
    -    }
    -  
    -    // Strip any zero-length decoration at the end.
    -    if (decPos && decorations[decPos - 2] === sourceLength) { decPos -= 2; }
    -    nDecorations = decorations.length = decPos;
    -  
    -    var decoration = null;
    -    while (spanIndex < nSpans) {
    -      var spanStart = spans[spanIndex];
    -      var spanEnd = spans[spanIndex + 2] || sourceLength;
    -  
    -      var decStart = decorations[decorationIndex];
    -      var decEnd = decorations[decorationIndex + 2] || sourceLength;
    -  
    -      var end = Math.min(spanEnd, decEnd);
    -  
    -      var textNode = spans[spanIndex + 1];
    -      if (textNode.nodeType !== 1) {  // Don't muck with <BR>s or <LI>s
    -        var styledText = source.substring(sourceIndex, end);
    -        // This may seem bizarre, and it is.  Emitting LF on IE causes the
    -        // code to display with spaces instead of line breaks.
    -        // Emitting Windows standard issue linebreaks (CRLF) causes a blank
    -        // space to appear at the beginning of every line but the first.
    -        // Emitting an old Mac OS 9 line separator makes everything spiffy.
    -        if (isIE) { styledText = styledText.replace(newlineRe, '\r'); }
    -        textNode.nodeValue = styledText;
    -        var document = textNode.ownerDocument;
    -        var span = document.createElement('SPAN');
    -        span.className = decorations[decorationIndex + 1];
    -        var parentNode = textNode.parentNode;
    -        parentNode.replaceChild(span, textNode);
    -        span.appendChild(textNode);
    -        if (sourceIndex < spanEnd) {  // Split off a text node.
    -          spans[spanIndex + 1] = textNode
    -              // TODO: Possibly optimize by using '' if there's no flicker.
    -              = document.createTextNode(source.substring(end, spanEnd));
    -          parentNode.insertBefore(textNode, span.nextSibling);
    -        }
    -      }
    -  
    -      sourceIndex = end;
    -  
    -      if (sourceIndex >= spanEnd) {
    -        spanIndex += 2;
    -      }
    -      if (sourceIndex >= decEnd) {
    -        decorationIndex += 2;
    -      }
    -    }
    -  }
    -
    -
    -  /** Maps language-specific file extensions to handlers. */
    -  var langHandlerRegistry = {};
    -  /** Register a language handler for the given file extensions.
    -    * @param {function (Object)} handler a function from source code to a list
    -    *      of decorations.  Takes a single argument job which describes the
    -    *      state of the computation.   The single parameter has the form
    -    *      {@code {
    -    *        source: {string} as plain text.
    -    *        decorations: {Array.<number|string>} an array of style classes
    -    *                     preceded by the position at which they start in
    -    *                     job.source in order.
    -    *                     The language handler should assigned this field.
    -    *        basePos: {int} the position of source in the larger source chunk.
    -    *                 All positions in the output decorations array are relative
    -    *                 to the larger source chunk.
    -    *      } }
    -    * @param {Array.<string>} fileExtensions
    -    */
    -  function registerLangHandler(handler, fileExtensions) {
    -    for (var i = fileExtensions.length; --i >= 0;) {
    -      var ext = fileExtensions[i];
    -      if (!langHandlerRegistry.hasOwnProperty(ext)) {
    -        langHandlerRegistry[ext] = handler;
    -      } else if ('console' in window) {
    -        console['warn']('cannot override language handler %s', ext);
    -      }
    -    }
    -  }
    -  function langHandlerForExtension(extension, source) {
    -    if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
    -      // Treat it as markup if the first non whitespace character is a < and
    -      // the last non-whitespace character is a >.
    -      extension = /^\s*</.test(source)
    -          ? 'default-markup'
    -          : 'default-code';
    -    }
    -    return langHandlerRegistry[extension];
    -  }
    -  registerLangHandler(decorateSource, ['default-code']);
    -  registerLangHandler(
    -      createSimpleLexer(
    -          [],
    -          [
    -           [PR_PLAIN,       /^[^<?]+/],
    -           [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
    -           [PR_COMMENT,     /^<\!--[\s\S]*?(?:-\->|$)/],
    -           // Unescaped content in an unknown language
    -           ['lang-',        /^<\?([\s\S]+?)(?:\?>|$)/],
    -           ['lang-',        /^<%([\s\S]+?)(?:%>|$)/],
    -           [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
    -           ['lang-',        /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
    -           // Unescaped content in javascript.  (Or possibly vbscript).
    -           ['lang-js',      /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
    -           // Contains unescaped stylesheet content
    -           ['lang-css',     /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
    -           ['lang-in.tag',  /^(<\/?[a-z][^<>]*>)/i]
    -          ]),
    -      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
    -  registerLangHandler(
    -      createSimpleLexer(
    -          [
    -           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],
    -           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
    -           ],
    -          [
    -           [PR_TAG,          /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
    -           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
    -           ['lang-uq.val',   /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
    -           [PR_PUNCTUATION,  /^[=<>\/]+/],
    -           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],
    -           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],
    -           ['lang-js',       /^on\w+\s*=\s*([^\"\'>\s]+)/i],
    -           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],
    -           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],
    -           ['lang-css',      /^style\s*=\s*([^\"\'>\s]+)/i]
    -           ]),
    -      ['in.tag']);
    -  registerLangHandler(
    -      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': CPP_KEYWORDS,
    -          'hashComments': true,
    -          'cStyleComments': true
    -        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': 'null true false'
    -        }), ['json']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': CSHARP_KEYWORDS,
    -          'hashComments': true,
    -          'cStyleComments': true,
    -          'verbatimStrings': true
    -        }), ['cs']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': JAVA_KEYWORDS,
    -          'cStyleComments': true
    -        }), ['java']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': SH_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true
    -        }), ['bsh', 'csh', 'sh']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': PYTHON_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'tripleQuotedStrings': true
    -        }), ['cv', 'py']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': PERL_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'regexLiterals': true
    -        }), ['perl', 'pl', 'pm']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': RUBY_KEYWORDS,
    -          'hashComments': true,
    -          'multiLineStrings': true,
    -          'regexLiterals': true
    -        }), ['rb']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': JSCRIPT_KEYWORDS,
    -          'cStyleComments': true,
    -          'regexLiterals': true
    -        }), ['js']);
    -  registerLangHandler(sourceDecorator({
    -          'keywords': COFFEE_KEYWORDS,
    -          'hashComments': 3,  // ### style block comments
    -          'cStyleComments': true,
    -          'multilineStrings': true,
    -          'tripleQuotedStrings': true,
    -          'regexLiterals': true
    -        }), ['coffee']);
    -  registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
    -
    -  function applyDecorator(job) {
    -    var opt_langExtension = job.langExtension;
    -
    -    try {
    -      // Extract tags, and convert the source code to plain text.
    -      var sourceAndSpans = extractSourceSpans(job.sourceNode);
    -      /** Plain text. @type {string} */
    -      var source = sourceAndSpans.source;
    -      job.source = source;
    -      job.spans = sourceAndSpans.spans;
    -      job.basePos = 0;
    -
    -      // Apply the appropriate language handler
    -      langHandlerForExtension(opt_langExtension, source)(job);
    -
    -      // Integrate the decorations and tags back into the source code,
    -      // modifying the sourceNode in place.
    -      recombineTagsAndDecorations(job);
    -    } catch (e) {
    -      if ('console' in window) {
    -        console['log'](e && e['stack'] ? e['stack'] : e);
    -      }
    -    }
    -  }
    -
    -  /**
    -   * @param sourceCodeHtml {string} The HTML to pretty print.
    -   * @param opt_langExtension {string} The language name to use.
    -   *     Typically, a filename extension like 'cpp' or 'java'.
    -   * @param opt_numberLines {number|boolean} True to number lines,
    -   *     or the 1-indexed number of the first line in sourceCodeHtml.
    -   */
    -  function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
    -    var container = document.createElement('PRE');
    -    // This could cause images to load and onload listeners to fire.
    -    // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
    -    // We assume that the inner HTML is from a trusted source.
    -    container.innerHTML = sourceCodeHtml;
    -    if (opt_numberLines) {
    -      numberLines(container, opt_numberLines);
    -    }
    -
    -    var job = {
    -      langExtension: opt_langExtension,
    -      numberLines: opt_numberLines,
    -      sourceNode: container
    -    };
    -    applyDecorator(job);
    -    return container.innerHTML;
    -  }
    -
    -  function prettyPrint(opt_whenDone) {
    -    function byTagName(tn) { return document.getElementsByTagName(tn); }
    -    // fetch a list of nodes to rewrite
    -    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
    -    var elements = [];
    -    for (var i = 0; i < codeSegments.length; ++i) {
    -      for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
    -        elements.push(codeSegments[i][j]);
    -      }
    -    }
    -    codeSegments = null;
    -
    -    var clock = Date;
    -    if (!clock['now']) {
    -      clock = { 'now': function () { return (new Date).getTime(); } };
    -    }
    -
    -    // The loop is broken into a series of continuations to make sure that we
    -    // don't make the browser unresponsive when rewriting a large page.
    -    var k = 0;
    -    var prettyPrintingJob;
    -
    -    function doWork() {
    -      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
    -                     clock.now() + 250 /* ms */ :
    -                     Infinity);
    -      for (; k < elements.length && clock.now() < endTime; k++) {
    -        var cs = elements[k];
    -        if (cs.className && cs.className.indexOf('prettyprint') >= 0) {
    -          // If the classes includes a language extensions, use it.
    -          // Language extensions can be specified like
    -          //     <pre class="prettyprint lang-cpp">
    -          // the language extension "cpp" is used to find a language handler as
    -          // passed to PR.registerLangHandler.
    -          var langExtension = cs.className.match(/\blang-(\w+)\b/);
    -          if (langExtension) { langExtension = langExtension[1]; }
    -
    -          // make sure this is not nested in an already prettified element
    -          var nested = false;
    -          for (var p = cs.parentNode; p; p = p.parentNode) {
    -            if ((p.tagName === 'pre' || p.tagName === 'code' ||
    -                 p.tagName === 'xmp') &&
    -                p.className && p.className.indexOf('prettyprint') >= 0) {
    -              nested = true;
    -              break;
    -            }
    -          }
    -          if (!nested) {
    -            // Look for a class like linenums or linenums:<n> where <n> is the
    -            // 1-indexed number of the first line.
    -            var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
    -            lineNums = lineNums
    -                  ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
    -                  : false;
    -            if (lineNums) { numberLines(cs, lineNums); }
    -
    -            // do the pretty printing
    -            prettyPrintingJob = {
    -              langExtension: langExtension,
    -              sourceNode: cs,
    -              numberLines: lineNums
    -            };
    -            applyDecorator(prettyPrintingJob);
    -          }
    -        }
    -      }
    -      if (k < elements.length) {
    -        // finish up in a continuation
    -        setTimeout(doWork, 250);
    -      } else if (opt_whenDone) {
    -        opt_whenDone();
    -      }
    -    }
    -
    -    doWork();
    -  }
    -
    -  window['prettyPrintOne'] = prettyPrintOne;
    -  window['prettyPrint'] = prettyPrint;
    -  window['PR'] = {
    -        'createSimpleLexer': createSimpleLexer,
    -        'registerLangHandler': registerLangHandler,
    -        'sourceDecorator': sourceDecorator,
    -        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
    -        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
    -        'PR_COMMENT': PR_COMMENT,
    -        'PR_DECLARATION': PR_DECLARATION,
    -        'PR_KEYWORD': PR_KEYWORD,
    -        'PR_LITERAL': PR_LITERAL,
    -        'PR_NOCODE': PR_NOCODE,
    -        'PR_PLAIN': PR_PLAIN,
    -        'PR_PUNCTUATION': PR_PUNCTUATION,
    -        'PR_SOURCE': PR_SOURCE,
    -        'PR_STRING': PR_STRING,
    -        'PR_TAG': PR_TAG,
    -        'PR_TYPE': PR_TYPE
    -      };
    -})();