├── .gitignore ├── index.html ├── README.md ├── js ├── vendor │ ├── htmlmixed.js │ ├── xml.js │ ├── javascript.js │ ├── css.js │ ├── jquery-ui.js │ └── jquery.js └── app.js └── css ├── reset.css └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Mesh: A Sleek Code Editor 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MESH 2 | > A sleek, collaborative, online code editor for HTML, CSS, JavaScript 3 | 4 | --- 5 | 6 | This project won Firebase's solo hackathon when their API was first exposed. That said, it will continue to grow (and be updated) with new features. If something is not working or you would like a new feature, please use the issues page. 7 | 8 | ## Demo 9 | 10 | Click for a demo: Mesh Code Editor. 11 | 12 | ## Installation 13 | 14 | You can simply fork and clone (or download) Mesh into your local directory: 15 | 16 | ``` 17 | $ git clone https://www.github.com/farhadg/mesh-code-editor 18 | ``` 19 | 20 | ## Usage 21 | 22 | Fire up `index.html` for the online code editor. You will be presented with some default text that'll provide you an idea of the layout. 23 | 24 | The preview box can be adjusted and dragged around. Be sure to select and drag around the edges (handlers), since the contents within the frame are exempt of this behaviour. 25 | 26 | You can also switch between a dark or light theme. 27 | 28 | For basic editor modifications, checkout `js/app.js` and `css/style.css`. 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
HTMLCSSJavaScript (jQuery)
37 | 38 | ## Options 39 | 40 | I'll be adding more meshing features; that said, if you'd like a feature, let me know so that I'll try and implement it into future updates. 41 | -------------------------------------------------------------------------------- /js/vendor/htmlmixed.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { 2 | var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); 3 | var cssMode = CodeMirror.getMode(config, "css"); 4 | 5 | var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes; 6 | scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, 7 | mode: CodeMirror.getMode(config, "javascript")}); 8 | if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) { 9 | var conf = scriptTypesConf[i]; 10 | scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)}); 11 | } 12 | scriptTypes.push({matches: /./, 13 | mode: CodeMirror.getMode(config, "text/plain")}); 14 | 15 | function html(stream, state) { 16 | var tagName = state.htmlState.tagName; 17 | var style = htmlMode.token(stream, state.htmlState); 18 | if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") { 19 | // Script block: mode to change to depends on type attribute 20 | var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); 21 | scriptType = scriptType ? scriptType[1] : ""; 22 | if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); 23 | for (var i = 0; i < scriptTypes.length; ++i) { 24 | var tp = scriptTypes[i]; 25 | if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { 26 | if (tp.mode) { 27 | state.token = script; 28 | state.localMode = tp.mode; 29 | state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); 30 | } 31 | break; 32 | } 33 | } 34 | } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { 35 | state.token = css; 36 | state.localMode = cssMode; 37 | state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); 38 | } 39 | return style; 40 | } 41 | function maybeBackup(stream, pat, style) { 42 | var cur = stream.current(); 43 | var close = cur.search(pat), m; 44 | if (close > -1) stream.backUp(cur.length - close); 45 | else if (m = cur.match(/<\/?$/)) { 46 | stream.backUp(cur.length); 47 | if (!stream.match(pat, false)) stream.match(cur); 48 | } 49 | return style; 50 | } 51 | function script(stream, state) { 52 | if (stream.match(/^<\/\s*script\s*>/i, false)) { 53 | state.token = html; 54 | state.localState = state.localMode = null; 55 | return html(stream, state); 56 | } 57 | return maybeBackup(stream, /<\/\s*script\s*>/, 58 | state.localMode.token(stream, state.localState)); 59 | } 60 | function css(stream, state) { 61 | if (stream.match(/^<\/\s*style\s*>/i, false)) { 62 | state.token = html; 63 | state.localState = state.localMode = null; 64 | return html(stream, state); 65 | } 66 | return maybeBackup(stream, /<\/\s*style\s*>/, 67 | cssMode.token(stream, state.localState)); 68 | } 69 | 70 | return { 71 | startState: function() { 72 | var state = htmlMode.startState(); 73 | return {token: html, localMode: null, localState: null, htmlState: state}; 74 | }, 75 | 76 | copyState: function(state) { 77 | if (state.localState) 78 | var local = CodeMirror.copyState(state.localMode, state.localState); 79 | return {token: state.token, localMode: state.localMode, localState: local, 80 | htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; 81 | }, 82 | 83 | token: function(stream, state) { 84 | return state.token(stream, state); 85 | }, 86 | 87 | indent: function(state, textAfter) { 88 | if (!state.localMode || /^\s*<\//.test(textAfter)) 89 | return htmlMode.indent(state.htmlState, textAfter); 90 | else if (state.localMode.indent) 91 | return state.localMode.indent(state.localState, textAfter); 92 | else 93 | return CodeMirror.Pass; 94 | }, 95 | 96 | electricChars: "/{}:", 97 | 98 | innerMode: function(state) { 99 | return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; 100 | } 101 | }; 102 | }, "xml", "javascript", "css"); 103 | 104 | 105 | CodeMirror.defineMIME("text/html", "htmlmixed"); 106 | -------------------------------------------------------------------------------- /js/app.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | var $window = $(window); 4 | var appRef = new Firebase('https://mesh-editor.firebaseio.com/'); 5 | 6 | /*========== User's Cursor ==========*/ 7 | 8 | var position = { 9 | html: { line: 0, ch: 0 }, 10 | css: { line: 0, ch: 0 }, 11 | js: { line: 0, ch: 0 } 12 | }; 13 | 14 | 15 | /*========== MESH CODE EDITOR BOXES ==========*/ 16 | 17 | var htmlBox = CodeMirror.fromTextArea(document.getElementById('html'), { 18 | lineNumbers: true, 19 | lineWrapping: true, 20 | mode: 'xml', 21 | htmlMode: true 22 | }); 23 | 24 | var cssBox = CodeMirror.fromTextArea(document.getElementById('css'), { 25 | lineNumbers: true, 26 | lineWrapping: true, 27 | mode: 'text/css' 28 | }); 29 | 30 | var jsBox = CodeMirror.fromTextArea(document.getElementById('js'), { 31 | lineNumbers: true, 32 | lineWrapping: true, 33 | mode: 'text/javascript' 34 | }); 35 | 36 | 37 | /*========== FIREBASE DATA FETCHING ==========*/ 38 | 39 | var notifyFireBase = true; 40 | 41 | appRef.on('value', function(snapshot) { 42 | var content = snapshot.val(); 43 | 44 | notifyFireBase = false; 45 | htmlBox.setValue(content.html.text); 46 | cssBox.setValue(content.css.text); 47 | jsBox.setValue(content.js.text); 48 | notifyFireBase = true; 49 | 50 | htmlBox.setCursor({ 51 | line: position.html.line, 52 | ch: position.html.ch 53 | }); 54 | 55 | cssBox.setCursor({ 56 | line: position.css.line, 57 | ch: position.css.ch 58 | }); 59 | 60 | jsBox.setCursor({ 61 | line: position.js.line, 62 | ch: position.js.ch 63 | }); 64 | 65 | }); 66 | 67 | 68 | /*========== PREVIEW FRAME CONTENT BUILDER ==========*/ 69 | 70 | var getContent = function() { 71 | var htmlContent = htmlBox.getValue(); 72 | var cssContent = cssBox.getValue(); 73 | var jsContent = jsBox.getValue(); 74 | 75 | var reset = function() { 76 | appRef.set({ 77 | html: { 78 | text: ['', 79 | '

[ mesh ]

