diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7b2b54b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: groovy -jdk: -- oraclejdk8 -sudo: false -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/.m2/ - -before_cache: -- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock -- rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - -before_script: -- rm -rf ./html-cleaner-plugin/build -- rm -rf ./html-cleaner-test-app/build - -script: "./travis-build.sh" -env: - global: - - secure: AASox/X03PcBPKiac0NK6gkD6N8ZiRsMiD97awBoHFhZZMVM7Nn5DBnC1m5Ut4UepG/SK3jxoR3jwVqk5hEvveWIzHEuvA4L0wMTXun5596GuVZv+sjgwu+cMZbyJGB5HGa3cGHrlrKwnj1MIgHxEULooB7U8Uka3OrwXOznlz4= - - secure: UuLQ16UZJeqqgH2QQ0Hgmj8YmqAYllnqcd7nVVb6VTWggkp9i0AMl0bjn1UqxmkPo77PYkGMX3pgl3cWSnpFKhVIZ2WbRzV+lgK1A0v1w2NGkk0Cf4gU7b6/S0MPYj/C4vDC2UgWFybqsth6F4uvrUJXpehUS2TODyuiU2oJyjY= diff --git a/README.md b/README.md deleted file mode 100644 index 7cb9306..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ - - -[![Build Status](https://travis-ci.org/snimavat/html-cleaner.svg?branch=master)](https://travis-ci.org/snimavat/html-cleaner) - -See [documentation](http://snimavat.github.com/html-cleaner/guide/index.html) \ No newline at end of file diff --git a/all-docs.html b/all-docs.html new file mode 100644 index 0000000..7a5cbf7 --- /dev/null +++ b/all-docs.html @@ -0,0 +1,13 @@ + + + + html-cleaner Documentation + + + + Java API docs
+ Groovy API docs
+ Manual (Page per chapter)
+ Manual (Single page)
+ + diff --git a/css/custom.css b/css/custom.css new file mode 100644 index 0000000..0c95685 --- /dev/null +++ b/css/custom.css @@ -0,0 +1,4 @@ +/* + Dummy stylesheet allowing for some customisation without having to + copy and modify the other stylesheets. +*/ diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..22ed10e --- /dev/null +++ b/css/main.css @@ -0,0 +1,722 @@ +@import "custom.css"; +@import "tools.css"; +@import "skin.css"; + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Body & Html. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +body { + font-family: Arial; +} + +.body { + font-family: Arial; + text-align: justify; + font-size: 85%; + background: #F2F2F2; +} + +/* Monospace should be same size as other fonts: this fix was taken from + * + * http://meyerweb.com/eric/thoughts/2010/02/12/fixed-monospace-sizing/ + */ +pre, code { + font-family: "Courier New", monospace, serif; + font-size: 1em; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Html Tag. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +strong { + font-weight: bold; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Content. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +#iframe { + overflow-x: hidden; +} + +/* +//////////////////////////////////////// +// Colset. +//////////////////////////////////////// +*/ + +#colset { + width: 100%; +} + +#colset #col2, #colset #col1 { + vertical-align: top; +} + +#colset #col2 { + display: table-cell; + width: 250px; +} + +/* Required for IE6 */ +#col2 .local { width: 250px; } + +/* +//////////////////////////////////////// +// Main & Local. +//////////////////////////////////////// +*/ + +#main { + margin: 10px; + border-width: 1px; + padding: 10px 15px; + margin-bottom: 0; +} + +#main.reference h1 { + color: #7C9D00; +} + +.local { + margin-right: 10px; +} + +.local .local-title { + display: block; + padding: 6px 0; + padding-top: 10px; + margin: 0; +} + +.local .local-title a { + text-decoration: none; + font-size: 1.25em; + font-weight: bold; +} + +.local .local-title .toggle { + display: none; +} + +.js .local .local-title .toggle { + display: inline; +} + +.local .local-title .toggle, .local .local-title .toggle a { + font-size: 1.05em; + font-weight: normal; +} + +.local .local-title .toggle a:hover { + text-decoration: underline; +} + +.next-right{ + float:right; +} + +.prev-left{ + float:left; +} + +/* +//////////////////////////////////////// +// Project. +//////////////////////////////////////// +*/ + +#main .project { + clear: left; + padding-top: 10px; +} + +#main .project h1 { + padding: 0; + margin: 5px 0 8px; +} + +#main .project p { + padding: 2px 0; + margin: 0; +} + +/* +//////////////////////////////////////// +// Table of content. +//////////////////////////////////////// +*/ + + +.section-block-right{ + float:right; + clear:right; + width:50%; +} + +.section-block-left{ + float:left; + clear:left; + width:50%; +} + +.toc-item span{ + padding-left:10px; +} + +#table-of-content a { + display: block; + padding: 4px 10px; + text-decoration: none; + color: #444; +} + +#table-of-content a:hover { + text-decoration: none; + border-right: 2px solid #7c9d00; +} + +/* +//////////////////////////////////////// +// Reference menu. +//////////////////////////////////////// +*/ + +.js .menu .menu-sub { + display: none; +} +.js .menu .selected { + display: block; +} + +.menu .menu-block { + width: 210px; + padding: 0 2%; +} + +.menu .menu-block h1 { + padding: 2px 0; + cursor:pointer; + padding-top: 8px; + margin: 0; + font-size: 1.1em; + font-weight: bold; +} + +.menu .menu-sub .menu-item { + margin-left: 10px; + padding: 2px 0; + padding-left: 10px; +} + +.menu .menu-sub .menu-item:first-child { + margin-bottom: 0.3em; + margin-top: 0.3em; +} + +.menu a { + text-decoration: none; +} + + + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Navigation. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +#navigation { + border-width: 0; + border-bottom-width: 1px; +} + +#navigation ul { + margin: 0; + padding: 0; + height: 2.8em; +} + +#navigation ul li { + list-style: none; + padding: 7px 3px; + padding-left: 6px; + margin: 0; + float: left; +} + +#navigation ul li.separator { + display: none; +} + +.js #navigation ul li.separator { + display: block; +} + +#navigation a { + display: block; + padding: 0.3em 10px; + outline: none; + text-decoration: none; +} + +#nav-summary { + position: relative; + margin: 0; + padding: 0; +} + +#nav-summary #nav-summary-childs { + position: absolute; + top: 1.6em; + margin: 0; + border-width: 1px; + padding: 10px; + width: 25em; +} + +#nav-summary #nav-summary-childs { + display: none; +} + +#nav-summary #nav-summary-childs a { + float: none; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Footer. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +#footer { + padding: 10px 10px 10px 20px; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Header. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +#header { + padding: 15px 15px 5px 15px; +} + +#header .images { + width: 100%; + padding: 0; + margin: 0; +} + +#header p { + font-size: 1.1em; + margin: 0 0 0.5em 0; +} + +#header { +} + +#header #logo, #header #sponsor { + display: block; + width: 40%; + float: left; +} + +#header #sponsor { + float: right; + text-align: right; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Default Style. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +.warning { + background-image: url(../img/warning.gif); + background-repeat: no-repeat; + background-position: 10px 10px; + border: 1px solid #CC0000; + margin-top: 1.5em; + margin-bottom: 1.5em; + padding: 10px; + padding-left: 40px; + line-height: 100%; + width: 80%; + background-color: #FFCCCC; +} + +.note { + background-image: url(../img/note.gif); + background-repeat: no-repeat; + background-position: 10px 10px; + border: 1px solid #F0C000; + margin-top: 1.5em; + margin-bottom: 1.5em; + padding: 10px; + padding-left: 40px; + line-height: 100%; + width: 80%; + background-color: #FFFFCE; +} + +.bq { + margin-top: 4px; + margin-bottom: 4px; + padding: 5px 5px 5px 5px; + padding-bottom: 15px; + color: inherit; + background-color: #F0F0F0; + border: 1px dashed black; + font-family: courier, courier new, monospace; + font-size: 1em; + line-height: 1.1em; + white-space: pre; + width: 90%; + overflow: auto; + overflow: scroll -moz-scrollbars-horizontal; + overflow-x: auto; +} + +/** +* Wiki text stylesheet definitions. +* @author Matthias L. Jugel +* @version $Id: SnipSnap-Theme.snip,v 1.1.2.1 2004/01/26 14:07:31 leo Exp $ +*/ + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +/************************************************/ +/* image positioning */ +img { + margin-top: 1px; + margin-bottom: 1px; + vertical-align: middle; +} + +img.left { + display: block; + left: 0px; +} + +img.right { + display: block; + right: 0px; +} + +img.center { + text-align: center; +} + +img.float-left { + float: left; + margin-top: 3px; + margin-right: 3px; + margin-bottom: 3px; +} + +img.float-right { + float: right; + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; +} + +/* +.graph-image { + position: relative; + width: 100%; +} +*/ + +.heading-1 { + font-weight: bold; + font-size: 1.05em; + font-variant: small-caps; +} + +.heading-1-1 { + font-size: 1em; + font-variant: small-caps; +} + +.heading-1-1-1 { + font-size: 1em; +} + +.quote { + font-style: italic; + color: inherit; + background-color: inherit; + font-family: inherit; + font-size: inherit; +} + +/************************************************/ +/* code formatting */ +.code { + margin: 4px 0; + padding: 5px 15Px; + color: inherit; + border-width: 1px; + font-family: courier, courier new, monospace; + font-size: 1em; + line-height: 1.1em; + white-space: pre; + overflow: auto; + overflow: scroll -moz-scrollbars-horizontal; + overflow-x: auto; +} + +.java-keyword { + font-weight: bold; + background-color: inherit; +} + +.java-object { + background-color: inherit; +} + +.java-quote { + background-color: inherit; +} + +.xml-keyword { + font-weight: bold; +} + +.xml-tag { + color: #0000aa; + background-color: inherit; +} + +/* weblog formatting */ +.blog-date { + display: block; + background-color: #f8f8f8; + color: black; + font-family: verdana, sans-serif; + font-size: 1em; + font-weight: bold; + margin-bottom: 10px; + width: 100%; +} + +/* special formatting of a wiki table */ +.wiki-table { + border-style: solid; + border-color: black; + border-width: 0px 1px 1px 1px; + empty-cells: show; +} + +.wiki-table td { + border-top: 1px solid black; + padding: 4px 4px 4px 4px; +} + +.wiki-table th { + border-top: 1px solid black; + text-align: left; + color: inherit; + font-weight: bold; /* background-color: #DDEEFF; */ + padding: 4px 4px 4px 4px; + font-size: 1em; +} + +.wiki-table .table-odd { + color: inherit; + background-color: #F8F8F8; +} + +.wiki-table .table-even { +} + +/************************************************/ +/* list formatting */ + +.list { +} + +.list-title { + font-weight: bold; +} + +.list ul { + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + padding-left: 0px; + list-style-type: none; +} + +/* wiki lists */ + +ul.minus { + list-style-type: square; +} + +ul.star { + list-style-type: disc; +} + +ol.roman { + list-style-type: lower-roman; +} + +ol.ROMAN { + list-style-type: upper-roman; +} + +ol.alpha { + list-style-type: lower-alpha; +} + +ol.ALPHA { + list-style-type: upper-alpha; +} + +ol.greek { + list-style-type: lower-greek; +} + +ol.GREEK { + list-style-type: upper-greek; +} + +ol.hiragana { + list-style-type: hiragana; +} + +ol.HIRAGANA { + list-style-type: hiragana-iroha; +} + +ol.katakana { + list-style-type: katakana; +} + +ol.KATAKANA { + list-style-type: katakana-iroha; +} + +ol.HEBREW { + list-style-type: hebrew; +} + +li { + margin-top: 0.7em; +} + +/************************************************/ +/* index formatting */ +.index-top { +} + +.index-top th { + padding: 1px 1px 1px 1px; + text-align: left; + color: inherit; + font-weight: bold; + background-color: #d9e4f9; +} + +.index { +} + +.index td { + padding: 1px 1px 1px 1px; +} + +.index th { + padding: 1px 1px 1px 1px; + text-align: left; + color: inherit; + font-weight: bold; + background-color: #d9e4f9; +} + +/************************************************/ +/* calendar display */ +.calendar { + border-spacing: 0px; + font-size: 0.7em; +} + +.calendar td { + text-align: right; + padding: 0px; +} + +.calendar caption { + font-size: 1em; + text-align: left; + font-weight: bold; +} + +.calendar .today { + border: 3px solid #cccccc; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// CSS 3. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +.corner-all, #nav-summary #nav-summary-childs { + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +#navigation a { + border-radius: 18px; + -moz-border-radius: 18px; + -webkit-border-radius: 18px; +} + +#footer, #table-of-content a:hover, #navigation #nav-summary-childs a { + text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.9); +} + +.wiki-table th strong { + text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5); +} + +#navigation a, #nav-summary #nav-summary-childs a:hover { + text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.8); +} diff --git a/css/menu.css b/css/menu.css new file mode 100644 index 0000000..ace229e --- /dev/null +++ b/css/menu.css @@ -0,0 +1,17 @@ +.menuItem { + font-family:Tahoma, Verdana, Arial; + font-weight: normal; + font-size:95%; +} +.menuTitle { + font-size:85%; + font-family:Tahoma, Verdana, Arial; +} +.menuUsageItem { + font-size:95%; + font-family:Tahoma, Verdana, Arial; + margin-bottom:10px; +} +.menuUsageItem a { + text-decoration: none; +} \ No newline at end of file diff --git a/css/pdf.css b/css/pdf.css new file mode 100644 index 0000000..da847b0 --- /dev/null +++ b/css/pdf.css @@ -0,0 +1,148 @@ +/* page layout and page numbering */ +@page { + size: a4; + font-family:Arial; +} + +@page :left { + @bottom-left { + content: counter(page); + vertical-align: middle; + margin: 0.8em 0; + font-size: 12pt; + } +} + +@page :right { + @bottom-right { + content: counter(page); + vertical-align: middle; + margin: 0.8em 0; + font-size: 12pt; + } +} + +.body { + margin: 0px; + padding: 0px; + font-size: 12pt; +} + +#main { + margin: 0; +} + +#header { + margin:0px; + padding:0px; + background:url(../img/bg.png) no-repeat; +} + +#header .images .rsalogo{ + display:none; +} + +.body #header .message{ + color:#FFFFFF; + font-size:16px; + margin-left:60px; + margin-top:730px; + border-bottom:none; + text-align:left; +} + +/* style overrides */ + +.paragraph { + text-align:center; + margin: 0.2em 0; + padding: 0.2em 0; +} + +h1 { + font-family: helvetica,arial,sans-serif; + font-size: 1.5em; + string-set: header content(); + page-break-before: always +} + +h1>a { + font-size: 1em; + string-set: header content(); + page-break-before: always +} + +h2 { + font-family: helvetica,arial,sans-serif; + font-size: 1.3em; +} + +h3 { + font-family: helvetica,arial,sans-serif; + font-size: 1.2em; +} + +h4 { + font-family: helvetica,arial,sans-serif; + font-size: 1.1em; +} + +h1, h2, h3, h1>a, h2>a, h3>a { + color:#000000; +} + +#toc div.tocItem { + list-style: none; + margin: 0; + padding: 0; +} + +#toc div.tocItem a::after { + content: leader('.') target-counter(attr(href), page); + font-style: normal; +} + +#col1 { + width: 100%; +} + +#col2 { + width: 0px; +} + +#col2 .local { + display: none; +} + +div.title { + font-size: 20px; +} + +.code pre { + text-align: left; + padding-left:5px; + font-size: 0.85em; + line-height: 100%; + white-space: pre-wrap; + page-break-inside: avoid; +} + +.bq { + white-space: pre-wrap; + page-break-inside: avoid; +} + +.code, .bq { + text-align: left; + margin-bottom: 1em; +} + +.warning, .note{ + background-position:10px 10px; +} + +.warning, .note, table { + margin-top: 1em; + margin-bottom: 1em; + page-break-inside: avoid; +} diff --git a/css/ref.css b/css/ref.css new file mode 100644 index 0000000..adf22de --- /dev/null +++ b/css/ref.css @@ -0,0 +1,431 @@ +@import "tools.css"; +@import "skin.css"; + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Body & Html. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +body { + font-family: Arial; +} + +.body { + margin-left: 30px; + font-family: Tahoma, Verdana, Arial; + font-size:95%; +} + +h1 { + font-family: Arial, Verdana, Tahoma; + border-bottom:1px solid #eeeeee; + font-size:1.2em; + margin-left:30px; + margin-top:50px; +} + +h2 { + font-family: Arial, Verdana, Tahoma; + font-weight:normal; + font-style: italic; + font-size:1.0em; + margin-left:30px; +} + +p { + margin-left:50px; +} + +ul { + + margin-left:50px; +} + +ol { + + margin-left:50px; +} + +blockquote { + margin-left:50px; +} + +/** +* Wiki text stylesheet definitions. +* @author Matthias L. Jugel +* @version $Id: SnipSnap-Theme.snip,v 1.1.2.1 2004/01/26 14:07:31 leo Exp $ +*/ + +.bold { + font-weight: bold; +} + +.italic { + font-style: italic; +} + +/************************************************/ +/* image positioning */ +img { + margin-top: 1px; + margin-bottom: 1px; + vertical-align: middle; +} + +img.left { + display: block; + left: 0px; +} + +img.right { + display: block; + right: 0px; +} + +img.center { + text-align: center; +} + +img.float-left { + float: left; + margin-top: 3px; + margin-right: 3px; + margin-bottom: 3px; +} + +img.float-right { + float: right; + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; +} + +/* +.graph-image { + position: relative; + width: 100%; +} +*/ + +.heading-1 { + font-weight: bold; + font-size: 14px; + font-variant: small-caps; +} + +.heading-1-1 { + font-size: 12px; + font-variant: small-caps; +} + +.heading-1-1-1 { + font-size: 12px; +} + +.quote { + font-style: italic; + color: inherit; + background-color: inherit; + font-family: inherit; + font-size: inherit; +} + +.warning { + background-image: url(../img/warning.gif); + background-repeat: no-repeat; + background-position: 7 7; + border: 1px solid #CC0000; + margin-top: 4px; + margin-bottom: 4px; + margin-left:50px; + padding: 10px; + padding-left: 40px; + line-height: 100%; + width: 85%; + background-color: #FFCCCC; +} + +.note { + background-image: url(../img/note.gif); + background-repeat: no-repeat; + background-position: 7 7; + border: 1px solid #F0C000; + margin-top: 4px; + margin-bottom: 4px; + margin-left:50px; + padding: 10px; + padding-left: 40px; + line-height: 100%; + width: 85%; + background-color: #FFFFCE; +} +/************************************************/ +/* code formatting */ +.bq { + margin-top: 4px; + margin-bottom: 4px; + margin-left:40px; + padding: 5px 5px 5px 5px; + padding-bottom: 15px; + color: inherit; + background-color: #F0F0F0; + border: 1px dashed black; + font-family: courier, courier new, monospace; + font-size: 12px; + line-height: 100%; + white-space: pre; + width: 90%; + overflow: auto; + overflow: scroll -moz-scrollbars-horizontal; + overflow-x: auto; +} +.code { + margin-top: 4px; + margin-bottom: 4px; + margin-left:40px; + padding: 5px 5px 5px 5px; + color: inherit; + background-color: #F0F0F0; + border: 1px dashed black; + font-family: courier, courier new, monospace; + font-size: 12px; + line-height: 100%; + white-space: pre; + width: 90%; + overflow: auto; + overflow: scroll -moz-scrollbars-horizontal; + overflow-x: auto; +} +/* Paragraphs are created inside code blocks after blank lines */ +.code p { + margin-left: 0px; +} +table .code { + margin-left:0px; +} + +.java-keyword { + font-weight: bold; + background-color: inherit; +} + +.java-object { + background-color: inherit; +} + +.java-quote { + background-color: inherit; +} + +.xml-keyword { + font-weight: bold; +} + +.xml-tag { + color: #0000aa; + background-color: inherit; +} + +/* weblog formatting */ +.blog-date { + display: block; + background-color: #f8f8f8; + color: black; + font-family: verdana, sans-serif; + font-size: 16px; + font-weight: bold; + margin-bottom: 10px; + width: 100%; +} + +/* special formatting of a wiki table */ +.wiki-table { + border-style: solid; + border-color: black; + border-width: 0px 1px 1px 1px; + empty-cells: show; +} + +.wiki-table td { + border-top: 1px solid black; + padding: 4px 4px 4px 4px; +} + +.wiki-table th { + border-top: 1px solid black; + text-align: left; + color: inherit; + font-weight: bold; /* background-color: #DDEEFF; */ + padding: 4px 4px 4px 4px; + font-size: 12px; +} + +.wiki-table .table-odd { + color: inherit; + background-color: #F8F8F8; +} + +.wiki-table .table-even { +} + +/************************************************/ +/* list formatting */ + +.list { +} + +.list-title { + font-weight: bold; +} + +.list ul { + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + padding-left: 0px; + list-style-type: none; +} + +/* wiki lists */ + +ul.minus { + list-style-type: square; +} + +ul.star { + list-style-type: disc; +} + +ol.roman { + list-style-type: lower-roman; +} + +ol.ROMAN { + list-style-type: upper-roman; +} + +ol.alpha { + list-style-type: lower-alpha; +} + +ol.ALPHA { + list-style-type: upper-alpha; +} + +ol.greek { + list-style-type: lower-greek; +} + +ol.GREEK { + list-style-type: upper-greek; +} + +ol.hiragana { + list-style-type: hiragana; +} + +ol.HIRAGANA { + list-style-type: hiragana-iroha; +} + +ol.katakana { + list-style-type: katakana; +} + +ol.KATAKANA { + list-style-type: katakana-iroha; +} + +ol.HEBREW { + list-style-type: hebrew; +} + +/************************************************/ +/* index formatting */ +.index-top { +} + +.index-top th { + padding: 1px 1px 1px 1px; + text-align: left; + color: inherit; + font-weight: bold; + background-color: #d9e4f9; +} + +.index { +} + +.index td { + padding: 1px 1px 1px 1px; +} + +.index th { + padding: 1px 1px 1px 1px; + text-align: left; + color: inherit; + font-weight: bold; + background-color: #d9e4f9; +} + +/************************************************/ +/* calendar display */ +.calendar { + border-spacing: 0px; + font-size: 0.7em; +} + +.calendar td { + text-align: right; + padding: 0px; +} + +.calendar caption { + font-size: 1em; + text-align: left; + font-weight: bold; +} + +.calendar .today { + border: 3px solid #cccccc; +} + +li { + margin-bottom: 2px; + margin-top: 2px; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// CSS 3. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +.corner-all, #nav-summary #nav-summary-childs { + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +#navigation a { + border-radius: 14px; + -moz-border-radius: 14px; + -webkit-border-radius: 14px; +} + +#footer, #table-of-content a:hover, #navigation #nav-summary-childs a { + text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.9); +} + +.wiki-table th strong { + text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.5); +} + +#navigation a, #nav-summary #nav-summary-childs a:hover { + text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.8); +} diff --git a/css/skin.css b/css/skin.css new file mode 100644 index 0000000..7476995 --- /dev/null +++ b/css/skin.css @@ -0,0 +1,139 @@ +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Color. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +body, .wiki-table th strong { + color: #444; +} + +a, a:hover, a:focus, a:active, a:hover, #main .project strong, #table-of-content a:hover strong, + #table-of-content a strong, .menu .menu-block h1, .menu a:hover, .local .local-title .toggle a, + #navigation #nav-summary-childs a:hover, #main h1, #main h2 { + color: #7c9d00; +} + +#main .project h1, #table-of-content h2 { + color: #444; +} + +#footer { + color: #999; +} + +#footer a, .menu a, .local .local-title a, .local .local-title .toggle, + #navigation #nav-summary-childs a { + color: #333; +} + +.java-keyword, .java-object { + color: #0911ff; +} + +.java-quote { + color: #268000; +} + +#navigation a, #nav-summary #nav-summary-childs a:hover { + color: white; +} + +.toc-item a { + text-decoration: none; +} + +.toc-item a:hover { + text-decoration: underline; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Background Color. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +#main { + background: white; +} + +.code, #navigation #nav-summary-childs { + background: #F2f2F2; +} + + +#navigation .selected a { + background: #5a7103; +} + +#navigation a:hover { + background: #678104; +} + +#navigation .selected a:hover, #navigation .active .button { + background: #526703; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Background Image. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + + +.menu .menu-item { + background: url(../img/default/bullet.gif) no-repeat 2px 8px; +} + +.local .local-title { + background: #F2F2F2 url(../img/default/separator-horizontal.gif) repeat-x 0 bottom; +} + +#table-of-content a:hover { + background: #F2F2F2 url(../img/default/linear-gradient.png) repeat-x 0 0; +} + +.wiki-table th, #navigation { + background: #a4c001 url(../img/default/linear-gradient-green.png) repeat-x 0 0; +} + +#navigation .separator { + background: url(../img/default/separator-menu.png) no-repeat 0 center; +} + + + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Border Color. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +#main { + border-color: #d3d3d3; + border-style: solid; +} + +#navigation { + border-style: solid; + border-color: #344d06; +} + +.code { + border-style: dashed; + border-color: #333; +} + +#navigation #nav-summary-childs { + border-style: solid; + border-color: #888; + border-top-color: #444; +} diff --git a/css/tools.css b/css/tools.css new file mode 100644 index 0000000..47e49c5 --- /dev/null +++ b/css/tools.css @@ -0,0 +1,123 @@ +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Style de base. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +html { + font-size: 100%; +} + +body { + margin: 0; + padding: 0; + font-size: .8em; + line-height: 1.2; + color: black; + background: white; +} + +h1, h2, h3, h4, h5, h6 { + margin: 1em 0 .5em 0; + line-height: 1.1; + font-weight: bold; + font-style: normal; +} +h1 { + font-size: 1.75em; +} +h2 { + font-size: 1.5em; +} +h3 { + font-size: 1.4em; +} +h4 { + font-size: 1.3em; +} + +ul, ol { + margin: .75em 0 .75em 32px; + padding: 0; +} + +p { + margin: 1em 0; +} + +address { + margin: .75em 0; + font-style: normal; +} + +a { + text-decoration: underline; +} + +a:active { + outline: none; +} +a img { + border: none; +} + +em { + font-style: italic; +} + +strong { + font-weight: bold; +} + +form, fieldset { + margin: 0; + padding: 0; + border: none; +} + +input, button, select { + vertical-align: middle; +} + +/* +//////////////////////////////////////////////////////////////////////////////// +// +// Clearfix. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +.clearfix:after +{ + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + font-size: 0; + height: 0; +} + +.clearfix +{ + display: inline-block; +} + +html[xmlns] .clearfix +{ + display: block; +} + +* html .clearfix +{ + height: 1%; +} + + +#toggle-col1{ + display: none; + float: right; + padding-left: 50px; +} diff --git a/gapi/DefaultPackage/HtmlCleanerDocsGrailsPlugin.html b/gapi/DefaultPackage/HtmlCleanerDocsGrailsPlugin.html new file mode 100644 index 0000000..168d9c3 --- /dev/null +++ b/gapi/DefaultPackage/HtmlCleanerDocsGrailsPlugin.html @@ -0,0 +1,540 @@ + + + + + + + + + +HtmlCleanerDocsGrailsPlugin (Groovy Documentation) + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+Groovy Documentation +
+ + + +
+ +

+ +[Groovy] Class HtmlCleanerDocsGrailsPlugin

+
java.lang.Object
+  HtmlCleanerDocsGrailsPlugin
+

+
class HtmlCleanerDocsGrailsPlugin
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Property Summary
+ java.lang.Object + author +
+

+
+ java.lang.Object + authorEmail +
+

+
+ java.lang.Object + dependsOn +
+

+
+ java.lang.Object + description +
+

+
+ java.lang.Object + doWithApplicationContext +
+

+
+ java.lang.Object + doWithDynamicMethods +
+

+
+ java.lang.Object + doWithSpring +
+

+
+ java.lang.Object + doWithWebDescriptor +
+

+
+ java.lang.Object + documentation +
+

+
+ java.lang.Object + grailsVersion +
+

+
+ java.lang.Object + onChange +
+

+
+ java.lang.Object + onConfigChange +
+

+
+ java.lang.Object + onShutdown +
+

+
+ java.lang.Object + pluginExcludes +
+

+
+ java.lang.Object + title +
+

+
+ java.lang.Object + version +
+

+
+   + + + + + + + + + + + + + + + + + + + +
+ Constructor Summary
+ HtmlCleanerDocsGrailsPlugin() +
+

+
+   + + + + + + + + + +
+ Method Summary
+   + + +
+ Methods inherited from class java.lang.Object +
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
+   + +

+ + + + + + + + + + + + + + + + + + + +
+ Property Detail
+ +

author

+
java.lang.Object author
+
+
+
+

+

+
+ +

authorEmail

+
java.lang.Object authorEmail
+
+
+
+

+

+
+ +

dependsOn

+
java.lang.Object dependsOn
+
+
+
+

+

+
+ +

description

+
java.lang.Object description
+
+
+
+

+

+
+ +

doWithApplicationContext

+
java.lang.Object doWithApplicationContext
+
+
+
+

+

+
+ +

doWithDynamicMethods

+
java.lang.Object doWithDynamicMethods
+
+
+
+

+

+
+ +

doWithSpring

+
java.lang.Object doWithSpring
+
+
+
+

+

+
+ +

doWithWebDescriptor

+
java.lang.Object doWithWebDescriptor
+
+
+
+

+

+
+ +

documentation

+
java.lang.Object documentation
+
+
+
+

+

+
+ +

grailsVersion

+
java.lang.Object grailsVersion
+
+
+
+

+

+
+ +

onChange

+
java.lang.Object onChange
+
+
+
+

+

+
+ +

onConfigChange

+
java.lang.Object onConfigChange
+
+
+
+

+

+
+ +

onShutdown

+
java.lang.Object onShutdown
+
+
+
+

+

+
+ +

pluginExcludes

+
java.lang.Object pluginExcludes
+
+
+
+

+

+
+ +

title

+
java.lang.Object title
+
+
+
+

+

+
+ +

version

+
java.lang.Object version
+
+
+
+

+

+
+ +   + + + + + + + + + + + + + + + +
+ Constructor Detail
+ +

+ HtmlCleanerDocsGrailsPlugin

+
HtmlCleanerDocsGrailsPlugin()
+
+
+
+

+

+
+ +   + + + + + + + + +

Groovy Documentation

+
+ + + diff --git a/gapi/DefaultPackage/UrlMappings.html b/gapi/DefaultPackage/UrlMappings.html new file mode 100644 index 0000000..91b75be --- /dev/null +++ b/gapi/DefaultPackage/UrlMappings.html @@ -0,0 +1,255 @@ + + + + + + + + + +UrlMappings (Groovy Documentation) + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+Groovy Documentation +
+ + + +
+ +

+ +[Groovy] Class UrlMappings

+
java.lang.Object
+  UrlMappings
+

+
class UrlMappings
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Property Summary
+ static java.lang.Object + mappings +
+

+
+   + + + + + + + + + + + + + + + + + + + +
+ Constructor Summary
+ UrlMappings() +
+

+
+   + + + + + + + + + +
+ Method Summary
+   + + +
+ Methods inherited from class java.lang.Object +
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
+   + +

+ + + + + + + + + + + + + + + + + + + +
+ Property Detail
+ +

mappings

+
static java.lang.Object mappings
+
+
+
+

+

+
+ +   + + + + + + + + + + + + + + + +
+ Constructor Detail
+ +

+ UrlMappings

+
UrlMappings()
+
+
+
+

+

+
+ +   + + + + + + + + +

Groovy Documentation

+
+ + + diff --git a/gapi/DefaultPackage/package-frame.html b/gapi/DefaultPackage/package-frame.html new file mode 100644 index 0000000..196f143 --- /dev/null +++ b/gapi/DefaultPackage/package-frame.html @@ -0,0 +1,38 @@ + + + + +DefaultPackage + + + + + + + + + + + +DefaultPackage + + + + + + + + +
+Classes  +
HtmlCleanerDocsGrailsPlugin
UrlMappings
+ + + + + + + + + + diff --git a/gapi/DefaultPackage/package-summary.html b/gapi/DefaultPackage/package-summary.html new file mode 100644 index 0000000..85e3268 --- /dev/null +++ b/gapi/DefaultPackage/package-summary.html @@ -0,0 +1,119 @@ + + + + +DefaultPackage (html-cleaner) + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ Groovy Documentation + +
+ + + +
+

+Package DefaultPackage +

+ + + +

 

+ + + + + + + + + + + + + + + + + + + +
+ Class Summary
HtmlCleanerDocsGrailsPlugin
UrlMappings
+  +

+

+
+
+ + + + + + + +

Groovy Documentation

+
+ + diff --git a/gapi/allclasses-frame.html b/gapi/allclasses-frame.html new file mode 100644 index 0000000..33ec4cf --- /dev/null +++ b/gapi/allclasses-frame.html @@ -0,0 +1,35 @@ + + + + +All Classes + + + + + + + + + +All Classes + +
+ + + + + +
+ + +HtmlCleanerDocsGrailsPlugin +
+UrlMappings +
+ + +
+ + + diff --git a/gapi/deprecated-list.html b/gapi/deprecated-list.html new file mode 100644 index 0000000..f0e42a5 --- /dev/null +++ b/gapi/deprecated-list.html @@ -0,0 +1,97 @@ + + + + + +Deprecated API (html-cleaner) + + + + + + + + + +
+ + + + + + + + + + + + + +
+ Groovy Documentation + +
+ + +
+
+

Deprecated API

+
+
+ + + + + + + + + + + + + +
+

Groovy Documentation

+
+ + diff --git a/gapi/groovy.ico b/gapi/groovy.ico new file mode 100644 index 0000000..9e9b8d8 Binary files /dev/null and b/gapi/groovy.ico differ diff --git a/gapi/help-doc.html b/gapi/help-doc.html new file mode 100644 index 0000000..63490e2 --- /dev/null +++ b/gapi/help-doc.html @@ -0,0 +1,188 @@ + + + + + + +API Help (html-cleaner) + + + + + + + + + +
+ + + + + + + + + + + + + +
+ Groovy Documentation + +
+ + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages +corresponding to the items in the navigation bar, described as follows.

+Overview

+
+ +

+The Overview +page is the front page of this API document and provides a list of all +packages with a summary for each. This page can also contain an overall +description of the set of packages.

+

+Package

+
+ +

+Each package has a page that contains a list of its classes and +interfaces, with a summary for each. This page can contain four +categories:

+
+

+Class/Interface

+
+ +

+Each class, interface, nested class and nested interface has its own +separate page. Each of these pages has three sections consisting of a +class/interface description, summary tables, and detailed member +descriptions:

+Each summary entry contains the first sentence from the detailed +description for that item. The summary entries are alphabetical, while +the detailed descriptions are in the order they appear in the source +code. This preserves the logical groupings established by the +programmer.
+ +

Annotation Type

+
+ +

+Each annotation type has its own separate page with the following sections:

+
+ +

Enum

+
+ +

+Each enum has its own separate page with the following sections:

+
+

Tree (Class Hierarchy)

+
+There is a Class Hierarchy +page for all packages, plus a hierarchy for each package. Each +hierarchy page contains a list of classes and a list of interfaces. The +classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. +
+

Deprecated API

+
+The Deprecated API +page lists all of the parts of the API that have been deprecated. A deprecated API +is not recommended for use, generally due to improvements, and a +replacement API is usually given. Deprecated APIs may be removed in +future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+ +

Constant Field Values

+The Constant Field Values page lists the static final fields and their values. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ +

Groovy Documentation

+
+ + \ No newline at end of file diff --git a/gapi/index-all.html b/gapi/index-all.html new file mode 100644 index 0000000..55fea38 --- /dev/null +++ b/gapi/index-all.html @@ -0,0 +1,448 @@ + + + + + +Index (html-cleaner) + + + + + + + + +
+ + + + + + + + + + + + + +
+ Groovy Documentation + +
+ + + +A + +B + +C + +D + +E + +F + +G + +H + +I + +J + +K + +L + +M + +N + +O + +P + +Q + +R + +S + +T + +U + +V + +W + +X + +Y + +Z + +_ + + + + +
+

+A

+ +
+ +
author - Property in HtmlCleanerDocsGrailsPlugin +
+
authorEmail - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+B

+ +
+ +
+ + + +
+

+C

+ +
+ +
+ + + +
+

+D

+ +
+ +
dependsOn - Property in HtmlCleanerDocsGrailsPlugin +
+
description - Property in HtmlCleanerDocsGrailsPlugin +
+
documentation - Property in HtmlCleanerDocsGrailsPlugin +
+
doWithApplicationContext - Property in HtmlCleanerDocsGrailsPlugin +
+
doWithDynamicMethods - Property in HtmlCleanerDocsGrailsPlugin +
+
doWithSpring - Property in HtmlCleanerDocsGrailsPlugin +
+
doWithWebDescriptor - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+E

+ +
+ +
+ + + +
+

+F

+ +
+ +
+ + + +
+

+G

+ +
+ +
grailsVersion - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+H

+ +
+ +
HtmlCleanerDocsGrailsPlugin - Class in HtmlCleanerDocsGrailsPlugin +
+
HtmlCleanerDocsGrailsPlugin() - Constructor in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+I

+ +
+ +
+ + + +
+

+J

+ +
+ +
+ + + +
+

+K

+ +
+ +
+ + + +
+

+L

+ +
+ +
+ + + +
+

+M

+ +
+ +
mappings - Property in UrlMappings +
+
+ + + +
+

+N

+ +
+ +
+ + + +
+

+O

+ +
+ +
onChange - Property in HtmlCleanerDocsGrailsPlugin +
+
onConfigChange - Property in HtmlCleanerDocsGrailsPlugin +
+
onShutdown - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+P

+ +
+ +
pluginExcludes - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+Q

+ +
+ +
+ + + +
+

+R

+ +
+ +
+ + + +
+

+S

+ +
+ +
+ + + +
+

+T

+ +
+ +
title - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+U

+ +
+ +
UrlMappings - Class in UrlMappings +
+
UrlMappings() - Constructor in UrlMappings +
+
+ + + +
+

+V

+ +
+ +
version - Property in HtmlCleanerDocsGrailsPlugin +
+
+ + + +
+

+W

+ +
+ +
+ + + +
+

+X

+ +
+ +
+ + + +
+

+Y

+ +
+ +
+ + + +
+

+Z

+ +
+ +
+ + + +
+

+_

+ +
+ +
+ + + +
+

Groovy Documentation

+
+ + diff --git a/gapi/index.html b/gapi/index.html new file mode 100644 index 0000000..cbe6628 --- /dev/null +++ b/gapi/index.html @@ -0,0 +1,37 @@ + + + + +{todo.title} + + + + + + + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to<A HREF="overview-summary.html">Non-frame version.</A> + + + diff --git a/gapi/inherit.gif b/gapi/inherit.gif new file mode 100644 index 0000000..c814867 Binary files /dev/null and b/gapi/inherit.gif differ diff --git a/gapi/overview-frame.html b/gapi/overview-frame.html new file mode 100644 index 0000000..f66f024 --- /dev/null +++ b/gapi/overview-frame.html @@ -0,0 +1,41 @@ + + + + +Overview (Groovy Documentation) + + + + + + + + + + + + + + +
+Groovy Documentation
+ + + + + +
All Classes +

+ +Packages +
+ +DefaultPackage +
+ +

+ +

+  + + diff --git a/gapi/overview-summary.html b/gapi/overview-summary.html new file mode 100644 index 0000000..e2fdf37 --- /dev/null +++ b/gapi/overview-summary.html @@ -0,0 +1,98 @@ + + + + +Overview (html-cleaner) + + + + + + + + +


+ + + + + + + + + + + + + +
+Groovy Documentation + +
+ + +
+
+

+Groovy Documentation

+
+

+

+ + + + + + + + + + + +
+Packages
DefaultPackage
+ +

+ +

Groovy Documentation

+
+ + diff --git a/gapi/package-list b/gapi/package-list new file mode 100644 index 0000000..943f15e --- /dev/null +++ b/gapi/package-list @@ -0,0 +1 @@ +DefaultPackage diff --git a/gapi/stylesheet.css b/gapi/stylesheet.css new file mode 100644 index 0000000..8f77530 --- /dev/null +++ b/gapi/stylesheet.css @@ -0,0 +1,28 @@ +/* Groovydoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Headings */ +h1 { font-size: 145% } + +/* Table colors */ +.TableHeadingColor { background: #97D0E8 } /* Dark cyan */ +.TableSubHeadingColor { background: #E0F0FF } /* Light cyan */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} \ No newline at end of file diff --git a/guide/definewhitelists.html b/guide/definewhitelists.html new file mode 100644 index 0000000..d9088bc --- /dev/null +++ b/guide/definewhitelists.html @@ -0,0 +1,182 @@ + + + + 3 Defining custom whitelists 0.1 + + + + + + + + + + + + + + + + +
+
+ + + + + + (Quick Reference) + + + + +
+

3 Defining custom whitelists - Reference Documentation

+ +

Authors: Sudhir Nimavat

+ +

Version: 0.1

+ + +
+ + + + + +

3 Defining custom whitelists

+Plugin provides a DSL to define custom whitelists in configuration.

Define a custom whitelist sample that will allow just <b>,<i>,<p> and <span> tags.

Config.groovy +

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            startwith "none"
+            allow "b", "p", "i", "span"
+        }
+    }
+}

The above configuration would define a whitelist with name sample that builds on top of whitelist none and allows additional tags <b>,<i>,<p> and <span>

A whitelist can start with any of the default whitelists or A whitelist can start with any custom whitelists that are defined earlier in configuration as well, but it must start with another whitelist.

Define a whitelist sample2 that starts with whitelist sample we defined above and allows tag <a> with just one attribute href and puts rel="nofollow"

htmlcleaner {
+    whitelists = {
+        whitelist("sample2") {
+            startwith "sample"
+            allow("a") {
+                attributes "href"
+                enforce attribute:"rel", value:"nofollow"
+            }
+        }
+    }
+}

Define a whitelist basic-with-tables that starts with whitelist basic and allows tables.

htmlcleaner {
+    whitelists = {
+        whitelist("basic-with-tables") {
+            startwith "basic"
+            allow "table", "tr", "td"
+        }
+    }
+}

Restricting attributes +

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            allow("div") {
+                attributes "id", "class"
+            }
+        }
+    }
+}

