├── src ├── libs │ ├── .eslintignore │ ├── colorpicker │ │ ├── jquery.colorpicker.css │ │ └── jquery.colorpicker.js │ └── jquery-1.8.2.min.js ├── global.d.ts ├── images │ ├── 128x128.png │ ├── 16x16.png │ ├── 48x48.png │ ├── linkclump.png │ └── background.png ├── types │ ├── Settings.ts │ └── Messages.ts ├── pages │ ├── test.css │ ├── test_area.html │ ├── style.css │ ├── options.html │ └── options.ts ├── manifest.json ├── background.ts └── linkclump.ts ├── media ├── favicon.ico ├── linkclump.png ├── googlechromeicon_19x19.png ├── Details for Linkclump Logo.md ├── style.css ├── index.html └── Logo_CMYK.svg ├── .gitignore ├── .babelrc ├── .github ├── ISSUE_TEMPLATE │ └── issue-template.md └── workflows │ └── close-stale-issues.yml ├── src-test ├── mock.js ├── test_options.js └── test_settings_manager.js ├── tsconfig.json ├── .vscode └── settings.json ├── .eslintrc.json ├── package.json ├── LICENSE.md ├── README.md ├── examples └── offset-with-transform.html ├── QA.txt └── webpack.config.js /src/libs/.eslintignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/global.d.ts: -------------------------------------------------------------------------------- 1 | interface Window { 2 | $: JQuery; 3 | } 4 | -------------------------------------------------------------------------------- /media/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/media/favicon.ico -------------------------------------------------------------------------------- /media/linkclump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/media/linkclump.png -------------------------------------------------------------------------------- /src/images/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/src/images/128x128.png -------------------------------------------------------------------------------- /src/images/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/src/images/16x16.png -------------------------------------------------------------------------------- /src/images/48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/src/images/48x48.png -------------------------------------------------------------------------------- /src/images/linkclump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/src/images/linkclump.png -------------------------------------------------------------------------------- /src/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/src/images/background.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings/ 2 | .project 3 | .DS_Store 4 | .idea 5 | *.iml 6 | node_modules/ 7 | *.zip 8 | build 9 | -------------------------------------------------------------------------------- /media/googlechromeicon_19x19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wvanderp/linkclump/HEAD/media/googlechromeicon_19x19.png -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env", 4 | "@babel/preset-typescript" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Issue 3 | about: General issue template. 4 | 5 | --- 6 | 7 | Please note that support can not be provided as this is a free extension. Developers are welcome to submit pull requests. 8 | -------------------------------------------------------------------------------- /media/Details for Linkclump Logo.md: -------------------------------------------------------------------------------- 1 | # Details for Linkclump Logo 2 | 3 | Font name: `Monoglyceride` 4 | found at `monog___.ttf` 5 | Orange (RGB): `#ef4136` 6 | Green (RGB): `#219776` 7 | -------------------------------------------------------------------------------- /src-test/mock.js: -------------------------------------------------------------------------------- 1 | /* eslint no-global-assign: 0, no-undef: 0 */ 2 | 3 | chrome = {}; 4 | chrome.extension = function() {}; 5 | chrome.extension.onMessage = function() {}; 6 | chrome.extension.onMessage.addListener = function() {}; 7 | chrome.windows = function() {}; 8 | chrome.windows.create = function() {}; 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "ES6", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "skipLibCheck": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "outDir": "./dist", 10 | "sourceMap": true 11 | }, 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /.github/workflows/close-stale-issues.yml: -------------------------------------------------------------------------------- 1 | name: Close stale issues 2 | on: 3 | schedule: 4 | - cron: "0 13 * * *" 5 | 6 | jobs: 7 | close-issues: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@v7.0.0 14 | with: 15 | repo-token: ${{ secrets.GITHUB_TOKEN }} 16 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "colorpicker", 4 | "copyfiles", 5 | "linkclump" 6 | ], 7 | "json.schemas": [ 8 | { 9 | "fileMatch": [ 10 | "**/manifest.json" 11 | ], 12 | "url": "https://json.schemastore.org/chrome-manifest" 13 | } 14 | ], 15 | "editor.formatOnSave": true 16 | } 17 | -------------------------------------------------------------------------------- /src-test/test_options.js: -------------------------------------------------------------------------------- 1 | /* eslint no-undef: 0 */ 2 | 3 | OptionTest = new TestCase("Option"); 4 | 5 | OptionTest.prototype.testDisplayKeys = function() { 6 | os = OS_WIN; 7 | assertNotEquals(displayKeys(1)[18], null); 8 | assertEquals(displayKeys(1)[91], null); 9 | 10 | os = OS_LINUX; 11 | assertEquals(displayKeys(1)[18], null); 12 | assertEquals(displayKeys(1)[91], null); 13 | }; 14 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true 5 | }, 6 | "extends": "eslint:recommended", 7 | "globals": { 8 | "Atomics": "readonly", 9 | "SharedArrayBuffer": "readonly", 10 | "chrome": "readonly" 11 | }, 12 | "parserOptions": { 13 | "ecmaVersion": 2018, 14 | "sourceType": "module" 15 | }, 16 | "rules": { 17 | "no-undef": "off" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/types/Settings.ts: -------------------------------------------------------------------------------- 1 | export type Settings = { 2 | actions: Record; 3 | blocked: string[]; 4 | } 5 | 6 | export interface Action { 7 | mouse: number; 8 | key: number; 9 | action: string; 10 | color: string; 11 | options: { 12 | smart: number; 13 | ignore: number[]; 14 | delay: number; 15 | close: number; 16 | block: boolean; 17 | reverse: boolean; 18 | end: boolean; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/pages/test.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #FFFFC0; 4 | margin: 0px; 5 | padding: 0px; 6 | } 7 | 8 | p { 9 | text-align: center; 10 | } 11 | 12 | a { 13 | color: blue; 14 | } 15 | 16 | a:visited { 17 | color: blue; 18 | } 19 | 20 | a:hover { 21 | color: darkblue; 22 | } 23 | 24 | ul { 25 | margin: 0px; 26 | padding: 0px; 27 | font-size: 20px; 28 | text-align: center; 29 | list-style-type: none; 30 | } 31 | 32 | li { 33 | padding: 15px; 34 | } 35 | -------------------------------------------------------------------------------- /media/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #A7977F; 4 | background-image: url('background.png'); 5 | background-repeat: no-repeat; 6 | background-position: 10% 0%; 7 | } 8 | 9 | div.box { 10 | position: relative; 11 | width: 500px; 12 | margin-left: auto; 13 | margin-right: auto; 14 | background-color: #FFFFFF; 15 | border: 2px dashed #000000; 16 | padding: 10px; 17 | margin-top: 50px; 18 | } 19 | 20 | img { 21 | display: block; 22 | margin-left: auto; 23 | margin-right: auto; 24 | } 25 | -------------------------------------------------------------------------------- /src/pages/test_area.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Try linkclump in this yellow test area.

11 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "linkclump-ng", 3 | "description": "Chrome extension", 4 | "version": "2.0.0", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/wvanderp/linkclump.git" 9 | }, 10 | "bugs": { 11 | "url": "https://github.com/wvanderp/linkclump/issues" 12 | }, 13 | "homepage": "https://github.com/wvanderp/linkclump#readme", 14 | "devDependencies": { 15 | "@babel/core": "^7.26.0", 16 | "@babel/preset-env": "^7.26.0", 17 | "@babel/preset-typescript": "^7.26.0", 18 | "@types/chrome": "^0.0.287", 19 | "@types/jquery": "^3.5.32", 20 | "babel-loader": "^9.2.1", 21 | "copy-webpack-plugin": "^12.0.2", 22 | "css-loader": "^7.1.2", 23 | "eslint": "^6.7.1", 24 | "html-webpack-plugin": "^5.6.3", 25 | "style-loader": "^4.0.0", 26 | "typescript": "^5.7.2", 27 | "webpack": "^5.97.1", 28 | "webpack-cli": "^5.1.4" 29 | }, 30 | "scripts": { 31 | "build": "webpack", 32 | "lint": "eslint src" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 3, 3 | "name": "Linkclump", 4 | "version": "2.9.5.1", 5 | "description": "Lets you open, copy or bookmark multiple links at the same time.", 6 | "background": { 7 | "service_worker": "background.js", 8 | "type": "module" 9 | }, 10 | "options_page": "pages/options.html", 11 | "icons": { 12 | "16": "images/16x16.png", 13 | "48": "images/48x48.png", 14 | "128": "images/128x128.png" 15 | }, 16 | "content_scripts": [ 17 | { 18 | "matches": [ 19 | "" 20 | ], 21 | "js": [ 22 | "linkclump.js" 23 | ], 24 | "run_at": "document_end", 25 | "all_frames": true 26 | } 27 | ], 28 | "permissions": [ 29 | "bookmarks", 30 | "storage", 31 | "clipboardWrite" 32 | ], 33 | "host_permissions": [ 34 | "*://*/*" 35 | ], 36 | "web_accessible_resources": [ 37 | { 38 | "resources": [ 39 | "pages/test_area.html" 40 | ], 41 | "matches": [ 42 | "http://*/*", 43 | "https://*/*" 44 | ] 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Benjamin Black 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linkclump-ng 2 | 3 | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/9e38a24d7f524c6ca73c07e8948d58a7)](https://www.codacy.com/manual/benblack86/linkclump?utm_source=github.com&utm_medium=referral&utm_content=benblack86/linkclump&utm_campaign=Badge_Grade) 4 | 5 | I don't intend to develop this any further. I've selected [Linkclump Plus](https://chromewebstore.google.com/detail/linkclump-plus/ainlglbojoodfdbndbfofojhmjbmelmm) as my daily driver. Thank you for the interest, thank you for forking and extending the plugin, and I hope I provided a solid foundation. 6 | 7 | After Manifest v3, Linkclump is no longer available in the Chrome Web Store. This is a fork of the original Linkclump extension, updated to manifest v3. 8 | 9 | Thanks to [benblack86](https://github.com/benblack86) for creating and maintaining this amazing extension. 10 | 11 | ## Installation 12 | 13 | Install it by visiting the [Chrome Web Store](https://chrome.google.com/webstore/detail/linkclump/lfpjkncokllnfokkgpkobnkbkmelfefj). 14 | 15 | ## Build 16 | 17 | Run `npm install` to install dependencies. 18 | 19 | Run `npm run build` to build the extension. 20 | -------------------------------------------------------------------------------- /src/libs/colorpicker/jquery.colorpicker.css: -------------------------------------------------------------------------------- 1 | .colorpicker-picker-span{ 2 | display: block; 3 | width: 40px; 4 | height: 40px; 5 | float: left; 6 | border: 1px solid #000; 7 | margin-right: 2px; 8 | cursor: pointer; 9 | } 10 | 11 | .colorpicker-picker-info{ 12 | padding: 0 0 2px; 13 | color: #fff; 14 | text-align: center; 15 | text-transform: uppercase; 16 | } 17 | 18 | .colorpicker-picker-span:hover { 19 | border: 1px solid #fff; 20 | } 21 | 22 | .colorpicker-picker-span.active { 23 | border: 1px solid #000; 24 | } 25 | 26 | .colorpicker-picker { 27 | background-color: #353534; 28 | padding: 5px; 29 | display: none; 30 | position: absolute; 31 | top: 0; 32 | -moz-border-radius: 5px; 33 | border-radius: 5px; 34 | box-shadow: 2px 2px 5px #111; 35 | -moz-box-shadow: 2px 2px 5px #111; 36 | -webkit-box-shadow: 2px 2px 5px #111; 37 | } 38 | 39 | .colorpicker-trigger { 40 | display: block; 41 | width: 30px; 42 | height: 30px; 43 | float: left; 44 | border: 1px solid #000; 45 | cursor: pointer; 46 | background-color: #808080;; 47 | } 48 | 49 | .colorpicker-label { 50 | float: left; 51 | margin-right: 2px; 52 | } -------------------------------------------------------------------------------- /examples/offset-with-transform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 |