', 80 | ''].join('\n') 86 | }, 87 | css: { 88 | text: ['/* CSS */', 89 | 'body { background: #3D3D3B; color: #aaa; }', 90 | 'h1 { padding: 0px 40px; color: gold; }', 91 | 'li { line-height: 1.7; }'].join('\n') 92 | }, 93 | js: { 94 | text: ['// JavaScript & jQuery', 95 | '$(\'body\').click(function() {', 96 | ' confirm("You\'re awesome, you know that?");', 97 | '});'].join('\n') 98 | } 99 | }); 100 | }; 101 | 102 | // Helper function (for demo) for resetting editors, once every hour 103 | setInterval(reset, 3600000); 104 | 105 | return '' 106 | + '' 109 | + htmlContent 110 | + '' 111 | + '' 116 | }; 117 | 118 | /*========== CODE EVENT LISTENERS ==========*/ 119 | 120 | var sync = function() { 121 | var htmlContent = htmlBox.getValue(); 122 | var cssContent = cssBox.getValue(); 123 | var jsContent = jsBox.getValue(); 124 | 125 | position.html = htmlBox.getCursor(); 126 | position.css = cssBox.getCursor(); 127 | position.js = jsBox.getCursor(); 128 | 129 | appRef.set({ 130 | html: { 131 | text: htmlContent 132 | }, 133 | css: { 134 | text: cssContent 135 | }, 136 | js: { 137 | text: jsContent 138 | } 139 | }); 140 | }; 141 | 142 | htmlBox.on('change', function() { 143 | updatePreview(); 144 | if (notifyFireBase) sync(); 145 | }); 146 | 147 | cssBox.on('change', function() { 148 | updatePreview(); 149 | if (notifyFireBase) sync(); 150 | }); 151 | 152 | jsBox.on('change', function() { 153 | updatePreview(); 154 | if (notifyFireBase) sync(); 155 | }); 156 | 157 | 158 | /*========== PREVIEW UPDATING ==========*/ 159 | 160 | var delay; 161 | var updatePreview = function() { 162 | clearTimeout(delay); 163 | 164 | var update = function() { 165 | var previewFrame = document.getElementById('preview'); 166 | var preview = previewFrame.contentDocument || previewFrame.contentWindow.document; 167 | preview.open(); 168 | preview.write(getContent()); 169 | preview.close(); 170 | }; 171 | 172 | delay = setTimeout(update, 500); 173 | } 174 | 175 | setInterval(updatePreview, 1000); 176 | 177 | 178 | /*========== STYLING & DYNAMIC BOX SIZING ==========*/ 179 | 180 | $('.lights').click(function(el) { 181 | el.preventDefault(); 182 | $('.cm-s-default').toggleClass('cm-s-monokai'); 183 | $(this).toggleClass('button-on'); 184 | }).click(); 185 | 186 | $('.together').click(function(el) { 187 | el.preventDefault(); 188 | $(this).toggleClass('button-on'); 189 | }).click(); 190 | 191 | $('#frame').animate({ 192 | 'height': ($window.height() / 1.8), 193 | 'width': ($window.width() / 2) 194 | }, 1000); 195 | 196 | var resizeBoxes = function() { 197 | var windowHeight = $(window).height(); 198 | var windowWidth = $(window).width(); 199 | $textBoxes = $('.CodeMirror'); 200 | $.each($textBoxes, function(idx, box) { 201 | $(box).height(windowHeight / 2.2); 202 | $(box).width(windowWidth / 2.15); 203 | }); 204 | }; 205 | 206 | resizeBoxes(); 207 | 208 | $window.resize(function() { 209 | resizeBoxes(); 210 | }); 211 | 212 | $('#frame').draggable().resizable({ 213 | handles: 'n, e, s, w, ne, se, sw, nw' 214 | }); 215 | 216 | }); 217 | -------------------------------------------------------------------------------- /css/reset.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v2.1.3 | MIT License | git.io/normalize */ 2 | 3 | /* ========================================================================== 4 | HTML5 display definitions 5 | ========================================================================== */ 6 | 7 | /** 8 | * Correct `block` display not defined in IE 8/9. 9 | */ 10 | 11 | article, 12 | aside, 13 | details, 14 | figcaption, 15 | figure, 16 | footer, 17 | header, 18 | hgroup, 19 | main, 20 | nav, 21 | section, 22 | summary { 23 | display: block; 24 | } 25 | 26 | /** 27 | * Correct `inline-block` display not defined in IE 8/9. 28 | */ 29 | 30 | audio, 31 | canvas, 32 | video { 33 | display: inline-block; 34 | } 35 | 36 | /** 37 | * Prevent modern browsers from displaying `audio` without controls. 38 | * Remove excess height in iOS 5 devices. 39 | */ 40 | 41 | audio:not([controls]) { 42 | display: none; 43 | height: 0; 44 | } 45 | 46 | /** 47 | * Address `[hidden]` styling not present in IE 8/9. 48 | * Hide the `template` element in IE, Safari, and Firefox < 22. 49 | */ 50 | 51 | [hidden], 52 | template { 53 | display: none; 54 | } 55 | 56 | /* ========================================================================== 57 | Base 58 | ========================================================================== */ 59 | 60 | /** 61 | * 1. Set default font family to sans-serif. 62 | * 2. Prevent iOS text size adjust after orientation change, without disabling 63 | * user zoom. 64 | */ 65 | 66 | html { 67 | font-family: sans-serif; /* 1 */ 68 | -ms-text-size-adjust: 100%; /* 2 */ 69 | -webkit-text-size-adjust: 100%; /* 2 */ 70 | } 71 | 72 | /** 73 | * Remove default margin. 74 | */ 75 | 76 | body { 77 | margin: 0; 78 | } 79 | 80 | /* ========================================================================== 81 | Links 82 | ========================================================================== */ 83 | 84 | /** 85 | * Remove the gray background color from active links in IE 10. 86 | */ 87 | 88 | a { 89 | background: transparent; 90 | } 91 | 92 | /** 93 | * Address `outline` inconsistency between Chrome and other browsers. 94 | */ 95 | 96 | a:focus { 97 | outline: thin dotted; 98 | } 99 | 100 | /** 101 | * Improve readability when focused and also mouse hovered in all browsers. 102 | */ 103 | 104 | a:active, 105 | a:hover { 106 | outline: 0; 107 | } 108 | 109 | /* ========================================================================== 110 | Typography 111 | ========================================================================== */ 112 | 113 | /** 114 | * Address variable `h1` font-size and margin within `section` and `article` 115 | * contexts in Firefox 4+, Safari 5, and Chrome. 116 | */ 117 | 118 | h1 { 119 | font-size: 2em; 120 | margin: 0.67em 0; 121 | } 122 | 123 | /** 124 | * Address styling not present in IE 8/9, Safari 5, and Chrome. 125 | */ 126 | 127 | abbr[title] { 128 | border-bottom: 1px dotted; 129 | } 130 | 131 | /** 132 | * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. 133 | */ 134 | 135 | b, 136 | strong { 137 | font-weight: bold; 138 | } 139 | 140 | /** 141 | * Address styling not present in Safari 5 and Chrome. 142 | */ 143 | 144 | dfn { 145 | font-style: italic; 146 | } 147 | 148 | /** 149 | * Address differences between Firefox and other browsers. 150 | */ 151 | 152 | hr { 153 | -moz-box-sizing: content-box; 154 | box-sizing: content-box; 155 | height: 0; 156 | } 157 | 158 | /** 159 | * Address styling not present in IE 8/9. 160 | */ 161 | 162 | mark { 163 | background: #ff0; 164 | color: #000; 165 | } 166 | 167 | /** 168 | * Correct font family set oddly in Safari 5 and Chrome. 169 | */ 170 | 171 | code, 172 | kbd, 173 | pre, 174 | samp { 175 | font-family: monospace, serif; 176 | font-size: 1em; 177 | } 178 | 179 | /** 180 | * Improve readability of pre-formatted text in all browsers. 181 | */ 182 | 183 | pre { 184 | white-space: pre-wrap; 185 | } 186 | 187 | /** 188 | * Set consistent quote types. 189 | */ 190 | 191 | q { 192 | quotes: "\201C" "\201D" "\2018" "\2019"; 193 | } 194 | 195 | /** 196 | * Address inconsistent and variable font size in all browsers. 197 | */ 198 | 199 | small { 200 | font-size: 80%; 201 | } 202 | 203 | /** 204 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 205 | */ 206 | 207 | sub, 208 | sup { 209 | font-size: 75%; 210 | line-height: 0; 211 | position: relative; 212 | vertical-align: baseline; 213 | } 214 | 215 | sup { 216 | top: -0.5em; 217 | } 218 | 219 | sub { 220 | bottom: -0.25em; 221 | } 222 | 223 | /* ========================================================================== 224 | Embedded content 225 | ========================================================================== */ 226 | 227 | /** 228 | * Remove border when inside `a` element in IE 8/9. 229 | */ 230 | 231 | img { 232 | border: 0; 233 | } 234 | 235 | /** 236 | * Correct overflow displayed oddly in IE 9. 237 | */ 238 | 239 | svg:not(:root) { 240 | overflow: hidden; 241 | } 242 | 243 | /* ========================================================================== 244 | Figures 245 | ========================================================================== */ 246 | 247 | /** 248 | * Address margin not present in IE 8/9 and Safari 5. 249 | */ 250 | 251 | figure { 252 | margin: 0; 253 | } 254 | 255 | /* ========================================================================== 256 | Forms 257 | ========================================================================== */ 258 | 259 | /** 260 | * Define consistent border, margin, and padding. 261 | */ 262 | 263 | fieldset { 264 | border: 1px solid #c0c0c0; 265 | margin: 0 2px; 266 | padding: 0.35em 0.625em 0.75em; 267 | } 268 | 269 | /** 270 | * 1. Correct `color` not being inherited in IE 8/9. 271 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 272 | */ 273 | 274 | legend { 275 | border: 0; /* 1 */ 276 | padding: 0; /* 2 */ 277 | } 278 | 279 | /** 280 | * 1. Correct font family not being inherited in all browsers. 281 | * 2. Correct font size not being inherited in all browsers. 282 | * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. 283 | */ 284 | 285 | button, 286 | input, 287 | select, 288 | textarea { 289 | font-family: inherit; /* 1 */ 290 | font-size: 100%; /* 2 */ 291 | margin: 0; /* 3 */ 292 | } 293 | 294 | /** 295 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 296 | * the UA stylesheet. 297 | */ 298 | 299 | button, 300 | input { 301 | line-height: normal; 302 | } 303 | 304 | /** 305 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 306 | * All other form control elements do not inherit `text-transform` values. 307 | * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. 308 | * Correct `select` style inheritance in Firefox 4+ and Opera. 309 | */ 310 | 311 | button, 312 | select { 313 | text-transform: none; 314 | } 315 | 316 | /** 317 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 318 | * and `video` controls. 319 | * 2. Correct inability to style clickable `input` types in iOS. 320 | * 3. Improve usability and consistency of cursor style between image-type 321 | * `input` and others. 322 | */ 323 | 324 | button, 325 | html input[type="button"], /* 1 */ 326 | input[type="reset"], 327 | input[type="submit"] { 328 | -webkit-appearance: button; /* 2 */ 329 | cursor: pointer; /* 3 */ 330 | } 331 | 332 | /** 333 | * Re-set default cursor for disabled elements. 334 | */ 335 | 336 | button[disabled], 337 | html input[disabled] { 338 | cursor: default; 339 | } 340 | 341 | /** 342 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 343 | * 2. Remove excess padding in IE 8/9/10. 344 | */ 345 | 346 | input[type="checkbox"], 347 | input[type="radio"] { 348 | box-sizing: border-box; /* 1 */ 349 | padding: 0; /* 2 */ 350 | } 351 | 352 | /** 353 | * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 354 | * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome 355 | * (include `-moz` to future-proof). 356 | */ 357 | 358 | input[type="search"] { 359 | -webkit-appearance: textfield; /* 1 */ 360 | -moz-box-sizing: content-box; 361 | -webkit-box-sizing: content-box; /* 2 */ 362 | box-sizing: content-box; 363 | } 364 | 365 | /** 366 | * Remove inner padding and search cancel button in Safari 5 and Chrome 367 | * on OS X. 368 | */ 369 | 370 | input[type="search"]::-webkit-search-cancel-button, 371 | input[type="search"]::-webkit-search-decoration { 372 | -webkit-appearance: none; 373 | } 374 | 375 | /** 376 | * Remove inner padding and border in Firefox 4+. 377 | */ 378 | 379 | button::-moz-focus-inner, 380 | input::-moz-focus-inner { 381 | border: 0; 382 | padding: 0; 383 | } 384 | 385 | /** 386 | * 1. Remove default vertical scrollbar in IE 8/9. 387 | * 2. Improve readability and alignment in all browsers. 388 | */ 389 | 390 | textarea { 391 | overflow: auto; /* 1 */ 392 | vertical-align: top; /* 2 */ 393 | } 394 | 395 | /* ========================================================================== 396 | Tables 397 | ========================================================================== */ 398 | 399 | /** 400 | * Remove most spacing between table cells. 401 | */ 402 | 403 | table { 404 | border-collapse: collapse; 405 | border-spacing: 0; 406 | } -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #ffffff; 3 | font-size: 1.2em; 4 | } 5 | 6 | .CodeMirror { 7 | font-family: monospace; 8 | height: 300px; 9 | } 10 | .CodeMirror-scroll { 11 | /* Set scrolling behaviour here */ 12 | overflow: auto; 13 | } 14 | 15 | /* PADDING */ 16 | 17 | .CodeMirror-lines { 18 | padding: 4px 0; /* Vertical padding around content */ 19 | } 20 | .CodeMirror pre { 21 | padding: 0 4px; /* Horizontal padding of content */ 22 | } 23 | 24 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 25 | background-color: white; /* The little square between H and V scrollbars */ 26 | } 27 | 28 | /* GUTTER */ 29 | 30 | .CodeMirror-gutters { 31 | background-color: background: rgba(0,0,0,0); 32 | border-right: 0px; 33 | white-space: nowrap; 34 | } 35 | .CodeMirror-linenumbers {} 36 | .CodeMirror-linenumber { 37 | padding: 0 3px 0 5px; 38 | min-width: 20px; 39 | text-align: right; 40 | color: #ccc; 41 | } 42 | 43 | /* CURSOR */ 44 | 45 | .CodeMirror div.CodeMirror-cursor { 46 | border-left: 1px solid black; 47 | z-index: 3; 48 | } 49 | /* Shown when moving in bi-directional text */ 50 | .CodeMirror div.CodeMirror-secondarycursor { 51 | border-left: 1px solid silver; 52 | } 53 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 54 | width: auto; 55 | border: 0; 56 | background: #7e7; 57 | z-index: 1; 58 | } 59 | /* Can style cursor different in overwrite (non-insert) mode */ 60 | .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} 61 | 62 | .cm-tab { display: inline-block; } 63 | 64 | /* DEFAULT THEME */ 65 | 66 | .cm-s-default .cm-keyword {color: #708;} 67 | .cm-s-default .cm-atom {color: #219;} 68 | .cm-s-default .cm-number {color: #164;} 69 | .cm-s-default .cm-def {color: #00f;} 70 | .cm-s-default .cm-variable {color: black;} 71 | .cm-s-default .cm-variable-2 {color: #05a;} 72 | .cm-s-default .cm-variable-3 {color: #085;} 73 | .cm-s-default .cm-property {color: black;} 74 | .cm-s-default .cm-operator {color: #666;} 75 | .cm-s-default .cm-comment {color: #a50;} 76 | .cm-s-default .cm-string {color: #a11;} 77 | .cm-s-default .cm-string-2 {color: #f50;} 78 | .cm-s-default .cm-meta {color: #555;} 79 | .cm-s-default .cm-qualifier {color: #555;} 80 | .cm-s-default .cm-builtin {color: #30a;} 81 | .cm-s-default .cm-bracket {color: #997;} 82 | .cm-s-default .cm-tag {color: #170;} 83 | .cm-s-default .cm-attribute {color: #00c;} 84 | .cm-s-default .cm-header {color: blue;} 85 | .cm-s-default .cm-quote {color: #090;} 86 | .cm-s-default .cm-hr {color: #999;} 87 | .cm-s-default .cm-link {color: #00c;} 88 | 89 | .cm-negative {color: #d44;} 90 | .cm-positive {color: #292;} 91 | .cm-header, .cm-strong {font-weight: bold;} 92 | .cm-em {font-style: italic;} 93 | .cm-link {text-decoration: underline;} 94 | 95 | .cm-s-default .cm-error {color: #f00;} 96 | .cm-invalidchar {color: #f00;} 97 | 98 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 99 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 100 | .CodeMirror-activeline-background {background: #e8f2ff;} 101 | 102 | /* STOP */ 103 | 104 | /* The rest of this file contains styles related to the mechanics of 105 | the editor. You probably shouldn't touch them. */ 106 | 107 | .CodeMirror { 108 | display: inline-block;float: left; 109 | line-height: 1.2em; 110 | position: relative; 111 | overflow: hidden; 112 | background: white; 113 | color: black; 114 | } 115 | 116 | .CodeMirror-scroll { 117 | /* 30px is the magic margin used to hide the element's real scrollbars */ 118 | /* See overflow: hidden in .CodeMirror */ 119 | margin-bottom: -30px; margin-right: -30px; 120 | padding-bottom: 30px; padding-right: 30px; 121 | height: 100%; 122 | outline: none; /* Prevent dragging from highlighting the element */ 123 | position: relative; 124 | -moz-box-sizing: content-box; 125 | box-sizing: content-box; 126 | } 127 | .CodeMirror-sizer { 128 | position: relative; 129 | } 130 | 131 | /* The fake, visible scrollbars. Used to force redraw during scrolling 132 | before actuall scrolling happens, thus preventing shaking and 133 | flickering artifacts. */ 134 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 135 | position: absolute; 136 | z-index: 6; 137 | display: none; 138 | } 139 | .CodeMirror-vscrollbar { 140 | right: 0; top: 0; 141 | overflow-x: hidden; 142 | overflow-y: scroll; 143 | } 144 | .CodeMirror-hscrollbar { 145 | bottom: 0; left: 0; 146 | overflow-y: hidden; 147 | overflow-x: scroll; 148 | } 149 | .CodeMirror-scrollbar-filler { 150 | right: 0; bottom: 0; 151 | } 152 | .CodeMirror-gutter-filler { 153 | left: 0; bottom: 0; 154 | } 155 | 156 | .CodeMirror-gutters { 157 | position: absolute; left: 0; top: 0; 158 | padding-bottom: 30px; 159 | z-index: 3; 160 | } 161 | .CodeMirror-gutter { 162 | white-space: normal; 163 | height: 100%; 164 | -moz-box-sizing: content-box; 165 | box-sizing: content-box; 166 | padding-bottom: 30px; 167 | margin-bottom: -32px; 168 | display: inline-block; 169 | /* Hack to make IE7 behave */ 170 | *zoom:1; 171 | *display:inline; 172 | } 173 | .CodeMirror-gutter-elt { 174 | position: absolute; 175 | cursor: default; 176 | z-index: 4; 177 | } 178 | 179 | .CodeMirror-lines { 180 | cursor: text; 181 | } 182 | .CodeMirror pre { 183 | /* Reset some styles that the rest of the page might have set */ 184 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; 185 | border-width: 0; 186 | background: transparent; 187 | font-family: inherit; 188 | font-size: inherit; 189 | margin: 0; 190 | white-space: pre; 191 | word-wrap: normal; 192 | line-height: inherit; 193 | color: inherit; 194 | z-index: 2; 195 | position: relative; 196 | overflow: visible; 197 | } 198 | .CodeMirror-wrap pre { 199 | word-wrap: break-word; 200 | white-space: pre-wrap; 201 | word-break: normal; 202 | } 203 | .CodeMirror-code pre { 204 | border-right: 30px solid transparent; 205 | width: -webkit-fit-content; 206 | width: -moz-fit-content; 207 | width: fit-content; 208 | } 209 | .CodeMirror-wrap .CodeMirror-code pre { 210 | border-right: none; 211 | width: auto; 212 | } 213 | .CodeMirror-linebackground { 214 | position: absolute; 215 | left: 0; right: 0; top: 0; bottom: 0; 216 | z-index: 0; 217 | } 218 | 219 | .CodeMirror-linewidget { 220 | position: relative; 221 | z-index: 2; 222 | overflow: auto; 223 | } 224 | 225 | .CodeMirror-widget {} 226 | 227 | .CodeMirror-wrap .CodeMirror-scroll { 228 | overflow-x: hidden; 229 | } 230 | 231 | .CodeMirror-measure { 232 | position: absolute; 233 | width: 100%; 234 | height: 0; 235 | overflow: hidden; 236 | visibility: hidden; 237 | } 238 | .CodeMirror-measure pre { position: static; } 239 | 240 | .CodeMirror div.CodeMirror-cursor { 241 | position: absolute; 242 | visibility: hidden; 243 | border-right: none; 244 | width: 0; 245 | } 246 | .CodeMirror-focused div.CodeMirror-cursor { 247 | visibility: visible; 248 | } 249 | 250 | .CodeMirror-selected { background: #d9d9d9; } 251 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 252 | 253 | .cm-searching { 254 | background: #ffa; 255 | background: rgba(255, 255, 0, .4); 256 | } 257 | 258 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 259 | .CodeMirror span { *vertical-align: text-bottom; } 260 | 261 | @media print { 262 | /* Hide the cursor when printing */ 263 | .CodeMirror div.CodeMirror-cursor { 264 | visibility: hidden; 265 | } 266 | } 267 | 268 | .cm-s-monokai {background: #272822;} 269 | .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} 270 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} 271 | .cm-s-monokai .CodeMirror-linenumber {color: #555;} 272 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} 273 | 274 | .cm-s-monokai span.cm-comment {color: #75715e;} 275 | .cm-s-monokai span.cm-atom {color: #ae81ff;} 276 | .cm-s-monokai span.cm-number {color: #ae81ff;} 277 | 278 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} 279 | .cm-s-monokai span.cm-keyword {color: #f92672;} 280 | .cm-s-monokai span.cm-string {color: #e6db74;} 281 | 282 | .cm-s-monokai span.cm-variable {color: #a6e22e;} 283 | .cm-s-monokai span.cm-variable-2 {color: #9effff;} 284 | .cm-s-monokai span.cm-def {color: #fd971f;} 285 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;} 286 | .cm-s-monokai span.cm-tag {color: #f92672;} 287 | .cm-s-monokai span.cm-link {color: #ae81ff;} 288 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} 289 | 290 | .cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;} 291 | .cm-s-monokai .CodeMirror-matchingbracket { 292 | text-decoration: underline; 293 | color: white !important; 294 | } 295 | 296 | .ui-resizable { 297 | position: relative; 298 | } 299 | 300 | .ui-resizable-handle { 301 | position: absolute; 302 | font-size: 0.1px; 303 | display: block; 304 | } 305 | 306 | .ui-resizable-disabled .ui-resizable-handle, 307 | .ui-resizable-autohide .ui-resizable-handle { 308 | display: none; 309 | } 310 | 311 | .ui-resizable-n { 312 | cursor: n-resize; 313 | height: 7px; 314 | width: 100%; 315 | top: -5px; 316 | left: 0; 317 | } 318 | 319 | .ui-resizable-s { 320 | cursor: s-resize; 321 | height: 7px; 322 | width: 100%; 323 | bottom: -5px; 324 | left: 0; 325 | } 326 | 327 | .ui-resizable-e { 328 | cursor: e-resize; 329 | width: 7px; 330 | right: -5px; 331 | top: 0; 332 | height: 100%; 333 | } 334 | 335 | .ui-resizable-w { 336 | cursor: w-resize; 337 | width: 7px; 338 | left: -5px; 339 | top: 0; 340 | height: 100%; 341 | } 342 | 343 | .ui-resizable-se { 344 | cursor: se-resize; 345 | width: 12px; 346 | height: 12px; 347 | right: 1px; 348 | bottom: 1px; 349 | } 350 | 351 | .ui-resizable-sw { 352 | cursor: sw-resize; 353 | width: 9px; 354 | height: 9px; 355 | left: -5px; 356 | bottom: -5px; 357 | } 358 | 359 | .ui-resizable-nw { 360 | cursor: nw-resize; 361 | width: 9px; 362 | height: 9px; 363 | left: -5px; 364 | top: -5px; 365 | } 366 | 367 | .ui-resizable-ne { 368 | cursor: ne-resize; 369 | width: 9px; 370 | height: 9px; 371 | right: -5px; 372 | top: -5px; 373 | } 374 | 375 | div.CodeMirror { 376 | padding: 10px 15px 15px 10px; 377 | margin: .5em; 378 | } 379 | 380 | #preview { 381 | width: 100%; 382 | height: 100%; 383 | border: none; 384 | } 385 | 386 | #frame { 387 | border: 8px solid #3D3D3B; 388 | padding: 15px; 389 | position: fixed; 390 | bottom: 20px; 391 | right: 20px; 392 | } 393 | 394 | #controls { 395 | position: fixed; 396 | top: 15px; 397 | right: 15px; 398 | z-index: 999; 399 | } 400 | 401 | .button { 402 | transition: all .3s ease; 403 | background-color: #3D3D3B; 404 | width: 40px; 405 | height: 40px; 406 | display: block; 407 | box-shadow: inset 0px 1px 1px 1px #000; 408 | } 409 | 410 | .button-on { 411 | transition: all .3s ease; 412 | background-color: #3D3D3B; 413 | box-shadow: 0px 1px 0px 1px rgba(0,0,0,.5), 414 | inset 0px 1px 0px 0px rgba(255,255,255,.3); 415 | } 416 | 417 | .button:hover, .button-on:hover { 418 | background-color: #555550; 419 | } 420 | 421 | .lights { 422 | background: url('http://i60.tinypic.com/2wdslf6.png') no-repeat; 423 | background-color: #3D3D3B; 424 | background-position: 8px; 425 | } 426 | 427 | /*.together { 428 | background: url('http://i61.tinypic.com/vyw3h4.png') no-repeat; 429 | background-color: #3D3D3B; 430 | background-position: 8px; 431 | }*/ -------------------------------------------------------------------------------- /js/vendor/xml.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("xml", function(config, parserConfig) { 2 | var indentUnit = config.indentUnit; 3 | var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; 4 | var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag || true; 5 | 6 | var Kludges = parserConfig.htmlMode ? { 7 | autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, 8 | 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, 9 | 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, 10 | 'track': true, 'wbr': true}, 11 | implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, 12 | 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, 13 | 'th': true, 'tr': true}, 14 | contextGrabbers: { 15 | 'dd': {'dd': true, 'dt': true}, 16 | 'dt': {'dd': true, 'dt': true}, 17 | 'li': {'li': true}, 18 | 'option': {'option': true, 'optgroup': true}, 19 | 'optgroup': {'optgroup': true}, 20 | 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, 21 | 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, 22 | 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, 23 | 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, 24 | 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, 25 | 'rp': {'rp': true, 'rt': true}, 26 | 'rt': {'rp': true, 'rt': true}, 27 | 'tbody': {'tbody': true, 'tfoot': true}, 28 | 'td': {'td': true, 'th': true}, 29 | 'tfoot': {'tbody': true}, 30 | 'th': {'td': true, 'th': true}, 31 | 'thead': {'tbody': true, 'tfoot': true}, 32 | 'tr': {'tr': true} 33 | }, 34 | doNotIndent: {"pre": true}, 35 | allowUnquoted: true, 36 | allowMissing: true 37 | } : { 38 | autoSelfClosers: {}, 39 | implicitlyClosed: {}, 40 | contextGrabbers: {}, 41 | doNotIndent: {}, 42 | allowUnquoted: false, 43 | allowMissing: false 44 | }; 45 | var alignCDATA = parserConfig.alignCDATA; 46 | 47 | // Return variables for tokenizers 48 | var tagName, type; 49 | 50 | function inText(stream, state) { 51 | function chain(parser) { 52 | state.tokenize = parser; 53 | return parser(stream, state); 54 | } 55 | 56 | var ch = stream.next(); 57 | if (ch == "<") { 58 | if (stream.eat("!")) { 59 | if (stream.eat("[")) { 60 | if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); 61 | else return null; 62 | } else if (stream.match("--")) { 63 | return chain(inBlock("comment", "-->")); 64 | } else if (stream.match("DOCTYPE", true, true)) { 65 | stream.eatWhile(/[\w\._\-]/); 66 | return chain(doctype(1)); 67 | } else { 68 | return null; 69 | } 70 | } else if (stream.eat("?")) { 71 | stream.eatWhile(/[\w\._\-]/); 72 | state.tokenize = inBlock("meta", "?>"); 73 | return "meta"; 74 | } else { 75 | var isClose = stream.eat("/"); 76 | tagName = ""; 77 | var c; 78 | while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; 79 | if (!tagName) return "tag error"; 80 | type = isClose ? "closeTag" : "openTag"; 81 | state.tokenize = inTag; 82 | return "tag"; 83 | } 84 | } else if (ch == "&") { 85 | var ok; 86 | if (stream.eat("#")) { 87 | if (stream.eat("x")) { 88 | ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); 89 | } else { 90 | ok = stream.eatWhile(/[\d]/) && stream.eat(";"); 91 | } 92 | } else { 93 | ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); 94 | } 95 | return ok ? "atom" : "error"; 96 | } else { 97 | stream.eatWhile(/[^&<]/); 98 | return null; 99 | } 100 | } 101 | 102 | function inTag(stream, state) { 103 | var ch = stream.next(); 104 | if (ch == ">" || (ch == "/" && stream.eat(">"))) { 105 | state.tokenize = inText; 106 | type = ch == ">" ? "endTag" : "selfcloseTag"; 107 | return "tag"; 108 | } else if (ch == "=") { 109 | type = "equals"; 110 | return null; 111 | } else if (ch == "<") { 112 | state.tokenize = inText; 113 | var next = state.tokenize(stream, state); 114 | return next ? next + " error" : "error"; 115 | } else if (/[\'\"]/.test(ch)) { 116 | state.tokenize = inAttribute(ch); 117 | state.stringStartCol = stream.column(); 118 | return state.tokenize(stream, state); 119 | } else { 120 | stream.eatWhile(/[^\s\u00a0=<>\"\']/); 121 | return "word"; 122 | } 123 | } 124 | 125 | function inAttribute(quote) { 126 | var closure = function(stream, state) { 127 | while (!stream.eol()) { 128 | if (stream.next() == quote) { 129 | state.tokenize = inTag; 130 | break; 131 | } 132 | } 133 | return "string"; 134 | }; 135 | closure.isInAttribute = true; 136 | return closure; 137 | } 138 | 139 | function inBlock(style, terminator) { 140 | return function(stream, state) { 141 | while (!stream.eol()) { 142 | if (stream.match(terminator)) { 143 | state.tokenize = inText; 144 | break; 145 | } 146 | stream.next(); 147 | } 148 | return style; 149 | }; 150 | } 151 | function doctype(depth) { 152 | return function(stream, state) { 153 | var ch; 154 | while ((ch = stream.next()) != null) { 155 | if (ch == "<") { 156 | state.tokenize = doctype(depth + 1); 157 | return state.tokenize(stream, state); 158 | } else if (ch == ">") { 159 | if (depth == 1) { 160 | state.tokenize = inText; 161 | break; 162 | } else { 163 | state.tokenize = doctype(depth - 1); 164 | return state.tokenize(stream, state); 165 | } 166 | } 167 | } 168 | return "meta"; 169 | }; 170 | } 171 | 172 | var curState, curStream, setStyle; 173 | function pass() { 174 | for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); 175 | } 176 | function cont() { 177 | pass.apply(null, arguments); 178 | return true; 179 | } 180 | 181 | function pushContext(tagName, startOfLine) { 182 | var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); 183 | curState.context = { 184 | prev: curState.context, 185 | tagName: tagName, 186 | indent: curState.indented, 187 | startOfLine: startOfLine, 188 | noIndent: noIndent 189 | }; 190 | } 191 | function popContext() { 192 | if (curState.context) curState.context = curState.context.prev; 193 | } 194 | 195 | function element(type) { 196 | if (type == "openTag") { 197 | curState.tagName = tagName; 198 | curState.tagStart = curStream.column(); 199 | return cont(attributes, endtag(curState.startOfLine)); 200 | } else if (type == "closeTag") { 201 | var err = false; 202 | if (curState.context) { 203 | if (curState.context.tagName != tagName) { 204 | if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) { 205 | popContext(); 206 | } 207 | err = !curState.context || curState.context.tagName != tagName; 208 | } 209 | } else { 210 | err = true; 211 | } 212 | if (err) setStyle = "error"; 213 | return cont(endclosetag(err)); 214 | } 215 | return cont(); 216 | } 217 | function endtag(startOfLine) { 218 | return function(type) { 219 | var tagName = curState.tagName; 220 | curState.tagName = curState.tagStart = null; 221 | if (type == "selfcloseTag" || 222 | (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) { 223 | maybePopContext(tagName.toLowerCase()); 224 | return cont(); 225 | } 226 | if (type == "endTag") { 227 | maybePopContext(tagName.toLowerCase()); 228 | pushContext(tagName, startOfLine); 229 | return cont(); 230 | } 231 | return cont(); 232 | }; 233 | } 234 | function endclosetag(err) { 235 | return function(type) { 236 | if (err) setStyle = "error"; 237 | if (type == "endTag") { popContext(); return cont(); } 238 | setStyle = "error"; 239 | return cont(arguments.callee); 240 | }; 241 | } 242 | function maybePopContext(nextTagName) { 243 | var parentTagName; 244 | while (true) { 245 | if (!curState.context) { 246 | return; 247 | } 248 | parentTagName = curState.context.tagName.toLowerCase(); 249 | if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || 250 | !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { 251 | return; 252 | } 253 | popContext(); 254 | } 255 | } 256 | 257 | function attributes(type) { 258 | if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);} 259 | if (type == "endTag" || type == "selfcloseTag") return pass(); 260 | setStyle = "error"; 261 | return cont(attributes); 262 | } 263 | function attribute(type) { 264 | if (type == "equals") return cont(attvalue, attributes); 265 | if (!Kludges.allowMissing) setStyle = "error"; 266 | else if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);} 267 | return (type == "endTag" || type == "selfcloseTag") ? pass() : cont(); 268 | } 269 | function attvalue(type) { 270 | if (type == "string") return cont(attvaluemaybe); 271 | if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();} 272 | setStyle = "error"; 273 | return (type == "endTag" || type == "selfCloseTag") ? pass() : cont(); 274 | } 275 | function attvaluemaybe(type) { 276 | if (type == "string") return cont(attvaluemaybe); 277 | else return pass(); 278 | } 279 | 280 | return { 281 | startState: function() { 282 | return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, tagStart: null, context: null}; 283 | }, 284 | 285 | token: function(stream, state) { 286 | if (!state.tagName && stream.sol()) { 287 | state.startOfLine = true; 288 | state.indented = stream.indentation(); 289 | } 290 | if (stream.eatSpace()) return null; 291 | 292 | setStyle = type = tagName = null; 293 | var style = state.tokenize(stream, state); 294 | state.type = type; 295 | if ((style || type) && style != "comment") { 296 | curState = state; curStream = stream; 297 | while (true) { 298 | var comb = state.cc.pop() || element; 299 | if (comb(type || style)) break; 300 | } 301 | } 302 | state.startOfLine = false; 303 | if (setStyle) 304 | style = setStyle == "error" ? style + " error" : setStyle; 305 | return style; 306 | }, 307 | 308 | indent: function(state, textAfter, fullLine) { 309 | var context = state.context; 310 | // Indent multi-line strings (e.g. css). 311 | if (state.tokenize.isInAttribute) { 312 | return state.stringStartCol + 1; 313 | } 314 | if ((state.tokenize != inTag && state.tokenize != inText) || 315 | context && context.noIndent) 316 | return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; 317 | // Indent the starts of attribute names. 318 | if (state.tagName) { 319 | if (multilineTagIndentPastTag) 320 | return state.tagStart + state.tagName.length + 2; 321 | else 322 | return state.tagStart + indentUnit * multilineTagIndentFactor; 323 | } 324 | if (alignCDATA && /", 336 | 337 | configuration: parserConfig.htmlMode ? "html" : "xml", 338 | helperType: parserConfig.htmlMode ? "html" : "xml" 339 | }; 340 | }); 341 | 342 | CodeMirror.defineMIME("text/xml", "xml"); 343 | CodeMirror.defineMIME("application/xml", "xml"); 344 | if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) 345 | CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); 346 | -------------------------------------------------------------------------------- /js/vendor/javascript.js: -------------------------------------------------------------------------------- 1 | // TODO actually recognize syntax of TypeScript constructs 2 | 3 | CodeMirror.defineMode("javascript", function(config, parserConfig) { 4 | var indentUnit = config.indentUnit; 5 | var statementIndent = parserConfig.statementIndent; 6 | var jsonMode = parserConfig.json; 7 | var isTS = parserConfig.typescript; 8 | 9 | var keywords = function(){ 10 | function kw(type) {return {type: type, style: "keyword"};} 11 | var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); 12 | var operator = kw("operator"), atom = {type: "atom", style: "atom"}; 13 | 14 | var jsKeywords = { 15 | "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, 16 | "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, 17 | "var": kw("var"), "const": kw("var"), "let": kw("var"), 18 | "function": kw("function"), "catch": kw("catch"), 19 | "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), 20 | "in": operator, "typeof": operator, "instanceof": operator, 21 | "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, 22 | "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"), 23 | "yield": C, "export": kw("export"), "import": kw("import"), "extends": C 24 | }; 25 | 26 | // Extend the 'normal' keywords with the TypeScript language extensions 27 | if (isTS) { 28 | var type = {type: "variable", style: "variable-3"}; 29 | var tsKeywords = { 30 | // object-like things 31 | "interface": kw("interface"), 32 | "extends": kw("extends"), 33 | "constructor": kw("constructor"), 34 | 35 | // scope modifiers 36 | "public": kw("public"), 37 | "private": kw("private"), 38 | "protected": kw("protected"), 39 | "static": kw("static"), 40 | 41 | // types 42 | "string": type, "number": type, "bool": type, "any": type 43 | }; 44 | 45 | for (var attr in tsKeywords) { 46 | jsKeywords[attr] = tsKeywords[attr]; 47 | } 48 | } 49 | 50 | return jsKeywords; 51 | }(); 52 | 53 | var isOperatorChar = /[+\-*&%=<>!?|~^]/; 54 | 55 | function nextUntilUnescaped(stream, end) { 56 | var escaped = false, next; 57 | while ((next = stream.next()) != null) { 58 | if (next == end && !escaped) 59 | return false; 60 | escaped = !escaped && next == "\\"; 61 | } 62 | return escaped; 63 | } 64 | 65 | // Used as scratch variables to communicate multiple values without 66 | // consing up tons of objects. 67 | var type, content; 68 | function ret(tp, style, cont) { 69 | type = tp; content = cont; 70 | return style; 71 | } 72 | function tokenBase(stream, state) { 73 | var ch = stream.next(); 74 | if (ch == '"' || ch == "'") { 75 | state.tokenize = tokenString(ch); 76 | return state.tokenize(stream, state); 77 | } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { 78 | return ret("number", "number"); 79 | } else if (ch == "." && stream.match("..")) { 80 | return ret("spread", "meta"); 81 | } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { 82 | return ret(ch); 83 | } else if (ch == "=" && stream.eat(">")) { 84 | return ret("=>"); 85 | } else if (ch == "0" && stream.eat(/x/i)) { 86 | stream.eatWhile(/[\da-f]/i); 87 | return ret("number", "number"); 88 | } else if (/\d/.test(ch)) { 89 | stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); 90 | return ret("number", "number"); 91 | } else if (ch == "/") { 92 | if (stream.eat("*")) { 93 | state.tokenize = tokenComment; 94 | return tokenComment(stream, state); 95 | } else if (stream.eat("/")) { 96 | stream.skipToEnd(); 97 | return ret("comment", "comment"); 98 | } else if (state.lastType == "operator" || state.lastType == "keyword c" || 99 | state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { 100 | nextUntilUnescaped(stream, "/"); 101 | stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla 102 | return ret("regexp", "string-2"); 103 | } else { 104 | stream.eatWhile(isOperatorChar); 105 | return ret("operator", null, stream.current()); 106 | } 107 | } else if (ch == "`") { 108 | state.tokenize = tokenQuasi; 109 | return tokenQuasi(stream, state); 110 | } else if (ch == "#") { 111 | stream.skipToEnd(); 112 | return ret("error", "error"); 113 | } else if (isOperatorChar.test(ch)) { 114 | stream.eatWhile(isOperatorChar); 115 | return ret("operator", null, stream.current()); 116 | } else { 117 | stream.eatWhile(/[\w\$_]/); 118 | var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; 119 | return (known && state.lastType != ".") ? ret(known.type, known.style, word) : 120 | ret("variable", "variable", word); 121 | } 122 | } 123 | 124 | function tokenString(quote) { 125 | return function(stream, state) { 126 | if (!nextUntilUnescaped(stream, quote)) 127 | state.tokenize = tokenBase; 128 | return ret("string", "string"); 129 | }; 130 | } 131 | 132 | function tokenComment(stream, state) { 133 | var maybeEnd = false, ch; 134 | while (ch = stream.next()) { 135 | if (ch == "/" && maybeEnd) { 136 | state.tokenize = tokenBase; 137 | break; 138 | } 139 | maybeEnd = (ch == "*"); 140 | } 141 | return ret("comment", "comment"); 142 | } 143 | 144 | function tokenQuasi(stream, state) { 145 | var escaped = false, next; 146 | while ((next = stream.next()) != null) { 147 | if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { 148 | state.tokenize = tokenBase; 149 | break; 150 | } 151 | escaped = !escaped && next == "\\"; 152 | } 153 | return ret("quasi", "string-2", stream.current()); 154 | } 155 | 156 | var brackets = "([{}])"; 157 | // This is a crude lookahead trick to try and notice that we're 158 | // parsing the argument patterns for a fat-arrow function before we 159 | // actually hit the arrow token. It only works if the arrow is on 160 | // the same line as the arguments and there's no strange noise 161 | // (comments) in between. Fallback is to only notice when we hit the 162 | // arrow, and not declare the arguments as locals for the arrow 163 | // body. 164 | function findFatArrow(stream, state) { 165 | if (state.fatArrowAt) state.fatArrowAt = null; 166 | var arrow = stream.string.indexOf("=>", stream.start); 167 | if (arrow < 0) return; 168 | 169 | var depth = 0, sawSomething = false; 170 | for (var pos = arrow - 1; pos >= 0; --pos) { 171 | var ch = stream.string.charAt(pos); 172 | var bracket = brackets.indexOf(ch); 173 | if (bracket >= 0 && bracket < 3) { 174 | if (!depth) { ++pos; break; } 175 | if (--depth == 0) break; 176 | } else if (bracket >= 3 && bracket < 6) { 177 | ++depth; 178 | } else if (/[$\w]/.test(ch)) { 179 | sawSomething = true; 180 | } else if (sawSomething && !depth) { 181 | ++pos; 182 | break; 183 | } 184 | } 185 | if (sawSomething && !depth) state.fatArrowAt = pos; 186 | } 187 | 188 | // Parser 189 | 190 | var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true}; 191 | 192 | function JSLexical(indented, column, type, align, prev, info) { 193 | this.indented = indented; 194 | this.column = column; 195 | this.type = type; 196 | this.prev = prev; 197 | this.info = info; 198 | if (align != null) this.align = align; 199 | } 200 | 201 | function inScope(state, varname) { 202 | for (var v = state.localVars; v; v = v.next) 203 | if (v.name == varname) return true; 204 | for (var cx = state.context; cx; cx = cx.prev) { 205 | for (var v = cx.vars; v; v = v.next) 206 | if (v.name == varname) return true; 207 | } 208 | } 209 | 210 | function parseJS(state, style, type, content, stream) { 211 | var cc = state.cc; 212 | // Communicate our context to the combinators. 213 | // (Less wasteful than consing up a hundred closures on every call.) 214 | cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; 215 | 216 | if (!state.lexical.hasOwnProperty("align")) 217 | state.lexical.align = true; 218 | 219 | while(true) { 220 | var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; 221 | if (combinator(type, content)) { 222 | while(cc.length && cc[cc.length - 1].lex) 223 | cc.pop()(); 224 | if (cx.marked) return cx.marked; 225 | if (type == "variable" && inScope(state, content)) return "variable-2"; 226 | return style; 227 | } 228 | } 229 | } 230 | 231 | // Combinator utils 232 | 233 | var cx = {state: null, column: null, marked: null, cc: null}; 234 | function pass() { 235 | for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); 236 | } 237 | function cont() { 238 | pass.apply(null, arguments); 239 | return true; 240 | } 241 | function register(varname) { 242 | function inList(list) { 243 | for (var v = list; v; v = v.next) 244 | if (v.name == varname) return true; 245 | return false; 246 | } 247 | var state = cx.state; 248 | if (state.context) { 249 | cx.marked = "def"; 250 | if (inList(state.localVars)) return; 251 | state.localVars = {name: varname, next: state.localVars}; 252 | } else { 253 | if (inList(state.globalVars)) return; 254 | if (parserConfig.globalVars) 255 | state.globalVars = {name: varname, next: state.globalVars}; 256 | } 257 | } 258 | 259 | // Combinators 260 | 261 | var defaultVars = {name: "this", next: {name: "arguments"}}; 262 | function pushcontext() { 263 | cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; 264 | cx.state.localVars = defaultVars; 265 | } 266 | function popcontext() { 267 | cx.state.localVars = cx.state.context.vars; 268 | cx.state.context = cx.state.context.prev; 269 | } 270 | function pushlex(type, info) { 271 | var result = function() { 272 | var state = cx.state, indent = state.indented; 273 | if (state.lexical.type == "stat") indent = state.lexical.indented; 274 | state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); 275 | }; 276 | result.lex = true; 277 | return result; 278 | } 279 | function poplex() { 280 | var state = cx.state; 281 | if (state.lexical.prev) { 282 | if (state.lexical.type == ")") 283 | state.indented = state.lexical.indented; 284 | state.lexical = state.lexical.prev; 285 | } 286 | } 287 | poplex.lex = true; 288 | 289 | function expect(wanted) { 290 | return function(type) { 291 | if (type == wanted) return cont(); 292 | else if (wanted == ";") return pass(); 293 | else return cont(arguments.callee); 294 | }; 295 | } 296 | 297 | function statement(type, value) { 298 | if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); 299 | if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); 300 | if (type == "keyword b") return cont(pushlex("form"), statement, poplex); 301 | if (type == "{") return cont(pushlex("}"), block, poplex); 302 | if (type == ";") return cont(); 303 | if (type == "if") return cont(pushlex("form"), expression, statement, poplex, maybeelse); 304 | if (type == "function") return cont(functiondef); 305 | if (type == "for") return cont(pushlex("form"), forspec, poplex, statement, poplex); 306 | if (type == "variable") return cont(pushlex("stat"), maybelabel); 307 | if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), 308 | block, poplex, poplex); 309 | if (type == "case") return cont(expression, expect(":")); 310 | if (type == "default") return cont(expect(":")); 311 | if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), 312 | statement, poplex, popcontext); 313 | if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex); 314 | if (type == "class") return cont(pushlex("form"), className, objlit, poplex); 315 | if (type == "export") return cont(pushlex("form"), afterExport, poplex); 316 | if (type == "import") return cont(pushlex("form"), afterImport, poplex); 317 | return pass(pushlex("stat"), expression, expect(";"), poplex); 318 | } 319 | function expression(type) { 320 | return expressionInner(type, false); 321 | } 322 | function expressionNoComma(type) { 323 | return expressionInner(type, true); 324 | } 325 | function expressionInner(type, noComma) { 326 | if (cx.state.fatArrowAt == cx.stream.start) { 327 | var body = noComma ? arrowBodyNoComma : arrowBody; 328 | if (type == "(") return cont(pushcontext, commasep(pattern, ")"), expect("=>"), body, popcontext); 329 | else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); 330 | } 331 | 332 | var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; 333 | if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); 334 | if (type == "function") return cont(functiondef); 335 | if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); 336 | if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); 337 | if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); 338 | if (type == "[") return cont(pushlex("]"), expressionNoComma, maybeArrayComprehension, poplex, maybeop); 339 | if (type == "{") return cont(commasep(objprop, "}"), maybeop); 340 | return cont(); 341 | } 342 | function maybeexpression(type) { 343 | if (type.match(/[;\}\)\],]/)) return pass(); 344 | return pass(expression); 345 | } 346 | function maybeexpressionNoComma(type) { 347 | if (type.match(/[;\}\)\],]/)) return pass(); 348 | return pass(expressionNoComma); 349 | } 350 | 351 | function maybeoperatorComma(type, value) { 352 | if (type == ",") return cont(expression); 353 | return maybeoperatorNoComma(type, value, false); 354 | } 355 | function maybeoperatorNoComma(type, value, noComma) { 356 | var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; 357 | var expr = noComma == false ? expression : expressionNoComma; 358 | if (value == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); 359 | if (type == "operator") { 360 | if (/\+\+|--/.test(value)) return cont(me); 361 | if (value == "?") return cont(expression, expect(":"), expr); 362 | return cont(expr); 363 | } 364 | if (type == "quasi") { cx.cc.push(me); return quasi(value); } 365 | if (type == ";") return; 366 | if (type == "(") return cont(commasep(expressionNoComma, ")", "call"), me); 367 | if (type == ".") return cont(property, me); 368 | if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); 369 | } 370 | function quasi(value) { 371 | if (!value) debugger; 372 | if (value.slice(value.length - 2) != "${") return cont(); 373 | return cont(expression, continueQuasi); 374 | } 375 | function continueQuasi(type) { 376 | if (type == "}") { 377 | cx.marked = "string-2"; 378 | cx.state.tokenize = tokenQuasi; 379 | return cont(); 380 | } 381 | } 382 | function arrowBody(type) { 383 | findFatArrow(cx.stream, cx.state); 384 | if (type == "{") return pass(statement); 385 | return pass(expression); 386 | } 387 | function arrowBodyNoComma(type) { 388 | findFatArrow(cx.stream, cx.state); 389 | if (type == "{") return pass(statement); 390 | return pass(expressionNoComma); 391 | } 392 | function maybelabel(type) { 393 | if (type == ":") return cont(poplex, statement); 394 | return pass(maybeoperatorComma, expect(";"), poplex); 395 | } 396 | function property(type) { 397 | if (type == "variable") {cx.marked = "property"; return cont();} 398 | } 399 | function objprop(type, value) { 400 | if (type == "variable") { 401 | cx.marked = "property"; 402 | if (value == "get" || value == "set") return cont(getterSetter); 403 | } else if (type == "number" || type == "string") { 404 | cx.marked = type + " property"; 405 | } else if (type == "[") { 406 | return cont(expression, expect("]"), afterprop); 407 | } 408 | if (atomicTypes.hasOwnProperty(type)) return cont(afterprop); 409 | } 410 | function getterSetter(type) { 411 | if (type != "variable") return pass(afterprop); 412 | cx.marked = "property"; 413 | return cont(functiondef); 414 | } 415 | function afterprop(type) { 416 | if (type == ":") return cont(expressionNoComma); 417 | if (type == "(") return pass(functiondef); 418 | } 419 | function commasep(what, end, info) { 420 | function proceed(type) { 421 | if (type == ",") { 422 | var lex = cx.state.lexical; 423 | if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; 424 | return cont(what, proceed); 425 | } 426 | if (type == end) return cont(); 427 | return cont(expect(end)); 428 | } 429 | return function(type) { 430 | if (type == end) return cont(); 431 | if (info === false) return pass(what, proceed); 432 | return pass(pushlex(end, info), what, proceed, poplex); 433 | }; 434 | } 435 | function block(type) { 436 | if (type == "}") return cont(); 437 | return pass(statement, block); 438 | } 439 | function maybetype(type) { 440 | if (isTS && type == ":") return cont(typedef); 441 | } 442 | function typedef(type) { 443 | if (type == "variable"){cx.marked = "variable-3"; return cont();} 444 | } 445 | function vardef() { 446 | return pass(pattern, maybetype, maybeAssign, vardefCont); 447 | } 448 | function pattern(type, value) { 449 | if (type == "variable") { register(value); return cont(); } 450 | if (type == "[") return cont(commasep(pattern, "]")); 451 | if (type == "{") return cont(commasep(proppattern, "}")); 452 | } 453 | function proppattern(type, value) { 454 | if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { 455 | register(value); 456 | return cont(maybeAssign); 457 | } 458 | if (type == "variable") cx.marked = "property"; 459 | return cont(expect(":"), pattern, maybeAssign); 460 | } 461 | function maybeAssign(_type, value) { 462 | if (value == "=") return cont(expressionNoComma); 463 | } 464 | function vardefCont(type) { 465 | if (type == ",") return cont(vardef); 466 | } 467 | function maybeelse(type, value) { 468 | if (type == "keyword b" && value == "else") return cont(pushlex("form"), statement, poplex); 469 | } 470 | function forspec(type) { 471 | if (type == "(") return cont(pushlex(")"), forspec1, expect(")")); 472 | } 473 | function forspec1(type) { 474 | if (type == "var") return cont(vardef, expect(";"), forspec2); 475 | if (type == ";") return cont(forspec2); 476 | if (type == "variable") return cont(formaybeinof); 477 | return pass(expression, expect(";"), forspec2); 478 | } 479 | function formaybeinof(_type, value) { 480 | if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } 481 | return cont(maybeoperatorComma, forspec2); 482 | } 483 | function forspec2(type, value) { 484 | if (type == ";") return cont(forspec3); 485 | if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } 486 | return pass(expression, expect(";"), forspec3); 487 | } 488 | function forspec3(type) { 489 | if (type != ")") cont(expression); 490 | } 491 | function functiondef(type, value) { 492 | if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} 493 | if (type == "variable") {register(value); return cont(functiondef);} 494 | if (type == "(") return cont(pushcontext, commasep(funarg, ")"), statement, popcontext); 495 | } 496 | function funarg(type) { 497 | if (type == "spread") return cont(funarg); 498 | return pass(pattern, maybetype); 499 | } 500 | function className(type, value) { 501 | if (type == "variable") {register(value); return cont(classNameAfter);} 502 | } 503 | function classNameAfter(_type, value) { 504 | if (value == "extends") return cont(expression); 505 | } 506 | function objlit(type) { 507 | if (type == "{") return cont(commasep(objprop, "}")); 508 | } 509 | function afterModule(type, value) { 510 | if (type == "string") return cont(statement); 511 | if (type == "variable") { register(value); return cont(maybeFrom); } 512 | } 513 | function afterExport(_type, value) { 514 | if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } 515 | if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } 516 | return pass(statement); 517 | } 518 | function afterImport(type) { 519 | if (type == "string") return cont(); 520 | return pass(importSpec, maybeFrom); 521 | } 522 | function importSpec(type, value) { 523 | if (type == "{") return cont(commasep(importSpec, "}")); 524 | if (type == "variable") register(value); 525 | return cont(); 526 | } 527 | function maybeFrom(_type, value) { 528 | if (value == "from") { cx.marked = "keyword"; return cont(expression); } 529 | } 530 | function maybeArrayComprehension(type) { 531 | if (type == "for") return pass(comprehension); 532 | if (type == ",") return cont(commasep(expressionNoComma, "]", false)); 533 | return pass(commasep(expressionNoComma, "]", false)); 534 | } 535 | function comprehension(type) { 536 | if (type == "for") return cont(forspec, comprehension); 537 | if (type == "if") return cont(expression, comprehension); 538 | } 539 | 540 | // Interface 541 | 542 | return { 543 | startState: function(basecolumn) { 544 | var state = { 545 | tokenize: tokenBase, 546 | lastType: "sof", 547 | cc: [], 548 | lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), 549 | localVars: parserConfig.localVars, 550 | context: parserConfig.localVars && {vars: parserConfig.localVars}, 551 | indented: 0 552 | }; 553 | if (parserConfig.globalVars) state.globalVars = parserConfig.globalVars; 554 | return state; 555 | }, 556 | 557 | token: function(stream, state) { 558 | if (stream.sol()) { 559 | if (!state.lexical.hasOwnProperty("align")) 560 | state.lexical.align = false; 561 | state.indented = stream.indentation(); 562 | findFatArrow(stream, state); 563 | } 564 | if (state.tokenize != tokenComment && stream.eatSpace()) return null; 565 | var style = state.tokenize(stream, state); 566 | if (type == "comment") return style; 567 | state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; 568 | return parseJS(state, style, type, content, stream); 569 | }, 570 | 571 | indent: function(state, textAfter) { 572 | if (state.tokenize == tokenComment) return CodeMirror.Pass; 573 | if (state.tokenize != tokenBase) return 0; 574 | var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; 575 | // Kludge to prevent 'maybelse' from blocking lexical scope pops 576 | for (var i = state.cc.length - 1; i >= 0; --i) { 577 | var c = state.cc[i]; 578 | if (c == poplex) lexical = lexical.prev; 579 | else if (c != maybeelse) break; 580 | } 581 | if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; 582 | if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") 583 | lexical = lexical.prev; 584 | var type = lexical.type, closing = firstChar == type; 585 | 586 | if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); 587 | else if (type == "form" && firstChar == "{") return lexical.indented; 588 | else if (type == "form") return lexical.indented + indentUnit; 589 | else if (type == "stat") 590 | return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? statementIndent || indentUnit : 0); 591 | else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) 592 | return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); 593 | else if (lexical.align) return lexical.column + (closing ? 0 : 1); 594 | else return lexical.indented + (closing ? 0 : indentUnit); 595 | }, 596 | 597 | electricChars: ":{}", 598 | blockCommentStart: jsonMode ? null : "/*", 599 | blockCommentEnd: jsonMode ? null : "*/", 600 | lineComment: jsonMode ? null : "//", 601 | fold: "brace", 602 | 603 | helperType: jsonMode ? "json" : "javascript", 604 | jsonMode: jsonMode 605 | }; 606 | }); 607 | 608 | CodeMirror.defineMIME("text/javascript", "javascript"); 609 | CodeMirror.defineMIME("text/ecmascript", "javascript"); 610 | CodeMirror.defineMIME("application/javascript", "javascript"); 611 | CodeMirror.defineMIME("application/ecmascript", "javascript"); 612 | CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); 613 | CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); 614 | CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); 615 | CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); 616 | -------------------------------------------------------------------------------- /js/vendor/css.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("css", function(config, parserConfig) { 2 | "use strict"; 3 | 4 | if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); 5 | 6 | var indentUnit = config.indentUnit || config.tabSize || 2, 7 | hooks = parserConfig.hooks || {}, 8 | atMediaTypes = parserConfig.atMediaTypes || {}, 9 | atMediaFeatures = parserConfig.atMediaFeatures || {}, 10 | propertyKeywords = parserConfig.propertyKeywords || {}, 11 | colorKeywords = parserConfig.colorKeywords || {}, 12 | valueKeywords = parserConfig.valueKeywords || {}, 13 | allowNested = !!parserConfig.allowNested, 14 | type = null; 15 | 16 | function ret(style, tp) { type = tp; return style; } 17 | 18 | function tokenBase(stream, state) { 19 | var ch = stream.next(); 20 | if (hooks[ch]) { 21 | // result[0] is style and result[1] is type 22 | var result = hooks[ch](stream, state); 23 | if (result !== false) return result; 24 | } 25 | if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());} 26 | else if (ch == "=") ret(null, "compare"); 27 | else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); 28 | else if (ch == "\"" || ch == "'") { 29 | state.tokenize = tokenString(ch); 30 | return state.tokenize(stream, state); 31 | } 32 | else if (ch == "#") { 33 | stream.eatWhile(/[\w\\\-]/); 34 | return ret("atom", "hash"); 35 | } 36 | else if (ch == "!") { 37 | stream.match(/^\s*\w*/); 38 | return ret("keyword", "important"); 39 | } 40 | else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { 41 | stream.eatWhile(/[\w.%]/); 42 | return ret("number", "unit"); 43 | } 44 | else if (ch === "-") { 45 | if (/\d/.test(stream.peek())) { 46 | stream.eatWhile(/[\w.%]/); 47 | return ret("number", "unit"); 48 | } else if (stream.match(/^[^-]+-/)) { 49 | return ret("meta", "meta"); 50 | } 51 | } 52 | else if (/[,+>*\/]/.test(ch)) { 53 | return ret(null, "select-op"); 54 | } 55 | else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { 56 | return ret("qualifier", "qualifier"); 57 | } 58 | else if (ch == ":") { 59 | return ret("operator", ch); 60 | } 61 | else if (/[;{}\[\]\(\)]/.test(ch)) { 62 | return ret(null, ch); 63 | } 64 | else if (ch == "u" && stream.match("rl(")) { 65 | stream.backUp(1); 66 | state.tokenize = tokenParenthesized; 67 | return ret("property", "variable"); 68 | } 69 | else { 70 | stream.eatWhile(/[\w\\\-]/); 71 | return ret("property", "variable"); 72 | } 73 | } 74 | 75 | function tokenString(quote, nonInclusive) { 76 | return function(stream, state) { 77 | var escaped = false, ch; 78 | while ((ch = stream.next()) != null) { 79 | if (ch == quote && !escaped) 80 | break; 81 | escaped = !escaped && ch == "\\"; 82 | } 83 | if (!escaped) { 84 | if (nonInclusive) stream.backUp(1); 85 | state.tokenize = tokenBase; 86 | } 87 | return ret("string", "string"); 88 | }; 89 | } 90 | 91 | function tokenParenthesized(stream, state) { 92 | stream.next(); // Must be '(' 93 | if (!stream.match(/\s*[\"\']/, false)) 94 | state.tokenize = tokenString(")", true); 95 | else 96 | state.tokenize = tokenBase; 97 | return ret(null, "("); 98 | } 99 | 100 | return { 101 | startState: function(base) { 102 | return {tokenize: tokenBase, 103 | baseIndent: base || 0, 104 | stack: [], 105 | lastToken: null}; 106 | }, 107 | 108 | token: function(stream, state) { 109 | 110 | // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50) 111 | // 112 | // rule** or **ruleset: 113 | // A selector + braces combo, or an at-rule. 114 | // 115 | // declaration block: 116 | // A sequence of declarations. 117 | // 118 | // declaration: 119 | // A property + colon + value combo. 120 | // 121 | // property value: 122 | // The entire value of a property. 123 | // 124 | // component value: 125 | // A single piece of a property value. Like the 5px in 126 | // text-shadow: 0 0 5px blue;. Can also refer to things that are 127 | // multiple terms, like the 1-4 terms that make up the background-size 128 | // portion of the background shorthand. 129 | // 130 | // term: 131 | // The basic unit of author-facing CSS, like a single number (5), 132 | // dimension (5px), string ("foo"), or function. Officially defined 133 | // by the CSS 2.1 grammar (look for the 'term' production) 134 | // 135 | // simple selector: 136 | // A single atomic selector, like a type selector, an attr selector, a 137 | // class selector, etc. 138 | // 139 | // compound selector: 140 | // One or more simple selectors without a combinator. div.example is 141 | // compound, div > .example is not. 142 | // 143 | // complex selector: 144 | // One or more compound selectors chained with combinators. 145 | // 146 | // combinator: 147 | // The parts of selectors that express relationships. There are four 148 | // currently - the space (descendant combinator), the greater-than 149 | // bracket (child combinator), the plus sign (next sibling combinator), 150 | // and the tilda (following sibling combinator). 151 | // 152 | // sequence of selectors: 153 | // One or more of the named type of selector chained with commas. 154 | 155 | state.tokenize = state.tokenize || tokenBase; 156 | if (state.tokenize == tokenBase && stream.eatSpace()) return null; 157 | var style = state.tokenize(stream, state); 158 | if (style && typeof style != "string") style = ret(style[0], style[1]); 159 | 160 | // Changing style returned based on context 161 | var context = state.stack[state.stack.length-1]; 162 | if (style == "variable") { 163 | if (type == "variable-definition") state.stack.push("propertyValue"); 164 | return state.lastToken = "variable-2"; 165 | } else if (style == "property") { 166 | var word = stream.current().toLowerCase(); 167 | if (context == "propertyValue") { 168 | if (valueKeywords.hasOwnProperty(word)) { 169 | style = "string-2"; 170 | } else if (colorKeywords.hasOwnProperty(word)) { 171 | style = "keyword"; 172 | } else { 173 | style = "variable-2"; 174 | } 175 | } else if (context == "rule") { 176 | if (!propertyKeywords.hasOwnProperty(word)) { 177 | style += " error"; 178 | } 179 | } else if (context == "block") { 180 | // if a value is present in both property, value, or color, the order 181 | // of preference is property -> color -> value 182 | if (propertyKeywords.hasOwnProperty(word)) { 183 | style = "property"; 184 | } else if (colorKeywords.hasOwnProperty(word)) { 185 | style = "keyword"; 186 | } else if (valueKeywords.hasOwnProperty(word)) { 187 | style = "string-2"; 188 | } else { 189 | style = "tag"; 190 | } 191 | } else if (!context || context == "@media{") { 192 | style = "tag"; 193 | } else if (context == "@media") { 194 | if (atMediaTypes[stream.current()]) { 195 | style = "attribute"; // Known attribute 196 | } else if (/^(only|not)$/.test(word)) { 197 | style = "keyword"; 198 | } else if (word == "and") { 199 | style = "error"; // "and" is only allowed in @mediaType 200 | } else if (atMediaFeatures.hasOwnProperty(word)) { 201 | style = "error"; // Known property, should be in @mediaType( 202 | } else { 203 | // Unknown, expecting keyword or attribute, assuming attribute 204 | style = "attribute error"; 205 | } 206 | } else if (context == "@mediaType") { 207 | if (atMediaTypes.hasOwnProperty(word)) { 208 | style = "attribute"; 209 | } else if (word == "and") { 210 | style = "operator"; 211 | } else if (/^(only|not)$/.test(word)) { 212 | style = "error"; // Only allowed in @media 213 | } else { 214 | // Unknown attribute or property, but expecting property (preceded 215 | // by "and"). Should be in parentheses 216 | style = "error"; 217 | } 218 | } else if (context == "@mediaType(") { 219 | if (propertyKeywords.hasOwnProperty(word)) { 220 | // do nothing, remains "property" 221 | } else if (atMediaTypes.hasOwnProperty(word)) { 222 | style = "error"; // Known property, should be in parentheses 223 | } else if (word == "and") { 224 | style = "operator"; 225 | } else if (/^(only|not)$/.test(word)) { 226 | style = "error"; // Only allowed in @media 227 | } else { 228 | style += " error"; 229 | } 230 | } else if (context == "@import") { 231 | style = "tag"; 232 | } else { 233 | style = "error"; 234 | } 235 | } else if (style == "atom") { 236 | if(!context || context == "@media{" || context == "block") { 237 | style = "builtin"; 238 | } else if (context == "propertyValue") { 239 | if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { 240 | style += " error"; 241 | } 242 | } else { 243 | style = "error"; 244 | } 245 | } else if (context == "@media" && type == "{") { 246 | style = "error"; 247 | } 248 | 249 | // Push/pop context stack 250 | if (type == "{") { 251 | if (context == "@media" || context == "@mediaType") { 252 | state.stack[state.stack.length-1] = "@media{"; 253 | } 254 | else { 255 | var newContext = allowNested ? "block" : "rule"; 256 | state.stack.push(newContext); 257 | } 258 | } 259 | else if (type == "}") { 260 | if (context == "interpolation") style = "operator"; 261 | // Pop off end of array until { is reached 262 | while(state.stack.length){ 263 | var removed = state.stack.pop(); 264 | if(removed.indexOf("{") > -1 || removed == "block" || removed == "rule"){ 265 | break; 266 | } 267 | } 268 | } 269 | else if (type == "interpolation") state.stack.push("interpolation"); 270 | else if (type == "@media") state.stack.push("@media"); 271 | else if (type == "@import") state.stack.push("@import"); 272 | else if (context == "@media" && /\b(keyword|attribute)\b/.test(style)) 273 | state.stack[state.stack.length-1] = "@mediaType"; 274 | else if (context == "@mediaType" && stream.current() == ",") 275 | state.stack[state.stack.length-1] = "@media"; 276 | else if (type == "(") { 277 | if (context == "@media" || context == "@mediaType") { 278 | // Make sure @mediaType is used to avoid error on { 279 | state.stack[state.stack.length-1] = "@mediaType"; 280 | state.stack.push("@mediaType("); 281 | } 282 | else state.stack.push("("); 283 | } 284 | else if (type == ")") { 285 | // Pop off end of array until ( is reached 286 | while(state.stack.length){ 287 | var removed = state.stack.pop(); 288 | if(removed.indexOf("(") > -1){ 289 | break; 290 | } 291 | } 292 | } 293 | else if (type == ":" && state.lastToken == "property") state.stack.push("propertyValue"); 294 | else if (context == "propertyValue" && type == ";") state.stack.pop(); 295 | else if (context == "@import" && type == ";") state.stack.pop(); 296 | 297 | return state.lastToken = style; 298 | }, 299 | 300 | indent: function(state, textAfter) { 301 | var n = state.stack.length; 302 | if (/^\}/.test(textAfter)) 303 | n -= state.stack[n-1] == "propertyValue" ? 2 : 1; 304 | return state.baseIndent + n * indentUnit; 305 | }, 306 | 307 | electricChars: "}", 308 | blockCommentStart: "/*", 309 | blockCommentEnd: "*/", 310 | fold: "brace" 311 | }; 312 | }); 313 | 314 | (function() { 315 | function keySet(array) { 316 | var keys = {}; 317 | for (var i = 0; i < array.length; ++i) { 318 | keys[array[i]] = true; 319 | } 320 | return keys; 321 | } 322 | 323 | var atMediaTypes = keySet([ 324 | "all", "aural", "braille", "handheld", "print", "projection", "screen", 325 | "tty", "tv", "embossed" 326 | ]); 327 | 328 | var atMediaFeatures = keySet([ 329 | "width", "min-width", "max-width", "height", "min-height", "max-height", 330 | "device-width", "min-device-width", "max-device-width", "device-height", 331 | "min-device-height", "max-device-height", "aspect-ratio", 332 | "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", 333 | "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", 334 | "max-color", "color-index", "min-color-index", "max-color-index", 335 | "monochrome", "min-monochrome", "max-monochrome", "resolution", 336 | "min-resolution", "max-resolution", "scan", "grid" 337 | ]); 338 | 339 | var propertyKeywords = keySet([ 340 | "align-content", "align-items", "align-self", "alignment-adjust", 341 | "alignment-baseline", "anchor-point", "animation", "animation-delay", 342 | "animation-direction", "animation-duration", "animation-iteration-count", 343 | "animation-name", "animation-play-state", "animation-timing-function", 344 | "appearance", "azimuth", "backface-visibility", "background", 345 | "background-attachment", "background-clip", "background-color", 346 | "background-image", "background-origin", "background-position", 347 | "background-repeat", "background-size", "baseline-shift", "binding", 348 | "bleed", "bookmark-label", "bookmark-level", "bookmark-state", 349 | "bookmark-target", "border", "border-bottom", "border-bottom-color", 350 | "border-bottom-left-radius", "border-bottom-right-radius", 351 | "border-bottom-style", "border-bottom-width", "border-collapse", 352 | "border-color", "border-image", "border-image-outset", 353 | "border-image-repeat", "border-image-slice", "border-image-source", 354 | "border-image-width", "border-left", "border-left-color", 355 | "border-left-style", "border-left-width", "border-radius", "border-right", 356 | "border-right-color", "border-right-style", "border-right-width", 357 | "border-spacing", "border-style", "border-top", "border-top-color", 358 | "border-top-left-radius", "border-top-right-radius", "border-top-style", 359 | "border-top-width", "border-width", "bottom", "box-decoration-break", 360 | "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", 361 | "caption-side", "clear", "clip", "color", "color-profile", "column-count", 362 | "column-fill", "column-gap", "column-rule", "column-rule-color", 363 | "column-rule-style", "column-rule-width", "column-span", "column-width", 364 | "columns", "content", "counter-increment", "counter-reset", "crop", "cue", 365 | "cue-after", "cue-before", "cursor", "direction", "display", 366 | "dominant-baseline", "drop-initial-after-adjust", 367 | "drop-initial-after-align", "drop-initial-before-adjust", 368 | "drop-initial-before-align", "drop-initial-size", "drop-initial-value", 369 | "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", 370 | "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", 371 | "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", 372 | "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", 373 | "font-stretch", "font-style", "font-synthesis", "font-variant", 374 | "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", 375 | "font-variant-ligatures", "font-variant-numeric", "font-variant-position", 376 | "font-weight", "grid-cell", "grid-column", "grid-column-align", 377 | "grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow", 378 | "grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span", 379 | "grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens", 380 | "icon", "image-orientation", "image-rendering", "image-resolution", 381 | "inline-box-align", "justify-content", "left", "letter-spacing", 382 | "line-break", "line-height", "line-stacking", "line-stacking-ruby", 383 | "line-stacking-shift", "line-stacking-strategy", "list-style", 384 | "list-style-image", "list-style-position", "list-style-type", "margin", 385 | "margin-bottom", "margin-left", "margin-right", "margin-top", 386 | "marker-offset", "marks", "marquee-direction", "marquee-loop", 387 | "marquee-play-count", "marquee-speed", "marquee-style", "max-height", 388 | "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", 389 | "nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline", 390 | "outline-color", "outline-offset", "outline-style", "outline-width", 391 | "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", 392 | "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", 393 | "page", "page-break-after", "page-break-before", "page-break-inside", 394 | "page-policy", "pause", "pause-after", "pause-before", "perspective", 395 | "perspective-origin", "pitch", "pitch-range", "play-during", "position", 396 | "presentation-level", "punctuation-trim", "quotes", "region-break-after", 397 | "region-break-before", "region-break-inside", "region-fragment", 398 | "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", 399 | "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", 400 | "ruby-position", "ruby-span", "shape-inside", "shape-outside", "size", 401 | "speak", "speak-as", "speak-header", 402 | "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", 403 | "tab-size", "table-layout", "target", "target-name", "target-new", 404 | "target-position", "text-align", "text-align-last", "text-decoration", 405 | "text-decoration-color", "text-decoration-line", "text-decoration-skip", 406 | "text-decoration-style", "text-emphasis", "text-emphasis-color", 407 | "text-emphasis-position", "text-emphasis-style", "text-height", 408 | "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", 409 | "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", 410 | "text-wrap", "top", "transform", "transform-origin", "transform-style", 411 | "transition", "transition-delay", "transition-duration", 412 | "transition-property", "transition-timing-function", "unicode-bidi", 413 | "vertical-align", "visibility", "voice-balance", "voice-duration", 414 | "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", 415 | "voice-volume", "volume", "white-space", "widows", "width", "word-break", 416 | "word-spacing", "word-wrap", "z-index", "zoom", 417 | // SVG-specific 418 | "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", 419 | "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", 420 | "color-interpolation", "color-interpolation-filters", "color-profile", 421 | "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", 422 | "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", 423 | "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", 424 | "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", 425 | "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", 426 | "glyph-orientation-vertical", "kerning", "text-anchor", "writing-mode" 427 | ]); 428 | 429 | var colorKeywords = keySet([ 430 | "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", 431 | "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", 432 | "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", 433 | "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", 434 | "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", 435 | "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", 436 | "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", 437 | "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", 438 | "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", 439 | "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", 440 | "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", 441 | "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", 442 | "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", 443 | "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", 444 | "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", 445 | "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", 446 | "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", 447 | "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", 448 | "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", 449 | "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", 450 | "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", 451 | "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", 452 | "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", 453 | "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", 454 | "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", 455 | "whitesmoke", "yellow", "yellowgreen" 456 | ]); 457 | 458 | var valueKeywords = keySet([ 459 | "above", "absolute", "activeborder", "activecaption", "afar", 460 | "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate", 461 | "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", 462 | "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page", 463 | "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", 464 | "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", 465 | "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel", 466 | "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian", 467 | "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", 468 | "cell", "center", "checkbox", "circle", "cjk-earthly-branch", 469 | "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", 470 | "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", 471 | "content-box", "context-menu", "continuous", "copy", "cover", "crop", 472 | "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", 473 | "decimal-leading-zero", "default", "default-button", "destination-atop", 474 | "destination-in", "destination-out", "destination-over", "devanagari", 475 | "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted", 476 | "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", 477 | "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", 478 | "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", 479 | "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", 480 | "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", 481 | "ethiopic-halehame-gez", "ethiopic-halehame-om-et", 482 | "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", 483 | "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", 484 | "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed", 485 | "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes", 486 | "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", 487 | "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", 488 | "help", "hidden", "hide", "higher", "highlight", "highlighttext", 489 | "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", 490 | "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", 491 | "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", 492 | "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", 493 | "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", 494 | "landscape", "lao", "large", "larger", "left", "level", "lighter", 495 | "line-through", "linear", "lines", "list-item", "listbox", "listitem", 496 | "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", 497 | "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", 498 | "lower-roman", "lowercase", "ltr", "malayalam", "match", 499 | "media-controls-background", "media-current-time-display", 500 | "media-fullscreen-button", "media-mute-button", "media-play-button", 501 | "media-return-to-realtime-button", "media-rewind-button", 502 | "media-seek-back-button", "media-seek-forward-button", "media-slider", 503 | "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", 504 | "media-volume-slider-container", "media-volume-sliderthumb", "medium", 505 | "menu", "menulist", "menulist-button", "menulist-text", 506 | "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", 507 | "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", 508 | "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", 509 | "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", 510 | "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", 511 | "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", 512 | "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", 513 | "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer", 514 | "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", 515 | "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", 516 | "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", 517 | "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", 518 | "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield", 519 | "searchfield-cancel-button", "searchfield-decoration", 520 | "searchfield-results-button", "searchfield-results-decoration", 521 | "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", 522 | "single", "skip-white-space", "slide", "slider-horizontal", 523 | "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", 524 | "small", "small-caps", "small-caption", "smaller", "solid", "somali", 525 | "source-atop", "source-in", "source-out", "source-over", "space", "square", 526 | "square-button", "start", "static", "status-bar", "stretch", "stroke", 527 | "sub", "subpixel-antialiased", "super", "sw-resize", "table", 528 | "table-caption", "table-cell", "table-column", "table-column-group", 529 | "table-footer-group", "table-header-group", "table-row", "table-row-group", 530 | "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", 531 | "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", 532 | "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", 533 | "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", 534 | "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", 535 | "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", 536 | "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", 537 | "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", 538 | "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", 539 | "window", "windowframe", "windowtext", "x-large", "x-small", "xor", 540 | "xx-large", "xx-small" 541 | ]); 542 | 543 | function tokenCComment(stream, state) { 544 | var maybeEnd = false, ch; 545 | while ((ch = stream.next()) != null) { 546 | if (maybeEnd && ch == "/") { 547 | state.tokenize = null; 548 | break; 549 | } 550 | maybeEnd = (ch == "*"); 551 | } 552 | return ["comment", "comment"]; 553 | } 554 | 555 | CodeMirror.defineMIME("text/css", { 556 | atMediaTypes: atMediaTypes, 557 | atMediaFeatures: atMediaFeatures, 558 | propertyKeywords: propertyKeywords, 559 | colorKeywords: colorKeywords, 560 | valueKeywords: valueKeywords, 561 | hooks: { 562 | "<": function(stream, state) { 563 | function tokenSGMLComment(stream, state) { 564 | var dashes = 0, ch; 565 | while ((ch = stream.next()) != null) { 566 | if (dashes >= 2 && ch == ">") { 567 | state.tokenize = null; 568 | break; 569 | } 570 | dashes = (ch == "-") ? dashes + 1 : 0; 571 | } 572 | return ["comment", "comment"]; 573 | } 574 | if (stream.eat("!")) { 575 | state.tokenize = tokenSGMLComment; 576 | return tokenSGMLComment(stream, state); 577 | } 578 | }, 579 | "/": function(stream, state) { 580 | if (stream.eat("*")) { 581 | state.tokenize = tokenCComment; 582 | return tokenCComment(stream, state); 583 | } 584 | return false; 585 | } 586 | }, 587 | name: "css" 588 | }); 589 | 590 | CodeMirror.defineMIME("text/x-scss", { 591 | atMediaTypes: atMediaTypes, 592 | atMediaFeatures: atMediaFeatures, 593 | propertyKeywords: propertyKeywords, 594 | colorKeywords: colorKeywords, 595 | valueKeywords: valueKeywords, 596 | allowNested: true, 597 | hooks: { 598 | ":": function(stream) { 599 | if (stream.match(/\s*{/)) { 600 | return [null, "{"]; 601 | } 602 | return false; 603 | }, 604 | "$": function(stream) { 605 | stream.match(/^[\w-]+/); 606 | if (stream.peek() == ":") { 607 | return ["variable", "variable-definition"]; 608 | } 609 | return ["variable", "variable"]; 610 | }, 611 | ",": function(stream, state) { 612 | if (state.stack[state.stack.length - 1] == "propertyValue" && stream.match(/^ *\$/, false)) { 613 | return ["operator", ";"]; 614 | } 615 | }, 616 | "/": function(stream, state) { 617 | if (stream.eat("/")) { 618 | stream.skipToEnd(); 619 | return ["comment", "comment"]; 620 | } else if (stream.eat("*")) { 621 | state.tokenize = tokenCComment; 622 | return tokenCComment(stream, state); 623 | } else { 624 | return ["operator", "operator"]; 625 | } 626 | }, 627 | "#": function(stream) { 628 | if (stream.eat("{")) { 629 | return ["operator", "interpolation"]; 630 | } else { 631 | stream.eatWhile(/[\w\\\-]/); 632 | return ["atom", "hash"]; 633 | } 634 | } 635 | }, 636 | name: "css" 637 | }); 638 | })(); 639 | -------------------------------------------------------------------------------- /js/vendor/jquery-ui.js: -------------------------------------------------------------------------------- 1 | (function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return"area"===o?(s=t.parentNode,n=s.name,t.href&&n&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css("position"),("absolute"===a||"relative"===a||"fixed"===a)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var a=e.attr(t,"tabindex"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,a&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===a?["Left","Right"]:["Top","Bottom"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+a]=function(i){return i===t?o["inner"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+a]=function(t,i){return"number"!=typeof t?o["outer"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var a=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],n=u+"-"+i,a||(a=s,s=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&"_"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},a=i.split("."),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,a){var n,r=this;"boolean"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,a,n){"string"==typeof a&&(a={effect:a});var r,o=a?a===!0||"number"==typeof a?i:a.effect||i:t;a=a||{},"number"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var a=this._uiHash();if(this._trigger("drag",t,a)===!1)return this._mouseUp({}),!1;this.position=a.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,a=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(a=e.ui.ddmanager.drop(this,t)),this.dropped&&(a=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!a||"valid"===this.options.revert&&a||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,a)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,a=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return a.parents("body").length||a.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),a[0]===this.element[0]||/(fixed|absolute)/.test(a.css("position"))||a.css("position","absolute"),a},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,a,s=this.options;return s.containment?"window"===s.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===s.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):s.containment.constructor===Array?(this.containment=s.containment,undefined):("parent"===s.containment&&(s.containment=this.helper[0].parentNode),i=e(s.containment),a=i[0],a&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(a.scrollWidth,a.offsetWidth):a.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(a.scrollHeight,a.offsetHeight):a.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var a="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}),{top:i.top+this.offset.relative.top*a+this.offset.parent.top*a-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*a,left:i.left+this.offset.relative.left*a+this.offset.parent.left*a-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*a}},_generatePosition:function(t){var i,a,s,n,r=this.options,o="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=t.pageX,h=t.pageY;return this.offset.scroll||(this.offset.scroll={top:o.scrollTop(),left:o.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(a=this.relative_container.offset(),i=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),r.grid&&(s=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,h=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-r.grid[1]:s+r.grid[1]:s,n=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,a){return a=a||this._uiHash(),e.ui.plugin.call(this,t,[i,a]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,a)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var a=e(this).data("ui-draggable"),s=a.options,n=e.extend({},i,{item:a.element});a.sortables=[],e(s.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(a.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i){var a=e(this).data("ui-draggable"),s=e.extend({},i,{item:a.element});e.each(a.sortables,function(){this.instance.isOver?(this.instance.isOver=0,a.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===a.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,s))})},drag:function(t,i){var a=e(this).data("ui-draggable"),s=this;e.each(a.sortables,function(){var n=!1,r=this;this.instance.positionAbs=a.positionAbs,this.instance.helperProportions=a.helperProportions,this.instance.offset.click=a.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(n=!0,e.each(a.sortables,function(){return this.instance.positionAbs=a.positionAbs,this.instance.helperProportions=a.helperProportions,this.instance.offset.click=a.offset.click,this!==r&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(r.instance.element[0],this.instance.element[0])&&(n=!1),n})),n?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(s).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=a.offset.click.top,this.instance.offset.click.left=a.offset.click.left,this.instance.offset.parent.left-=a.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=a.offset.parent.top-this.instance.offset.parent.top,a._trigger("toSortable",t),a.dropped=this.instance.element,a.currentItem=a.element,this.instance.fromOutside=a),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),a._trigger("fromSortable",t),a.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var a=e(i.helper),s=e(this).data("ui-draggable").options;a.css("opacity")&&(s._opacity=a.css("opacity")),a.css("opacity",s.opacity)},stop:function(t,i){var a=e(this).data("ui-draggable").options;a._opacity&&e(i.helper).css("opacity",a._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),a=i.options,s=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(a.axis&&"x"===a.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY=0;d--)o=p.snapElements[d].left,l=o+p.snapElements[d].width,h=p.snapElements[d].top,u=h+p.snapElements[d].height,o-m>v||g>l+m||h-m>b||y>u+m||!e.contains(p.snapElements[d].item.ownerDocument,p.snapElements[d].item)?(p.snapElements[d].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(a=m>=Math.abs(h-b),s=m>=Math.abs(u-y),n=m>=Math.abs(o-v),r=m>=Math.abs(l-g),a&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),n&&(i.position.left=p._convertPositionTo("relative",{top:0,left:o-p.helperProportions.width}).left-p.margins.left),r&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),c=a||s||n||r,"outer"!==f.snapMode&&(a=m>=Math.abs(h-y),s=m>=Math.abs(u-b),n=m>=Math.abs(o-g),r=m>=Math.abs(l-v),a&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),s&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.left=p._convertPositionTo("relative",{top:0,left:o}).left-p.margins.left),r&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[d].snapping&&(a||s||n||r||c)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=a||s||n||r||c)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,a=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});a.length&&(t=parseInt(e(a[0]).css("zIndex"),10)||0,e(a).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+a.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var a=e(i.helper),s=e(this).data("ui-draggable").options;a.css("zIndex")&&(s._zIndex=a.css("zIndex")),a.css("zIndex",s.zIndex)},stop:function(t,i){var a=e(this).data("ui-draggable").options;a._zIndex&&e(i.helper).css("zIndex",a._zIndex)}})})(jQuery);(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,a,n,r=this,o=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=o.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),n="ui-resizable-"+s,a=e("
"),a.css({zIndex:o.zIndex}),"se"===s&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(a);this._renderAxis=function(t){var i,s,a,n;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),n=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),a=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(a,n),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){r.resizing||(this.className&&(a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=a&&a[1]?a[1]:"se")}),o.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){o.disabled||(e(this).removeClass("ui-resizable-autohide"),r._handles.show())}).mouseleave(function(){o.disabled||r.resizing||(e(this).addClass("ui-resizable-autohide"),r._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,a=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(a=!0);return!this.options.disabled&&a},_mouseStart:function(i){var s,a,n,r=this.options,o=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:o.top,left:o.left}),this._renderProxy(),s=t(this.helper.css("left")),a=t(this.helper.css("top")),r.containment&&(s+=e(r.containment).scrollLeft()||0,a+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:a},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:a},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,a={},n=this.originalMousePosition,r=this.axis,o=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-n.left||0,d=t.pageY-n.top||0,p=this._change[r];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==o&&(a.top=this.position.top+"px"),this.position.left!==h&&(a.left=this.position.left+"px"),this.size.width!==l&&(a.width=this.size.width+"px"),this.size.height!==u&&(a.height=this.size.height+"px"),s.css(a),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(a)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,a,n,r,o,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),a=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,n=s?0:u.sizeDiff.width,r={width:u.helper.width()-n,height:u.helper.height()-a},o=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(r,{top:h,left:o})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,a,n,r,o=this.options;r={minWidth:i(o.minWidth)?o.minWidth:0,maxWidth:i(o.maxWidth)?o.maxWidth:1/0,minHeight:i(o.minHeight)?o.minHeight:0,maxHeight:i(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=r.minHeight*this.aspectRatio,a=r.minWidth/this.aspectRatio,s=r.maxHeight*this.aspectRatio,n=r.maxWidth/this.aspectRatio,t>r.minWidth&&(r.minWidth=t),a>r.minHeight&&(r.minHeight=a),r.maxWidth>s&&(r.maxWidth=s),r.maxHeight>n&&(r.maxHeight=n)),this._vBoundaries=r},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,a=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===a&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===a&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,a=i(e.width)&&t.maxWidth&&t.maxWidthe.width,o=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return r&&(e.width=t.minWidth),o&&(e.height=t.minHeight),a&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),r&&u&&(e.left=h-t.minWidth),a&&u&&(e.left=h-t.maxWidth),o&&c&&(e.top=l-t.minHeight),n&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,a,n=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(a=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[a.css("borderTopWidth"),a.css("borderRightWidth"),a.css("borderBottomWidth"),a.css("borderLeftWidth")],s=[a.css("paddingTop"),a.css("paddingRight"),a.css("paddingBottom"),a.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);a.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,a=this.originalPosition;return{top:a.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,a=i._proportionallyResizeElements,n=a.length&&/textarea/i.test(a[0].nodeName),r=n&&e.ui.hasScroll(a[0],"left")?0:i.sizeDiff.height,o=n?0:i.sizeDiff.width,h={width:i.size.width-o,height:i.size.height-r},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};a&&a.length&&e(a[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,a,n,r,o,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,a){s[e]=t(i.css("padding"+a))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},a=l.containerOffset,n=l.containerSize.height,r=l.containerSize.width,o=e.ui.hasScroll(p,"left")?p.scrollWidth:r,h=e.ui.hasScroll(p)?p.scrollHeight:n,l.parentData={element:p,left:a.left,top:a.top,width:o,height:h}))},resize:function(t){var i,s,a,n,r=e(this).data("ui-resizable"),o=r.options,h=r.containerOffset,l=r.position,u=r._aspectRatio||t.shiftKey,c={top:0,left:0},d=r.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(r._helper?h.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-h.left:r.position.left-c.left),u&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=o.helper?h.left:0),l.top<(r._helper?h.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-h.top:r.position.top),u&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?h.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top,i=Math.abs((r._helper?r.offset.left-c.left:r.offset.left-c.left)+r.sizeDiff.width),s=Math.abs((r._helper?r.offset.top-c.top:r.offset.top-h.top)+r.sizeDiff.height),a=r.containerElement.get(0)===r.element.parent().get(0),n=/relative|absolute/.test(r.containerElement.css("position")),a&&n&&(i-=r.parentData.left),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,u&&(r.size.height=r.size.width/r.aspectRatio)),s+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-s,u&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,a=t.containerPosition,n=t.containerElement,r=e(t.helper),o=r.offset(),h=r.outerWidth()-t.sizeDiff.width,l=r.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(n.css("position"))&&e(this).css({left:o.left-a.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(n.css("position"))&&e(this).css({left:o.left-a.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),a=s.options,n=s.originalSize,r=s.originalPosition,o={height:s.size.height-n.height||0,width:s.size.width-n.width||0,top:s.position.top-r.top||0,left:s.position.left-r.left||0},h=function(t,s){e(t).each(function(){var t=e(this),a=e(this).data("ui-resizable-alsoresize"),n={},r=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(e,t){var i=(a[t]||0)+(o[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})};"object"!=typeof a.alsoResize||a.alsoResize.nodeType?h(a.alsoResize):e.each(a.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,a=t.originalSize,n=t.originalPosition,r=t.axis,o="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=o[0]||1,l=o[1]||1,u=Math.round((s.width-a.width)/h)*h,c=Math.round((s.height-a.height)/l)*l,d=a.width+u,p=a.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=o,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(r)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(r)?(t.size.width=d,t.size.height=p,t.position.top=n.top-c):/^(sw)$/.test(r)?(t.size.width=d,t.size.height=p,t.position.left=n.left-u):(t.size.width=d,t.size.height=p,t.position.top=n.top-c,t.position.left=n.left-u)}})})(jQuery); -------------------------------------------------------------------------------- /js/vendor/jquery.js: -------------------------------------------------------------------------------- 1 | (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=[],p="2.0.2",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\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:p,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"+(p+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 f.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,p,f,h,d,g,m,y,v="sizzle"+-new Date,b=e.document,w=0,T=0,C=at(),k=at(),N=at(),E=!1,S=function(){return 0},j=typeof undefined,D=1<<31,A={}.hasOwnProperty,L=[],H=L.pop,q=L.push,O=L.push,F=L.slice,P=L.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),B="\\["+M+"*("+W+")"+M+"*(?:([*^$|!~]?=)"+M+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+M+"*\\]",I=":("+W+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+B.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=RegExp("^"+M+"*,"+M+"*"),X=RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=RegExp(M+"*[+~]"),Y=RegExp("="+M+"*([^\\]'\"]*)"+M+"*\\]","g"),V=RegExp(I),G=RegExp("^"+$+"$"),J={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+B),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/^(?:input|select|textarea|button)$/i,et=/^h\d$/i,tt=/'|\\/g,nt=RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{O.apply(L=F.call(b.childNodes),b.childNodes),L[b.childNodes.length].nodeType}catch(it){O={apply:L.length?function(e,t){q.apply(e,F.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function ot(e,t,r,i){var o,s,a,u,l,f,g,m,x,w;if((t?t.ownerDocument||t:b)!==p&&c(t),t=t||p,r=r||[],!e||"string"!=typeof e)return r;if(1!==(u=t.nodeType)&&9!==u)return[];if(h&&!i){if(o=K.exec(e))if(a=o[1]){if(9===u){if(s=t.getElementById(a),!s||!s.parentNode)return r;if(s.id===a)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&y(t,s)&&s.id===a)return r.push(s),r}else{if(o[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=o[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&(!d||!d.test(e))){if(m=g=v,x=t,w=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){f=vt(e),(g=t.getAttribute("id"))?m=g.replace(tt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;while(l--)f[l]=m+xt(f[l]);x=U.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return O.apply(r,x.querySelectorAll(w)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return St(e.replace(z,"$1"),t,r,i)}function st(e){return Q.test(e+"")}function at(){var e=[];function t(n,r){return e.push(n+=" ")>i.cacheLength&&delete t[e.shift()],t[n]=r}return t}function ut(e){return e[v]=!0,e}function lt(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t,n){e=e.split("|");var r,o=e.length,s=n?null:t;while(o--)(r=i.attrHandle[e[o]])&&r!==t||(i.attrHandle[e[o]]=s)}function pt(e,t){var n=e.getAttributeNode(t);return n&&n.specified?n.value:e[t]===!0?t.toLowerCase():null}function ft(e,t){return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function ht(e){return"input"===e.nodeName.toLowerCase()?e.defaultValue:undefined}function dt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~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 gt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function mt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function yt(e){return ut(function(t){return t=+t,ut(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]))})})}s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},n=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:b,r=t.parentWindow;return t!==p&&9===t.nodeType&&t.documentElement?(p=t,f=t.documentElement,h=!s(t),r&&r.frameElement&&r.attachEvent("onbeforeunload",function(){c()}),n.attributes=lt(function(e){return e.innerHTML="
",ct("type|href|height|width",ft,"#"===e.firstChild.getAttribute("href")),ct(R,pt,null==e.getAttribute("disabled")),e.className="i",!e.getAttribute("className")}),n.input=lt(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}),ct("value",ht,n.attributes&&n.input),n.getElementsByTagName=lt(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=lt(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),n.getById=lt(function(e){return f.appendChild(e).id=v,!t.getElementsByName||!t.getElementsByName(v).length}),n.getById?(i.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.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},i.find.CLASS=n.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&h?t.getElementsByClassName(e):undefined},g=[],d=[],(n.qsa=st(t.querySelectorAll))&&(lt(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll(":checked").length||d.push(":checked")}),lt(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&d.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")})),(n.matchesSelector=st(m=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&<(function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",I)}),d=d.length&&RegExp(d.join("|")),g=g.length&&RegExp(g.join("|")),y=st(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},n.sortDetached=lt(function(e){return 1&e.compareDocumentPosition(t.createElement("div"))}),S=f.compareDocumentPosition?function(e,r){if(e===r)return E=!0,0;var i=r.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(r);return i?1&i||!n.sortDetached&&r.compareDocumentPosition(e)===i?e===t||y(b,e)?-1:r===t||y(b,r)?1:l?P.call(l,e)-P.call(l,r):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],u=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:l?P.call(l,e)-P.call(l,n):0;if(o===s)return dt(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)u.unshift(r);while(a[i]===u[i])i++;return i?dt(a[i],u[i]):a[i]===b?-1:u[i]===b?1:0},t):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Y,"='$1']"),!(!n.matchesSelector||!h||g&&g.test(t)||d&&d.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&c(e);var r=i.attrHandle[t.toLowerCase()],o=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!h):undefined;return o===undefined?n.attributes||!h?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null:o},ot.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,o=0;if(E=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(S),E){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=ot.selectors={cacheLength:50,createPseudo:ut,match:J,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(nt,rt),e[3]=(e[4]||e[5]||"").replace(nt,rt),"~="===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]||ot.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]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return J.CHILD.test(e[0])?null:(e[3]&&e[4]!==undefined?e[2]=e[4]:n&&V.test(n)&&(t=vt(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(nt,rt).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("(^|"+M+")"+e+"("+M+"|$)"))&&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=ot.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,p,f,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){p=t;while(p=p[g])if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[v]||(m[v]={}),l=c[e]||[],h=l[0]===w&&l[1],f=l[0]===w&&l[2],p=h&&m.childNodes[h];while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[w,h,f];break}}else if(x&&(l=(t[v]||(t[v]={}))[e])&&l[0]===w)f=l[1];else while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if((a?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(x&&((p[v]||(p[v]={}))[e]=[w,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[v]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ut(function(e,n){var i,o=r(e,t),s=o.length;while(s--)i=P.call(e,o[s]),e[i]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ut(function(e){var t=[],n=[],r=a(e.replace(z,"$1"));return r[v]?ut(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:ut(function(e){return function(t){return ot(e,t).length>0}}),contains:ut(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ut(function(e){return G.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=h?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===p.activeElement&&(!p.hasFocus||p.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!i.pseudos.empty(e)},header:function(e){return et.test(e.nodeName)},input:function(e){return Z.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:yt(function(){return[0]}),last:yt(function(e,t){return[t-1]}),eq:yt(function(e,t,n){return[0>n?n+t:n]}),even:yt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:yt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:yt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:yt(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})i.pseudos[t]=gt(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=mt(t);function vt(e,t){var n,r,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=i.preFilter;while(a){(!n||(r=_.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=X.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(z," ")}),a=a.slice(n.length));for(s in i.filter)!(r=J[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ot.error(e):k(e,u).slice(0)}function xt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function bt(e,t,n){var i=t.dir,o=n&&"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,n,a){var u,l,c,p=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[v]||(t[v]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,a)||r,l[1]===!0)return!0}}function wt(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 Tt(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 Ct(e,t,n,r,i,o){return r&&!r[v]&&(r=Ct(r)),i&&!i[v]&&(i=Ct(i,o)),ut(function(o,s,a,u){var l,c,p,f=[],h=[],d=s.length,g=o||Et(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:Tt(g,f,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=Tt(y,h),r(l,[],a,u),c=l.length;while(c--)(p=l[c])&&(y[h[c]]=!(m[h[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?P.call(o,p):f[c])>-1&&(o[l]=!(s[l]=p))}}else y=Tt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):O.apply(s,y)})}function kt(e){var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,c=bt(function(e){return e===t},a,!0),p=bt(function(e){return P.call(t,e)>-1},a,!0),f=[function(e,n,r){return!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>l;l++)if(n=i.relative[e[l].type])f=[bt(wt(f),n)];else{if(n=i.filter[e[l].type].apply(null,e[l].matches),n[v]){for(r=++l;o>r;r++)if(i.relative[e[r].type])break;return Ct(l>1&&wt(f),l>1&&xt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&kt(e.slice(l,r)),o>r&&kt(e=e.slice(r)),o>r&&xt(e))}f.push(n)}return wt(f)}function Nt(e,t){var n=0,o=t.length>0,s=e.length>0,a=function(a,l,c,f,h){var d,g,m,y=[],v=0,x="0",b=a&&[],T=null!=h,C=u,k=a||s&&i.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(u=l!==p&&l,r=n);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,c)){f.push(d);break}T&&(w=N,r=++n)}o&&((d=!m&&d)&&v--,a&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,c);if(a){if(v>0)while(x--)b[x]||y[x]||(y[x]=H.call(f));y=Tt(y)}O.apply(f,y),T&&!a&&y.length>0&&v+t.length>1&&ot.uniqueSort(f)}return T&&(w=N,u=C),b};return o?ut(a):a}a=ot.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=vt(e)),n=t.length;while(n--)o=kt(t[n]),o[v]?r.push(o):i.push(o);o=N(e,Nt(i,r))}return o};function Et(e,t,n){var r=0,i=t.length;for(;i>r;r++)ot(e,t[r],n);return n}function St(e,t,r,o){var s,u,l,c,p,f=vt(e);if(!o&&1===f.length){if(u=f[0]=f[0].slice(0),u.length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&h&&i.relative[u[1].type]){if(t=(i.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return r;e=e.slice(u.shift().value.length)}s=J.needsContext.test(e)?0:u.length;while(s--){if(l=u[s],i.relative[c=l.type])break;if((p=i.find[c])&&(o=p(l.matches[0].replace(nt,rt),U.test(u[0].type)&&t.parentNode||t))){if(u.splice(s,1),e=o.length&&xt(u),!e)return O.apply(r,o),r;break}}}return a(e,f)(o,t,!h,r,U.test(e)),r}i.pseudos.nth=i.pseudos.eq;function jt(){}jt.prototype=i.filters=i.pseudos,i.setFilters=new jt,n.sortStable=v.split("").sort(S).join("")===v,c(),[0,0].sort(S),n.detectDuplicates=E,x.find=ot,x.expr=ot.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ot.uniqueSort,x.text=ot.getText,x.isXMLDoc=ot.isXML,x.contains=ot.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(p){for(t=e.memory&&p,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(p[0],p[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,H,q=/(?:\{[\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))x.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},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,o=this.key(e),s=this.cache[o];if(t===undefined)this.cache[o]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):(i=x.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(w)||[])),n=r.length;while(n--)delete s[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},L=new F,H=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||H.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 H.access(e,t,n)},_removeData:function(e,t){H.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&&!H.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.slice(5)),P(i,r,s[r]));H.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:q.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=H.get(e,t),n&&(!r||x.isArray(n)?r=H.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--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire() 2 | },_queueHooks:function(e,t){var n=t+"queueHooks";return H.get(e,n)||H.access(e,n,{empty:x.Callbacks("once memory").add(function(){H.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);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=H.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\f]/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&&H.set(this,"__className__",this.className),this.className=this.className||e===!1?"":H.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;1===this.nodeType&&(i=r?e.call(this,n,x(this).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.bool.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.bool.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.bool.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,p,f,h,d,g,m,y=H.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&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},p=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,f.setup&&f.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),f.add&&(f.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,p):h.push(p),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,p,f,h,d,g,m=H.hasData(e)&&H.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){p=x.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;while(o--)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&p.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,H.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,p,f,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]),f=x.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!x.isWindow(r)){for(l=f.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:f.bindType||d,p=(H.get(a,"events")||{})[t.type]&&H.get(a,"handle"),p&&p.apply(a,n),p=c&&a[c],p&&x.acceptData(a)&&p.apply&&p.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||f._default&&f._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=(H.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,s=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new x.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):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=/^(?:parents|prev(?:Until|All))/,Q=x.expr.match.needsContext,K={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e: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(et(this,e||[],!0))},filter:function(e){return this.pushStack(et(this,e||[],!1))},is:function(e){return!!et(this,"string"==typeof e&&Q.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],s=Q.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 Z(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 Z(e,"nextSibling")},prev:function(e){return Z(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 e.contentDocument||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&&(K[e]||x.unique(i),J.test(e)&&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 et(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 tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nt=/<([\w:]+)/,rt=/<|&#?\w+;/,it=/<(?:script|style|link)/i,ot=/^(?:checkbox|radio)$/i,st=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,ut=/^true\/(.*)/,lt=/^\s*\s*$/g,ct={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.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=pt(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=pt(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(mt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&dt(mt(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(mt(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&&!it.test(e)&&!ct[(nt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(tt,"<$1>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(mt(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&&(r&&r.parentNode!==i&&(r=this.nextSibling),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=f.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,p=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&st.test(d))return this.each(function(r){var i=p.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(mt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,mt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,ht),l=0;s>l;l++)a=o[l],at.test(a.type||"")&&!H.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(lt,"")))}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=mt(a),o=mt(e),r=0,i=o.length;i>r;r++)yt(o[r],s[r]);if(t)if(n)for(o=o||mt(e),s=s||mt(a),r=0,i=o.length;i>r;r++)gt(o[r],s[r]);else gt(e,a);return s=mt(a,"script"),s.length>0&&dt(s,!u&&mt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,p=e.length,f=t.createDocumentFragment(),h=[];for(;p>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(rt.test(i)){o=o||f.appendChild(t.createElement("div")),s=(nt.exec(i)||["",""])[1].toLowerCase(),a=ct[s]||ct._default,o.innerHTML=a[1]+i.replace(tt,"<$1>")+a[2],l=a[0];while(l--)o=o.firstChild;x.merge(h,o.childNodes),o=f.firstChild,o.textContent=""}else h.push(t.createTextNode(i));f.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=mt(f.appendChild(i),"script"),u&&dt(o),n)){l=0;while(i=o[l++])at.test(i.type||"")&&n.push(i)}return f},cleanData:function(e){var t,n,r,i,o,s,a=x.event.special,u=0;for(;(n=e[u])!==undefined;u++){if(F.accepts(n)&&(o=n[H.expando],o&&(t=H.cache[o]))){if(r=Object.keys(t.events||{}),r.length)for(s=0;(i=r[s])!==undefined;s++)a[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);H.cache[o]&&delete H.cache[o]}delete L.cache[n[L.expando]]}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}});function pt(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 ht(e){var t=ut.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function dt(e,t){var n=e.length,r=0;for(;n>r;r++)H.set(e[r],"globalEval",!t||H.get(t[r],"globalEval"))}function gt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(H.hasData(e)&&(o=H.access(e),s=H.set(t,o),l=o.events)){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 mt(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 yt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ot.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 vt,xt,bt=/^(none|table(?!-c[ea]).+)/,wt=/^margin/,Tt=RegExp("^("+b+")(.*)$","i"),Ct=RegExp("^("+b+")(?!px)[a-z%]+$","i"),kt=RegExp("^([+-])=("+b+")","i"),Nt={BODY:"block"},Et={position:"absolute",visibility:"hidden",display:"block"},St={letterSpacing:0,fontWeight:400},jt=["Top","Right","Bottom","Left"],Dt=["Webkit","O","Moz","ms"];function At(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Dt.length;while(i--)if(t=Dt[i]+n,t in e)return t;return r}function Lt(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function Ht(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]=H.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Lt(r)&&(o[s]=H.access(r,"olddisplay",Rt(r.nodeName)))):o[s]||(i=Lt(r),(n&&"none"!==n||!i)&&H.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=Ht(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:Lt(this))?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=vt(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]=At(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=kt.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]=At(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=vt(e,t,r)),"normal"===i&&t in St&&(i=St[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),vt=function(e,t,n){var r,i,o,s=n||Ht(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)),Ct.test(a)&&wt.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 Ot(e,t,n){var r=Tt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ft(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+jt[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+jt[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+jt[o]+"Width",!0,i))):(s+=x.css(e,"padding"+jt[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+jt[o]+"Width",!0,i)));return s}function Pt(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Ht(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=vt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Ct.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ft(e,t,n||(s?"border":"content"),r,o)+"px"}function Rt(e){var t=o,n=Nt[e];return n||(n=Mt(e,t),"none"!==n&&n||(xt=(xt||x("