├── js └── jquery │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── bower.json │ ├── component.json │ ├── composer.json │ └── jquery.min.js ├── icons ├── icon128.png ├── icon16.png ├── icon19.png └── icon48.png ├── src ├── options_custom │ ├── icon.png │ ├── custom.css │ ├── js │ │ ├── i18n.js │ │ └── classes │ │ │ ├── tab.js │ │ │ ├── search.js │ │ │ ├── fancy-settings.js │ │ │ └── setting.js │ ├── css │ │ ├── setting.css │ │ └── main.css │ ├── settings.js │ ├── index.html │ ├── i18n.js │ ├── lib │ │ ├── store.js │ │ └── default.css │ ├── README.md │ └── manifest.js ├── browser_action │ └── browser_action.html ├── inject │ └── inject.js └── bg │ └── background.js ├── README.md ├── manifest.json └── _locales └── en └── messages.json /js/jquery/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | jquery-migrate.js 3 | jquery-migrate.min.js 4 | -------------------------------------------------------------------------------- /icons/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shell/bubble-chrome/master/icons/icon128.png -------------------------------------------------------------------------------- /icons/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shell/bubble-chrome/master/icons/icon16.png -------------------------------------------------------------------------------- /icons/icon19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shell/bubble-chrome/master/icons/icon19.png -------------------------------------------------------------------------------- /icons/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shell/bubble-chrome/master/icons/icon48.png -------------------------------------------------------------------------------- /js/jquery/README.md: -------------------------------------------------------------------------------- 1 | jQuery Component 2 | ================ 3 | 4 | Shim repository for jQuery. 5 | -------------------------------------------------------------------------------- /src/options_custom/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shell/bubble-chrome/master/src/options_custom/icon.png -------------------------------------------------------------------------------- /src/options_custom/custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | // Add your own style rules here, not in css/main.css 3 | // or css/setting.css for easy updating reasons. 4 | */ 5 | -------------------------------------------------------------------------------- /js/jquery/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "components-jquery", 3 | "version": "2.0.0", 4 | "description": "jQuery component", 5 | "keywords": ["jquery"], 6 | "main": "./jquery.js" 7 | } 8 | -------------------------------------------------------------------------------- /js/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.0.0", 4 | "description": "jQuery component", 5 | "keywords": [ 6 | "jquery", 7 | "component" 8 | ], 9 | "scripts": [ 10 | "jquery.js" 11 | ], 12 | "license": "MIT" 13 | } 14 | -------------------------------------------------------------------------------- /src/browser_action/browser_action.html: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 |
15 |

Hello extensionizr!

16 |

To shut this popup down, edit the manifest file and remove the "default popup" key. To edit it, just edit ext/browser_action/browser_action.html. The CSS is there, too.

17 |
-------------------------------------------------------------------------------- /js/jquery/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.0.0", 4 | "description": "jQuery component", 5 | "keywords": [ 6 | "jquery", 7 | "component" 8 | ], 9 | "scripts": [ 10 | "jquery.js" 11 | ], 12 | "license": "MIT", 13 | "gitHead": "46f8412bd1bb9b1b30b5b0eb88560e2d4196509c", 14 | "readme": "jQuery Component\n================\n\nShim repository for jQuery.\n", 15 | "readmeFilename": "README.md", 16 | "_id": "jquery@2.0.0", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/components/jquery.git" 20 | } 21 | } -------------------------------------------------------------------------------- /src/inject/inject.js: -------------------------------------------------------------------------------- 1 | chrome.extension.sendMessage({ 2 | origin: window.location.origin 3 | }, function(response) { 4 | var readyStateCheckInterval = setInterval(function() { 5 | if (document.readyState === "complete") { 6 | clearInterval(readyStateCheckInterval) 7 | 8 | var container = response.contentBlock 9 | var searchSelector = response.contentClass 10 | var filters = response.contentFilter 11 | 12 | $(container).map(function() { 13 | body = $(this) 14 | var search = body.find(searchSelector) 15 | 16 | filters.forEach(function(filter) { 17 | if (search.text().includes(filter)) { 18 | body.hide() 19 | } 20 | }) 21 | }) 22 | } 23 | }, 10) 24 | }) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bubble-chrome 2 | 3 | If living in the filter bubble, means never to hear about Gordon Ramay, sign me up! 4 | 5 | ## what 6 | 7 | This extension for Google Chrome browser allows you to live in your own filter bubble. 8 | Install it in to Chrome and configure your trigger-words to hever hear about them browsing your favorite sites 9 | 10 | Mainly I've got annoyed with some tv shows that appear in my feed. Filtering them out. 11 | 12 | ## todo 13 | 14 | 1. configure to store and options from options page 15 | 2. flexible title matching 16 | 3. context menu integration to filter out content 17 | 4. add more sites 18 | 5. per site configuration 19 | 6. update content after any new ajax requests 20 | 21 | ## thanks 22 | 23 | Skeleton generated by https://extensionizr.com -------------------------------------------------------------------------------- /src/options_custom/js/i18n.js: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | // 6 | (function () { 7 | var lang = navigator.language; 8 | if (this.i18n === undefined) { this.i18n = {}; } 9 | this.i18n.get = function (value) { 10 | if (value === "lang") { 11 | return lang; 12 | } 13 | 14 | if (this.hasOwnProperty(value)) { 15 | value = this[value]; 16 | if (value.hasOwnProperty(lang)) { 17 | return value[lang]; 18 | } else if (value.hasOwnProperty("en")) { 19 | return value["en"]; 20 | } else { 21 | return Object.values(value)[0]; 22 | } 23 | } else { 24 | return value; 25 | } 26 | }; 27 | }()); 28 | -------------------------------------------------------------------------------- /js/jquery/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "components/jquery", 3 | "description": "jQuery JavaScript Library", 4 | "type": "component", 5 | "homepage": "http://jquery.com", 6 | "license": "MIT", 7 | "support": { 8 | "irc": "irc://irc.freenode.org/jquery", 9 | "issues": "http://bugs.jquery.com", 10 | "forum": "http://forum.jquery.com", 11 | "wiki": "http://docs.jquery.com/", 12 | "source": "https://github.com/jquery/jquery" 13 | }, 14 | "authors": [ 15 | { 16 | "name": "John Resig", 17 | "email": "jeresig@gmail.com" 18 | } 19 | ], 20 | "require": { 21 | "robloach/component-installer": "*" 22 | }, 23 | "extra": { 24 | "component": { 25 | "scripts": [ 26 | "jquery.js" 27 | ] 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Bubble", 3 | "version": "0.0.1", 4 | "manifest_version": 2, 5 | "description": "Filter unwanted content on the pages across internet", 6 | "homepage_url": "https://github.com/shell/bubble-chrome", 7 | "icons": { 8 | "16": "icons/icon16.png", 9 | "48": "icons/icon48.png", 10 | "128": "icons/icon128.png" 11 | }, 12 | "default_locale": "en", 13 | "background": { 14 | "scripts": [ 15 | "src/bg/background.js" 16 | ], 17 | "persistent": true 18 | }, 19 | "options_page": "src/options_custom/index.html", 20 | "browser_action": { 21 | "default_icon": "icons/icon19.png", 22 | "default_title": "browser action demo", 23 | "default_popup": "src/browser_action/browser_action.html" 24 | }, 25 | "permissions": [ 26 | "" 27 | ], 28 | "content_scripts": [ 29 | { 30 | "matches": [ 31 | "" 32 | ], 33 | "js": [ 34 | "js/jquery/jquery.min.js", 35 | "src/inject/inject.js" 36 | ] 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /src/bg/background.js: -------------------------------------------------------------------------------- 1 | // if you checked "fancy-settings" in extensionizr.com, uncomment this lines 2 | 3 | // var settings = new Store("settings", { 4 | // "sample_setting": "This is how you use Store.js to remember values" 5 | // }); 6 | 7 | //example of using a message handler from the inject scripts 8 | var sites = { 9 | "https://9gag.com": { 10 | contentBlock: '.badge-entry-container', 11 | contentClass: '.badge-item-title' 12 | }, 13 | 14 | "https://www.reddit.com": { 15 | contentBlock: '.thing', 16 | contentClass: '.title' 17 | }, 18 | 19 | "https://eztv.ag": { 20 | contentBlock: 'tr.forum_header_border', 21 | contentClass: '.forum_thread_post' 22 | } 23 | } 24 | 25 | chrome.extension.onMessage.addListener( 26 | function(request, sender, sendResponse) { 27 | var siteMeta = sites[request.origin] 28 | 29 | sendResponse(Object.assign({}, { 30 | contentFilter: [ 31 | // stupid cats 32 | 'cat', 33 | 34 | // "cooks" 35 | 'Gordon Ramsay', 'Babish', 36 | 37 | // comedians 38 | 'Louis C.K.', 'Chappelle', 'Chris Rock', 'Kevin Hart', 'Burr', 39 | 40 | // celebrities 41 | 'Kardashian', 'Kanye', 42 | 43 | // eztv 44 | 'Bong Appetit', 'The Daily Show', 'Seth Meyers', 'Homes Under The Hammer', 'Greys Anatomy', 'Nathan For You', 45 | 'How to Get Away with Murder', '90 Day Fiance', 'River Monsters', 'Gotham', 'The Chris Gethard Show', 46 | 'Criminal Minds', 'Moonshiners', 'Full Frontal With Samantha Bee' 47 | ] 48 | }, siteMeta)); 49 | }); 50 | -------------------------------------------------------------------------------- /src/options_custom/css/setting.css: -------------------------------------------------------------------------------- 1 | /* 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | */ 6 | .tab-content h2 { 7 | margin: 0; 8 | padding-bottom: 5px; 9 | font-size: 26px; 10 | color: #707070; 11 | line-height: 1; 12 | } 13 | 14 | .setting.group { 15 | border-top: 1px solid #EEEEEE; 16 | margin-top: 10px; 17 | padding-top: 5px; 18 | padding-left: 2px; 19 | } 20 | 21 | .setting.group-name { 22 | width: 140px; 23 | padding: 0; 24 | font-size: 14px; 25 | font-weight: bold; 26 | vertical-align: top; 27 | } 28 | 29 | .setting.bundle { 30 | max-width: 600px; 31 | margin-bottom: 5px; 32 | } 33 | 34 | .setting.bundle.list-box { 35 | margin-bottom: 10px; 36 | } 37 | 38 | .setting.label.radio-buttons + .setting.container.radio-buttons { 39 | margin-top: 3px; 40 | } 41 | 42 | .setting.label, .setting.element-label { 43 | margin-right: 15px; 44 | font-size: 13px; 45 | font-weight: normal; 46 | } 47 | 48 | .setting.label.checkbox, .setting.element-label { 49 | margin-left: 5px; 50 | margin-right: 0; 51 | } 52 | 53 | .setting.label.checkbox { 54 | position: relative; 55 | top: 1px; 56 | } 57 | 58 | .setting.element.slider { 59 | position: relative; 60 | width: 150px; 61 | top: 4px; 62 | } 63 | 64 | .setting.element.list-box { 65 | display: block; 66 | height: 100px; 67 | width: 100%; 68 | } 69 | 70 | .setting.display.slider { 71 | margin-left: 5px; 72 | color: #666666; 73 | } 74 | 75 | #nothing-found { 76 | display: none; 77 | margin-top: 10px; 78 | font-size: 18px; 79 | font-weight: lighter; 80 | color: #999999; 81 | } 82 | -------------------------------------------------------------------------------- /src/options_custom/settings.js: -------------------------------------------------------------------------------- 1 | window.addEvent("domready", function () { 2 | // Option 1: Use the manifest: 3 | new FancySettings.initWithManifest(function (settings) { 4 | settings.manifest.myButton.addEvent("action", function () { 5 | alert("You clicked me!"); 6 | }); 7 | }); 8 | 9 | // Option 2: Do everything manually: 10 | /* 11 | var settings = new FancySettings("My Extension", "icon.png"); 12 | 13 | var username = settings.create({ 14 | "tab": i18n.get("information"), 15 | "group": i18n.get("login"), 16 | "name": "username", 17 | "type": "text", 18 | "label": i18n.get("username"), 19 | "text": i18n.get("x-characters") 20 | }); 21 | 22 | var password = settings.create({ 23 | "tab": i18n.get("information"), 24 | "group": i18n.get("login"), 25 | "name": "password", 26 | "type": "text", 27 | "label": i18n.get("password"), 28 | "text": i18n.get("x-characters-pw"), 29 | "masked": true 30 | }); 31 | 32 | var myDescription = settings.create({ 33 | "tab": i18n.get("information"), 34 | "group": i18n.get("login"), 35 | "name": "myDescription", 36 | "type": "description", 37 | "text": i18n.get("description") 38 | }); 39 | 40 | var myButton = settings.create({ 41 | "tab": "Information", 42 | "group": "Logout", 43 | "name": "myButton", 44 | "type": "button", 45 | "label": "Disconnect:", 46 | "text": "Logout" 47 | }); 48 | 49 | // ... 50 | 51 | myButton.addEvent("action", function () { 52 | alert("You clicked me!"); 53 | }); 54 | 55 | settings.align([ 56 | username, 57 | password 58 | ]); 59 | */ 60 | }); 61 | -------------------------------------------------------------------------------- /src/options_custom/index.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 40 |
41 |
42 |