By only transform

16 | 17 |
18 | 21 | 22 |
23 | item-02 24 |
25 | 26 |
27 | item-03 28 |
29 |
30 | 31 |

By offset and transform

32 | 33 |
34 |
35 | item-01 36 |
37 | 38 |
39 | item-02 40 |
41 | 42 |
43 | item-03 44 |
45 |
46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /QA.txt: -------------------------------------------------------------------------------- 1 | WINDOWS 2 | - setup open as new tabs 3 | # right 4 | # color red 5 | # smart select off 6 | # delay 2 7 | # reverse on 8 | # block repeat links off 9 | - setup bookmarks 10 | # left + shift 11 | # color green 12 | # smart select on 13 | # block repeat links on 14 | - goto http://www.nationalgeographic.com/ and type a badly spelt word into search, right click to correct 15 | - setup open as new tabs 16 | # right + alt 17 | # color blue 18 | # exclude links with words (find words on hackernews) 19 | # delay of 2 20 | # close of 10 21 | # open tabs at end 22 | - setup open as new windows 23 | # right + ctrl 24 | # color yellow 25 | # include links with words (find words on hackernews) 26 | - restart browser and check settings 27 | 28 | 29 | MAC 30 | - setup open as new window 31 | # left + x key 32 | # color blue 33 | # smart select on 34 | # delay 1 35 | - try the above setup, once the new window pops up,go back to current page and try selecting without key 36 | - setup copy to clipboard 37 | # right + alt 38 | # color white 39 | # smart select off 40 | # reverse 41 | # URLS with titles 42 | - restart browser and check settings 43 | 44 | 45 | LINUX 46 | - setup copy to clipboard 47 | # right + y key 48 | # color gold 49 | # smart select on 50 | # as HTML 51 | - setup open as new tabs 52 | # left 53 | # color grey 54 | # smart select off 55 | # reverse 56 | # exclude links with words "comments" 57 | - goto guide page on options and see if it works 58 | - restart browser and check settings 59 | 60 | -------------------------------------------------------------------------------- /src/types/Messages.ts: -------------------------------------------------------------------------------- 1 | import { Settings } from './Settings'; 2 | 3 | export type Messages = ActivateMessage | InitMessage | UpdateMessage; 4 | 5 | export enum CopyFormat { 6 | URLS_WITH_TITLES = 0, 7 | URLS_ONLY = 1, 8 | URLS_ONLY_SPACE_SEPARATED = 2, 9 | TITLES_ONLY = 3, 10 | AS_LINK_HTML = 4, 11 | AS_LIST_LINK_HTML = 5, 12 | AS_MARKDOWN = 6, 13 | } 14 | 15 | export type ActivateMessage_copy = { 16 | "action": "copy", 17 | "options": { 18 | "block": boolean, 19 | "reverse": boolean, 20 | "copy": CopyFormat 21 | } 22 | } 23 | 24 | export type ActivateMessage_bm = { 25 | "action": "bm", 26 | "options": { 27 | "block": boolean, 28 | "reverse": boolean, 29 | } 30 | } 31 | 32 | export type ActivateMessage_win = { 33 | "action": "win", 34 | "options": { 35 | "block": boolean, 36 | "reverse": boolean, 37 | "unfocus": boolean, 38 | "delay": number, 39 | } 40 | } 41 | 42 | export type ActivateMessage_tabs = { 43 | "action": "tabs", 44 | "options": { 45 | "block": boolean, 46 | "reverse": boolean, 47 | "end": boolean, 48 | "delay": number, 49 | "close"?: number, 50 | } 51 | } 52 | 53 | export type ActivateMessageTypes = ActivateMessage_copy | ActivateMessage_bm | ActivateMessage_win | ActivateMessage_tabs; 54 | 55 | export type ActivateMessage = { 56 | "message": "activate", 57 | "urls": { url: string, title: string }[], 58 | "setting": T 59 | } 60 | 61 | export type UpdateMessage = { 62 | "message": "update", 63 | "settings": Settings, 64 | } 65 | 66 | export type InitMessage = { 67 | "message": "init", 68 | } 69 | 70 | export type InitResponse = Settings & { error?: string }; 71 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | 5 | module.exports = { 6 | // Define entry points for each script in your extension 7 | entry: { 8 | background: './src/background.ts', 9 | linkclump: './src/linkclump.ts', 10 | options: './src/pages/options.ts', // Entry point for options page script 11 | }, 12 | output: { 13 | filename: (pathData) => { 14 | // Customize output filenames 15 | if (pathData.chunk.name === 'options') return 'pages/options.js'; 16 | return '[name].js'; 17 | }, 18 | path: path.resolve(__dirname, 'build'), 19 | clean: true, 20 | }, 21 | resolve: { 22 | extensions: ['.ts', '.js'], // Resolve TypeScript and JavaScript files 23 | }, 24 | module: { 25 | rules: [ 26 | { 27 | test: /\.ts$/, 28 | exclude: /node_modules/, 29 | use: { 30 | loader: 'babel-loader', // Use Babel to transpile TypeScript 31 | } 32 | }, 33 | { 34 | test: /\.css$/, 35 | use: ['style-loader', 'css-loader'], 36 | }, 37 | { 38 | test: /\.(png|jpg|gif|svg)$/, 39 | type: 'asset/resource', 40 | generator: { 41 | filename: 'images/[name][ext]', 42 | }, 43 | } 44 | ], 45 | }, 46 | plugins: [ 47 | // Copy static files to the output directory 48 | new CopyWebpackPlugin({ 49 | patterns: [ 50 | { from: 'src/manifest.json', to: 'manifest.json' }, 51 | { from: 'src/images', to: 'images' }, // Copy images folder 52 | { from: 'src/pages/test.css', to: 'pages/test.css' }, 53 | ], 54 | }), 55 | // Generate options.html and inject the script 56 | new HtmlWebpackPlugin({ 57 | template: 'src/pages/options.html', 58 | filename: 'pages/options.html', 59 | chunks: ['options'], 60 | }), 61 | new HtmlWebpackPlugin({ 62 | template: 'src/pages/test_area.html', 63 | filename: 'pages/test_area.html', 64 | chunks: ['linkclump'], 65 | }), 66 | ], 67 | mode: 'production', // Use 'development' for non-minified output 68 | devtool: 'source-map', // Generate source maps for debugging 69 | }; 70 | -------------------------------------------------------------------------------- /media/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Linkclump 6 | 7 | 8 | 24 | 25 | 26 |
27 | Linkclump logo 28 |

29 | A Google Chrome extension that allows you to use your mouse to select and open groups of links into new tabs. 30 |

31 |

32 | Use your mouse to drag a box around the links you want to open and when you release the mouse button all the links will open up into new tabs. 33 |

34 | screen shot of linkclump in action 35 | 36 |

Feature list...

37 |
    38 |
  • Customise: choose how Linkclump is activated using different mouse and key combination (including shift/alt/ctrl).
  • 39 | 40 |
  • Smart Select: only the important links on the page are selected.
  • 41 | 42 |
  • Auto Scroll: the page will automatically scroll up/down to make it easier to select all the links at once.
  • 43 | 44 |
  • Exclude Words: exclude links that contain certain words.
  • 45 | 46 |
  • New Window: choose to have the new tabs open in the current browser window or a new browser window.
  • 47 | 48 |
  • OS Tested: works on windows, mac and linux operating systems.
  • 49 |
50 | 51 |

52 | Please visit Google Chrome extension gallery 53 | to install. 54 |