Enforcing attributes - An enforced attribute will always be added to the element. If the element already has the attribute set, it will be overridden. +

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            allow("div") {
+                enforce attribute:"class", value:"block"
+            }
+        }
+    }
+}

Defining multiple whitelists

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            startwith "none"
+            allow "b", "p", "span"
+        }

whitelist("sample-with-anchor") { + startwith "sample" + allow("a") { + attributes "href" + enforce attribute:"rel", value:"nofollow" + } + }

whitelist("basic-with-tables") { + startwith "basic" + allow "table", "tr", "td" + }

} +}

+ + +
+ + + +
+
+
+
+ + +
+
+ + + + + + + diff --git a/guide/index.html b/guide/index.html new file mode 100644 index 0000000..d8b59b9 --- /dev/null +++ b/guide/index.html @@ -0,0 +1,115 @@ + + + + Html Cleaner Docs Plugin 0.1 + + + + + + + + + + + + + + + + +
+
+ + (Quick Reference) + +
+

Html Cleaner Docs Plugin - Reference Documentation

+

Authors: Sudhir Nimavat

+

Version: 0.1

+ +
+ + +
+

Table of Contents

+ + + + + + + + + +
+
+ + +
+
+
+ + +
+
+ + + + + + + + + diff --git a/guide/introduction.html b/guide/introduction.html new file mode 100644 index 0000000..a6fe170 --- /dev/null +++ b/guide/introduction.html @@ -0,0 +1,142 @@ + + + + 1 Introduction 0.1 + + + + + + + + + + + + + + + + +
+
+ + + + (Quick Reference) + + + + + + +
+