43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /src/options_custom/js/classes/tab.js: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | // 6 | (function () { 7 | var Bundle = new Class({ 8 | "initialize": function (creator) { 9 | this.creator = creator; 10 | 11 | // Create DOM elements 12 | this.tab = new Element("div", {"class": "tab"}); 13 | this.content = new Element("div", {"class": "tab-content"}); 14 | 15 | // Create event handlers 16 | this.tab.addEvent("click", this.activate.bind(this)); 17 | }, 18 | 19 | "activate": function () { 20 | if (this.creator.activeBundle && this.creator.activeBundle !== this) { 21 | this.creator.activeBundle.deactivate(); 22 | } 23 | this.tab.addClass("active"); 24 | this.content.addClass("show"); 25 | this.creator.activeBundle = this; 26 | }, 27 | 28 | "deactivate": function () { 29 | this.tab.removeClass("active"); 30 | this.content.removeClass("show"); 31 | this.creator.activeBundle = null; 32 | } 33 | }); 34 | 35 | this.Tab = new Class({ 36 | "activeBundle": null, 37 | 38 | "initialize": function (tabContainer, tabContentContainer) { 39 | this.tabContainer = tabContainer; 40 | this.tabContentContainer = tabContentContainer; 41 | }, 42 | 43 | "create": function () { 44 | var bundle = new Bundle(this); 45 | bundle.tab.inject(this.tabContainer); 46 | bundle.content.inject(this.tabContentContainer); 47 | if (!this.activeBundle) { bundle.activate(); } 48 | return bundle; 49 | } 50 | }); 51 | }()); 52 | -------------------------------------------------------------------------------- /src/options_custom/i18n.js: -------------------------------------------------------------------------------- 1 | // SAMPLE 2 | this.i18n = { 3 | "settings": { 4 | "en": "Settings", 5 | "de": "Optionen" 6 | }, 7 | "search": { 8 | "en": "Search", 9 | "de": "Suche" 10 | }, 11 | "nothing-found": { 12 | "en": "No matches were found.", 13 | "de": "Keine Übereinstimmungen gefunden." 14 | }, 15 | 16 | 17 | 18 | "information": { 19 | "en": "Information", 20 | "de": "Information" 21 | }, 22 | "login": { 23 | "en": "Login", 24 | "de": "Anmeldung" 25 | }, 26 | "username": { 27 | "en": "Username:", 28 | "de": "Benutzername:" 29 | }, 30 | "password": { 31 | "en": "Password:", 32 | "de": "Passwort:" 33 | }, 34 | "x-characters": { 35 | "en": "6 - 12 characters", 36 | "de": "6 - 12 Zeichen" 37 | }, 38 | "x-characters-pw": { 39 | "en": "10 - 18 characters", 40 | "de": "10 - 18 Zeichen" 41 | }, 42 | "description": { 43 | "en": "This is a description. You can write any text inside of this.
\ 44 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut\ 45 | labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores\ 46 | et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem\ 47 | ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et\ 48 | dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\ 49 | Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.", 50 | 51 | "de": "Das ist eine Beschreibung. Du kannst hier beliebigen Text einfügen.
\ 52 | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut\ 53 | labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores\ 54 | et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem\ 55 | ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et\ 56 | dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.\ 57 | Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." 58 | }, 59 | "logout": { 60 | "en": "Logout", 61 | "de": "Abmeldung" 62 | }, 63 | "enable": { 64 | "en": "Enable", 65 | "de": "Aktivieren" 66 | }, 67 | "disconnect": { 68 | "en": "Disconnect:", 69 | "de": "Trennen:" 70 | } 71 | }; 72 | -------------------------------------------------------------------------------- /src/options_custom/css/main.css: -------------------------------------------------------------------------------- 1 | /* 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | */ 6 | .fancy { 7 | text-shadow: #F5F5F5 0 1px 0; 8 | } 9 | 10 | #sidebar { 11 | position: absolute; 12 | background-color: #EDEDED; 13 | background-image: linear-gradient(top, #EDEDED, #F5F5F5); 14 | background-image: -webkit-gradient( 15 | linear, 16 | left top, 17 | left 500, 18 | color-stop(0, #EDEDED), 19 | color-stop(1, #F5F5F5) 20 | ); 21 | background-image: -moz-linear-gradient( 22 | center top, 23 | #EDEDED 0%, 24 | #F5F5F5 100% 25 | ); 26 | background-image: -o-linear-gradient(top, #EDEDED, #F5F5F5); 27 | width: 219px; 28 | top: 0; 29 | left: 0; 30 | bottom: 0; 31 | border-right: 1px solid #C2C2C2; 32 | box-shadow: inset -8px 0 30px -30px black; 33 | } 34 | 35 | #icon { 36 | position: absolute; 37 | width: 30px; 38 | height: 30px; 39 | top: 12px; 40 | left: 12px; 41 | } 42 | 43 | #sidebar h1 { 44 | position: absolute; 45 | top: 13px; 46 | right: 25px; 47 | font-size: 26px; 48 | color: #707070; 49 | } 50 | 51 | #tab-container { 52 | position: absolute; 53 | top: 50px; 54 | left: 0; 55 | right: 0; 56 | bottom: 0; 57 | overflow-y: auto; 58 | overflow-x: hidden; 59 | text-align: right; 60 | } 61 | 62 | #tab-container .tab { 63 | height: 28px; 64 | padding-right: 25px; 65 | border-top: 1px solid transparent; 66 | border-bottom: 1px solid transparent; 67 | font-size: 12px; 68 | line-height: 28px; 69 | color: #808080; 70 | cursor: pointer; 71 | } 72 | 73 | #search-container { 74 | margin-top: 5px; 75 | margin-bottom: 5px; 76 | padding-right: 23px !important; 77 | cursor: default !important; 78 | } 79 | 80 | #search-container input { 81 | width: 130px; 82 | } 83 | 84 | #tab-container .tab.active, body.searching #search-container { 85 | background-color: #D4D4D4; 86 | border-color: #BFBFBF; 87 | color: black; 88 | text-shadow: #DBDBDB 0 1px 0; 89 | box-shadow: inset -12px 0 30px -30px black; 90 | } 91 | 92 | body.searching #tab-container .tab.active { 93 | background-color: transparent; 94 | border-color: transparent; 95 | color: #808080; 96 | text-shadow: inherit; 97 | box-shadow: none; 98 | } 99 | 100 | #content { 101 | position: absolute; 102 | top: 0; 103 | left: 220px; 104 | right: 0; 105 | bottom: 0; 106 | overflow: auto; 107 | } 108 | 109 | .tab-content { 110 | display: none; 111 | position: absolute; 112 | width: 840px; 113 | top: 0; 114 | left: 0; 115 | bottom: 0; 116 | padding: 20px; 117 | padding-top: 15px; 118 | } 119 | 120 | body.searching .tab-content { 121 | display: none !important; 122 | } 123 | 124 | body.searching #search-result-container { 125 | display: block !important; 126 | } 127 | 128 | body.measuring .tab-content, body.measuring #search-result-container { 129 | display: block !important; 130 | opacity: 0; 131 | overflow: hidden; 132 | } 133 | -------------------------------------------------------------------------------- /src/options_custom/lib/store.js: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/store-js 4 | // License: MIT-license 5 | // 6 | (function () { 7 | var Store = this.Store = function (name, defaults) { 8 | var key; 9 | this.name = name; 10 | 11 | if (defaults !== undefined) { 12 | for (key in defaults) { 13 | if (defaults.hasOwnProperty(key) && this.get(key) === undefined) { 14 | this.set(key, defaults[key]); 15 | } 16 | } 17 | } 18 | }; 19 | 20 | Store.prototype.get = function (name) { 21 | name = "store." + this.name + "." + name; 22 | if (localStorage.getItem(name) === null) { return undefined; } 23 | try { 24 | return JSON.parse(localStorage.getItem(name)); 25 | } catch (e) { 26 | return null; 27 | } 28 | }; 29 | 30 | Store.prototype.set = function (name, value) { 31 | if (value === undefined) { 32 | this.remove(name); 33 | } else { 34 | if (typeof value === "function") { 35 | value = null; 36 | } else { 37 | try { 38 | value = JSON.stringify(value); 39 | } catch (e) { 40 | value = null; 41 | } 42 | } 43 | 44 | localStorage.setItem("store." + this.name + "." + name, value); 45 | } 46 | 47 | return this; 48 | }; 49 | 50 | Store.prototype.remove = function (name) { 51 | localStorage.removeItem("store." + this.name + "." + name); 52 | return this; 53 | }; 54 | 55 | Store.prototype.removeAll = function () { 56 | var name, 57 | i; 58 | 59 | name = "store." + this.name + "."; 60 | for (i = (localStorage.length - 1); i >= 0; i--) { 61 | if (localStorage.key(i).substring(0, name.length) === name) { 62 | localStorage.removeItem(localStorage.key(i)); 63 | } 64 | } 65 | 66 | return this; 67 | }; 68 | 69 | Store.prototype.toObject = function () { 70 | var values, 71 | name, 72 | i, 73 | key, 74 | value; 75 | 76 | values = {}; 77 | name = "store." + this.name + "."; 78 | for (i = (localStorage.length - 1); i >= 0; i--) { 79 | if (localStorage.key(i).substring(0, name.length) === name) { 80 | key = localStorage.key(i).substring(name.length); 81 | value = this.get(key); 82 | if (value !== undefined) { values[key] = value; } 83 | } 84 | } 85 | 86 | return values; 87 | }; 88 | 89 | Store.prototype.fromObject = function (values, merge) { 90 | if (merge !== true) { this.removeAll(); } 91 | for (var key in values) { 92 | if (values.hasOwnProperty(key)) { 93 | this.set(key, values[key]); 94 | } 95 | } 96 | 97 | return this; 98 | }; 99 | }()); 100 | -------------------------------------------------------------------------------- /src/options_custom/README.md: -------------------------------------------------------------------------------- 1 | # [Fancy Settings 1.2](https://github.com/frankkohlhepp/fancy-settings) 2 | *Create fancy, chrome-look-alike settings for your Chrome or Safari extension in minutes!* 3 | 4 | ### Howto 5 | Welcome to Fancy Settings! Are you ready for tabs, groups, search, good style? 6 | Let's get started, it only takes a few minutes... 7 | 8 | Settings can be of different types: text input, checkbox, slider, etc. Some "settings" are not actual settings but provide functionality that is relevant to the options page: description (which is simply a block of text), button. 9 | 10 | Settings are defined in the manifest.js file as JavaScript objects. Each setting is defined by specifying a number of parameters. All types of settings are configured with the string parameters tab, group, name and type. 11 | 12 | ###Basic example: 13 | ```javascript 14 | { 15 | "tab": "Tab 1", 16 | "group": "Group 1", 17 | "name": "checkbox1", 18 | "type": "checkbox" 19 | } 20 | ``` 21 | 22 | "name" is used as a part of the key when storing the setting's value in localStorage. 23 | If it's missing, nothing will be saved. 24 | 25 | ###Additionally, all types of settings are configured with their own custom parameters: 26 | 27 | ###Description ("type": "description") 28 | 29 | text (string) the block of text, which can include HTML tags. You can continue multiple lines of text by putting a \ at the end of a line, just as with any JavaScript file. 30 | 31 | #### 32 | Button ("type": "button") 33 | ``` 34 | Label (string) text shown in front of the button 35 | 36 | Text (string) text shown on the button 37 | ``` 38 | 39 | ####Text ("type": "text") 40 | ``` 41 | label (string) text shown in front of the text field 42 | 43 | text (string) text shown in the text field when empty 44 | 45 | masked (boolean) indicates a password field 46 | ``` 47 | 48 | ####Checkbox ("type": "checkbox") 49 | ``` 50 | label (string) text shown behind the checkbox 51 | ``` 52 | 53 | ####Slider ("type": "slider") 54 | ``` 55 | label (string) text shown in front of the slider 56 | 57 | max (number) maximal value of the slider 58 | 59 | min (number) minimal value of the slider 60 | 61 | step (number) steps between two values 62 | 63 | display (boolean) indicates whether to show the slider display 64 | 65 | displayModifier (function) a function to modify the value shown in the display 66 | ``` 67 | 68 | ####PopupButton ("type": "popupButton"), ListBox ("type": "listBox") & RadioButtons ("type": "radioButtons") 69 | ``` 70 | label (string) text shown in front of the options 71 | 72 | options (array of options) 73 | 74 | where an option can be one of the following formats: 75 | ``` 76 | 77 | ####"value" 78 | ``` 79 | ["value", "displayed text"] 80 | 81 | {value: "value", text: "displayed text"} 82 | ``` 83 | The "displayed text" field is optional and is displayed to the user when you don't want to display the internal value directly to the user. 84 | 85 | #### You can also group options so that the user can easily choose among them (groups may only be applied to popupButtons): 86 | 87 | ```javascript 88 | "options": { 89 | "groups": [ 90 | "Hot", "Cold", 91 | ], 92 | "values": [ 93 | { 94 | "value": "hot", 95 | "text": "Very hot", 96 | "group": "Hot", 97 | }, 98 | { 99 | "value": "Medium", 100 | "group": 1, 101 | }, 102 | { 103 | "value": "Cold", 104 | "group": 2, 105 | }, 106 | ["Non-existing"] 107 | ], 108 | }, 109 | 110 | ``` 111 | 112 | ### License 113 | Fancy Settings is licensed under the **LGPL 2.1**. 114 | For details see *LICENSE.txt* -------------------------------------------------------------------------------- /_locales/en/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "l10nTabName": { 3 | "message":"Localization" 4 | ,"description":"name of the localization tab" 5 | } 6 | ,"l10nHeader": { 7 | "message":"It does localization too! (this whole tab is, actually)" 8 | ,"description":"Header text for the localization section" 9 | } 10 | ,"l10nIntro": { 11 | "message":"'L10n' refers to 'Localization' - 'L' an 'n' are obvious, and 10 comes from the number of letters between those two. It is the process/whatever of displaying something in the language of choice. It uses 'I18n', 'Internationalization', which refers to the tools / framework supporting L10n. I.e., something is internationalized if it has I18n support, and can be localized. Something is localized for you if it is in your language / dialect." 12 | ,"description":"introduce the basic idea." 13 | } 14 | ,"l10nProd": { 15 | "message":"You are planning to allow localization, right? You have no idea who will be using your extension! You have no idea who will be translating it! At least support the basics, it's not hard, and having the framework in place will let you transition much more easily later on." 16 | ,"description":"drive the point home. It's good for you." 17 | } 18 | ,"l10nFirstParagraph": { 19 | "message":"When the options page loads, elements decorated with data-l10n will automatically be localized!" 20 | ,"description":"inform that elements will be localized on load" 21 | } 22 | ,"l10nSecondParagraph": { 23 | "message":"If you need more complex localization, you can also define data-l10n-args. This should contain $containerType$ filled with $dataType$, which will be passed into Chrome's i18n API as $functionArgs$. In fact, this paragraph does just that, and wraps the args in mono-space font. Easy!" 24 | ,"description":"introduce the data-l10n-args attribute. End on a lame note." 25 | ,"placeholders": { 26 | "containerType": { 27 | "content":"$1" 28 | ,"example":"'array', 'list', or something similar" 29 | ,"description":"type of the args container" 30 | } 31 | ,"dataType": { 32 | "content":"$2" 33 | ,"example":"string" 34 | ,"description":"type of data in each array index" 35 | } 36 | ,"functionArgs": { 37 | "content":"$3" 38 | ,"example":"arguments" 39 | ,"description":"whatever you call what you pass into a function/method. args, params, etc." 40 | } 41 | } 42 | } 43 | ,"l10nThirdParagraph": { 44 | "message":"Message contents are passed right into innerHTML without processing - include any tags (or even scripts) that you feel like. If you have an input field, the placeholder will be set instead, and buttons will have the value attribute set." 45 | ,"description":"inform that we handle placeholders, buttons, and direct HTML input" 46 | } 47 | ,"l10nButtonsBefore": { 48 | "message":"Different types of buttons are handled as well. <button> elements have their html set:" 49 | } 50 | ,"l10nButton": { 51 | "message":"in a button" 52 | } 53 | ,"l10nButtonsBetween": { 54 | "message":"while <input type='submit'> and <input type='button'> get their 'value' set (note: no HTML):" 55 | } 56 | ,"l10nSubmit": { 57 | "message":"a submit value" 58 | } 59 | ,"l10nButtonsAfter": { 60 | "message":"Awesome, no?" 61 | } 62 | ,"l10nExtras": { 63 | "message":"You can even set data-l10n on things like the <title> tag, which lets you have translatable page titles, or fieldset <legend> tags, or anywhere else - the default Boil.localize() behavior will check every tag in the document, not just the body." 64 | ,"description":"inform about places which may not be obvious, like , etc" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/options_custom/manifest.js: -------------------------------------------------------------------------------- 1 | // SAMPLE 2 | this.manifest = { 3 | "name": "My Extension", 4 | "icon": "icon.png", 5 | "settings": [ 6 | { 7 | "tab": i18n.get("information"), 8 | "group": i18n.get("login"), 9 | "name": "username", 10 | "type": "text", 11 | "label": i18n.get("username"), 12 | "text": i18n.get("x-characters") 13 | }, 14 | { 15 | "tab": i18n.get("information"), 16 | "group": i18n.get("login"), 17 | "name": "password", 18 | "type": "text", 19 | "label": i18n.get("password"), 20 | "text": i18n.get("x-characters-pw"), 21 | "masked": true 22 | }, 23 | { 24 | "tab": i18n.get("information"), 25 | "group": i18n.get("login"), 26 | "name": "myDescription", 27 | "type": "description", 28 | "text": i18n.get("description") 29 | }, 30 | { 31 | "tab": i18n.get("information"), 32 | "group": i18n.get("logout"), 33 | "name": "myCheckbox", 34 | "type": "checkbox", 35 | "label": i18n.get("enable") 36 | }, 37 | { 38 | "tab": i18n.get("information"), 39 | "group": i18n.get("logout"), 40 | "name": "myButton", 41 | "type": "button", 42 | "label": i18n.get("disconnect"), 43 | "text": i18n.get("logout") 44 | }, 45 | { 46 | "tab": "Details", 47 | "group": "Sound", 48 | "name": "noti_volume", 49 | "type": "slider", 50 | "label": "Notification volume:", 51 | "max": 1, 52 | "min": 0, 53 | "step": 0.01, 54 | "display": true, 55 | "displayModifier": function (value) { 56 | return (value * 100).floor() + "%"; 57 | } 58 | }, 59 | { 60 | "tab": "Details", 61 | "group": "Sound", 62 | "name": "sound_volume", 63 | "type": "slider", 64 | "label": "Sound volume:", 65 | "max": 100, 66 | "min": 0, 67 | "step": 1, 68 | "display": true, 69 | "displayModifier": function (value) { 70 | return value + "%"; 71 | } 72 | }, 73 | { 74 | "tab": "Details", 75 | "group": "Food", 76 | "name": "myPopupButton", 77 | "type": "popupButton", 78 | "label": "Soup 1 should be:", 79 | "options": { 80 | "groups": [ 81 | "Hot", "Cold", 82 | ], 83 | "values": [ 84 | { 85 | "value": "hot", 86 | "text": "Very hot", 87 | "group": "Hot", 88 | }, 89 | { 90 | "value": "Medium", 91 | "group": 1, 92 | }, 93 | { 94 | "value": "Cold", 95 | "group": 2, 96 | }, 97 | ["Non-existing"] 98 | ], 99 | }, 100 | }, 101 | { 102 | "tab": "Details", 103 | "group": "Food", 104 | "name": "myListBox", 105 | "type": "listBox", 106 | "label": "Soup 2 should be:", 107 | "options": [ 108 | ["hot", "Hot and yummy"], 109 | ["cold"] 110 | ] 111 | }, 112 | { 113 | "tab": "Details", 114 | "group": "Food", 115 | "name": "myRadioButtons", 116 | "type": "radioButtons", 117 | "label": "Soup 3 should be:", 118 | "options": [ 119 | ["hot", "Hot and yummy"], 120 | ["cold"] 121 | ] 122 | } 123 | ], 124 | "alignment": [ 125 | [ 126 | "username", 127 | "password" 128 | ], 129 | [ 130 | "noti_volume", 131 | "sound_volume" 132 | ] 133 | ] 134 | }; 135 | -------------------------------------------------------------------------------- /src/options_custom/js/classes/search.js: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | // 6 | (function () { 7 | this.Search = new Class({ 8 | "index": [], 9 | "groups": {}, 10 | 11 | "initialize": function (search, searchResultContainer) { 12 | var setting, 13 | find; 14 | 15 | this.search = search; 16 | this.searchResultContainer = searchResultContainer; 17 | this.setting = new Setting(new Element("div")); 18 | 19 | // Create setting for message "nothing found" 20 | setting = new Setting(this.searchResultContainer); 21 | this.nothingFound = setting.create({ 22 | "type": "description", 23 | "text": (i18n.get("nothing-found") || "No matches were found.") 24 | }); 25 | this.nothingFound.bundle.set("id", "nothing-found"); 26 | 27 | // Create event handlers 28 | find = (function (event) { 29 | this.find(event.target.get("value")); 30 | }).bind(this); 31 | 32 | this.search.addEvent("keyup", (function (event) { 33 | if (event.key === "esc") { 34 | this.reset(); 35 | } else { 36 | find(event); 37 | } 38 | }).bind(this)); 39 | this.search.addEventListener("search", find, false); 40 | }, 41 | 42 | "bind": function (tab) { 43 | tab.addEvent("click", this.reset.bind(this)); 44 | }, 45 | 46 | "add": function (setting) { 47 | var searchSetting = this.setting.create(setting.params); 48 | setting.search = searchSetting; 49 | searchSetting.original = setting; 50 | this.index.push(searchSetting); 51 | 52 | setting.addEvent("action", function (value, stopPropagation) { 53 | if (searchSetting.set !== undefined && stopPropagation !== true) { 54 | searchSetting.set(value, true); 55 | } 56 | }); 57 | searchSetting.addEvent("action", function (value) { 58 | if (setting.set !== undefined) { 59 | setting.set(value, true); 60 | } 61 | setting.fireEvent("action", [value, true]); 62 | }); 63 | }, 64 | 65 | "find": function (searchString) { 66 | // Exit search mode 67 | if (searchString.trim() === "") { 68 | document.body.removeClass("searching"); 69 | return; 70 | } 71 | 72 | // Or enter search mode 73 | this.index.each(function (setting) { setting.bundle.dispose(); }); 74 | Object.each(this.groups, function (group) { group.dispose(); }); 75 | document.body.addClass("searching"); 76 | 77 | // Filter settings 78 | var result = this.index.filter(function (setting) { 79 | if (setting.params.searchString.contains(searchString.trim().toLowerCase())) { 80 | return true; 81 | } 82 | }); 83 | 84 | // Display settings 85 | result.each((function (setting) { 86 | var group, 87 | row; 88 | 89 | // Create group if it doesn't exist already 90 | if (this.groups[setting.params.group] === undefined) { 91 | this.groups[setting.params.group] = (new Element("table", { 92 | "class": "setting group" 93 | })).inject(this.searchResultContainer); 94 | 95 | group = this.groups[setting.params.group]; 96 | row = (new Element("tr")).inject(group); 97 | 98 | (new Element("td", { 99 | "class": "setting group-name", 100 | "text": setting.params.group 101 | })).inject(row); 102 | 103 | group.content = (new Element("td", { 104 | "class": "setting group-content" 105 | })).inject(row); 106 | } else { 107 | group = this.groups[setting.params.group].inject(this.searchResultContainer); 108 | } 109 | 110 | setting.bundle.inject(group.content); 111 | }).bind(this)); 112 | 113 | if (result.length === 0) { 114 | this.nothingFound.bundle.addClass("show"); 115 | } else { 116 | this.nothingFound.bundle.removeClass("show"); 117 | } 118 | }, 119 | 120 | "reset": function () { 121 | this.search.set("value", ""); 122 | this.search.blur(); 123 | this.find(""); 124 | } 125 | }); 126 | }()); 127 | -------------------------------------------------------------------------------- /src/options_custom/js/classes/fancy-settings.js: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | // 6 | (function () { 7 | var FancySettings = this.FancySettings = new Class({ 8 | "tabs": {}, 9 | 10 | "initialize": function (name, icon) { 11 | // Set title and icon 12 | $("title").set("text", name); 13 | $("favicon").set("href", icon); 14 | $("icon").set("src", icon); 15 | $("settings-label").set("text", (i18n.get("settings") || "Settings")); 16 | $("search-label").set("text", (i18n.get("search") || "Search")); 17 | $("search").set("placeholder", (i18n.get("search") || "Search") + "..."); 18 | 19 | this.tab = new Tab($("tab-container"), $("content")); 20 | this.search = new Search($("search"), $("search-result-container")); 21 | }, 22 | 23 | "create": function (params) { 24 | var tab, 25 | group, 26 | row, 27 | content, 28 | bundle; 29 | 30 | // Create tab if it doesn't exist already 31 | if (this.tabs[params.tab] === undefined) { 32 | this.tabs[params.tab] = {"groups":{}}; 33 | tab = this.tabs[params.tab]; 34 | 35 | tab.content = this.tab.create(); 36 | tab.content.tab.set("text", params.tab); 37 | this.search.bind(tab.content.tab); 38 | 39 | tab.content = tab.content.content; 40 | (new Element("h2", { 41 | "text": params.tab 42 | })).inject(tab.content); 43 | } else { 44 | tab = this.tabs[params.tab]; 45 | } 46 | 47 | // Create group if it doesn't exist already 48 | if (tab.groups[params.group] === undefined) { 49 | tab.groups[params.group] = {}; 50 | group = tab.groups[params.group]; 51 | 52 | group.content = (new Element("table", { 53 | "class": "setting group" 54 | })).inject(tab.content); 55 | 56 | row = (new Element("tr")).inject(group.content); 57 | 58 | (new Element("td", { 59 | "class": "setting group-name", 60 | "text": params.group 61 | })).inject(row); 62 | 63 | content = (new Element("td", { 64 | "class": "setting group-content" 65 | })).inject(row); 66 | 67 | group.setting = new Setting(content); 68 | } else { 69 | group = tab.groups[params.group]; 70 | } 71 | 72 | // Create and index the setting 73 | bundle = group.setting.create(params); 74 | this.search.add(bundle); 75 | 76 | return bundle; 77 | }, 78 | 79 | "align": function (settings) { 80 | var types, 81 | type, 82 | maxWidth; 83 | 84 | types = [ 85 | "text", 86 | "button", 87 | "slider", 88 | "popupButton" 89 | ]; 90 | type = settings[0].params.type; 91 | maxWidth = 0; 92 | 93 | if (!types.contains(type)) { 94 | throw "invalidType"; 95 | } 96 | 97 | settings.each(function (setting) { 98 | if (setting.params.type !== type) { 99 | throw "multipleTypes"; 100 | } 101 | 102 | var width = setting.label.offsetWidth; 103 | if (width > maxWidth) { 104 | maxWidth = width; 105 | } 106 | }); 107 | 108 | settings.each(function (setting) { 109 | var width = setting.label.offsetWidth; 110 | if (width < maxWidth) { 111 | if (type === "button" || type === "slider") { 112 | setting.element.setStyle("margin-left", (maxWidth - width + 2) + "px"); 113 | setting.search.element.setStyle("margin-left", (maxWidth - width + 2) + "px"); 114 | } else { 115 | setting.element.setStyle("margin-left", (maxWidth - width) + "px"); 116 | setting.search.element.setStyle("margin-left", (maxWidth - width) + "px"); 117 | } 118 | } 119 | }); 120 | } 121 | }); 122 | 123 | FancySettings.__proto__.initWithManifest = function (callback) { 124 | var settings, 125 | output; 126 | 127 | settings = new FancySettings(manifest.name, manifest.icon); 128 | settings.manifest = {}; 129 | 130 | manifest.settings.each(function (params) { 131 | output = settings.create(params); 132 | if (params.name !== undefined) { 133 | settings.manifest[params.name] = output; 134 | } 135 | }); 136 | 137 | if (manifest.alignment !== undefined) { 138 | document.body.addClass("measuring"); 139 | manifest.alignment.each(function (group) { 140 | group = group.map(function (name) { 141 | return settings.manifest[name]; 142 | }); 143 | settings.align(group); 144 | }); 145 | document.body.removeClass("measuring"); 146 | } 147 | 148 | if (callback !== undefined) { 149 | callback(settings); 150 | } 151 | }; 152 | }()); 153 | -------------------------------------------------------------------------------- /src/options_custom/lib/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | // Copyright (c) 2007 - 2010 blueprintcss.org 3 | // Modified and extended by Frank Kohlhepp in 2011 4 | // https://github.com/frankkohlhepp/default-css 5 | // License: MIT-license 6 | */ 7 | 8 | /* 9 | // Reset the default browser CSS 10 | */ 11 | html { 12 | margin: 0; 13 | padding: 0; 14 | border: 0; 15 | } 16 | 17 | body, div, span, object, iframe, 18 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 19 | a, abbr, acronym, address, code, 20 | del, dfn, em, img, q, dl, dt, dd, ol, ul, li, 21 | fieldset, form, label, legend, 22 | table, caption, tbody, tfoot, thead, tr, th, td, 23 | article, aside, dialog, figure, footer, header, 24 | hgroup, nav, section { 25 | margin: 0; 26 | padding: 0; 27 | border: 0; 28 | font-family: inherit; 29 | font-size: 100%; 30 | font-weight: inherit; 31 | font-style: inherit; 32 | vertical-align: baseline; 33 | } 34 | 35 | article, aside, dialog, figure, footer, header, 36 | hgroup, nav, section { 37 | display: block; 38 | } 39 | 40 | body { 41 | background-color: white; 42 | line-height: 1.5; 43 | } 44 | 45 | table { 46 | border-collapse: separate; 47 | border-spacing: 0; 48 | } 49 | 50 | caption, th, td { 51 | text-align: left; 52 | font-weight: normal; 53 | } 54 | 55 | table, th, td { 56 | vertical-align: middle; 57 | } 58 | 59 | blockquote:before, blockquote:after, q:before, q:after { 60 | content: ""; 61 | } 62 | 63 | blockquote, q { 64 | quotes: "" ""; 65 | } 66 | 67 | a img { 68 | border: none; 69 | } 70 | 71 | /* 72 | // Default typography 73 | */ 74 | html { 75 | font-size: 100.01%; 76 | } 77 | 78 | body { 79 | background-color: white; 80 | font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; 81 | font-size: 75%; 82 | color: #222222; 83 | } 84 | 85 | /* Headings */ 86 | h1, h2, h3, h4, h5, h6 { 87 | font-weight: normal; 88 | color: #111111; 89 | } 90 | 91 | h1 { 92 | margin-bottom: 0.5em; 93 | font-size: 3em; 94 | line-height: 1; 95 | } 96 | 97 | h2 { 98 | margin-bottom: 0.75em; 99 | font-size: 2em; 100 | } 101 | 102 | h3 { 103 | margin-bottom: 1em; 104 | font-size: 1.5em; 105 | line-height: 1; 106 | } 107 | 108 | h4 { 109 | margin-bottom: 1.25em; 110 | font-size: 1.2em; 111 | line-height: 1.25; 112 | } 113 | 114 | h5 { 115 | margin-bottom: 1.5em; 116 | font-size: 1em; 117 | font-weight: bold; 118 | } 119 | 120 | h6 { 121 | font-size: 1em; 122 | font-weight: bold; 123 | } 124 | 125 | h1 img, h2 img, h3 img, 126 | h4 img, h5 img, h6 img { 127 | margin: 0; 128 | } 129 | 130 | /* Text elements */ 131 | p { 132 | margin: 0 0 1.5em; 133 | } 134 | 135 | .left { 136 | float: left !important; 137 | } 138 | 139 | p .left { 140 | margin: 1.5em 1.5em 1.5em 0; 141 | padding: 0; 142 | } 143 | 144 | .right { 145 | float: right !important; 146 | } 147 | 148 | p .right { 149 | margin: 1.5em 0 1.5em 1.5em; 150 | padding: 0; 151 | } 152 | 153 | a:focus, a:hover { 154 | color: #0099FF; 155 | } 156 | 157 | a { 158 | color: #0066CC; 159 | text-decoration: underline; 160 | } 161 | 162 | blockquote { 163 | margin: 1.5em; 164 | font-style: italic; 165 | color: #666666; 166 | } 167 | 168 | strong, dfn { 169 | font-weight: bold; 170 | } 171 | 172 | em, dfn { 173 | font-style: italic; 174 | } 175 | 176 | sup, sub { 177 | line-height: 0; 178 | } 179 | 180 | abbr, acronym { 181 | border-bottom: 1px dotted #666666; 182 | } 183 | 184 | address { 185 | margin: 0 0 1.5em; 186 | font-style: italic; 187 | } 188 | 189 | del { 190 | color: #666666; 191 | } 192 | 193 | pre { 194 | margin: 1.5em 0; 195 | white-space: pre; 196 | } 197 | 198 | pre, code, tt { 199 | font: 1em "andale mono", "lucida console", monospace; 200 | line-height: 1.5; 201 | } 202 | 203 | /* Lists */ 204 | li ul, li ol { 205 | margin: 0; 206 | } 207 | 208 | ul, ol { 209 | margin: 0 1.5em 1.5em 0; 210 | padding-left: 1.5em; 211 | } 212 | 213 | ul { 214 | list-style-type: disc; 215 | } 216 | 217 | ol { 218 | list-style-type: decimal; 219 | } 220 | 221 | dl { 222 | margin: 0 0 1.5em 0; 223 | } 224 | 225 | dl dt { 226 | font-weight: bold; 227 | } 228 | 229 | dd { 230 | margin-left: 1.5em; 231 | } 232 | 233 | /* Tables */ 234 | table { 235 | width: 100%; 236 | margin-bottom: 1.4em; 237 | } 238 | 239 | th { 240 | font-weight: bold; 241 | } 242 | 243 | table.zebra thead th, table.zebra tfoot th { 244 | background-color: #BFBFBF; 245 | } 246 | 247 | th, td, caption { 248 | padding: 4px 10px 4px 5px; 249 | } 250 | 251 | table.zebra tbody tr:nth-child(even) td, table.zebra tbody tr.even td { 252 | background-color: #E6E6E6; 253 | } 254 | 255 | caption { 256 | background-color: #EEEEEE; 257 | } 258 | 259 | /* Misc classes */ 260 | .fancy { 261 | text-shadow: white 0 1px 0; 262 | } 263 | 264 | .bfancy { 265 | text-shadow: black 0 1px 0; 266 | } 267 | 268 | .fancyt { 269 | text-shadow: white 0 -1px 0; 270 | } 271 | 272 | .bfancyt { 273 | text-shadow: black 0 -1px 0; 274 | } 275 | 276 | .no-fancy { 277 | text-shadow: none; 278 | } 279 | 280 | .select { 281 | cursor: auto; 282 | user-select: auto; 283 | -webkit-user-select: auto; 284 | -moz-user-select: auto; 285 | -o-user-select: auto; 286 | } 287 | 288 | img.select, .select img { 289 | user-drag: auto; 290 | -webkit-user-drag: auto; 291 | -moz-user-drag: auto; 292 | -o-user-drag: auto; 293 | } 294 | 295 | .no-select { 296 | cursor: default; 297 | user-select: none; 298 | -webkit-user-select: none; 299 | -moz-user-select: none; 300 | -o-user-select: none; 301 | } 302 | 303 | img.no-select, .no-select img { 304 | user-drag: none; 305 | -webkit-user-drag: none; 306 | -moz-user-drag: none; 307 | -o-user-drag: none; 308 | } 309 | 310 | .focus:focus, .focus :focus { 311 | outline: auto; 312 | } 313 | 314 | .no-focus:focus, .no-focus :focus { 315 | outline: 0; 316 | } 317 | 318 | .small { 319 | margin-bottom: 1.875em; 320 | font-size: .8em; 321 | line-height: 1.875em; 322 | } 323 | 324 | .large { 325 | margin-bottom: 1.25em; 326 | font-size: 1.2em; 327 | line-height: 2.5em; 328 | } 329 | 330 | .show { 331 | display: block !important; 332 | } 333 | 334 | .show-inline { 335 | display: inline-block !important; 336 | } 337 | 338 | .hide { 339 | display: none; 340 | } 341 | 342 | .quiet { 343 | color: #666666; 344 | } 345 | 346 | .loud { 347 | color: black; 348 | } 349 | 350 | .highlight { 351 | background-color: yellow; 352 | } 353 | 354 | .added { 355 | background-color: #006600; 356 | color: white; 357 | } 358 | 359 | .removed { 360 | background-color: #990000; 361 | color: white; 362 | } 363 | 364 | .first { 365 | margin-left: 0; 366 | padding-left: 0; 367 | } 368 | 369 | .last { 370 | margin-right: 0; 371 | padding-right: 0; 372 | } 373 | 374 | .top { 375 | margin-top: 0; 376 | padding-top: 0; 377 | } 378 | 379 | .bottom { 380 | margin-bottom: 0; 381 | padding-bottom: 0; 382 | } 383 | 384 | /* 385 | // Default styling for forms 386 | */ 387 | fieldset { 388 | margin: 0 0 1.5em 0; 389 | padding: 0 1.4em 1.4em 1.4em; 390 | border: 1px solid #CCCCCC; 391 | } 392 | 393 | legend { 394 | margin-top: -0.2em; 395 | margin-bottom: 1em; 396 | font-weight: bold; 397 | font-size: 1.2em; 398 | } 399 | 400 | /* Form fields */ 401 | input[type=text], input[type=password], textarea { 402 | background-color: white; 403 | border: 1px solid #BBBBBB; 404 | } 405 | 406 | input[type=text], input[type=password], 407 | textarea, select { 408 | margin: 0.5em 0; 409 | } 410 | 411 | input[type=text], input[type=password] { 412 | width: 300px; 413 | padding: 4px; 414 | } 415 | 416 | textarea { 417 | width: 450px; 418 | height: 170px; 419 | padding: 5px; 420 | } 421 | 422 | /* success, info, notice and error boxes */ 423 | .success, .info, .notice, .error { 424 | margin-bottom: 1em; 425 | padding: 0.8em; 426 | border: 2px solid #DDDDDD; 427 | } 428 | 429 | .success { 430 | background-color: #E6EFC2; 431 | border-color: #C6D880; 432 | color: #264409; 433 | } 434 | 435 | .info { 436 | background-color: #D5EDF8; 437 | border-color: #92CAE4; 438 | color: #205791; 439 | } 440 | 441 | .notice { 442 | background-color: #FFF6BF; 443 | border-color: #FFD324; 444 | color: #514721; 445 | } 446 | 447 | .error { 448 | background-color: #FBE3E4; 449 | border-color: #FBC2C4; 450 | color: #8A1F11; 451 | } 452 | 453 | .success a { 454 | color: #264409; 455 | } 456 | 457 | .info a { 458 | color: #205791; 459 | } 460 | 461 | .notice a { 462 | color: #514721; 463 | } 464 | 465 | .error a { 466 | color: #8A1F11; 467 | } 468 | -------------------------------------------------------------------------------- /src/options_custom/js/classes/setting.js: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011 Frank Kohlhepp 3 | // https://github.com/frankkohlhepp/fancy-settings 4 | // License: LGPL v2.1 5 | // 6 | (function () { 7 | var settings, 8 | Bundle; 9 | 10 | settings = new Store("settings"); 11 | Bundle = new Class({ 12 | // Attributes: 13 | // - tab 14 | // - group 15 | // - name 16 | // - type 17 | // 18 | // Methods: 19 | // - initialize 20 | // - createDOM 21 | // - setupDOM 22 | // - addEvents 23 | // - get 24 | // - set 25 | "Implements": Events, 26 | 27 | "initialize": function (params) { 28 | this.params = params; 29 | this.params.searchString = "•" + this.params.tab + "•" + this.params.group + "•"; 30 | 31 | this.createDOM(); 32 | this.setupDOM(); 33 | this.addEvents(); 34 | 35 | if (this.params.id !== undefined) { 36 | this.element.set("id", this.params.id); 37 | } 38 | 39 | if (this.params.name !== undefined) { 40 | this.set(settings.get(this.params.name), true); 41 | } 42 | 43 | this.params.searchString = this.params.searchString.toLowerCase(); 44 | }, 45 | 46 | "addEvents": function () { 47 | this.element.addEvent("change", (function (event) { 48 | if (this.params.name !== undefined) { 49 | settings.set(this.params.name, this.get()); 50 | } 51 | 52 | this.fireEvent("action", this.get()); 53 | }).bind(this)); 54 | }, 55 | 56 | "get": function () { 57 | return this.element.get("value"); 58 | }, 59 | 60 | "set": function (value, noChangeEvent) { 61 | this.element.set("value", value); 62 | 63 | if (noChangeEvent !== true) { 64 | this.element.fireEvent("change"); 65 | } 66 | 67 | return this; 68 | } 69 | }); 70 | 71 | Bundle.Description = new Class({ 72 | // text 73 | "Extends": Bundle, 74 | "addEvents": undefined, 75 | "get": undefined, 76 | "set": undefined, 77 | 78 | "initialize": function (params) { 79 | this.params = params; 80 | this.params.searchString = ""; 81 | 82 | this.createDOM(); 83 | this.setupDOM(); 84 | }, 85 | 86 | "createDOM": function () { 87 | this.bundle = new Element("div", { 88 | "class": "setting bundle description" 89 | }); 90 | 91 | this.container = new Element("div", { 92 | "class": "setting container description" 93 | }); 94 | 95 | this.element = new Element("p", { 96 | "class": "setting element description" 97 | }); 98 | }, 99 | 100 | "setupDOM": function () { 101 | if (this.params.text !== undefined) { 102 | this.element.set("html", this.params.text); 103 | } 104 | 105 | this.element.inject(this.container); 106 | this.container.inject(this.bundle); 107 | } 108 | }); 109 | 110 | Bundle.Button = new Class({ 111 | // label, text 112 | // action -> click 113 | "Extends": Bundle, 114 | "get": undefined, 115 | "set": undefined, 116 | 117 | "initialize": function (params) { 118 | this.params = params; 119 | this.params.searchString = "•" + this.params.tab + "•" + this.params.group + "•"; 120 | 121 | this.createDOM(); 122 | this.setupDOM(); 123 | this.addEvents(); 124 | 125 | if (this.params.id !== undefined) { 126 | this.element.set("id", this.params.id); 127 | } 128 | 129 | this.params.searchString = this.params.searchString.toLowerCase(); 130 | }, 131 | 132 | "createDOM": function () { 133 | this.bundle = new Element("div", { 134 | "class": "setting bundle button" 135 | }); 136 | 137 | this.container = new Element("div", { 138 | "class": "setting container button" 139 | }); 140 | 141 | this.element = new Element("input", { 142 | "class": "setting element button", 143 | "type": "button" 144 | }); 145 | 146 | this.label = new Element("label", { 147 | "class": "setting label button" 148 | }); 149 | }, 150 | 151 | "setupDOM": function () { 152 | if (this.params.label !== undefined) { 153 | this.label.set("html", this.params.label); 154 | this.label.inject(this.container); 155 | this.params.searchString += this.params.label + "•"; 156 | } 157 | 158 | if (this.params.text !== undefined) { 159 | this.element.set("value", this.params.text); 160 | this.params.searchString += this.params.text + "•"; 161 | } 162 | 163 | this.element.inject(this.container); 164 | this.container.inject(this.bundle); 165 | }, 166 | 167 | "addEvents": function () { 168 | this.element.addEvent("click", (function () { 169 | this.fireEvent("action"); 170 | }).bind(this)); 171 | } 172 | }); 173 | 174 | Bundle.Text = new Class({ 175 | // label, text, masked 176 | // action -> change & keyup 177 | "Extends": Bundle, 178 | 179 | "createDOM": function () { 180 | this.bundle = new Element("div", { 181 | "class": "setting bundle text" 182 | }); 183 | 184 | this.container = new Element("div", { 185 | "class": "setting container text" 186 | }); 187 | 188 | this.element = new Element("input", { 189 | "class": "setting element text", 190 | "type": "text" 191 | }); 192 | 193 | this.label = new Element("label", { 194 | "class": "setting label text" 195 | }); 196 | }, 197 | 198 | "setupDOM": function () { 199 | if (this.params.label !== undefined) { 200 | this.label.set("html", this.params.label); 201 | this.label.inject(this.container); 202 | this.params.searchString += this.params.label + "•"; 203 | } 204 | 205 | if (this.params.text !== undefined) { 206 | this.element.set("placeholder", this.params.text); 207 | this.params.searchString += this.params.text + "•"; 208 | } 209 | 210 | if (this.params.masked === true) { 211 | this.element.set("type", "password"); 212 | this.params.searchString += "password" + "•"; 213 | } 214 | 215 | this.element.inject(this.container); 216 | this.container.inject(this.bundle); 217 | }, 218 | 219 | "addEvents": function () { 220 | var change = (function (event) { 221 | if (this.params.name !== undefined) { 222 | settings.set(this.params.name, this.get()); 223 | } 224 | 225 | this.fireEvent("action", this.get()); 226 | }).bind(this); 227 | 228 | this.element.addEvent("change", change); 229 | this.element.addEvent("keyup", change); 230 | } 231 | }); 232 | 233 | Bundle.Checkbox = new Class({ 234 | // label 235 | // action -> change 236 | "Extends": Bundle, 237 | 238 | "createDOM": function () { 239 | this.bundle = new Element("div", { 240 | "class": "setting bundle checkbox" 241 | }); 242 | 243 | this.container = new Element("div", { 244 | "class": "setting container checkbox" 245 | }); 246 | 247 | this.element = new Element("input", { 248 | "id": String.uniqueID(), 249 | "class": "setting element checkbox", 250 | "type": "checkbox", 251 | "value": "true" 252 | }); 253 | 254 | this.label = new Element("label", { 255 | "class": "setting label checkbox", 256 | "for": this.element.get("id") 257 | }); 258 | }, 259 | 260 | "setupDOM": function () { 261 | this.element.inject(this.container); 262 | this.container.inject(this.bundle); 263 | 264 | if (this.params.label !== undefined) { 265 | this.label.set("html", this.params.label); 266 | this.label.inject(this.container); 267 | this.params.searchString += this.params.label + "•"; 268 | } 269 | }, 270 | 271 | "get": function () { 272 | return this.element.get("checked"); 273 | }, 274 | 275 | "set": function (value, noChangeEvent) { 276 | this.element.set("checked", value); 277 | 278 | if (noChangeEvent !== true) { 279 | this.element.fireEvent("change"); 280 | } 281 | 282 | return this; 283 | } 284 | }); 285 | 286 | Bundle.Slider = new Class({ 287 | // label, max, min, step, display, displayModifier 288 | // action -> change 289 | "Extends": Bundle, 290 | 291 | "initialize": function (params) { 292 | this.params = params; 293 | this.params.searchString = "•" + this.params.tab + "•" + this.params.group + "•"; 294 | 295 | this.createDOM(); 296 | this.setupDOM(); 297 | this.addEvents(); 298 | 299 | if (this.params.name !== undefined) { 300 | this.set((settings.get(this.params.name) || 0), true); 301 | } else { 302 | this.set(0, true); 303 | } 304 | 305 | this.params.searchString = this.params.searchString.toLowerCase(); 306 | }, 307 | 308 | "createDOM": function () { 309 | this.bundle = new Element("div", { 310 | "class": "setting bundle slider" 311 | }); 312 | 313 | this.container = new Element("div", { 314 | "class": "setting container slider" 315 | }); 316 | 317 | this.element = new Element("input", { 318 | "class": "setting element slider", 319 | "type": "range" 320 | }); 321 | 322 | this.label = new Element("label", { 323 | "class": "setting label slider" 324 | }); 325 | 326 | this.display = new Element("span", { 327 | "class": "setting display slider" 328 | }); 329 | }, 330 | 331 | "setupDOM": function () { 332 | if (this.params.label !== undefined) { 333 | this.label.set("html", this.params.label); 334 | this.label.inject(this.container); 335 | this.params.searchString += this.params.label + "•"; 336 | } 337 | 338 | if (this.params.max !== undefined) { 339 | this.element.set("max", this.params.max); 340 | } 341 | 342 | if (this.params.min !== undefined) { 343 | this.element.set("min", this.params.min); 344 | } 345 | 346 | if (this.params.step !== undefined) { 347 | this.element.set("step", this.params.step); 348 | } 349 | 350 | this.element.inject(this.container); 351 | if (this.params.display !== false) { 352 | if (this.params.displayModifier !== undefined) { 353 | this.display.set("text", this.params.displayModifier(0)); 354 | } else { 355 | this.display.set("text", 0); 356 | } 357 | this.display.inject(this.container); 358 | } 359 | this.container.inject(this.bundle); 360 | }, 361 | 362 | "addEvents": function () { 363 | this.element.addEvent("change", (function (event) { 364 | if (this.params.name !== undefined) { 365 | settings.set(this.params.name, this.get()); 366 | } 367 | 368 | if (this.params.displayModifier !== undefined) { 369 | this.display.set("text", this.params.displayModifier(this.get())); 370 | } else { 371 | this.display.set("text", this.get()); 372 | } 373 | this.fireEvent("action", this.get()); 374 | }).bind(this)); 375 | }, 376 | 377 | "get": function () { 378 | return Number.from(this.element.get("value")); 379 | }, 380 | 381 | "set": function (value, noChangeEvent) { 382 | this.element.set("value", value); 383 | 384 | if (noChangeEvent !== true) { 385 | this.element.fireEvent("change"); 386 | } else { 387 | if (this.params.displayModifier !== undefined) { 388 | this.display.set("text", this.params.displayModifier(Number.from(value))); 389 | } else { 390 | this.display.set("text", Number.from(value)); 391 | } 392 | } 393 | 394 | return this; 395 | } 396 | }); 397 | 398 | Bundle.PopupButton = new Class({ 399 | // label, options[{value, text}] 400 | // action -> change 401 | "Extends": Bundle, 402 | 403 | "createDOM": function () { 404 | this.bundle = new Element("div", { 405 | "class": "setting bundle popup-button" 406 | }); 407 | 408 | this.container = new Element("div", { 409 | "class": "setting container popup-button" 410 | }); 411 | 412 | this.element = new Element("select", { 413 | "class": "setting element popup-button" 414 | }); 415 | 416 | this.label = new Element("label", { 417 | "class": "setting label popup-button" 418 | }); 419 | 420 | if (this.params.options === undefined) { return; } 421 | 422 | // convert array syntax into object syntax for options 423 | function arrayToObject(option) { 424 | if (typeOf(option) == "array") { 425 | option = { 426 | "value": option[0], 427 | "text": option[1] || option[0], 428 | }; 429 | } 430 | return option; 431 | } 432 | 433 | // convert arrays 434 | if (typeOf(this.params.options) == "array") { 435 | var values = []; 436 | this.params.options.each((function(values, option) { 437 | values.push(arrayToObject(option)); 438 | }).bind(this, values)); 439 | this.params.options = { "values": values }; 440 | } 441 | 442 | var groups; 443 | if (this.params.options.groups !== undefined) { 444 | groups = {}; 445 | this.params.options.groups.each((function (groups, group) { 446 | this.params.searchString += (group) + "•"; 447 | groups[group] = (new Element("optgroup", { 448 | "label": group, 449 | }).inject(this.element)); 450 | }).bind(this, groups)); 451 | } 452 | 453 | if (this.params.options.values !== undefined) { 454 | this.params.options.values.each((function(groups, option) { 455 | option = arrayToObject(option); 456 | this.params.searchString += (option.text || option.value) + "•"; 457 | 458 | // find the parent of this option - either a group or the main element 459 | var parent; 460 | if (option.group && this.params.options.groups) { 461 | if ((option.group - 1) in this.params.options.groups) { 462 | option.group = this.params.options.groups[option.group-1]; 463 | } 464 | if (option.group in groups) { 465 | parent = groups[option.group]; 466 | } 467 | else { 468 | parent = this.element; 469 | } 470 | } 471 | else { 472 | parent = this.element; 473 | } 474 | 475 | (new Element("option", { 476 | "value": option.value, 477 | "text": option.text || option.value, 478 | })).inject(parent); 479 | }).bind(this, groups)); 480 | } 481 | }, 482 | 483 | "setupDOM": function () { 484 | if (this.params.label !== undefined) { 485 | this.label.set("html", this.params.label); 486 | this.label.inject(this.container); 487 | this.params.searchString += this.params.label + "•"; 488 | } 489 | 490 | this.element.inject(this.container); 491 | this.container.inject(this.bundle); 492 | } 493 | }); 494 | 495 | Bundle.ListBox = new Class({ 496 | // label, options[{value, text}] 497 | // action -> change 498 | "Extends": Bundle.PopupButton, 499 | 500 | "createDOM": function () { 501 | this.bundle = new Element("div", { 502 | "class": "setting bundle list-box" 503 | }); 504 | 505 | this.container = new Element("div", { 506 | "class": "setting container list-box" 507 | }); 508 | 509 | this.element = new Element("select", { 510 | "class": "setting element list-box", 511 | "size": "2" 512 | }); 513 | 514 | this.label = new Element("label", { 515 | "class": "setting label list-box" 516 | }); 517 | 518 | if (this.params.options === undefined) { return; } 519 | this.params.options.each((function (option) { 520 | this.params.searchString += (option.text || option.value) + "•"; 521 | 522 | (new Element("option", { 523 | "value": option.value, 524 | "text": option.text || option.value 525 | })).inject(this.element); 526 | }).bind(this)); 527 | }, 528 | 529 | "get": function () { 530 | return (this.element.get("value") || undefined); 531 | } 532 | }); 533 | 534 | Bundle.Textarea = new Class({ 535 | // label, text, value 536 | // action -> change & keyup 537 | "Extends": Bundle, 538 | 539 | "createDOM": function () { 540 | this.bundle = new Element("div", { 541 | "class": "setting bundle textarea" 542 | }); 543 | 544 | this.container = new Element("div", { 545 | "class": "setting container textarea" 546 | }); 547 | 548 | this.element = new Element("textarea", { 549 | "class": "setting element textarea" 550 | }); 551 | 552 | this.label = new Element("label", { 553 | "class": "setting label textarea" 554 | }); 555 | }, 556 | 557 | "setupDOM": function () { 558 | if (this.params.label !== undefined) { 559 | this.label.set("html", this.params.label); 560 | this.label.inject(this.container); 561 | this.params.searchString += this.params.label + "•"; 562 | } 563 | 564 | if (this.params.text !== undefined) { 565 | this.element.set("placeholder", this.params.text); 566 | this.params.searchString += this.params.text + "•"; 567 | } 568 | 569 | if (this.params.value !== undefined) { 570 | this.element.appendText(this.params.text); 571 | } 572 | 573 | this.element.inject(this.container); 574 | this.container.inject(this.bundle); 575 | }, 576 | 577 | "addEvents": function () { 578 | var change = (function (event) { 579 | if (this.params.name !== undefined) { 580 | settings.set(this.params.name, this.get()); 581 | } 582 | 583 | this.fireEvent("action", this.get()); 584 | }).bind(this); 585 | 586 | this.element.addEvent("change", change); 587 | this.element.addEvent("keyup", change); 588 | } 589 | }); 590 | 591 | Bundle.RadioButtons = new Class({ 592 | // label, options[{value, text}] 593 | // action -> change 594 | "Extends": Bundle, 595 | 596 | "createDOM": function () { 597 | var settingID = String.uniqueID(); 598 | 599 | this.bundle = new Element("div", { 600 | "class": "setting bundle radio-buttons" 601 | }); 602 | 603 | this.label = new Element("label", { 604 | "class": "setting label radio-buttons" 605 | }); 606 | 607 | this.containers = []; 608 | this.elements = []; 609 | this.labels = []; 610 | 611 | if (this.params.options === undefined) { return; } 612 | this.params.options.each((function (option) { 613 | var optionID, 614 | container; 615 | 616 | this.params.searchString += (option.text || option.value) + "•"; 617 | 618 | optionID = String.uniqueID(); 619 | container = (new Element("div", { 620 | "class": "setting container radio-buttons" 621 | })).inject(this.bundle); 622 | this.containers.push(container); 623 | 624 | this.elements.push((new Element("input", { 625 | "id": optionID, 626 | "name": settingID, 627 | "class": "setting element radio-buttons", 628 | "type": "radio", 629 | "value": option.value 630 | })).inject(container)); 631 | 632 | this.labels.push((new Element("label", { 633 | "class": "setting element-label radio-buttons", 634 | "for": optionID, 635 | "text": option.text || option.value 636 | })).inject(container)); 637 | }).bind(this)); 638 | }, 639 | 640 | "setupDOM": function () { 641 | if (this.params.label !== undefined) { 642 | this.label.set("html", this.params.label); 643 | this.label.inject(this.bundle, "top"); 644 | this.params.searchString += this.params.label + "•"; 645 | } 646 | }, 647 | 648 | "addEvents": function () { 649 | this.bundle.addEvent("change", (function (event) { 650 | if (this.params.name !== undefined) { 651 | settings.set(this.params.name, this.get()); 652 | } 653 | 654 | this.fireEvent("action", this.get()); 655 | }).bind(this)); 656 | }, 657 | 658 | "get": function () { 659 | var checkedEl = this.elements.filter((function (el) { 660 | return el.get("checked"); 661 | }).bind(this)); 662 | return (checkedEl[0] && checkedEl[0].get("value")); 663 | }, 664 | 665 | "set": function (value, noChangeEvent) { 666 | var desiredEl = this.elements.filter((function (el) { 667 | return (el.get("value") === value); 668 | }).bind(this)); 669 | desiredEl[0] && desiredEl[0].set("checked", true); 670 | 671 | if (noChangeEvent !== true) { 672 | this.bundle.fireEvent("change"); 673 | } 674 | 675 | return this; 676 | } 677 | }); 678 | 679 | this.Setting = new Class({ 680 | "initialize": function (container) { 681 | this.container = container; 682 | }, 683 | 684 | "create": function (params) { 685 | var types, 686 | bundle; 687 | 688 | // Available types 689 | types = { 690 | "description": "Description", 691 | "button": "Button", 692 | "text": "Text", 693 | "textarea": "Textarea", 694 | "checkbox": "Checkbox", 695 | "slider": "Slider", 696 | "popupButton": "PopupButton", 697 | "listBox": "ListBox", 698 | "radioButtons": "RadioButtons" 699 | }; 700 | 701 | if (types.hasOwnProperty(params.type)) { 702 | bundle = new Bundle[types[params.type]](params); 703 | bundle.bundleContainer = this.container; 704 | bundle.bundle.inject(this.container); 705 | return bundle; 706 | } else { 707 | throw "invalidType"; 708 | } 709 | } 710 | }); 711 | }()); 712 | -------------------------------------------------------------------------------- /js/jquery/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v2.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license 2 | //@ sourceMappingURL=jquery.min.map 3 | */ 4 | (function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],f="2.0.0",p=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=f.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return p.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,f,p,h,d,g,m,y="sizzle"+-new Date,v=e.document,b={},w=0,T=0,C=ot(),k=ot(),N=ot(),E=!1,S=function(){return 0},j=typeof undefined,D=1<<31,A=[],L=A.pop,q=A.push,H=A.push,O=A.slice,F=A.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=M.replace("w","w#"),$="\\["+R+"*("+M+")"+R+"*(?:([*^$|!~]?=)"+R+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+R+"*\\]",B=":("+M+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",I=RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),z=RegExp("^"+R+"*,"+R+"*"),_=RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),X=RegExp(R+"*[+~]"),U=RegExp("="+R+"*([^\\]'\"]*)"+R+"*\\]","g"),Y=RegExp(B),V=RegExp("^"+W+"$"),G={ID:RegExp("^#("+M+")"),CLASS:RegExp("^\\.("+M+")"),TAG:RegExp("^("+M.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+B),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),"boolean":RegExp("^(?:"+P+")$","i"),needsContext:RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,et=/'|\\/g,tt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,nt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{H.apply(A=O.call(v.childNodes),v.childNodes),A[v.childNodes.length].nodeType}catch(rt){H={apply:A.length?function(e,t){q.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function it(e){return J.test(e+"")}function ot(){var e,t=[];return e=function(n,i){return t.push(n+=" ")>r.cacheLength&&delete e[t.shift()],e[n]=i}}function st(e){return e[y]=!0,e}function at(e){var t=c.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ut(e,t,n,r){var i,o,s,a,u,f,d,g,x,w;if((t?t.ownerDocument||t:v)!==c&&l(t),t=t||c,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(p&&!r){if(i=Q.exec(e))if(s=i[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&m(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return H.apply(n,t.getElementsByTagName(e)),n;if((s=i[3])&&b.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(s)),n}if(b.qsa&&(!h||!h.test(e))){if(g=d=y,x=t,w=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(d=t.getAttribute("id"))?g=d.replace(et,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=f.length;while(u--)f[u]=g+mt(f[u]);x=X.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return H.apply(n,x.querySelectorAll(w)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(I,"$1"),t,n,r)}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},l=ut.setDocument=function(e){var t=e?e.ownerDocument||e:v;return t!==c&&9===t.nodeType&&t.documentElement?(c=t,f=t.documentElement,p=!o(t),b.getElementsByTagName=at(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),b.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByClassName=at(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),b.sortDetached=at(function(e){return 1&e.compareDocumentPosition(c.createElement("div"))}),b.getById=at(function(e){return f.appendChild(e).id=y,!t.getElementsByName||!t.getElementsByName(y).length}),b.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}):(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==j&&n.getAttributeNode("id").value===e?[n]:undefined:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=b.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=b.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&p?t.getElementsByClassName(e):undefined},d=[],h=[],(b.qsa=it(t.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+R+"*(?:value|"+P+")"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){var t=c.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&h.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(b.matchesSelector=it(g=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){b.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),d.push("!=",B)}),h=h.length&&RegExp(h.join("|")),d=d.length&&RegExp(d.join("|")),m=it(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,n){if(e===n)return E=!0,0;var r=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);return r?1&r||!b.sortDetached&&n.compareDocumentPosition(e)===r?e===t||m(v,e)?-1:n===t||m(v,n)?1:u?F.call(u,e)-F.call(u,n):0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],l=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:u?F.call(u,e)-F.call(u,n):0;if(o===s)return lt(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)l.unshift(r);while(a[i]===l[i])i++;return i?lt(a[i],l[i]):a[i]===v?-1:l[i]===v?1:0},c):c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){if((e.ownerDocument||e)!==c&&l(e),t=t.replace(U,"='$1']"),!(!b.matchesSelector||!p||d&&d.test(t)||h&&h.test(t)))try{var n=g.call(e,t);if(n||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),m(e,t)},ut.attr=function(e,t){(e.ownerDocument||e)!==c&&l(e);var n=r.attrHandle[t.toLowerCase()],i=n&&n(e,t,!p);return i===undefined?b.attributes||!p?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null:i},ut.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=0,i=0;if(E=!b.detectDuplicates,u=!b.sortStable&&e.slice(0),e.sort(S),E){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return e};function lt(e,t){var n=t&&e,r=n&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ct(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}function ft(e,t,n){var r;return n?undefined:r=e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return st(function(t){return t=+t,st(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}i=ut.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=i(t);return n},r=ut.selectors={cacheLength:50,createPseudo:st,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(tt,nt),e[3]=(e[4]||e[5]||"").replace(tt,nt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ut.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&Y.test(n)&&(t=gt(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(tt,nt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){f=t;while(f=f[g])if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[y]||(m[y]={}),l=c[e]||[],h=l[0]===w&&l[1],p=l[0]===w&&l[2],f=h&&m.childNodes[h];while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if(1===f.nodeType&&++p&&f===t){c[e]=[w,h,p];break}}else if(x&&(l=(t[y]||(t[y]={}))[e])&&l[0]===w)p=l[1];else while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if((a?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++p&&(x&&((f[y]||(f[y]={}))[e]=[w,p]),f===t))break;return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var r,o=i(e,t),s=o.length;while(s--)r=F.call(e,o[s]),e[r]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:st(function(e){var t=[],n=[],r=s(e.replace(I,"$1"));return r[y]?st(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:st(function(e){return V.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(tt,nt).toLowerCase(),function(t){var n;do if(n=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[0>n?n+t:n]}),even:dt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ht(t);function gt(e,t){var n,i,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=r.preFilter;while(a){(!n||(i=z.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=_.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(I," ")}),a=a.slice(n.length));for(s in r.filter)!(i=G[s].exec(a))||l[s]&&!(i=l[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ut.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,r){var i=t.dir,o=r&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,r,a){var u,l,c,f=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,r,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[y]||(t[y]={}),(l=c[i])&&l[0]===f){if((u=l[1])===!0||u===n)return u===!0}else if(l=c[i]=[f],l[1]=e(t,r,a)||n,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[y]&&(r=bt(r)),i&&!i[y]&&(i=bt(i,o)),st(function(o,s,a,u){var l,c,f,p=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,p,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(f=l[c])&&(y[h[c]]=!(m[h[c]]=f))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(f=y[c])&&l.push(m[c]=f);i(null,y=[],l,u)}c=y.length;while(c--)(f=y[c])&&(l=i?F.call(o,f):p[c])>-1&&(o[l]=!(s[l]=f))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):H.apply(s,y)})}function wt(e){var t,n,i,o=e.length,s=r.relative[e[0].type],u=s||r.relative[" "],l=s?1:0,c=yt(function(e){return e===t},u,!0),f=yt(function(e){return F.call(t,e)>-1},u,!0),p=[function(e,n,r){return!s&&(r||n!==a)||((t=n).nodeType?c(e,n,r):f(e,n,r))}];for(;o>l;l++)if(n=r.relative[e[l].type])p=[yt(vt(p),n)];else{if(n=r.filter[e[l].type].apply(null,e[l].matches),n[y]){for(i=++l;o>i;i++)if(r.relative[e[i].type])break;return bt(l>1&&vt(p),l>1&&mt(e.slice(0,l-1)).replace(I,"$1"),n,i>l&&wt(e.slice(l,i)),o>i&&wt(e=e.slice(i)),o>i&&mt(e))}p.push(n)}return vt(p)}function Tt(e,t){var i=0,o=t.length>0,s=e.length>0,u=function(u,l,f,p,h){var d,g,m,y=[],v=0,x="0",b=u&&[],T=null!=h,C=a,k=u||s&&r.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(a=l!==c&&l,n=i);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,f)){p.push(d);break}T&&(w=N,n=++i)}o&&((d=!m&&d)&&v--,u&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,f);if(u){if(v>0)while(x--)b[x]||y[x]||(y[x]=L.call(p));y=xt(y)}H.apply(p,y),T&&!u&&y.length>0&&v+t.length>1&&ut.uniqueSort(p)}return T&&(w=N,a=C),b};return o?st(u):u}s=ut.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[y]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ut(e,t[r],n);return n}function kt(e,t,n,i){var o,a,u,l,c,f=gt(e);if(!i&&1===f.length){if(a=f[0]=f[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&p&&r.relative[a[1].type]){if(t=(r.find.ID(u.matches[0].replace(tt,nt),t)||[])[0],!t)return n;e=e.slice(a.shift().value.length)}o=G.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],r.relative[l=u.type])break;if((c=r.find[l])&&(i=c(u.matches[0].replace(tt,nt),X.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=i.length&&mt(a),!e)return H.apply(n,i),n;break}}}return s(e,f)(i,t,!p,n,X.test(e)),n}r.pseudos.nth=r.pseudos.eq;function Nt(){}Nt.prototype=r.filters=r.pseudos,r.setFilters=new Nt,b.sortStable=y.split("").sort(S).join("")===y,l(),[0,0].sort(S),b.detectDuplicates=E,at(function(e){if(e.innerHTML="<a href='#'></a>","#"!==e.firstChild.getAttribute("href")){var t="type|href|height|width".split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ft}}),at(function(e){if(null!=e.getAttribute("disabled")){var t=P.split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ct}}),x.find=ut,x.expr=ut.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ut.uniqueSort,x.text=ut.getText,x.isXMLDoc=ut.isXML,x.contains=ut.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(f){for(t=e.memory&&f,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(f[0],f[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!a||n&&!u||(r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))this.cache[i]=t;else for(r in t)o[r]=t[r]},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){return t===undefined||t&&"string"==typeof t&&n===undefined?this.get(e,t):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i=this.key(e),o=this.cache[i];if(t===undefined)this.cache[i]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):t in o?r=[t]:(r=x.camelCase(t),r=r in o?[r]:r.match(w)||[]),n=r.length;while(n--)delete o[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){delete this.cache[this.key(e)]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.substring(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t); 5 | x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,s=0,a=x(this),u=t,l=e.match(w)||[];while(o=l[s++])u=i?u:!a.hasClass(o),a[u?"addClass":"removeClass"](o)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i,o=x(this);1===this.nodeType&&(i=r?e.call(this,n,o.val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.boolean.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.boolean.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.boolean.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,f,p,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(p=x.event.special[d]||{},d=(o?p.delegateType:p.bindType)||d,p=x.event.special[d]||{},f=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,p.setup&&p.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,f):h.push(f),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){f=x.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,p=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));s&&!p.length&&(f.teardown&&f.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,f,p,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),p=x.event.special[d]||{},i||!p.trigger||p.trigger.apply(r,n)!==!1)){if(!i&&!p.noBubble&&!x.isWindow(r)){for(l=p.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:p.bindType||d,f=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),f&&f.apply(a,n),f=c&&a[c],f&&x.acceptData(a)&&f.apply&&f.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||p._default&&p._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return 3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=x.expr.match.needsContext,Q={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return t=this,this.pushStack(x(e).filter(function(){for(r=0;i>r;r++)if(x.contains(t[r],this))return!0}));for(n=[],r=0;i>r;r++)x.find(e,this[r],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(Z(this,e||[],!0))},filter:function(e){return this.pushStack(Z(this,e||[],!1))},is:function(e){return!!e&&("string"==typeof e?J.test(e)?x(e,this.context).index(this[0])>=0:x.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],s=J.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function K(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return K(e,"nextSibling")},prev:function(e){return K(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(Q[e]||x.unique(i),"p"===e[0]&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function Z(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var et=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,tt=/<([\w:]+)/,nt=/<|&#?\w+;/,rt=/<(?:script|style|link)/i,it=/^(?:checkbox|radio)$/i,ot=/checked\s*(?:[^=]|=\s*.checked.)/i,st=/^$|\/(?:java|ecma)script/i,at=/^true\/(.*)/,ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,lt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};lt.optgroup=lt.option,lt.tbody=lt.tfoot=lt.colgroup=lt.caption=lt.col=lt.thead,lt.th=lt.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(gt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&ht(gt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(gt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!lt[(tt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(et,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(gt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,f=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&ot.test(d))return this.each(function(r){var i=f.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(gt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,gt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,pt),l=0;s>l;l++)a=o[l],st.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(ut,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=gt(a),o=gt(e),r=0,i=o.length;i>r;r++)mt(o[r],s[r]);if(t)if(n)for(o=o||gt(e),s=s||gt(a),r=0,i=o.length;i>r;r++)dt(o[r],s[r]);else dt(e,a);return s=gt(a,"script"),s.length>0&&ht(s,!u&>(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,f=e.length,p=t.createDocumentFragment(),h=[];for(;f>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(nt.test(i)){o=o||p.appendChild(t.createElement("div")),s=(tt.exec(i)||["",""])[1].toLowerCase(),a=lt[s]||lt._default,o.innerHTML=a[1]+i.replace(et,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.firstChild;x.merge(h,o.childNodes),o=p.firstChild,o.textContent=""}else h.push(t.createTextNode(i));p.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=gt(p.appendChild(i),"script"),u&&ht(o),n)){l=0;while(i=o[l++])st.test(i.type||"")&&n.push(i)}return p},cleanData:function(e){var t,n,r,i=e.length,o=0,s=x.event.special;for(;i>o;o++){if(n=e[o],x.acceptData(n)&&(t=q.access(n)))for(r in t.events)s[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);L.discard(n),q.discard(n)}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"text",async:!1,global:!1,success:x.globalEval})}});function ct(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function pt(e){var t=at.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ht(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function dt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=x.extend({},o),l=o.events,q.set(t,s),l)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function gt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function mt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&it.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var yt,vt,xt=/^(none|table(?!-c[ea]).+)/,bt=/^margin/,wt=RegExp("^("+b+")(.*)$","i"),Tt=RegExp("^("+b+")(?!px)[a-z%]+$","i"),Ct=RegExp("^([+-])=("+b+")","i"),kt={BODY:"block"},Nt={position:"absolute",visibility:"hidden",display:"block"},Et={letterSpacing:0,fontWeight:400},St=["Top","Right","Bottom","Left"],jt=["Webkit","O","Moz","ms"];function Dt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=jt.length;while(i--)if(t=jt[i]+n,t in e)return t;return r}function At(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function Lt(t){return e.getComputedStyle(t,null)}function qt(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&At(r)&&(o[s]=q.access(r,"olddisplay",Pt(r.nodeName)))):o[s]||(i=At(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=Lt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return qt(this,!0)},hide:function(){return qt(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:At(this))?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=yt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=Dt(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=Ct.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=Dt(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=yt(e,t,r)),"normal"===i&&t in Et&&(i=Et[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),yt=function(e,t,n){var r,i,o,s=n||Lt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Tt.test(a)&&bt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ht(e,t,n){var r=wt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ot(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+St[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+St[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+St[o]+"Width",!0,i))):(s+=x.css(e,"padding"+St[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+St[o]+"Width",!0,i)));return s}function Ft(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Lt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=yt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Tt.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ot(e,t,n||(s?"border":"content"),r,o)+"px"}function Pt(e){var t=o,n=kt[e];return n||(n=Rt(e,t),"none"!==n&&n||(vt=(vt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(vt[0].contentWindow||vt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Rt(e,t),vt.detach()),kt[e]=n),n}function Rt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&xt.test(x.css(e,"display"))?x.swap(e,Nt,function(){return Ft(e,t,r)}):Ft(e,t,r):undefined},set:function(e,n,r){var i=r&&Lt(e);return Ht(e,n,r?Ot(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},yt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=yt(e,t),Tt.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+St[r]+t]=o[r]||o[r-2]||o[0];return i}},bt.test(e)||(x.cssHooks[e+t].set=Ht)});var Mt=/%20/g,Wt=/\[\]$/,$t=/\r?\n/g,Bt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&It.test(this.nodeName)&&!Bt.test(e)&&(this.checked||!it.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace($t,"\r\n")}}):{name:t.name,value:n.replace($t,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)zt(n,e[n],t,i);return r.join("&").replace(Mt,"+")};function zt(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||Wt.test(e)?r(e,i):zt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)zt(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var _t,Xt,Ut=x.now(),Yt=/\?/,Vt=/#.*$/,Gt=/([?&])_=[^&]*/,Jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Qt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kt=/^(?:GET|HEAD)$/,Zt=/^\/\//,en=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,tn=x.fn.load,nn={},rn={},on="*/".concat("*");try{Xt=i.href}catch(sn){Xt=o.createElement("a"),Xt.href="",Xt=Xt.href}_t=en.exec(Xt.toLowerCase())||[];function an(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[]; 6 | if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function un(e,t,n,r){var i={},o=e===rn;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function ln(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&tn)return tn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Xt,type:"GET",isLocal:Qt.test(_t[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":on,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ln(ln(e,x.ajaxSettings),t):ln(x.ajaxSettings,e)},ajaxPrefilter:an(nn),ajaxTransport:an(rn),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),f=c.context||c,p=c.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Jt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Xt)+"").replace(Vt,"").replace(Zt,_t[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=en.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===_t[1]&&a[2]===_t[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(_t[3]||("http:"===_t[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),un(nn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Kt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Yt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Gt.test(r)?r.replace(Gt,"$1_="+Ut++):r+(Yt.test(r)?"&":"?")+"_="+Ut++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+on+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(f,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=un(rn,c,t,T)){T.readyState=1,u&&p.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=cn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(f,[m,C,T]):h.rejectWith(f,[T,C,y]),T.statusCode(g),g=undefined,u&&p.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(f,[T,C]),u&&(p.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function cn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(f){return{state:"parsererror",error:s?f:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var pn=[],hn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=pn.pop()||x.expando+"_"+Ut++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(hn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&hn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(hn,"$1"+i):t.jsonp!==!1&&(t.url+=(Yt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,pn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var dn=x.ajaxSettings.xhr(),gn={0:200,1223:204},mn=0,yn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in yn)yn[e]();yn=undefined}),x.support.cors=!!dn&&"withCredentials"in dn,x.support.ajax=dn=!!dn,x.ajaxTransport(function(e){var t;return x.support.cors||dn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete yn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(gn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=yn[o=mn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var vn,xn,bn=/^(?:toggle|show|hide)$/,wn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Tn=/queueHooks$/,Cn=[Dn],kn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=wn.exec(t),s=i.cur(),a=+s||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(x.cssNumber[e]?"":"px"),"px"!==r&&a){a=x.css(i.elem,e,!0)||n||1;do u=u||".5",a/=u,x.style(i.elem,e,a+r);while(u!==(u=i.cur()/s)&&1!==u&&--l)}i.unit=r,i.start=a,i.end=o[1]?a+(o[1]+1)*n:n}return i}]};function Nn(){return setTimeout(function(){vn=undefined}),vn=x.now()}function En(e,t){x.each(t,function(t,n){var r=(kn[t]||[]).concat(kn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function Sn(e,t,n){var r,i,o=0,s=Cn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=vn||Nn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:vn||Nn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(jn(c,l.opts.specialEasing);s>o;o++)if(r=Cn[o].call(l,e,c,l.opts))return r;return En(l,c),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function jn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(Sn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],kn[n]=kn[n]||[],kn[n].unshift(t)},prefilter:function(e,t){t?Cn.unshift(e):Cn.push(e)}});function Dn(e,t,n){var r,i,o,s,a,u,l,c,f,p=this,h=e.style,d={},g=[],m=e.nodeType&&At(e);n.queue||(c=x._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,x.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),a=q.get(e,"fxshow");for(r in t)if(o=t[r],bn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||a===undefined||a[r]===undefined)continue;m=!0}g.push(r)}if(s=g.length){a=q.get(e,"fxshow")||q.access(e,"fxshow",{}),"hidden"in a&&(m=a.hidden),u&&(a.hidden=!m),m?x(e).show():p.done(function(){x(e).hide()}),p.done(function(){var t;q.remove(e,"fxshow");for(t in d)x.style(e,t,d[t])});for(r=0;s>r;r++)i=g[r],l=p.createTween(i,m?a[i]:0),d[i]=a[i]||x.style(e,i),i in a||(a[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function An(e,t,n,r,i){return new An.prototype.init(e,t,n,r,i)}x.Tween=An,An.prototype={constructor:An,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=An.propHooks[this.prop];return e&&e.get?e.get(this):An.propHooks._default.get(this)},run:function(e){var t,n=An.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):An.propHooks._default.set(this),this}},An.prototype.init.prototype=An.prototype,An.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},An.propHooks.scrollTop=An.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Ln(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(At).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=Sn(this,x.extend({},e),o);s.finish=function(){t.stop(!0)},(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Tn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function Ln(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=St[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:Ln("show"),slideUp:Ln("hide"),slideToggle:Ln("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=An.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(vn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),vn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){xn||(xn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(xn),xn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=qn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),f=x(e),p={};"static"===c&&(e.style.position="relative"),a=f.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=f.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+i),"using"in t?t.using.call(e,p):f.css(p)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=qn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function qn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window); --------------------------------------------------------------------------------