55 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /src-test/test_settings_manager.js: -------------------------------------------------------------------------------- 1 | /* eslint no-undef: 0 */ 2 | 3 | var TestSettingsManager = new TestCase("Settings Manager"); 4 | 5 | TestSettingsManager.prototype.setUp = function() { 6 | // clear storage each time 7 | localStorage.clear(); 8 | }; 9 | 10 | TestSettingsManager.prototype.testInitWindows = function() { 11 | var sm = new SettingsManager(); 12 | 13 | assertUndefined(localStorage["settings"]); 14 | assertUndefined(localStorage["version"]); 15 | 16 | var good_settings = { 17 | "actions": { 18 | "101": { 19 | "mouse": 0, 20 | "key": 90, 21 | "action": "tabs", 22 | "color": "#FFA500", 23 | "options": { 24 | "smart": 0, 25 | "ignore": [0], 26 | "delay": 0, 27 | "close": 0, 28 | "block": true, 29 | "reverse": false, 30 | "end": false 31 | } 32 | } 33 | }, 34 | "blocked": [] 35 | }; 36 | 37 | var settings = sm.init(); 38 | 39 | assertEquals("5", localStorage["version"]); 40 | assertEquals(good_settings, settings); 41 | assertUndefined(settings.error); 42 | }; 43 | 44 | TestSettingsManager.prototype.testInitLinux = function() { 45 | var sm = new SettingsManager(); 46 | 47 | assertUndefined(localStorage["settings"]); 48 | assertUndefined(localStorage["version"]); 49 | assertTrue(!sm.isInit()); 50 | 51 | var good_settings = { 52 | "actions": { 53 | "101": { 54 | "mouse": 0, 55 | "key": 90, 56 | "action": "tabs", 57 | "color": "#FFA500", 58 | "options": { 59 | "smart": 0, 60 | "ignore": [0], 61 | "delay": 0, 62 | "close": 0, 63 | "block": true, 64 | "reverse": false, 65 | "end": false 66 | } 67 | } 68 | }, 69 | "blocked": [] 70 | }; 71 | 72 | var settings = sm.init(); 73 | 74 | assertEquals("5", localStorage["version"]); 75 | assertEquals(good_settings, settings); 76 | assertUndefined(settings.error); 77 | assertTrue(sm.isInit()); 78 | }; 79 | 80 | TestSettingsManager.prototype.testSave = function() { 81 | var sm = new SettingsManager(); 82 | 83 | var settings = sm.init(); 84 | 85 | assertEquals(0, settings.actions[101].options.smart); 86 | 87 | settings.actions[101].options.smart = 1; 88 | 89 | sm.save(settings); 90 | 91 | var new_settings = sm.load(); 92 | 93 | assertEquals(1, new_settings.actions[101].options.smart) 94 | }; 95 | 96 | TestSettingsManager.prototype.testError = function() { 97 | var sm = new SettingsManager(); 98 | 99 | var good_settings = { 100 | "actions": { 101 | "101": { 102 | "mouse": 0, 103 | "key": 90, 104 | "action": "tabs", 105 | "color": "#FFA500", 106 | "options": { 107 | "smart": 0, 108 | "ignore": [0], 109 | "delay": 0, 110 | "close": 0, 111 | "block": true, 112 | "reverse": false, 113 | "end": false 114 | } 115 | } 116 | }, 117 | "blocked": [] 118 | }; 119 | 120 | var settings = sm.load(); 121 | assertEquals("Error: SyntaxError: Unexpected token u in JSON at position 0|Data:undefined", settings.error); 122 | assertEquals(good_settings.actions, settings.actions); 123 | 124 | // load again and there should be no error 125 | settings = sm.load(); 126 | assertUndefined(settings.error); 127 | assertEquals(good_settings, settings); 128 | }; 129 | -------------------------------------------------------------------------------- /src/pages/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #F4F4F4; 4 | background-image: url('../images/background.png'); 5 | background-repeat: no-repeat; 6 | background-position: 10% 0%; 7 | background-attachment: fixed; 8 | overflow-y: scroll 9 | } 10 | 11 | img { 12 | display: block; 13 | margin: auto; 14 | padding: 5px; 15 | } 16 | 17 | a.button { 18 | color: #000; 19 | border: solid 1px #000; 20 | display: inline; 21 | text-align: center; 22 | text-decoration: none; 23 | border-radius: 3px; 24 | margin: 10px; 25 | padding: 2px; 26 | background: #D0D0D0; 27 | cursor: pointer; 28 | } 29 | 30 | a:hover.button { 31 | background: #606060; 32 | } 33 | 34 | .page { 35 | width: 650px; 36 | margin-left: auto; 37 | margin-right: auto; 38 | } 39 | 40 | .info-box { 41 | background-color: rgba(256, 256, 256, 0.95); 42 | border: 1px solid #000; 43 | border-radius: 4px; 44 | padding: 0px; 45 | margin: 5px; 46 | } 47 | 48 | .info-box p { 49 | padding: 10px; 50 | } 51 | 52 | .info-box .button { 53 | display: block; 54 | width: 150px; 55 | margin-left: auto; 56 | margin-right: auto; 57 | } 58 | 59 | .info-box h2 { 60 | font-size: 25px; 61 | font-weight: normal; 62 | border-bottom: 3px solid #000; 63 | margin: 2px; 64 | padding: 5px; 65 | background-color: #E6FAF0; 66 | } 67 | 68 | .info-box .setting { 69 | overflow: hidden; 70 | background-color: #FBFBFB; 71 | margin: 10px; 72 | margin-bottom: 20px; 73 | padding: 5px; 74 | padding-left: 20px; 75 | border-bottom: 1px solid #000; 76 | border-top: 1px solid #000; 77 | position: relative; 78 | } 79 | 80 | .info-box .setting h3 { 81 | font-size: 20px; 82 | font-weight: normal; 83 | margin: 0px; 84 | padding-bottom: 5px; 85 | } 86 | 87 | .info-box .setting .color { 88 | width: 40px; 89 | height: 10px; 90 | border: 1px solid #000; 91 | float: right; 92 | margin-top: 2px; 93 | margin-right: 380px; 94 | } 95 | 96 | .info-box .setting .button { 97 | display: inline-block; 98 | margin: 20px 5px 10px 5px; 99 | width: 80px; 100 | 101 | } 102 | 103 | .info-box .undo { 104 | margin: 10px; 105 | margin-bottom: 20px; 106 | padding: 5px; 107 | background-color: #DFF48B; 108 | } 109 | 110 | .info-box .undo a { 111 | text-decoration: underline; 112 | cursor: pointer; 113 | } 114 | 115 | .info-box .undo a:hover { 116 | color: blue; 117 | } 118 | 119 | 120 | 121 | #test_area { 122 | width: 95%; 123 | border: 2px solid black; 124 | display: block; 125 | margin-left: auto; 126 | margin-right: auto; 127 | } 128 | 129 | 130 | 131 | #form_color { 132 | visibility: hidden; 133 | display: none; 134 | } 135 | 136 | #form-background { 137 | display: none; 138 | background-color: rgba(255, 255, 255, 0.8); 139 | position: absolute; 140 | width: 100%; 141 | height: 100%; 142 | left: 0px; 143 | top: 0px; 144 | color: #FFF; 145 | } 146 | 147 | .form { 148 | width: 600px; 149 | margin-left: auto; 150 | margin-right: auto; 151 | background-color: #000; 152 | border: 1px solid #000; 153 | border-radius: 5px; 154 | padding: 10px; 155 | overflow: hidden; 156 | } 157 | 158 | .form h2 { 159 | font-size: 25px; 160 | font-weight: normal; 161 | border-bottom: 1px solid #FFF; 162 | margin-top: 5px; 163 | margin-bottom: 5px; 164 | } 165 | 166 | .form label { 167 | float: left; 168 | width: 280px; 169 | text-align: right; 170 | clear: left; 171 | margin-bottom: 5px; 172 | margin-right: 15px; 173 | } 174 | 175 | .form p { 176 | margin: 4px; 177 | } 178 | 179 | .form input { 180 | margin-right: 10px; 181 | } 182 | 183 | .form fieldset { 184 | border: 0px; 185 | margin-left: 150px; 186 | } 187 | 188 | .form .button { 189 | width: 150px; 190 | display: block; 191 | } 192 | 193 | .form .cancel { 194 | float: left; 195 | margin-left: 130px; 196 | } 197 | 198 | .form .save { 199 | float: right; 200 | margin-right: 130px; 201 | } 202 | 203 | .form #form_extra { 204 | background-color: #FFF; 205 | position: absolute; 206 | width: 180px; 207 | color: #000; 208 | font-size: 14px; 209 | border: 1px solid #000; 210 | border-radius: 4px; 211 | padding: 5px; 212 | display: none; 213 | } 214 | 215 | ul { 216 | font-size: 14px; 217 | margin: 0px; 218 | } 219 | 220 | .warning { 221 | background-color: #ED2E01; 222 | display: none; 223 | padding: 10px; 224 | } 225 | 226 | .warning2 { 227 | background-color: #ED2E01; 228 | display: none; 229 | padding: 10px; 230 | } 231 | -------------------------------------------------------------------------------- /src/libs/colorpicker/jquery.colorpicker.js: -------------------------------------------------------------------------------- 1 | /* 2 | * INFORMATION 3 | * --------------------------- 4 | * Owner: jquery.webspirited.com 5 | * Developer: Matthew Hailwood 6 | * --------------------------- 7 | * 8 | * CHANGELOG: 9 | * --------------------------- 10 | * 1.1 11 | * Fixed bug 01 12 | * Fixed bug 02 13 | * 14 | * --------------------------- 15 | * Bug Fix Credits: 16 | * -- 17 | * * Number: 01 18 | * * Bug: Initial color should be option "selected" from select 19 | * * Name: Nico 20 | * -- 21 | * * Number: 02 22 | * * Bug: Selects Change event should be called on color pick 23 | * * Name: Bob Farrell 24 | */ 25 | (function($) { 26 | $.fn.extend({ 27 | colorpicker: function(options) { 28 | 29 | //Settings list and the default values 30 | var defaults = { 31 | label: '', 32 | size: 20, 33 | count: 6, 34 | hide: true 35 | }; 36 | 37 | var options = $.extend(defaults, options); 38 | var obj; 39 | var colors = {}; 40 | 41 | var wrap = $('
'); 42 | var label = $('
'); 43 | var trigger = $('
'); 44 | var picker = $('
'); 45 | var info = $('
'); 46 | var clear = $('
'); 47 | 48 | return this.each(function() { 49 | obj = this; 50 | 51 | //build an array of colors 52 | $(obj).children('option').each(function(i, elm) { 53 | colors[i] = {}; 54 | colors[i].color = $(elm).text(); 55 | colors[i].value = $(elm).val(); 56 | }); 57 | create_wrap(); 58 | if (options.label != '') 59 | create_label(); 60 | create_trigger(); 61 | create_picker(); 62 | wrap.append(label); 63 | wrap.append(trigger); 64 | wrap.append(picker); 65 | wrap.append(clear); 66 | $(obj).after(wrap); 67 | if (options.hide) 68 | $(obj).css({ 69 | position: 'absolute', 70 | left: -10000 71 | }); 72 | }); 73 | 74 | 75 | function create_wrap() { 76 | wrap.mouseleave(function() { 77 | picker.fadeOut('slow'); 78 | }); 79 | } 80 | 81 | function create_label() { 82 | label.text(options.label); 83 | label.click(function() { 84 | trigger.click() 85 | }); 86 | } 87 | 88 | function create_trigger() { 89 | trigger.click(function() { 90 | var offset = $(this).position(); 91 | var top = offset.top; 92 | var left = offset.left + $(this).width() + 5; 93 | $(picker).css({ 94 | 'top': top, 95 | 'left': left 96 | }).fadeIn('slow'); 97 | }); 98 | } 99 | 100 | function create_picker() { 101 | picker.append(info); 102 | for (var i in colors) { 103 | picker.append(''); 104 | } 105 | trigger.css('background-color', '#'+$(obj).children(":selected").text()); 106 | info.text('#'+$(obj).children(":selected").text()); 107 | picker.children(".colorpicker-picker-span").hover(function() { 108 | info.text('#' + $(this).attr('rel')); 109 | }, function() { 110 | info.text('#' + picker.children('.colorpicker-picker-span.active').attr('rel')); 111 | }); 112 | picker.delegate(".colorpicker-picker-span", "click", function() { 113 | info.text('#' + $(this).attr('rel')); 114 | $(obj).val($(this).attr('rel')); 115 | $(obj).change(); 116 | picker.children('.colorpicker-picker-span.active').removeClass('active'); 117 | $(this).addClass('active'); 118 | trigger.css('background-color', $(this).css('background-color')); 119 | }); 120 | $(obj).after(picker); 121 | } 122 | } 123 | }); 124 | })(jQuery); -------------------------------------------------------------------------------- /src/pages/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Options 5 | 6 | 7 | 8 |
9 |
10 | 11 |

Welcome and thank you for trying out linkclump. To use linkclump you should press and hold the mouse button, then drag the selection 13 | box around the links you want to open. When you release the mouse button all the links will be . You are now ready to go!

15 | 16 |
17 |

Use the test area below to try out linkclump or click the option button at the bottom of the page to 18 | explore the many options available.

19 |
20 | 21 |
22 |

Options 23 |
24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 |

Welcome to the options page, where you can change the default behaviour and add new actions.

32 | How does it work? 33 |

Do you love linkclump? Then please leave a rating, thank you :-)

34 | Rate 36 |
37 | 38 |
39 |

Actions

40 |
41 |
42 | Add Action 43 |
44 | 45 |
46 |

FAQ

