diff --git a/sources_non_forked/vim-autoformat/.gitattributes b/sources_non_forked/vim-autoformat/.gitattributes new file mode 100644 index 00000000..e08c83e7 --- /dev/null +++ b/sources_non_forked/vim-autoformat/.gitattributes @@ -0,0 +1,7 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.vim text +*.md text diff --git a/sources_non_forked/vim-autoformat/.github/ISSUE_TEMPLATE.md b/sources_non_forked/vim-autoformat/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..536abdc4 --- /dev/null +++ b/sources_non_forked/vim-autoformat/.github/ISSUE_TEMPLATE.md @@ -0,0 +1 @@ +Before you create an issue, please read and follow the troubleshooting steps [listed here](https://github.com/Chiel92/vim-autoformat#help-the-formatter-doesnt-work-as-expected). diff --git a/sources_non_forked/vim-autoformat/.gitignore b/sources_non_forked/vim-autoformat/.gitignore new file mode 100644 index 00000000..324a2e0c --- /dev/null +++ b/sources_non_forked/vim-autoformat/.gitignore @@ -0,0 +1,2 @@ +# Ignore vim swap files +*.swp diff --git a/sources_non_forked/vim-autoformat/LICENSE b/sources_non_forked/vim-autoformat/LICENSE new file mode 100644 index 00000000..0de73017 --- /dev/null +++ b/sources_non_forked/vim-autoformat/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Chiel ten Brinke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sources_non_forked/vim-autoformat/README.md b/sources_non_forked/vim-autoformat/README.md new file mode 100644 index 00000000..3ab89194 --- /dev/null +++ b/sources_non_forked/vim-autoformat/README.md @@ -0,0 +1,505 @@ +# vim-autoformat + +Format code with one button press (or automatically on save). + +This plugin makes use of external formatting programs to achieve the most decent results. +Check the list of formatprograms below to see which languages are supported by default. +Most formatprograms will obey vim settings, such as `textwidth` and `shiftwidth()`. +You can easily customize existing formatprogram definitions or add your own formatprogram. +When no formatprogram exists (or no formatprogram is installed) for a certain filetype, +vim-autoformat falls back by default to indenting, (using vim's auto indent functionality), retabbing and removing trailing whitespace. + +## Requirement +vim-autoformat requires vim to have python support (python 2 or python 3). You can check your vim has python support by running `:echo has("python3")` and `:echo has("python2")`. + +#### Neovim +Neovim does not come with python support by default, and additional setup is required. + +First install [pynvim](https://github.com/neovim/pynvim) +``` +python3 -m pip install pynvim +``` + +And add the following configuration in your `.vimrc` + +``` +let g:python3_host_prog="/path/to/python/executable/" +``` + + +## How to install + +#### Vundle + +Put this in your `.vimrc`. + +```vim +Plugin 'Chiel92/vim-autoformat' +``` + +Then restart vim and run `:PluginInstall`. Alternatively, you could run `:source $MYVIMRC` +to reload your `.vimrc` without restarting vim. +To update the plugin to the latest version, you can run `:PluginUpdate`. + +#### Pathogen + +Download the source and extract in your bundle directory. +Updating has to be done manually, as far as I'm aware. + +#### Other + +It is highly recommended to use a plugin manager such as Vundle, since this makes it easy to update plugins or uninstall them. +It also keeps your .vim directory clean. +Still you can decide to download this repository as a zip file or whatever and extract it to your .vim folder. + +## How to use + +First you should install an external program that can format code of the programming language you are using. +This can either be one of the programs that are listed below as defaultprograms, or a custom program. +For defaultprograms, vim-autoformat knows for which filetypes it can be used. +For using a custom formatprogram, read the text below *How can I change the behaviour of formatters, or add one myself?* +If the formatprogram you want to use is installed in one of the following ways, vim automatically detects it: + +* It suffices to make the formatprogram globally available, which is the case if you install it via your package manager. +* Alternatively you can point vim-autoformat to folders containing formatters, by putting the absolute paths to these folders in `g:formatterpath` in your .vimrc, like: + +```vim +let g:formatterpath = ['/some/path/to/a/folder', '/home/superman/formatters'] +``` + +Remember that when no formatprograms exists for a certain filetype, +vim-autoformat falls back by default to indenting, retabbing and removing trailing whitespace. +This will fix at least the most basic things, according to vim's indentfile for that filetype. + +When you have installed the formatter you need, you can format the entire buffer with the command `:Autoformat`. +You can provide the command with a file type such as `:Autoformat json`, otherwise the buffer's filetype will be used. + +Some formatters allow you to format only a part of the file, for instance `clang-format` and +`autopep8`. +To use this, provide a range to the `:Autoformat` command, for instance by visually selecting a +part of your file, and then executing `:Autoformat`. +For convenience it is recommended that you assign a key for this, like so: + +```vim +noremap :Autoformat +``` + +Or to have your code be formatted upon saving your file, you could use something like this: + +```vim +au BufWrite * :Autoformat +``` + +You can also format the current line only (without having to make a visual selection) by executing `:AutoformatLine`. + +To disable the fallback to vim's indent file, retabbing and removing trailing whitespace, set the following variables to 0. + +```vim +let g:autoformat_autoindent = 0 +let g:autoformat_retab = 0 +let g:autoformat_remove_trailing_spaces = 0 +``` + +To disable or re-enable these option for specific buffers, use the buffer local variants: +`b:autoformat_autoindent`, `b:autoformat_retab` and `b:autoformat_remove_trailing_spaces`. +So to disable autoindent for filetypes that have incompetent indent files, use + +```vim +autocmd FileType vim,tex let b:autoformat_autoindent=0 +``` + +You can manually autoindent, retab or remove trailing whitespace with the following respective +commands. + +```vim +gg=G +:retab +:RemoveTrailingSpaces +``` + +For each filetype, vim-autoformat has a list of applicable formatters. +If you have multiple formatters installed that are supported for some filetype, vim-autoformat +tries all formatters in this list of applicable formatters, until one succeeds. +You can set this list manually in your vimrc (see section *How can I change the behaviour of formatters, or add one myself?*, +or change the formatter with the highest priority by the commands `:NextFormatter` and `:PreviousFormatter`. +To print the currently selected formatter use `:CurrentFormatter`. +These latter commands are mostly useful for debugging purposes. +If you have a composite filetype with dots (like `django.python` or `php.wordpress`), +vim-autoformat first tries to detect and use formatters for the exact original filetype, and +then tries the same for all supertypes occurring from left to right in the original filetype +separated by dots (`.`). + +### Using multiple formatters for the same file + +It is possible to apply multiple formatters for single file, for example, html can use special formatters for js/css etc. +Support can be enabled via the `g:run_all_formatters_` option. + +In this case, formatters from `g:formatdef_` will be applied to the file one by one. Fallback (vim) formatting +isn't used if at least one formatter has finished sucessfully. + +Sample config: +```vim +let g:formatters_vue = ['eslint_local', 'stylelint'] +let g:run_all_formatters_vue = 1 +``` + +## Default formatprograms + +Here is a list of formatprograms that are supported by default, and thus will be detected and used by vim when they are installed properly. + +* `buildifier` for __bazel__ build files. (https://github.com/bazelbuild/buildtools/tree/master/buildifier) + +* `clang-format` for __C__, __C++__, __Objective-C__, __Protobuf__ (supports formatting ranges). + Clang-format is a product of LLVM source builds. + If you `brew install llvm`, clang-format can be found in /usr/local/Cellar/llvm/bin/. + Vim-autoformat checks whether there exists a `.clang-format` or a `_clang-format` file up in + the current directory's ancestry. Based on that it either uses that file or tries to match + vim options as much as possible. + Details: http://clang.llvm.org/docs/ClangFormat.html. + +* `astyle` for __C#__, __C++__, __C__ and __Java__. + Download it here: http://astyle.sourceforge.net/. + *Important: version `2.0.5` or higher is required, since only those versions correctly support piping and are stable enough.* + +* `dfmt` for __D__. + It can be built or downloaded from https://github.com/dlang-community/dfmt. + Arch Linux users can install it from the `community` repository with `pacman -S dfmt`. + If `dfmt` is not found in `PATH`, Vim-autoformat will try to use `dub run dfmt` command + to automatically download and run `dfmt`. + +* `autopep8` for __Python__ (supports formatting ranges). + It's probably in your distro's repository, so you can download it as a regular package. + For Ubuntu type `sudo apt-get install python-autopep8` in a terminal. + Here is the link to the repository: https://github.com/hhatto/autopep8. + And here the link to its page on the python website: http://pypi.python.org/pypi/autopep8/0.5.2. + +* `yapf` for __Python__ (supports formatting ranges). + Vim-autoformat checks whether there exists a `.style.yapf` or a `setup.cfg` file up in the current directory's ancestry. + Based on that it either uses that file or tries to match vim options as much as possible. + Most users can install with the terminal command `sudo pip install yapf` or `pip install --user yapf`. + YAPF has one optional configuration variable to control the formatter style. + For example: + + ```vim + let g:formatter_yapf_style = 'pep8' + ``` + + `pep8` is the default value, or you can choose: `google`, `facebook`, `chromium`. + + Here is the link to the repository: https://github.com/google/yapf + +* `black` for __Python__. + Most users can install with the terminal command `sudo pip install black` or `pip install --user black`. + Here is the link to the repository: https://github.com/ambv/black + +* `js-beautify` for __Javascript__ and __JSON__. + It can be installed by running `npm install -g js-beautify`. + Note that `nodejs` is needed for this to work. + The python version version is also supported by default, which does not need `nodejs` to run. + Here is the link to the repository: https://github.com/einars/js-beautify. + +* `JSCS` for __Javascript__. https://jscs-dev.github.io/ + +* `gnatpp` for __Ada__. http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gnat_ugn_unw/The-GNAT-Pretty_002dPrinter-gnatpp.html + +* `standard` for __Javascript__. + It can be installed by running `npm install -g standard` (`nodejs` is required). No more configuration needed. + More information about the style guide can be found here: http://standardjs.com/. + +* `ESlint` for __Javascript__. http://eslint.org/ + It can be installed by running `npm install eslint` for a local project or by running `npm install -g eslint` for global use. The linter is then installed locally at `$YOUR_PROJECT/node_modules/.bin/eslint` or globally at `~/.npm-global/bin/eslint`. + When running the formatter, vim will walk up from the current file to search for such local installation and a ESLint configuration file (either `.eslintrc.js` or `eslintrc.json`). When the local version is missing it will fallback to the global version in your home directory. When both requirements are found eslint is executed with the `--fix` argument. + Note that the formatter's name is still `eslint_local` for legacy reasons even though it already supports global `eslint`. + Currently only working on \*nix like OS (Linux, MacOS etc.) as it requires the OS to provide sh like shell syntax. + +* `xo` for __Javascript__. + It can be installed by running `npm install -g xo` (`nodejs` is required). + Here is the link to the repository: https://github.com/sindresorhus/xo. + +* `JuliaFormatter.jl` for __Julia__. + It can be installed by running `julia -e 'import Pkg; Pkg.add("JuliaFormatter")'`. You will need to install Julia and have the `julia` binary in your `PATH`. + See https://github.com/domluna/JuliaFormatter.jl for more information on how to configure `JuliaFormatter.jl`. + Note that since `vim-autoformat` works by running a subprocess, a new instance of Julia is instantiated every time it is invoked. + And since Julia needs to precompile the code to run `format_text`, this may block the vim instance while the subprocess is running. + Once Julia finishes executing, control will be handled back to the user and the formatted text will replaces the current buffer. + You can consider precompiling `JuliaFormatter.jl` to make this process faster (See [`PackageCompiler.jl`](https://github.com/JuliaLang/PackageCompiler.jl) for more information on that), + or consider using [a dedicated `JuliaFormatter.vim` plugin](https://github.com/kdheepak/JuliaFormatter.vim) that works asynchronously. + +* `html-beautify` for __HTML__. + It is shipped with `js-beautify`, which can be installed by running `npm install -g js-beautify`. + Note that `nodejs` is needed for this to work. + Here is the link to the repository: https://github.com/einars/js-beautify. + +* `css-beautify` for __CSS__. + It is shipped with `js-beautify`, which can be installed by running `npm install -g js-beautify`. + Note that `nodejs` is needed for this to work. + Here is the link to the repository: https://github.com/einars/js-beautify. + +* `stylelint` for __CSS__. https://stylelint.io/ + It can be installed by running `npm install stylelint stylelint-config-standard` for a local project or by running `npm install -g stylelint stylelint-config-standard` for global use. The linter is then installed locally at `$YOUR_PROJECT/node_modules/.bin/stylelint` or globally at `~/.npm-global/bin/stylelint`. + When running the formatter, vim will walk up from the current file to search for such local installation. When the local version is missing it will fallback to the global version in your home directory. When both requirements are found styelint is executed with the `--fix` argument. + Currently only working on \*nix like OS (Linux, MacOS etc.) as it requires the OS to provide sh like shell syntax. + +* `typescript-formatter` for __Typescript__. + `typescript-formatter` is a thin wrapper around the TypeScript compiler services. + It can be installed by running `npm install -g typescript-formatter`. + Note that `nodejs` is needed for this to work. + Here is the link to the repository: https://github.com/vvakame/typescript-formatter. + +* `haxe-formatter` for __Haxe__. + `haxe-formatter` is a thin wrapper around the haxelib formatter library. + It can be installed by running `haxelib install formatter`. + Here is the link to the repository: https://github.com/HaxeCheckstyle/haxe-formatter + +* `sass-convert` for __SCSS__. + It is shipped with `sass`, a CSS preprocessor written in Ruby, which can be installed by running `gem install sass`. + Here is the link to the SASS homepage: http://sass-lang.com/. + +* `tidy` for __HTML__, __XHTML__ and __XML__. + It's probably in your distro's repository, so you can download it as a regular package. + For Ubuntu type `sudo apt-get install tidy` in a terminal. + +* `rbeautify` for __Ruby__. + It is shipped with `ruby-beautify`, which can be installed by running `gem install ruby-beautify`. + Note that compatible `ruby-beautify-0.94.0` or higher version. + Here is the link to the repository: https://github.com/erniebrodeur/ruby-beautify. + This beautifier developed and tested with ruby `2.0+`, so you can have weird results with earlier ruby versions. + +* `rubocop` for __Ruby__. + It can be installed by running `gem install rubocop`. + Here is the link to the repository: https://github.com/bbatsov/rubocop + +* `gofmt` for __Golang__. + The default golang formatting program is shipped with the golang distribution. Make sure `gofmt` is in your PATH (if golang is installed properly, it should be). + Here is the link to the installation: https://golang.org/doc/install + An alternative formatter is [gofumpt](https://github.com/mvdan/gofumpt), which enforces a stricter format than `gofmt`. To enable `gofumpt` support, you should install it by running `go install mvdan.cc/gofumpt@latest`, and then change the default golang formatter by configuring `let g:formatters_go = ['gofumpt']`. + +* `rustfmt` for __Rust__. + It can be installed using `cargo`, the Rust package manager. Up-to-date installation instructions are on the project page: https://github.com/rust-lang/rustfmt#quick-start. + +* `dartfmt` for __Dart__. + Part of the Dart SDK (make sure it is on your PATH). See https://www.dartlang.org/tools/dartfmt/ for more info. + +* `perltidy` for __Perl__. + It can be installed from CPAN `cpanm Perl::Tidy` . See https://metacpan.org/pod/Perl::Tidy and http://perltidy.sourceforge.net/ for more info. + +* `stylish-haskell` for __Haskell__ + It can be installed using [`cabal`](https://www.haskell.org/cabal/) build tool. Installation instructions are available at https://github.com/jaspervdj/stylish-haskell#installation + +* `purty` for __Purescript__ + It can be installed using `npm install purty`. Further instructions available at https://gitlab.com/joneshf/purty + +* `remark` for __Markdown__. + A Javascript based markdown processor that can be installed with `npm install -g remark-cli`. More info is available at https://github.com/wooorm/remark. + +* `fprettify` for modern __Fortran__. + Download from [official repository](https://github.com/pseewald/fprettify). Install with `./setup.py install` or `./setup.py install --user`. + +* `mix format` for __Elixir__. + `mix format` is included with Elixir 1.6+. + +* `fixjson` for JSON. + It is a JSON file fixer/formatter for humans using (relaxed) JSON5. It fixes various failures while humans writing JSON and formats JSON codes. + It can be installed with `npm install -g fixjson`. More info is available at https://github.com/rhysd/fixjson. + +* `shfmt` for __Shell__. + A shell formatter written in Go supporting POSIX Shell, Bash and mksh that can be installed with `go get -u mvdan.cc/sh/cmd/shfmt`. See https://github.com/mvdan/sh for more info. + +* `fish_indent` for __Fish-shell__. + Fish shell builtin fish_indent formatter for fish shell script. + +* `luafmt` for __Lua__. + Install `luafmt` with `npm`. See https://github.com/trixnz/lua-fmt for more info. + +* `stylua` for __Lua__. + Install `stylua` with `cargo`. See https://github.com/JohnnyMorganz/StyLua for more info. + +* `sqlformat` for __SQL__. + Install `sqlparse` with `pip`. + +* `cmake-format` for __CMake__. + Install `cmake_format` with `pip`. See https://github.com/cheshirekow/cmake_format for more info. + +* `latexindent.pl` for __LaTeX__. + Installation instructions at https://github.com/cmhughes/latexindent.pl. On mac you can install it with `brew install latexindent`, then you have to add `let g:formatdef_latexindent = '"latexindent -"'` to `.vimrc`. + +* `ocamlformat` for __OCaml__. + OCamlFormat can be installed with opam: `opam install ocamlformat`. + Details: https://github.com/ocaml-ppx/ocamlformat. + We also provide `ocp-indent` as reserve formatter. + +* `asmfmt` for __Assembly__. + An assembly formatter. Can be installed with `go get -u github.com/klauspost/asmfmt/cmd/asmfmt`. See https://github.com/klauspost/asmfmt for more info. + +* `nixfmt` for __Nix__. + It can be installed from nixpkgs with `nix-env -iA nixpkgs.nixfmt`. See https://github.com/serokell/nixfmt for more. + +* `dhall format` for __Dhall__. + The standard formatter, bundled with the interpreter. See https://github.com/dhall-lang/dhall-lang for more info. + +* `terraform fmt` for __Terraform__. + The standard formatter included with Terraform. See https://www.terraform.io/docs/cli/commands/fmt.html for more info. + +* `packer fmt` for __Packer__. + The standard formatter included with Packer. See https://www.packer.io/docs/commands/fmt for more info. + +* `nginxfmt.py` for __NGINX__. + See https://github.com/slomkowski/nginx-config-formatter for more info. + +* `zigformat` for __Zig__. + It is an unofficial binary. You can find the installation instructions from the repo: [zigformat](https://github.com/Himujjal/zigformat) + +## Help, the formatter doesn't work as expected! + +If you're struggling with getting a formatter to work, it may help to set vim-autoformat in +verbose-mode. Vim-autoformat will then output errors on formatters that failed. +The value of g:autoformat_verbosemode could set as 0, 1 or 2. which means: +0: no message output. 1: only error message output. 2: all message output. + +```vim +let g:autoformat_verbosemode=1 +" OR: +let verbose=1 +``` + +To read all messages in a vim session type `:messages`. Since one cannot always easily copy +the contents of messages (e.g. for posting it in an issue), vim-autoformats command `:PutMessages` may +help. It puts the messages in the current buffer, allowing you to do whatever you want. + +#### Reporting bugs + +Please report bugs by creating an issue in this repository. +When there are problems with getting a certain formatter to work, provide the output of verbose +mode in the issue. + +## How can I change the behaviour of formatters, or add one myself? + +If you need a formatter that is not among the defaults, or if you are not satisfied with the default formatting behaviour that is provided by vim-autoformat, you can define it yourself. +*The formatprogram must read the unformatted code from the standard input, and write the formatted code to the standard output.* + +#### Basic definitions + +The formatprograms that available for a certain `` are defined in `g:formatters_`. +This is a list containing string identifiers, which point to corresponding formatter definitions. +The formatter definitions themselves are defined in `g:formatdef_` as a string +expression. +Defining any of these variable manually in your .vimrc, will override the default value, if existing. +For example, a complete definition in your .vimrc for C# files could look like this: + +```vim +let g:formatdef_my_custom_cs = '"astyle --mode=cs --style=ansi -pcHs4"' +let g:formatters_cs = ['my_custom_cs'] +``` + +In this example, `my_custom_cs` is the identifier for our formatter definition. +The first line defines how to call the external formatter, while the second line tells +vim-autoformat that this is the only formatter that we want to use for C# files. +*Please note the double quotes in `g:formatdef_my_custom_cs`*. +This allows you to define the arguments dynamically: + +```vim +let g:formatdef_my_custom_cs = '"astyle --mode=cs --style=ansi -pcHs".&shiftwidth' +let g:formatters_cs = ['my_custom_cs'] +``` + +Please notice that `g:formatdef_my_custom_cs` contains an expression that can be evaluated, as required. +As you see, this allows us to dynamically define some parameters. +In this example, the indent width that astyle will use, depends on the buffer local value of `&shiftwidth`, instead of being fixed at 4. +So if you're editing a csharp file and change the `shiftwidth` (even at runtime), the `g:formatdef_my_custom_cs` will change correspondingly. + +For the default formatprogram definitions, the options `expandtab`, `shiftwidth` and `textwidth` are taken into account whenever possible. +This means that the formatting style will match your current vim settings as much as possible. +You can have look look at the exact default definitions for more examples. +They are defined in `vim-autoformat/plugin/defaults.vim`. +As a small side note, in the actual defaults the function `shiftwidth()` is used instead of the +property. This is because it falls back to the value of `tabstop` if `shiftwidth` is 0. + +If you have a composite filetype with dots (like `django.python` or `php.wordpress`), +vim-autoformat internally replaces the dots with underscores so you can specify formatters +through `g:formatters_django_python` and so on. + +To override these options for a local buffer, use the buffer local variants: +`b:formatters_` and `b:formatdef_`. This can be useful, for example, when +working with different projects with conflicting formatting rules, with each project having settings +in its own vimrc or exrc file: + +```vim +let b:formatdef_custom_c='"astyle --mode=c --suffix=none --options=/home/user/special_project/astylerc"' +let b:formatters_c = ['custom_c'] +``` + +#### Ranged definitions + +If your format program supports formatting specific ranges, you can provide a format +definition which allows to make use of this. +The first and last line of the current range can be retrieved by the variables `a:firstline` and +`a:lastline`. They default to the first and last line of your file, if no range was explicitly +specified. +So, a ranged definition could look like this. + +```vim +let g:formatdef_autopep8 = "'autopep8 - --range '.a:firstline.' '.a:lastline" +let g:formatters_python = ['autopep8'] +``` + +This would allow the user to select a part of the file and execute `:Autoformat`, which +would then only format the selected part. + +## Contributing + +This project is community driven. I don't actively do development on vim-autoformat myself, +as it's current state fulfills my personal needs. +However, I will review pull requests and keep an eye on the general sanity of the code. + +If you have any improvements on this plugin or on this readme, if you have some +formatter definition that can be added to the defaults, or if you experience problems, please +open a pull request or an issue in this repository. + +## Major Change Log + +### October 2018 +* We also take the returncode of the formatter process into account, not just the presence of output on stderr. + +### March 2016 +* We don't use the option formatprg internally anymore, to always have the possible of using the default `gq` command. +* More fallback options have been added. + +### June 2015 + +* *Backward incompatible patch!* +* Multiple formatters per filetype are now supported. +* Configuration variable names changed. +* Using `gq` as alias for `:Autoformat` is no longer supported. +* `:Autoformat` now supports ranges. +* Composite filetypes are fully supported. + +### December 20 2013 + +* `html-beautify` is now the new default for HTML since it seems to be better maintained, and seems to handle inline javascript neatly. +* The `formatters/` folder is no longer supported anymore, because it is unnecessary. +* `js-beautify` can no longer be installed as a bundle, since it only makes this plugin unnecessarily complex. + +### March 27 2013 + +* The default behaviour of gq is enabled again by removing the fallback on auto-indenting. + Instead, the fallback is only used when running the command `:Autoformat`. + +### March 16 2013 + +* The options `expandtab`, `shiftwidth`, `tabstop` and `softtabstop` are not overwritten anymore. +* This obsoletes `g:autoformat_no_default_shiftwidth` +* `g:formatprg_args_expr_` is introduced. + +### March 13 2013 + +* It is now possible to prevent vim-autoformat from overwriting your settings for `tabstop`, `softtabstop`, `shiftwidth` and `expandtab` in your .vimrc. + +### March 10 2013 + +* When no formatter is installed or defined, vim will now auto-indent the file instead. This uses the indentfile for that specific filetype. + +### March 9 2013 + +* Customization of formatprograms can be done easily now, as explained in the readme. +* I set the default tabwidth to 4 for all formatprograms as well as for vim itself. +* phpCB has been removed from the defaults, due to code-breaking behaviour. diff --git a/sources_non_forked/vim-autoformat/plugin/autoformat.vim b/sources_non_forked/vim-autoformat/plugin/autoformat.vim new file mode 100644 index 00000000..c628772f --- /dev/null +++ b/sources_non_forked/vim-autoformat/plugin/autoformat.vim @@ -0,0 +1,404 @@ +" Function for getting the verbose mode level +function! s:GetVerboseMode(...) + let verbose = &verbose + if exists("g:autoformat_verbosemode ") + if g:autoformat_verbosemode > verbose + let verbose = g:autoformat_verbosemode + endif + endif + return verbose +endfunction + +" Function for finding the formatters for this filetype +" Result is stored in b:formatters +function! s:FindFormatters(...) + " Detect verbosity + let verbose = s:GetVerboseMode() + + " Extract filetype to be used + let ftype = a:0 ? a:1 : &filetype + " Support composite filetypes by replacing dots with underscores + let compoundtype = substitute(ftype, "[.]", "_", "g") + if ftype =~? "[.]" + " Try all super filetypes in search for formatters in a sane order + let ftypes = [compoundtype] + split(ftype, "[.]") + else + let ftypes = [compoundtype] + endif + + " Support multiple formatters per file type + let run_all_formatters_var = "g:run_all_formatters_".compoundtype + if exists(run_all_formatters_var) + let b:run_all_formatters = eval(run_all_formatters_var) + else + let b:run_all_formatters = 0 + endif + + " Warn for backward incompatible configuration + let old_formatprg_var = "g:formatprg_".compoundtype + let old_formatprg_args_var = "g:formatprg_args_".compoundtype + let old_formatprg_args_expr_var = "g:formatprg_args_expr_".compoundtype + if exists(old_formatprg_var) || exists(old_formatprg_args_var) || exists(old_formatprg_args_expr_var) + echohl WarningMsg | + \ echomsg "WARNING: the options g:formatprg_, g:formatprg_args_ and g:formatprg_args_expr_ are no longer supported as of June 2015, due to major backward-incompatible improvements. Please check the README for help on how to configure your formatters." | + \ echohl None + endif + + " Detect configuration for all possible ftypes + let b:formatters = [] + for supertype in ftypes + let formatters_var = "b:formatters_".supertype + if !exists(formatters_var) + let formatters_var = "g:formatters_".supertype + endif + if !exists(formatters_var) + " No formatters defined + if verbose > 0 + echoerr "No formatters defined for supertype ".supertype + endif + else + let formatters = eval(formatters_var) + if type(formatters) != type([]) + echoerr formatters_var." is not a list" + else + let b:formatters = b:formatters + formatters + endif + endif + endfor + + if len(b:formatters) == 0 + " No formatters defined + if verbose > 0 + echoerr "No formatters defined for filetype '".ftype."'." + endif + return 0 + endif + return 1 +endfunction + + +" Try all formatters, starting with the currently selected one, until one +" works. If none works, autoindent the buffer. +function! s:TryAllFormatters(...) range + " Detect verbosity + let verbose = s:GetVerboseMode() + + " Make sure formatters are defined and detected + if !call('FindFormatters', a:000) + " No formatters defined + if verbose > 0 + echomsg "No format definitions are defined for this filetype." + endif + call s:Fallback() + return 0 + endif + + " Make sure index exist and is valid + if !exists('b:current_formatter_index') + let b:current_formatter_index = 0 + endif + if b:current_formatter_index >= len(b:formatters) + let b:current_formatter_index = 0 + endif + + " Try all formatters, starting with selected one + let s:index = b:current_formatter_index + + " Save if at least one formatter was successful + let l:formatter_run_successfully = 0 + + while 1 + " Formatter definition must be existent + let formatdef_var = 'b:formatdef_'.b:formatters[s:index] + if !exists(formatdef_var) + let formatdef_var = 'g:formatdef_'.b:formatters[s:index] + endif + if !exists(formatdef_var) + echoerr "No format definition found in '".formatdef_var."'." + return 0 + endif + + " Eval twice, once for getting definition content, + " once for getting the final expression + let b:formatprg = eval(eval(formatdef_var)) + + if verbose > 1 + echomsg "Trying definition from ".formatdef_var + echomsg "Evaluated formatprg: ".b:formatprg + endif + + " Detect if +python or +python3 is available, and call the corresponding function + if !has("python") && !has("python3") + echohl WarningMsg | + \ echomsg "WARNING: vim has no support for python, but it is required to run the formatter!" | + \ echohl None + return 1 + endif + if has("python3") + if verbose > 1 + echomsg "Using python 3 code..." + endif + let success = s:TryFormatterPython3() + else + if verbose > 1 + echomsg "Using python 2 code..." + endif + let success = s:TryFormatterPython() + endif + + let s:index = (s:index + 1) % len(b:formatters) + + if success == 0 + if verbose > 1 + echomsg "Definition in '".formatdef_var."' was successful." + endif + " Check if we can run few formatters in row + if b:run_all_formatters == 1 + let l:formatter_run_successfully += 1 + if s:index != b:current_formatter_index + if verbose > 1 + echomsg "Running next chained formatter." + endif + endif + else + return 1 + endif + else + if verbose > 0 + echomsg "Definition in '".formatdef_var."' was unsuccessful." + endif + endif + + if s:index == b:current_formatter_index + if b:run_all_formatters == 1 && l:formatter_run_successfully >= 1 + if verbose > 1 + echomsg l:formatter_run_successfully." formatters were successfuly run." + endif + return 1 + else + if verbose > 0 + echomsg "No format definitions were successful." + endif + " Tried all formatters, none worked + call s:Fallback() + return 0 + endif + endif + endwhile +endfunction + +function! s:Fallback() + " Detect verbosity + let verbose = s:GetVerboseMode() + + if exists('b:autoformat_remove_trailing_spaces') ? b:autoformat_remove_trailing_spaces == 1 : g:autoformat_remove_trailing_spaces == 1 + if verbose > 1 + echomsg "Removing trailing whitespace..." + endif + call s:RemoveTrailingSpaces() + endif + + if exists('b:autoformat_retab') ? b:autoformat_retab == 1 : g:autoformat_retab == 1 + if verbose > 1 + echomsg "Retabbing..." + endif + retab + endif + + if exists('b:autoformat_autoindent') ? b:autoformat_autoindent == 1 : g:autoformat_autoindent == 1 + if verbose > 1 + echomsg "Autoindenting..." + endif + " Autoindent code + exe "normal! gg=G" + endif + +endfunction + + +" Call formatter +" If stderr is empty, apply result, return 0 +" Otherwise, return 1 + +" +python version +function! s:TryFormatterPython() + " Detect verbosity + let verbose = s:GetVerboseMode() + +python << EOF +import vim, subprocess, os +from subprocess import Popen, PIPE +text = os.linesep.join(vim.current.buffer[:]) + os.linesep +formatprg = vim.eval('b:formatprg') +verbose = bool(int(vim.eval('verbose'))) + +env = os.environ.copy() +if int(vim.eval('exists("g:formatterpath")')): + extra_path = vim.eval('g:formatterpath') + env['PATH'] = os.pathsep.join(extra_path) + os.pathsep + env['PATH'] + +# When an entry is unicode, Popen can't deal with it in Python 2. +# As a pragmatic fix, we'll omit that entry. +newenv = {} +for key,val in env.iteritems(): + if type(key) == type(val) == str: + newenv[key] = val +env=newenv +p = subprocess.Popen(formatprg, env=env, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) +stdoutdata, stderrdata = p.communicate(text) + +formattername = vim.eval('b:formatters[s:index]') +if stderrdata: + if verbose > 0: + print('Formatter {} has errors: {}'.format(formattername, stderrdata)) + vim.command('return 1') +elif p.returncode > 0: + if verbose > 0: + print('Formatter {} gives nonzero returncode: {}'.format(formattername, p.returncode)) + vim.command('return 1') +else: + # It is not certain what kind of line endings are being used by the format program. + # Therefore we simply split on all possible eol characters. + possible_eols = ['\r\n', os.linesep, '\r', '\n'] + + # Often shell commands will append a newline at the end of their output. + # It is not entirely clear when and why that happens. + # However, extra newlines are almost never required, while there are linters that complain + # about superfluous newlines, so we remove one empty newline at the end of the file. + for eol in possible_eols: + eol_len = len(eol) + if len(stdoutdata) > 0 and stdoutdata[-eol_len:] == eol: + stdoutdata = stdoutdata[:-eol_len] + + lines = [stdoutdata] + for eol in possible_eols: + lines = [splitline for line in lines for splitline in line.split(eol)] + + if vim.current.buffer[:] != lines: + vim.current.buffer[:] = lines +EOF + + return 0 +endfunction + +" +python3 version +function! s:TryFormatterPython3() + " Detect verbosity + let verbose = s:GetVerboseMode() + +python3 << EOF +import vim, subprocess, os +from subprocess import Popen, PIPE + +# The return code is `failure`, unless otherwise specified +vim.command('return 1') + +text = bytes(os.linesep.join(vim.current.buffer[:]) + os.linesep, 'utf-8') +formatprg = vim.eval('b:formatprg') +verbose = bool(int(vim.eval('verbose'))) +env = os.environ.copy() +if int(vim.eval('exists("g:formatterpath")')): + extra_path = vim.eval('g:formatterpath') + env['PATH'] = os.pathsep.join(extra_path) + os.pathsep + env['PATH'] + +try: + p = subprocess.Popen(formatprg, env=env, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) + stdoutdata, stderrdata = p.communicate(text) +except (BrokenPipeError, IOError): + if verbose > 0: + raise +else: + formattername = vim.eval('b:formatters[s:index]') + if stderrdata: + if verbose > 0: + print('Formatter {} has errors: {}'.format(formattername, stderrdata)) + elif p.returncode > 0: + if verbose > 0: + print('Formatter {} gives nonzero returncode: {}'.format(formattername, p.returncode)) + elif not stdoutdata: + if verbose > 0: + print('Formatter {} gives empty result: {}'.format(formattername, stderrdata)) + else: + # It is not certain what kind of line endings are being used by the format program. + # Therefore we simply split on all possible eol characters. + possible_eols = ['\r\n', os.linesep, '\r', '\n'] + + stdoutdata = stdoutdata.decode('utf-8') + + # Often shell commands will append a newline at the end of their output. + # It is not entirely clear when and why that happens. + # However, extra newlines are almost never required, while there are linters that complain + # about superfluous newlines, so we remove one empty newline at the end of the file. + for eol in possible_eols: + eol_len = len(eol) + if len(stdoutdata) > 0 and stdoutdata[-eol_len:] == eol: + stdoutdata = stdoutdata[:-eol_len] + + lines = [stdoutdata] + for eol in possible_eols: + lines = [splitline for line in lines for splitline in line.split(eol)] + + if vim.current.buffer[:] != lines: + vim.current.buffer[:] = lines + vim.command('return 0') +EOF +endfunction + + +" Create a command for formatting the entire buffer +" Save and recall window state to prevent vim from jumping to line 1 +" Write and read viminfo to restore marks +command! -nargs=? -range=% -complete=filetype -bar + \ Autoformat let winview=winsaveview()|wviminfo|,call s:TryAllFormatters()|call winrestview(winview)|rviminfo + +" Create a command for formatting a single line, or range of lines +" Save and recall window state to prevent vim from jumping to line 1 +" Write and read viminfo to restore marks +command! -nargs=? -range -complete=filetype -bar + \ AutoformatLine let winview=winsaveview()|wviminfo|,call s:TryAllFormatters()|call winrestview(winview)|rviminfo + + +" Functions for iterating through list of available formatters +function! s:NextFormatter() + call s:FindFormatters() + if !exists('b:current_formatter_index') + let b:current_formatter_index = 0 + endif + let b:current_formatter_index = (b:current_formatter_index + 1) % len(b:formatters) + echomsg 'Selected formatter: '.b:formatters[b:current_formatter_index] +endfunction + +function! s:PreviousFormatter() + call s:FindFormatters() + if !exists('b:current_formatter_index') + let b:current_formatter_index = 0 + endif + let l = len(b:formatters) + let b:current_formatter_index = (b:current_formatter_index - 1 + l) % l + echomsg 'Selected formatter: '.b:formatters[b:current_formatter_index] +endfunction + +function! s:CurrentFormatter() + call s:FindFormatters() + if !exists('b:current_formatter_index') + let b:current_formatter_index = 0 + endif + echomsg 'Selected formatter: '.b:formatters[b:current_formatter_index] +endfunction + +" Create commands for iterating through formatter list +command! NextFormatter call s:NextFormatter() +command! PreviousFormatter call s:PreviousFormatter() +command! CurrentFormatter call s:CurrentFormatter() + +" Other commands +function! s:RemoveTrailingSpaces() + let user_gdefault = &gdefault + try + set nogdefault + silent! %s/\s\+$ + finally + let &gdefault = user_gdefault + endtry +endfunction +command! RemoveTrailingSpaces call s:RemoveTrailingSpaces() diff --git a/sources_non_forked/vim-autoformat/plugin/defaults.vim b/sources_non_forked/vim-autoformat/plugin/defaults.vim new file mode 100644 index 00000000..39130124 --- /dev/null +++ b/sources_non_forked/vim-autoformat/plugin/defaults.vim @@ -0,0 +1,747 @@ + +" +" This file contains default settings and all format program definitions and links these to filetypes +" + + +" Vim-autoformat configuration variables +if !exists('g:autoformat_autoindent') + let g:autoformat_autoindent = 1 +endif + +if !exists('g:autoformat_retab') + let g:autoformat_retab = 1 +endif + +if !exists('g:autoformat_remove_trailing_spaces') + let g:autoformat_remove_trailing_spaces = 1 +endif + +if !exists('g:autoformat_verbosemode') + let g:autoformat_verbosemode = 0 +endif + + +" Ada +if !exists('g:formatdef_gnatpp') + let g:formatdef_gnatpp = "'cat > /tmp/adafile; gnatpp --pipe /tmp/adafile; rm -f /tmp/adafile'" +endif + +if !exists('g:formatters_ada') + let g:formatters_ada = ['gnatpp'] +endif + +" Python +if !exists('g:formatdef_autopep8') + " Autopep8 will not do indentation fixes when a range is specified, so we + " only pass a range when there is a visual selection that is not the + " entire file. See #125. + let g:formatdef_autopep8 = '"autopep8 -".(g:DoesRangeEqualBuffer(a:firstline, a:lastline) ? " --range ".a:firstline." ".a:lastline : "")." ".(&textwidth ? "--max-line-length=".&textwidth : "")' +endif + +" There doesn't seem to be a reliable way to detect if are in some kind of visual mode, +" so we use this as a workaround. We compare the length of the file against +" the range arguments. If there is no range given, the range arguments default +" to the entire file, so we return false if the range comprises the entire file. +function! g:DoesRangeEqualBuffer(first, last) + return line('$') != a:last - a:first + 1 +endfunction + +" Yapf supports multiple formatter styles: pep8, google, chromium, or facebook +if !exists('g:formatter_yapf_style') + let g:formatter_yapf_style = 'pep8' +endif +if !exists('g:formatdef_yapf') + let s:configfile_def = "'yapf -l '.a:firstline.'-'.a:lastline" + let s:noconfigfile_def = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.shiftwidth().(&textwidth ? ',column_limit:'.&textwidth : '').'}\" -l '.a:firstline.'-'.a:lastline" + let g:formatdef_yapf = "g:YAPFFormatConfigFileExists() ? (" . s:configfile_def . ") : (" . s:noconfigfile_def . ")" +endif + +function! g:YAPFFormatConfigFileExists() + return len(findfile(".style.yapf", expand("%:p:h").";")) || len(findfile("setup.cfg", expand("%:p:h").";")) || filereadable(exists('$XDG_CONFIG_HOME') ? expand('$XDG_CONFIG_HOME/yapf/style') : expand('~/.config/yapf/style')) +endfunction + +if !exists('g:formatdef_black') + let g:formatdef_black = '"black -q ".(&textwidth ? "-l".&textwidth : "")." -"' +endif + +if !exists('g:formatters_python') + let g:formatters_python = ['autopep8','yapf', 'black'] +endif + + +" C# +if !exists('g:formatdef_astyle_cs') + if filereadable('.astylerc') + let g:formatdef_astyle_cs = '"astyle --mode=cs --options=.astylerc"' + elseif filereadable(expand('~/.astylerc')) || exists('$ARTISTIC_STYLE_OPTIONS') + let g:formatdef_astyle_cs = '"astyle --mode=cs"' + else + let g:formatdef_astyle_cs = '"astyle --mode=cs --style=ansi --indent-namespaces -pcH".(&expandtab ? "s".shiftwidth() : "t")' + endif +endif + +if !exists('g:formatters_cs') + let g:formatters_cs = ['astyle_cs'] +endif + +if !exists('g:formatters_bzl') + let g:formatters_bzl = ['buildifier'] +endif + + +" Generic C, C++, Objective-C +if !exists('g:formatdef_clangformat') + let s:configfile_def = "'clang-format -lines='.a:firstline.':'.a:lastline.' --assume-filename=\"'.expand('%:p').'\" -style=file'" + let s:noconfigfile_def = "'clang-format -lines='.a:firstline.':'.a:lastline.' --assume-filename=\"'.expand('%:p').'\" -style=\"{BasedOnStyle: WebKit, AlignTrailingComments: true, '.(&textwidth ? 'ColumnLimit: '.&textwidth.', ' : '').'IndentWidth: '.shiftwidth().', TabWidth: '.&tabstop.', '.(&expandtab ? 'UseTab: Never' : 'UseTab: Always').'}\"'" + let g:formatdef_clangformat = "g:ClangFormatConfigFileExists() ? (" . s:configfile_def . ") : (" . s:noconfigfile_def . ")" +endif + +function! g:ClangFormatConfigFileExists() + return len(findfile(".clang-format", expand("%:p:h").";")) || len(findfile("_clang-format", expand("%:p:h").";")) || len(findfile("~/.clang-format", expand("%:p:h").";")) || len(findfile("~/_clang-format", expand("%:p:h").";")) +endfunction + + + +" C +if !exists('g:formatdef_astyle_c') + if filereadable('.astylerc') + let g:formatdef_astyle_c = '"astyle --mode=c --options=.astylerc"' + elseif filereadable(expand('~/.astylerc')) || exists('$ARTISTIC_STYLE_OPTIONS') + let g:formatdef_astyle_c = '"astyle --mode=c"' + else + let g:formatdef_astyle_c = '"astyle --mode=c --style=ansi -pcH".(&expandtab ? "s".shiftwidth() : "t")' + endif +endif + +if !exists('g:formatters_c') + let g:formatters_c = ['clangformat', 'astyle_c'] +endif + + +" C++ +if !exists('g:formatdef_astyle_cpp') + if filereadable('.astylerc') + let g:formatdef_astyle_cpp = '"astyle --mode=c --options=.astylerc"' + elseif filereadable(expand('~/.astylerc')) || exists('$ARTISTIC_STYLE_OPTIONS') + let g:formatdef_astyle_cpp = '"astyle --mode=c"' + else + let g:formatdef_astyle_cpp = '"astyle --mode=c --style=ansi -pcH".(&expandtab ? "s".shiftwidth() : "t")' + endif +endif + +if !exists('g:formatters_cpp') + let g:formatters_cpp = ['clangformat', 'astyle_cpp'] +endif + + +" Objective C +if !exists('g:formatters_objc') + let g:formatters_objc = ['clangformat'] +endif + + +" D +if !exists('g:formatdef_dfmt') + if executable('dfmt') + let s:dfmt_command = 'dfmt' + else + let s:dfmt_command = 'dub run -q dfmt --' + endif + + let s:configfile_def = '"' . s:dfmt_command . '"' + let s:noconfigfile_def = '"' . s:dfmt_command . ' -t " . (&expandtab ? "space" : "tab") . " --indent_size " . shiftwidth() . (&textwidth ? " --soft_max_line_length " . &textwidth : "")' + + let g:formatdef_dfmt = 'g:EditorconfigFileExists() ? (' . s:configfile_def . ') : (' . s:noconfigfile_def . ')' + let g:formatters_d = ['dfmt'] +endif + +function! g:EditorconfigFileExists() + return len(findfile(".editorconfig", expand("%:p:h").";")) +endfunction + + +" Protobuf +if !exists('g:formatters_proto') + let g:formatters_proto = ['clangformat'] +endif + + +" Java +if !exists('g:formatdef_astyle_java') + if filereadable('.astylerc') + let g:formatdef_astyle_java = '"astyle --mode=java --options=.astylerc"' + elseif filereadable(expand('~/.astylerc')) || exists('$ARTISTIC_STYLE_OPTIONS') + let g:formatdef_astyle_java = '"astyle --mode=java"' + else + let g:formatdef_astyle_java = '"astyle --mode=java --style=java -pcH".(&expandtab ? "s".shiftwidth() : "t")' + endif +endif + +if !exists('g:formatters_java') + let g:formatters_java = ['astyle_java'] +endif + + +" Javascript +if !exists('g:formatdef_jsbeautify_javascript') + if filereadable('.jsbeautifyrc') + let g:formatdef_jsbeautify_javascript = '"js-beautify"' + elseif filereadable(expand('~/.jsbeautifyrc')) + let g:formatdef_jsbeautify_javascript = '"js-beautify"' + else + let g:formatdef_jsbeautify_javascript = '"js-beautify -X -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")' + endif +endif + +if !exists('g:formatdef_jscs') + let g:formatdef_jscs = '"jscs -x"' +endif + +if !exists('g:formatdef_standard_javascript') + let g:formatdef_standard_javascript = '"standard --fix --stdin"' +endif + + +if !exists('g:formatdef_prettier') + let g:formatdef_prettier = '"prettier --stdin-filepath ".expand("%:p").(&textwidth ? " --print-width ".&textwidth : "")." --tab-width=".shiftwidth()' +endif + + +" This is an xo formatter (inspired by the above eslint formatter) +" To support ignore and overrides options, we need to use a tmp file +" So we create a tmp file here and then remove it afterwards +if !exists('g:formatdef_xo_javascript') + function! g:BuildXOLocalCmd() + let l:xo_js_tmp_file = fnameescape(tempname().".js") + let content = getline('1', '$') + call writefile(content, l:xo_js_tmp_file) + return "xo --fix ".l:xo_js_tmp_file." 1> /dev/null; exit_code=$? + \ cat ".l:xo_js_tmp_file."; rm -f ".l:xo_js_tmp_file."; exit $exit_code" + endfunction + let g:formatdef_xo_javascript = "g:BuildXOLocalCmd()" +endif + +function! s:NodeJsFindPathToExecFile(exec_name) + let l:path = fnamemodify(expand('%'), ':p') + " find formatter & config file + let l:prog = findfile('node_modules/.bin/'.a:exec_name, l:path.";") + if empty(l:prog) + let l:prog = findfile('~/.npm-global/bin/'.a:exec_name) + if empty(l:prog) + let l:prog = findfile('/usr/local/bin/'.a:exec_name) + endif + else + let l:prog = getcwd()."/".l:prog + endif + return l:prog +endfunction + +" Setup ESLint local. Setup is done on formatter execution if ESLint and +" corresponding config is found they are used, otherwiese the formatter fails. +" No windows support at the moment. +if !exists('g:formatdef_eslint_local') + " returns unique file name near original + function! g:BuildESLintTmpFile(path, ext) + let l:i = 0 + let l:result = a:path.'_eslint_tmp_'.l:i.a:ext + while filereadable(l:result) && l:i < 100000 + let l:i = l:i + 1 + let l:result = a:path.'_eslint_tmp_'.l:i.a:ext + endwhile + if filereadable(l:result) + echoerr "Temporary file could not be created for ".a:path + echoerr "Tried from ".a:path.'_eslint_tmp_0'.a:ext." to ".a:path.'_eslint_tmp_'.l:i.a:ext + return '' + endif + return l:result + endfunction + + function! g:BuildESLintLocalCmd() + let l:path = fnamemodify(expand('%'), ':p') + let l:ext = ".".expand('%:p:e') + let verbose = &verbose || g:autoformat_verbosemode == 1 + if has('win32') + return "(>&2 echo 'ESLint not supported on win32')" + endif + " find formatter & config file + let l:prog = s:NodeJsFindPathToExecFile('eslint') + + "initial + let l:cfg = findfile('.eslintrc.js', l:path.";") + + if empty(l:cfg) + let l:cfg_fallbacks = [ + \'.eslintrc.yaml', + \'.eslintrc.yml', + \'.eslintrc.json', + \'.eslintrc', + \] + + for i in l:cfg_fallbacks + let l:tcfg = findfile(i, l:path.";") + if !empty(l:tcfg) + break + endif + endfor + + if !empty(l:tcfg) + let l:cfg = fnamemodify(l:tcfg, ":p") + else + let l:cfg = findfile('~/.eslintrc.js') + for i in l:cfg_fallbacks + if !empty(l:cfg) + break + endif + let l:cfg = findfile("~/".i) + endfor + endif + endif + + if (empty(l:cfg) || empty(l:prog)) + if verbose > 0 + return "(>&2 echo 'No local or global ESLint program and/or config found')" + endif + return + endif + + " This formatter uses a temporary file as ESLint has not option to print + " the formatted source to stdout without modifieing the file. + let l:eslint_tmp_file = g:BuildESLintTmpFile(l:path, l:ext) + let content = getline('1', '$') + call writefile(content, l:eslint_tmp_file) + return l:prog." -c ".l:cfg." --fix ".l:eslint_tmp_file." 1> /dev/null; exit_code=$? + \ cat ".l:eslint_tmp_file."; rm -f ".l:eslint_tmp_file."; exit $exit_code" + endfunction + let g:formatdef_eslint_local = "g:BuildESLintLocalCmd()" +endif + +if !exists('g:formatters_javascript') + let g:formatters_javascript = [ + \ 'eslint_local', + \ 'jsbeautify_javascript', + \ 'jscs', + \ 'standard_javascript', + \ 'prettier', + \ 'xo_javascript', + \ 'stylelint', + \ ] +endif + +" Vue +if !exists('g:formatters_vue') + let g:formatters_vue = [ + \ 'eslint_local', + \ 'stylelint', + \ ] +endif + +" JSON +if !exists('g:formatdef_jsbeautify_json') + if filereadable('.jsbeautifyrc') + let g:formatdef_jsbeautify_json = '"js-beautify"' + elseif filereadable(expand('~/.jsbeautifyrc')) + let g:formatdef_jsbeautify_json = '"js-beautify"' + else + let g:formatdef_jsbeautify_json = '"js-beautify -".(&expandtab ? "s ".shiftwidth() : "t")' + endif +endif + +if !exists('g:formatdef_fixjson') + let g:formatdef_fixjson = '"fixjson"' +endif + +if !exists('g:formatters_json') + let g:formatters_json = [ + \ 'jsbeautify_json', + \ 'fixjson', + \ 'prettier', + \ ] +endif + + +" Julia +if !exists('g:formatdef_juliaformatter') + function! g:BuildJuliaCmd() + return 'julia -e "using JuliaFormatter; print(format_text(read(\"' . expand("%:p") . '\", String)))"' + endfunction + let g:formatdef_juliaformatter = 'g:BuildJuliaCmd()' +endif + +if !exists('g:formatters_julia') + let g:formatters_julia = ['juliaformatter'] +endif + + +" HTML +if !exists('g:formatdef_htmlbeautify') + let g:formatdef_htmlbeautify = '"html-beautify - -".(&expandtab ? "s ".shiftwidth() : "t").(&textwidth ? " -w ".&textwidth : "")' +endif + +if !exists('g:formatdef_tidy_html') + let g:formatdef_tidy_html = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".shiftwidth()." --vertical-space yes --tidy-mark no -wrap ".&textwidth' +endif + +if !exists('g:formatters_html') + let g:formatters_html = ['htmlbeautify', 'tidy_html', 'stylelint'] +endif + + + +" XML +if !exists('g:formatdef_tidy_xml') + let g:formatdef_tidy_xml = '"tidy -q -xml --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".shiftwidth()." --vertical-space yes --tidy-mark no -wrap ".&textwidth' +endif + +if !exists('g:formatters_xml') + let g:formatters_xml = ['tidy_xml'] +endif + +" SVG +if !exists('g:formatters_svg') + let g:formatters_svg = ['tidy_xml'] +endif + +" XHTML +if !exists('g:formatdef_tidy_xhtml') + let g:formatdef_tidy_xhtml = '"tidy -q --show-errors 0 --show-warnings 0 --force-output --indent auto --indent-spaces ".shiftwidth()." --vertical-space yes --tidy-mark no -asxhtml -wrap ".&textwidth' +endif + +if !exists('g:formatters_xhtml') + let g:formatters_xhtml = ['tidy_xhtml'] +endif + +" Ruby +if !exists('g:formatdef_rbeautify') + let g:formatdef_rbeautify = '"rbeautify ".(&expandtab ? "-s -c ".shiftwidth() : "-t")' +endif + +if !exists('g:formatdef_rubocop') + " The pipe to sed is required to remove some rubocop output that could not + " be suppressed. + let g:formatdef_rubocop = "'rubocop --auto-correct -o /dev/null -s '.bufname('%').' \| sed -n 2,\\$p'" +endif + +if !exists('g:formatters_ruby') + let g:formatters_ruby = ['rbeautify', 'rubocop'] +endif + + +" CSS + +" Setup stylelint. Setup is done on formatter execution +" if stylelint is found, otherwise the formatter fails. +" No windows support at the moment. +if !exists('g:formatdef_stylelint') + function! g:BuildStyleLintCmd() + let verbose = &verbose || g:autoformat_verbosemode == 1 + if has('win32') + return "(>&2 echo 'stylelint not supported on win32')" + endif + " find formatter + let l:prog = s:NodeJsFindPathToExecFile('stylelint') + + if (empty(l:prog)) + if verbose > 0 + return "(>&2 echo 'No local or global stylelint program found')" + endif + return + endif + + return l:prog." --fix --stdin --stdin-filename ".bufname('%') + endfunction + let g:formatdef_stylelint = "g:BuildStyleLintCmd()" +endif + + +if !exists('g:formatdef_cssbeautify') + let g:formatdef_cssbeautify = '"css-beautify -f - -s ".shiftwidth()' +endif + +if !exists('g:formatters_css') + let g:formatters_css = ['cssbeautify', 'prettier', 'stylelint'] +endif + +" SCSS +if !exists('g:formatdef_sassconvert') + let g:formatdef_sassconvert = '"sass-convert -F scss -T scss --indent " . (&expandtab ? shiftwidth() : "t")' +endif + +if !exists('g:formatters_scss') + let g:formatters_scss = ['sassconvert', 'prettier', 'stylelint'] +endif + +" Less +if !exists('g:formatters_less') + let g:formatters_less = ['prettier', 'stylelint'] +endif + +" Typescript +if !exists('g:formatdef_tsfmt') + let g:formatdef_tsfmt = "'tsfmt --stdin '.bufname('%')" +endif + +if !exists('g:formatters_typescript') + let g:formatters_typescript = ['tsfmt', 'prettier'] +endif + +" Haxe +if !exists('g:formatdef_haxe_formatter') + let g:formatdef_haxe_formatter = "'haxelib run formatter --stdin --source " . fnamemodify("%", ":p:h") . "'" +endif + +if !exists('g:formatters_haxe') + let g:formatters_haxe = ["haxe_formatter"] +endif + +" Golang +" Two definitions are provided for two versions of gofmt. +" See issue #59 +if !exists('g:formatdef_gofmt_1') + let g:formatdef_gofmt_1 = '"gofmt -tabs=".(&expandtab ? "false" : "true")." -tabwidth=".shiftwidth()' +endif + +if !exists('g:formatdef_gofmt_2') + let g:formatdef_gofmt_2 = '"gofmt"' +endif + +if !exists('g:formatdef_goimports') + let g:formatdef_goimports = '"goimports"' +endif + +if !exists('g:formatdef_gofumpt') + let g:formatdef_gofumpt = '"gofumpt"' +endif + +if !exists('g:formatters_go') + let g:formatters_go = ['gofmt_1', 'goimports', 'gofmt_2', 'gofumpt'] +endif + +" Rust +if !exists('g:formatdef_rustfmt') + let g:formatdef_rustfmt = '"rustfmt --edition 2018"' +endif + +if !exists('g:formatters_rust') + let g:formatters_rust = ['rustfmt'] +endif + +" Zig +if !exists('g:formatdef_zigfmt') + let g:formatdef_zigfmt = '"zig fmt --stdin"' +endif + +if !exists('g:formatters_zig') + let g:formatters_zig = ['zigfmt'] +endif + +" Dart +if !exists('g:formatdef_dart_format') + let g:formatdef_dart_format = '"dart format"' +endif + +if !exists('g:formatters_dart') + let g:formatters_dart = ['dart_format'] +endif + +" Perl +if !exists('g:formatdef_perltidy') + " use perltidyrc file if readable + if (has("win32") && (filereadable("perltidy.ini") || + \ filereadable($HOMEPATH."/perltidy.ini"))) || + \ ((has("unix") || + \ has("mac")) && (filereadable(".perltidyrc") || + \ filereadable(expand("~/.perltidyrc")) || + \ filereadable("/usr/local/etc/perltidyrc") || + \ filereadable("/etc/perltidyrc"))) + let g:formatdef_perltidy = '"perltidy -q -st"' + else + let g:formatdef_perltidy = '"perltidy --perl-best-practices --format-skipping -q "' + endif +endif + +if !exists('g:formatters_perl') + let g:formatters_perl = ['perltidy'] +endif + +" Haskell +if !exists('g:formatdef_stylish_haskell') + let g:formatdef_stylish_haskell = '"stylish-haskell"' +endif + +if !exists('g:formatters_haskell') + let g:formatters_haskell = ['stylish_haskell'] +endif + +" Purescript +if !exists('g:formatdef_purty') + let g:formatdef_purty = '"purty -"' +endif + +if !exists('g:formatters_purescript') + let g:formatters_purescript = ['purty'] +endif + +" Markdown +if !exists('g:formatdef_remark_markdown') + let g:formatdef_remark_markdown = '"remark --silent --no-color"' +endif + +if !exists('g:formatters_markdown') + let g:formatters_markdown = ['remark_markdown', 'prettier', 'stylelint'] +endif + +" Graphql +if !exists('g:formatters_graphql') + let g:formatters_graphql = ['prettier'] +endif + +" Fortran +if !exists('g:formatdef_fprettify') + let g:formatdef_fprettify = '"fprettify --no-report-errors --indent=".shiftwidth()' +endif + +if !exists('g:formatters_fortran') + let g:formatters_fortran = ['fprettify'] +endif + +" Elixir + +if !exists('g:formatters_elixir') + let s:configfile_def = '"mix format --dot-formatter " . findfile(".formatter.exs", expand("%:p:h").";") . " -"' + let s:noconfigfile_def = '"mix format -"' + + let g:formatdef_mix_format = 'g:ElixirconfigFileExists() ? (' . s:configfile_def . ') : (' . s:noconfigfile_def . ')' + let g:formatters_elixir = ['mix_format'] +endif + + +function! g:ElixirconfigFileExists() + return len(findfile(".formatter.exs", expand("%:p:h").";")) +endfunction + +" Shell +if !exists('g:formatdef_shfmt') + let g:formatdef_shfmt = '"shfmt -i ".(&expandtab ? shiftwidth() : "0")' +endif + +if !exists('g:formatters_sh') + let g:formatters_sh = ['shfmt'] +endif + +" Fish shell +if !exists('g:formatdef_fish_indent') + let g:formatdef_fish_indent = '"fish_indent"' +endif + +if !exists('g:formatters_fish') + let g:formatters_fish = ['fish_indent'] +endif + +" Lua +if !exists('g:formatdef_luafmt') + let g:formatdef_luafmt = "'luafmt --stdin '.bufname('%')" +endif +if !exists('g:formatdef_stylua') + let g:formatdef_stylua = "'stylua --search-parent-directories --stdin-filepath ' . expand('%:p') .' -- -'" +endif +if !exists('g:formatters_lua') + let g:formatters_lua = ['luafmt', 'stylua'] +endif + +" SQL +if !exists('g:formatdef_sqlformat') + let g:formatdef_sqlformat = '"sqlformat --reindent --indent_width ".shiftwidth()." --keywords upper --identifiers lower -"' +endif +if !exists('g:formatters_sql') + let g:formatters_sql = ['sqlformat'] +endif + +" CMake +if !exists('g:formatdef_cmake_format') + let g:formatdef_cmake_format = '"cmake-format - --tab-size ".shiftwidth()." ".(&textwidth ? "--line-width=".&textwidth : "")' +endif + +if !exists('g:formatters_cmake') + let g:formatters_cmake = ['cmake_format'] +endif + +" Latex +if !exists('g:formatdef_latexindent') + let g:formatdef_latexindent = '"latexindent.pl -"' +endif + +if !exists('g:formatters_latex') + let g:formatters_tex = ['latexindent'] +endif + +" OCaml +if !exists('g:formatdef_ocp_indent') + let g:formatdef_ocp_indent = '"ocp-indent"' +endif + +if !exists('g:formatdef_ocamlformat') + if filereadable('.ocamlformat') + let g:formatdef_ocamlformat = '"ocamlformat --enable-outside-detected-project --name " . expand("%:p") . " -"' + else + let g:formatdef_ocamlformat = '"ocamlformat --profile=ocamlformat --enable-outside-detected-project --name " . expand("%:p") . " -"' + endif +endif + +if !exists('g:formatters_ocaml') + let g:formatters_ocaml = ['ocamlformat', 'ocp_indent'] +endif + +" Assembly +if !exists('g:formatdef_asm_format') + let g:formatdef_asm_format = '"asmfmt"' +endif + +if !exists('g:formatters_asm') + let g:formatters_asm = ['asm_format'] +endif + +" Nix +if !exists('g:formatdef_nix_format') + let g:formatdef_nix_format = '"nixfmt"' +endif + +if !exists('g:formatters_nix') + let g:formatters_nix = ['nix_format'] +endif + +" Dhall +if !exists('g:formatdef_dhall_format') + let g:formatdef_dhall_format = '"dhall --ascii format"' +endif + +if !exists('g:formatters_dhall') + let g:formatters_dhall = ['dhall_format'] +endif + +" Terraform +if !exists('g:formatdef_terraform_format') + let g:formatdef_terraform_format = '"terraform fmt -"' +endif + +if !exists('g:formatters_terraform') + let g:formatters_terraform = ['terraform_format'] +endif + +" Packer +if !exists('g:formatdef_packer_format') + let g:formatdef_packer_format = '"packer fmt -"' +endif + +if !exists('g:formatters_packer') + let g:formatters_packer = ['packer_format'] +endif + +" Nginx +if !exists('g:formatdef_nginxfmt') + let g:formatdef_nginxfmt = '"nginxfmt.py -i ".shiftwidth()." -"' +endif + +if !exists('g:formatters_nginx') + let g:formatters_nginx = ['nginxfmt'] +endif diff --git a/sources_non_forked/vim-autoformat/plugin/utils.vim b/sources_non_forked/vim-autoformat/plugin/utils.vim new file mode 100644 index 00000000..e28b7b31 --- /dev/null +++ b/sources_non_forked/vim-autoformat/plugin/utils.vim @@ -0,0 +1,20 @@ + +" Simple python-based random number generator +function! g:RandomInt() +if has("python3") +python3 << EOF +import random +result = random.randrange(1, 1000000) +vim.command('return ' + str(result)) +EOF +else +python << EOF +import random +result = random.randrange(1, 1000000) +vim.command('return ' + str(result)) +EOF +endif +endfunction + +" Put the uncopyable messages text into the buffer +command! PutMessages redir @" | messages | redir END | put diff --git a/sources_non_forked/vim-autoformat/samples/csharp.cs b/sources_non_forked/vim-autoformat/samples/csharp.cs new file mode 100644 index 00000000..c1c072ae --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/csharp.cs @@ -0,0 +1,4 @@ +using System; class Program { static int Main(string[] args) { Console.WriteLine(args[0]); int i = 0; i++; return 0; } + public int Foo() { switch (1) { case 1: int i = 0; default: int j = 1; } + } +} diff --git a/sources_non_forked/vim-autoformat/samples/fortran.f90 b/sources_non_forked/vim-autoformat/samples/fortran.f90 new file mode 100644 index 00000000..6ae6a189 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/fortran.f90 @@ -0,0 +1,258 @@ +module prettify_selftest + implicit none + private + public :: dp, test_routine, & + test_function, test_type, str_function + integer, parameter :: dp = selected_real_kind ( 15 , 307) + type test_type + real (kind =dp ) :: r = 1.0d-3 + integer :: i + end type test_type + +contains + + + subroutine test_routine( & + r, i, j, k, l) + integer, intent(in) :: r, i, j, k + integer, intent (out) :: l + + l = test_function(r,i,j,k) + end & +subroutine + + pure function test_function(r, i, j, & + k) & + result(l) + integer, intent(in) :: r, i, j, k + integer :: l + + l=r + i +j +k + end function + function & + str_function(a) result(l) + character(len=*) :: a + integer :: l + + if(len(a)<5)then + l=0 + else + l=1 + endif +end function + +end module + +program example_prog + use example, only: dp, test_routine, test_function, test_type,str_function + + implicit none + integer :: r,i,j,k,l,my_integer,m + integer, dimension(5) :: arr + integer, dimension(20) :: big_arr +integer :: endif + type(test_type) :: t +real(kind=dp) :: r1, r2, r3, r4, r5, r6 + integer, pointer :: point + + point=> null( ) + +! 1) white space formatting ! +!***************************! +! example 1.1 + r=1;i=-2;j=3;k=4;l=5 + r2 = 0.0_dp; r3= 1.0_dp; r4 =2.0_dp; r5=3.0_dp; r6 = 4.0_dp + r1=-(r2**i*(r3+r5*(-r4)-r6))-2.e+2 + if( r.eq.2.and.r<=5) i=3 + write(*, *)(merge(3, 1, i<=2)) + write(*, *)test_function(r,i,j , k) + t % r = 4.0_dp + t%i = str_function( "t % i = " ) + +! example 1.2 + my_integer=2 + i=3 + j=5 + + big_arr = [1, 2, 3, 4, 5, & + 6, 7, 8, 9, 10, & + 11, 12, 13, 14, 15, & + 16, 17, 18, 19, 20] + +! example 1.3: disabling auto-formatter: + my_integer = 2 !& + i = 3 !& + j = 5 !& + +!&< + my_integer = 2 + i = 3 + j = 5 +!&> + + big_arr = [ 1, 2, 3, 4, 5, & !& + 6, 7, 8, 9, 10, & !& + 11, 12, 13, 14, 15, & !& + 16, 17, 18, 19, 20] !& + +! example 1.4: + + big_arr = [1, 2, 3, 4, 5,& + & 6, 7, 8, 9, 10, & + & 11, 12, 13, 14, 15,& + &16, 17, 18, 19, 20] + +! 2) auto indentation for loops ! +!*******************************! + +! example 2.1 + l = 0 + do r= 1 , 10 + select case (r) + case(1) + do_label: do i = 1,100 + if (i<=2) then + m =0 + do while(m <4) + m =m+1 + do k=1,3 + if (k==1) l =l +1 + end do + enddo + endif + enddo do_label + case ( 2 ) + l=i + j + k + end select + enddo + +! example 2.2 + do m = 1, 2 + do r = 1, 3 + write (*, *) r + do k = 1, 4 + do l = 1, 3 + do i = 4, 5 + do my_integer = 1, 1 + do j = 1, 2 + write (*, *) test_function(m, r, k, l) + i + enddo + enddo + enddo + enddo + enddo + enddo + enddo + +! 3) auto alignment for linebreaks ! +!************************************! + +! example 3.1 + l = test_function(1, 2, test_function(1, 2, 3, 4), 4) + 3 *(2+1) + + l = test_function (1, 2, test_function(1,2, 3, 4),4) +& + 3*(2+ 1 ) + + l = test_function(1, 2, & + test_function(1, 2, 3, 4), 4)+ & + 3 * (2+1) + + l = test_function(1, 2, & + test_function(1, 2, 3, & + 4), 4) + & + 3*(2 + 1) + +! example 3.2 + arr = [1, (/3,4, 5/), 6] + [ 1, 2,3, 4,5 ] + + arr = [1,(/ 3, 4, 5 /) , & + 6] +[1,2, 3, 4, 5 ] + + arr = [1,(/3,4,5/), & + 6]+ & + [1, 2, 3, 4, 5] + + arr = [1, (/3, 4, & + 5/), & + 6] + & + [1, 2,3, 4, 5 ] + +! example 3.3 + l = test_function(1, 2, & + 3, 4) + + l = test_function( & + 1, 2, 3, 4) + + arr = [1, 2, & + 3, 4, 5] + arr = [ & + 1, 2, 3, 4, 5] + +! 4) more complex formatting and tricky test cases ! +!**************************************************! + +! example 4.1 + l = 0 + do r = 1, 10 + select case ( r ) + case( 1) + do i=1,100;if (i<=2) then! comment + do j = 1,5 + do k= 1, 3 + l = l + 1 +! unindented comment + ! indented comment + end do; enddo + elseif ( .not. j ==4 ) then + my_integer = 4 + else + write (*,*) " hello" + endif + enddo + case(2 ) + l = i+ j + k + end select + enddo + +! example 4.2 + if ( & + l == & + 111) & + then + do k = 1, 2 + if (k == 1) & + l = test_function(1, & + test_function(r=4, i=5, & + j=6, k=test_function(1,2*(3*(1 +1)), str_function ( ")a!(b['(;=dfe"), & + 9) + & + test_function(1, 2, 3, 4)), 9, 10) & + ! test_function(1,2,3,4)),9,10) & + ! +13*str_function('') + str_function('"') + + 13*str_function('') + str_function('"') + end & ! comment + ! comment + do + endif + +! example 4.3 + arr = [1,( /3,4, & + 5 /),& + 6 ]+ & + [1,2, 3, 4,5] ; arr = [1, 2,& + 3, 4, 5] + +! example 4.4 + endif = 3 + if(endif==2)then + endif=5 + else if(endif==3)then + write(*,*)endif + endif + +! example 4.5 + do i=1,2;if(.true.)then + write(*, *)"hello" + endif; enddo + + end program diff --git a/sources_non_forked/vim-autoformat/samples/html.html b/sources_non_forked/vim-autoformat/samples/html.html new file mode 100644 index 00000000..9c61ccf9 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/html.html @@ -0,0 +1,4 @@ +Google Gebruikers van schermlezers kunnen hier klikken om Google Instant uit te schakelen.

diff --git a/sources_non_forked/vim-autoformat/samples/java.java b/sources_non_forked/vim-autoformat/samples/java.java new file mode 100644 index 00000000..106a31ad --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/java.java @@ -0,0 +1 @@ +public class Blastoff{ public static void main(String[] args) { public static void countdown(int n, int m) { if (n == 0) { System.out.println("Blastoff!"); } else { System.out.println(n); countdown(n - 1); } } }} diff --git a/sources_non_forked/vim-autoformat/samples/js.js b/sources_non_forked/vim-autoformat/samples/js.js new file mode 100644 index 00000000..b8eeb962 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/js.js @@ -0,0 +1,10173 @@ +(function() { var a, b = window.T, c = "http"; scheme = c + "://", host = + "open.t.qq.com", a = { name: "Tencent weibo SDK", version: "1.0", + appkey: { value: "{APPKEY}", version: "{APPKEY_VERSION}", + verified: !1 }, debug: !0, pingback: !0, _domain: { + api: scheme + host + "{API_URI}", auth: scheme + + host + "{AUTH_URI}", query: scheme + host + "{QUERY_TOKEN_URI}", +exchange: scheme + host + "{EXCHANGE_TOKEN_URI}", flashproxy: scheme + host + + "{FLASHPROXY_URI}", serverproxy: scheme + host + "{SERVERPROXY_URI}", +clientproxy: "{CLIENTPROXY_URI}" }, _const: { AUTH_WINDOW_NAME: + "authClientProxy_ee5a0f93", AUTH_WINDOW_WIDTH: 575, AUTH_WINDOW_HEIGHT: + 465 }, _cookie: { names: { accessToken: "QQWBToken", refreshToken: + "QQWBRefreshToken" }, path: "/", domain: "" }, noConflict: + function() { return b && (window.T = b), a }, copy: function(a, b, c, + d) { for (var e in b) if (c || typeof a[e] == "undefined") a[e] + = d ? d(b[e]) : b[e]; return a }, create: function(a, + b) { var c = this, d = a ? a.split(".") : [], e + = d.length; for (var f = 0; f < e; f++) +{ var g = d[f], h = c[g]; h || (h = b && f + 1 === e ? b : {}, c[g] = h), c = h +} return c }, extend: function(b, c, d) { return a.copy(typeof b == "string" ? + a.create.call(this, b) : b, c, d) }, _alias: function(b, c) { c = c || + a; if (typeof b == "string") this[b] = c; else if + (Object.prototype.toString.call(b) === "[object + Array]") for (var d = 0, e = b.length; d < e; d++) + this[b[d]] = c }, alias: function(b, c) { a._alias(b, + a[c]) }, assign: function(a, b, c) { + var d = this, e = d, f = a ? + a.split(".") : [], g = + f.length; for (var h = + 0; h < + g; + h++) { + var + i + = + f[h], + j + = + d[i]; + if + (!j) + throw + new + Error("Tencent + weibo + SDK: + [ERROR] + no + such + name + " + + + i); + e + = + d, + d + = + j + } if + (typeof d == "string") e[i] = + d.replace(new + RegExp("\\{" + + + b + + + "\\}", + "ig"), + c); + else if (typeof d == "object") + for (var k in d) + d.hasOwnProperty(k) + && + typeof + d[k] + == + "string" + && + (d[k] + = + d[k].replace(new + RegExp("\\{" + + + b + + + "\\}", + "ig"), + c)) + }, uid: function() { return + Math.random().toString(16).substr(2) + } }, a.alias("provide", "create"), + a._alias.call(window, ["QQWB", "T"], + a), + a.assign("_domain", "API_URI", + "/api"), + a.assign("_domain", "AUTH_URI", + "/oauth2_html/login.php"), + a.assign("_domain", "SERVERPROXY_URI", + "/open-js/proxy.html"), + a.assign("_domain", "FLASHPROXY_URI", + "/open-js/proxy_v15.swf"), + a.assign("_domain", + "EXCHANGE_TOKEN_URI", + "/cgi-bin/exchange_token"), + a.assign("_domain", "QUERY_TOKEN_URI", + "/cgi-bin/auto_token") + })(), QQWB.extend("String", { + _trimLeft: /^\s+/, _trimRight: + /\s+$/, isString: function(a) + { return typeof a == "string" }, + ltrim: function(a) { return a == null + ? "" : + a.toString().replace(this._trimLeft, + "") }, rtrim: + function(a) { return a == null + ? "" : + a.toString().replace(this._trimRight, + "") }, trim: + String.prototype.trim ? + function(a) { return a == null + ? "" : + String.prototype.trim.call(a) + } : function(a) { return a == + null ? "" : + a.toString().replace(this._trimLeft, + "").replace(this._trimRight, + "") }, + startsWith: + String.prototype.startsWith + ? function(a, + b) + { return a == + null ? + !1 + : + String.prototype.startsWith.call(a, + b) + } : + function(a, b) { return a == null ? !1 + : a.toString().indexOf(b) == 0 + }, endsWith: String.prototype.endsWith + ? function(a, b) { return a == null ? + !1 : + String.prototype.endsWith.call(a, + b) } : + function(a, b) { + return a == + null ? + !1 : + a.toString().lastIndexOf(b) + >= 0 + && + a.toString().lastIndexOf(b) + + + b.length + == + a.length + } }), + QQWB.extend("_const", + { + HTTP_METHOD_GET: + "GET", + HTTP_METHOD_POST: + "POST", + HTTP_METHOD_GET_OR_POST: + "GET | POST", + API_CATEGORY_TIMELINE: + "时间线", + API_CATEGORY_WEIBO: + "微博相关", + API_CATEGORY_ACCOUNT: + "账户相关", + API_CATEGORY_RELATION: + "关系链相关", + API_CATEGORY_SIXIN: + "私信相关", + API_CATEGORY_SEARCH: + "搜索相关", + API_CATEGORY_TRENS: + "热度趋势", + API_CATEGORY_QUERY: + "查看数据", + API_CATEGORY_FAVORITE: + "数据收藏", + API_CATEGORY_TOPIC: + "话题相关", + API_CATEGORY_TAG: + "标签相关", + API_CATEGORY_OTHER: + "其他", + API_NO_DESCRIPTION: + "暂时没有关于此参数的说明", + API_NO_DEFAULT_VALUE: + "", + COMMON_NULL: null, + COMMON_EMPTY_STRING: + "" }), + QQWB.extend("_apiProvider", + { + _apiRetError: + { 1: + "参数错误", + 2: "频率受限", + 3: "鉴权失败", + 4: "内部错误" + }, + _apiErrorCode: + { 4: + "过多脏话", + 5: "禁止访问", + 6: + "记录不存在", + 8: "内容过长", + 9: + "内容包含垃圾信息", + 10: + "发表太快,频率限制", + 11: + "源消息不存在", + 12: + "未知错误", + 13: "重复发表" + }, + _apiParseRetCode: + function(a) + { var + b + = + a.match(/\"ret\":(\d+)\}/) + || + a.match(/(\d+)<\/ret>/); + return + b + ? + parseInt(b[1], + 10) + : + b + }, + _apiParseErrorCode: + function(a) + { var + b + = + a.match(/\"errcode\":(-?\d+)/) + || + a.match(/(\d+)<\/errcode>/); + return + b + ? + parseInt(b[1], + 10) + : + b + }, + _apiGetErrorMessage: + function(a, + b) + { var + c + = + [], + a + = + a + + + "", + b + = + b + + + "", + d + = + QQWB._apiProvider._apiRetError[a], + e + = + QQWB._apiProvider._apiErrorCode[b]; + return + d + && + c.push(d), + e + && + c.push(e), + c.length + > + 0 + ? + c.join(",") + : + "未知错误" + }, + apis: { + "/statuses/home_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "主页时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/home_timeline_vip": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "vip用户时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "2", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/public_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "广播大厅时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pos: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/user_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "其他用户发表时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/mentions_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "@提到我的时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "0x1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/ht_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "话题时间线", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + httext: + { + defaultValue: + "pBoard", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pageinfo: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/broadcast_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "我发表时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/special_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "特别收听的人发表时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/broadcast_timeline_ids": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "我发表时间线索引", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/home_timeline_ids": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "首页时间线索引", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/mentions_timeline_ids": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "提及我的时间线索引", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/user_timeline_ids": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "用户发表时间线索引", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/users_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "多用户发表时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + names: + { + defaultValue: + "t,api_weibo", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/users_timeline_ids": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "多用户发表时间线索引", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + names: + { + defaultValue: + "t,api_weibo", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/area_timeline": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "同城发表时间线", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pos: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + country: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + province: + { + defaultValue: + 11, + description: + QQWB._const.API_NO_DESCRIPTION + }, + city: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/statuses/ht_timeline_ext": + { + category: + QQWB._const.API_CATEGORY_TIMELINE, + description: + "话题时间线(修复翻页问题)", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 10, + description: + QQWB._const.API_NO_DESCRIPTION + }, + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + flag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + httext: + { + defaultValue: + "iweibo", + description: + QQWB._const.API_NO_DESCRIPTION + }, + htid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/show": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "获取一条微博数据", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + id: + { + defaultValue: + 51545056800467, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "发表一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/del": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "删除一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + id: + { + defaultValue: + 94035056272295, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/re_add": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "转播一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reid: + { + defaultValue: + 77048060858014, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/reply": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "回复一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reid: + { + defaultValue: + 77048060858014, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add_pic": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "发表一条图片微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pic: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add_emotion": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "发表一条心情微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + signtype: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/re_count": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "转播数或点评数", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + ids: + { + defaultValue: + 0xb04fd23c98500000, + description: + QQWB._const.API_NO_DESCRIPTION + }, + flag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/re_list": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "获取单条微博的转发和点评列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + flag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + rootid: + { + defaultValue: + 92035070199751, + description: + QQWB._const.API_NO_DESCRIPTION + }, + pageflag: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + "2", + description: + QQWB._const.API_NO_DESCRIPTION + }, + twitterid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/comment": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "点评一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reid: + { + defaultValue: + 28135069067568, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add_music": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "发表音频微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + url: + { + defaultValue: + "http://url.cn", + description: + QQWB._const.API_NO_DESCRIPTION + }, + title: + { + defaultValue: + "歌名", + description: + QQWB._const.API_NO_DESCRIPTION + }, + author: + { + defaultValue: + "演唱者", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reid: + { + defaultValue: + 12345678, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add_video": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "发表视频微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + url: + { + defaultValue: + "http://url.cn", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add_video": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "发表视频微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + url: + { + defaultValue: + "http://url.cn", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/getvideoinfo": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "获取视频信息", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + url: + { + defaultValue: + "http://v.youku.com/v_show/id_XMjExODczODM2.html", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/list": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "根据微博ID批量得到微博数据", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + ids: + { + defaultValue: + "39110101242147,39578069128701", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/add_video_prev": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "预发表一条视频微博", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + vid: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + title: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/t/sub_re_count": + { + category: + QQWB._const.API_CATEGORY_WEIBO, + description: + "获取转播的再次转播数", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + ids: + { + defaultValue: + "8171051658365,55054116813124", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/info": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "获取自己的详细资料", + supportMethod: + QQWB._const.HTTP_METHOD_GET + }, + "/user/update": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "更新个人资料", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + nick: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + sex: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + year: + { + defaultValue: + 2e3, + description: + QQWB._const.API_NO_DESCRIPTION + }, + month: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + day: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + countrycode: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + provincecode: + { + defaultValue: + 11, + description: + QQWB._const.API_NO_DESCRIPTION + }, + citycode: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + introduction: + { + defaultValue: + "xxxx", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/update_edu": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "更新个人教育信息", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + year: + { + defaultValue: + 1995, + description: + QQWB._const.API_NO_DESCRIPTION + }, + level: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + schoolid: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + field: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + departmentid: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/update_head": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "更新个人资料头像", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + pic: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/other_info": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "获取其他人资料", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/infos": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "多用户信息", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + names: + { + defaultValue: + "t,api_weibo", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/verify": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "验证账户是否合法(是否注册微博)", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/user/emotion": + { + category: + QQWB._const.API_CATEGORY_ACCOUNT, + description: + "获取心情微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + id: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + timstamp: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + contenttype: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + accesslevel: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + emotiontype: + { + defaultValue: + "0xFFFFFFFF", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 10, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/fanslist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "我的听众列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/idollist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "我收听的人列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/blacklist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "黑名单列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/speciallist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "特别收听列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/add": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "收听某个用户", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/del": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "取消收听某个用户", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/addspecial": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "特别收听某个用户", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/delspecial": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "取消特别收听某个用户", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/addblacklist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "添加某个用户到黑名单", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/delblacklist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "从黑名单中删除某个用户", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/check": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "检查是否我的听众或收听的人", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + names: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + }, + flag: + { + defaultValue: + "2", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/user_fanslist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "其他账户听众列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 30, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/user_idollist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "其他账户收听的人列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 30, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/user_speciallist": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "其他账户特别收听的人列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 30, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + name: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/fanslist_s": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "多听众列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 100, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/idollist_s": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "多收听人列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 100, + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/friends/mutual_list": + { + category: + QQWB._const.API_CATEGORY_RELATION, + description: + "互听关系链列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + name: + { + defaultValue: + "t", + description: + QQWB._const.API_NO_DESCRIPTION + }, + startindex: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 30, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/private/add": + { + category: + QQWB._const.API_CATEGORY_SIXIN, + description: + "发私信", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + content: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + clientip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + jing: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + wei: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + name: + { + defaultValue: + "mmplayer", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/private/del": + { + category: + QQWB._const.API_CATEGORY_SIXIN, + description: + "删除一条私信", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + id: + { + defaultValue: + 26154115313103, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/private/recv": + { + category: + QQWB._const.API_CATEGORY_SIXIN, + description: + "收件箱", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/private/send": + { + category: + QQWB._const.API_CATEGORY_SIXIN, + description: + "发件箱", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/search/user": + { + category: + QQWB._const.API_CATEGORY_SEARCH, + description: + "搜索用户", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + keyword: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagesize: + { + defaultValue: + 10, + description: + QQWB._const.API_NO_DESCRIPTION + }, + page: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/search/t": + { + category: + QQWB._const.API_CATEGORY_SEARCH, + description: + "搜索微博", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + keyword: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagesize: + { + defaultValue: + 10, + description: + QQWB._const.API_NO_DESCRIPTION + }, + page: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/search/userbytag": + { + category: + QQWB._const.API_CATEGORY_SEARCH, + description: + "通过标签搜索用户", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + keyword: + { + defaultValue: + "test", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagesize: + { + defaultValue: + 10, + description: + QQWB._const.API_NO_DESCRIPTION + }, + page: + { + defaultValue: + "1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/trends/ht": + { + category: + QQWB._const.API_CATEGORY_TRENS, + description: + "话题热榜", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + type: + { + defaultValue: + "3", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + pos: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/trends/t": + { + category: + QQWB._const.API_CATEGORY_TRENS, + description: + "热门转播", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + pos: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/info/update": + { + category: + QQWB._const.API_CATEGORY_QUERY, + description: + "更新条数", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + op: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + type: + { + defaultValue: + "9", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/fav/addt": + { + category: + QQWB._const.API_CATEGORY_FAVORITE, + description: + "收藏一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + id: + { + defaultValue: + 123456789, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/fav/delt": + { + category: + QQWB._const.API_CATEGORY_FAVORITE, + description: + "取消收藏一条微博", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + id: + { + defaultValue: + 123456789, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/fav/list_t": + { + category: + QQWB._const.API_CATEGORY_FAVORITE, + description: + "收藏的微博列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + nexttime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + prevtime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/fav/addht": + { + category: + QQWB._const.API_CATEGORY_FAVORITE, + description: + "订阅话题", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + id: + { + defaultValue: + 123456789, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/fav/delht": + { + category: + QQWB._const.API_CATEGORY_FAVORITE, + description: + "取消收藏话题", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + id: + { + defaultValue: + 123456789, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/fav/list_ht": + { + category: + QQWB._const.API_CATEGORY_FAVORITE, + description: + "获取已订阅话题列表", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + reqnum: + { + defaultValue: + 20, + description: + QQWB._const.API_NO_DESCRIPTION + }, + pageflag: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + pagetime: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + }, + lastid: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/ht/ids": + { + category: + QQWB._const.API_CATEGORY_TOPIC, + description: + "根据话题名称查询话题ID", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + httexts: + { + defaultValue: + "abc,efg", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/ht/info": + { + category: + QQWB._const.API_CATEGORY_TOPIC, + description: + "根据话题ID获取话题相关微博", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + ids: + { + defaultValue: + 0xb04fd23c98500000, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/tag/add": + { + category: + QQWB._const.API_CATEGORY_TAG, + description: + "添加标签", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + tag: + { + defaultValue: + "snow", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/tag/del": + { + category: + QQWB._const.API_CATEGORY_TAG, + description: + "删除标签", + supportMethod: + QQWB._const.HTTP_METHOD_POST, + supportParams: + { + tagid: + { + defaultValue: + 0x4735d427dffb9400, + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/other/kownperson": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "我可能认识的人", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + ip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + }, + country_code: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + province_code: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + }, + city_code: + { + defaultValue: + "", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/other/kownperson": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "可能认识的人", + supportMethod: + QQWB._const.HTTP_METHOD_GET + }, + "/other/shorturl": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "短URL转长URL", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + url: + { + defaultValue: + "3M6GSa", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/other/get_emotions": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "获取表情接口", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + type: + { + defaultValue: + "0", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/other/kownperson": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "我可能认识的人", + supportMethod: + QQWB._const.HTTP_METHOD_GET, + supportParams: + { + ip: + { + defaultValue: + "127.0.0.1", + description: + QQWB._const.API_NO_DESCRIPTION + } + } + }, + "/other/videokey": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "获取视频上传的key", + supportMethod: + QQWB._const.HTTP_METHOD_GET + }, + "/other/gettopreadd": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "一键转播热门排行", + supportMethod: + QQWB._const.HTTP_METHOD_GET + }, + "/other/url_converge": + { + category: + QQWB._const.API_CATEGORY_OTHER, + description: + "短url聚合", + supportMethod: + QQWB._const.HTTP_METHOD_GET + } }, + getDescriptor: + function(a) + { + return + this.apis[a] + }, + isProvide: + function(a) + { + return + !!this.getDescriptor(a) + }, + describe: + function(a) + { var + b + = + this.getDescriptor(a); + return + b + ? + b.category + + + ">" + + + b.description + : + "" + }, + compat: + function(a) + { + return + !QQWB.String.startsWith(a, + "/") + && + (a + = + "/" + + + a), + a.toLowerCase() + } }); +var JSON; JSON || (JSON = {}), function() { function f(a) { return a < 10 ? "0" + + a : a } + + function quote(a) { return escapable.lastIndex = 0, escapable.test(a) ? '"' + + a.replace(escapable, function(a) { var b = meta[a]; return typeof + b == "string" ? b : "\\u" + ("0000" + + a.charCodeAt(0).toString(16)).slice(-4) }) + '"' : + '"' + a + '"' } + + function str(a, b) { var c, d, e, f, g = gap, h, i = b[a]; i && typeof i == + "object" && typeof i.toJSON == "function" && (i = i.toJSON(a)), + typeof rep == "function" && (i = rep.call(b, a, i)); switch (typeof + i) { case "string": return quote(i); case "number": + return isFinite(i) ? String(i) : "null"; + case "boolean": case "null": return + String(i); + case "object": if (!i) return "null"; gap + += indent, h = []; + if + (Object.prototype.toString.apply(i) + === "[object + Array]") { f = + i.length; + for (c = 0; c < f; c += 1) + h[c] = str(c, i) || + "null"; + return e = h.length === 0 ? + "[]" : gap ? "[\n" + + gap + h.join(",\n" + + gap) + + "\n" + g + "]" : + "[" + h.join(",") + + "]", gap = g, e } if + (rep && typeof rep + == "object") { f = + rep.length; + for (c = 0; + c + < + f; + c + += + 1) + typeof + rep[c] + == + "string" + && + (d + = + rep[c], + e + = + str(d, + i), + e + && + h.push(quote(d) + + + (gap + ? + ": + " + : + ":") + + + e)) + } else for (d in i) + Object.prototype.hasOwnProperty.call(i, + d) + && + (e + = + str(d, + i), + e + && + h.push(quote(d) + + + (gap + ? + ": + " + : + ":") + + + e)); + return e = h.length + === 0 ? + "{}" : gap + ? "{\n" + + gap + + h.join(",\n" + + + gap) + + "\n" + g + + "}" : "{" + + + h.join(",") + + "}", gap + = g, e } } + "use strict", typeof Date.prototype.toJSON != "function" && + (Date.prototype.toJSON = function(a) { return + isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + + ":" + f(this.getUTCSeconds()) + "Z" : null }, + String.prototype.toJSON = Number.prototype.toJSON = + Boolean.prototype.toJSON = function(a) { return + this.valueOf() }); var cx = + /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = + /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, indent, meta = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": + "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, rep; typeof + JSON.stringify != "function" && (JSON.stringify = + function(a, b, c) { var d; gap = "", indent + = ""; if (typeof c == "number") for + (d = 0; d < c; d += 1) indent += " "; else typeof c + == "string" && (indent = c); rep = b; if (!b || + typeof b == "function" || typeof b == + "object" && typeof b.length == "number") + return str("", { "": a }); throw new + Error("JSON.stringify") }), typeof JSON.parse != + "function" && (JSON.parse = function(text, reviver) { + function walk(a, b) { var c, d, e = a[b]; if (e && + typeof e == "object") for (c in e) + Object.prototype.hasOwnProperty.call(e, c) + && (d = walk(e, c), d !== undefined ? e[c] = d : + delete e[c]); return reviver.call(a, b, e) + } var j; text = String(text), cx.lastIndex = 0, + cx.test(text) && (text = text.replace(cx, function(a) { + return "\\u" + ("0000" + + a.charCodeAt(0).toString(16)).slice(-4) + })); if + (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + "]").replace(/(?:^|:|,)(?:\s*\[)+/g, + ""))) + return j = eval("(" + text + ")"), typeof reviver + == "function" ? walk({ "": j }, "") : j; throw new + SyntaxError("JSON.parse") }) }(), + QQWB.extend("JSON", { fromString: function(a) { if (!a || + !QQWB.String.isString(a)) return + {}; a = a.replace(/^\s+/, "").replace(/\s+$/, ""); if + (window.JSON && window.JSON.parse) a = + window.JSON.parse(a); else if + (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + "]").replace(/(?:^|:|,)(?:\s*\[)+/g, + ""))) + a = (new Function("return " + data))(); else throw + new SyntaxError("Invalid JSON: " + a); return a }, + stringify: function(a) { return a == null ? "" : + window.JSON.stringify(a) }, toString: function(a) { + return QQWB.JSON.stringify(a) }, parse: + function(a) { return a == null ? {} : + window.JSON.parse(a) } }, !0), + QQWB.provide("man", function(a) { return a = + this._apiProvider.compat(a), + this._apiProvider.getDescriptor(a) ? + QQWB.JSON.stringify(this._apiProvider.getDescriptor(a)) + : "no such api" }), QQWB.extend("Array", { isArray: + function(a) { return + Object.prototype.toString.call(a) + === "[object Array]" }, inArray: + function(a, b) { for (var c = 0, d = + a.length; c < d; c++) if (b === + a[c]) return !0; return !1 + }, fromString: function(a, b, c) { return + QQWB.String.isString(a) ? (b = b || + "", c ? a.split(b, c) : + a.split(b)) : [] }, + fromArguments: function(a, + b) { return typeof + a != + "object" ? [] : b ? + Array.prototype.slice.call(a, b) : + Array.prototype.slice.call(a) }, toArray: + function(a) { return typeof a == "string" ? + a.split("") : typeof a == "object" + ? Array.prototype.slice.call(a, 0) : + this.toArray(a.toString()) }, each: + function(a, b) { for (var c = 0, d = + a.length; c < d; c++) if + (!1 === b(c, a[c])) break }, get: + function(a, b) { var c = a.length; + if (Math.abs(b) < c) return + b >= 0 ? a[b] : a[c + + b] } }), + QQWB.extend("dom", + { + create: + function(a, + b) + { + var + c = + document.createElement(a + + + ""); + if (b && c) + for + (attr + in + b) + b.hasOwnProperty(attr) + && + (QQWB.String.startsWith(attr, + "data-") + ? + c.setAttribute(attr, + b[attr]) + : + c[attr] + = + b[attr]); + return c }, + createHidden: + function(a, + b, + c) + { a + = + a + || + "div"; + var + d + = + this.create(a, + b); + return + c + ? + (d.width + = + d.height + = + 0, + d.style.width + = + d.style.height + = + 0, + d.style.position + = + "absolute", + d.style.top + = + "-9999px") + : + d.style.display + = + "none", + d + }, + append: + function(a, + b) + { + return + b + = + b + || + document.body, + a + && + a.nodeType + && + b.appendChild(a), + this + }, + html: + function(a, + b) + { + return + a + && + a.nodeType + && + b + && + (a.innerHTML + = + b), + this + }, + appendHidden: + function(a, + b, + c) + { + var + d + = + this.createHidden(null, + b, + c); + return + this.html(d, + a), + this.append(d) + }, + remove: + function(a) + { + return + a + && + a.nodeType + && + a.parentNode + && + a.parentNode.removeChild(a), + this + }, + hasClass: + function(a, + b) + { + return + (" + " + + + a.className + + + " + ").indexOf(" + " + + + b + + + " + ") + >= + 0 + }, + addClass: + function(a, + b) + { + return + b + = + QQWB.String.trim(b), + QQWB.Array.isArray(a) + ? + (QQWB.Array.each(a, + function(a, + c) + { + QQWB.dom.addClass(c, + b) + }), + this) + : + (QQWB.dom.hasClass(a, + b) + || + (a.className + = + a.className + + + " + " + + + b), + this) + }, + removeClass: + function(a, + b) + { + return + b + = + QQWB.String.trim(b), + QQWB.Array.isArray(a) + ? + (QQWB.Array.each(a, + function(a, + c) + { + QQWB.dom.removeClass(c, + b) + }), + this) + : + (QQWB.dom.hasClass(a, + b) + && + (a.className + = + a.className.replace(b, + ""), + QQWB.dom.removeClass(a, + b)), + this) + } + }), + QQWB.extend("queryString", + { + encode: + function(a, + b, + c, + d) + { + var + e + = + /%20/g, + f + = + b + || + "&", + g + = + c + || + encodeURIComponent, + h + = + [], + i + = + [], + j, + k; + for + (j + in + a) + if + (a.hasOwnProperty(j)) + { + k + = + a[j]; + if + (k + !== + null + && + typeof + k + != + "undefined") + { + j + = + g(j).replace(e, + "+"), + k + = + g(k).replace(e, + "+"); + if + (!d) + h.push(j + + + "=" + + + k); + else + for + (var + l + = + 0, + m + = + d.length; + l + < + m; + l++) + d[l] + === + j + && + (h[l] + = + j + + + "=" + + + k) + } + } + for + (var + n + = + 0, + o + = + h.length; + n + < + o; + n++) + typeof + h[n] + != + "undefined" + && + i.push(h[n]); + return + h + = + i, + i + = + null, + h.join(f) + }, + decode: + function(a, + b, + c) + { + var + d + = + c + || + decodeURIComponent, + e + = + b + || + "&", + f + = + a.split(e), + g + = + {}, + h; + for + (var + i + = + 0, + j + = + f.length; + i + < + j; + i++) + h + = + f[i].split("=", + 2), + h + && + h[0] + && + (g[d(h[0])] + = + d(h[1])); + return + g + } + }), + function() +{ function q(a, b, c, d, e, f) { for (var g = 0, h = d.length; g < h; g++) { + var i = d[g]; if (i) { var j = !1; i = i[a]; while (i) { if (i.sizcache + === c) { j = d[i.sizset]; break } i.nodeType === 1 && + !f && (i.sizcache = c, i.sizset = g); if + (i.nodeName.toLowerCase() === b) { j = i; break } i = i[a] } + d[g] = j } } } + + function r(a, b, c, d, e, f) { for (var g = 0, i = d.length; g < i; g++) { + var j = d[g]; if (j) { var k = !1; j = j[a]; while (j) { if + (j.sizcache === c) { k = d[j.sizset]; break } if + (j.nodeType === 1) { f || (j.sizcache = c, j.sizset + = g); if (typeof b != "string") { + if (j === b) { k = !0; + break } } else if + (h.filter(b, + [j]).length + > 0) { k = + j; + break + } } j = + j[a] } d[g] = k } } } var a = + /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ + >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + b = 0, c = + Object.prototype.toString, d = !1, + e = !0, f = /\\/g, g = /\W/; [0, + 0].sort(function() { return e = !1, + 0 }); var h = function(b, + d, e, f) { e = e || + [], d = d + || document; var g = d; if (d.nodeType !== + 1 && d.nodeType !== 9) return []; + if (!b || typeof b != "string") return e; var k, l, + n, o, p, q, r, t, u = !0, v = h.isXML(d), w = [], x + = b; do { a.exec(""), k = a.exec(x); if (k) + { x = k[3], w.push(k[1]); if (k[2]) + { o = k[3]; break } } } + while (k); if (w.length > 1 && j.exec(b)) if + (w.length === 2 && i.relative[w[0]]) l = + s(w[0] + w[1], d); else { l = + i.relative[w[0]] ? [d] : + h(w.shift(), d); while (w.length) b = + w.shift(), i.relative[b] && (b += + w.shift()), l = s(b, l) } + else { !f && w.length > 1 && d.nodeType === 9 && !v + && i.match.ID.test(w[0]) && + !i.match.ID.test(w[w.length - 1]) + && (p = h.find(w.shift(), d, v), d + = p.expr ? + h.filter(p.expr, + p.set)[0] : + p.set[0]); if (d) { + p = f ? { + expr: + w.pop(), + set: + m(f) + } : + h.find(w.pop(), + w.length + === + 1 + && + (w[0] + === + "~" + || + w[0] + === + "+") + && + d.parentNode + ? + d.parentNode + : + d, + v), + l = + p.expr + ? + h.filter(p.expr, + p.set) + : + p.set, + w.length + > + 0 + ? + n + = + m(l) + : + u + = + !1; + while + (w.length) + q + = + w.pop(), + r + = + q, + i.relative[q] + ? + r + = + w.pop() + : + q + = + "", + r + == + null + && + (r + = + d), + i.relative[q](n, + r, + v) + } else n = w = [] } + n || (n = l), n || h.error(q || b); if (c.call(n) + === "[object Array]") if (!u) + e.push.apply(e, n); else if (d && + d.nodeType === 1) for (t = + 0; n[t] != null; + t++) n[t] && (n[t] + === !0 || + n[t].nodeType + === 1 && + h.contains(d, + n[t])) + && + e.push(l[t]); + else for (t = 0; + n[t] + != + null; + t++) + n[t] && + n[t].nodeType + === + 1 + && + e.push(l[t]); + else m(n, e); + return o && (h(o, + g, + e, + f), + h.uniqueSort(e)), + e }; + h.uniqueSort = function(a) { if (o) { d = e, a.sort(o); if + (d) for (var b = 1; b < a.length; b++) a[b] === a[b + - 1] && a.splice(b--, 1) } return a }, + h.matches = function(a, b) { return h(a, null, + null, b) }, h.matchesSelector = + function(a, b) { return h(b, null, null, + [a]).length > 0 }, h.find = + function(a, b, c) { var d; if (!a) return + []; for (var e = 0, g = + i.order.length; e < + g; e++) { var h, j + = + i.order[e]; + if (h = + i.leftMatch[j].exec(a)) + { var k = + h[1]; + h.splice(1, + 1); + if + (k.substr(k.length + - + 1) + !== + "\\") + { + h[1] + = + (h[1] + || + "").replace(f, + ""), + d + = + i.find[j](h, + b, + c); + if + (d + != + null) + { + a + = + a.replace(i.match[j], + ""); + break + } + } + } } return + d || (d = typeof + b.getElementsByTagName + != "undefined" ? + b.getElementsByTagName("*") + : []), { set: d, + expr: a } + }, h.filter = function(a, b, c, d) { var e, + f, g = a, j = [], k = b, l = b && + b[0] && h.isXML(b[0]); + while (a && b.length) { for (var m + in i.filter) if ((e + = + i.leftMatch[m].exec(a)) + != null && + e[2]) { var + n, + o, + p = + i.filter[m], + q = + e[1]; + f = + !1, + e.splice(1, + 1); + if + (q.substr(q.length + - + 1) + === + "\\") + continue; + k + === + j + && + (j + = + []); + if + (i.preFilter[m]) + { + e + = + i.preFilter[m](e, + k, + c, + j, + d, + l); + if + (!e) + f + = + n + = + !0; + else + if + (e + === + !0) + continue + } + if + (e) + for + (var + r + = + 0; + (o + = + k[r]) + != + null; + r++) + if + (o) + { + n + = + p(o, + e, + r, + k); + var + s + = + d + ^ + !! + n; + c + && + n + != + null + ? + s + ? + f + = + !0 + : + k[r] + = + !1 + : + s + && + (j.push(o), + f + = + !0) + } + if + (n + !== + undefined) + { + c + || + (k + = + j), + a + = + a.replace(i.match[m], + ""); + if + (!f) + return + []; + break + } + } if (a === + g) + if + (f + == + null) + h.error(a); + else + break; + g = a } + return k }, h.error = function(a) { + throw "Syntax error, + unrecognized + expression: " + + a }; var i + = h.selectors + = { order: + ["ID", + "NAME", + "TAG"], + match: + { ID: + /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: + /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: + /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: + /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: + /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: + /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: + /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: + /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + leftMatch: + {}, + attrMap: + { + "class": + "className", + "for": + "htmlFor" + }, + attrHandle: + { + href: + function(a) + { + return + a.getAttribute("href") + }, + type: + function(a) + { + return + a.getAttribute("type") + } + }, + relative: + { + "+": + function(a, + b) + { + var + c + = + typeof + b + == + "string", + d + = + c + && + !g.test(b), + e + = + c + && + !d; + d + && + (b + = + b.toLowerCase()); + for + (var + f + = + 0, + i + = + a.length, + j; + f + < + i; + f++) + if + (j + = + a[f]) + { + while + ((j + = + j.previousSibling) + && + j.nodeType + !== + 1); + a[f] + = + e + || + j + && + j.nodeName.toLowerCase() + === + b + ? + j + || + !1 + : + j + === + b + } + e + && + h.filter(b, + a, + !0) + }, + ">": + function(a, + b) + { + var + c, + d + = + typeof + b + == + "string", + e + = + 0, + f + = + a.length; + if + (d + && + !g.test(b)) + { + b + = + b.toLowerCase(); + for + (; + e + < + f; + e++) + { + c + = + a[e]; + if + (c) + { + var + i + = + c.parentNode; + a[e] + = + i.nodeName.toLowerCase() + === + b + ? + i + : + !1 + } + } + } + else + { + for + (; + e + < + f; + e++) + c + = + a[e], + c + && + (a[e] + = + d + ? + c.parentNode + : + c.parentNode + === + b); + d + && + h.filter(b, + a, + !0) + } + }, + "": + function(a, + c, + d) + { + var + e, + f + = + b++, + h + = + r; + typeof + c + == + "string" + && + !g.test(c) + && + (c + = + c.toLowerCase(), + e + = + c, + h + = + q), + h("parentNode", + c, + f, + a, + e, + d) + }, + "~": + function(a, + c, + d) + { + var + e, + f + = + b++, + h + = + r; + typeof + c + == + "string" + && + !g.test(c) + && + (c + = + c.toLowerCase(), + e + = + c, + h + = + q), + h("previousSibling", + c, + f, + a, + e, + d) + } + }, + find: + { ID: + function(a, + b, + c) + { + if + (typeof + b.getElementById + != + "undefined" + && + !c) + { + var + d + = + b.getElementById(a[1]); + return + d + && + d.parentNode + ? + [d] + : + [] + } + }, + NAME: + function(a, + b) + { + if + (typeof + b.getElementsByName + != + "undefined") + { + var + c + = + [], + d + = + b.getElementsByName(a[1]); + for + (var + e + = + 0, + f + = + d.length; + e + < + f; + e++) + d[e].getAttribute("name") + === + a[1] + && + c.push(d[e]); + return + c.length + === + 0 + ? + null + : + c + } + }, + TAG: + function(a, + b) + { + if + (typeof + b.getElementsByTagName + != + "undefined") + return + b.getElementsByTagName(a[1]) + } + }, + preFilter: + { + CLASS: + function(a, + b, + c, + d, + e, + g) + { + a + = + " + " + + + a[1].replace(f, + "") + + + " + "; + if + (g) + return + a; + for + (var + h + = + 0, + i; + (i + = + b[h]) + != + null; + h++) + i + && + (e + ^ + (i.className + && + (" + " + + + i.className + + + " + ").replace(/[\t\n\r]/g, + " + ").indexOf(a) + >= + 0) + ? + c + || + d.push(i) + : + c + && + (b[h] + = + !1)); + return + !1 + }, + ID: + function(a) + { + return + a[1].replace(f, + "") + }, + TAG: + function(a, + b) + { + return + a[1].replace(f, + "").toLowerCase() + }, + CHILD: + function(a) + { + if + (a[1] + === + "nth") + { + a[2] + || + h.error(a[0]), + a[2] + = + a[2].replace(/^\+|\s*/g, + ""); + var + c + = + /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2] + === + "even" + && + "2n" + || + a[2] + === + "odd" + && + "2n+1" + || + !/\D/.test(a[2]) + && + "0n+" + + + a[2] + || + a[2]); + a[2] + = + c[1] + + + (c[2] + || + 1) + - + 0, + a[3] + = + c[3] + - + 0 + } + else + a[2] + && + h.error(a[0]); + return + a[0] + = + b++, + a + }, + ATTR: + function(a, + b, + c, + d, + e, + g) + { + var + h + = + a[1] + = + a[1].replace(f, + ""); + return + !g + && + i.attrMap[h] + && + (a[1] + = + i.attrMap[h]), + a[4] + = + (a[4] + || + a[5] + || + "").replace(f, + ""), + a[2] + === + "~=" + && + (a[4] + = + " + " + + + a[4] + + + " + "), + a + }, + PSEUDO: + function(b, + c, + d, + e, + f) + { + if + (b[1] + === + "not") + if + ((a.exec(b[3]) + || + "").length + > + 1 + || + /^\w/.test(b[3])) + b[3] + = + h(b[3], + null, + null, + c); + else + { + var + g + = + h.filter(b[3], + c, + d, + !0 + ^ + f); + return + d + || + e.push.apply(e, + g), + !1 + } + else + if + (i.match.POS.test(b[0]) + || + i.match.CHILD.test(b[0])) + return + !0; + return + b + }, + POS: + function(a) + { + return + a.unshift(!0), + a + } + }, + filters: + { + enabled: + function(a) + { + return + a.disabled + === + !1 + && + a.type + !== + "hidden" + }, + disabled: + function(a) + { + return + a.disabled + === + !0 + }, + checked: + function(a) + { + return + a.checked + === + !0 + }, + selected: + function(a) + { + return + a.parentNode + && + a.parentNode.selectedIndex, + a.selected + === + !0 + }, + parent: + function(a) + { + return + !!a.firstChild + }, + empty: + function(a) + { + return + !a.firstChild + }, + has: + function(a, + b, + c) + { + return + !!h(c[3], + a).length + }, + header: + function(a) + { + return + /h\d/i.test(a.nodeName) + }, + text: + function(a) + { + var + b + = + a.getAttribute("type"), + c + = + a.type; + return + a.nodeName.toLowerCase() + === + "input" + && + "text" + === + c + && + (b + === + c + || + b + === + null) + }, + radio: + function(a) + { + return + a.nodeName.toLowerCase() + === + "input" + && + "radio" + === + a.type + }, + checkbox: + function(a) + { + return + a.nodeName.toLowerCase() + === + "input" + && + "checkbox" + === + a.type + }, + file: + function(a) + { + return + a.nodeName.toLowerCase() + === + "input" + && + "file" + === + a.type + }, + password: + function(a) + { + return + a.nodeName.toLowerCase() + === + "input" + && + "password" + === + a.type + }, + submit: + function(a) + { + var + b + = + a.nodeName.toLowerCase(); + return + (b + === + "input" + || + b + === + "button") + && + "submit" + === + a.type + }, + image: + function(a) + { + return + a.nodeName.toLowerCase() + === + "input" + && + "image" + === + a.type + }, + reset: + function(a) + { + var + b + = + a.nodeName.toLowerCase(); + return + (b + === + "input" + || + b + === + "button") + && + "reset" + === + a.type + }, + button: + function(a) + { + var + b + = + a.nodeName.toLowerCase(); + return + b + === + "input" + && + "button" + === + a.type + || + b + === + "button" + }, + input: + function(a) + { + return + /input|select|textarea|button/i.test(a.nodeName) + }, + focus: + function(a) + { + return + a + === + a.ownerDocument.activeElement + } + }, + setFilters: + { + first: + function(a, + b) + { + return + b + === + 0 + }, + last: + function(a, + b, + c, + d) + { + return + b + === + d.length + - + 1 + }, + even: + function(a, + b) + { + return + b + % + 2 + === + 0 + }, + odd: + function(a, + b) + { + return + b + % + 2 + === + 1 + }, + lt: + function(a, + b, + c) + { + return + b + < + c[3] + - + 0 + }, + gt: + function(a, + b, + c) + { + return + b + > + c[3] + - + 0 + }, + nth: + function(a, + b, + c) + { + return + c[3] + - + 0 + === + b + }, + eq: + function(a, + b, + c) + { + return + c[3] + - + 0 + === + b + } + }, + filter: + { + PSEUDO: + function(a, + b, + c, + d) + { + var + e + = + b[1], + f + = + i.filters[e]; + if + (f) + return + f(a, + c, + b, + d); + if + (e + === + "contains") + return + (a.textContent + || + a.innerText + || + h.getText([a]) + || + "").indexOf(b[3]) + >= + 0; + if + (e + === + "not") + { + var + g + = + b[3]; + for + (var + j + = + 0, + k + = + g.length; + j + < + k; + j++) + if + (g[j] + === + a) + return + !1; + return + !0 + } + h.error(e) + }, + CHILD: + function(a, + b) + { + var + c + = + b[1], + d + = + a; + switch + (c) + { + case + "only": + case + "first": + while + (d + = + d.previousSibling) + if + (d.nodeType + === + 1) + return + !1; + if + (c + === + "first") + return + !0; + d + = + a; + case + "last": + while + (d + = + d.nextSibling) + if + (d.nodeType + === + 1) + return + !1; + return + !0; + case + "nth": + var + e + = + b[2], + f + = + b[3]; + if + (e + === + 1 + && + f + === + 0) + return + !0; + var + g + = + b[0], + h + = + a.parentNode; + if + (h + && + (h.sizcache + !== + g + || + !a.nodeIndex)) + { + var + i + = + 0; + for + (d + = + h.firstChild; + d; + d + = + d.nextSibling) + d.nodeType + === + 1 + && + (d.nodeIndex + = + ++i); + h.sizcache + = + g + } + var + j + = + a.nodeIndex + - + f; + return + e + === + 0 + ? + j + === + 0 + : + j + % + e + === + 0 + && + j + / + e + >= + 0 + } + }, + ID: + function(a, + b) + { + return + a.nodeType + === + 1 + && + a.getAttribute("id") + === + b + }, + TAG: + function(a, + b) + { + return + b + === + "*" + && + a.nodeType + === + 1 + || + a.nodeName.toLowerCase() + === + b + }, + CLASS: + function(a, + b) + { + return + (" + " + + + (a.className + || + a.getAttribute("class")) + + + " + ").indexOf(b) + > + -1 + }, + ATTR: + function(a, + b) + { + var + c + = + b[1], + d + = + i.attrHandle[c] + ? + i.attrHandle[c](a) + : + a[c] + != + null + ? + a[c] + : + a.getAttribute(c), + e + = + d + + + "", + f + = + b[2], + g + = + b[4]; + return + d + == + null + ? + f + === + "!=" + : + f + === + "=" + ? + e + === + g + : + f + === + "*=" + ? + e.indexOf(g) + >= + 0 + : + f + === + "~=" + ? + (" + " + + + e + + + " + ").indexOf(g) + >= + 0 + : + g + ? + f + === + "!=" + ? + e + !== + g + : + f + === + "^=" + ? + e.indexOf(g) + === + 0 + : + f + === + "$=" + ? + e.substr(e.length + - + g.length) + === + g + : + f + === + "|=" + ? + e + === + g + || + e.substr(0, + g.length + + + 1) + === + g + + + "-" + : + !1 + : + e + && + d + !== + !1 + }, + POS: + function(a, + b, + c, + d) + { + var + e + = + b[2], + f + = + i.setFilters[e]; + if + (f) + return + f(a, + c, + b, + d) + } + } }, + j = i.match.POS, k = + function(a, + b) + { return "\\" + + (b + - + 0 + + + 1) + }; for (var l + in + i.match) + i.match[l] = + new + RegExp(i.match[l].source + + + /(?![^\[]*\])(?![^\(]*\))/.source), + i.leftMatch[l] + = + new + RegExp(/(^(?:.|\r|\n)*?)/.source + + + i.match[l].source.replace(/\\(\d+)/g, + k)); + var m + = + function(a, + b) + { + return + a + = + Array.prototype.slice.call(a, + 0), + b + ? + (b.push.apply(b, + a), + b) + : + a + }; + try { + Array.prototype.slice.call(document.documentElement.childNodes, + 0)[0].nodeType + } + catch + (n) + { + m + = + function(a, + b) + { + var + d + = + 0, + e + = + b + || + []; + if + (c.call(a) + === + "[object + Array]") + Array.prototype.push.apply(e, + a); + else + if + (typeof + a.length + == + "number") + for + (var + f + = + a.length; + d + < + f; + d++) + e.push(a[d]); + else + for + (; + a[d]; + d++) + e.push(a[d]); + return + e + } + } + var + o, + p; + document.documentElement.compareDocumentPosition + ? + o + = + function(a, + b) + { + return + a + === + b + ? + (d + = + !0, + 0) + : + !a.compareDocumentPosition + || + !b.compareDocumentPosition + ? + a.compareDocumentPosition + ? + -1 + : + 1 + : + a.compareDocumentPosition(b) + & + 4 + ? + -1 + : + 1 + } + : (o + = + function(a, + b) + { + if + (a + === + b) + return + d + = + !0, + 0; if + (a.sourceIndex + && + b.sourceIndex) + return + a.sourceIndex + - + b.sourceIndex; + var + c, + e, + f + = + [], + g + = + [], + h + = + a.parentNode, + i + = + b.parentNode, + j + = + h; + if (h + === + i) + return + p(a, + b); + if + (!h) + return + -1; + if + (!i) + return + 1; + while + (j) + f.unshift(j), + j + = + j.parentNode; + j = + i; + while + (j) + g.unshift(j), + j + = + j.parentNode; + c = + f.length, + e + = + g.length; + for + (var + k + = + 0; + k + < + c + && + k + < + e; + k++) + if + (f[k] + !== + g[k]) + return + p(f[k], + g[k]); + return + k + === + c + ? + p(a, + g[k], + -1) + : + p(f[k], + b, + 1) + }, + p + = + function(a, + b, + c) + { + if + (a + === + b) + return + c; + var + d + = + a.nextSibling; + while + (d) + { + if + (d + === + b) + return + -1; + d + = + d.nextSibling + } + return + 1 + }), + h.getText + = + function(a) + { + var + b + = + "", + c; + for + (var + d + = + 0; + a[d]; + d++) + c + = + a[d], + c.nodeType + === + 3 + || + c.nodeType + === + 4 + ? + b + += + c.nodeValue + : + c.nodeType + !== + 8 + && + (b + += + h.getText(c.childNodes)); + return + b + }, + function() + { + var + a + = + document.createElement("div"), + b + = + "script" + + + (new + Date).getTime(), + c + = + document.documentElement; + a.innerHTML + = + "", + c.insertBefore(a, + c.firstChild), + document.getElementById(b) + && + (i.find.ID + = + function(a, + b, + c) + { + if + (typeof + b.getElementById + != + "undefined" + && + !c) + { + var + d + = + b.getElementById(a[1]); + return + d + ? + d.id + === + a[1] + || + typeof + d.getAttributeNode + != + "undefined" + && + d.getAttributeNode("id").nodeValue + === + a[1] + ? + [d] + : + undefined + : + [] + } + }, + i.filter.ID + = + function(a, + b) + { + var + c + = + typeof + a.getAttributeNode + != + "undefined" + && + a.getAttributeNode("id"); + return + a.nodeType + === + 1 + && + c + && + c.nodeValue + === + b + }), + c.removeChild(a), + c + = + a + = + null + }(), + function() + { + var + a + = + document.createElement("div"); + a.appendChild(document.createComment("")), + a.getElementsByTagName("*").length + > + 0 + && + (i.find.TAG + = + function(a, + b) + { + var + c + = + b.getElementsByTagName(a[1]); + if + (a[1] + === + "*") + { + var + d + = + []; + for + (var + e + = + 0; + c[e]; + e++) + c[e].nodeType + === + 1 + && + d.push(c[e]); + c + = + d + } + return + c + }), + a.innerHTML + = + "", + a.firstChild + && + typeof + a.firstChild.getAttribute + != + "undefined" + && + a.firstChild.getAttribute("href") + !== + "#" + && + (i.attrHandle.href + = + function(a) + { + return + a.getAttribute("href", + 2) + }), + a + = + null + }(), + document.querySelectorAll + && + function() + { + var + a + = + h, + b + = + document.createElement("div"), + c + = + "__sizzle__"; + b.innerHTML + = + "

"; + if + (b.querySelectorAll + && + b.querySelectorAll(".TEST").length + === + 0) + return; + h + = + function(b, + d, + e, + f) + { + d + = + d + || + document; + if + (!f + && + !h.isXML(d)) + { + var + g + = + /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b); + if + (g + && + (d.nodeType + === + 1 + || + d.nodeType + === + 9)) + { + if + (g[1]) + return + m(d.getElementsByTagName(b), + e); + if + (g[2] + && + i.find.CLASS + && + d.getElementsByClassName) + return + m(d.getElementsByClassName(g[2]), + e) + } + if + (d.nodeType + === + 9) + { + if + (b + === + "body" + && + d.body) + return + m([d.body], + e); + if + (g + && + g[3]) + { + var + j + = + d.getElementById(g[3]); + if + (!j + || + !j.parentNode) + return + m([], + e); + if + (j.id + === + g[3]) + return + m([j], + e) + } + try + { + return + m(d.querySelectorAll(b), + e) + } + catch + (k) + {} + } + else + if + (d.nodeType + === + 1 + && + d.nodeName.toLowerCase() + !== + "object") + { + var + l + = + d, + n + = + d.getAttribute("id"), + o + = + n + || + c, + p + = + d.parentNode, + q + = + /^\s*[+~]/.test(b); + n + ? + o + = + o.replace(/'/g, + "\\$&") + : + d.setAttribute("id", + o), + q + && + p + && + (d + = + d.parentNode); + try + { + if + (!q + || + p) + return + m(d.querySelectorAll("[id='" + + + o + + + "'] + " + + + b), + e) + } + catch + (r) + {} + finally + { + n + || + l.removeAttribute("id") + } + } + } + return + a(b, + d, + e, + f) + }; + for + (var + d + in + a) + h[d] + = + a[d]; + b + = + null + }(), + function() + { + var + a + = + document.documentElement, + b + = + a.matchesSelector + || + a.mozMatchesSelector + || + a.webkitMatchesSelector + || + a.msMatchesSelector; + if + (b) + { + var + c + = + !b.call(document.createElement("div"), + "div"), + d + = + !1; + try + { + b.call(document.documentElement, + "[test!='']:sizzle") + } + catch + (e) + { + d + = + !0 + } + h.matchesSelector + = + function(a, + e) + { + e + = + e.replace(/\=\s*([^'"\]]*)\s*\]/g, + "='$1']"); + if + (!h.isXML(a)) + try + { + if + (d + || + !i.match.PSEUDO.test(e) + && + !/!=/.test(e)) + { + var + f + = + b.call(a, + e); + if + (f + || + !c + || + a.document + && + a.document.nodeType + !== + 11) + return + f + } + } + catch + (g) + {} + return + h(e, + null, + null, + [a]).length + > + 0 + } + } + }(), + function() + { + var + a + = + document.createElement("div"); + a.innerHTML + = + "
"; + if + (!a.getElementsByClassName + || + a.getElementsByClassName("e").length + === + 0) + return; + a.lastChild.className + = + "e"; + if + (a.getElementsByClassName("e").length + === + 1) + return; + i.order.splice(1, + 0, + "CLASS"), + i.find.CLASS + = + function(a, + b, + c) + { + if + (typeof + b.getElementsByClassName + != + "undefined" + && + !c) + return + b.getElementsByClassName(a[1]) + }, + a + = + null + }(), + document.documentElement.contains + ? + h.contains + = + function(a, + b) + { + return + a + !== + b + && + (a.contains + ? + a.contains(b) + : + !0) + } + : + document.documentElement.compareDocumentPosition + ? + h.contains + = + function(a, + b) + { + return + !!(a.compareDocumentPosition(b) + & + 16) + } + : + h.contains + = + function() + { + return + !1 + }, + h.isXML + = + function(a) + { + var + b + = + (a + ? + a.ownerDocument + || + a + : + 0).documentElement; + return + b + ? + b.nodeName + !== + "HTML" + : + !1 + }; + var s + = + function(a, + b) + { + var + c, + d + = + [], + e + = + "", + f + = + b.nodeType + ? + [b] + : + b; + while + (c + = + i.match.PSEUDO.exec(a)) + e + += + c[0], + a + = + a.replace(i.match.PSEUDO, + ""); + a + = + i.relative[a] + ? + a + + + "*" + : + a; + for + (var + g + = + 0, + j + = + f.length; + g + < + j; + g++) + h(a, + f[g], + d); + return + h.filter(e, + d) + }, + t + = + window.Sizzle; + h.noConflict + = + function() + { + window.Sizzle + = + t + }, + window.Sizzle + = + h +}(), function() { function b(b) { var c; if (!QQWB.Array.isArray(this)) return + this; c = []; for (var d = 0, e = this.length; d < e; d++) c = + c.concat(a(b, this[d])); return c } + + function c(b) { return typeof b != "string" ? this : b.length <= 0 ? this : + a.matches(":contains(" + b + ")", this) } + + function d(b) { return a.matches(b, this) } + + function e(b) { return a.matches(":not(" + b + ")", this) } + + function f(a) { return QQWB.Array.get(this, a) } + + function g(a) { if (!QQWB.Array.isArray(this) || !a) return this; for (var + b = 0, c = this.length; b < c; b++) if (a(this[b]) === !1) + break; return this } + + function h(a) { return !a.find && (a.find = function(c) { return + h(b.call(a, c)) }), !a.contains && (a.contains = function(b) { + return h(c.call(a, b)) }), !a.keep && (a.keep = function(b) + { return h(d.call(a, b)) }), !a.tear && (a.tear = + function(b) { return h(e.call(a, b)) }), !a.get && (a.get = + function(b) { return f.call(a, b) }), !a.each && (a.each = + function(b) { return g.call(a, b) }), a } var a = + window.Sizzle; a.noConflict(), QQWB.provide("dom.find", + function(b, c) { return h(a(b, c)) }), + QQWB._alias("find", QQWB.dom.find) }(), function() { var a = + function() { function b(a) { return + Object.prototype.toString.call(a).slice(8, + -1).toLowerCase() } + + function c(a, b) { for (var c = []; b > 0; c[--b] = a); return + c.join("") } var d = function() { return + d.cache.hasOwnProperty(arguments[0]) || + (d.cache[arguments[0]] = + d.parse(arguments[0])), + d.format.call(null, d.cache[arguments[0]], + arguments) }; return d.format = + function(d, e) { var f = 1, g = d.length, h + = "", i, j = [], k, l, m, n, o, p; + for (k = 0; k < g; k++) { h = + b(d[k]); if (h === + "string") + j.push(d[k]); else + if (h === "array") + { m = d[k]; if + (m[2]) { i + = + e[f]; + for + (l + = + 0; + l + < + m[2].length; + l++) + { + if + (!i.hasOwnProperty(m[2][l])) + throw + a('[sprintf] + property + "%s" + does + not + exist', + m[2][l]); + i + = + i[m[2][l]] + } + } else m[1] + ? i + = + e[m[1]] + : + i + = + e[f++]; + if + (/[^s]/.test(m[8]) + && + b(i) + != + "number") + throw + a("[sprintf] + expecting + number + but + found + %s", + b(i)); + switch + (m[8]) + { + case + "b": + i + = + i.toString(2); + break; + case + "c": + i + = + String.fromCharCode(i); + break; + case + "d": + i + = + parseInt(i, + 10); + break; + case + "e": + i + = + m[7] + ? + i.toExponential(m[7]) + : + i.toExponential(); + break; + case + "f": + i + = + m[7] + ? + parseFloat(i).toFixed(m[7]) + : + parseFloat(i); + break; + case + "o": + i + = + i.toString(8); + break; + case + "s": + i + = + (i + = + i + ? + String(i) + : + "") + && + m[7] + ? + i.substring(0, + m[7]) + : + i; + break; + case + "u": + i + = + Math.abs(i); + break; + case + "x": + i + = + i.toString(16); + break; + case + "X": + i + = + i.toString(16).toUpperCase() + } i + = + /[def]/.test(m[8]) + && + m[3] + && + i + >= + 0 ? + "+" + + i + : + i, + o = + m[4] + ? + m[4] + == + "0" + ? + "0" + : + m[4].charAt(1) + : + " + ", + p = + m[6] + - + String(i).length, + n = + m[6] + ? + c(o, + p) + : + "", + j.push(m[5] + ? + i + + + n + : + n + + + i) + } } return + j.join("") }, d.cache = {}, d.parse + = function(a) { var b = a, + c = [], d = [], e = + 0; while + (b) { if + ((c + = + /^[^\x25]+/.exec(b)) + !== + null) + d.push(c[0]); + else + if + ((c + = + /^\x25{2}/.exec(b)) + !== + null) + d.push("%"); + else + { + if + ((c + = + /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b)) + === + null) + throw + "[sprintf] + huh?"; + if + (c[2]) + { + e + |= + 1; + var + f + = + [], + g + = + c[2], + h + = + []; + if + ((h + = + /^([a-z_][a-z_\d]*)/i.exec(g)) + === + null) + throw + "[sprintf] + huh?"; + f.push(h[1]); + while + ((g + = + g.substring(h[0].length)) + !== + "") + if + ((h + = + /^\.([a-z_][a-z_\d]*)/i.exec(g)) + !== + null) + f.push(h[1]); + else + if + ((h + = + /^\[(\d+)\]/.exec(g)) + !== + null) + f.push(h[1]); + else + throw + "[sprintf] + huh?"; + c[2] + = + f + } + else + e + |= + 2; + if + (e + === + 3) + throw + "[sprintf] + mixing + positional + and + named + placeholders + is + not + (yet) + supported"; + d.push(c) + } + b = + b.substring(c[0].length) + } return d + }, d }(), b = function(b, + c) { return + c.unshift(b), + a.apply(null, + c) + }; + QQWB.extend("String.format", { sprintf: a, vsprintf: b }), + QQWB._alias("format", QQWB.String.format) }(), + QQWB.extend("time", { now: function() { return + +this.dateNow() }, secondsNow: function() { + return Math.round(this.now() / 1e3) + }, dateNow: function() { return new Date }, + shortTime: function(a, b) { return a instanceof + Date || (b = a, a = this.dateNow()), b = b + || "%(year)s/%(month)s/%(day)s + %(hour)02d:%(minute)02d:%(second)02d", + QQWB.format.sprintf(b, { year: a.getFullYear(), + month: a.getMonth(), day: a.getDate(), + hour: a.getHours(), minute: a.getMinutes(), second: + a.getSeconds() }) } }), QQWB.extend("log", + { CRITICAL: 50, ERROR: 40, WARNING: 30, INFO: 20, + DEBUG: 10, NOTSET: 0, _level: 0, _format: + "%(source)s%(popup)s%(frame)s%(name)s: + [%(levelname)s] %(time)s + %(message)s", setLevel: function(a) + { return this._level = a, this }, + setFormat: function(a) { return + this._format = a, this }, debug: + function(a) { return this.DEBUG >= + this._level && + this._out("DEBUG", a), this }, + info: function(a) { return this.INFO >= + this._level && this._out("INFO", + a), this }, warning: + function(a) { return this.WARNING + >= this._level && + this._out("WARNING", a), this }, + error: function(a) { return this.ERROR >= + this._level && this._out("ERROR", + a), this }, critical: + function(a) { return this.CRITICAL + >= this._level && + this._out("CRITICAL", + a), + this }, _out: function(a, + b) { var c + = + this._format; + c = + QQWB.format.sprintf(c, + { + name: + QQWB.name, + levelname: + a, + time: + QQWB.time.shortTime(), + message: + b, + frame: + window + != + window.parent + ? + "*" + : + "", + source: + window.name + ? + window.name + : + "", + popup: + window.opener + || + window.name + === + QQWB._const.AUTH_WINDOW_NAME + ? + "#" + : + "" + }), + this._capture + && + typeof + this._captureLevel + == + "number" + && + this[a] + > + this._captureLevel + && + this._capturedMessages + && + (this._capturedMessages.length + >= + this._captureMaxSize + && + this._capturedMessages.shift(), + this._capturedMessages.push(c)), + QQWB.debug + && + window.console + && + window.console.log(c) + }, + startCapture: + function(a, + b) + { + return + this._captureLevel + = + a + || + this.NOTSET, + this._captureMaxSize + = + b + || + 50, + this._capturedMessages + = + [], + this._capture + = + !0, + this + }, + stopCapture: + function() + { + return + this._capture + && + (this._capture + = + !1), + this + }, + lastCaptured: + function(a) + { + return + a + = + a + || + "\n", + this._capturedMessages + ? + this._capturedMessages.join(a) + : + "" + } + }), QQWB.extend("cookie", { set: function(a, b, c, + d, e, f) { f = f || escape; if + (typeof c == "undefined" || + c === null) c = -1; var g + = e ? "domain=" + e + : "", h = d ? "path=" + d : "", i = ""; + return c === 0 ? i = "expires=" + (new Date(1970, + 1, 1)).toUTCString() : c > 0 && (i + = "expires=" + (new Date(+(new + Date) + c * + 1e3)).toUTCString()), + document.cookie = [a + "=" + f(b), + i, h, g].join("; "), this }, get: function(a, b, c) + { b = b || unescape; var d = a + "="; cookies = + (document.cookie || "").split(/\s*;\s*/); + for (var e = 0, f = cookies.length; e < f; + e++) { var g = cookies[e]; if + (g.indexOf(d) === 0) return + b(g.substr(d.length)) } return c }, del: + function(a, b, c) { return this.set(a, "", + 0, b, c), document.cookie.indexOf(a + + "=") >= 0 && + QQWB.log.warning("Cookie + may not be + deleted as + you + expected"), + this } }), QQWB.extend("XML", { + isXML: function(a) {}, + toString: function(a) { return + this.stringify(a) }, + stringify: function(a) { var b; + return window.ActiveXObject + ? b = a.xml : b = (new + XMLSerializer).serializeToString(a), + b }, fromString: function(a) { var + b; if + (window.ActiveXObject) b = + new + ActiveXObject("Microsoft.XMLDOM"), + b.async = "false", b.loadXML(a); + else { var c = new DOMParser; b = + c.parseFromString(a, + "text/xml") } + return b } }, !0), + QQWB.extend("Function", { + isFunction: function(a) { + return typeof a == + "function" } }), + QQWB.extend("deferred", { + _promiseMethods: "done fail + isResolved isRejected + promise then always success + error complete + whatever".split(" "), + _deferred: function() { var a = [], + b, c, d, e = { done: + function() { if + (!d) { var + c = + arguments, f, g; b && (g = + b, b = 0); for (var + h = 0, i = + c.length; h + < i; h++) f + = c[h], + QQWB.Array.isArray(f) ? + e.done.apply(e, f) : + QQWB.Function.isFunction(f) + && a.push(f); g && + e.resolveWith(g[0], g[1]) } + return this + }, resolveWith: + function(e, f) { if + (!d && !b + && !c) { f + = + f + || + [], + c + = + 1; + try + { + while + (a[0]) + a.shift().apply(e, + f) + } + finally + { + b + = + [e, + f], + c + = + 0 + } + } return + this }, + resolve: + function() + { + return + e.resolveWith(this, + arguments), + this + }, + isResolved: + function() + { + return + !!c + || + !! + b + }, + cancel: + function() + { + return + d + = + 1, + a + = + [], + this + } + }; return e }, deferred: + function(a) { var b, c = + QQWB.deferred._deferred(), + d = + QQWB.deferred._deferred(); + return QQWB.extend(c, { + fail: d.done, then: + function(a, b) { + return + c.done(a).fail(b), + this }, always: + function() { return + c.done.apply(c, + arguments).fail.apply(this, + arguments) + }, rejectWith: + d.resolveWith, reject: + d.resolve, + isRejected: + d.isResolved, + promise: function(a) + { if (a == null) { if (b) + return + b; b = a = {} } var + d = + QQWB.deferred._promiseMethods.length; + while + (d--) + a[QQWB.deferred._promiseMethods[d]] + = + c[QQWB.deferred._promiseMethods[d]]; + return + a + } }), c.success = c.done, + c.error = c.fail, + c.complete = + c.whatever = + c.always, + c.done(d.cancel).fail(c.cancel), + delete c.cancel, a + && a.call(c, + c), + c }, when: + function(a) + { function + f(a) + { + return + + function(c) { b[a] = arguments.length > 1 ? + QQWB.Array.fromArguments(arguments) : c, --d || + e.resolveWith(e, + QQWB.Array.fromArguments(b)) + } } var b = arguments, c = b.length, d = c, e = c <= 1 && a && + QQWB.Function.isFunction(a.promise) + ? + a + : + QQWB.deferred.deferred(); + if + (c + > + 1) + for + (var + g + = + 0; + g + < + c; + g++) + b[g] + && + QQWB.Function.isFunction(b[g].promise) + ? + b[g].promise().then(f(g), + e.reject) + : + --d, + d + || + e.resolveWith(e, + b); + else + e + !== + a + && + e.resolveWith(e, + c + ? + [a] + : + []); + return + e.promise() + } }), + QQWB._alias(["task", + "when"], + QQWB.deferred.when), + QQWB.extend("io", + { + _globalIOTimeout: + 3e4, + _IOScript: + function(a) + { var b, c, + d = + document.head + || + document.getElementsByTagName("head")[0] + || + document.documentElement; + return { + send: + function(e) + { var f = + QQWB.time.now(); + b = + document.createElement("script"), + b.async = + "async", + a.charset && + (b.charset + = + a.charset), + b.src = + a.url, + c = + setTimeout(function() + { + QQWB.log.warning("script + loading + timeout"), + e(599, + "network + connect + timeout", + QQWB.time.now() + - + f) + }, + QQWB.io._globalIOTimeout), + b.onload = + b.onreadystatechange + = + function(a, + g) + { if + (g + || + !b.readyState + || + /loaded|complete/.test(b.readyState)) + clearTimeout(c), + b.onload + = + b.onreadystatechange + = + null, + d + && + b.parentNode + && + d.removeChild(b), + b + = + null, + !g + && + e + && + e.apply(QQWB, + [200, + "success", + QQWB.time.now() + - + f]), + g + && + e + && + e.apply(QQWB, + [-1, + "aborted", + QQWB.time.now() + - + f]) + }, + b.onerror = + function(a) + { + clearTimeout(c), + e + && + e.apply(QQWB, + [404, + a, + QQWB.time.now() + - + f]) + }, + d.insertBefore(b, + d.firstChild) + }, abort: + function() { + b && + b.onload(0, + 1) + } } }, + _IOAjax: + function(a) + { + var + b, + c, + a + = + a + || + {}, + d + = + window.XMLHttpRequest + ? + new + window.XMLHttpRequest + : + new + window.ActiveXObject("Microsoft.XMLHTTP"); + return + a.async + || + (a.async + = + "async"), + { + send: + function(e) + { + var + f + = + QQWB.time.now(); + a.username + ? + d.open(a.type, + a.url, + a.async, + a.username, + a.password) + : + d.open(a.type, + a.url, + a.async); + try + { + a.type + == + "POST" + && + d.setRequestHeader("Content-Type", + "application/x-www-form-urlencoded"), + d.setRequestHeader("X-Requested-With", + "XMLHttpRequest"), + d.setRequestHeader("X-Requested-From", + "openjs") + } + catch + (g) + {} + d.send(a.data + || + null), + c + = + setTimeout(function() + { + QQWB.log.warning("request + timeout"), + e(599, + "network + connect + timeout", + QQWB.time.now() + - + f) + }, + QQWB.io._globalIOTimeout), + b + = + function(g, + h) + { + var + i, + j, + k, + l, + m, + n; + try + { + if + (b + && + (h + || + d.readyState + === + 4)) + { + b + = + null; + if + (h) + d.readyState + !== + 4 + && + d.abort(); + else + { + i + = + d.status, + k + = + d.getAllResponseHeaders(), + l + = + {}, + n + = + d.responseXML, + n + && + n.documentElement + && + (l.xml + = + n), + l.text + = + d.responseText; + try + { + j + = + d.statusText + } + catch + (o) + { + j + = + "" + } + i + === + 1223 + && + (i + = + 204), + a.dataType.toLowerCase() + == + "json" + ? + m + = + QQWB.JSON.fromString(l.text) + : + a.dataType.toLowerCase() + == + "xml" + ? + m + = + l.xml + : + m + = + l.text + } + clearTimeout(c), + e(i, + j, + QQWB.time.now() + - + f, + m, + l.text, + k, + a.dataType) + } + } + catch + (p) + { + var + q + = + p; + i + = + -2, + j + = + "", + j + += + "Exception + [Type:", + j + += + q + && + q.type + ? + q.type + : + "unknown + exception + type", + j + += + ", + Message:", + j + += + q + && + q.message + ? + q.message + : + q, + j + += + "]", + QQWB.log.warning("caught + " + + + j + + + " + exception + QQWB.io._IOAjax"), + h + || + (clearTimeout(c), + e(i, + j, + QQWB.time.now() + - + f)) + } + }, + !a.async + || + d.readyState + === + 4 + ? + b() + : + d.onreadystatechange + = + b + }, + abort: + function() + { + b + && + b(0, + 1) + } + } + }, + _IOFlash: + function(a) + { + var + b, + c, + d, + a + = + a + || + {}; + return + { + send: + function(e) + { + var + f + = + QQWB.time.now(); + d + = + 1, + c + = + setTimeout(function() + { + QQWB.log.warning("request + timeout"), + e(599, + "network + connect + timeout", + QQWB.time.now() + - + f) + }, + QQWB.io._globalIOTimeout), + b + = + function(d, + g) + { + var + h, + i, + j, + k, + l, + m, + n + = + 4; + clearTimeout(c); + try + { + b + && + (g + || + n + == + 4) + && + (b + = + null, + g + ? + e(-1, + "request + has + aborted", + QQWB.time.now() + - + f) + : + (h + = + this.httpStatus, + i + = + this.httpStatus + == + 200 + ? + "ok" + : + "", + j + = + "", + k + = + {}, + k.text + = + this.httpResponseText, + a.dataType.toLowerCase() + == + "json" + ? + l + = + QQWB.JSON.fromString(k.text) + : + a.dataType.toLowerCase() + == + "xml" + ? + l + = + QQWB.XML.fromString(k.text) + : + l + = + k.text), + e(h, + i, + QQWB.time.now() + - + f, + l, + k.text, + j, + a.dataType)) + } + catch + (o) + { + var + p + = + o; + h + = + -2, + i + = + "", + i + += + "Exception + [Type:", + i + += + p + && + p.type + ? + p.type + : + "unknown + exception + type", + i + += + ", + Message:", + i + += + p + && + p.message + ? + p.message + : + p, + i + += + "]", + QQWB.log.warning("caught + " + + + i + + + " + exception + QQWB.io._IOFlash"), + g + || + e(h, + i, + QQWB.time.now() + - + f) + } + }, + window.onFlashRequestComplete_8df046 + || + (window.onFlashRequestComplete_8df046 + = + function(a) + { + if + (!a.ticket) + { + QQWB.log.error("ticket + doesn't + exists + in + response, + " + + + QQWB.JSON.stringify(a)); + return + } + var + b + = + window.onFlashRequestComplete_8df046.callbacks.getByTicket(a.ticket), + c + = + a.srcEvent; + b.readyState + || + (b.readyState + = + 0), + /httpStatus/i.test(c.type) + ? + (b.httpStatus + = + c.status, + b.readyState++) + : + /error/i.test(c.type) + ? + (b.httpError + = + c.type, + b.readyState++) + : + /complete/i.test(c.type) + && + (b.httpResponseText + = + c.target.data, + b.readyState++), + b.readyState + == + 2 + && + (b.call(b), + window.onFlashRequestComplete_8df046.callbacks.unregister(a.ticket)) + }, + window.onFlashRequestComplete_8df046.callbacks + = + { + _callbackPool: + {}, + _ticketPrefix: + "openjstkt", + _ticketStartIndex: + 0, + register: + function(a) + { + var + b; + return + this._ticketStartIndex++, + b + = + this._ticketPrefix + + + this._ticketStartIndex, + this._callbackPool[b] + = + a, + b + }, + getByTicket: + function(a) + { + return + this._callbackPool[a] + || + QQWB.log.error("get + callback + failed, + callback + doesn't + exist + at + ticket + " + + + a), + this._callbackPool[a] + }, + unregister: + function(a) + { + return + this._callbackPool[a] + ? + (delete + this._callbackPool[a], + !0) + : + (QQWB.log.error("unregister + callback + failed, + callback + doesn't + exist + at + ticket + " + + + a), + !1) + } + }), + QQWBFlashTransport + && + QQWBFlashTransport.httpRequest + ? + QQWBFlashTransport.httpRequest(a.url, + a.data, + a.type, + window.onFlashRequestComplete_8df046.callbacks.register(b)) + : + QQWB.log.critical("flash + transportation + object + error" + + + QQWBFlashTransportName) + }, + abort: + function() + { + b + && + b(0, + 1) + } + } + }, + _apiAjax: + function(a, + b, + c, + d) + { + var + e + = + { + type: + d.toUpperCase(), + url: + QQWB._domain.api + + + a, + data: + QQWB.queryString.encode(b), + dataType: + c + }; + return + e.type + == + "GET" + && + (e.url + += + e.data + ? + "?" + + + e.data + : + "", + delete + e.data), + QQWB.io.ajax(e) + }, + _apiFlashAjax: + function(a, + b, + c, + d) + { + var + e + = + { + type: + d.toUpperCase(), + url: + QQWB._domain.api + + + a, + data: + QQWB.queryString.encode(b), + dataType: + c + }; + return + e.type + == + "GET" + && + (e.url + += + e.data + ? + "?" + + + e.data + : + "", + delete + e.data), + QQWB.io.flashAjax(e) + }, + _apiResponder: + function(a) + { + return + + function(b, c, d, e, f, g, h) { var i, j; b !== 200 ? (b = 2e6 + + Math.abs(b ? b : 0), a.reject(b, c, d, "")) : typeof(i + = QQWB._apiProvider._apiParseRetCode(f)) == "number" && + 0 !== i ? (j = + QQWB._apiProvider._apiParseErrorCode(f), + b = 1e6 + i * 1e3 + 500 + (j ? + j : 0), a.reject(b, + QQWB._apiProvider._apiGetErrorMessage(i, + j), d, + f)) : + a.resolve(b, c, d, e, g, h) } }, + _ajaxResponder: + function(a) + { + return + + function(b, c, d, e, f, g, h) { b !== 200 ? a.reject(b, c, d, "") : + a.resolve(e, d, f) } }, flashAjax: function(a) { var b = + QQWB.deferred.deferred(), c = { type: "get", dataType: + "json" }; return QQWB.extend(c, a, !0), + QQWB.io._IOFlash(c).send(QQWB.io._apiResponder(b)), + b.promise() }, ajax: function(a) { var b = + QQWB.deferred.deferred(), c = { type: "get", + dataType: "json" }; return + QQWB.extend(c, a, !0), + QQWB.io._IOAjax(c).send(QQWB.io._apiResponder(b)), + b.promise() }, ajax2: function(a) { var + b = QQWB.deferred.deferred(), c + = { type: "get", + dataType: + "json" + }; return + QQWB.extend(c, a, !0), + QQWB.io._IOAjax(c).send(QQWB._ajaxResponder(b)), + b.promise() }, script: + function(a, b) + { var b = b || + "utf-8", + c = + QQWB.deferred.deferred(); + return + QQWB.io._IOScript({ + charset: + b, + url: + a + }).send(function(a, + b, + d) + { + a + !== + 200 + ? + c.reject(a, + b, + d) + : + c.resolve(a, + b, + d) + }), + c.promise() + }, jsonp: + function(a) { var b = + QQWB.deferred.deferred(), + c = "callback", d = + "jsonp_", e = d + + QQWB.uid(), f + = + window.callbackName, + g, h = { dataType: + "text", + charset: + "utf-8", + url: "" }; + return QQWB.extend(h, + a, !0), + h.data && (h.url + += + "?" + + + h.data + + + "&" + + + c + + + "=" + + + e), + window[e] = + function(a) + { var c + = + a; + h.dataType.toLowerCase() + === + "json" + ? + c + = + QQWB.JSON.fromString(a) + : + h.dataType.toLowerCase() + === + "xml" + && + (c + = + QQWB.XML.fromString(a)), + b.resolve(c, + g), + window[e] + = + f + }, + QQWB.io._IOScript(h).send(function(a, + c, + d) + { + a + !== 200 + && + b.reject(a, + c, + d), + g = d }), + b.promise() } + }), + QQWB._alias("ajax", + QQWB.io.ajax2), + QQWB._alias("jsonp", + QQWB.io.jsonp), + QQWB._alias("script", + QQWB.io.script), + QQWB.extend("_token", + { + setAccessToken: + function(a, + b, + c, + d) + { + var + e + = + this.getTokenUser(!0); + return + QQWB.cookie.set(QQWB._cookie.names.accessToken, + [a, + QQWB.time.now() + + + b + * + 1e3, + c + || + e + && + e.name + || + "", + d + || + e + && + e.nick + || + ""].join("|"), + 31536e3, + QQWB._cookie.path, + QQWB._cookie.domain), + QQWB + }, + getAccessToken: + function(a) + { + var + b + = + QQWB.cookie.get(QQWB._cookie.names.accessToken); + if + (b) + { + b + = + b.split("|", + 2); + if + (a + || + parseInt(b[1], + 10) + > + QQWB.time.now()) + return + b[0] + } + }, + getTokenUser: + function(a) + { + var + b + = + QQWB.cookie.get(QQWB._cookie.names.accessToken); + if + (b) + { + b + = + b.split("|", + 4); + if + (a + || + parseInt(b[1], + 10) + > + QQWB.time.now()) + return + { + name: + b[2], + nick: + b[3] + } + } + }, + clearAccessToken: + function() + { + return + QQWB.cookie.del(QQWB._cookie.names.accessToken, + QQWB._cookie.path, + QQWB._cookie.domain), + QQWB + }, + setRefreshToken: + function(a) + { + return + QQWB.cookie.set(QQWB._cookie.names.refreshToken, + a, + 31536e3, + QQWB._cookie.path, + QQWB._cookie.domain), + QQWB + }, + getRefreshToken: + function() + { + return + QQWB.cookie.get(QQWB._cookie.names.refreshToken) + }, + clearRefreshToken: + function() + { + return + QQWB.cookie.del(QQWB._cookie.names.refreshToken, + QQWB._cookie.path, + QQWB._cookie.domain), + QQWB + }, + exchangeForToken: + function(a) + { + return + QQWB.io.jsonp({ + url: + QQWB._domain.exchange, + data: + QQWB.queryString.encode({ + response_type: + "token", + client_id: + QQWB.appkey.value, + scope: + "all", + state: + "1", + refresh_token: + this.getRefreshToken(), + access_token: + this.getAccessToken(!0) + }) + }).success(function(a) + { + var + b + = + a; + QQWB.String.isString(a) + && + (a + = + QQWB.queryString.decode(a)), + a.access_token + ? + (!a.expires_in + && + QQWB.log.error("token + expires_in + not + retrieved"), + !a.wb_name + && + QQWB.log.warning("weibo + username + not + retrieved, + will + not + update + username"), + !a.wb_nick + && + QQWB.log.warning("weibo + usernick + not + retrieved, + will + not + update + usernick"), + QQWB._token.setAccessToken(a.access_token, + parseInt(a.expires_in, + 10), + a.wb_name, + a.wb_nick), + a.refresh_token + ? + QQWB._token.setRefreshToken(a.refresh_token) + : + QQWB.log.error("refresh + token + not + retrieved"), + QQWB.log.info("exchange + token + succeed")) + : + a.error + ? + QQWB.log.error("exchange + token + error + " + + + a.error) + : + QQWB.log.error("unexpected + result + returned + from + server + " + + + b + + + " + while + exchanging + for + new + access + token") + }).error(function(a, + b) + { + a + === + 404 + ? + QQWB.log.error("exchange + token + has + failed, + script + not + found") + : + QQWB.log.error("exchange + token + has + failed, + " + + + b) + }).complete(function(b, + c, + d) + { + a + && + a.apply(QQWB, + [b, + c, + d]) + }), + QQWB + }, + getNewAccessToken: + function(a) + { + return + QQWB.io.jsonp({ + url: + QQWB._domain.query, + data: + QQWB.queryString.encode({ + response_type: + "token", + client_id: + QQWB.appkey.value, + scope: + "all", + state: + "1" + }) + }).success(function(a) + { + var + b + = + a; + QQWB.String.isString(a) + && + (a + = + QQWB.queryString.decode(a)), + a.access_token + ? + (!a.expires_in + && + QQWB.log.error("token + expires_in + not + retrieved"), + !a.wb_name + && + QQWB.log.warning("weibo + username + not + retrieved"), + !a.wb_nick + && + QQWB.log.warning("weibo + usernick + not + retrieved"), + QQWB._token.setAccessToken(a.access_token, + parseInt(a.expires_in, + 10), + a.wb_name, + a.wb_nick), + a.refresh_token + ? + QQWB._token.setRefreshToken(a.refresh_token) + : + QQWB.log.error("refresh + token + not + retrieved"), + QQWB.log.info("retrieve + new + access + token + succeed")) + : + a.error + ? + QQWB.log.error("retrieve + new + access + token + error + " + + + a.error) + : + QQWB.log.error("unexpected + result + returned + from + server + " + + + b + + + " + while + retrieving + new + access + token") + }).error(function(a, + b) + { + a + === + 404 + ? + QQWB.log.error("get + token + has + failed, + script + not + found") + : + QQWB.log.error("get + token + failed, + " + + + b) + }).complete(function(b, + c, + d) + { + a + && + a.apply(QQWB, + [b, + c, + d]) + }), + QQWB + }, + resolveResponse: + function(a, + b) + { + var + c, + d + = + (b + || + window).QQWB, + e + = + QQWB.String.isString(a) + ? + d.queryString.decode(a) + : + a; + e.access_token + ? + (d._token.setAccessToken(e.access_token, + parseInt(e.expires_in, + 10), + e.wb_name, + e.wb_nick), + e.refresh_token + ? + d._token.setRefreshToken(e.refresh_token) + : + d.log.error("refresh + token + not + retrieved"), + c + = + d.loginStatus(), + d.log.info("user + " + + + c.name + + + " + logged + in"), + d.trigger(d.events.USER_LOGGEDIN_EVENT, + c)) + : + e.error + ? + (d.log.error("login + error + occurred + " + + + e.error), + e.message + = + e.error, + d.trigger(d.events.USER_LOGIN_FAILED_EVENT, + e)) + : + (d.log.error("unexpected + result + returned + from + server + " + + + a), + e.message + = + e.error + = + "server + error", + d.trigger(d.events.USER_LOGIN_FAILED_EVENT, + e)) + } + }), + QQWB.extend("_eventProvider", + { + _getEventsMap: + function() + { + return + this._eventsMap + || + (this._eventsMap + = + {}), + this._eventsMap + }, + bind: + function(a, + b) + { + var + c + = + this._getEventsMap(); + c[a] + ? + QQWB.Array.inArray(c[a], + b) + || + c[a].push(b) + : + c[a] + = + [b] + }, + unbind: + function(a, + b) + { + var + c + = + this._getEventsMap()[a]; + if + (c) + if + (b) + for + (var + d + = + 0, + e + = + c.length; + d + < + e; + d++) + b + === + c[d] + && + (c[d] + = + null); + else + delete + this._getEventsMap()[a] + }, + trigger: + function(a, + b) + { + var + c + = + this._getEventsMap()[a]; + if + (c) + for + (var + d + = + 0, + e + = + c.length; + d + < + e; + d++) + { + var + f + = + c[d]; + f + && + f.call(QQWB, + b) + } + } + }), + QQWB.extend("", + { + bind: + function(a, + b) + { + return + a + = + a.toLowerCase(), + this._eventProvider.bind(a, + b), + this + }, + once: + function(a, + b) + { + a + = + a.toLowerCase(); + var + c + = + function() + { + var + d + = + QQWB.Array.fromArguments(arguments); + b.apply(QQWB, + d), + this._eventProvider.unbind(a, + c), + c + = + null + }; + return + this._eventProvider.bind(a, + c), + this + }, + unbind: + function(a, + b) + { + return + a + = + a.toLowerCase(), + this._eventProvider.unbind(a, + b), + this + }, + trigger: + function(a, + b) + { + return + a + = + a.toLowerCase(), + this._eventProvider.trigger(a, + b), + this + } + }), + QQWB.extend("events", + { + USER_LOGGEDIN_EVENT: + "UserLoggedIn", + USER_LOGIN_FAILED_EVENT: + "UserLoginFailed", + USER_LOGGEDOUT_EVENT: + "UserLoggedOut", + TOKEN_READY_EVENT: + "tokenReady", + DOCUMENT_READY_EVENT: + "documentReady", + EVERYTHING_READY_EVENT: + "everythingReady" + }), + function() +{ function j(a) { a = a.toLowerCase(); var b = e.exec(a) || d.exec(a) || + c.exec(a) || a.indexOf("compatible") < 0 && f.exec(a) || []; return { + browser: b[1] || "unknown", version: b[2] || "0" } } + + function k() { for (var a in i) i.hasOwnProperty(a) && i[a]() && (g[a] = + !0) } + + function l() { var a = navigator.userAgent || navigator.vendor || + window.opera; return + /android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge + |maemo|midp|mmp|opera m(ob|in)i|palm( + os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows + (ce|phone)|xda|xiino/i.test(a) || + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a + wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r + |s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 + u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( + i|ip)|hs\-c|ht(c(\-| + |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( + |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( + |\/)|klon|kpt + |kwc\-|kyo(c|k)|le(no|xi)|lg( + g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| + |o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g + |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, + 4)) + ? { + mobile: + !0 + } : + { pc: !0 } } + + function m() { var a = navigator.appVersion, b = {}, c = "unknown"; return + a.indexOf("Win") != -1 && (c = "windows"), a.indexOf("Mac") != -1 + && (c = "mac"), a.indexOf("X11") != -1 && (c = "unix"), + a.indexOf("Linux") != -1 && (c = "linux"), b[c] = !0, b } var a, b + = navigator.userAgent, c = /(msie) ([\w.]+)/, d = + /(opera)(?:.*version)?[ \/]([\w.]+)/, e = /(webkit)[ + \/]([\w.]+)/, f = /(mozilla)(?:.*? rv:([\w.]+))?/, g = {}, + h = ["Webkit", "Moz", "O", "ms", "khtml"], i = { cookie: function() + { var a = navigator.cookieEnabled; if (a && + QQWB.browser.webkit) { var b = + "COOKIE_TEST_" + QQWB.uid(); + document.cookie = b + "=" + 1 + "; + domain=; path=;", + document.cookie.indexOf(b) + < 0 ? a = !1 : + document.cookie = b + + "=" + "; + expires=" + (new Date(1970, 1, + 1)).toUTCString() + "; + domain=; path=;" } return !a && + QQWB.log.critical("Your + browser + doesn't + support + cookie or + cookie + isn't + enabled"), + a }, flash: function() { if + (typeof + navigator.plugins + != "undefined" && + typeof + navigator.plugins["Shockwave + Flash"] == + "object") { var a + = + navigator.plugins["Shockwave + Flash"].description, + b = typeof + navigator.mimeTypes + != + "undefined" + && + navigator.mimeTypes["application/x-shockwave-flash"] + && + navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin; + return a + && + b + } if (typeof + window.ActiveXObject + != + "undefined") + try { var c = new + ActiveXObject("ShockwaveFlash.ShockwaveFlash"); + if (c) + return + c.getVariable("$version") + } catch (d) {} }, + userdata: function() { + return + QQWB.browser.msie + }, postmessage: function() + { return !!window.postMessage && + (QQWB.browser.msie && + parseInt(QQWB.browser.version, + 10) < 8 ? !1 : !0) + }, canvas: function() { var a = + document.createElement("canvas"); + return !!a.getContext && !! + a.getContext("2d") + }, webgl: function() { return + !!window.WebGLRenderingContext + }, geolocation: function() { return + !!navigator.geolocation }, + websqldatabase: function() + { return + !!window.openDatabase + }, indexeddb: function() { + for (var a = 0, b = + h.length; + a < + b; + a++) + if + (window[h[a].toLowerCase() + + + "IndexedDB"]) + return + !0; + return + !!window.indexedDB + }, websocket: function() { + for (var a = 0, b = + h.length; + a < + b; + a++) + if + (window[h[a].toLowerCase() + + + "WebSocket"]) + return + !0; + return + !!window.WebSocket + }, localstorage: function() + { return + window.localStorage + && + localStorage.getItem + }, sessionstorage: + function() { return + window.sessionStorage + && + sessionStorage.getItem + }, webworker: function() { + return + !!window.Worker + }, applicationcache: + function() { return + !!window.applicationCache + } }; a = j(b), + QQWB.extend("browser", { version: a.version }), + QQWB.browser[a.browser] = !0, k(), QQWB.extend("browser.feature", + g), QQWB.extend("browser.platform", l()), + QQWB.extend("browser.os", m()) }(), QQWB.extend("flash", { + NO_CACHE: 1, load: function(a, b, c) { this.loadedSwfs || + (this.loadedSwfs = []); if + (QQWB.Array.inArray(this.loadedSwfs, a)) { + QQWB.log.warning(a + "is already loaded"); return } + c === this.NO_CACHE && (a += "?" + QQWB.uid()); var d = + "movieContainer_" + QQWB.uid(), e = "movie_" + QQWB.uid(), + f = "onFlashReady_a1f5b4ce", g = window[f]; return window[f] = + function() { b && b(e), window[f] = g, g = null, b && (b = + null), e = null }, + QQWB.dom.appendHidden(["', '', '', + ""].join(" "), { id: d }, !0), + document.getElementById(d) }, getSWFObjectByName: function(a) { + return QQWB.browser.msie ? window[a] : document[a].length ? + document[a][1] : document[a] } }), + QQWB.extend("_solution", { HTML5_SOLUTION: "html5", + FLASH_SOLUTION: "flash", + SILVER_LIGHT_SOLUTION: "silverlight", initSolution: + function(a) { var b, c = + QQWB.deferred.deferred(); !this[a] + && QQWB.Array.inArray([this.HTML5_SOLUTION, + this.FLASH_SOLUTION, + this.SILVER_LIGHT_SOLUTION], a) && + (this[a] = {}, this[a].name = a, + this[a].readyState = 0, this[a].id = + "solution_" + QQWB.uid(), this[a].deferred + = QQWB.deferred.deferred(), + this[a].promise = + this[a].deferred.promise()); if (this[a] + && this[a].readyState !== 0) + this[a].deferred.success(function() { + c.resolve(QQWB.Array.fromArguments(arguments)) + }).fail(function() { + c.reject(QQWB.Array.fromArguments(arguments)) + }); else switch (a) { case + this.HTML5_SOLUTION: if + (QQWB.browser.feature.postmessage) + { b = + this[this.HTML5_SOLUTION]; + var d = + function(a) + { + QQWB._domain.serverproxy.indexOf(a.origin) + !== + 0 + ? + QQWB.log.warning("unexpected + message + arrived + from + " + + + a.origin + + + " + with + data + " + + + a.data) + : + (a.data + === + "success" + ? + (QQWB.log.info("html5 + solution + was + successfully + initialized"), + b.readyState + = + 1, + b.deferred.resolve()) + : + QQWB.log.info("unexpected + solution + signal + " + + + a.data), + window.addEventListener + ? + window.removeEventListener("message", + d, + !1) + : + window.attachEvent + && + window.detachEvent("onmessage", + d), + d + = + null) + }; + window.addEventListener + ? + window.addEventListener("message", + d, + !1) + : + window.attachEvent + && + window.attachEvent("onmessage", + d), + QQWB.everythingReady(function() + { + QQWB.log.info("init + html5 + solution..."), + serverframe + = + QQWB.dom.createHidden("iframe", + { + id: + b.id, + src: + QQWB._domain.serverproxy + }), + QQWB.dom.append(serverframe), + serverframe.onload + = + function(a) + { + setTimeout(function() + { + b.readyState + !== + 1 + && + (QQWB.log.error("html5 + solution + initialition + has + failed, + server + proxy + frame + encountered + error"), + b.readyState + = + 2, + b.deferred.reject(-1, + "server + proxy + frame + not + working")) + }, + 1e3) } }) + } else + QQWB.log.error("can't + init + solution + \"" + + + a) + + + "\",browser + doesn't + support + postmessage", + c.reject("browser + not + supported"); + break; case + this.FLASH_SOLUTION: + QQWB.browser.feature.flash + ? (b = + this[this.FLASH_SOLUTION], + QQWB.everythingReady(function() + { + QQWB.log.info("init + flash + solution..."); + var + a, + c + = + 1e4, + d + = + QQWB.flash.load(QQWB._domain.flashproxy, + function(c) + { + QQWB.log.info("flash + solution + initlized + successfully"), + b.readyState + = + 1, + window.QQWBFlashTransport + = + QQWB.flash.getSWFObjectByName(c), + a + && + clearTimeout(a), + b.deferred.resolve() + }, + QQWB.flash.NO_CACHE); + a + = + setTimeout(function() + { + b.deferred.isResolved() + || + (b.readyState + = + 2, + b.deferred.reject(-1, + "encounter + error + while + loading + proxy + swf, + need + newer + flash + player"), + QQWB.dom.remove(d)) + }, + c) + })) + : (QQWB.log.error("can't + init + solution + \"" + + + a) + + + "\",browser + doesn't + support + flash or + flash is + disabled", + c.reject("browser + not + supported")); + break; case + this.SILVER_LIGHT_SOLUTION: + QQWB.browser.feature.silverlight + ? (-2, + QQWB.log.error("sorry, + silverlight + solution + is + not + implemented")) + : + (QQWB.log.error("can't + init + solution + \"" + + + a) + + "\",browser + doesn't support + silverlight or + silverlight is + disabled", + c.reject("browser + not + supported")); + break; default: + QQWB.log.error("can't + init + solution + \"" + + + a) + + '",not + supported', + c.reject("solution + " + + + a + + + " + not + supported") + } return c.promise() } }), + QQWB.extend("ping", { _pingbackURL: + "http://btrace.qq.com/collect", + _stupidPingParamsOrder: ["ftime", "sIp", + "iQQ", "sBiz", "sOp", "iSta", "iTy", + "iFlow"], _paramSeprator: ";", + _getBasePingParams: function() { var a = + QQWB.cookie.get("uin", null, + "0").match(/\d+/)[0], b = + ""; return { sIp: "", iQQ: + a, sBiz: + "open-js", sOp: "", iSta: "", iTy: + 1183, iFlow: b, iFrom: "", + iPubFrom: "", sUrl: "", iUrlType: "", + iPos: "", sText: "", iBak1: "", iBak2: "", + sBak1: "", sBak2: QQWB.uid() } }, + pingWith: function(a, b) { a = + QQWB.extend(QQWB.ping._getBasePingParams(), + a, !0), + QQWBPingTransport_18035d19 = new + Image(1, 1), + QQWBPingTransport_18035d19.src = + QQWB.ping._pingbackURL + "?" + + QQWB.queryString.encode(a, null, + null, b) }, + pingInit: function() { function a() { var + a = 1e6; return feature = 0, + QQWB.browser.msie ? a += 100 : + QQWB.browser.opera ? a += + 200 : QQWB.browser.webkit + ? a += 300 : + QQWB.browser.mozilla ? a + += 400 : a += 500, + QQWB.browser.feature.postmessage + && (feature += 1), + QQWB.browser.feature.flash && + (feature += 2), + QQWB.browser.feature.cookie && + (feature += 4), a += + feature, a } + + function b() { var a = 1e6; return QQWB.browser.platform.mobile ? a += + 100 : a += 200, QQWB.browser.os.windows ? a += 10 : + QQWB.browser.os.windows ? a += 20 : QQWB.browser.os.mac + ? a += 30 : QQWB.browser.os.unix ? a += 40 : + QQWB.browser.os.linux ? a += 50 : a += 60, a += + parseInt(QQWB.appkey.version, 10), a } return + QQWB.ping.pingWith({ sOp: "init", iFrom: + QQWB.version.replace(/\./g, ""), iPubFrom: b(), + sUrl: [document.title, + document.location.href].join(QQWB.ping._paramSeprator), + sText: QQWB.appkey.value, iBak1: a() }, + QQWB.ping._stupidPingParamsOrder.concat("iFrom", + "iPubFrom", "sUrl", "iUrlType", "iPos", + "sText", "iBak1", "iBak2", "sBak1", "sBak2")) + }, _pingAuthorize: function(a) { return + QQWB.ping.pingWith({ sOp: "login", + iSta: a ? 1 : 0, iFrom: + QQWB.version.replace(/\./g, + ""), sUrl: + document.location.href, + sText: QQWB.appkey.value }, + QQWB.ping._stupidPingParamsOrder.concat("iFrom", + "iPubFrom", "sUrl", + "iUrlType", "iPos", + "sText", "iBak1", "iBak2", + "sBak1", "sBak2")) }, + pingLoggedIn: function() { + return + QQWB.ping._pingAuthorize(!0) + }, pingLoggedInFailed: + function() { return + QQWB.ping._pingAuthorize(!1) + }, pingAPI: function(a, b, c, d, + e, f, g, h) { var + i = 1e6; a + = + a + || + "", + b = b || + "", + c = c || + "", + d = d || + "", + e = e || + "-2", + f = f || + "", + g = g || + "-1", + h = h || + ""; + switch (h) + { case + QQWB._solution.HTML5_SOLUTION: + case + "postmessage": + i + += + 100; + break; + case + QQWB._solution.FLASH_SOLUTION: + i + += + 200; + break; + case + QQWB._solution.SILVER_LIGHT_SOLUTION: + i + += + 400 + } d = + d.toUpperCase(); + switch (d) + { case + "GET": + i + += + 10; + break; + case + "POST": + i + += + 20 + } return + QQWB.ping.pingWith({ + sOp: + "api", + iSta: + e, + iFrom: + QQWB.version.replace(/\./g, + ""), + iPubFrom: + i, + sUrl: + document.location.href, + sText: + QQWB.appkey.value, + iBak1: + g, + sBak1: + [a, + b].join(QQWB.ping._paramSeprator) + }, + QQWB.ping._stupidPingParamsOrder.concat("iFrom", + "iPubFrom", + "sUrl", + "iUrlType", + "iPos", + "sText", + "iBak1", + "iBak2", + "sBak1", + "sBak2")) + } }), + QQWB.extend("door", + { + doors: + 0, door: + function(a, + b) + { var c = + 0; + return + this.doors++, + { lock: function() + { return + c++, + a && a.call(QQWB), + this }, unlock: + function() + { return c--, c = + Math.max(0, + c), + b && + b.call(QQWB), + this }, + isOpen: function() + { return c === 0 } + } }, count: + function() { + return + this.doors + } }), + QQWB.extend("", { + init: + function(a) + { if (this._inited + === !0) + return + this.log.warning("already + initialized"), + this; + this.log.info("init + signal has + arrived"), + a = + QQWB.extend({ + callbackurl: + document.location.href.replace(location.search, + "").replace(location.hash, + ""), + pingback: + !0, + synclogin: + !0 + }, a, !0), + QQWB.pingback = + a.pingback; + var b = + this._token.getAccessToken(), + c = + this._token.getAccessToken(!0), + d = + this._token.getRefreshToken(), + e = d && + !b + && + c, + f = !d && + !b + && + a.synclogin; + return a.appkey && + (this.log.info("client + id + is + " + + + a.appkey), + this.assign("appkey.value", + "APPKEY", + a.appkey)), + this.log.info("client + proxy + uri + is + " + + + a.callbackurl), + this.assign("_domain", + "CLIENTPROXY_URI", + a.callbackurl), + (e || f) + && + QQWB._tokenReadyDoor.lock(), + e ? + (this.log.info("exchanging + refresh + token + to + access + token..."), + QQWB._token.exchangeForToken(function(b) + { + a.synclogin + && + b.error + && + (QQWB.log.warning("exchange + token + has + failed, + trying + to + retrieve + a + new + access_token..."), + this._tokenReadyDoor.lock(), + QQWB._token.getNewAccessToken(function() + { + this._tokenReadyDoor.unlock() + })), + this._tokenReadyDoor.unlock() + })) + : f && + (this.log.info("retrieving + new + access + token..."), + QQWB._token.getNewAccessToken(function() + { + QQWB._tokenReadyDoor.unlock() + })), + /^[a-z\d][a-z\d]{30}[a-z\d]$/i.test(QQWB.appkey.value) + ? + this.assign("appkey", + "APPKEY_VERSION", + 1) + : + /^[1-9][0-9]{7}[0-9]$/.test(QQWB.appkey.value) + ? + this.assign("appkey", + "APPKEY_VERSION", + 2) + : + this.assign("appkey", + "APPKEY_VERSION", + 3), + this._inited + = + !0, + QQWB._tokenReadyDoor.unlock(), + this.pingback + && + this.ping + && + this.ping.pingInit(), + this.pingback + && + this.ping + && + QQWB.bind(QQWB.events.USER_LOGGEDIN_EVENT, + this.ping.pingLoggedIn), + this.pingback + && + this.ping + && + QQWB.bind(QQWB.events.USER_LOGIN_FAILED_EVENT, + this.ping.pingLoggedInFailed), + this }, + _tokenReadyDoor: + QQWB.door.door(function() + { + this.log.info("tokenReady + is + locked") + }, + function() + { + this.log.info("tokenReady + is + unlocked"), + this._tokenReadyDoor.isOpen() + && + this.log.info("token + is + ready") + && + this.trigger(this.events.TOKEN_READY_EVENT) + }), + tokenReady: + function(a) + { return + this._tokenReadyDoor.isOpen() + ? + a + && + a() + : + this.bind(this.events.TOKEN_READY_EVENT, + a), + this + }, + _isDocumentReady: + !1, + _tryToTriggerDocumentReadyEvents: + function() + { if + (this._isDocumentReady) + return; + try + { + var + a + = + document.getElementsByTagName("body")[0].appendChild(document.createElement("span")); + a.parentNode.removeChild(a) + } + catch + (b) + { + return + } + this._isDocumentReady + = + !0, + this.log.info("document + is + ready"), + this._everythingReadyDoor.unlock(), + this.trigger(this.events.DOCUMENT_READY_EVENT) + }, + documentReady: + function(a) + { return + this._isDocumentReady + ? + a + && + a() + : + (this.bind(this.events.DOCUMENT_READY_EVENT, + a), + this._tryToTriggerDocumentReadyEvents()), + this + }, + _everythingReadyDoor: + QQWB.door.door(function() + { + this.log.info("everythingReady + is + locked") + }, + function() + { + this.log.info("everythingReady + is + unlocked"), + this._everythingReadyDoor.isOpen() + && + this.log.info("everything + is + ready") + && + this.trigger(this.events.EVERYTHING_READY_EVENT) + }), + everythingReady: + function(a) + { return + this._everythingReadyDoor.isOpen() + ? + a + && + a() + : + this.bind(this.events.EVERYTHING_READY_EVENT, + a), + this + } }), + T.alias("ready", + "everythingReady"), + function() +{ function c() { QQWB.browser.feature.postmessage ? + QQWB._solution.initSolution(QQWB._solution.HTML5_SOLUTION) : + QQWB.browser.feature.flash ? + QQWB._solution.initSolution(QQWB._solution.FLASH_SOLUTION) + : QQWB.log.error("init solution is called, but no + solution for the browser") } var a = + window != window.parent, b = QQWB._domain.serverproxy + === window.location.href; QQWB._tokenReadyDoor.lock(), + QQWB._everythingReadyDoor.lock(), + QQWB._everythingReadyDoor.lock(), + QQWB.bind(QQWB.events.TOKEN_READY_EVENT, function() { + QQWB._everythingReadyDoor.unlock() }); if (a && b && + QQWB.browser.feature.postmessage) { + QQWB.log.info("library booting at server proxy + mode"); var d = "*", e = + window.parent; e.postMessage("success", + d); var f = function(a) + { var b = QQWB.JSON.fromString(a.data), + c = b.id, f = b.data, g = f[0]; + f[2].toLowerCase() == "xml" && + (f[2] = "xmltext"), g ? + QQWB.io._apiAjax.apply(this, + f).complete(function() + { + e.postMessage(QQWB.JSON.stringify({ + id: + c, + data: + QQWB.Array.fromArguments(arguments) + }), + d) + }) + : + (e.postMessage(QQWB.JSON.stringify({ + id: c, data: + [-1, "interface + can not be + empty"] }), d), + QQWB.log.error("interface + is empty")) }; + window.addEventListener ? + window.addEventListener("message", + f, !1) + : window.attachEvent && + window.attachEvent("onmessage", + f); + return } QQWB.log.info("library + booting at + normal mode"), + c() }(), + QQWB._isDocumentReady || + (window.addEventListener + && + document.addEventListener("DOMContentLoaded", + function() { + QQWB._tryToTriggerDocumentReadyEvents() + }, !1), + window.attachEvent && + (document.attachEvent("onreadystatechange", + function() + { + /complete/.test(document.readyState) + && + (document.detachEvent("onreadystatechange", + arguments.callee), + QQWB._tryToTriggerDocumentReadyEvents()) + }), + window === window.top + && function() { if + (QQWB._isDocumentReady) + return; try { + document.documentElement.doScroll("left") + } catch (a) { + setTimeout(arguments.callee, + 0); + return + } + QQWB._tryToTriggerDocumentReadyEvents() + }()), + QQWB.browser.webkit && + function() { if + (QQWB._isDocumentReady) + return; + if + (!/load|complete/.test(document.readyState)) + { + setTimeout(arguments.callee, + 0); + return + } + QQWB._tryToTriggerDocumentReadyEvents() + }()), function() { + function b() { + var c = + !! + QQWB._token.getAccessToken(), + d; a && + QQWB.log.info("cancel + the + **OLD** + maintain + token + schedule"), + a && + clearTimeout(a), + c ? (d + = + parseInt(QQWB.cookie.get(QQWB._cookie.names.accessToken).split("|")[1], + 10) + - + QQWB.time.now() + - + 15e3, + QQWB.log.info("scheduled + to + exchange + token + after + " + + + d + + + "ms"), + a + = + setTimeout(function() + { + QQWB._token.exchangeForToken(function() + { + b() + }) + }, + d)) + : + (a + && + QQWB.log.info("cancel + the + exchange + token + schedule"), + a + && + clearTimeout(a)) + } var a; + QQWB.bind(QQWB.events.TOKEN_READY_EVENT, + b), + QQWB.bind(QQWB.events.USER_LOGGEDIN_EVENT, + b), + QQWB.bind(QQWB.events.USER_LOGIN_FAILED_EVENT, + b), + QQWB.bind(QQWB.events.USER_LOGGEDOUT_EVENT, + b) + }(); if +(QQWB.browser.feature.localstorage) QQWB.extend("localStorage", { set: + function(a, b, c) { a = "k" + a; var d = QQWB.time.secondsNow() + (c || + 7) * 24 * 3600, e = { value: b, expire: d }; return + localStorage[a] = JSON.stringify(e), localStorage[a] }, get: + function(a, b) { a = "k" + a; var c = localStorage[a]; return c && (c = + JSON.parse(c)) && c.value && QQWB.time.secondsNow() < c.expire + ? c.value : b }, del: function(a) { return a = "k" + a, + localStorage.removeItem(a), !localStorage[a] } }); else +if (QQWB.browser.feature.userdata) { var userData, storeName = + "QQWBLocalStore"; QQWB.documentReady(function() { userData = + document.createElement("input"), userData.type = "hidden", + userData.style.display = "none", + userData.addBehavior("#default#userData"), userData.expires = + (new Date(QQWB.time.now() + 31536e7)).toUTCString(), + document.body.appendChild(userData) }), + QQWB.extend("localStorage", { set: function(a, b, c) { a = "k" + + a; var d = QQWB.time.secondsNow() + (c || 7) * 24 * + 3600, e = { value: b, expire: d }; return !userData && + QQWB.log.error("store can't set value for key " + a + + ", userData is unavaiable, please try later"), + userData && userData.load(storeName), userData && + userData.setAttribute(a, JSON.stringify(e)), userData + && userData.save(storeName), userData.getAttribute(a) + }, get: function(a, b) { a = "k" + a, !userData && + QQWB.log.error("store can't get value for key " + a + + ", userData is unavaiable, please try later"), + userData && userData.load(storeName); var c = userData + && userData.getAttribute(a); return c && (c = + JSON.parse(c)) && c.value && + QQWB.time.secondsNow() < c.expire ? c.value : b }, del: + function(a) { return a = "k" + a, !userData && + QQWB.log.error("store can't delete value for + key " + a + ", userData is unavaiable, + please try later"), userData && + userData.load(storeName), userData && + userData.removeAttribute(a), userData && + userData.save(storeName), !userData.getAttribute(a) } + }) } else QQWB.log.warning("T.localStorage object isn't + initialized, do check before use"); QQWB.localStorage + && (QQWB._alias.call(QQWB.localStorage, "save", + QQWB.localStorage.set), + QQWB._alias.call(QQWB.localStorage, "remove", + QQWB.localStorage.del)), + QQWB.extend("auth.authWindow", { _width: + QQWB._const.AUTH_WINDOW_WIDTH, _height: + QQWB._const.AUTH_WINDOW_HEIGHT, _name: + QQWB._const.AUTH_WINDOW_NAME, _url: QQWB._domain.auth, + _attribs: + "toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=yes,status=no", + _authorizing: !1, _window: null, show: function() { var a, b, + c, d; return this._authorizing ? this.focus() : (a = + (window.screenX || window.screenLeft) + + ((window.outerWidth || + document.documentElement.clientWidth) - + this._width) / 2, b = (window.screenY || + window.screenTop) + + ((window.outerHeight || + document.documentElement.clientHeight) - + this._height) / 2, c = + QQWB.queryString.encode({ response_type: + "token", client_id: QQWB.appkey.value, + redirect_uri: QQWB._domain.clientproxy, scope: + "all", status: 0 }), d = ["width=" + + this._width, "height=" + this._height, "left=" + + a, "top=" + b], this._window = + window.open(this._url + "?" + c, this._name, d + + "," + this._attribs), + this._authorizing = !0, function() { var a = + QQWB.auth.authWindow, b; if + (a._window.closed) { + QQWB._token.resolveResponse("error=access_denied"), + a.close(); return } try { b = + a._window.location.hash } catch + (c) { b = null } if (b) { b = + QQWB.queryString.decode(b.split("#").pop()), + parseInt(b.status, 10) + == 200 && + QQWB._token.resolveResponse(b), + a.close(); return } + setTimeout(arguments.callee, 0) }()), this }, close: + function() { return this._authorizing = !1, + this._window ? this._window.closed ? + this : (this._window.close(), + this) : this }, + focus: function() { return this._window + && this._window.focus(), this } + }), QQWB.extend("auth", { login: function(a, b) { QQWB._inited + || QQWB.log.critical("Library not initialized, call + T.init() to initialize"); var c = + QQWB.loginStatus(), d; if (c && a) { a(c); + return } if (a || b) d = function(c) { + c.access_token && a ? a(c) : + c.error && b ? b(c) : QQWB.log.warning("confused result + of T.login"), + QQWB.unbind(QQWB.events.USER_LOGGEDIN_EVENT, d), + QQWB.unbind(QQWB.events.USER_LOGIN_FAILED_EVENT, d), d = null + }, + QQWB.bind(QQWB.events.USER_LOGGEDIN_EVENT, d), + QQWB.bind(QQWB.events.USER_LOGIN_FAILED_EVENT, d); return + QQWB.auth.authWindow.show().focus(), QQWB }, logout: + function(a) { var b = QQWB.loginStatus(); return + QQWB.log.info("logging out user..."), b ? + (QQWB._token.clearAccessToken(), + QQWB._token.clearRefreshToken(), QQWB.log.info(b.name + + " has logged out successfully")) : + QQWB.log.warning("oops, user not logged in"), a && + a.call(QQWB), + QQWB.trigger(QQWB.events.USER_LOGGEDOUT_EVENT), QQWB }, + loginStatus: function(a) { var b, c = + QQWB._token.getAccessToken(), d = + QQWB._token.getTokenUser(); return c && (b = { + access_token: c, name: d.name, nick: + d.nick }), a && a.call(QQWB, b), b } + }), QQWB._alias("login", QQWB.auth.login), + QQWB._alias("logout", QQWB.auth.logout), + QQWB._alias("loginStatus", QQWB.auth.loginStatus), + QQWB.provide("api", function(a, b, c, d, e) { a = + this._apiProvider.compat(a), b = b || {}, c = (c || + "json").toLowerCase(), d = d || "GET"; var f, + g, h = c, i = { json: !0, xml: !0 }, j = + QQWB.deferred.deferred(); h in i || (h = "json"), + b.oauth_consumer_key = QQWB.appkey.value, b.oauth_token = + QQWB._token.getAccessToken(), b.oauth_version = "2.0", + b.format = h, f = j.promise(), e && + QQWB.Array.inArray([QQWB._solution.HTML5_SOLUTION, + QQWB._solution.FLASH_SOLUTION, + QQWB._solution.SILVER_LIGHT_SOLUTION], e) ? + (QQWB.log.warning("forced to use solution " + e), + QQWB._solution[e] || (QQWB.log.warning("forced to use + solution " + e + ", this solution is + not inited, initialzing..."), + QQWB._solution.initSolution[e]), g = + QQWB._solution[e]) : g = + QQWB.browser.feature.postmessage && + QQWB._solution[QQWB._solution.HTML5_SOLUTION] || + QQWB.browser.feature.flash && + QQWB._solution[QQWB._solution.FLASH_SOLUTION] || + QQWB.browser.feature.silverlight && + QQWB._solution[QQWB._solution.SILVER_LIGHT_SOLUTION]; + if (!g || g.readyState === 2) return + QQWB.log.critical("solution error"), j.reject(-1, + "solution error", 0), f; if + (g.readyState === 0) return + QQWB.log.warning("solution is not ready, your + api call request has been + cached, will invoke immediately + when solution is ready"), + g.promise.done(function() { + QQWB.log.info('invoking cached api call + "QQWB.api( ' + [a, b, c, + d].join(",") + ')"...'), QQWB.api(a, b, + c, d).success(function() { + j.resolveWith(j, + QQWB.Array.fromArguments(arguments)) + }).error(function() { j.rejectWith(j, + QQWB.Array.fromArguments(arguments)) + }) }).fail(function() { + QQWB.log.error("can't invoking + cached api call + \"QQWB.api( " + [a, b, + c, d].join(",") + ')"'), + j.rejectWith(j, + QQWB.Array.fromArguments(arguments)) + }), f; QQWB.api.id || + QQWB.extend(QQWB.api, { id: 0, total: function() { return + QQWB.api.id } }), QQWB.api.id++, QQWB.log.info("[" + + QQWB.api.id + '] requesting data "' + + QQWB._apiProvider.describe(a) + '" from + server...'); if (g === + QQWB._solution[QQWB._solution.HTML5_SOLUTION]) + { var k = document.getElementById(g.id); if + (!k) QQWB.log.critical("server proxy + not found"), + j.reject(-1, "server proxy not found", + 0); else if (k.src !== + QQWB._domain.serverproxy) + QQWB.log.critical("server + proxy + is + not + valid, + src + attribute + has + unexpected + value"), + j.reject(-1, "server + proxy + not + valid", + 0); + else { QQWB.api._deferredCollection || + QQWB.extend(QQWB.api, { + _deferredCollection: + {}, deferredAt: function(a) { + if + (this._deferredCollection[a]) + return + this._deferredCollection[a]; + QQWB.log.warning("get deferred + object has failed, that + object does not exist + at index " + a) }, + uncollect: function(a) + { this._deferredCollection[a] ? + delete + this._deferredCollection[a] + : + QQWB.log.warning("uncollect + deferred object + has failed, + that object + does not exist + at index " + a) + }, collect: function(a) { if + (a.promise) return + this._deferredCollection[this.id] + = a, this.id; + QQWB.log.warning("collect + a + non-deferred + object + is + illegal") + } }), QQWB.api.messageHandler + || + (QQWB.provide("api.messageHandler", + function(a) + { if + (QQWB._domain.serverproxy.indexOf(a.origin) + !== + 0) + QQWB.log.warning("unexpected + message + arrived + from + " + + + a.origin + + + " + with + data + " + + + a.data); + else + { + var + b + = + QQWB.JSON.fromString(a.data), + c + = + b.id, + d + = + QQWB.api.deferredAt(c), + e + = + b.data; + d + ? + (e[0] + !== + 200 + ? + d.reject.apply(d, + e) + : + (e[5] + == + "xmltext" + && + (e[3] + = + QQWB.XML.fromString(e[3])), + d.resolve(e[3], + e[2], + e[4])), + QQWB.api.uncollect(c)) + : + QQWB.log.warning("related + deferred + object + not + found, + it + shouldn't + happen") + } + }), + window.addEventListener + ? + window.addEventListener("message", + QQWB.api.messageHandler, + !1) + : + window.attachEvent + && + window.attachEvent("onmessage", + QQWB.api.messageHandler)); + try { var l = + QQWB.api.collect(j); + setTimeout(function() { + k.contentWindow.postMessage(QQWB.JSON.stringify({ + id: l, + data: + [a, b, + c, d] + }), + QQWB._domain.serverproxy) + }, 0) } catch (m) { + QQWB.log.critical("post + message + to + server + proxy + has + failed, + " + + + m), + j.reject(-1, + m, + 0) + } } } else g === + QQWB._solution[QQWB._solution.FLASH_SOLUTION] && + QQWB.io._apiFlashAjax(a, b, c, d).complete(function() { + var a = QQWB.Array.fromArguments(arguments); + a[0] !== 200 ? j.reject.apply(j, a) : + j.resolve(a[3], a[2], a[4]) }); return + + function() { var e = QQWB.api.id; f.complete(function() { + QQWB.log.info("*[" + e + "] done"), e = null }); if (QQWB.pingback + && QQWB.ping) { function h(e, f, h) { QQWB.ping.pingAPI(a, + QQWB.queryString.encode(b), c, d, e, f, h, g.name) } + f.success(function(a, b) { h(200, "ok", b) }), f.fail(function(a, + b, c) { h(a, b, c) }) } }(), f }) +/* + |xGv00|6d5d6ce9717937b567ca32a7f3d7c7d0 */ + diff --git a/sources_non_forked/vim-autoformat/samples/js2.js b/sources_non_forked/vim-autoformat/samples/js2.js new file mode 100644 index 00000000..16ad06c5 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/js2.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[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","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/sources_non_forked/vim-autoformat/samples/perl.pl b/sources_non_forked/vim-autoformat/samples/perl.pl new file mode 100644 index 00000000..6ee48aa1 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/perl.pl @@ -0,0 +1,92 @@ +# Examples from perltidy webpage..... + +#Some code with side comments +my $lines = 0; # checksum: #lines +my $bytes = 0; # checksum: #bytes +my $sum = 0; # checksum: system V sum +my $patchdata = 0; # saw patch data +my $pos = 0; # start of patch data +my $endkit = 0; # saw end of kit +my $fail = 0; # failed + +#A loop +$_ = <<'EOL'; + $url = new URI::URL "http://www/"; die if $url eq "xXx"; +EOL + LOOP:{print(" digits"),redo LOOP if/\G\d+\b[,.;]?\s*/gc;print(" lowercase"), + redo LOOP if/\G[a-z]+\b[,.;]?\s*/gc;print(" UPPERCASE"),redo LOOP + if/\G[A-Z]+\b[,.;]?\s*/gc;print(" Capitalized"), + redo LOOP if/\G[A-Z][a-z]+\b[,.;]?\s*/gc; + print(" MiXeD"),redo LOOP if/\G[A-Za-z]+\b[,.;]?\s*/gc;print( + " alphanumeric"),redo LOOP if/\G[A-Za-z0-9]+\b[,.;]?\s*/gc;print(" line-noise" + ),redo LOOP if/\G[^A-Za-z0-9]+/gc;print". That's all!\n";} + +#A hash definition list +%unitscale=("in",72,"pt",72.27/72,"pc",12,"mm",72/25.4,"cm",72/2.54, +"\\hsize",100,"\\vsize",100,"\\textwidth",100,"\\textheight",100, +"\\pagewidth",100,"\\linewidth",100); + +#A matrix +my $a_box = [ [ $a11, $a12, $a13, $a14, $a15, $a16 ], +[ $a21, $a22, $a23, $a24, $a25, $a26 ], [ $a31, $a32, $a33, $a34, $a35, $a36 ], +[ $a41, $a42, $a43, $a44, $a45, $a46 ], [ $a51, $a52, $a53, $a54, $a55, $a56 ], + [ $a61, $a62, $a63, $a64, $a65, $a66 ], ]; + +#A complex data structure +%TV=(flintstones=>{series=>"flintstones",nights=>[qw(monday thursday friday)], +members=>[{name=>"fred",role=>"lead",age=>36,},{name=>"wilma",role=>"wife", +age=>31,},{name=>"pebbles",role=>"kid",age=>4,},],},jetsons=>{series=>"jetsons", +nights=>[qw(wednesday saturday)],members=>[{name=>"george",role=>"lead",age=>41, +},{name=>"jane",role=>"wife",age=>39,},{name=>"elroy",role=>"kid",age=>9,},],}, +simpsons=>{series=>"simpsons",nights=>[qw(monday)],members=>[{name=>"homer", +role=>"lead",age=>34,},{name=>"marge",role=>"wife",age=>37,},{name=>"bart", +role=>"kid",age=>11,},],},); + +#Cleaning up code from a code generator +#A good application of perltidy is to clean up code which has been produced by a code generator. Here is a snippet advent.t which was generated from Fortran source by a translation tool. +{ + L9140: + if ($msccom::obj==$msccom::food) { + goto L8142; + } + if ($msccom::obj==$msccom::bird||$msccom::obj==$msccom::snake||$msccom::obj==$msccom::clam||$msccom::obj==$msccom::oyster||$msccom::obj==$msccom::dwarf||$msccom::obj==$msccom::dragon||$msccom::obj==$msccom::troll||$msccom::obj==$msccom::bear) { + $msccom::spk=71; + } + goto L2011; + # + # DRINK. IF NO OBJECT, ASSUME WATER AND LOOK FOR IT HERE. IF WATER IS + # THE BOTTLE, DRINK THAT, ELSE MUST BE AT A WATER LOC, SO DRINK STREAM. + # + L9150: + if ($msccom::obj==0&&$liqloc->($placom::loc)!=$msccom::water&&($liq->(0)!=$msccom::water||!$here->($msccom::bottle))) { + goto L8000; + } + if ($msccom::obj!=0&&$msccom::obj!=$msccom::water) { + $msccom::spk=110; + } + if ($msccom::spk==110||$liq->(0)!=$msccom::water||!$here->($msccom::bottle)) { + goto L2011; + } + $placom::prop->($msccom::bottle)=1; + $placom::place->($msccom::water)=0; + $msccom::spk=74; + goto L2011; + # + # RUB. YIELDS VARIOUS SNIDE REMARKS. + # + L9160: + if ($msccom::obj!=$placom::lamp) { + $msccom::spk=76; + } + goto L2011; + # + # THROW. SAME AS DISCARD UNLESS AXE. THEN SAME AS ATTACK EXCEPT IGNOR + # AND IF DWARF IS PRESENT THEN ONE MIGHT BE KILLED. (ONLY WAY TO DO SO + # AXE ALSO SPECIAL FOR DRAGON, BEAR, AND TROLL. TREASURES SPECIAL FOR + # + L9170: + if ($toting->($msccom::rod2)&&$msccom::obj==$msccom::rod&&!$toting->($msccom::rod)) { + $msccom::obj=$msccom::rod2; + } + } + diff --git a/sources_non_forked/vim-autoformat/samples/python.py b/sources_non_forked/vim-autoformat/samples/python.py new file mode 100644 index 00000000..c177f185 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/python.py @@ -0,0 +1,208 @@ +#! /usr/bin/env python +"""Tkinter-based GUI for websucker. +Easy use: type or paste source URL and destination directory in +their respective text boxes,click GO or hit return,and presto. +""" +from Tkinter import * +import Tkinter +import websucker +import sys +import os +import threading +import Queue +import time +VERBOSE=2 +try: + class Canceled(Exception): + "Exception used to cancel run()." +except (NameError,TypeError): + Canceled=__name__+".Canceled" +class SuckerThread(websucker.Sucker): + stopit=0 + savedir=None + rootdir=None + def __init__(self,msgq): + self.msgq=msgq + websucker.Sucker.__init__(self) + self.setflags(verbose=VERBOSE) + self.urlopener.addheaders=[('User-agent','websucker/%s'%websucker.__version__),] + def message(self,format,*args): + if args: + format=format%args + ##print format + self.msgq.put(format) + def run1(self,url): + try: + try: + self.reset() + self.addroot(url) + self.run() + except Canceled: + self.message("[canceled]") + else: + self.message("[done]") + finally: + self.msgq.put(None) + def savefile(self,text,path): + if self.stopit: + raise Canceled + websucker.Sucker.savefile(self,text,path) + def getpage(self,url): + if self.stopit: + raise Canceled + return websucker.Sucker.getpage(self,url) + def savefilename(self,url): + path=websucker.Sucker.savefilename(self,url) + if self.savedir: + n=len(self.rootdir) + if path[:n] == self.rootdir: + path=path[n:] + while path[:1] == os.sep: + path=path[1:] + path=os.path.join(self.savedir,path) + return path + def XXXaddrobot(self,*args): + pass + def XXXisallowed(self,*args): + return 1 + +class App: + sucker=None + msgq=None + def __init__(self,top): + self.top=top + top.columnconfigure(99,weight=1) + self.url_label=Label(top,text="URL:") + self.url_label.grid(row=0,column=0,sticky='e') + self.url_entry=Entry(top,width=60,exportselection=0) + self.url_entry.grid(row=0,column=1,sticky='we', + columnspan=99) + self.url_entry.focus_set() + self.url_entry.bind("",self.go) + self.dir_label=Label(top,text="Directory:") + self.dir_label.grid(row=1,column=0,sticky='e') + self.dir_entry=Entry(top) + self.dir_entry.grid(row=1,column=1,sticky='we', + columnspan=99) + self.go_button=Button(top,text="Go",command=self.go) + self.go_button.grid(row=2,column=1,sticky='w') + self.cancel_button=Button(top,text="Cancel", + command=self.cancel, + state=DISABLED) + self.cancel_button.grid(row=2,column=2,sticky='w') + self.auto_button=Button(top,text="Paste+Go", + command=self.auto) + self.auto_button.grid(row=2,column=3,sticky='w') + self.status_label=Label(top,text="[idle]") + self.status_label.grid(row=2,column=4,sticky='w') + self.top.update_idletasks() + self.top.grid_propagate(0) + def message(self,text,*args): + if args: + text=text % args + self.status_label.config(text=text) + def check_msgq(self): + while not self.msgq.empty(): + msg=self.msgq.get() + if msg is None: + self.go_button.configure(state=NORMAL) + self.auto_button.configure(state=NORMAL) + self.cancel_button.configure(state=DISABLED) + if self.sucker: + self.sucker.stopit=0 + self.top.bell() + else: + self.message(msg) + self.top.after(100,self.check_msgq) + def go(self,event=None): + if not self.msgq: + self.msgq=Queue.Queue(0) + self.check_msgq() + if not self.sucker: + self.sucker=SuckerThread(self.msgq) + if self.sucker.stopit: + return + self.url_entry.selection_range(0,END) + url=self.url_entry.get() + url=url.strip() + if not url: + self.top.bell() + self.message("[Error: No URL entered]") + return + self.rooturl=url + dir=self.dir_entry.get().strip() + if not dir: + self.sucker.savedir=None + else: + self.sucker.savedir=dir + self.sucker.rootdir=os.path.dirname( + websucker.Sucker.savefilename(self.sucker,url)) + self.go_button.configure(state=DISABLED) + self.auto_button.configure(state=DISABLED) + self.cancel_button.configure(state=NORMAL) + self.message( '[running...]') + self.sucker.stopit=0 + t=threading.Thread(target=self.sucker.run1,args=(url,)) + t.start() + def cancel(self): + if self.sucker: + self.sucker.stopit=1 + self.message("[canceling...]") + def auto(self): + tries=['PRIMARY','CLIPBOARD'] + text="" + for t in tries: + try: + text=self.top.selection_get(selection=t) + except TclError: + continue + text=text.strip() + if text: + break + if not text: + self.top.bell() + self.message("[Error: clipboard is empty]") + return + self.url_entry.delete(0,END) + self.url_entry.insert(0,text) + self.go() + +class AppArray: + def __init__(self,top=None): + if not top: + top=Tk() + top.title("websucker GUI") + top.iconname("wsgui") + top.wm_protocol('WM_DELETE_WINDOW',self.exit) + self.top=top + self.appframe=Frame(self.top) + self.appframe.pack(fill='both') + self.applist=[] + self.exit_button=Button(top,text="Exit",command=self.exit) + self.exit_button.pack(side=RIGHT) + self.new_button=Button(top,text="New",command=self.addsucker) + self.new_button.pack(side=LEFT) + self.addsucker() + ##self.applist[0].url_entry.insert(END,"http://www.python.org/doc/essays/") + def addsucker(self): + self.top.geometry("") + frame=Frame(self.appframe,borderwidth=2,relief=GROOVE) + frame.pack(fill='x') + app=App(frame) + self.applist.append(app) + done=0 + def mainloop(self): + while not self.done: + time.sleep(0.1) + self.top.update() + def exit(self): + for app in self.applist: + app.cancel() + app.message("[exiting...]") + self.done=1 + +def main(): + AppArray().mainloop() +if __name__ == '__main__': + main() + diff --git a/sources_non_forked/vim-autoformat/samples/ruby.rb b/sources_non_forked/vim-autoformat/samples/ruby.rb new file mode 100644 index 00000000..28249840 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/ruby.rb @@ -0,0 +1,33 @@ +require 'inifile' + +# Reads settings from init file +class Settings + attr_reader :jusername, :jpassword, :jurl + + def initialize(path) + settings = read(path) + parse(settings) + end + + private + + def read(path) + settings = IniFile.load(path) + fail "File #{path} not found!" unless settings + settings + end + + def parse(settings) + jira = settings['jira'] + fail "Init file hasn't [jira] section!" unless jira + + @jusername = jira['username'] + @jpassword = jira['password'] + @jurl = jira['url'] + + fail "Init file hasn't username option!" unless jusername + fail "Init file hasn't password option!" unless jpassword + fail "Init file hasn't url option!" unless jurl + end +end + diff --git a/sources_non_forked/vim-autoformat/samples/sample.css b/sources_non_forked/vim-autoformat/samples/sample.css new file mode 100644 index 00000000..2e887c09 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/sample.css @@ -0,0 +1 @@ +body{overflow:hidden;background:#000000;background-image:url(images/bg.gif);background-repeat:no-repeat;background-position:left top;} diff --git a/sources_non_forked/vim-autoformat/samples/test.json b/sources_non_forked/vim-autoformat/samples/test.json new file mode 100644 index 00000000..5d37dc1c --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/test.json @@ -0,0 +1,4 @@ +{ + "test": "test", + "test": [1, 2, 3] +} diff --git a/sources_non_forked/vim-autoformat/samples/test.sql b/sources_non_forked/vim-autoformat/samples/test.sql new file mode 100644 index 00000000..ad80b71a --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/test.sql @@ -0,0 +1 @@ +selECT * FROM foo WHERE id IN (SELECT id FROM bar); diff --git a/sources_non_forked/vim-autoformat/samples/xhtml.xhtml b/sources_non_forked/vim-autoformat/samples/xhtml.xhtml new file mode 100644 index 00000000..9a905556 --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/xhtml.xhtml @@ -0,0 +1 @@ +
diff --git a/sources_non_forked/vim-autoformat/samples/xml.xml b/sources_non_forked/vim-autoformat/samples/xml.xml new file mode 100644 index 00000000..1e0e44fa --- /dev/null +++ b/sources_non_forked/vim-autoformat/samples/xml.xml @@ -0,0 +1 @@ + Gambardella, Matthew XML Developer's Guide Computer 44.95 2000-10-01 An in-depth look at creating applications with XML. Ralls, Kim Midnight Rain Fantasy 5.95 2000-12-16 A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world. Corets, Eva Maeve Ascendant Fantasy 5.95 2000-11-17 After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society. Corets, Eva Oberon's Legacy Fantasy 5.95 2001-03-10 In post-apocalypse England, the mysterious agent known only as Oberon helps to create a new life for the inhabitants of London. Sequel to Maeve Ascendant. Corets, Eva The Sundered Grail Fantasy 5.95 2001-09-10 The two daughters of Maeve, half-sisters, battle one another for control of England. Sequel to Oberon's Legacy. Randall, Cynthia Lover Birds Romance 4.95 2000-09-02 When Carla meets Paul at an ornithology conference, tempers fly as feathers get ruffled. Thurman, Paula Splish Splash Romance 4.95 2000-11-02 A deep sea diver finds true love twenty thousand leagues beneath the sea. Knorr, Stefan Creepy Crawlies Horror 4.95 2000-12-06 An anthology of horror stories about roaches, centipedes, scorpions and other insects. Kress, Peter Paradox Lost Science Fiction 6.95 2000-11-02 After an inadvertant trip through a Heisenberg Uncertainty Device, James Salway discovers the problems of being quantum. O'Brien, Tim Microsoft .NET: The Programming Bible Computer 36.95 2000-12-09 Microsoft's .NET initiative is explored in detail in this deep programmer's reference. O'Brien, Tim MSXML3: A Comprehensive Guide Computer 36.95 2000-12-01 The Microsoft MSXML3 parser is covered in detail, with attention to XML DOM interfaces, XSLT processing, SAX and more. Galos, Mike Visual Studio 7: A Comprehensive Guide Computer 49.95 2001-04-16 Microsoft Visual Studio 7 is explored in depth, looking at how Visual Basic, Visual C++, C#, and ASP+ are integrated into a comprehensive development environment. diff --git a/temp_dirs/undodir/.gitignore b/temp_dirs/undodir/.gitignore deleted file mode 100644 index 47e856eb..00000000 --- a/temp_dirs/undodir/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# http://stackoverflow.com/a/932982 -!.gitignore diff --git a/temp_dirs/undodir/README.md b/temp_dirs/undodir/README.md deleted file mode 100644 index 37f6debe..00000000 --- a/temp_dirs/undodir/README.md +++ /dev/null @@ -1 +0,0 @@ -Undo dir for VIM diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index f510083c..19537f58 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -109,7 +109,7 @@ let g:multi_cursor_quit_key = '' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => surround.vim config -" Annotate strings with gettext +" Annotate strings with gettext """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" vmap Si S(i_f) au FileType mako vmap Si S"i${ _(2f"a) } @@ -119,25 +119,25 @@ au FileType mako vmap Si S"i${ _(2f"a) } " => lightline """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:lightline = { - \ 'colorscheme': 'wombat', - \ 'active': { - \ 'left': [ ['mode', 'paste'], - \ ['fugitive', 'readonly', 'filename', 'modified'] ], - \ 'right': [ [ 'lineinfo' ], ['percent'] ] - \ }, - \ 'component': { - \ 'readonly': '%{&filetype=="help"?"":&readonly?"🔒":""}', - \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', - \ 'fugitive': '%{exists("*FugitiveHead")?FugitiveHead():""}' - \ }, - \ 'component_visible_condition': { - \ 'readonly': '(&filetype!="help"&& &readonly)', - \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))', - \ 'fugitive': '(exists("*FugitiveHead") && ""!=FugitiveHead())' - \ }, - \ 'separator': { 'left': ' ', 'right': ' ' }, - \ 'subseparator': { 'left': ' ', 'right': ' ' } - \ } + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ ['mode', 'paste'], + \ ['fugitive', 'readonly', 'filename', 'modified'] ], + \ 'right': [ [ 'lineinfo' ], ['percent'] ] + \ }, + \ 'component': { + \ 'readonly': '%{&filetype=="help"?"":&readonly?"🔒":""}', + \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', + \ 'fugitive': '%{exists("*FugitiveHead")?FugitiveHead():""}' + \ }, + \ 'component_visible_condition': { + \ 'readonly': '(&filetype!="help"&& &readonly)', + \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))', + \ 'fugitive': '(exists("*FugitiveHead") && ""!=FugitiveHead())' + \ }, + \ 'separator': { 'left': ' ', 'right': ' ' }, + \ 'subseparator': { 'left': ' ', 'right': ' ' } + \ } """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vimroom @@ -152,10 +152,10 @@ nnoremap z :Goyo " => Ale (syntax checker and linter) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:ale_linters = { -\ 'javascript': ['eslint'], -\ 'python': ['flake8'], -\ 'go': ['go', 'golint', 'errcheck'] -\} + \ 'javascript': ['eslint'], + \ 'python': ['flake8'], + \ 'go': ['go', 'golint', 'errcheck'] + \} nmap a (ale_next_wrap) @@ -186,3 +186,26 @@ let g:EditorConfig_exclude_patterns = ['fugitive://.*'] " Copy the link to the line of a Git repository to the clipboard nnoremap v :.GBrowse! xnoremap v :'<'>GBrowse! + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Coc.nvim +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +"inoremap +"" \ pumvisible() ? "\" : +"" \ check_back_space() ? "\" : +"" \ coc#refresh() +"inoremap pumvisible() ? "\" : "\" + +" Make auto-select the first completion item and notify coc.nvim to +" format on enter, could be remapped by other vim plugin +inoremap pumvisible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Vim-autoformat +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let g:python3_host_prog="/usr/bin/python3" +autocmd BufWrite * :Autoformat