1 Introduction - Reference Documentation

+ +

Authors: Sudhir Nimavat

+ +

Version: 0.1

+ + +
+ + +
+

Table of Contents

+ + + +
+ + + + +

1 Introduction

+The html-cleaner plugin is a whitelist based html sanitizer, based on jsoup. +Plugin provides a DSL to define whitelists and adds a method cleanHtml() to every controllers. + + + +

1.1 Change Log

+ +

Version 0.1

+
    +
  • Initial release - for grails version 1.3.7 and greater.
  • +

+ + +

+ + + +
+
+
+
+ + +
+
+ + + + + + + diff --git a/guide/pages/changelog.html b/guide/pages/changelog.html new file mode 100644 index 0000000..d29e240 --- /dev/null +++ b/guide/pages/changelog.html @@ -0,0 +1,128 @@ + + + + 1.1 Change Log 0.1 + + + + + + + + + + + + + + + + +
+
+ + + + (Quick Reference) + + + + + + +
+

1.1 Change Log - Reference Documentation

+ +

Authors: Sudhir Nimavat

+ +

Version: 0.1

+ + +
+ + + + + +

1.1 Change Log

+ +

Version 0.1

+
    +
  • Initial release - for grails version 1.3.7 and greater.
  • +

+ + +

+ + + +
+
+
+
+ + +
+
+ + + + + + + diff --git a/guide/single.html b/guide/single.html new file mode 100644 index 0000000..c4557cd --- /dev/null +++ b/guide/single.html @@ -0,0 +1,209 @@ + + + + Html Cleaner Docs Plugin 0.1 + + + + + + + + + + + + + + + + +
+
+ + (Quick Reference) + +
+