47 |
48 |
    49 |
  • To use on local pages (i.e. file:// URLs) you need to go to the extensions page 50 | (chrome://extensions) and tick the option "Allow access to file URLs" for the Linkclump extension. 51 |
  • 52 |
  • Double tabs? Make sure you don't have a similar extension installed. If you also have "Snap 53 | Links Lite" installed it might appear that you are only using Linkclump, but actually these 54 | extensions are also working in the background and will try to open tabs also.
  • 55 |
  • Mandatory key? If you want to use the right mouse button on the Linux/Mac operating systems 56 | then you have to select a key. This is due to the way Chrome is designed on these systems and is 57 | necessary to make Linkclump work. Left and middle mouse buttons are not affected.
  • 58 |
  • Not working? Make sure you are pressing the correct mouse button and key combination. Please 59 | note that chrome automatically disables in-browser extensions on the chrome webstore/extension web 60 | pages for security purposes.
  • 61 |
  • Does not do what you want it to do? There are a hand full of extension/add ons for different 62 | browsers that allow you to open multiple links and therefore there are going to be differences with 63 | functionality. I've tried to create this extension so that it is fast and versatile. You are very 64 | welcome and encouraged to contribute new features and code improvements to the Linkclump project. 65 |
  • 66 |
  • Issues when zoomed out? When zoomed out the scrolling functionality will be jerky and there 67 | isn't much that can be done about it.
  • 68 |
  • Where is the source code? You can find it on GitHub and pull requests are 70 | welcome.
  • 71 |
72 |
73 |
74 | 75 |
76 |

Blocklist

77 |

To stop linkclump on certain sites, please list the URLs below (one per line). 78 | 79 | 80 |

81 |
82 |
83 | 84 | 85 |
86 |
87 |

Activation

88 |

To activate the selection box you should press and hold...

89 |
WARNING: The selected mouse/key match another action already setup
90 |

91 |

92 |

93 |

94 |

95 | 96 | 97 |

Action

98 |

Selected links should be...

99 |
100 | 101 |

Advanced Options

102 |

Available options for the action...

103 |
104 |
105 | 106 |
107 | Cancel 108 | Save 109 |
110 |
111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/background.ts: -------------------------------------------------------------------------------- 1 | import { ActivateMessage, ActivateMessage_bm, ActivateMessage_copy, ActivateMessage_tabs, ActivateMessage_win, CopyFormat, Messages, UpdateMessage } from './types/Messages'; 2 | import { Settings } from './types/Settings'; 3 | 4 | var CURRENT_VERSION = "5"; 5 | 6 | const linkclumpSettingsKey = "linkclumpSettings"; 7 | const linkclumpVersionKey = "linkclumpVersion"; 8 | 9 | class SettingsManager { 10 | 11 | async load(): Promise { 12 | var { [linkclumpSettingsKey]: settings } = await chrome.storage.sync.get(linkclumpSettingsKey); 13 | 14 | if (settings) { 15 | return settings; 16 | } 17 | 18 | settings = this.init(); 19 | return settings; 20 | 21 | }; 22 | 23 | save(settings: Settings & { error?: string }) { 24 | // remove any error messages from object (shouldn't be there) 25 | if (settings.error !== undefined) { 26 | delete settings.error; 27 | } 28 | 29 | chrome.storage.sync.set({ [linkclumpSettingsKey]: settings }); 30 | }; 31 | 32 | async isInit() { 33 | const { [linkclumpVersionKey]: version } = await chrome.storage.sync.get(linkclumpVersionKey); 34 | return version !== undefined; 35 | }; 36 | 37 | async isLatest() { 38 | const { [linkclumpVersionKey]: version } = await chrome.storage.sync.get(linkclumpVersionKey); 39 | return version === CURRENT_VERSION; 40 | }; 41 | 42 | init() { 43 | // create default settings for first time user 44 | var settings: Settings = { 45 | "actions": { 46 | "101": { 47 | "mouse": 0, // left mouse button 48 | "key": 90, // z key 49 | "action": "tabs", 50 | "color": "#FFA500", 51 | "options": { 52 | "smart": 0, 53 | "ignore": [0], 54 | "delay": 0, 55 | "close": 0, 56 | "block": true, 57 | "reverse": false, 58 | "end": false 59 | } 60 | } 61 | }, 62 | "blocked": [] 63 | }; 64 | 65 | // save settings to store 66 | chrome.storage.sync.set({ [linkclumpSettingsKey]: settings }); 67 | chrome.storage.sync.set({ [linkclumpVersionKey]: CURRENT_VERSION }); 68 | 69 | return settings; 70 | }; 71 | 72 | 73 | async update() { 74 | if (!(await this.isInit())) { 75 | this.init(); 76 | } 77 | }; 78 | } 79 | 80 | var settingsManager = new SettingsManager(); 81 | 82 | function uniqueUrl(arr: T[]): T[] { 83 | var a = []; 84 | var l = arr.length; 85 | for (var i = 0; i < l; i++) { 86 | for (var j = i + 1; j < l; j++) { 87 | if (arr[i].url === arr[j].url) 88 | j = ++i; 89 | } 90 | a.push(arr[i]); 91 | } 92 | return a; 93 | }; 94 | 95 | function openTab( 96 | urls: { url: string, title: string }[], 97 | delay: number, 98 | windowId?: number, 99 | openerTabId?: number, 100 | tabIndex?: number | null, 101 | closeTime?: number 102 | ) { 103 | 104 | const url = urls.shift()?.url; 105 | 106 | if (!url || urls.length > 0) { 107 | setTimeout( 108 | function () { 109 | openTab(urls, delay, windowId, openerTabId, tabIndex, closeTime) 110 | }, 111 | delay * 1000 112 | ); 113 | } 114 | 115 | const obj = { 116 | windowId, 117 | url: url, 118 | active: false 119 | } as chrome.tabs.CreateProperties; 120 | 121 | // only add tab ID if delay feature is not being used as if tab with openerTabId is closed, the links stop opening 122 | if (!delay) { 123 | obj.openerTabId = openerTabId; 124 | } 125 | 126 | if (tabIndex != null) { 127 | obj.index = tabIndex; 128 | tabIndex++; 129 | } 130 | 131 | chrome.tabs.create( 132 | obj, 133 | function (tab) { 134 | if (closeTime && closeTime > 0) { 135 | setTimeout(function () { 136 | if (tab.id) { 137 | chrome.tabs.remove(tab.id); 138 | } 139 | }, closeTime * 1000); 140 | } 141 | } 142 | ); 143 | } 144 | 145 | /** 146 | * 147 | * @param {string} text - Text to copy to clipboard 148 | */ 149 | function copyToClipboard(text: string) { 150 | chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { 151 | if (tabs[0].id) { 152 | chrome.tabs.sendMessage(tabs[0].id, { message: "copyToClipboard", text: text }); 153 | } 154 | }); 155 | } 156 | 157 | function pad(number: number, length: number) { 158 | var str = "" + number; 159 | while (str.length < length) { 160 | str = "0" + str; 161 | } 162 | 163 | return str; 164 | } 165 | 166 | function timeConverter(a: Date) { 167 | var year = a.getFullYear(); 168 | var month = pad(a.getMonth() + 1, 2) 169 | var day = pad(a.getDate(), 2); 170 | var hour = pad(a.getHours(), 2); 171 | var min = pad(a.getMinutes(), 2); 172 | var sec = pad(a.getSeconds(), 2); 173 | var time = year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec; 174 | return time; 175 | } 176 | 177 | async function sendInit(callback: (response?: any) => void) { 178 | const settings = await settingsManager.load(); 179 | callback(settings); 180 | } 181 | 182 | // Link copy formats 183 | const URLS_WITH_TITLES = 0 184 | const URLS_ONLY = 1 185 | const URLS_ONLY_SPACE_SEPARATED = 2 186 | const TITLES_ONLY = 3 187 | const AS_LINK_HTML = 4 188 | const AS_LIST_LINK_HTML = 5 189 | const AS_MARKDOWN = 6 190 | 191 | function formatLink({ url, title }: ActivateMessage["urls"][0], copyFormat: CopyFormat) { 192 | switch (Number.parseInt(copyFormat, 10)) { 193 | case URLS_WITH_TITLES: 194 | return title + "\t" + url + "\n"; 195 | case URLS_ONLY: 196 | return url + "\n"; 197 | case URLS_ONLY_SPACE_SEPARATED: 198 | return url + " "; 199 | case TITLES_ONLY: 200 | return title + "\n"; 201 | case AS_LINK_HTML: 202 | return '' + title + "\n"; 203 | case AS_LIST_LINK_HTML: 204 | return '
  • ' + title + "
  • \n"; 205 | case AS_MARKDOWN: 206 | return "[" + title + "](" + url + ")\n"; 207 | default: 208 | throw new Error("Invalid copy format: " + copyFormat); 209 | } 210 | } 211 | 212 | function handleCopy(request: ActivateMessage) { 213 | var text = ""; 214 | for (let i = 0; i < request.urls.length; i++) { 215 | text += formatLink(request.urls[i], request.setting.options.copy); 216 | } 217 | 218 | if (request.setting.options.copy == AS_LIST_LINK_HTML) { 219 | text = "
      \n" + text + "
    \n" 220 | } 221 | 222 | copyToClipboard(text); 223 | } 224 | 225 | function handleBookmark(request: ActivateMessage) { 226 | chrome.bookmarks.getTree( 227 | function (bookmarkTreeNodes) { 228 | 229 | const folderID = bookmarkTreeNodes[0].children?.[1]?.id; 230 | if (!folderID) { 231 | console.error("Folder ID is undefined"); 232 | return; 233 | } 234 | 235 | // make assumption that bookmarkTreeNodes[0].children[1] refers to the "other bookmarks" folder 236 | // as different languages will not use the english name to refer to the folder 237 | chrome.bookmarks.create({ 238 | "parentId": folderID, 239 | "title": "Linkclump " + timeConverter(new Date()) 240 | }, 241 | function (newFolder) { 242 | for (let j = 0; j < request.urls.length; j++) { 243 | chrome.bookmarks.create({ 244 | "parentId": newFolder.id, 245 | "title": request.urls[j].title, 246 | "url": request.urls[j].url 247 | }); 248 | } 249 | } 250 | ); 251 | } 252 | ); 253 | } 254 | 255 | function handleWin(request: ActivateMessage) { 256 | chrome.windows.getCurrent( 257 | function (currentWindow) { 258 | const url = request.urls.shift()?.url; 259 | 260 | if (!url) { 261 | return; 262 | } 263 | 264 | chrome.windows.create( 265 | { 266 | url: url, 267 | "focused": !request.setting.options.unfocus 268 | }, 269 | function (window) { 270 | const windowId = window ? window.id : currentWindow.id; 271 | 272 | if (request.urls.length > 0) { 273 | openTab( 274 | request.urls, 275 | request.setting.options.delay, 276 | windowId, 277 | undefined, 278 | undefined, 279 | 0 280 | ); 281 | } 282 | }); 283 | 284 | if (currentWindow.id && request.setting.options.unfocus) { 285 | chrome.windows.update( 286 | currentWindow.id, 287 | { "focused": true } 288 | ); 289 | } 290 | } 291 | ); 292 | } 293 | 294 | function handleTab(request: ActivateMessage, sender: chrome.runtime.MessageSender) { 295 | if (sender.tab === undefined || sender.tab.id === undefined) { 296 | return; 297 | } 298 | 299 | chrome.tabs.get(sender.tab.id, function (tab) { 300 | chrome.windows.getCurrent(function (currentWindow) { 301 | var tab_index = null; 302 | 303 | if (!request.setting.options.end) { 304 | tab_index = tab.index + 1; 305 | } 306 | 307 | const windowId = currentWindow ? currentWindow.id : undefined; 308 | 309 | openTab( 310 | request.urls, 311 | request.setting.options.delay, 312 | windowId, 313 | tab.id, 314 | tab_index, 315 | request.setting.options.close 316 | ); 317 | }) 318 | }); 319 | } 320 | 321 | function handleRequests(request: Messages, sender: chrome.runtime.MessageSender, callback: (response?: any) => void) { 322 | switch (request.message) { 323 | case "activate": { 324 | if (request.setting.options.block) { 325 | request.urls = uniqueUrl(request.urls); 326 | } 327 | 328 | if (request.urls.length === 0) { 329 | return; 330 | } 331 | 332 | if (request.setting.options.reverse) { 333 | request.urls.reverse(); 334 | } 335 | 336 | switch (request.setting.action) { 337 | case "copy": { 338 | handleCopy(request as ActivateMessage); 339 | break; 340 | } 341 | case "bm": { 342 | handleBookmark(request as ActivateMessage); 343 | break; 344 | } 345 | 346 | case "win": { 347 | handleWin(request as ActivateMessage); 348 | break; 349 | } 350 | 351 | case "tabs": { 352 | handleTab(request as ActivateMessage, sender); 353 | break; 354 | } 355 | } 356 | 357 | break; 358 | } 359 | 360 | case "init": { 361 | sendInit(callback); 362 | return true; 363 | } 364 | case "update": { 365 | settingsManager.save(request.settings); 366 | 367 | chrome.windows.getAll({ 368 | populate: true 369 | }, function (windowList) { 370 | windowList.forEach(function (window) { 371 | if (!window.tabs) return; 372 | 373 | window.tabs.forEach(async function (tab) { 374 | if (!tab.id) return; 375 | 376 | chrome.tabs.sendMessage( 377 | tab.id, 378 | { 379 | message: "update", 380 | settings: await settingsManager.load() 381 | } as UpdateMessage 382 | ); 383 | }) 384 | }) 385 | }); 386 | 387 | return; 388 | } 389 | } 390 | } 391 | 392 | chrome.runtime.onMessage.addListener(handleRequests); 393 | 394 | if (!settingsManager.isInit()) { 395 | // initialize settings manager with defaults and to stop this appearing again 396 | settingsManager.init(); 397 | 398 | // inject Linkclump into windows currently open to make it just work 399 | chrome.windows.getAll( 400 | { populate: true }, 401 | function (windows) { 402 | for (var i = 0; i < windows.length; ++i) { 403 | const numberOfTabs = windows[i].tabs?.length 404 | if (numberOfTabs === undefined) { 405 | continue 406 | } 407 | for (var j = 0; j < numberOfTabs; ++j) { 408 | const tab = windows[i]?.tabs?.[j] 409 | const url = tab?.url 410 | const id = tab?.id 411 | if (!url || !id) { 412 | continue 413 | } 414 | if (!/^https?:\/\//.test(url)) continue; 415 | chrome.tabs.executeScript(id, { file: "linkclump.js" }); 416 | } 417 | } 418 | } 419 | ); 420 | 421 | // pop up window to show tour and options page 422 | chrome.windows.create({ 423 | url: document.location.protocol + "//" + document.location.host + "/pages/options.html?init=true", 424 | width: 800, 425 | height: 850, 426 | left: screen.width / 2 - 800 / 2, 427 | top: screen.height / 2 - 700 / 2 428 | }); 429 | } else if (!settingsManager.isLatest()) { 430 | settingsManager.update(); 431 | } 432 | 433 | 434 | -------------------------------------------------------------------------------- /src/pages/options.ts: -------------------------------------------------------------------------------- 1 | import "../libs/jquery-1.8.2.min.js"; 2 | import "../libs/colorpicker/jquery.colorpicker.js"; 3 | import "../libs/colorpicker/jquery.colorpicker.css"; 4 | import "./style.css" 5 | import { Settings } from "../types/Settings"; 6 | 7 | interface Trigger { 8 | name: string; 9 | } 10 | 11 | interface ActionOption { 12 | name: string; 13 | type: 'selection' | 'selection-textbox' | 'textbox' | 'checkbox'; 14 | data?: string[]; 15 | extra: string; 16 | } 17 | 18 | interface Action { 19 | name: string; 20 | options: string[]; 21 | } 22 | 23 | interface Config { 24 | triggers: Trigger[]; 25 | actions: Record; 26 | options: Record; 27 | } 28 | 29 | interface ActionParam { 30 | mouse: number; 31 | key: number; 32 | color: string; 33 | action: string; 34 | options: Record; 35 | } 36 | 37 | const config: Config = { 38 | "triggers": 39 | [{ "name": "Left" }, { "name": "Middle" }, { "name": "Right" }], 40 | "actions": { 41 | "win": { "name": "Opened in a New Window", "options": ["smart", "ignore", "delay", "block", "reverse", "unfocus"] }, 42 | "tabs": { "name": "Opened as New Tabs", "options": ["smart", "ignore", "delay", "close", "block", "reverse", "end"] }, 43 | "bm": { "name": "Bookmarked", "options": ["smart", "ignore", "block", "reverse"] }, 44 | "copy": { "name": "Copied to clipboard", "options": ["smart", "ignore", "copy", "block", "reverse"] } 45 | }, 46 | "options": { 47 | "smart": { 48 | "name": "smart select", 49 | "type": "selection", 50 | "data": ["on", "off"], 51 | "extra": "with smart select turned on linkclump tries to select only the important links" 52 | }, 53 | "ignore": { 54 | "name": "filter links", 55 | "type": "selection-textbox", 56 | "data": ["exclude links with words", "include links with words"], 57 | "extra": "filter links that include/exclude these words; separate words with a comma ," 58 | }, 59 | "copy": { 60 | "name": "copy format", 61 | "type": "selection", 62 | "data": ["URLS with titles", "URLS only", "URLS only space separated", "titles only", "as link HTML", "as list link HTML", "as Markdown"], 63 | "extra": "format of the links saved to the clipboard" 64 | }, 65 | "delay": { 66 | "name": "delay in opening", 67 | "type": "textbox", 68 | "extra": "number of seconds between the opening of each link" 69 | }, 70 | "close": { 71 | "name": "close tab time", 72 | "type": "textbox", 73 | "extra": "number of seconds before closing opened tab (0 means the tab wouldn't close)" 74 | }, 75 | "block": { 76 | "name": "block repeat links in selection", 77 | "type": "checkbox", 78 | "extra": "select to block repeat links from opening" 79 | }, 80 | "reverse": { 81 | "name": "reverse order", 82 | "type": "checkbox", 83 | "extra": "select to have links opened in reverse order" 84 | }, 85 | "end": { 86 | "name": "open tabs at the end", 87 | "type": "checkbox", 88 | "extra": "select to have links opened at the end of all other tabs" 89 | }, 90 | "unfocus": { 91 | "name": "do not focus on new window", 92 | "type": "checkbox", 93 | "extra": "select to stop the new window from coming to the front" 94 | } 95 | } 96 | }; 97 | 98 | const OS_WIN = 0; 99 | const OS_LINUX = 1; 100 | const OS_MAC = 2; 101 | 102 | const colors: string[] = ["458B74", "838B8B", "CCCCCC", "0000FF", "8A2BE2", "D2691E", "6495ED", "DC143C", "006400", "9400D3", "1E90FF", "228B22", "00FF00", "ADFF2F", "FF69B4", "4B0082", "F0E68C", "8B814C", "87CEFA", "32CD32", "000080", "FFA500", "FF4500", "DA70D6", "8B475D", "8B668B", "FF0000", "2E8B57", "8E388E", "FFFF00"]; 103 | let params: Settings | null = null; 104 | const div_history: Record = []; 105 | const keys = displayKeys(0); 106 | const os = ((navigator.appVersion.indexOf("Win") === -1) ? ((navigator.appVersion.indexOf("Mac") === -1) ? OS_LINUX : OS_MAC) : OS_WIN); 107 | 108 | function close_form(event: JQuery.Event) { 109 | $("#form-background").fadeOut(); 110 | 111 | event.preventDefault(); 112 | } 113 | 114 | function tour1() { 115 | setup_text(keys); 116 | $("#page2").fadeOut(0); 117 | $("#page1").fadeIn(); 118 | $("#test_area").focus(); 119 | } 120 | 121 | function tour2() { 122 | $("#page1").fadeOut(0); 123 | $("#page2").fadeIn(); 124 | } 125 | 126 | /** 127 | * 128 | * @param {string | null} id 129 | */ 130 | function load_action(id: string | null) { // into form 131 | if (id === null) { 132 | displayKeys(0); 133 | displayOptions("tabs"); 134 | $("#form_id").val(""); 135 | $("#form_mouse").val(0); // default to left mouse button 136 | $("#form_key").val(90); // and z key 137 | $(".colorpicker-trigger").css("background-color", "#" + colors[Math.floor(Math.random() * colors.length)]); 138 | } else { 139 | var param = params?.actions[id]; 140 | $("#form_id").val(id); 141 | 142 | $("#form_mouse").val(param.mouse); 143 | displayKeys(param.mouse); 144 | $("#form_key").val(param.key); 145 | 146 | $(".colorpicker-trigger").css("background-color", param.color); 147 | 148 | $("#form_" + param.action).attr("checked", "checked"); 149 | 150 | displayOptions(param.action); 151 | 152 | for (var i in param.options) { 153 | switch (config.options[i].type) { 154 | case "selection": 155 | $("#form_option_" + i).val(param.options[i]); 156 | break; 157 | 158 | case "textbox": 159 | $("#form_option_" + i).val(param.options[i]); 160 | break; 161 | 162 | case "checkbox": 163 | if (param.options[i]) { 164 | $("#form_option_" + i).attr("checked", "true"); 165 | } else { 166 | $("#form_option_" + i).attr("checked", "false"); 167 | } 168 | break; 169 | 170 | case "selection-textbox": 171 | if (param.options[i].length > 1) { 172 | var selection = param.options[i][0]; 173 | var text = ""; 174 | for (var k = 1; k < param.options[i].length; k++) { 175 | text += param.options[i][k] + ","; 176 | } 177 | 178 | $("#form_option_selection_" + i).val(selection); 179 | $("#form_option_text_" + i).val(text); 180 | } 181 | 182 | break; 183 | } 184 | 185 | } 186 | } 187 | 188 | // hide warning and let it show later if required 189 | $(".warning").hide(); 190 | 191 | // place the form at the top of the window+10 192 | $(".form").css("margin-top", $(window).scrollTop() + 10); 193 | 194 | // fade in the form and set the background to cover the whole page 195 | $("#form-background").fadeIn(); 196 | $("#form-background").css("height", $(document).height()); 197 | 198 | check_selection(); 199 | } 200 | 201 | /** 202 | * 203 | * @param {string} id 204 | * @param {JQuery} div 205 | */ 206 | function delete_action(id: string, div: JQuery) { 207 | div.fadeOut("swing", function () { 208 | var del = $("
    Action has been deleted
    "); 209 | var undo = $("undo").click({ "i": id, "param": params.actions[id] }, 210 | function (event) { 211 | div_history[event.data.i].replaceWith(setup_action(event.data.param, event.data.i)); 212 | params.actions[event.data.i] = event.data.param; 213 | 214 | delete (div_history[event.data.i]); 215 | 216 | save_params(); 217 | return false; 218 | } 219 | ); 220 | del.append(undo); 221 | 222 | $(this).replaceWith(del).fadeIn("swing"); 223 | 224 | div_history[id] = del; 225 | delete (params.actions[id]); 226 | 227 | save_params(); 228 | }); 229 | } 230 | 231 | function setup_action(param: ActionParam, id: string): JQuery { 232 | var setting = $("
    "); 233 | 234 | setting.append("

    " + config.actions[param.action].name + "

    "); 235 | setting.append("Activate by " + config.triggers[param.mouse].name + " mouse button"); 236 | if (param.key > 0) { 237 | setting.append(" and \"" + keys[param.key] + "\" key "); 238 | } 239 | 240 | var list = $("
      "); 241 | for (var j in param.options) { 242 | var op = config.options[j]; 243 | var text = op.name + ": "; 244 | switch (op.type) { 245 | case "selection": 246 | text += op.data[param.options[j]]; 247 | break; 248 | case "textbox": 249 | // TODO not sure if param.options[j] returns a string or int 250 | if (param.options[j] === "" || param.options[j] == "0") { 251 | continue; 252 | } 253 | text += param.options[j]; 254 | break; 255 | case "checkbox": 256 | if (!param.options[j]) { 257 | continue; 258 | } 259 | text += param.options[j]; 260 | break; 261 | case "selection-textbox": 262 | if (param.options[j].length < 2) { 263 | continue; 264 | } 265 | var selection = param.options[j][0]; 266 | var words = ""; 267 | for (var i = 1; i < param.options[j].length; i++) { 268 | words += param.options[j][i]; 269 | 270 | if (i < param.options[j].length - 1) { 271 | words += ", "; 272 | } 273 | } 274 | text += op.data[selection] + "; " + words; 275 | break; 276 | } 277 | 278 | list.append("
    • " + text + "
    • "); 279 | } 280 | list.append("
    • selection box color:
    • "); 281 | 282 | setting.append(list); 283 | 284 | var edit = $("Edit").click({ 'i': id }, 285 | function (event) { 286 | load_action(event.data.i, $(this).parent().parent()); 287 | return false; 288 | } 289 | ); 290 | 291 | var del = $("Delete").click({ "i": id }, 292 | function (event) { 293 | delete_action(event.data.i, $(this).parent()); 294 | return false; 295 | } 296 | ); 297 | 298 | setting.append(del); 299 | setting.append(edit); 300 | 301 | return setting; 302 | } 303 | 304 | function setup_form() { 305 | var mouse = $("#form_mouse"); 306 | for (var i = 0; i < config.triggers.length; i++) { 307 | mouse.append(''); 308 | } 309 | 310 | mouse.change(function (event) { 311 | displayKeys($(this)[0][$(this)[0].selectedIndex].value); 312 | check_selection(); 313 | }); 314 | 315 | var color = $("#form_color"); 316 | for (var i in colors) { 317 | color.append(""); 318 | } 319 | 320 | color.colorpicker({ 321 | size: 30, 322 | hide: false 323 | }); 324 | 325 | 326 | var action = $("#form_action"); 327 | for (var i in config.actions) { 328 | var act = $('' + config.actions[i].name + '
      ') 329 | 330 | 331 | act.click(function (event) { 332 | displayOptions(event.currentTarget.value) 333 | } 334 | ); 335 | 336 | action.append(act); 337 | } 338 | 339 | $('input[value="tabs"]').attr("checked", "checked"); 340 | } 341 | 342 | function setup_text(keys: Record) { 343 | var param; 344 | for (var i in params.actions) { 345 | param = params.actions[i]; 346 | break; 347 | } 348 | if (param === undefined) { 349 | return; 350 | } 351 | $("#mouse_name").text(config.triggers[param.mouse].name); 352 | $("#action_name").text(config.actions[param.action].name); 353 | if (param.key > 0) { 354 | $("#key_name").html("the " + keys[param.key] + " key and"); 355 | } else { 356 | $("#key_name").html(""); 357 | } 358 | } 359 | 360 | function check_selection() { 361 | var m = $("#form_mouse").val(); 362 | var k = $("#form_key").val(); 363 | var id = $("#form_id").val(); 364 | 365 | 366 | var keyWarning = $('#key_warning'); 367 | keyWarning.empty(); 368 | if (k === "0") { 369 | keyWarning.append("WARNING: Not using a key could cause unexpected behavior on some websites"); 370 | if ($(".warning2").is(":hidden")) { 371 | $(".warning2").fadeIn(); 372 | } 373 | } else { 374 | if (!$(".warning2").is(":hidden")) { 375 | $(".warning2").fadeOut(); 376 | } 377 | } 378 | 379 | for (var i in params.actions) { 380 | // not sure if mouse/key are strings or ints 381 | if (i != id && params.actions[i].mouse == m && params.actions[i].key == k) { 382 | if ($(".warning").is(":hidden")) { 383 | $(".warning").fadeIn(); 384 | } 385 | 386 | return; 387 | } 388 | } 389 | 390 | if (!$(".warning").is(":hidden")) { 391 | $(".warning").fadeOut(); 392 | } 393 | } 394 | 395 | function displayOptions(action: string) { 396 | var options = $("#form_options"); 397 | options.empty(); 398 | 399 | for (var i in config.actions[action].options) { 400 | var op = config.options[config.actions[action].options[i]]; 401 | var title = $(""); 402 | var p = $("

      "); 403 | p.append(title); 404 | 405 | switch (op.type) { 406 | case "selection": 407 | var selector = $("'); 416 | break; 417 | 418 | case "checkbox": 419 | p.append(''); 420 | break; 421 | 422 | case "selection-textbox": 423 | var selector = $("'); 430 | break; 431 | } 432 | 433 | p.mouseover({ "extra": op.extra }, function (event) { 434 | var extra = $("#form_extra"); 435 | extra.html(event.data.extra); 436 | extra.css("top", $(this).position().top); 437 | extra.css("left", $(this).position().left + 500); 438 | extra.show(); 439 | }).mouseout(function () { 440 | $("#form_extra").hide(); 441 | }); 442 | 443 | options.append(p); 444 | 445 | } 446 | } 447 | 448 | function displayKeys(mouseButton: number): Record { 449 | var key = $("#form_key"); 450 | key.empty(); 451 | var keys: Record = []; 452 | 453 | keys[16] = "shift"; 454 | keys[17] = "ctrl"; 455 | 456 | if (os !== OS_LINUX) { 457 | keys[18] = "alt"; 458 | } 459 | 460 | // if not left or windows then allow no key 461 | // NOTE mouseButton is sometimes a string, sometimes an int 462 | if (mouseButton != 2 || os === OS_WIN) { 463 | keys[0] = ''; 464 | } 465 | 466 | // add on alpha characters 467 | for (var i = 0; i < 26; i++) { 468 | keys[65 + i] = String.fromCharCode(97 + i); 469 | } 470 | 471 | for (var i in keys) { 472 | key.append(''); 473 | } 474 | 475 | // set selected value to z 476 | key.val(90); 477 | 478 | return keys; 479 | } 480 | 481 | function load_new_action(event: JQuery.Event) { 482 | load_action(null); 483 | event.preventDefault(); 484 | } 485 | 486 | function save_action(event: JQuery.Event) { 487 | var id = $("#form_id").val(); 488 | 489 | var param: ActionParam = {} as ActionParam; 490 | 491 | param.mouse = $("#form_mouse").val(); 492 | param.key = $("#form_key").val(); 493 | param.color = $(".colorpicker-trigger").css("background-color"); 494 | param.action = $("input[name=action]:radio:checked").val(); 495 | param.options = {}; 496 | 497 | for (var opt in config.actions[param.action].options) { 498 | var name = config.actions[param.action].options[opt]; 499 | var type = config.options[name].type; 500 | if (type === "checkbox") { 501 | param.options[name] = $("#form_option_" + name).is(":checked"); 502 | } else { 503 | if (name === "ignore") { 504 | var ignore = $("#form_option_text_" + name).val().replace(/^ */, "").replace(/, */g, ",").toLowerCase().split(",") 505 | // if the last entry is empty then just remove from array 506 | if (ignore.length > 0 && ignore[ignore.length - 1] === "") { 507 | ignore.pop(); 508 | } 509 | // add selection to the start of the array 510 | ignore.unshift(param.options[name] = $("#form_option_selection_" + name).val()); 511 | 512 | param.options[name] = ignore; 513 | } else if (name === "delay" || name === "close") { 514 | var delay; 515 | try { 516 | delay = parseFloat($("#form_option_" + name).val()); 517 | } catch (err) { 518 | delay = 0; 519 | } 520 | if (isNaN(delay)) { 521 | delay = 0; 522 | } 523 | 524 | 525 | param.options[name] = delay; 526 | } else { 527 | param.options[name] = $("#form_option_" + name).val(); 528 | } 529 | } 530 | } 531 | 532 | if (id === "" || params.actions[id] === null) { 533 | var newDate = new Date; 534 | id = newDate.getTime(); 535 | 536 | params.actions[id] = param; 537 | $("#settings").append(setup_action(param, id)); 538 | } else { 539 | params.actions[id] = param; 540 | var update = setup_action(param, id); 541 | $("#action_" + id).replaceWith(update); 542 | } 543 | 544 | save_params(); 545 | close_form(event); 546 | } 547 | 548 | function save_params() { 549 | chrome.runtime.sendMessage({ 550 | message: "update", 551 | settings: params 552 | }); 553 | } 554 | 555 | function save_block() { 556 | // replace any whitespace at end to stop empty site listings 557 | var sites = $("#form_block").val().replace(/^\s+|\s+$/g, "").split("\n"); 558 | 559 | if (Array.isArray(sites)) { 560 | params.blocked = sites; 561 | save_params(); 562 | } 563 | } 564 | 565 | $(function() { 566 | var isFirstTime = window.location.href.indexOf("init=true") > -1; 567 | 568 | // temp check to not load if in test mode 569 | if (document.getElementById("guide2") === null) { 570 | return 571 | } 572 | 573 | 574 | document.getElementById("guide2").addEventListener("click", tour2); 575 | document.getElementById("guide1").addEventListener("click", tour1); 576 | document.getElementById("add").addEventListener("click", load_new_action); 577 | document.getElementById("form_block").addEventListener("keyup", save_block); 578 | document.getElementById("form_key").addEventListener("change", check_selection); 579 | document.getElementById("cancel").addEventListener("click", close_form); 580 | document.getElementById("save").addEventListener("click", save_action); 581 | 582 | setup_form(); 583 | 584 | chrome.runtime.sendMessage({ 585 | message: "init", 586 | debug: true 587 | }, 588 | function (response) { 589 | params = response; 590 | 591 | for (var i in params.actions) { 592 | $("#settings").append(setup_action(params.actions[i], i)); 593 | } 594 | setup_text(keys); 595 | 596 | $("#form_block").val(params.blocked.join("\n")); 597 | 598 | if (isFirstTime) { 599 | tour1(); 600 | } else { 601 | tour2(); 602 | } 603 | }); 604 | }); 605 | -------------------------------------------------------------------------------- /src/linkclump.ts: -------------------------------------------------------------------------------- 1 | import { ActivateMessage, InitMessage, InitResponse } from './types/Messages'; 2 | import { Settings } from './types/Settings'; 3 | 4 | // set all the properties of the window object 5 | // to avoid typescript errors 6 | declare global { 7 | interface Window { 8 | settings: Settings["actions"] | Record; 9 | setting: number; 10 | 11 | key_pressed: number; 12 | mouse_button: number | null; 13 | stop_menu: boolean; 14 | box_on: boolean; 15 | smart_select: boolean; 16 | 17 | mouse_x: number; 18 | mouse_y: number; 19 | 20 | scroll_id: number; 21 | links: any[]; 22 | box: HTMLElement & { x: number, y: number, x1: number, x2: number, y1: number, y2: number }; 23 | count_label: HTMLElement; 24 | overlay: HTMLElement | null; 25 | scroll_bug_ignore: boolean; 26 | os: 0 | 1; 27 | 28 | timer: number | NodeJS.Timeout; 29 | } 30 | } 31 | 32 | const END_CODE = "End"; 33 | const HOME_CODE = "Home"; 34 | const Z_INDEX = "2147483647"; 35 | const OS_WIN = 1; 36 | const OS_LINUX = 0; 37 | const LEFT_BUTTON = 0; 38 | const EXCLUDE_LINKS = 0; 39 | const INCLUDE_LINKS = 1; 40 | 41 | window.settings = {}; 42 | window.setting = -1; 43 | window.key_pressed = 0; 44 | window.mouse_button = null; 45 | window.stop_menu = false; 46 | window.box_on = false; 47 | window.smart_select = false; 48 | window.mouse_x = -1; 49 | window.mouse_y = -1; 50 | window.scroll_id = 0; 51 | window.links = []; 52 | // @ts-expect-error -- all will be right at the end of the function 53 | window.box = undefined; 54 | // @ts-expect-error -- all will be right at the end of the function 55 | window.count_label = undefined; 56 | window.overlay = null; 57 | window.scroll_bug_ignore = false; 58 | window.os = ((navigator.appVersion.indexOf("Win") === -1) ? OS_LINUX : OS_WIN); 59 | window.timer = 0; 60 | 61 | 62 | chrome.runtime.sendMessage( 63 | { 64 | message: "init" 65 | } as InitMessage, 66 | function (response: InitResponse | null) { 67 | if (response === null) { 68 | console.error("Unable to load linkclump due to null response"); 69 | } else { 70 | if (response.hasOwnProperty("error")) { 71 | console.error("Unable to properly load linkclump, returning to default settings: " + JSON.stringify(response)); 72 | } 73 | 74 | window.settings = response.actions; 75 | 76 | var allowed = true; 77 | for (var i in response.blocked) { 78 | if (response.blocked[i] == "") continue; 79 | var re = new RegExp(response.blocked[i], "i"); 80 | 81 | if (re.test(window.location.href)) { 82 | allowed = false; 83 | console.error("Linkclump is blocked on this site: " + response.blocked[i] + "~" + window.location.href); 84 | } 85 | } 86 | 87 | if (allowed) { 88 | // setting up the box and count label 89 | window.box = create_box(); 90 | document.body.appendChild(window.box); 91 | 92 | window.count_label = create_count_label(); 93 | document.body.appendChild(window.count_label); 94 | 95 | // add event listeners 96 | window.addEventListener("mousedown", mousedown, true); 97 | window.addEventListener("keydown", keydown, true); 98 | window.addEventListener("keyup", keyup, true); 99 | window.addEventListener("blur", blur, true); 100 | window.addEventListener("contextmenu", contextmenu, true); 101 | } 102 | } 103 | } 104 | ); 105 | 106 | chrome.runtime.onMessage.addListener(function (request) { 107 | if (request.message === "update") { 108 | window.settings = request.settings.actions; 109 | } 110 | if (request.message === "copyToClipboard") { 111 | const textarea = document.createElement("textarea"); 112 | textarea.value = request.text; 113 | document.body.appendChild(textarea); 114 | textarea.select(); 115 | document.execCommand("copy"); 116 | document.body.removeChild(textarea); 117 | } 118 | }); 119 | 120 | function create_box() { 121 | // @ts-expect-error -- all will be right at the end of the function 122 | window.box = document.createElement("span"); 123 | window.box.style.margin = "0px auto"; 124 | window.box.style.border = "2px dotted " + (window.settings[window.setting]?.color ?? "red"); 125 | window.box.style.position = "absolute"; 126 | window.box.style.zIndex = Z_INDEX; 127 | window.box.style.visibility = "hidden"; 128 | 129 | // set the box properties 130 | window.box.x = 0; 131 | window.box.y = 0; 132 | window.box.x1 = 0; 133 | window.box.x2 = 0; 134 | window.box.y1 = 0; 135 | window.box.y2 = 0; 136 | 137 | return window.box; 138 | } 139 | 140 | function create_count_label() { 141 | window.count_label = document.createElement("span"); 142 | window.count_label.style.zIndex = Z_INDEX; 143 | window.count_label.style.position = "absolute"; 144 | window.count_label.style.visibility = "hidden"; 145 | window.count_label.style.left = "10px"; 146 | window.count_label.style.width = "50px"; 147 | window.count_label.style.top = "10px"; 148 | window.count_label.style.height = "20px"; 149 | window.count_label.style.fontSize = "10px"; 150 | window.count_label.style.font = "Arial, sans-serif"; 151 | window.count_label.style.color = "black"; 152 | 153 | return window.count_label; 154 | } 155 | 156 | function mousemove(event: MouseEvent) { 157 | prevent_escalation(event); 158 | if (allow_selection() || window.scroll_bug_ignore) { 159 | window.scroll_bug_ignore = false; 160 | update_box(event.pageX, event.pageY); 161 | 162 | // while detect keeps on calling false then recall the method 163 | while (!detect(event.pageX, event.pageY, false)) { 164 | // empty 165 | } 166 | } else { 167 | // only stop if the mouseup timer is no longer set 168 | if (window.timer === 0) { 169 | stop(); 170 | } 171 | } 172 | } 173 | 174 | function clean_up() { 175 | // remove the box 176 | if (window.box) window.box.style.visibility = "hidden"; 177 | if (window.count_label) window.count_label.style.visibility = "hidden"; 178 | window.box_on = false; 179 | 180 | // remove the link boxes 181 | for (var i = 0; i < window.links.length; i++) { 182 | if (window.links[i].box !== null) { 183 | document.body.removeChild(window.links[i].box); 184 | window.links[i].box = null; 185 | } 186 | } 187 | window.links = []; 188 | 189 | // wipe clean the smart select 190 | window.smart_select = false; 191 | window.mouse_button = -1; 192 | window.key_pressed = 0; 193 | } 194 | 195 | function mousedown(event: MouseEvent) { 196 | window.mouse_button = event.button; 197 | 198 | // turn on menu for windows 199 | if (window.os === OS_WIN) { 200 | window.stop_menu = false; 201 | } 202 | 203 | if (allow_selection()) { 204 | // don't prevent for windows right click as it breaks spell checker 205 | // do prevent for left as otherwise the page becomes highlighted 206 | if (window.os === OS_LINUX || (window.os === OS_WIN && window.mouse_button === LEFT_BUTTON)) { 207 | prevent_escalation(event); 208 | } 209 | 210 | // if mouse up timer is set then clear it as it was just caused by bounce 211 | if (window.timer !== 0) { 212 | clearTimeout(window.timer); 213 | window.timer = 0; 214 | 215 | // keep menu off for windows 216 | if (window.os === OS_WIN) { 217 | window.stop_menu = true; 218 | } 219 | } else { 220 | // clean up any mistakes 221 | if (window.box_on) { 222 | clean_up(); 223 | } 224 | 225 | // update position 226 | window.box.x = event.pageX; 227 | window.box.y = event.pageY; 228 | update_box(event.pageX, event.pageY); 229 | 230 | // setup mouse move and mouse up 231 | window.addEventListener("mousemove", mousemove, true); 232 | window.addEventListener("mouseup", mouseup, true); 233 | window.addEventListener("mousewheel", mousewheel, true); 234 | window.addEventListener("mouseout", mouseout, true); 235 | } 236 | } 237 | } 238 | 239 | function update_box(x: number, y: number) { 240 | var width = Math.max(document.documentElement["clientWidth"], document.body["scrollWidth"], document.documentElement["scrollWidth"], document.body["offsetWidth"], document.documentElement["offsetWidth"]); // taken from jquery 241 | var height = Math.max(document.documentElement["clientHeight"], document.body["scrollHeight"], document.documentElement["scrollHeight"], document.body["offsetHeight"], document.documentElement["offsetHeight"]); // taken from jquery 242 | x = Math.min(x, width - 7); 243 | y = Math.min(y, height - 7); 244 | 245 | if (x > window.box.x) { 246 | window.box.x1 = window.box.x; 247 | window.box.x2 = x; 248 | } else { 249 | window.box.x1 = x; 250 | window.box.x2 = window.box.x; 251 | } 252 | if (y > window.box.y) { 253 | window.box.y1 = window.box.y; 254 | window.box.y2 = y; 255 | } else { 256 | window.box.y1 = y; 257 | window.box.y2 = window.box.y; 258 | } 259 | 260 | window.box.style.left = window.box.x1 + "px"; 261 | window.box.style.width = window.box.x2 - window.box.x1 + "px"; 262 | window.box.style.top = window.box.y1 + "px"; 263 | window.box.style.height = window.box.y2 - window.box.y1 + "px"; 264 | 265 | window.count_label.style.left = x - 15 + "px"; 266 | window.count_label.style.top = y - 15 + "px"; 267 | } 268 | 269 | function mousewheel() { 270 | window.scroll_bug_ignore = true; 271 | } 272 | 273 | function mouseout(event: MouseEvent) { 274 | mousemove(event); 275 | // the mouse wheel event might also call this event 276 | window.scroll_bug_ignore = true; 277 | } 278 | 279 | function prevent_escalation(event: MouseEvent) { 280 | event.stopPropagation(); 281 | event.preventDefault(); 282 | } 283 | 284 | function mouseup(event: MouseEvent) { 285 | prevent_escalation(event); 286 | 287 | if (window.box_on) { 288 | // all the detection of the mouse to bounce 289 | if (allow_selection() && window.timer === 0) { 290 | window.timer = setTimeout(function () { 291 | update_box(event.pageX, event.pageY); 292 | detect(event.pageX, event.pageY, true); 293 | 294 | stop(); 295 | window.timer = 0; 296 | }, 100); 297 | } 298 | } else { 299 | // false alarm 300 | stop(); 301 | } 302 | } 303 | 304 | function getXY(element: HTMLElement): { x: number, y: number } { 305 | var x = 0; 306 | var y = 0; 307 | 308 | var parent: Element | null = element; 309 | var style; 310 | var matrix; 311 | do { 312 | style = window.getComputedStyle(parent); 313 | matrix = new WebKitCSSMatrix(style.webkitTransform); 314 | x += parent.offsetLeft + matrix.m41; 315 | y += parent.offsetTop + matrix.m42; 316 | } while (parent = parent.offsetParent); 317 | 318 | parent = element; 319 | while (parent && parent !== document.body) { 320 | if (parent.scrollLeft) { 321 | x -= parent.scrollLeft; 322 | } 323 | if (parent.scrollTop) { 324 | y -= parent.scrollTop; 325 | } 326 | parent = parent.parentNode; 327 | } 328 | 329 | return { 330 | x: x, 331 | y: y 332 | }; 333 | } 334 | 335 | function start() { 336 | const selectedAction = window.settings[window.setting] 337 | 338 | if (selectedAction === undefined) { 339 | console.error("No setting selected"); 340 | return; 341 | } 342 | 343 | // stop user from selecting text/elements 344 | document.body.style.userSelect = "none"; 345 | 346 | // turn on the box 347 | window.box.style.visibility = "visible"; 348 | window.count_label.style.visibility = "visible"; 349 | 350 | // find all links (find them each time as they could have moved) 351 | var page_links = document.links; 352 | 353 | 354 | // create RegExp once 355 | var re1 = new RegExp("^javascript:", "i"); 356 | var re2 = new RegExp(selectedAction.options.ignore.slice(1).join("|"), "i"); 357 | var re3 = new RegExp("^H\\d$"); 358 | 359 | for (var i = 0; i < page_links.length; i++) { 360 | // reject javascript: links 361 | if (re1.test(page_links[i].href)) { 362 | continue; 363 | } 364 | 365 | // reject href="" or href="#" 366 | if (!page_links[i].getAttribute("href") || page_links[i].getAttribute("href") === "#") { 367 | continue; 368 | } 369 | 370 | // include/exclude links 371 | if (selectedAction.options.ignore.length > 1) { 372 | if (re2.test(page_links[i].href) || re2.test(page_links[i].innerHTML)) { 373 | if (selectedAction.options.ignore[0] == EXCLUDE_LINKS) { 374 | continue; 375 | } 376 | } else if (selectedAction.options.ignore[0] == INCLUDE_LINKS) { 377 | continue; 378 | } 379 | } 380 | 381 | // attempt to ignore invisible links (can't ignore overflow) 382 | var comp = window.getComputedStyle(page_links[i], null); 383 | if (comp.visibility == "hidden" || comp.display == "none") { 384 | continue; 385 | } 386 | 387 | var pos = getXY(page_links[i]); 388 | var width = page_links[i].offsetWidth; 389 | var height = page_links[i].offsetHeight; 390 | 391 | // attempt to get the actual size of the link 392 | for (var k = 0; k < page_links[i].childNodes.length; k++) { 393 | if (page_links[i].childNodes[k].nodeName == "IMG") { 394 | const pos2 = getXY(page_links[i].childNodes[k]); 395 | if (pos.y >= pos2.y) { 396 | pos.y = pos2.y; 397 | 398 | width = Math.max(width, page_links[i].childNodes[k].offsetWidth); 399 | height = Math.max(height, page_links[i].childNodes[k].offsetHeight); 400 | } 401 | } 402 | } 403 | 404 | page_links[i].x1 = pos.x; 405 | page_links[i].y1 = pos.y; 406 | page_links[i].x2 = pos.x + width; 407 | page_links[i].y2 = pos.y + height; 408 | page_links[i].height = height; 409 | page_links[i].width = width; 410 | page_links[i].box = null; 411 | page_links[i].important = selectedAction.options.smart == 0 && page_links[i].parentNode != null && re3.test(page_links[i].parentNode.nodeName); 412 | 413 | window.links.push(page_links[i]); 414 | } 415 | 416 | window.box_on = true; 417 | 418 | // turn off menu for windows so mouse up doesn't trigger context menu 419 | if (window.os === OS_WIN) { 420 | window.stop_menu = true; 421 | } 422 | } 423 | 424 | function stop() { 425 | // allow user to select text/elements 426 | document.body.style.userSelect = ""; 427 | 428 | // turn off mouse move and mouse up 429 | window.removeEventListener("mousemove", mousemove, true); 430 | window.removeEventListener("mouseup", mouseup, true); 431 | window.removeEventListener("mousewheel", mousewheel, true); 432 | window.removeEventListener("mouseout", mouseout, true); 433 | 434 | if (window.box_on) { 435 | clean_up(); 436 | } 437 | 438 | // turn on menu for linux 439 | if (window.os === OS_LINUX && window.settings[window.setting]?.key != window.key_pressed) { 440 | window.stop_menu = false; 441 | } 442 | } 443 | 444 | function scroll() { 445 | if (allow_selection()) { 446 | var y = window.mouse_y - window.scrollY; 447 | var win_height = window.innerHeight; 448 | 449 | if (y > win_height - 20) { //down 450 | let speed = win_height - y; 451 | if (speed < 2) { 452 | speed = 60; 453 | } else if (speed < 10) { 454 | speed = 30; 455 | } else { 456 | speed = 10; 457 | } 458 | window.scrollBy(0, speed); 459 | window.mouse_y += speed; 460 | update_box(window.mouse_x, window.mouse_y); 461 | detect(window.mouse_x, window.mouse_y, false); 462 | 463 | window.scroll_bug_ignore = true; 464 | return; 465 | } else if (window.scrollY > 0 && y < 20) { //up 466 | let speed = y; 467 | if (speed < 2) { 468 | speed = 60; 469 | } else if (speed < 10) { 470 | speed = 30; 471 | } else { 472 | speed = 10; 473 | } 474 | window.scrollBy(0, -speed); 475 | window.mouse_y -= speed; 476 | update_box(window.mouse_x, window.mouse_y); 477 | detect(window.mouse_x, window.mouse_y, false); 478 | 479 | window.scroll_bug_ignore = true; 480 | return; 481 | } 482 | } 483 | 484 | clearInterval(window.scroll_id); 485 | window.scroll_id = 0; 486 | } 487 | 488 | function detect(x: number, y: number, open: boolean) { 489 | window.mouse_x = x; 490 | window.mouse_y = y; 491 | 492 | if (!window.box_on) { 493 | if (window.box.x2 - window.box.x1 < 5 && window.box.y2 - window.box.y1 < 5) { 494 | return true; 495 | } else { 496 | start(); 497 | } 498 | 499 | } 500 | 501 | if (!window.scroll_id) { 502 | window.scroll_id = setInterval(scroll, 100); 503 | } 504 | 505 | var count = 0; 506 | var count_tabs = new Set; 507 | var open_tabs = []; 508 | for (var i = 0; i < window.links.length; i++) { 509 | if ( 510 | (!window.smart_select || window.links[i].important) 511 | && !( 512 | window.links[i].x1 > window.box.x2 513 | || window.links[i].x2 < window.box.x1 514 | || window.links[i].y1 > window.box.y2 515 | || window.links[i].y2 < window.box.y1 516 | ) 517 | ) { 518 | if (open) { 519 | open_tabs.push({ 520 | "url": window.links[i].href, 521 | "title": window.links[i].innerText 522 | }); 523 | } 524 | 525 | // check if important links have been selected and possibly redo 526 | if (!window.smart_select) { 527 | if (window.links[i].important) { 528 | window.smart_select = true; 529 | return false; 530 | } 531 | } else { 532 | if (window.links[i].important) { 533 | count++; 534 | } 535 | } 536 | 537 | if (window.links[i].box === null) { 538 | var link_box = document.createElement("span"); 539 | link_box.id = "linkclump-link"; 540 | link_box.style.margin = "0px auto"; 541 | link_box.style.border = "1px solid red"; 542 | link_box.style.position = "absolute"; 543 | link_box.style.width = window.links[i].width + "px"; 544 | link_box.style.height = window.links[i].height + "px"; 545 | link_box.style.top = window.links[i].y1 + "px"; 546 | link_box.style.left = window.links[i].x1 + "px"; 547 | link_box.style.zIndex = Z_INDEX; 548 | 549 | document.body.appendChild(link_box); 550 | window.links[i].box = link_box; 551 | } else { 552 | window.links[i].box.style.visibility = "visible"; 553 | } 554 | 555 | count_tabs.add(window.links[i].href); 556 | } else { 557 | if (window.links[i].box !== null) { 558 | window.links[i].box.style.visibility = "hidden"; 559 | } 560 | } 561 | } 562 | 563 | // important links were found, but not anymore so redo 564 | if (window.smart_select && count === 0) { 565 | window.smart_select = false; 566 | return false; 567 | } 568 | 569 | window.count_label.innerText = count_tabs.size.toString(); 570 | 571 | if (open_tabs.length > 0) { 572 | chrome.runtime.sendMessage({ 573 | message: "activate", 574 | urls: open_tabs, 575 | setting: window.settings[window.setting] 576 | } as ActivateMessage); 577 | } 578 | 579 | return true; 580 | } 581 | 582 | function allow_key(keyCode: number) { 583 | for (var i in window.settings) { 584 | if (window.settings[i]?.key == keyCode) { 585 | return true; 586 | } 587 | } 588 | return false; 589 | } 590 | 591 | 592 | function keydown(event: KeyboardEvent) { 593 | if (event.code != END_CODE && event.code != HOME_CODE) { 594 | window.key_pressed = event.keyCode; 595 | // turn menu off for linux 596 | if (window.os === OS_LINUX && allow_key(window.key_pressed)) { 597 | window.stop_menu = true; 598 | } 599 | } else { 600 | window.scroll_bug_ignore = true; 601 | } 602 | } 603 | 604 | function blur() { 605 | remove_key(); 606 | } 607 | 608 | function keyup(event: KeyboardEvent) { 609 | if (event.code != END_CODE && event.code != HOME_CODE) { 610 | remove_key(); 611 | } 612 | } 613 | 614 | function remove_key() { 615 | // turn menu on for linux 616 | if (window.os === OS_LINUX) { 617 | window.stop_menu = false; 618 | } 619 | window.key_pressed = 0; 620 | } 621 | 622 | 623 | function allow_selection() { 624 | for (var i in window.settings) { 625 | // need to check if key is 0 as key_pressed might not be accurate 626 | if ( 627 | window.settings[i]?.mouse == window.mouse_button 628 | && window.settings[i]?.key == window.key_pressed 629 | ) { 630 | window.setting = Number.parseInt(i, 10); 631 | if (window.box !== null) { 632 | window.box.style.border = "2px dotted " + window.settings[i]?.color; 633 | } 634 | return true; 635 | } 636 | } 637 | return false; 638 | } 639 | 640 | function contextmenu(event: MouseEvent) { 641 | if (window.stop_menu) { 642 | event.preventDefault(); 643 | } 644 | } 645 | -------------------------------------------------------------------------------- /media/Logo_CMYK.svg: -------------------------------------------------------------------------------- 1 | 2 | 34 | 36 | 40 | 50 | 53 | 56 | 59 | 63 | 67 | 71 | 75 | 79 | 83 | 87 | 91 | 95 | 99 | 103 | 107 | 111 | 115 | 116 | 118 | 120 | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | 160 | 161 | 165 | 173 | 177 | 181 | 185 | 189 | 193 | 197 | 201 | 205 | 206 | 210 | 211 | 213 | 221 | 225 | 229 | 233 | 237 | 241 | 245 | 249 | 253 | 254 | 258 | 267 | 271 | 275 | 279 | 283 | 287 | 291 | 295 | 299 | 300 | 305 | 313 | 317 | 321 | 325 | 329 | 333 | 337 | 341 | 345 | 346 | 350 | 358 | 362 | 366 | 370 | 374 | 378 | 382 | 386 | 390 | 391 | 392 | 400 | 404 | 408 | 412 | 416 | 420 | 424 | 428 | 432 | 433 | 437 | 438 | 439 | 440 | 443 | 446 | 450 | 454 | 458 | 462 | 466 | 470 | 474 | 478 | 482 | 486 | 490 | 494 | 498 | 502 | 503 | 506 | 508 | 516 | 520 | 524 | 528 | 532 | 536 | 540 | 544 | 548 | 549 | 553 | 561 | 565 | 569 | 573 | 577 | 581 | 585 | 589 | 593 | 594 | 598 | 599 | 601 | 610 | 614 | 618 | 622 | 626 | 630 | 634 | 638 | 642 | 643 | 648 | 656 | 660 | 664 | 668 | 672 | 676 | 680 | 684 | 688 | 689 | 693 | 694 | 695 | 696 | 699 | 701 | 705 | 709 | 713 | 717 | 721 | 725 | 729 | 733 | 737 | 741 | 745 | 749 | 753 | 757 | 758 | 761 | 769 | 773 | 777 | 781 | 785 | 789 | 793 | 797 | 801 | 802 | 806 | 810 | 818 | 822 | 826 | 830 | 834 | 838 | 842 | 846 | 850 | 851 | 855 | 857 | 865 | 869 | 873 | 877 | 881 | 885 | 889 | 893 | 894 | 898 | 906 | 910 | 914 | 918 | 922 | 926 | 930 | 934 | 935 | 939 | 940 | 941 | 942 | 945 | 947 | 951 | 955 | 959 | 963 | 967 | 971 | 975 | 979 | 983 | 987 | 991 | 995 | 999 | 1003 | 1004 | 1006 | 1008 | 1016 | 1020 | 1024 | 1028 | 1032 | 1036 | 1040 | 1044 | 1048 | 1049 | 1053 | 1061 | 1065 | 1069 | 1073 | 1077 | 1081 | 1085 | 1089 | 1093 | 1094 | 1098 | 1099 | 1107 | 1111 | 1115 | 1119 | 1123 | 1127 | 1131 | 1135 | 1139 | 1140 | 1144 | 1146 | 1154 | 1158 | 1162 | 1166 | 1170 | 1174 | 1178 | 1182 | 1186 | 1187 | 1191 | 1199 | 1203 | 1207 | 1211 | 1215 | 1219 | 1223 | 1227 | 1231 | 1232 | 1236 | 1237 | 1238 | 1239 | 1247 | 1251 | 1255 | 1259 | 1263 | 1267 | 1271 | 1275 | 1279 | 1280 | 1284 | Link clump 1299 | 1300 | -------------------------------------------------------------------------------- /src/libs/jquery-1.8.2.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v1.8.2 jquery.com | jquery.org/license */ 2 | (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
      a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
      t
      ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="

      ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
      ",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="

      ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
      ","
      "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
      ").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); --------------------------------------------------------------------------------