Html Cleaner Docs Plugin - Reference Documentation

+

Authors: Sudhir Nimavat

+

Version: 0.1

+ +
+ + +
+

Table of Contents

+ + + + + + + + + +
+
+ + + +

1 Introduction

+The html-cleaner plugin is a whitelist based html sanitizer, based on jsoup. +Plugin provides a DSL to define whitelists and adds a method cleanHtml() to every controllers. + + + +

1.1 Change Log

+ +

Version 0.1

+
    +
  • Initial release - for grails version 1.3.7 and greater.
  • +

+ + +

2 Usage

+The plugin adds cleanHtml(String unsafe, String whitelist) method to every controller. The method can be used to clean and sanitize +user entered unsafe html against given whitelist. See Whitelist to know more about whitelist.

cleanHtml()

+Let's say you have a form with a text area, but you don't want to allow any html. You can clean the user supplied text with whitelist none and it will stripe out all the html.

class FooController {

def save = {

String cleaned = cleanHtml(params.textArea, 'none') + }

}

allow basic html as per basic whitelist.

def cleaned = cleanHtml(unsafe, 'basic')

Following whitelists are available by default and does not need any configuration. +

    +
  • none
  • +
  • simpleText
  • +
  • basic
  • +
  • basicWithImages
  • +
  • relaxed
  • +

htmlCleaner bean

+Plugin makes a spring bean with name htmlCleaner available. htmlCleaner provides a method cleanHtml() with same signature as the dynamic method available in controllers.

Using htmlCleaner inside a service

class FooService {

def htmlCleaner

def foo() { + String cleaned = htmlCleaner.cleanHtml(unsafe, 'none') + } + }

<hc:cleanHtml /> tag

Example

<hc:cleanHtml unsafe="${domainInstance.description}" whitelist="basic"/>
+ + +

3 Defining custom whitelists

+Plugin provides a DSL to define custom whitelists in configuration.

Define a custom whitelist sample that will allow just <b>,<i>,<p> and <span> tags.

Config.groovy +

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            startwith "none"
+            allow "b", "p", "i", "span"
+        }
+    }
+}

The above configuration would define a whitelist with name sample that builds on top of whitelist none and allows additional tags <b>,<i>,<p> and <span>

A whitelist can start with any of the default whitelists or A whitelist can start with any custom whitelists that are defined earlier in configuration as well, but it must start with another whitelist.

Define a whitelist sample2 that starts with whitelist sample we defined above and allows tag <a> with just one attribute href and puts rel="nofollow"

htmlcleaner {
+    whitelists = {
+        whitelist("sample2") {
+            startwith "sample"
+            allow("a") {
+                attributes "href"
+                enforce attribute:"rel", value:"nofollow"
+            }
+        }
+    }
+}

Define a whitelist basic-with-tables that starts with whitelist basic and allows tables.

htmlcleaner {
+    whitelists = {
+        whitelist("basic-with-tables") {
+            startwith "basic"
+            allow "table", "tr", "td"
+        }
+    }
+}

Restricting attributes +

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            allow("div") {
+                attributes "id", "class"
+            }
+        }
+    }
+}

Enforcing attributes - An enforced attribute will always be added to the element. If the element already has the attribute set, it will be overridden. +

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            allow("div") {
+                enforce attribute:"class", value:"block"
+            }
+        }
+    }
+}

Defining multiple whitelists

htmlcleaner {
+    whitelists = {
+        whitelist("sample") {
+            startwith "none"
+            allow "b", "p", "span"
+        }

whitelist("sample-with-anchor") { + startwith "sample" + allow("a") { + attributes "href" + enforce attribute:"rel", value:"nofollow" + } + }

whitelist("basic-with-tables") { + startwith "basic" + allow "table", "tr", "td" + }

} +}

+ +
+
+
+ + +
+
+ + + + + + + + + diff --git a/guide/usage.html b/guide/usage.html new file mode 100644 index 0000000..60ba817 --- /dev/null +++ b/guide/usage.html @@ -0,0 +1,142 @@ + + + + 2 Usage 0.1 + + + + + + + + + + + + + + + + +
+
+ + + + + + (Quick Reference) + + + + + + +
+

2 Usage - Reference Documentation

+ +

Authors: Sudhir Nimavat

+ +

Version: 0.1

+ + +
+ + + + + +

2 Usage

+The plugin adds cleanHtml(String unsafe, String whitelist) method to every controller. The method can be used to clean and sanitize +user entered unsafe html against given whitelist. See Whitelist to know more about whitelist.

cleanHtml()

+Let's say you have a form with a text area, but you don't want to allow any html. You can clean the user supplied text with whitelist none and it will stripe out all the html.

class FooController {

def save = {

String cleaned = cleanHtml(params.textArea, 'none') + }

}

allow basic html as per basic whitelist.

def cleaned = cleanHtml(unsafe, 'basic')

Following whitelists are available by default and does not need any configuration. +

    +
  • none
  • +
  • simpleText
  • +
  • basic
  • +
  • basicWithImages
  • +
  • relaxed
  • +

htmlCleaner bean

+Plugin makes a spring bean with name htmlCleaner available. htmlCleaner provides a method cleanHtml() with same signature as the dynamic method available in controllers.

Using htmlCleaner inside a service

class FooService {

def htmlCleaner

def foo() { + String cleaned = htmlCleaner.cleanHtml(unsafe, 'none') + } + }

<hc:cleanHtml /> tag

Example

<hc:cleanHtml unsafe="${domainInstance.description}" whitelist="basic"/>
+ + +
+ + + + + +
+
+
+
+ + +
+
+ + + + + + + diff --git a/html-cleaner-plugin/.gitignore b/html-cleaner-plugin/.gitignore deleted file mode 100644 index a4fdde6..0000000 --- a/html-cleaner-plugin/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.class -/target -/build -/.gradle -*.log -*.zip -plugin.xml -web-app -/.settings -/scripts -/lib -*.iml -*.ipr -*.iws -/.grails \ No newline at end of file diff --git a/html-cleaner-plugin/build.gradle b/html-cleaner-plugin/build.gradle deleted file mode 100644 index 460f210..0000000 --- a/html-cleaner-plugin/build.gradle +++ /dev/null @@ -1,79 +0,0 @@ -buildscript { - repositories { - mavenLocal() - maven { url "https://repo.grails.org/grails/core" } - } - dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsVersion" - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' - } -} - -version "3.0.0.1" -group = 'org.grails.plugins' - -apply plugin:"eclipse" -apply plugin:"idea" -apply plugin:"org.grails.grails-plugin" -apply plugin:"org.grails.grails-plugin-publish" - -repositories { - mavenLocal() - maven { url "https://repo.grails.org/grails/core" } -} - -dependencyManagement { - imports { - mavenBom "org.grails:grails-bom:$grailsVersion" - } - applyMavenExclusions false -} - -dependencies { - compile "org.springframework.boot:spring-boot-starter-logging" - compile "org.springframework.boot:spring-boot-autoconfigure" - testCompile "org.springframework.boot:spring-boot-starter-tomcat" - testCompile "org.grails:grails-web-boot" - compile "org.grails:grails-core" - console "org.grails:grails-console" - profile "org.grails.profiles:plugin" - provided "org.grails:grails-plugin-services" - provided "org.grails:grails-plugin-domain-class" - testCompile "org.grails:grails-plugin-testing" - - compile 'org.jsoup:jsoup:1.10.2' -} - -bootRun { - jvmArgs('-Dspring.output.ansi.enabled=always') -} - -// enable if you wish to package this plugin as a standalone application -bootRepackage.enabled = false - -grailsPublish { - user = System.getenv("BINTRAY_USER") ?: project.bintrayUser - key = System.getenv("BINTRAY_KEY") ?: project.bintrayKey - - title = "Html Cleaner Plugin" - desc = "Html Cleaner Grails Plugin" - developers = ["snimavat": "Sudhir Nimavat"] - - - githubSlug = 'snimavat/html-cleaner' - issueTrackerUrl = 'https://github.com/snimavat/html-cleaner/issues' - vcsUrl = 'https://github.com/snimavat/html-cleaner' - - license { - name = 'Apache-2.0' - } - - repo = 'grails-plugins' - - bintray { - override = true//rootProject.version.endsWith("SNAPSHOT") - } - - //portalUser = System.getenv("GRAILS_PORTAL_USER") ?: project.grailsPortalUser - //portalPassword = System.getenv("GRAILS_PORTAL_PASSWORD") ?: project.grailsPortalPassword -} \ No newline at end of file diff --git a/html-cleaner-plugin/gradle.properties b/html-cleaner-plugin/gradle.properties deleted file mode 100644 index fad431a..0000000 --- a/html-cleaner-plugin/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -grailsVersion=3.2.4 -gradleWrapperVersion=3.0 diff --git a/html-cleaner-plugin/gradle/wrapper/gradle-wrapper.jar b/html-cleaner-plugin/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index deedc7f..0000000 Binary files a/html-cleaner-plugin/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/html-cleaner-plugin/gradle/wrapper/gradle-wrapper.properties b/html-cleaner-plugin/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 86185e7..0000000 --- a/html-cleaner-plugin/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Nov 27 23:09:32 CET 2015 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip diff --git a/html-cleaner-plugin/gradlew b/html-cleaner-plugin/gradlew deleted file mode 100755 index 9d82f78..0000000 --- a/html-cleaner-plugin/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/html-cleaner-plugin/gradlew.bat b/html-cleaner-plugin/gradlew.bat deleted file mode 100755 index aec9973..0000000 --- a/html-cleaner-plugin/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/html-cleaner-plugin/grails-app/conf/application.groovy b/html-cleaner-plugin/grails-app/conf/application.groovy deleted file mode 100644 index 8d9e228..0000000 --- a/html-cleaner-plugin/grails-app/conf/application.groovy +++ /dev/null @@ -1,17 +0,0 @@ -htmlcleaner { - - defaultWhiteList = "simpleText" - - whitelists = { - whitelist("sample") { - startwith "none" - allow "b", "p", "img" - allow "span" - allow("a") { - attributes "href" - protocols attribute: 'href', value: 'http' - enforce attribute:"rel", value:"nofollow" - } - } - } -} \ No newline at end of file diff --git a/html-cleaner-plugin/grails-app/conf/application.yml b/html-cleaner-plugin/grails-app/conf/application.yml deleted file mode 100644 index b89ed80..0000000 --- a/html-cleaner-plugin/grails-app/conf/application.yml +++ /dev/null @@ -1,24 +0,0 @@ -grails: - profile: plugin - codegen: - defaultPackage: org.grails.plugins.htmlcleaner - spring: - transactionManagement: - proxies: false -info: - app: - name: '@info.app.name@' - version: '@info.app.version@' - grailsVersion: '@info.app.grailsVersion@' -spring: - main: - banner-mode: "off" - groovy: - template: - check-template-location: false - -# Spring Actuator Endpoints are Disabled by Default -endpoints: - enabled: false - jmx: - enabled: true diff --git a/html-cleaner-plugin/grails-app/conf/logback.groovy b/html-cleaner-plugin/grails-app/conf/logback.groovy deleted file mode 100644 index 30b4d60..0000000 --- a/html-cleaner-plugin/grails-app/conf/logback.groovy +++ /dev/null @@ -1,39 +0,0 @@ -import grails.util.BuildSettings -import grails.util.Environment -import org.springframework.boot.logging.logback.ColorConverter -import org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter - -import java.nio.charset.Charset - -conversionRule 'clr', ColorConverter -conversionRule 'wex', WhitespaceThrowableProxyConverter - -// See http://logback.qos.ch/manual/groovy.html for details on configuration -appender('STDOUT', ConsoleAppender) { - encoder(PatternLayoutEncoder) { - charset = Charset.forName('UTF-8') - - pattern = - '%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} ' + // Date - '%clr(%5p) ' + // Log level - '%clr(---){faint} %clr([%15.15t]){faint} ' + // Thread - '%clr(%-40.40logger{39}){cyan} %clr(:){faint} ' + // Logger - '%m%n%wex' // Message - } -} - -def targetDir = BuildSettings.TARGET_DIR -if (Environment.isDevelopmentMode() && targetDir != null) { - appender("FULL_STACKTRACE", FileAppender) { - file = "${targetDir}/stacktrace.log" - append = true - encoder(PatternLayoutEncoder) { - pattern = "%level %logger - %msg%n" - } - } - logger("StackTrace", ERROR, ['FULL_STACKTRACE'], false) - root(ERROR, ['STDOUT', 'FULL_STACKTRACE']) -} -else { - root(ERROR, ['STDOUT']) -} diff --git a/html-cleaner-plugin/grails-app/init/org/grails/plugins/htmlcleaner/Application.groovy b/html-cleaner-plugin/grails-app/init/org/grails/plugins/htmlcleaner/Application.groovy deleted file mode 100644 index daf89f4..0000000 --- a/html-cleaner-plugin/grails-app/init/org/grails/plugins/htmlcleaner/Application.groovy +++ /dev/null @@ -1,12 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import grails.boot.* -import grails.boot.config.GrailsAutoConfiguration -import grails.plugins.metadata.* - -@PluginSource -class Application extends GrailsAutoConfiguration { - static void main(String[] args) { - GrailsApp.run(Application, args) - } -} \ No newline at end of file diff --git a/html-cleaner-plugin/grails-app/taglib/org/grails/plugins/htmlcleaner/HtmlCleanerTagLib.groovy b/html-cleaner-plugin/grails-app/taglib/org/grails/plugins/htmlcleaner/HtmlCleanerTagLib.groovy deleted file mode 100644 index e8316e6..0000000 --- a/html-cleaner-plugin/grails-app/taglib/org/grails/plugins/htmlcleaner/HtmlCleanerTagLib.groovy +++ /dev/null @@ -1,21 +0,0 @@ -package org.grails.plugins.htmlcleaner - -class HtmlCleanerTagLib { - static final namespace = 'hc' - - HtmlCleaner htmlCleaner - - /** - * Cleans HTML and removes html tags based on whitelist - * - * @attr unsafe - the html string to clean - * @attr whitelist - Name of whitelist that should be used to clean the html. If not specified default whitelist will be used. - */ - def cleanHtml = {attrs, body -> - if (!attrs.whitelist) { - out << htmlCleaner.cleanHtml(attrs.unsafe) - } else { - out << htmlCleaner.cleanHtml(attrs.unsafe, attrs.whitelist) - } - } -} diff --git a/html-cleaner-plugin/grails-wrapper.jar b/html-cleaner-plugin/grails-wrapper.jar deleted file mode 100644 index 3636935..0000000 Binary files a/html-cleaner-plugin/grails-wrapper.jar and /dev/null differ diff --git a/html-cleaner-plugin/grailsw b/html-cleaner-plugin/grailsw deleted file mode 100755 index 958b832..0000000 --- a/html-cleaner-plugin/grailsw +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Grails start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRAILS_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -JAR_PATH=$APP_HOME/grails-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRAILS_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRAILS_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRAILS_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRAILS_OPTS - -exec "$JAVACMD" -jar "$JAR_PATH" "${JVM_OPTS[@]}" "$@" diff --git a/html-cleaner-plugin/grailsw.bat b/html-cleaner-plugin/grailsw.bat deleted file mode 100755 index d1f0959..0000000 --- a/html-cleaner-plugin/grailsw.bat +++ /dev/null @@ -1,89 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Grails startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRAILS_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line -set JAR_PATH=%APP_HOME%/grails-wrapper.jar - -@rem Execute Grails -"%JAVA_EXE%" -jar %JAR_PATH% %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRAILS_OPTS% %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRAILS_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRAILS_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/html-cleaner-plugin/settings.gradle b/html-cleaner-plugin/settings.gradle deleted file mode 100644 index 310f1d8..0000000 --- a/html-cleaner-plugin/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'html-cleaner' \ No newline at end of file diff --git a/html-cleaner-plugin/src/ast/groovy/org/grails/plugins/htmlcleaner/HtmlCleaner.groovy b/html-cleaner-plugin/src/ast/groovy/org/grails/plugins/htmlcleaner/HtmlCleaner.groovy deleted file mode 100644 index 238d704..0000000 --- a/html-cleaner-plugin/src/ast/groovy/org/grails/plugins/htmlcleaner/HtmlCleaner.groovy +++ /dev/null @@ -1,44 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import groovy.transform.CompileDynamic -import groovy.transform.CompileStatic -import org.jsoup.Jsoup -import org.springframework.util.Assert - -@CompileStatic -class HtmlCleaner { - - String defaultWhiteList - - void setDefaultWhiteList(String str) { - Assert.hasText(str, "Whitelist name must not be empty") - defaultWhiteList= str - } - - @CompileDynamic - String cleanHtml(String unsafe, String whitelist) { - if(!unsafe) { return unsafe } - Assert.hasText(whitelist, "Whitelist name must not be empty") - - if(!whitelists[whitelist]) { - throw new RuntimeException("Whitelist [${whitelist}] is not defined") - } - return Jsoup.clean(unsafe, whitelists[whitelist]) - } - - /** - * cleanHtml based on defaultWhitelist - * - * @param unsafe - * @return - */ - String cleanHtml(String unsafe) { - if(!unsafe) { return unsafe } - - if(!defaultWhiteList) { - throw new RuntimeException("Default Whitelist is not specified in configuration") - } - - return cleanHtml(unsafe, defaultWhiteList) - } -} diff --git a/html-cleaner-plugin/src/ast/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerTrait.groovy b/html-cleaner-plugin/src/ast/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerTrait.groovy deleted file mode 100644 index dfd2bc7..0000000 --- a/html-cleaner-plugin/src/ast/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerTrait.groovy +++ /dev/null @@ -1,34 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import grails.artefact.Enhances -import groovy.transform.CompileStatic -import org.grails.core.artefact.ControllerArtefactHandler -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.beans.factory.annotation.Qualifier - -import javax.persistence.Transient - - -@CompileStatic -@Enhances([ControllerArtefactHandler.TYPE]) -trait HtmlCleanerTrait { - - @Transient - private HtmlCleaner cleaner - - - String cleanHtml(String unsafe, String whitelist) { - return cleaner.cleanHtml(unsafe, whitelist) - } - - String cleanHtml(String unsafe) { - return cleaner.cleanHtml(unsafe) - } - - @Autowired - @Qualifier("htmlCleaner") - public void setHtmlCleaner(HtmlCleaner cleaner) { - this.cleaner = cleaner - } - -} diff --git a/html-cleaner-plugin/src/integration-test/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerSpec.groovy b/html-cleaner-plugin/src/integration-test/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerSpec.groovy deleted file mode 100644 index 4b33308..0000000 --- a/html-cleaner-plugin/src/integration-test/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerSpec.groovy +++ /dev/null @@ -1,51 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import grails.core.GrailsApplication -import grails.test.mixin.integration.Integration -import org.jsoup.Jsoup -import org.jsoup.safety.Whitelist -import org.springframework.beans.factory.annotation.Autowired -import spock.lang.Specification - -@Integration -class HtmlCleanerSpec extends Specification { - - private static final String UNSAFE_WITH_TABLE_TAG = ''' -

A sample paragraph - containing various tags - A link - A tag that will be removed -

- ''' - - @Autowired - HtmlCleaner htmlCleaner - - GrailsApplication grailsApplication - - private Whitelist whitelist = Whitelist.none() - - protected void setup() { - //setup a whitelist same as the 'sample' whitelist defined in config - whitelist.addTags('b','p','img','span','a') - whitelist.addAttributes('a', 'href') - whitelist.addProtocols('a', 'href', 'http') - whitelist.addEnforcedAttribute('a', 'rel', 'nofollow') - } - - void testCleanHtml() { - when: - def result = htmlCleaner.cleanHtml(UNSAFE_WITH_TABLE_TAG, "sample") - - then: - Jsoup.clean(UNSAFE_WITH_TABLE_TAG, whitelist) == result - } - - void testCleanHtmlWithDefaultWhiteList() { - when: - def result = htmlCleaner.cleanHtml(UNSAFE_WITH_TABLE_TAG) - - then: - Jsoup.clean(UNSAFE_WITH_TABLE_TAG, Whitelist.simpleText()) == result - } -} diff --git a/html-cleaner-plugin/src/main/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerGrailsPlugin.groovy b/html-cleaner-plugin/src/main/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerGrailsPlugin.groovy deleted file mode 100644 index 6f0049f..0000000 --- a/html-cleaner-plugin/src/main/groovy/org/grails/plugins/htmlcleaner/HtmlCleanerGrailsPlugin.groovy +++ /dev/null @@ -1,70 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import grails.plugins.Plugin -import org.jsoup.safety.Whitelist - -class HtmlCleanerGrailsPlugin extends Plugin { - def version = "3.0.0.1" - def grailsVersion = "3.0.0 > *" - def title = "Html Cleaner" - def author = "Sudhir Nimavat" - def authorEmail = "sudhir_nimavat@yahoo.com" - def description = "whitelist based html cleaner based on jsoup" - def developers = [ [ name: "Igor Shults", email: "igor.shults@gmail.com" ] ] - - def documentation = "http://snimavat.github.com/html-cleaner/guide/index.html" - def license = 'APACHE' - def issueManagement = [system: 'GitHub', url: 'https://github.com/snimavat/html-cleaner/issues'] - def scm = [system: 'GitHub', url: 'https://github.com/snimavat/html-cleaner'] - - def observe = ['controllers'] - - private final Map whitelists = [:] - - @Override - Closure doWithSpring() { { -> - def application = grailsApplication - buildWhitelists(application) - HtmlCleaner.metaClass.getWhitelists = { - return Collections.unmodifiableMap(whitelists) - } - - def pluginConfig = application.config.htmlcleaner - String defaultWhiteListStr = application.config.htmlcleaner?.defaultWhiteList - - //create a spring bean - htmlCleaner(HtmlCleaner) { - if(defaultWhiteListStr) { - defaultWhiteList = defaultWhiteListStr - } - } - } - } - - - @Override - void onConfigChange(Map event) { - buildWhitelists(event.application) - } - - private void buildWhitelists(application) { - WhitelistBuilder builder = new WhitelistBuilder() - - def pluginConfig = application.config.htmlcleaner - def whitelistsClosure = pluginConfig?.whitelists - - //Clear all existing whitelists - whitelists.clear() - - if(whitelistsClosure && whitelistsClosure instanceof Closure) { - whitelists.putAll(builder.build(whitelistsClosure)) - } - - //Add default whitelists - whitelists['none'] = Whitelist.none() - whitelists['basic'] = Whitelist.basic() - whitelists['simpleText'] = Whitelist.simpleText() - whitelists['basicWithImages'] = Whitelist.basicWithImages() - whitelists['relaxed'] = Whitelist.relaxed() - } -} diff --git a/html-cleaner-plugin/src/main/groovy/org/grails/plugins/htmlcleaner/WhitelistBuilder.groovy b/html-cleaner-plugin/src/main/groovy/org/grails/plugins/htmlcleaner/WhitelistBuilder.groovy deleted file mode 100644 index cefc08f..0000000 --- a/html-cleaner-plugin/src/main/groovy/org/grails/plugins/htmlcleaner/WhitelistBuilder.groovy +++ /dev/null @@ -1,106 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import groovy.transform.CompileStatic -import org.jsoup.safety.Whitelist - -@CompileStatic -class WhitelistBuilder { - - private static final List RESERVED_WHITELISTS = ['none', 'simpleText', 'basic', 'basicWithImages', 'relaxed'] - private final Map whiteLists = [:] - - private Whitelist currentWhitelist - private String currentTag - - Map build(Closure c) { - if(c) { - c.delegate = this - c.resolveStrategy = Closure.DELEGATE_ONLY - c.call() - } - return whiteLists - } - - void whitelist(String name, Closure c) { - if(!name) { - throw new RuntimeException("Whitelist must have a name") - } - if(RESERVED_WHITELISTS.contains(name)) { - throw new RuntimeException("Whitelist name [${name}] is reserved") - } - if(c) { - c.delegate = this - c.resolveStrategy = Closure.DELEGATE_ONLY - c.call() - whiteLists[name] = currentWhitelist - } - } - - void startwith(String name) { - currentWhitelist = null - switch (name) { - case "basic": - currentWhitelist = Whitelist.basic() - break - case "none": - currentWhitelist = Whitelist.none() - break - case "simpleText": - currentWhitelist = Whitelist.simpleText() - break - case "basicWithImages": - currentWhitelist = Whitelist.basicWithImages() - break - case "relaxed": - currentWhitelist = Whitelist.relaxed() - break - default: - currentWhitelist = whiteLists[name] - } - if(!currentWhitelist) { - throw new RuntimeException("Whitelist [${name}] is not defined") - } - } - - void allow(String[] tags) { - tags.each { String tag -> - currentWhitelist.addTags(tag) - } - } - - void allow(String name, Closure c) { - if(name) { - currentWhitelist.addTags(name) - currentTag = name - } - if(c) { - c.delegate = this - c.resolveStrategy = Closure.DELEGATE_ONLY - c.call() - } - } - - void attributes(String[] attrs) { - attrs.each { String attr -> - currentWhitelist.addAttributes(currentTag, attr) - } - } - - void enforce(Map attr) { - if(attr) { - currentWhitelist.addEnforcedAttribute(currentTag, attr.attribute, attr.value) - } - } - - void protocols(Map map) { - if (!map?.attribute || !map.value) { - return - } - - List values = (List) (map.value instanceof String ? [ map.value ] : map.value) - - values.each { String protocol -> - currentWhitelist.addProtocols(currentTag, (String)map.attribute, protocol) - } - } -} diff --git a/html-cleaner-plugin/src/test/groovy/org/grails/plugins/htmlcleaner/WhitelistBuilderSpec.groovy b/html-cleaner-plugin/src/test/groovy/org/grails/plugins/htmlcleaner/WhitelistBuilderSpec.groovy deleted file mode 100644 index 03dd8b7..0000000 --- a/html-cleaner-plugin/src/test/groovy/org/grails/plugins/htmlcleaner/WhitelistBuilderSpec.groovy +++ /dev/null @@ -1,98 +0,0 @@ -package org.grails.plugins.htmlcleaner - -import spock.lang.Specification - -class WhitelistBuilderSpec extends Specification { - - private WhitelistBuilder builder = new WhitelistBuilder() - - def confSuccess = { - whitelist("sample") { - startwith "basic" - allow "b", "p", "img" - allow("a") { - attributes "class", "style", "href" - protocols attribute: 'href', value: 'http' - enforce attribute:"rel", value:"nofollow" - } - } - - whitelist("sample2") { - startwith "none" - allow "b", "p", "img" - allow("a") { - attributes "class", "style", "href" - protocols attribute: 'href', value: [ 'http', 'https' ] - enforce attribute:"rel", value:"nofollow" - } - } - - whitelist("sample3") { - startwith "sample2" - allow "span" - allow("a") { - protocols attribute: 'href', value: 'http' - protocols attribute: 'href', value: 'https' - protocols attribute: 'href' // Invalid - protocols value: 'http' // Invalid - } - } - } - - def confWhitelistStartsWithUndefinedWhitelist = { - whitelist("sample") { - startwith "undefined" - allow "b", "p", "img" - } - } - - def confWhitelistWithReservedName = { - whitelist("none") { - startwith "basic" - allow "b", "p", "img" - } - } - - void testWhitelistBuildSuccess() { - Integer numCalled = 0 - - /* - // Need to verify addProtocols() getting called properly, but no get method available on Whitelists. MetaClass gets rolled back so should not leak. - Whitelist.metaClass.addProtocols = { String tagName, String attribute, String protocol -> - assert tagName == 'a' - assert attribute == 'href' - assert protocol in [ 'http', 'https'] - - numCalled++ - }*/ - - when: - Map whiteLists = builder.build(confSuccess) - - then: - whiteLists != null - whiteLists['sample'] != null - whiteLists['sample2'] != null - whiteLists['sample3'] != null - - //numCalled == 5 // One for each valid protocol in the three sample configs. - } - - void testWhitelistStartsWithUndefinedWhitelistShouldFail() { - when: - builder.build(confWhitelistStartsWithUndefinedWhitelist) - - then: - RuntimeException exception = thrown() - "Whitelist [undefined] is not defined" == exception.message - } - - void testWhitelistWithReservedNamesShouldFails() { - when: - builder.build(confWhitelistWithReservedName) - - then: - RuntimeException exception = thrown() - "Whitelist name [none] is reserved" == exception.message - } -} diff --git a/html-cleaner-test-app/.gitignore b/html-cleaner-test-app/.gitignore deleted file mode 100644 index 611ee88..0000000 --- a/html-cleaner-test-app/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -Thumbs.db -.DS_Store -.gradle -build/ -.idea -*.iml -*.ipr -*.iws -.project -.settings -.classpath diff --git a/html-cleaner-test-app/build.gradle b/html-cleaner-test-app/build.gradle deleted file mode 100644 index cb22fd6..0000000 --- a/html-cleaner-test-app/build.gradle +++ /dev/null @@ -1,69 +0,0 @@ -buildscript { - repositories { - mavenLocal() - maven { url "https://repo.grails.org/grails/core" } - } - dependencies { - classpath "org.grails:grails-gradle-plugin:$grailsVersion" - classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.6" - classpath "org.grails.plugins:hibernate5:6.0.4" - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' - } -} - -version "0.1" -group "grails.test" - -apply plugin:"idea" -apply plugin:"war" -apply plugin:"org.grails.grails-web" -apply plugin:"org.grails.grails-gsp" -apply plugin:"asset-pipeline" - -repositories { - mavenLocal() - maven { url "https://repo.grails.org/grails/core" } -} - -dependencyManagement { - imports { - mavenBom "org.grails:grails-bom:$grailsVersion" - } - applyMavenExclusions false -} - -dependencies { - compile project(':html-cleaner') - - compile "org.springframework.boot:spring-boot-starter-logging" - compile "org.springframework.boot:spring-boot-autoconfigure" - compile "org.grails:grails-core" - compile "org.springframework.boot:spring-boot-starter-actuator" - compile "org.springframework.boot:spring-boot-starter-tomcat" - compile "org.grails:grails-dependencies" - compile "org.grails:grails-web-boot" - compile "org.grails.plugins:cache" - compile "org.grails.plugins:scaffolding" - //compile "org.grails.plugins:hibernate5" - //compile "org.hibernate:hibernate-core:5.1.2.Final" - //compile "org.hibernate:hibernate-ehcache:5.1.2.Final" - console "org.grails:grails-console" - profile "org.grails.profiles:web" - runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.6" - runtime "com.h2database:h2" - testCompile "org.grails:grails-plugin-testing" - - //testCompile "org.grails.plugins:geb" - //testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" - //testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" -} - -bootRun { - jvmArgs('-Dspring.output.ansi.enabled=always') -} - - -assets { - minifyJs = true - minifyCss = true -} diff --git a/html-cleaner-test-app/gradle.properties b/html-cleaner-test-app/gradle.properties deleted file mode 100644 index fad431a..0000000 --- a/html-cleaner-test-app/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -grailsVersion=3.2.4 -gradleWrapperVersion=3.0 diff --git a/html-cleaner-test-app/gradle/wrapper/gradle-wrapper.jar b/html-cleaner-test-app/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index deedc7f..0000000 Binary files a/html-cleaner-test-app/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/html-cleaner-test-app/gradle/wrapper/gradle-wrapper.properties b/html-cleaner-test-app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 86185e7..0000000 --- a/html-cleaner-test-app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Nov 27 23:09:32 CET 2015 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip diff --git a/html-cleaner-test-app/gradlew b/html-cleaner-test-app/gradlew deleted file mode 100755 index 9d82f78..0000000 --- a/html-cleaner-test-app/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/html-cleaner-test-app/gradlew.bat b/html-cleaner-test-app/gradlew.bat deleted file mode 100755 index aec9973..0000000 --- a/html-cleaner-test-app/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/html-cleaner-test-app/grails-app/assets/images/apple-touch-icon-retina.png b/html-cleaner-test-app/grails-app/assets/images/apple-touch-icon-retina.png deleted file mode 100644 index 5cc83ed..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/apple-touch-icon-retina.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/apple-touch-icon.png b/html-cleaner-test-app/grails-app/assets/images/apple-touch-icon.png deleted file mode 100644 index aba337f..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/apple-touch-icon.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg b/html-cleaner-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg deleted file mode 100644 index d3fe882..0000000 --- a/html-cleaner-test-app/grails-app/assets/images/grails-cupsonly-logo-white.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/database_add.png b/html-cleaner-test-app/grails-app/assets/images/skin/database_add.png deleted file mode 100644 index 802bd6c..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/database_add.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/database_delete.png b/html-cleaner-test-app/grails-app/assets/images/skin/database_delete.png deleted file mode 100644 index cce652e..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/database_delete.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/database_edit.png b/html-cleaner-test-app/grails-app/assets/images/skin/database_edit.png deleted file mode 100644 index e501b66..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/database_edit.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/database_save.png b/html-cleaner-test-app/grails-app/assets/images/skin/database_save.png deleted file mode 100644 index 44c06dd..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/database_save.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/database_table.png b/html-cleaner-test-app/grails-app/assets/images/skin/database_table.png deleted file mode 100644 index 693709c..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/database_table.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/exclamation.png b/html-cleaner-test-app/grails-app/assets/images/skin/exclamation.png deleted file mode 100644 index c37bd06..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/exclamation.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/house.png b/html-cleaner-test-app/grails-app/assets/images/skin/house.png deleted file mode 100644 index fed6221..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/house.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/information.png b/html-cleaner-test-app/grails-app/assets/images/skin/information.png deleted file mode 100644 index 12cd1ae..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/information.png and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/shadow.jpg b/html-cleaner-test-app/grails-app/assets/images/skin/shadow.jpg deleted file mode 100644 index b7ed44f..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/shadow.jpg and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/sorted_asc.gif b/html-cleaner-test-app/grails-app/assets/images/skin/sorted_asc.gif deleted file mode 100644 index 6b179c1..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/sorted_asc.gif and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/skin/sorted_desc.gif b/html-cleaner-test-app/grails-app/assets/images/skin/sorted_desc.gif deleted file mode 100644 index 38b3a01..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/skin/sorted_desc.gif and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/images/spinner.gif b/html-cleaner-test-app/grails-app/assets/images/spinner.gif deleted file mode 100644 index 1ed786f..0000000 Binary files a/html-cleaner-test-app/grails-app/assets/images/spinner.gif and /dev/null differ diff --git a/html-cleaner-test-app/grails-app/assets/javascripts/application.js b/html-cleaner-test-app/grails-app/assets/javascripts/application.js deleted file mode 100644 index 5c6a18d..0000000 --- a/html-cleaner-test-app/grails-app/assets/javascripts/application.js +++ /dev/null @@ -1,21 +0,0 @@ -// This is a manifest file that'll be compiled into application.js. -// -// Any JavaScript file within this directory can be referenced here using a relative path. -// -// You're free to add application-wide JavaScript to this file, but it's generally better -// to create separate JavaScript files as needed. -// -//= require jquery-2.2.0.min -//= require bootstrap -//= require_tree . -//= require_self - -if (typeof jQuery !== 'undefined') { - (function($) { - $(document).ajaxStart(function() { - $('#spinner').fadeIn(); - }).ajaxStop(function() { - $('#spinner').fadeOut(); - }); - })(jQuery); -} diff --git a/html-cleaner-test-app/grails-app/assets/javascripts/bootstrap.js b/html-cleaner-test-app/grails-app/assets/javascripts/bootstrap.js deleted file mode 100644 index 01fbbcb..0000000 --- a/html-cleaner-test-app/grails-app/assets/javascripts/bootstrap.js +++ /dev/null @@ -1,2363 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ - -if (typeof jQuery === 'undefined') { - throw new Error('Bootstrap\'s JavaScript requires jQuery') -} - -+function ($) { - 'use strict'; - var version = $.fn.jquery.split(' ')[0].split('.') - if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) { - throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3') - } -}(jQuery); - -/* ======================================================================== - * Bootstrap: transition.js v3.3.6 - * http://getbootstrap.com/javascript/#transitions - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' - } - - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } - - return false // explicit for ie8 ( ._.) - } - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false - var $el = this - $(this).one('bsTransitionEnd', function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this - } - - $(function () { - $.support.transition = transitionEnd() - - if (!$.support.transition) return - - $.event.special.bsTransitionEnd = { - bindType: $.support.transition.end, - delegateType: $.support.transition.end, - handle: function (e) { - if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) - } - } - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: alert.js v3.3.6 - * http://getbootstrap.com/javascript/#alerts - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // ALERT CLASS DEFINITION - // ====================== - - var dismiss = '[data-dismiss="alert"]' - var Alert = function (el) { - $(el).on('click', dismiss, this.close) - } - - Alert.VERSION = '3.3.6' - - Alert.TRANSITION_DURATION = 150 - - Alert.prototype.close = function (e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = $(selector) - - if (e) e.preventDefault() - - if (!$parent.length) { - $parent = $this.closest('.alert') - } - - $parent.trigger(e = $.Event('close.bs.alert')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - // detach from parent, fire event then clean up data - $parent.detach().trigger('closed.bs.alert').remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent - .one('bsTransitionEnd', removeElement) - .emulateTransitionEnd(Alert.TRANSITION_DURATION) : - removeElement() - } - - - // ALERT PLUGIN DEFINITION - // ======================= - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.alert') - - if (!data) $this.data('bs.alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - var old = $.fn.alert - - $.fn.alert = Plugin - $.fn.alert.Constructor = Alert - - - // ALERT NO CONFLICT - // ================= - - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } - - - // ALERT DATA-API - // ============== - - $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: button.js v3.3.6 - * http://getbootstrap.com/javascript/#buttons - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // BUTTON PUBLIC CLASS DEFINITION - // ============================== - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - this.isLoading = false - } - - Button.VERSION = '3.3.6' - - Button.DEFAULTS = { - loadingText: 'loading...' - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() - - state += 'Text' - - if (data.resetText == null) $el.data('resetText', $el[val]()) - - // push to event loop to allow forms to submit - setTimeout($.proxy(function () { - $el[val](data[state] == null ? this.options[state] : data[state]) - - if (state == 'loadingText') { - this.isLoading = true - $el.addClass(d).attr(d, d) - } else if (this.isLoading) { - this.isLoading = false - $el.removeClass(d).removeAttr(d) - } - }, this), 0) - } - - Button.prototype.toggle = function () { - var changed = true - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if ($parent.length) { - var $input = this.$element.find('input') - if ($input.prop('type') == 'radio') { - if ($input.prop('checked')) changed = false - $parent.find('.active').removeClass('active') - this.$element.addClass('active') - } else if ($input.prop('type') == 'checkbox') { - if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false - this.$element.toggleClass('active') - } - $input.prop('checked', this.$element.hasClass('active')) - if (changed) $input.trigger('change') - } else { - this.$element.attr('aria-pressed', !this.$element.hasClass('active')) - this.$element.toggleClass('active') - } - } - - - // BUTTON PLUGIN DEFINITION - // ======================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.button') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.button', (data = new Button(this, options))) - - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - var old = $.fn.button - - $.fn.button = Plugin - $.fn.button.Constructor = Button - - - // BUTTON NO CONFLICT - // ================== - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - // BUTTON DATA-API - // =============== - - $(document) - .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - Plugin.call($btn, 'toggle') - if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() - }) - .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { - $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: carousel.js v3.3.6 - * http://getbootstrap.com/javascript/#carousel - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = null - this.sliding = null - this.interval = null - this.$active = null - this.$items = null - - this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) - - this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element - .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) - .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) - } - - Carousel.VERSION = '3.3.6' - - Carousel.TRANSITION_DURATION = 600 - - Carousel.DEFAULTS = { - interval: 5000, - pause: 'hover', - wrap: true, - keyboard: true - } - - Carousel.prototype.keydown = function (e) { - if (/input|textarea/i.test(e.target.tagName)) return - switch (e.which) { - case 37: this.prev(); break - case 39: this.next(); break - default: return - } - - e.preventDefault() - } - - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) - - this.interval && clearInterval(this.interval) - - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - - return this - } - - Carousel.prototype.getItemIndex = function (item) { - this.$items = item.parent().children('.item') - return this.$items.index(item || this.$active) - } - - Carousel.prototype.getItemForDirection = function (direction, active) { - var activeIndex = this.getItemIndex(active) - var willWrap = (direction == 'prev' && activeIndex === 0) - || (direction == 'next' && activeIndex == (this.$items.length - 1)) - if (willWrap && !this.options.wrap) return active - var delta = direction == 'prev' ? -1 : 1 - var itemIndex = (activeIndex + delta) % this.$items.length - return this.$items.eq(itemIndex) - } - - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" - if (activeIndex == pos) return this.pause().cycle() - - return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) - } - - Carousel.prototype.pause = function (e) { - e || (this.paused = true) - - if (this.$element.find('.next, .prev').length && $.support.transition) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - - this.interval = clearInterval(this.interval) - - return this - } - - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } - - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } - - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || this.getItemForDirection(type, $active) - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var that = this - - if ($next.hasClass('active')) return (this.sliding = false) - - var relatedTarget = $next[0] - var slideEvent = $.Event('slide.bs.carousel', { - relatedTarget: relatedTarget, - direction: direction - }) - this.$element.trigger(slideEvent) - if (slideEvent.isDefaultPrevented()) return - - this.sliding = true - - isCycling && this.pause() - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) - $nextIndicator && $nextIndicator.addClass('active') - } - - var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" - if ($.support.transition && this.$element.hasClass('slide')) { - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one('bsTransitionEnd', function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { - that.$element.trigger(slidEvent) - }, 0) - }) - .emulateTransitionEnd(Carousel.TRANSITION_DURATION) - } else { - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger(slidEvent) - } - - isCycling && this.cycle() - - return this - } - - - // CAROUSEL PLUGIN DEFINITION - // ========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide - - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - var old = $.fn.carousel - - $.fn.carousel = Plugin - $.fn.carousel.Constructor = Carousel - - - // CAROUSEL NO CONFLICT - // ==================== - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - - // CAROUSEL DATA-API - // ================= - - var clickHandler = function (e) { - var href - var $this = $(this) - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 - if (!$target.hasClass('carousel')) return - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false - - Plugin.call($target, options) - - if (slideIndex) { - $target.data('bs.carousel').to(slideIndex) - } - - e.preventDefault() - } - - $(document) - .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) - .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) - - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - Plugin.call($carousel, $carousel.data()) - }) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: collapse.js v3.3.6 - * http://getbootstrap.com/javascript/#collapse - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + - '[data-toggle="collapse"][data-target="#' + element.id + '"]') - this.transitioning = null - - if (this.options.parent) { - this.$parent = this.getParent() - } else { - this.addAriaAndCollapsedClass(this.$element, this.$trigger) - } - - if (this.options.toggle) this.toggle() - } - - Collapse.VERSION = '3.3.6' - - Collapse.TRANSITION_DURATION = 350 - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return - - var activesData - var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') - - if (actives && actives.length) { - activesData = actives.data('bs.collapse') - if (activesData && activesData.transitioning) return - } - - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - if (actives && actives.length) { - Plugin.call(actives, 'hide') - activesData || actives.data('bs.collapse', null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing')[dimension](0) - .attr('aria-expanded', true) - - this.$trigger - .removeClass('collapsed') - .attr('aria-expanded', true) - - this.transitioning = 1 - - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('collapse in')[dimension]('') - this.transitioning = 0 - this.$element - .trigger('shown.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element[dimension](this.$element[dimension]())[0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse in') - .attr('aria-expanded', false) - - this.$trigger - .addClass('collapsed') - .attr('aria-expanded', false) - - this.transitioning = 1 - - var complete = function () { - this.transitioning = 0 - this.$element - .removeClass('collapsing') - .addClass('collapse') - .trigger('hidden.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - this.$element - [dimension](0) - .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(Collapse.TRANSITION_DURATION) - } - - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - Collapse.prototype.getParent = function () { - return $(this.options.parent) - .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') - .each($.proxy(function (i, element) { - var $element = $(element) - this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) - }, this)) - .end() - } - - Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { - var isOpen = $element.hasClass('in') - - $element.attr('aria-expanded', isOpen) - $trigger - .toggleClass('collapsed', !isOpen) - .attr('aria-expanded', isOpen) - } - - function getTargetFromTrigger($trigger) { - var href - var target = $trigger.attr('data-target') - || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 - - return $(target) - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.collapse - - $.fn.collapse = Plugin - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { - var $this = $(this) - - if (!$this.attr('data-target')) e.preventDefault() - - var $target = getTargetFromTrigger($this) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() - - Plugin.call($target, option) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: dropdown.js v3.3.6 - * http://getbootstrap.com/javascript/#dropdowns - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // DROPDOWN CLASS DEFINITION - // ========================= - - var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle="dropdown"]' - var Dropdown = function (element) { - $(element).on('click.bs.dropdown', this.toggle) - } - - Dropdown.VERSION = '3.3.6' - - function getParent($this) { - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = selector && $(selector) - - return $parent && $parent.length ? $parent : $this.parent() - } - - function clearMenus(e) { - if (e && e.which === 3) return - $(backdrop).remove() - $(toggle).each(function () { - var $this = $(this) - var $parent = getParent($this) - var relatedTarget = { relatedTarget: this } - - if (!$parent.hasClass('open')) return - - if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return - - $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) - - if (e.isDefaultPrevented()) return - - $this.attr('aria-expanded', 'false') - $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) - }) - } - - Dropdown.prototype.toggle = function (e) { - var $this = $(this) - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we use a backdrop because click events don't delegate - $(document.createElement('div')) - .addClass('dropdown-backdrop') - .insertAfter($(this)) - .on('click', clearMenus) - } - - var relatedTarget = { relatedTarget: this } - $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) - - if (e.isDefaultPrevented()) return - - $this - .trigger('focus') - .attr('aria-expanded', 'true') - - $parent - .toggleClass('open') - .trigger($.Event('shown.bs.dropdown', relatedTarget)) - } - - return false - } - - Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return - - var $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - if (!isActive && e.which != 27 || isActive && e.which == 27) { - if (e.which == 27) $parent.find(toggle).trigger('focus') - return $this.trigger('click') - } - - var desc = ' li:not(.disabled):visible a' - var $items = $parent.find('.dropdown-menu' + desc) - - if (!$items.length) return - - var index = $items.index(e.target) - - if (e.which == 38 && index > 0) index-- // up - if (e.which == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items.eq(index).trigger('focus') - } - - - // DROPDOWN PLUGIN DEFINITION - // ========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.dropdown') - - if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - var old = $.fn.dropdown - - $.fn.dropdown = Plugin - $.fn.dropdown.Constructor = Dropdown - - - // DROPDOWN NO CONFLICT - // ==================== - - $.fn.dropdown.noConflict = function () { - $.fn.dropdown = old - return this - } - - - // APPLY TO STANDARD DROPDOWN ELEMENTS - // =================================== - - $(document) - .on('click.bs.dropdown.data-api', clearMenus) - .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) - .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: modal.js v3.3.6 - * http://getbootstrap.com/javascript/#modals - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // MODAL CLASS DEFINITION - // ====================== - - var Modal = function (element, options) { - this.options = options - this.$body = $(document.body) - this.$element = $(element) - this.$dialog = this.$element.find('.modal-dialog') - this.$backdrop = null - this.isShown = null - this.originalBodyPad = null - this.scrollbarWidth = 0 - this.ignoreBackdropClick = false - - if (this.options.remote) { - this.$element - .find('.modal-content') - .load(this.options.remote, $.proxy(function () { - this.$element.trigger('loaded.bs.modal') - }, this)) - } - } - - Modal.VERSION = '3.3.6' - - Modal.TRANSITION_DURATION = 300 - Modal.BACKDROP_TRANSITION_DURATION = 150 - - Modal.DEFAULTS = { - backdrop: true, - keyboard: true, - show: true - } - - Modal.prototype.toggle = function (_relatedTarget) { - return this.isShown ? this.hide() : this.show(_relatedTarget) - } - - Modal.prototype.show = function (_relatedTarget) { - var that = this - var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) - - this.$element.trigger(e) - - if (this.isShown || e.isDefaultPrevented()) return - - this.isShown = true - - this.checkScrollbar() - this.setScrollbar() - this.$body.addClass('modal-open') - - this.escape() - this.resize() - - this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) - - this.$dialog.on('mousedown.dismiss.bs.modal', function () { - that.$element.one('mouseup.dismiss.bs.modal', function (e) { - if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true - }) - }) - - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') - - if (!that.$element.parent().length) { - that.$element.appendTo(that.$body) // don't move modals dom position - } - - that.$element - .show() - .scrollTop(0) - - that.adjustDialog() - - if (transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element.addClass('in') - - that.enforceFocus() - - var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) - - transition ? - that.$dialog // wait for modal to slide in - .one('bsTransitionEnd', function () { - that.$element.trigger('focus').trigger(e) - }) - .emulateTransitionEnd(Modal.TRANSITION_DURATION) : - that.$element.trigger('focus').trigger(e) - }) - } - - Modal.prototype.hide = function (e) { - if (e) e.preventDefault() - - e = $.Event('hide.bs.modal') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - this.resize() - - $(document).off('focusin.bs.modal') - - this.$element - .removeClass('in') - .off('click.dismiss.bs.modal') - .off('mouseup.dismiss.bs.modal') - - this.$dialog.off('mousedown.dismiss.bs.modal') - - $.support.transition && this.$element.hasClass('fade') ? - this.$element - .one('bsTransitionEnd', $.proxy(this.hideModal, this)) - .emulateTransitionEnd(Modal.TRANSITION_DURATION) : - this.hideModal() - } - - Modal.prototype.enforceFocus = function () { - $(document) - .off('focusin.bs.modal') // guard against infinite focus loop - .on('focusin.bs.modal', $.proxy(function (e) { - if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.trigger('focus') - } - }, this)) - } - - Modal.prototype.escape = function () { - if (this.isShown && this.options.keyboard) { - this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { - e.which == 27 && this.hide() - }, this)) - } else if (!this.isShown) { - this.$element.off('keydown.dismiss.bs.modal') - } - } - - Modal.prototype.resize = function () { - if (this.isShown) { - $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) - } else { - $(window).off('resize.bs.modal') - } - } - - Modal.prototype.hideModal = function () { - var that = this - this.$element.hide() - this.backdrop(function () { - that.$body.removeClass('modal-open') - that.resetAdjustments() - that.resetScrollbar() - that.$element.trigger('hidden.bs.modal') - }) - } - - Modal.prototype.removeBackdrop = function () { - this.$backdrop && this.$backdrop.remove() - this.$backdrop = null - } - - Modal.prototype.backdrop = function (callback) { - var that = this - var animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $(document.createElement('div')) - .addClass('modal-backdrop ' + animate) - .appendTo(this.$body) - - this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { - if (this.ignoreBackdropClick) { - this.ignoreBackdropClick = false - return - } - if (e.target !== e.currentTarget) return - this.options.backdrop == 'static' - ? this.$element[0].focus() - : this.hide() - }, this)) - - if (doAnimate) this.$backdrop[0].offsetWidth // force reflow - - this.$backdrop.addClass('in') - - if (!callback) return - - doAnimate ? - this.$backdrop - .one('bsTransitionEnd', callback) - .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : - callback() - - } else if (!this.isShown && this.$backdrop) { - this.$backdrop.removeClass('in') - - var callbackRemove = function () { - that.removeBackdrop() - callback && callback() - } - $.support.transition && this.$element.hasClass('fade') ? - this.$backdrop - .one('bsTransitionEnd', callbackRemove) - .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : - callbackRemove() - - } else if (callback) { - callback() - } - } - - // these following methods are used to handle overflowing modals - - Modal.prototype.handleUpdate = function () { - this.adjustDialog() - } - - Modal.prototype.adjustDialog = function () { - var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight - - this.$element.css({ - paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', - paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' - }) - } - - Modal.prototype.resetAdjustments = function () { - this.$element.css({ - paddingLeft: '', - paddingRight: '' - }) - } - - Modal.prototype.checkScrollbar = function () { - var fullWindowWidth = window.innerWidth - if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 - var documentElementRect = document.documentElement.getBoundingClientRect() - fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) - } - this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth - this.scrollbarWidth = this.measureScrollbar() - } - - Modal.prototype.setScrollbar = function () { - var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) - this.originalBodyPad = document.body.style.paddingRight || '' - if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) - } - - Modal.prototype.resetScrollbar = function () { - this.$body.css('padding-right', this.originalBodyPad) - } - - Modal.prototype.measureScrollbar = function () { // thx walsh - var scrollDiv = document.createElement('div') - scrollDiv.className = 'modal-scrollbar-measure' - this.$body.append(scrollDiv) - var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth - this.$body[0].removeChild(scrollDiv) - return scrollbarWidth - } - - - // MODAL PLUGIN DEFINITION - // ======================= - - function Plugin(option, _relatedTarget) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.modal') - var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data) $this.data('bs.modal', (data = new Modal(this, options))) - if (typeof option == 'string') data[option](_relatedTarget) - else if (options.show) data.show(_relatedTarget) - }) - } - - var old = $.fn.modal - - $.fn.modal = Plugin - $.fn.modal.Constructor = Modal - - - // MODAL NO CONFLICT - // ================= - - $.fn.modal.noConflict = function () { - $.fn.modal = old - return this - } - - - // MODAL DATA-API - // ============== - - $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { - var $this = $(this) - var href = $this.attr('href') - var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 - var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) - - if ($this.is('a')) e.preventDefault() - - $target.one('show.bs.modal', function (showEvent) { - if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown - $target.one('hidden.bs.modal', function () { - $this.is(':visible') && $this.trigger('focus') - }) - }) - Plugin.call($target, option, this) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: tooltip.js v3.3.6 - * http://getbootstrap.com/javascript/#tooltip - * Inspired by the original jQuery.tipsy by Jason Frame - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // TOOLTIP PUBLIC CLASS DEFINITION - // =============================== - - var Tooltip = function (element, options) { - this.type = null - this.options = null - this.enabled = null - this.timeout = null - this.hoverState = null - this.$element = null - this.inState = null - - this.init('tooltip', element, options) - } - - Tooltip.VERSION = '3.3.6' - - Tooltip.TRANSITION_DURATION = 150 - - Tooltip.DEFAULTS = { - animation: true, - placement: 'top', - selector: false, - template: '', - trigger: 'hover focus', - title: '', - delay: 0, - html: false, - container: false, - viewport: { - selector: 'body', - padding: 0 - } - } - - Tooltip.prototype.init = function (type, element, options) { - this.enabled = true - this.type = type - this.$element = $(element) - this.options = this.getOptions(options) - this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) - this.inState = { click: false, hover: false, focus: false } - - if (this.$element[0] instanceof document.constructor && !this.options.selector) { - throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') - } - - var triggers = this.options.trigger.split(' ') - - for (var i = triggers.length; i--;) { - var trigger = triggers[i] - - if (trigger == 'click') { - this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) - } else if (trigger != 'manual') { - var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' - var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' - - this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) - this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) - } - } - - this.options.selector ? - (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : - this.fixTitle() - } - - Tooltip.prototype.getDefaults = function () { - return Tooltip.DEFAULTS - } - - Tooltip.prototype.getOptions = function (options) { - options = $.extend({}, this.getDefaults(), this.$element.data(), options) - - if (options.delay && typeof options.delay == 'number') { - options.delay = { - show: options.delay, - hide: options.delay - } - } - - return options - } - - Tooltip.prototype.getDelegateOptions = function () { - var options = {} - var defaults = this.getDefaults() - - this._options && $.each(this._options, function (key, value) { - if (defaults[key] != value) options[key] = value - }) - - return options - } - - Tooltip.prototype.enter = function (obj) { - var self = obj instanceof this.constructor ? - obj : $(obj.currentTarget).data('bs.' + this.type) - - if (!self) { - self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) - $(obj.currentTarget).data('bs.' + this.type, self) - } - - if (obj instanceof $.Event) { - self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true - } - - if (self.tip().hasClass('in') || self.hoverState == 'in') { - self.hoverState = 'in' - return - } - - clearTimeout(self.timeout) - - self.hoverState = 'in' - - if (!self.options.delay || !self.options.delay.show) return self.show() - - self.timeout = setTimeout(function () { - if (self.hoverState == 'in') self.show() - }, self.options.delay.show) - } - - Tooltip.prototype.isInStateTrue = function () { - for (var key in this.inState) { - if (this.inState[key]) return true - } - - return false - } - - Tooltip.prototype.leave = function (obj) { - var self = obj instanceof this.constructor ? - obj : $(obj.currentTarget).data('bs.' + this.type) - - if (!self) { - self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) - $(obj.currentTarget).data('bs.' + this.type, self) - } - - if (obj instanceof $.Event) { - self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false - } - - if (self.isInStateTrue()) return - - clearTimeout(self.timeout) - - self.hoverState = 'out' - - if (!self.options.delay || !self.options.delay.hide) return self.hide() - - self.timeout = setTimeout(function () { - if (self.hoverState == 'out') self.hide() - }, self.options.delay.hide) - } - - Tooltip.prototype.show = function () { - var e = $.Event('show.bs.' + this.type) - - if (this.hasContent() && this.enabled) { - this.$element.trigger(e) - - var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) - if (e.isDefaultPrevented() || !inDom) return - var that = this - - var $tip = this.tip() - - var tipId = this.getUID(this.type) - - this.setContent() - $tip.attr('id', tipId) - this.$element.attr('aria-describedby', tipId) - - if (this.options.animation) $tip.addClass('fade') - - var placement = typeof this.options.placement == 'function' ? - this.options.placement.call(this, $tip[0], this.$element[0]) : - this.options.placement - - var autoToken = /\s?auto?\s?/i - var autoPlace = autoToken.test(placement) - if (autoPlace) placement = placement.replace(autoToken, '') || 'top' - - $tip - .detach() - .css({ top: 0, left: 0, display: 'block' }) - .addClass(placement) - .data('bs.' + this.type, this) - - this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) - this.$element.trigger('inserted.bs.' + this.type) - - var pos = this.getPosition() - var actualWidth = $tip[0].offsetWidth - var actualHeight = $tip[0].offsetHeight - - if (autoPlace) { - var orgPlacement = placement - var viewportDim = this.getPosition(this.$viewport) - - placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : - placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : - placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : - placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : - placement - - $tip - .removeClass(orgPlacement) - .addClass(placement) - } - - var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) - - this.applyPlacement(calculatedOffset, placement) - - var complete = function () { - var prevHoverState = that.hoverState - that.$element.trigger('shown.bs.' + that.type) - that.hoverState = null - - if (prevHoverState == 'out') that.leave(that) - } - - $.support.transition && this.$tip.hasClass('fade') ? - $tip - .one('bsTransitionEnd', complete) - .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : - complete() - } - } - - Tooltip.prototype.applyPlacement = function (offset, placement) { - var $tip = this.tip() - var width = $tip[0].offsetWidth - var height = $tip[0].offsetHeight - - // manually read margins because getBoundingClientRect includes difference - var marginTop = parseInt($tip.css('margin-top'), 10) - var marginLeft = parseInt($tip.css('margin-left'), 10) - - // we must check for NaN for ie 8/9 - if (isNaN(marginTop)) marginTop = 0 - if (isNaN(marginLeft)) marginLeft = 0 - - offset.top += marginTop - offset.left += marginLeft - - // $.fn.offset doesn't round pixel values - // so we use setOffset directly with our own function B-0 - $.offset.setOffset($tip[0], $.extend({ - using: function (props) { - $tip.css({ - top: Math.round(props.top), - left: Math.round(props.left) - }) - } - }, offset), 0) - - $tip.addClass('in') - - // check to see if placing tip in new offset caused the tip to resize itself - var actualWidth = $tip[0].offsetWidth - var actualHeight = $tip[0].offsetHeight - - if (placement == 'top' && actualHeight != height) { - offset.top = offset.top + height - actualHeight - } - - var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) - - if (delta.left) offset.left += delta.left - else offset.top += delta.top - - var isVertical = /top|bottom/.test(placement) - var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight - var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' - - $tip.offset(offset) - this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) - } - - Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { - this.arrow() - .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') - .css(isVertical ? 'top' : 'left', '') - } - - Tooltip.prototype.setContent = function () { - var $tip = this.tip() - var title = this.getTitle() - - $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) - $tip.removeClass('fade in top bottom left right') - } - - Tooltip.prototype.hide = function (callback) { - var that = this - var $tip = $(this.$tip) - var e = $.Event('hide.bs.' + this.type) - - function complete() { - if (that.hoverState != 'in') $tip.detach() - that.$element - .removeAttr('aria-describedby') - .trigger('hidden.bs.' + that.type) - callback && callback() - } - - this.$element.trigger(e) - - if (e.isDefaultPrevented()) return - - $tip.removeClass('in') - - $.support.transition && $tip.hasClass('fade') ? - $tip - .one('bsTransitionEnd', complete) - .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : - complete() - - this.hoverState = null - - return this - } - - Tooltip.prototype.fixTitle = function () { - var $e = this.$element - if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { - $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') - } - } - - Tooltip.prototype.hasContent = function () { - return this.getTitle() - } - - Tooltip.prototype.getPosition = function ($element) { - $element = $element || this.$element - - var el = $element[0] - var isBody = el.tagName == 'BODY' - - var elRect = el.getBoundingClientRect() - if (elRect.width == null) { - // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 - elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) - } - var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() - var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } - var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null - - return $.extend({}, elRect, scroll, outerDims, elOffset) - } - - Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { - return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : - placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : - /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } - - } - - Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { - var delta = { top: 0, left: 0 } - if (!this.$viewport) return delta - - var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 - var viewportDimensions = this.getPosition(this.$viewport) - - if (/right|left/.test(placement)) { - var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll - var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight - if (topEdgeOffset < viewportDimensions.top) { // top overflow - delta.top = viewportDimensions.top - topEdgeOffset - } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow - delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset - } - } else { - var leftEdgeOffset = pos.left - viewportPadding - var rightEdgeOffset = pos.left + viewportPadding + actualWidth - if (leftEdgeOffset < viewportDimensions.left) { // left overflow - delta.left = viewportDimensions.left - leftEdgeOffset - } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow - delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset - } - } - - return delta - } - - Tooltip.prototype.getTitle = function () { - var title - var $e = this.$element - var o = this.options - - title = $e.attr('data-original-title') - || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) - - return title - } - - Tooltip.prototype.getUID = function (prefix) { - do prefix += ~~(Math.random() * 1000000) - while (document.getElementById(prefix)) - return prefix - } - - Tooltip.prototype.tip = function () { - if (!this.$tip) { - this.$tip = $(this.options.template) - if (this.$tip.length != 1) { - throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') - } - } - return this.$tip - } - - Tooltip.prototype.arrow = function () { - return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) - } - - Tooltip.prototype.enable = function () { - this.enabled = true - } - - Tooltip.prototype.disable = function () { - this.enabled = false - } - - Tooltip.prototype.toggleEnabled = function () { - this.enabled = !this.enabled - } - - Tooltip.prototype.toggle = function (e) { - var self = this - if (e) { - self = $(e.currentTarget).data('bs.' + this.type) - if (!self) { - self = new this.constructor(e.currentTarget, this.getDelegateOptions()) - $(e.currentTarget).data('bs.' + this.type, self) - } - } - - if (e) { - self.inState.click = !self.inState.click - if (self.isInStateTrue()) self.enter(self) - else self.leave(self) - } else { - self.tip().hasClass('in') ? self.leave(self) : self.enter(self) - } - } - - Tooltip.prototype.destroy = function () { - var that = this - clearTimeout(this.timeout) - this.hide(function () { - that.$element.off('.' + that.type).removeData('bs.' + that.type) - if (that.$tip) { - that.$tip.detach() - } - that.$tip = null - that.$arrow = null - that.$viewport = null - }) - } - - - // TOOLTIP PLUGIN DEFINITION - // ========================= - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.tooltip') - var options = typeof option == 'object' && option - - if (!data && /destroy|hide/.test(option)) return - if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.tooltip - - $.fn.tooltip = Plugin - $.fn.tooltip.Constructor = Tooltip - - - // TOOLTIP NO CONFLICT - // =================== - - $.fn.tooltip.noConflict = function () { - $.fn.tooltip = old - return this - } - -}(jQuery); - -/* ======================================================================== - * Bootstrap: popover.js v3.3.6 - * http://getbootstrap.com/javascript/#popovers - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // POPOVER PUBLIC CLASS DEFINITION - // =============================== - - var Popover = function (element, options) { - this.init('popover', element, options) - } - - if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') - - Popover.VERSION = '3.3.6' - - Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { - placement: 'right', - trigger: 'click', - content: '', - template: '' - }) - - - // NOTE: POPOVER EXTENDS tooltip.js - // ================================ - - Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) - - Popover.prototype.constructor = Popover - - Popover.prototype.getDefaults = function () { - return Popover.DEFAULTS - } - - Popover.prototype.setContent = function () { - var $tip = this.tip() - var title = this.getTitle() - var content = this.getContent() - - $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) - $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events - this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' - ](content) - - $tip.removeClass('fade top bottom left right in') - - // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do - // this manually by checking the contents. - if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() - } - - Popover.prototype.hasContent = function () { - return this.getTitle() || this.getContent() - } - - Popover.prototype.getContent = function () { - var $e = this.$element - var o = this.options - - return $e.attr('data-content') - || (typeof o.content == 'function' ? - o.content.call($e[0]) : - o.content) - } - - Popover.prototype.arrow = function () { - return (this.$arrow = this.$arrow || this.tip().find('.arrow')) - } - - - // POPOVER PLUGIN DEFINITION - // ========================= - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.popover') - var options = typeof option == 'object' && option - - if (!data && /destroy|hide/.test(option)) return - if (!data) $this.data('bs.popover', (data = new Popover(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.popover - - $.fn.popover = Plugin - $.fn.popover.Constructor = Popover - - - // POPOVER NO CONFLICT - // =================== - - $.fn.popover.noConflict = function () { - $.fn.popover = old - return this - } - -}(jQuery); - -/* ======================================================================== - * Bootstrap: scrollspy.js v3.3.6 - * http://getbootstrap.com/javascript/#scrollspy - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // SCROLLSPY CLASS DEFINITION - // ========================== - - function ScrollSpy(element, options) { - this.$body = $(document.body) - this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) - this.options = $.extend({}, ScrollSpy.DEFAULTS, options) - this.selector = (this.options.target || '') + ' .nav li > a' - this.offsets = [] - this.targets = [] - this.activeTarget = null - this.scrollHeight = 0 - - this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) - this.refresh() - this.process() - } - - ScrollSpy.VERSION = '3.3.6' - - ScrollSpy.DEFAULTS = { - offset: 10 - } - - ScrollSpy.prototype.getScrollHeight = function () { - return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) - } - - ScrollSpy.prototype.refresh = function () { - var that = this - var offsetMethod = 'offset' - var offsetBase = 0 - - this.offsets = [] - this.targets = [] - this.scrollHeight = this.getScrollHeight() - - if (!$.isWindow(this.$scrollElement[0])) { - offsetMethod = 'position' - offsetBase = this.$scrollElement.scrollTop() - } - - this.$body - .find(this.selector) - .map(function () { - var $el = $(this) - var href = $el.data('target') || $el.attr('href') - var $href = /^#./.test(href) && $(href) - - return ($href - && $href.length - && $href.is(':visible') - && [[$href[offsetMethod]().top + offsetBase, href]]) || null - }) - .sort(function (a, b) { return a[0] - b[0] }) - .each(function () { - that.offsets.push(this[0]) - that.targets.push(this[1]) - }) - } - - ScrollSpy.prototype.process = function () { - var scrollTop = this.$scrollElement.scrollTop() + this.options.offset - var scrollHeight = this.getScrollHeight() - var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() - var offsets = this.offsets - var targets = this.targets - var activeTarget = this.activeTarget - var i - - if (this.scrollHeight != scrollHeight) { - this.refresh() - } - - if (scrollTop >= maxScroll) { - return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) - } - - if (activeTarget && scrollTop < offsets[0]) { - this.activeTarget = null - return this.clear() - } - - for (i = offsets.length; i--;) { - activeTarget != targets[i] - && scrollTop >= offsets[i] - && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) - && this.activate(targets[i]) - } - } - - ScrollSpy.prototype.activate = function (target) { - this.activeTarget = target - - this.clear() - - var selector = this.selector + - '[data-target="' + target + '"],' + - this.selector + '[href="' + target + '"]' - - var active = $(selector) - .parents('li') - .addClass('active') - - if (active.parent('.dropdown-menu').length) { - active = active - .closest('li.dropdown') - .addClass('active') - } - - active.trigger('activate.bs.scrollspy') - } - - ScrollSpy.prototype.clear = function () { - $(this.selector) - .parentsUntil(this.options.target, '.active') - .removeClass('active') - } - - - // SCROLLSPY PLUGIN DEFINITION - // =========================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.scrollspy') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.scrollspy - - $.fn.scrollspy = Plugin - $.fn.scrollspy.Constructor = ScrollSpy - - - // SCROLLSPY NO CONFLICT - // ===================== - - $.fn.scrollspy.noConflict = function () { - $.fn.scrollspy = old - return this - } - - - // SCROLLSPY DATA-API - // ================== - - $(window).on('load.bs.scrollspy.data-api', function () { - $('[data-spy="scroll"]').each(function () { - var $spy = $(this) - Plugin.call($spy, $spy.data()) - }) - }) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: tab.js v3.3.6 - * http://getbootstrap.com/javascript/#tabs - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // TAB CLASS DEFINITION - // ==================== - - var Tab = function (element) { - // jscs:disable requireDollarBeforejQueryAssignment - this.element = $(element) - // jscs:enable requireDollarBeforejQueryAssignment - } - - Tab.VERSION = '3.3.6' - - Tab.TRANSITION_DURATION = 150 - - Tab.prototype.show = function () { - var $this = this.element - var $ul = $this.closest('ul:not(.dropdown-menu)') - var selector = $this.data('target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - if ($this.parent('li').hasClass('active')) return - - var $previous = $ul.find('.active:last a') - var hideEvent = $.Event('hide.bs.tab', { - relatedTarget: $this[0] - }) - var showEvent = $.Event('show.bs.tab', { - relatedTarget: $previous[0] - }) - - $previous.trigger(hideEvent) - $this.trigger(showEvent) - - if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return - - var $target = $(selector) - - this.activate($this.closest('li'), $ul) - this.activate($target, $target.parent(), function () { - $previous.trigger({ - type: 'hidden.bs.tab', - relatedTarget: $this[0] - }) - $this.trigger({ - type: 'shown.bs.tab', - relatedTarget: $previous[0] - }) - }) - } - - Tab.prototype.activate = function (element, container, callback) { - var $active = container.find('> .active') - var transition = callback - && $.support.transition - && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - .end() - .find('[data-toggle="tab"]') - .attr('aria-expanded', false) - - element - .addClass('active') - .find('[data-toggle="tab"]') - .attr('aria-expanded', true) - - if (transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if (element.parent('.dropdown-menu').length) { - element - .closest('li.dropdown') - .addClass('active') - .end() - .find('[data-toggle="tab"]') - .attr('aria-expanded', true) - } - - callback && callback() - } - - $active.length && transition ? - $active - .one('bsTransitionEnd', next) - .emulateTransitionEnd(Tab.TRANSITION_DURATION) : - next() - - $active.removeClass('in') - } - - - // TAB PLUGIN DEFINITION - // ===================== - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.tab') - - if (!data) $this.data('bs.tab', (data = new Tab(this))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.tab - - $.fn.tab = Plugin - $.fn.tab.Constructor = Tab - - - // TAB NO CONFLICT - // =============== - - $.fn.tab.noConflict = function () { - $.fn.tab = old - return this - } - - - // TAB DATA-API - // ============ - - var clickHandler = function (e) { - e.preventDefault() - Plugin.call($(this), 'show') - } - - $(document) - .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) - .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) - -}(jQuery); - -/* ======================================================================== - * Bootstrap: affix.js v3.3.6 - * http://getbootstrap.com/javascript/#affix - * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // AFFIX CLASS DEFINITION - // ====================== - - var Affix = function (element, options) { - this.options = $.extend({}, Affix.DEFAULTS, options) - - this.$target = $(this.options.target) - .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) - .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) - - this.$element = $(element) - this.affixed = null - this.unpin = null - this.pinnedOffset = null - - this.checkPosition() - } - - Affix.VERSION = '3.3.6' - - Affix.RESET = 'affix affix-top affix-bottom' - - Affix.DEFAULTS = { - offset: 0, - target: window - } - - Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { - var scrollTop = this.$target.scrollTop() - var position = this.$element.offset() - var targetHeight = this.$target.height() - - if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false - - if (this.affixed == 'bottom') { - if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' - return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' - } - - var initializing = this.affixed == null - var colliderTop = initializing ? scrollTop : position.top - var colliderHeight = initializing ? targetHeight : height - - if (offsetTop != null && scrollTop <= offsetTop) return 'top' - if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' - - return false - } - - Affix.prototype.getPinnedOffset = function () { - if (this.pinnedOffset) return this.pinnedOffset - this.$element.removeClass(Affix.RESET).addClass('affix') - var scrollTop = this.$target.scrollTop() - var position = this.$element.offset() - return (this.pinnedOffset = position.top - scrollTop) - } - - Affix.prototype.checkPositionWithEventLoop = function () { - setTimeout($.proxy(this.checkPosition, this), 1) - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var height = this.$element.height() - var offset = this.options.offset - var offsetTop = offset.top - var offsetBottom = offset.bottom - var scrollHeight = Math.max($(document).height(), $(document.body).height()) - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) - - var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) - - if (this.affixed != affix) { - if (this.unpin != null) this.$element.css('top', '') - - var affixType = 'affix' + (affix ? '-' + affix : '') - var e = $.Event(affixType + '.bs.affix') - - this.$element.trigger(e) - - if (e.isDefaultPrevented()) return - - this.affixed = affix - this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null - - this.$element - .removeClass(Affix.RESET) - .addClass(affixType) - .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') - } - - if (affix == 'bottom') { - this.$element.offset({ - top: scrollHeight - height - offsetBottom - }) - } - } - - - // AFFIX PLUGIN DEFINITION - // ======================= - - function Plugin(option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.affix') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - var old = $.fn.affix - - $.fn.affix = Plugin - $.fn.affix.Constructor = Affix - - - // AFFIX NO CONFLICT - // ================= - - $.fn.affix.noConflict = function () { - $.fn.affix = old - return this - } - - - // AFFIX DATA-API - // ============== - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - var data = $spy.data() - - data.offset = data.offset || {} - - if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom - if (data.offsetTop != null) data.offset.top = data.offsetTop - - Plugin.call($spy, data) - }) - }) - -}(jQuery); diff --git a/html-cleaner-test-app/grails-app/assets/javascripts/jquery-2.2.0.min.js b/html-cleaner-test-app/grails-app/assets/javascripts/jquery-2.2.0.min.js deleted file mode 100644 index 06ac263..0000000 --- a/html-cleaner-test-app/grails-app/assets/javascripts/jquery-2.2.0.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.2.0 | (c) jQuery Foundation | 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=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.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 e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.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()},push:g,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!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));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,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!k.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},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){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim: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):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;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,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"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,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=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)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(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 oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(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"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.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},B=b?function(a,b){if(a===b)return l=!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===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.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=fa.selectors={cacheLength:50,createPseudo:ha,match:W,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(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===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]||fa.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]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(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(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.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.replace(P," ")+" ").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(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(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),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?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===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.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 Y.test(a.nodeName)},input:function(a){return X.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:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;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,k=[w,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(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(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 ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(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 va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(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?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(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(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==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=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.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.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&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 u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||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&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},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().progress(c.notify).done(c.resolve).fail(c.reject):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=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--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){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;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},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c}catch(e){}O.set(a,b,c); -}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),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=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(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.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return this;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=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(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.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=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(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,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!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&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");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 K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("