diff --git a/cement/core/meta.py b/cement/core/meta.py index 1929606e..66e4607d 100644 --- a/cement/core/meta.py +++ b/cement/core/meta.py @@ -4,6 +4,8 @@ class Meta(object): """ + # Testing + Model that acts as a container class for a meta attributes for a larger class. It stuffs any kwarg it gets in it's init as an attribute of itself. @@ -17,6 +19,19 @@ class Meta(object): setattr(self, key, dict_obj[key]) + def johnny(self): + """ + Testing... + + # Arguments + + spam (Spam): 200g of spam + eggs (Egg): 3 eggs + ham (Ham): As much ham as you like. + + """ + pass + class MetaMixin(object): """ diff --git a/cement/ext/ext_alarm.py b/cement/ext/ext_alarm.py index 42116332..58132142 100644 --- a/cement/ext/ext_alarm.py +++ b/cement/ext/ext_alarm.py @@ -3,56 +3,52 @@ The Alarm Extension provides easy access to setting an application alarm to handle timing out operations. See the `Python Signal Library `_. -Requirements ------------- +**Requirements** * No external dependencies. * Only available on Unix/Linux -Configuration -------------- +**Configuration** This extension does not honor any application configuration settings. -Usage ------ +**Usage** -.. code-block:: python +```python +import time +from cement import App, CaughtSignal - import time - from cement import App, CaughtSignal - - class MyApp(App): - class Meta: - label = 'myapp' - exit_on_close = True - extensions = ['alarm'] +class MyApp(App): + class Meta: + label = 'myapp' + exit_on_close = True + extensions = ['alarm'] - with MyApp() as app: - try: - app.run() - app.alarm.set(3, "The operation timed out after 3 seconds!") +with MyApp() as app: + try: + app.run() + app.alarm.set(3, "The operation timed out after 3 seconds!") - # do something that takes time to operate - time.sleep(5) + # do something that takes time to operate + time.sleep(5) - app.alarm.stop() + app.alarm.stop() - except CaughtSignal as e: - print(e.msg) - app.exit_code = 1 + except CaughtSignal as e: + print(e.msg) + app.exit_code = 1 +``` Looks like: -.. code-block:: console - - $ python myapp.py - ERROR: The operation timed out after 3 seconds! - Caught signal 14 - +``` +$ python myapp.py +ERROR: The operation timed out after 3 seconds! +Caught signal 14 +``` """ import signal diff --git a/doc-new/config.toml b/doc-new/config.toml deleted file mode 100644 index 757cb4da..00000000 --- a/doc-new/config.toml +++ /dev/null @@ -1,47 +0,0 @@ -baseurl = "http://builtoncement.com/" -title = "Cement Framework Documentation" -languageCode = "en-us" -theme = "docuapi" - -# Code higlighting settings -pygmentsCodefences = true -pygmentsCodeFencesGuesSyntax = false -pygmentsOptions = "" -pygmentsStyle = "monokai" -# The monokai stylesheet is included in the base template. -pygmentsUseClasses = true - -defaultContentLanguage = "en" - -search = true - -toc_footers = [ -"[![Continuous Integration Status](https://travis-ci.org/datafolklabs/cement.svg)](https://travis-ci.org/datafolklabs/cement)", -"[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/datafolklabs/cement?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)", -# "[DOCS](http://builtoncement.com/2.99/)", -# "[CODE](http://github.com/datafolklabs/cement/)", -# "[PYPI](http://pypi.python.org/pypi/cement/)", -# "[GITTER](https://gitter.im/datafolklabs/cement)", -] - -# Configure the language example tabs. -[[params.language_tabs]] -key = "code" -name = "Code Examples / Usage" -# [[params.language_tabs]] -# key = "go" -# name = "Go" -# [[params.language_tabs]] -# key = "ruby" -# name = "Ruby" -# [[params.language_tabs]] -# key = "bash" -# name = "BASH" - -#Languages -[languages] - -[languages.en] -languageName = "English" -weight = 2 -title = "Cement Framework" diff --git a/doc-new/content/changelog.md b/doc-new/content/changelog.md deleted file mode 100755 index 0d2e140a..00000000 --- a/doc-new/content/changelog.md +++ /dev/null @@ -1,49 +0,0 @@ -# ChangeLog - -## 2.99.1 - DEVELOPMENT (will be released as dev/2.99.2 or stable/3.0.0) - -This is a complete fork from Cement 2 code base. Please continue to use -stable versions of Cement 2, until Cement 3.0.0 is released. - - -Bugs: - -- `[ext.redis]` Unable To Set Redis Host - - [Issue #440](https://github.com/datafolklabs/cement/issues/440) - - -Features: - -- `[core]` Add Docker / Docker Compose Support - - [Issue #439](https://github.com/datafolklabs/cement/issues/439) - - -Refactoring: - -- *Too many to reference* - - -Incompatible: - -- `[core]` Replace Interfaces with ABC Base Classes - - [Issue #192](https://github.com/datafolklabs/cement/issues/192) -- `[core.foundation]` Rename `CementApp` to `App`. -- `[core.handler]` Rename `CementBaseHandler` to `Handler` -- `[core.handler]` Drop deprecated backend globals -- `[core.hook]` Drop deprecated backend globals -- `[core.controller]` Drop `CementBaseController` -- `[ext.argcomplete]` No longer shipped with Cement. -- `[ext.reload_config]` No longer shipped with Cement. -- `[ext.configobj]` No longer shipped with Cement. -- `[ext.json_configobj]` No longer shipped with Cement. -- `[ext.yaml_configobj]` No longer shipped with Cement. -- `[ext.genshi]` No longer shipped with Cement. -- `[ext.argparse]` ArgparseController.Meta.default_func is not `_default`, and - will print help info and exit. Can now set this to `None` as well to - pass/exit. - - [Issue #426](https://github.com/datafolklabs/cement/issues/426) - - -Deprecation: - -* *Everything with deprecation notices in Cement < 3* diff --git a/doc-new/content/cleanup.md b/doc-new/content/cleanup.md deleted file mode 100644 index e74e42d8..00000000 --- a/doc-new/content/cleanup.md +++ /dev/null @@ -1,141 +0,0 @@ ---- -weight: 4 -title: Cleanup ---- - -# Application Cleanup - -> Automatic Cleanup (Builtin) - -```python -from cement import App - -### both .setup() / .close() called automatically by `with` - -with App('myapp') as app: - app.run() - - -### the above is equivalent to - -app = App('myapp') -app.setup() -app.run() -app.close() -``` - -The concept of 'cleanup' after application run time is nothing new. What -happens during 'cleanup' all depends on the application. This might mean -closing and deleting temporary files, removing session data, or deleting a PID -(Process ID) file. - -To allow for application cleanup not only within your program, but also -external plugins and extensions, there is the `app.close()` function that -must be called after `app.run()` regardless of any exceptions or runtime -errors. Note that `app.close()` is called automatically when using the -Python `with` operator, so it is not generally something you call directly, -but it is important to know how and when it is called. - -Calling `app.close()` ensures that the ``pre_close`` and ``post_close`` -framework hooks are run, allowing extensions/plugins/etc to cleanup after the -program runs. - - -## Exit Status and Error Codes - -> Setting Exit Code on Application Close - -```python - -from cement import App - - -### set exit_on_close for production use - -class MyApp(App): - class Meta: - label = 'myapp' - exit_on_close = True - - -### disable it for testing - -class MyAppForTesting(MyApp): - class Meta: - exit_on_close = False - - -with MyApp() as app: - try: - app.run() - except Exception as e: - ### set exit code to use on app.close() - app.exit_code = 1 - -``` - - -You can optionally set the status code that your application exists with via -`App.exit_code`, however you must also ensure that the meta option -`App.Meta.exit_on_close` is enabled. - - - -Note that the default exit code is `0`, and any *uncaught exceptions* will -cause the application to exit with a code of `1` (error). - - -## Running Cleanup Code - -> Example: Running Cleanup Code Via Hooks - -```python - -import os -from tempfile import mkstemp -from cement import App, init_defaults - -defaults = init_defaults('myapp') -defaults['myapp']['tmp_file'] = mkstemp()[1] - - -def my_cleanup_hook(app): - # do something with app... - - tmp_file = app.config.get('myapp', 'tmp_file') - if os.path.exists(tmp_file): - app.log.warning('removing tmp file: %s' % tmp_file) - os.remove(tmp_file) - - -class MyApp(App): - class Meta: - label = 'myapp' - config_defaults = defaults - hooks = [ - ('pre_close', my_cleanup_hook), - ] - - -with MyApp() as app: - app.run() - -``` - -> Usage - -``` -$ python myapp.py -WARNING: removing tmp file: /tmp/tmpifmxsfid - -``` - -Any extension, plugin, or even the application itself that has 'cleanup' -code should do so within the `pre_close` or `post_close` hooks to ensure -that it gets run. See the `Hooks` section of the documentation for more -information on running framework hooks. diff --git a/doc-new/content/hooks.md b/doc-new/content/hooks.md deleted file mode 100644 index 379036bc..00000000 --- a/doc-new/content/hooks.md +++ /dev/null @@ -1,326 +0,0 @@ ---- -weight: 3 -title: Hooks ---- - -# Hooks - -Hooks allow developers to tie into different pieces of the application, and/or -the Cement Framework. A hook can be defined anywhere, be it internally in the -application, or in a plugin. Once a hook is defined, functions can be -registered to that hook so that when the hook is called, all functions -registered to that hook will be executed. By defining a hook, you are saying -that you are going to honor that hook somewhere in your application or plugin. -Using descriptive hook names is good for clarity. For example, the name -`pre_database_connect` is obviously a hook that will be run just before a -database connection is attempted. - -The most important thing to remember when defining hooks is to properly -document them. Include whether anything is expected in return -or what, if any, arguments will be passed to the hook functions when called. - - -## Defining Hooks - -> Defining a Hook via App.Meta - -```python - -from cement import App - - -class MyApp(App): - class Meta: - label = 'myapp' - define_hooks = [ - 'my_example_hook', - ] -``` - -> Defining a Hook via App.setup() - -```python -class MyApp(App): - # ... - - def setup(self): - super() - self.hook.define('my_example_hook') -``` - -A hook can be defined anywhere, however it is best-practice to define the hook -as early as possible. A hook definition simply gives a label to the hook, and -allows the developer (or third-party plugin developers) to register functions -to that hook. It's label is arbitrary. - - -## Registering Hook Functions - -> Registering Hook Functions via App.Meta - -```python -from cement import App - - -def my_hook1(app): - # do something with app - pass - - -def my_hook2(app): - # do something with app - pass - - -class MyApp(App): - class Meta: - label = 'myapp' - - ### list of tuples: ( 'hook_label', ) - hooks = [ - ('post_argument_parsing', my_hook1), - ('pre_close', my_hook2), - ] -``` - -> Registering Hook Functions via App.setup() - -```python -class MyApp(App): - # ... - - def setup(self): - super() - - ### register hook functions - self.hook.register('post_argument_parsing', my_hook1) - self.hook.register('pre_close', my_hook2) -``` - -A hook label is just an arbitrary identifier, but the functions registered to -that hook are what get run when the hook is called. Registering a hook -function should also be done early on in the bootstrap process, any time after -the application has been created, after the hook is defined, and before the -hook is run. Note that every hook is different, and therefore should be -clearly documented by the 'owner' of the hook (application developer, plugin -developer, etc). - -What you return depends on what the developer defining the hook is expecting. -Each hook is different, and the nature of the hook determines whether you need -to return anything or not. That is up to the developer. Also, the `*args` -and `**kwargs` coming in depend on the developer. You have to be familiar -with the purpose of the defined hook in order to know whether you are -receiving any `*args` or `**kwargs`. - - -## Running Hooks - -> Running a Hook - -```python -with MyApp() as app: - app.run() - - for res in app.hook.run('my_example_hook'): - # do something with res? - pass -``` - - -Now that a hook is defined, and functions have been registered to that hook, -all that is left is to run it. As you can see in the example, we iterate over -the hook rather than just calling `app.hook.run()` by itself. This is -necessary because `app.hook.run()` yields the results from each hook function -as they are run. Hooks can be run anywhere **after** the hook is defined, and -hooks are registered to that hook. - - - - -## Controlling Hook Run Order - -> Example: Hook Run Order - -```python - -from cement import App - - -### define hook functions - -def func1(app): - print('Inside hook func1') - - -def func2(app): - print('Inside hook func2') - - -def func3(app): - print('Inside hook func3') - - -class MyApp(App): - class Meta: - label = 'myapp' - - ### define my_hook - define_hooks = [ - 'my_hook', - ] - - ### register functions to my_hook - hooks = [ - ('my_hook', func1, weight=0), - ('my_hook', func2, weight=100), - ('my_hook', func3, weight=-99), - ] - -with MyApp() as app: - app.run() - - ### execute my_hook - for res in app.hook.run('my_hook', app) - pass -``` - -> Usage - -```bash -$ python myapp.py -Inside hook func3 -Inside hook func1 -Inside hook func2 -``` - -Sometimes you might have a very specific purpose in mind for a hook, and need -it to run before or after other functions in the same hook. For that reason -there is an optional `weight` parameter that can be passed when registering -a hook function. - -As you can see in the example, it doesn’t matter what order we register the -hook, the weight runs then in order from lowest to highest. - - -## Cement Framework Hooks - -> Example Usage of Framework Hooks - -```python - -from cement import App - - -### handle arguments before app.run() is called -def inspect_arguments(app): - if app.pargs.foo is not None: - print('Foo Argument Was Passed!') - - -class MyApp(App): - class Meta: - label = 'myapp' - hooks = [ - ('post_argument_parsing', inspect_arguments), - ] - - -with MyApp() as app: - app.args.add_argument('--foo') - app.run() -``` - -> Usage - -```bash -$ python myapp.py --foo bar -Foo Argument Was Passed! -``` - -Cement has a number of hooks that tie into the framework. - -### pre_setup - -Run first when `App.setup()` is called. The application object is -passed as an argument. Nothing is expected in return. - - -### post_setup - -Run last when `App.setup()` is called. The application object is -passed as an argument. Nothing is expected in return. - - -### pre_run - -Run first when `App.run()` is called. The application object is -passed as an argument. Nothing is expected in return. - - -### post_run - -Run last when `App.run()` is called. The application object is -passed as an argument. Nothing is expected in return. - - -### pre_argument_parsing - -Run after `App.run()` is called, just *before* argument parsing happens. -The application object is passed as an argument to these hook -functions. Nothing is expected in return. - - -### post_argument_parsing - -Run after `App.run()` is called, just *after* argument parsing happens. -The application object is passed as an argument to these hook -functions. Nothing is expected in return. - -This hook is generally useful where the developer needs to perform actions -based on the arguments that were passed at command line, but before the -logic of `App.run()` happens. - - -### pre_render - -Run first when App.render() is called. The application object, and -data dictionary are passed as arguments. Must return either the original -data dictionary, or a modified one. - -Note: This does not affect anything that is 'printed' to console. - - -### post_render - -Run last when `App.render()` is called. The application object, and -rendered output text are passed as arguments. Must return either the original -output text, or a modified version. - - -### pre_close - -Run first when `App.close()` is called. This hook should be used by plugins -and extensions to do any 'cleanup' at the end of program execution. Nothing -is expected in return. - - -### post_close - -Run last when `App.close()` is called. Most use cases need `pre_close`, -however this hook is available should one need to do anything after all other -'close' operations. - - -### signal - -Run when signal handling is enabled, and the defined signal handler callback -is executed. This hook should be used by the application, plugins, and -extensions to perform any actions when a specific signal is caught. Nothing -is expected in return. \ No newline at end of file diff --git a/doc-new/content/index.md b/doc-new/content/index.md deleted file mode 100644 index 220ded1a..00000000 --- a/doc-new/content/index.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -weight: 1 -title: Cement Framework ---- - -# Cement Framework v2.99.1 - -> Installation via PyPi (Stable) - -``` -$ pip install cement -``` - -> Hello World Example - -```python -from cement import App - -with App('myapp') as app: - app.run() - app.log.info('Hello World!') -``` - -> Usage - -``` -$ python helloworld.py --help -usage: helloworld [-h] [--debug] [--quiet] - -optional arguments: - -h, --help show this help message and exit - --debug toggle debug output - --quiet suppress all output - -$ python helloworld.py -INFO: Hello World! -``` - -Let's hope that this long sentence doesn't get eaten up by the `slate monsters of old`. -And this one also I want to see what this looks `App.Meta.config_files == 'test'`. - - - -Cement is an advanced Application Framework for Python, with a primary focus -on Command Line Interfaces (CLI). Its goal is to introduce a standard, and -feature-full platform for both simple and complex command line applications -as well as support rapid development needs without sacrificing quality. -Cement is flexible, and it's use cases span from the simplicity of a -micro-framework to the complexity of a mega-framework. Whether it's a single -file script, or a multi-tier application, Cement is the foundation you've been -looking for. - -The first commit to Git was on Dec 4, 2009. Since then, the framework has -seen several iterations in design, and has continued to grow and improve -since it's inception. Cement is the most stable, and complete framework for -command line and backend application development. - -Cement core features include (but are not limited to): - -- Core pieces of the framework are customizable via handlers/interfaces -- Handler system connects implementation classes with Interfaces -- Extension handler interface to easily extend framework functionality -- Config handler supports parsing multiple config files into one config -- Argument handler parses command line arguments and merges with config -- Log handler supports console and file logging -- Plugin handler provides an interface to easily extend your application -- Output handler interface renders return dictionaries to console -- Cache handler interface adds caching support for improved performance -- Controller handler supports sub-commands, and nested controllers -- Hook support adds a bit of magic to apps and also ties into framework -- Zero external dependencies* (not including optional extensions) -- 100% test coverage using `nose` and `coverage` -- 100% PEP8 and style compliant using `flake8` -- Extensive Sphinx documentation -- Tested on Python 3.5+ -- Does not support Python 2.x - - - -**More Information** - -- [Documentation](http://builtoncement.com/2.99/) -- [Source Code](http://github.com/datafolklabs/cement/) -- [PyPi](http://pypi.python.org/pypi/cement/) -- [Travis Continuous Integration Testing](https://travis-ci.org/datafolklabs/cement/) -- [Gitter Discussion Channel](https://gitter.im/datafolklabs/cement/) - - -**License** - -The Cement CLI Application Framework is Open Source and is distributed under -the BSD License (three clause). Please see the -[LICENSE](https://raw.githubusercontent.com/datafolklabs/cement/master/LICENSE) -file included with this software. - diff --git a/doc-new/content/quickstart.md b/doc-new/content/quickstart.md deleted file mode 100644 index a6b099e4..00000000 --- a/doc-new/content/quickstart.md +++ /dev/null @@ -1,864 +0,0 @@ ---- -title: "Quick Start Overview" -weight: 2 -slug: quickstart ---- - -# Quickstart Overview - -This section is intended to give a brief overview of some of the most commonly -used core features of Cement. Please do not be discouraged if you don't -"get it" right away. Please also do not think, "is this it?". This is not -intended to be an exhaustive end-all-be-all coverage of every feature of the -framework. - -Some assumptions are being made here. Primarily, we assume that you've used -and are familiar with Python. The quickstart is intended to give a high level -look at using Cement. Please dive deeper into the individual sections after -the quickstart in order to gain a better understanding of each component. - - -[comment]: <> (--------------------------------------------------------------) - -## The Application Object - -> Using Cement App Directly - -```python -from cement import App - -with App('myapp') as app: - app.run() -``` - -> Sub-classing Cement App - -```python -from cement import App - -class MyApp(App): - class Meta: - label = 'myapp' - -with MyApp() as app: - app.run() -``` - -> Usage - -```bash -$ python myapp.py --help -usage: myapp [-h] [--debug] [--quiet] - -optional arguments: - -h, --help show this help message and exit - --debug toggle debug output - --quiet suppress all output -``` - -The core of your application starts with the Cement `App` object, which we -will refer to throughout this documentation as: - - * `App` - The uninstantiated Cement `App` base class - * `MyApp` - The uninstatiated/sub-classed Cement application you are creating - * `app` - The instantiated application object - - -Technically, Cement `App` can be used direcly (as in the example), however in -practice you will almost always sub-class `App` in order to configure it for -your needs (I.e. `MyApp`). - - -[comment]: <> (--------------------------------------------------------------) - -## MetaMixin's - -> Sub-classing Cement App / Overriding Metadata Options - -```python -from cement import App, init_defaults - -# define default application configuration settings -defaults = init_defaults('myapp') -defaults['myapp']['foo'] = 'bar' - - -class MyApp(App): - class Meta: - label = 'myapp' - config_defaults = defaults - - -with MyApp() as app: - app.run() - print("Foo => %s" % app.config.get('myapp', 'foo')) -``` - -> Usage - -``` -$ python myapp.py -Foo => bar -``` - -Cement uses `MetaMixin` classes everywhere, which allows the framework to -define default functionality but also provides an easy mechanism for -developers to override and customize. - -This is implemented by declaring a `Meta` class, under your application and/or -other Cement Handler classes. All Meta-options can also be overridden by any -`**kwargs` that are passed to the parent class that is being instantiated. - -I.e. `App('myapp', config_defaults={'foo': 'bar'})` - -Nearly every Cement class has an associated `Meta` class, which we often -refer to as `App.Meta`, `SomeHandlerClass.Meta`, etc. The -instantiated object is refered to in code as `app._meta`, -`some_handler._meta`, etc. - - -[comment]: <> (--------------------------------------------------------------) - -## Interfaces and Handlers - -> Overriding Default Framework Handlers - -```python -from cement import App -from cement.ext.ext_configparser import ConfigParserConfigHandler - - -class MyConfigHandler(ConfigParserConfigHandler): - class Meta: - label = 'my_config_handler' - - # do something to subclass/re-implement - # config handler here... - - -class MyApp(App): - class Meta: - label = 'myapp' - config_handler = 'my_config_handler' - handlers = [ - MyConfigHandler - ] -``` - - -All aspects of the framework are broken up into interfaces, and handlers. -Interfaces define some functionality, and Handlers implement that -functionality. Cement defines the following interfaces: - -- `extension` - Framework extensions loading -- `log` - Logging to console/file -- `config` - Application Configuration defaults, overrides by file, etc -- `mail` - Mail sending (smtp, etc) -- `plugin` - Application plugin loading -- `output` - Output rendering (JSON, Yaml, Mustache Templates, etc) -- `argument` - Command line argument parsing -- `controller` - Command dispatch (sub-commands, sub-command arguments, etc) -- `cache` - Key/Value data store (memcached, redis, etc) - -For example, the builtin configuration handler -`ConfigParserConfigHandler`, implements the `config` interface. Handlers -are referred to by the interfaces they implement, such as -`config.configparser`, `config.json`, `config.yaml`, etc. - - - -### Overriding Via Configuration Files - -> Overriding Via Configuration File - -``` -[myapp] - -### override App.Meta.mail_handler -mail_handler = my_mail_handler - -``` - -`MyApp` defines and/or defaults to builtin handlers for all of the above -listed core handlers. Whatever the application code defines is the default, -however you can also override via the configuration file(s) as in the example -to the right. - -For example, imagine that your default `mail_handler` is `smtp` for -sending email via your local SMTP server. This is a configuration that might -very on a per-user/environment basis. Via the application configuration, you -could override this with an alternative mail handler like - `mail_handler=some_other_mail_handler` - - - -[comment]: <> (--------------------------------------------------------------) - -## Configuration - -> myapp.py - -```python -from cement import App, init_defaults - -defaults = init_defaults('myapp') -defaults['myapp']['foo'] = 'bar' - -class MyApp(App): - class Meta: - label = 'myapp' - config_defaults = defaults - -with MyApp() as app: - app.run() - print("Foo => %s" % app.config.get('myapp', 'foo')) -``` - -> ~/.myapp.conf - -``` -[myapp] -foo = not-bar -``` - -> Usage - -``` -$ python myapp.py -Foo => not-bar -``` - -> Alternative Configuration Handler Example - -```python -from cement import App - -class MyApp(App): - class Meta: - label = 'myapp' - extensions = ['yaml'] - config_handler = 'yaml' - config_extension = '.yml' -``` - -> ~/.myapp.yml - -```yaml -myapp: - foo: not-bar -``` - -Cement supports loading multiple configuration files out-of-the-box. -Configurations loaded from files are merged in, overriding the applications -default settings (`App.Meta.config_defaults`). The default configuration -handler is `ConfigParserConfigHandler`, based on -[ConfigParser](https://docs.python.org/3/library/configparser.html) in the -standard library, and is instantiated as `app.config`. - -Cement looks for configuration files in the most common places such as: - -- `/etc/myapp/myapp.conf` -- `~/.myapp.conf` -- `~/.myapp/config` -- etc - -The list of configuration file paths can be customized via the meta option -`App.Meta.config_files` as well as their extension (i.e. `.conf`) can also -be easily modified with `App.Meta.config_extension`. - -The builtin configuration handler `ConfigParserConfigHandler` uses common -unix-like config files where `blocks` or `sections` are defined with brackets: - -I.e. `[myapp]`, `[myplugin]`, `[interface.handler]`, etc - -Additional support for the following file formats is provided -via optional extensions: - - * Json - * Yaml - - - -All extensions and application plugins can support customization loaded from -the application configuration file under the section `[interface.handler]`. -For example, the `ColorLogHandler` extension reads it's configuration from -`[log.colorlog]`. - - -[comment]: <> (--------------------------------------------------------------) - -## Arguments - -> Simple Arguments Defined With Cement App - -```python - -from cement import App - -with App('myapp') as app: - app.args.add_argument('-f', '--foo', - help='notorous foo option', - dest='foo') - app.run() - - # do something with parsed arguments - if app.pargs.foo is not None: - print("Foo Argument => %s" % app.pargs.foo) - -``` - -> Arguments Defined by Controllers - -```python - -from cement import App, Controller, ex - - -class Base(Controller): - class Meta: - label = 'base' - - arguments = [ - # list of tuples in the format `( [], {} )` - ( [ '-f', '--foo' ], - { 'help' : 'notorious foo option', - 'dest' : 'foo' } ), - ] - - @ex(hide=True) - def _default(self): - print('Inside BaseController._default()') - - # do something with parsed arguments - if self.app.pargs.foo is not None: - print("Foo Argument => %s" % self.app.pargs.foo) - - -class MyApp(App): - class Meta: - label = 'myapp' - handlers = [Base] - - -with MyApp() as app: - app.run() - -``` - -> Usage - -``` -$ python myapp.py --help -usage: myapp [-h] [--debug] [--quiet] [-f FOO] - -optional arguments: - -h, --help show this help message and exit - --debug toggle debug output - --quiet suppress all output - -f FOO, --foo FOO notorous foo option - -$ python myapp.py -f bar -Foo Argument => bar -``` - -Argument parsing is based on the standard -[Argparse](https://docs.python.org/3/library/argparse.html) library, with the -same usage that you're familiar with. The argument handler -`ArgparseArgumentHandler` is instantiated as `app.args`, arguments are defined -with `app.args.add_argument()`, and parsed arguments are stored as -`app.args.parsed_args` (or more conveniently `app.pargs` for easy reference). - - -### Arguments Defined by Controllers - -The power of the framework comes into play when we start talking about -application controllers that streamline the process of mapping arguments and -sub-commands to actions/functions as in the example (more on that later). - -[comment]: <> (--------------------------------------------------------------) - -## Logging - -> Logging Example - -```python - -from cement import App - -with App('myapp') as app: - app.run() - - # log messages to console and file - app.log.info('this is an info message') - app.log.warning('this is an warning message') - app.log.error('this is an error message') - app.log.fatal('this is an fatal message') - app.log.debug('this is an debug message') - - -``` - -> Logging Configuration Example - -``` -[myapp] -log_handler = logging - -[log.logging] -to_console = true -file = /path/to/myapp.log -level = warning -``` - -Logging is based on the standard -[Logging](https://docs.python.org/3/library/logging.html) library, with the -same usage you're familiar with. The logging facility is customizable via the -`[log.logging]` section of an applications configuration: - - -- `level` - The level at which to start logging (`INFO`, `WARNING`, `ERROR`, - `FATAL`, `DEBUG`, etc). -- `file` (*path*) - File path to log to. -- `to_console` (*bool*) - Whether or not to log to console. -- `rotate` (*bool*) - Whether or not to rotate the log file when it hits - `max_bytes` -- `max_bytes` (*int*) - Maximum file size in bytes before file gets rotated -- `max_files` (*int*) - Maximum number of log files to keep after rotating - - -Cement also includes the following optional extensions that provide drop-in -replacements for the default log handler: - -- `ColorlogHandler` - Provides colorized log output via the - [Colorlog](https://github.com/borntyping/python-colorlog) library. - - -[comment]: <> (--------------------------------------------------------------) - -## Output - -> Standard Output via Print Statements - -```python -from cement import App - -with App('myapp') as app: - print('About Run MyApp!') - app.run() -``` - -> Mixed Template/JSON Output Example - -```python -from cement import App - -class MyApp(App): - class Meta: - label = 'myapp' - - ### add optional extensions - extensions = ['json', 'mustache'] - - ### set the default output handler - output_handler = 'mustache' - - ### external template directory - template_dir = '/path/to/templates' - - ### internal template module (shipped with app code) - template_module = 'myapp.templates' - - -with MyApp() as app: - app.run() - - ### create some data - data = { - 'foo' : 'bar', - } - - ### render data using mustache template (by default) - app.render(data, 'example.m') - -``` - -> Mustache Template: /path/to/templates/example.m - -``` -The value of foo={{foo}}. -``` - -> Usage - -``` -$ python test.py --help -usage: myapp [-h] [--debug] [--quiet] [-o {json}] - -optional arguments: - -h, --help show this help message and exit - --debug toggle debug output - --quiet suppress all output - -o {json} output handler - - -$ python myapp.py -The value of foo=bar - - -$ python myapp.py -o json -{"foo": "bar"} -``` - -By default, Cement does not define any output handlers. Just like any other -app, you are free to `print()` to console all you like or use the builtin -logging facility. That said, more complex applications will benefit greatly -by separating the output from the logic. Think of output handling as the -`view` in a traditional -[MVC Framework](https://en.wikipedia.org/wiki/Model-view-controller). - -Cement ships with several types of extensions that produce output in -different forms, including the following: - -- Text Rendered From Template Files -- Programatic Structures (JSON, Yaml, etc) -- Tabulated (like MySQL, etc) -- Etc - -The following output handlers ship with Cement: - -- `Json` - Produces JSON output from dicts -- `Yaml` - Produces Yaml output from dicts -- `Mustache` - Produces text output rendered from - [Mustache](http://mustache.github.io/) templates -- `Handlebars` - Produces text output rendered from - [Handlebars](https://github.com/wbond/pybars3) templates -- `Jinja2` - Produces text output rendered from - [Jinja2](http://jinja.pocoo.org/) templates -- `Tabulated` - Produces tabulated text output rendered via the - [Tabulate](https://pypi.python.org/pypi/tabulate) library. - - -### Multiple Output Handler Support - -One of the unique features of Cement is that you can build your application -to support multiple output handlers and formats. Output handlers have a -special attribute that allows them to be exposed via the CLI option -`-o` (configurable via `App.Meta.core_handler_override_options`). Therefore, -you might have default text based output rendered from Mustache templates, but -optionally output programatic structures *from the same dict* when necessary -(i.e.`$ myapp -o json`). - - -[comment]: <> (--------------------------------------------------------------) - -## Controllers - -> Example: Application Base Controller - -```python -from cement import App, Controller, ex - - -class Base(Controller): - class Meta: - label = 'base' - - arguments = [ - # list of tuples in the format `( [], {} )` - ( [ '-a' ], - { 'help' : 'example a option', - 'dest' : 'a' } ), - ] - - def _default(self): - print('Inside Base._default()') - if self.app.pargs.a: - print('Received Option: -a') - - @ex( - help='sub-command under base controller', - arguments=[ - ( [ '-b' ], - { 'help' : 'cmd1 b option' } ), - ] - ) - def cmd1(self): - print('Inside Base.cmd1()') - if self.app.pargs.b: - print('Recieved Option: -b') - - -class MyApp(App): - class Meta: - label = 'myapp' - handlers = [ - Base, - ] - - -with MyApp() as app: - app.run() -``` - -> Usage - -```bash -### help output shows base namespace arguments and sub-commands - -$ python myapp.py --help -usage: myapp [-h] [--debug] [--quiet] [-a A] {cmd1} ... - -optional arguments: - -h, --help show this help message and exit - --debug toggle debug output - --quiet suppress all output - -a A example a option - -sub-commands: - {cmd1} - cmd1 sub-command under base controller - - -$ python myapp.py -a foo -Inside Base._default() -Received Option: -a - - -### sub-commands support their own arguments - -$ python myapp.py cmd1 --help -usage: myapp cmd1 [-h] [-b B] - -optional arguments: - -h, --help show this help message and exit - -b B cmd1 b option - - -$ python myapp.py cmd1 -b foo -Inside Base.cmd1() -Recieved Option: -b -``` - -Controllers provide a common means of organizing application logic into -relevant chunks of code, as well as the ability for plugins and extensions to -extend an applications capabilities. It is the `Controller` piece of the -traditional -[MVC Framework](https://en.wikipedia.org/wiki/Model-view-controller). - -The first controller is called `base`, and if registered will take over -runtime control when `app.run()` is called. What this means is, instead of -Cement calling `app.args.parse_arguments()` directly, the application dispatch -is handed over to the `base` controller, that is then responsible for -parsing and handling arguments. This is what we call `Runtime Dispatch`. - -The most notable action of `Runtime Dispatch` is mapping arguments and -sub-commands to their respective controllers and functions. For example, the -default action when running `$ myapp` without any arguments or sub-commands -is to execute the `BaseController._default()` function. - -### Nested / Embedded Controllers - -Cement supports two types of controller `stacking`: - -- `nested` - The arguments and commands are nested under a sub-parser whose - label is that of the controller. For example, a nested controller with a - label of `my-nested-controller` would be called as - `$ myapp my-nested-controller sub-command`. -- `embedded` - The arguments and commands are embedded within it's parent - controller, therefore appearing as if they were defined by the parent - itself. A sub-command under an embedded controller would be called as - `$ myapp sub-command`. - - -Controllers can be stacked on other controllers as many levels deep as -necessary. An `embedded` controller can be stacked on top of a `nested` -controller, and vice versa. There is little, if any, limitation. - -### Controller Arguments vs Command Arguments - -Both Controllers and their sub-commands can have arguments defined. Think of -controllers as the primary namespace. It's arguments should be globally -relevant within that namespace. A sub-command within the namespace can have -it's own arguments, but are only relevant to that sub-command. - -For example: `$ myapp -a my-controller -b my-sub-command -c` - -In the above example, `-a` is relevant to the global scope of the entire -application because it is defined on the `base` controller. Option `-b` is -relevant to the scope of `my-controller` and all sub-commands under it. -Finally, `-c` is only relevant to the `my-sub-command` and has no use -elsewhere. - - -### Exposing Sub-Commands - -By default, no commands are exposed to the CLI except that a `_default()` -function will be called if no sub-command is passed (configurable by -`Controller.Meta.default_func`). - -To expose a function as a sub-command, you must decorate it with `@ex()`. -It's usage is simple, and supports the following parameters: - -- `hide` (*bool*) - Whether or not to display in `--help` output. -- `arguments` (*list*) - Argument list of tuples in the format `( [], {} )`, - that are passed to `Argparse.add_argument(*args, **kwargs)`. -- `**kwargs` - Additional keyword arguments are passed directly to Argparse - when creating the sub-parser for this command. - - - - - -[comment]: <> (--------------------------------------------------------------) - -## Framework Extensions - -> Example: Using Framework Extensions - -```python -from time import sleep -from cement import App - - -class MyApp(App): - class Meta: - label = 'myapp' - extensions = [ - 'alarm', - ] - - -with MyApp() as app: - app.run() - - ### set an alarm based on the max allowed run time - app.alarm.set(3, "The operation timed out after 3 seconds!") - - ### do something that takes time to operate - sleep(5) - - ### stop the alarm if it ran within the time frame - app.alarm.stop() -``` - -> Usage - -```bash -$ python myapp.py -ERROR: The operation timed out after 3 seconds! -Traceback (most recent call last): - File "myapp.py", line 20, in - sleep(5) - File "cement/core/foundation.py", line 123, in cement_signal_handler - raise exc.CaughtSignal(signum, frame) -cement.core.exc.CaughtSignal: Caught signal 14 -``` - -Cement's Interfaces and Handlers system make extending the framework easy, and -limitless. Cement ships dozens of extensions that either alter existing -funtionality, or add to it. For example, the default logging facility -provides basic logging capabilities, however with a single line of code an -application can instead use the `colorlog` extension to enable colorized -console logging. - -The example provides a quick look at using the `alarm` extension to handle -application timeouts of long running operations - -Cement includes (but not limited to) the following extensions: - -- `alarm` - Provides easy access to setting an application alarm to handle - timing out operations -- `argparse` - Provides `ArgparseArgumentHandler` and `ArgparseController` - handlers built on Argparse -- `colorlog` - Provides `ColorLogHandler` that produces colorized console - logging -- `configparser` - Provides `ConfigParserConfigHandler` handler for - application configuration built on on ConfigParser -- `daemon` - Provides daemonization, pidfile management, user/group - context switching, etc -- `handlebars` - Provides `HandlebarsOutputHandler` to render text output from - Handlerbars templates -- `jinja2` - Provides `Jinja2OutputHandler` to render text output from - Jinja2 templates -- `json` - Provides `JsonConfigHandler` and `JsonOutputHandler` to read - JSON configuration files, and produce JSON structured output. -- `logging` - Provides `LoggingLogHandler` for standard application - logging -- `memcached` - Providers `MemcachedCacheHandler` for caching built on - Memcached -- `mustache` - Provides `MustacheOutputHandler` to render text output from - Mustache templates -- `plugin` - Provides `CementPluginHandler` for application plugin support -- `redis` - Provides `RedisCacheHandler` for caching built on Redis -- `smtp` - Provides `SMTPMailHandler` for email messaging -- `tabulate` - Provides `TabulateOutputHandler` for text output tabularized - like MySQL, etc -- `watchdog` - Provides cross-platform directory/file monitoring in order to - handle filesystem events as they occur. -- `yaml` - Providers `YamlConfigHandler` and `YamlOutputHandler` to read - Yaml configuration files, and produce Yaml structured output. - - -[comment]: <> (--------------------------------------------------------------) - -## Application Plugins - -FIX ME - - -[comment]: <> (--------------------------------------------------------------) - -## Hooks - -> Example: Executing Code Via Hooks - -```python -from cement import App - - -def my_example_hook(app): - print('Inside my_example_hook()') - - -class MyApp(App): - class Meta: - label = 'myapp' - hooks = [ - ('post_argument_parsing', my_example_hook), - ] - - -with MyApp() as app: - app.run() -``` - -> Usage - -```bash -$ python myapp.py -Inside my_example_hook() -``` - -Hooks provide developers the ability to tie into the framework, and -applications without direct access to the runtime. For example, a plugin -might need to execute some code after arguments have been parsed, but before -controller sub-commands are dispatched. As a plugin developer, you don't have -direct access to the applications runtime code but you can still tie into it -with the builtin `post_argument_parsing` hook. - -Cement defines several hooks that tie in to specific points throughout the -application life cycle, however application developers can also define their -own hooks allowing others to tie elsewhere, when needed. diff --git a/doc-new/content/upgrading.md b/doc-new/content/upgrading.md deleted file mode 100644 index 8b813ec9..00000000 --- a/doc-new/content/upgrading.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -weight: 99 -title: Upgrading ---- - -# Upgrading - -This section outlines any information and changes that might need to be made -in order to update your application built on previous versions of Cement. - -## 2.8.x to 2.9.x - -Cement 2.9 introduces a few incompatible changes from the previous 2.8 stable -release, as noted in the :ref:`ChangeLog `. - -### Deprecated: cement.core.interface.list() - -This function should no longer be used in favor of -`CementApp.handler.list_types()`. It will continue to work throughout -Cement 2.x, however is not compatible if -`CementApp.Meta.use_backend_globals == False`. - -Related: - - * [Issue #366](https://github.com/datafolklabs/cement/issues/366) - * [Issue #376](https://github.com/datafolklabs/cement/issues/376) - - diff --git a/doc-new/layouts/partials/hook_head_end.html b/doc-new/layouts/partials/hook_head_end.html deleted file mode 100644 index 9961b286..00000000 --- a/doc-new/layouts/partials/hook_head_end.html +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/doc-new/static/images/logo.png b/doc-new/static/images/logo.png deleted file mode 100644 index a1e298ec..00000000 Binary files a/doc-new/static/images/logo.png and /dev/null differ diff --git a/doc-new/themes/docuapi/.gitignore b/doc-new/themes/docuapi/.gitignore deleted file mode 100644 index 088d287a..00000000 --- a/doc-new/themes/docuapi/.gitignore +++ /dev/null @@ -1 +0,0 @@ -docuapi \ No newline at end of file diff --git a/doc-new/themes/docuapi/LICENSE.md b/doc-new/themes/docuapi/LICENSE.md deleted file mode 100644 index b62a9b5f..00000000 --- a/doc-new/themes/docuapi/LICENSE.md +++ /dev/null @@ -1,194 +0,0 @@ -Apache License -============== - -_Version 2.0, January 2004_ -_<>_ - -### Terms and Conditions for use, reproduction, and distribution - -#### 1. Definitions - -“License” shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -“Licensor” shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -“Legal Entity” shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, “control” means **(i)** the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the -outstanding shares, or **(iii)** beneficial ownership of such entity. - -“You” (or “Your”) shall mean an individual or Legal Entity exercising -permissions granted by this License. - -“Source” form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -“Object” form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -“Work” shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -“Derivative Works” shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -“Contribution” shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -“submitted” means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as “Not a Contribution.” - -“Contributor” shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -#### 2. Grant of Copyright License - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -#### 3. Grant of Patent License - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -#### 4. Redistribution - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -* **(a)** You must give any other recipients of the Work or Derivative Works a copy of -this License; and -* **(b)** You must cause any modified files to carry prominent notices stating that You -changed the files; and -* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. - -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -#### 5. Submission of Contributions - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -#### 6. Trademarks - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -#### 7. Disclaimer of Warranty - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -#### 8. Limitation of Liability - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -#### 9. Accepting Warranty or Additional Liability - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -_END OF TERMS AND CONDITIONS_ - -### APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets `[]` replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same “printed page” as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/doc-new/themes/docuapi/Makefile b/doc-new/themes/docuapi/Makefile deleted file mode 100644 index f11b338b..00000000 --- a/doc-new/themes/docuapi/Makefile +++ /dev/null @@ -1,26 +0,0 @@ - - -# -# Makefile to perform rebuilds after changes to asset files. -# -# n.b. you must install fswatch (OS X: `brew install fswatch`) -# -# To start live live rebuilds, use the following command: -# $ make serve -# - -# TODO: Figure a way to watch recursive -SLATE_DIR := /Users/bep/dev/clone/slate -WATCH_PATHS = ./assets/*.* ./assets/javascripts/*.* ./assets/javascripts/app/*.* -WATCH_PATHS := ${WATCH_PATHS} ./assets/stylesheets/*.* - -build: - go run bundler.go -slate=${SLATE_DIR} - -serve: - @make build - @fswatch -o ${WATCH_PATHS} | xargs -n1 -I{} make build - -release: - git tag -a ${version} -m "Release ${version}" - git push --follow-tags diff --git a/doc-new/themes/docuapi/README.md b/doc-new/themes/docuapi/README.md deleted file mode 100644 index b81c199a..00000000 --- a/doc-new/themes/docuapi/README.md +++ /dev/null @@ -1,69 +0,0 @@ -**DocuAPI** is a beautiful multilingual API documentation theme for [Hugo](http://gohugo.io/). This theme is built on top of the beautiful work of [Robert Lord](https://github.com/lord) and others on the [Slate](https://github.com/lord/slate) project ([Apache 2 License](https://github.com/lord/slate/blob/master/LICENSE)). - -
- -> Visit the [demo site](https://docuapi.com/). - -
- -![Screenshot DocuAPI Example site](https://raw.githubusercontent.com/bep/docuapi/master/images/screenshot.png) - -## Use - -See the [exampleSite](https://github.com/bep/docuapi/tree/master/exampleSite) and more specific its site [configuration](https://github.com/bep/docuapi/blob/master/exampleSite/config.toml) for the available options. - -**Note that this theme needs Pygments installed to render code samples. See [pygments.org](http://pygments.org/)** - -**Most notable:** This theme will use all the (non drafts) pages in the site and build a single-page API documentation. Using `weight` in the page front matter is the easiest way to control page order. - -If you want a different page selection, please provide your own `layouts/index.html` template. - -## Hooks - -When the fix for [#2549](https://github.com/spf13/hugo/issues/2549) is released we may do this with blocks, but until then you can provide some custom partials: - -* `partials/hook_head_end.html` is inserted right before the `head` end tag. Useful for additional styles etc. -* `partials/hook_body_end.html` which should be clear by its name. -* `partials/hook_left_sidebar_start.html` the start of the left sidebar -* `partials/hook_left_sidebar_end.html` the end of the left sidebar -* `partials/hook_left_sidebar_logo.html` the log `img` source - -The styles and Javascript import are also put in each partial and as such can be overridden if really needed: - -* `partials/styles.html` -* `partials/js.html` - -## Develop the Theme - -**Note:** In most situations you will be well off just using the theme and maybe in some cases provide your own template(s). Please refer to the [Hugo Documentation](http://gohugo.io/overview/introduction/) for that. - -But you may find styling issues, etc., that you want to fix. Those Pull Requests are warmly welcomed! - -**If you find issues that obviously belongs to [Slate](https://github.com/lord/slate), then please report/fix them there, and we will pull in the latest changes here.** - -This project provides a very custom asset bundler in [bundler.go](https://github.com/bep/docuapi/blob/master/bundler.go) written in Go. - -It depends on `libsass` to build, so you will need `gcc` (a C compiler) to build it for your platform. If that is present, you can try: - -* `go get -u -v .` -* `go run bundler.go` (this will clone Slate to a temp folder) -* Alternative to the above if you already have Slate cloned somewhere: `go run bundler.go -slate=/path/to/Slate` - -All options: - -```bash -go run bundler.go -h - -minify - apply minification to output Javascript, CSS etc. (default true) - -slate string - the path to the Slate source, if not set it will be cloned from https://github.com/lord/slate.git -``` - -With `make` and `fswatch` (OSX only, I believe) available, you can get a fairly enjoyable live-reloading development experience for all artifacts by running: - -* `hugo server` in your Hugo site project. -* `make serve` in the theme folder. - - - - diff --git a/doc-new/themes/docuapi/archetypes/default.md b/doc-new/themes/docuapi/archetypes/default.md deleted file mode 100644 index ac36e062..00000000 --- a/doc-new/themes/docuapi/archetypes/default.md +++ /dev/null @@ -1,2 +0,0 @@ -+++ -+++ diff --git a/doc-new/themes/docuapi/assets/images/logo.psd b/doc-new/themes/docuapi/assets/images/logo.psd deleted file mode 100644 index 4243d512..00000000 Binary files a/doc-new/themes/docuapi/assets/images/logo.psd and /dev/null differ diff --git a/doc-new/themes/docuapi/assets/javascripts/app/_lang.js b/doc-new/themes/docuapi/assets/javascripts/app/_lang.js deleted file mode 100644 index 9572b019..00000000 --- a/doc-new/themes/docuapi/assets/javascripts/app/_lang.js +++ /dev/null @@ -1,168 +0,0 @@ -//= require ../lib/_jquery - -/* -Copyright 2008-2013 Concur Technologies, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); you may -not use this file except in compliance with the License. You may obtain -a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. -*/ -(function (global) { - 'use strict'; - - var languages = []; - - - global.setupLanguages = setupLanguages; - global.activateLanguage = activateLanguage; - - function activateLanguage(language) { - if (!language) return; - if (language === "") return; - $(".lang-selector a").removeClass('active'); - $(".lang-selector a[data-language-name='" + language + "']").addClass('active'); - // Mod to match Pygments from Hugo: div.highlight > pre code.language-ruby - var codeSelectorPrefix = ".highlight code.language-"; - for (var i=0; i < languages.length; i++) { - $(codeSelectorPrefix + languages[i]).parentsUntil(".highlight").hide(); - $(".lang-specific." + languages[i]).hide(); - } - $(codeSelectorPrefix + language).parentsUntil(".highlight").show(); - $(".lang-specific." + language).parentsUntil(".highlight").show(); - - global.toc.calculateHeights(); - - // scroll to the new location of the position - if ($(window.location.hash).get(0)) { - $(window.location.hash).get(0).scrollIntoView(true); - } - } - - // parseURL and stringifyURL are from https://github.com/sindresorhus/query-string - // MIT licensed - // https://github.com/sindresorhus/query-string/blob/7bee64c16f2da1a326579e96977b9227bf6da9e6/license - function parseURL(str) { - if (typeof str !== 'string') { - return {}; - } - - str = str.trim().replace(/^(\?|#|&)/, ''); - - if (!str) { - return {}; - } - - return str.split('&').reduce(function (ret, param) { - var parts = param.replace(/\+/g, ' ').split('='); - var key = parts[0]; - var val = parts[1]; - - key = decodeURIComponent(key); - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); - - if (!ret.hasOwnProperty(key)) { - ret[key] = val; - } else if (Array.isArray(ret[key])) { - ret[key].push(val); - } else { - ret[key] = [ret[key], val]; - } - - return ret; - }, {}); - }; - - function stringifyURL(obj) { - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; - - if (Array.isArray(val)) { - return val.sort().map(function (val2) { - return encodeURIComponent(key) + '=' + encodeURIComponent(val2); - }).join('&'); - } - - return encodeURIComponent(key) + '=' + encodeURIComponent(val); - }).join('&') : ''; - }; - - // gets the language set in the query string - function getLanguageFromQueryString() { - if (location.search.length >= 1) { - var language = parseURL(location.search).language - if (language) { - return language; - } else if (jQuery.inArray(location.search.substr(1), languages) != -1) { - return location.search.substr(1); - } - } - - return false; - } - - // returns a new query string with the new language in it - function generateNewQueryString(language) { - var url = parseURL(location.search); - if (url.language) { - url.language = language; - return stringifyURL(url); - } - return language; - } - - // if a button is clicked, add the state to the history - function pushURL(language) { - if (!history) { return; } - var hash = window.location.hash; - if (hash) { - hash = hash.replace(/^#+/, ''); - } - history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash); - - // save language as next default - localStorage.setItem("language", language); - } - - function setupLanguages(l) { - var defaultLanguage = localStorage.getItem("language"); - - languages = l; - - var presetLanguage = getLanguageFromQueryString(); - if (presetLanguage) { - // the language is in the URL, so use that language! - activateLanguage(presetLanguage); - - localStorage.setItem("language", presetLanguage); - } else if ((defaultLanguage !== null) && (jQuery.inArray(defaultLanguage, languages) != -1)) { - // the language was the last selected one saved in localstorage, so use that language! - activateLanguage(defaultLanguage); - } else { - // no language selected, so use the default - activateLanguage(languages[0]); - } - } - - // if we click on a language tab, activate that language - $(function() { - $(".lang-selector a").on("click", function() { - var language = $(this).data("language-name"); - pushURL(language); - activateLanguage(language); - return false; - }); - window.onpopstate = function() { - activateLanguage(getLanguageFromQueryString()); - }; - }); -})(window); diff --git a/doc-new/themes/docuapi/assets/stylesheets/_docuapi.scss b/doc-new/themes/docuapi/assets/stylesheets/_docuapi.scss deleted file mode 100644 index 99768287..00000000 --- a/doc-new/themes/docuapi/assets/stylesheets/_docuapi.scss +++ /dev/null @@ -1,43 +0,0 @@ - - -// The section(s) below are just pulled over from _variables.scss in Slate and adjusted. - -// Make the selected code language a nice blue. -$lang-select-active-bg: $nav-active-bg; - -// Make the main background color slightly lighter than the original. -$main-bg: lighten(#eaf2f6, 2%); - - -// This will be added as the last import to the original Slate screen.css.scs. TOOD(bep) Print? - -.content { - // prevent clearing of higlight divs - &>div.highlight { - clear:none; - } -} - -.toc-footer { - .translations-title { - background-color: $nav-subitem-bg; - padding: 10px $nav-padding; - color: $nav-text; - font-size: 12px; - } -} - - - -// Getting the paths just right for Android and iOS and friends is hard ... -@font-face { - font-family:'slate'; - src:url(/fonts/slate.eot?-syv14m); - src:url(../fonts/slate.eot?#iefix-syv14m) format("embedded-opentype"), - url(../fonts/slate.woff2?-syv14m) format("woff2"), - url(../fonts/slate.woff?-syv14m) format("woff"), - url(../fonts/slate.ttf?-syv14m) format("truetype"), - url(../fonts/slate.svg?-syv14m#slate) format("svg"); - font-weight: normal; - font-style: normal; -} \ No newline at end of file diff --git a/doc-new/themes/docuapi/assets/stylesheets/monokai.css b/doc-new/themes/docuapi/assets/stylesheets/monokai.css deleted file mode 100644 index e020d51f..00000000 --- a/doc-new/themes/docuapi/assets/stylesheets/monokai.css +++ /dev/null @@ -1,65 +0,0 @@ -.highlight pre { background-color: #272822; } -.highlight .hll { background-color: #272822; } -.highlight .c { color: #75715e } /* Comment */ -.highlight .err { color: #960050; background-color: #1e0010 } /* Error */ -.highlight .k { color: #66d9ef } /* Keyword */ -.highlight .l { color: #ae81ff } /* Literal */ -.highlight .n { color: #f8f8f2 } /* Name */ -.highlight .o { color: #f92672 } /* Operator */ -.highlight .p { color: #f8f8f2 } /* Punctuation */ -.highlight .cm { color: #75715e } /* Comment.Multiline */ -.highlight .cp { color: #75715e } /* Comment.Preproc */ -.highlight .c1 { color: #75715e } /* Comment.Single */ -.highlight .cs { color: #75715e } /* Comment.Special */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .kc { color: #66d9ef } /* Keyword.Constant */ -.highlight .kd { color: #66d9ef } /* Keyword.Declaration */ -.highlight .kn { color: #f92672 } /* Keyword.Namespace */ -.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ -.highlight .kr { color: #66d9ef } /* Keyword.Reserved */ -.highlight .kt { color: #66d9ef } /* Keyword.Type */ -.highlight .ld { color: #e6db74 } /* Literal.Date */ -.highlight .m { color: #ae81ff } /* Literal.Number */ -.highlight .s { color: #e6db74 } /* Literal.String */ -.highlight .na { color: #a6e22e } /* Name.Attribute */ -.highlight .nb { color: #f8f8f2 } /* Name.Builtin */ -.highlight .nc { color: #a6e22e } /* Name.Class */ -.highlight .no { color: #66d9ef } /* Name.Constant */ -.highlight .nd { color: #a6e22e } /* Name.Decorator */ -.highlight .ni { color: #f8f8f2 } /* Name.Entity */ -.highlight .ne { color: #a6e22e } /* Name.Exception */ -.highlight .nf { color: #a6e22e } /* Name.Function */ -.highlight .nl { color: #f8f8f2 } /* Name.Label */ -.highlight .nn { color: #f8f8f2 } /* Name.Namespace */ -.highlight .nx { color: #a6e22e } /* Name.Other */ -.highlight .py { color: #f8f8f2 } /* Name.Property */ -.highlight .nt { color: #f92672 } /* Name.Tag */ -.highlight .nv { color: #f8f8f2 } /* Name.Variable */ -.highlight .ow { color: #f92672 } /* Operator.Word */ -.highlight .w { color: #f8f8f2 } /* Text.Whitespace */ -.highlight .mf { color: #ae81ff } /* Literal.Number.Float */ -.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */ -.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */ -.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */ -.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ -.highlight .sc { color: #e6db74 } /* Literal.String.Char */ -.highlight .sd { color: #e6db74 } /* Literal.String.Doc */ -.highlight .s2 { color: #e6db74 } /* Literal.String.Double */ -.highlight .se { color: #ae81ff } /* Literal.String.Escape */ -.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ -.highlight .si { color: #e6db74 } /* Literal.String.Interpol */ -.highlight .sx { color: #e6db74 } /* Literal.String.Other */ -.highlight .sr { color: #e6db74 } /* Literal.String.Regex */ -.highlight .s1 { color: #e6db74 } /* Literal.String.Single */ -.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ -.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ -.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ -.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ -.highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ - -.highlight .gh { } /* Generic Heading & Diff Header */ -.highlight .gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ -.highlight .gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ -.highlight .gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ diff --git a/doc-new/themes/docuapi/bundler.go b/doc-new/themes/docuapi/bundler.go deleted file mode 100644 index 088c0536..00000000 --- a/doc-new/themes/docuapi/bundler.go +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright 2016 Bjørn Erik Pedersen s. All rights reserved. -// -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "os" - "os/exec" - "path/filepath" - "strings" - - "github.com/tdewolff/minify" - "github.com/tdewolff/minify/js" - - shutil "github.com/termie/go-shutil" - libsass "github.com/wellington/go-libsass" -) - -const ( - - // The source for the styles and scripts. - // If you have Slate locally, set the slate flag. - slateRepo = "https://github.com/lord/slate.git" -) - -var ( - logger *log.Logger = log.New(os.Stdout, "bundler: ", log.Ldate|log.Ltime|log.Lshortfile) - - staticSlateDirs = []string{ - "images", - "fonts", - } -) - -func main() { - - var ( - slateSourceDir = flag.String("slate", "", "the path to the Slate source, if not set it will be cloned from "+slateRepo) - minify = flag.Bool("minify", true, "apply minification to output Javascript, CSS etc.") - ) - - flag.Parse() - - pwd, err := os.Getwd() - - if err != nil { - logger.Fatal(err) - } - - bundler := newBundler( - *slateSourceDir, - filepath.Join(pwd, "static", "slate"), *minify) - - if err := bundler.init(); err != nil { - logger.Fatal(err) - } - - if err := bundler.fetchSlateIfNeeded(); err != nil { - logger.Fatal(err) - } - - if err := bundler.replaceSlateSourcesInTheme(); err != nil { - logger.Fatal("Failed to move Slate sources: ", err) - } - - if err := bundler.mergeAndAdjustStyles(); err != nil { - logger.Fatal("Failed to edit Slate sources: ", err) - } - - if err := bundler.createJSBundles(); err != nil { - logger.Fatal("Failed to bundle JS: ", err) - } - - if err := bundler.compileSassSources(); err != nil { - logger.Fatal("Failed compile SASS stylesheets: ", err) - } - - logger.Println("Done...") - -} - -type bundler struct { - slateSource string - slateTarget string - - minify bool - - // We do some mods to the Slate source (add some styles). Do that on a copy in here. - tmpSlateSource string - - logger *log.Logger -} - -func newBundler(slateSource, slateTarget string, minify bool) *bundler { - return &bundler{slateSource: slateSource, slateTarget: slateTarget, minify: minify, logger: logger} -} - -func (b *bundler) init() error { - if err := os.RemoveAll(b.slateTarget); err != nil { - return err - } - - if err := os.MkdirAll(b.slateTarget, os.ModePerm); err != nil { - return err - } - - return nil -} - -func (b *bundler) fetchSlateIfNeeded() error { - if b.slateSource != "" { - b.logger.Println("Use existing Slate clone in", b.slateSource) - if err := b.copySlateSourcesToModify(); err != nil { - return err - } - return nil - } - - b.logger.Println("Fetch Slate from", slateRepo) - - slateSource, err := ioutil.TempDir("", "docuapi") - - if err != nil { - return fmt.Errorf("Failed to create tmpdir: %s", err) - } - - if err := cloneSlateInto(slateSource); err != nil { - return fmt.Errorf("Failed to clone Slate: %s", err) - } - - b.slateSource = slateSource - - // This will be replaced on next build, so it is tempoary enough. - b.tmpSlateSource = slateSource - - return nil -} - -func (b *bundler) copySlateSourcesToModify() error { - slateSource, err := ioutil.TempDir("", "docuapi") - - if err != nil { - return fmt.Errorf("Failed to create tmpdir: %s", err) - } - - // We need to adapt the SASS source ... or learn how to use includeDirs ... - if err := shutil.CopyTree( - filepath.Join(b.slateSource, "source", "stylesheets"), - filepath.Join(slateSource, "source", "stylesheets"), nil); err != nil { - return fmt.Errorf("Failed to copy stylesheets: %s", err) - } - - b.tmpSlateSource = slateSource - - return nil -} - -func (b *bundler) replaceSlateSourcesInTheme() error { - for _, staticDir := range staticSlateDirs { - b.logger.Println("Copy", staticDir) - if err := shutil.CopyTree(filepath.Join(b.slateSource, "source", staticDir), filepath.Join(b.slateTarget, staticDir), nil); err != nil { - return err - } - } - return nil -} - -func (b *bundler) mergeAndAdjustStyles() error { - slateStylesheetsDir := filepath.Join(b.tmpSlateSource, "source", "stylesheets") - b.logger.Println("Compile SASS in", slateStylesheetsDir) - - customImports := filepath.Join(b.slateTarget, "..", "..", "assets", "stylesheets") - - // Copy custom SASS files into merged source. Should be able to do this by - // setting an includePath, but ... - fis, err := ioutil.ReadDir(customImports) - - if err != nil { - return err - } - - for _, fi := range fis { - if err := shutil.CopyFile(filepath.Join(customImports, fi.Name()), filepath.Join(slateStylesheetsDir, fi.Name()), false); err != nil { - return fmt.Errorf("failed to copy custom SASS: %s", err) - } - } - - // Insert custom import - if err := replaceInFile(filepath.Join(slateStylesheetsDir, "screen.css.scss"), - "@import 'variables';\n@import 'icon-font';", - "@import 'variables';\n@import 'icon-font';\n@import 'docuapi';"); err != nil { - return err - } - - return nil -} - -func replaceInFile(filename, old, new string) error { - read, err := ioutil.ReadFile(filename) - if err != nil { - return err - } - nc := bytes.Replace(read, []byte(old), []byte(new), -1) - - err = ioutil.WriteFile(filename, nc, os.ModePerm) - if err != nil { - return err - } - return nil -} - -func (b *bundler) compileSassSources() error { - source := filepath.Join(b.tmpSlateSource, "source", "stylesheets") - target := filepath.Join(b.slateTarget, "stylesheets") - os.MkdirAll(target, os.ModePerm) - - fis, err := ioutil.ReadDir(source) - if err != nil { - return err - } - - for _, fi := range fis { - if strings.HasPrefix(fi.Name(), "_") { - continue - } - - targetName := strings.TrimSuffix(fi.Name(), ".scss") - - b.logger.Println("Compile", fi.Name(), "to", targetName) - - cssFile, err := os.Create(filepath.Join(target, targetName)) - if err != nil { - return err - } - - outputStyle := libsass.NESTED_STYLE - - if b.minify { - outputStyle = libsass.COMPRESSED_STYLE - } - - comp, err := libsass.New(cssFile, nil, - libsass.OutputStyle(outputStyle), - libsass.Path(filepath.Join(source, fi.Name())), - ) - - if err != nil { - return err - } - - if err := comp.Run(); err != nil { - return fmt.Errorf("SASS run failed: %s", err) - } - - } - - return nil -} - -func (b *bundler) createJSBundles() error { - src := filepath.Join(b.slateSource, "source", "javascripts") - dst := filepath.Join(b.slateTarget, "javascripts") - overrides := filepath.Join(b.slateTarget, "..", "..", "assets", "javascripts") - jsB := newJSBundler(src, dst, overrides, b.minify) - return jsB.bundle() -} - -func cloneSlateInto(dir string) error { - logger.Println("Clone Slate into", dir, "...") - - cmd := exec.Command("git", "clone", "-b", "docuapi", slateRepo, dir) - return cmd.Run() -} - -type jsBundler struct { - src string - dst string - - minify bool - - overridesSrc string - overrides map[string][]byte - - logger *log.Logger - - // Per bundle - seen map[string]bool - buff bytes.Buffer -} - -func newJSBundler(src, dst, overridesSrc string, minify bool) *jsBundler { - return &jsBundler{src: src, dst: dst, overridesSrc: overridesSrc, minify: minify, logger: logger, overrides: make(map[string][]byte)} -} - -func (j *jsBundler) readOverrides() error { - j.logger.Println("Looking for overrides in", j.overridesSrc) - return filepath.Walk(j.overridesSrc, func(path string, info os.FileInfo, err error) error { - if info.IsDir() { - return nil - } - libPath := strings.TrimPrefix(path, j.overridesSrc) - libPath = strings.TrimPrefix(libPath, string(filepath.Separator)) - j.logger.Println("Adding override:", libPath) - - libContent, err := ioutil.ReadFile(path) - if err != nil { - return err - } - - j.overrides[libPath] = libContent - - return nil - }) - -} - -func (j *jsBundler) bundle() error { - - if err := j.readOverrides(); err != nil { - return err - } - - if err := os.MkdirAll(j.dst, os.ModePerm); err != nil { - return err - } - - fis, err := ioutil.ReadDir(j.src) - if err != nil { - return err - } - - for _, fi := range fis { - if !strings.HasSuffix(fi.Name(), ".js") { - continue - } - - filename := filepath.Join(j.src, fi.Name()) - if err := j.newBundle(filename); err != nil { - return err - } - - var source bytes.Buffer - - if j.minify { - j.logger.Println("Minify JS") - m := minify.New() - m.AddFunc("text/javascript", js.Minify) - if err := m.Minify("text/javascript", &source, &j.buff); err != nil { - return err - } - } else { - source = j.buff - } - - if err = ioutil.WriteFile(filepath.Join(j.dst, fi.Name()), source.Bytes(), os.ModePerm); err != nil { - return fmt.Errorf("Failed to write to destination: %s", err) - } - - } - - return nil -} - -func (j *jsBundler) newBundle(filename string) error { - j.logger.Println("New bundle from ", filename) - j.seen = make(map[string]bool) - j.buff.Reset() - - j.buff.WriteString("\n\n// From bep's Poor Man's JS bundler // ----\n") - - return j.handleFile(filename) -} - -func (j *jsBundler) handleFile(filename string) error { - - var ( - overridenContent = j.getOverrideIfFound(filename) - currDir = filepath.Dir(filename) - libs []string - ) - - if overridenContent == nil { - file, err := os.Open(filename) - if err != nil { - return err - } - - // TODO(bep) exclude the requires when writing to bundle - libs = j.extractRequiredLibs(file) - - file.Close() - } else { - libs = j.extractRequiredLibs(bytes.NewReader(overridenContent)) - } - - for _, lib := range libs { - if j.seen[lib] { - continue - } - - j.seen[lib] = true - - lib += ".js" - libFilename := filepath.Join(currDir, lib) - - //j.logger.Println("Handle lib", lib) - - // Must write its dependencies first - if err := j.handleFile(libFilename); err != nil { - return err - } - - var content []byte - var err error - - content = j.getOverrideIfFound(libFilename) - - if content == nil { - content, err = ioutil.ReadFile(libFilename) - if err != nil { - return err - } - } - - _, err = j.buff.Write(content) - if err != nil { - return err - } - - } - - return nil -} - -func (j *jsBundler) getOverrideIfFound(filename string) []byte { - libPath := strings.TrimPrefix(filename, j.src) - libPath = strings.TrimPrefix(libPath, string(filepath.Separator)) - return j.overrides[libPath] -} - -func (j *jsBundler) extractRequiredLibs(r io.Reader) []string { - const require = "//= require" - scanner := bufio.NewScanner(r) - var libs []string - for scanner.Scan() { - t := strings.TrimSpace(scanner.Text()) - if strings.HasPrefix(t, require) { - libs = append(libs, strings.TrimSpace(t[len(require):])) - } - } - return libs -} diff --git a/doc-new/themes/docuapi/exampleSite/.gitignore b/doc-new/themes/docuapi/exampleSite/.gitignore deleted file mode 100644 index 85a1daf9..00000000 --- a/doc-new/themes/docuapi/exampleSite/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/public \ No newline at end of file diff --git a/doc-new/themes/docuapi/exampleSite/config.toml b/doc-new/themes/docuapi/exampleSite/config.toml deleted file mode 100644 index 7e5518b9..00000000 --- a/doc-new/themes/docuapi/exampleSite/config.toml +++ /dev/null @@ -1,71 +0,0 @@ -theme = "docuapi" -themesdir = "../.." -languageCode = "en-us" -baseurl = "http://docuapi.com/" -title = "DocuAPI Example Site" - -# Code higlighting settings -pygmentsCodefences = true -pygmentsCodeFencesGuesSsyntax = false -pygmentsOptions = "" -pygmentsStyle = "monokai" -# The monokai stylesheet is included in the base template. -pygmentsUseClasses = true - -defaultContentLanguage = "en" - -[params] -search = true - -# Configure the language example tabs. -[[params.language_tabs]] -key = "go" -name = "Go" -[[params.language_tabs]] -key = "shell" -name = "Shell" -[[params.language_tabs]] -key = "ruby" -name = "Ruby" -[[params.language_tabs]] -key = "python" -name = "Python" -[[params.language_tabs]] -key = "javascript" -name = "Javascript" - -#Languages -[languages] - -[languages.en] -languageName = "English" -weight = 2 -title = "DocuAPI Example Site" - -# Left sidebar footer items. Use HTMl or Markdown. -toc_footers = [ -"Sign Up for a Developer Key", -"Documentation Powered by [DocuAPI](https://github.com/bep/docuapi)", -"Hugo Theme by [bep](https://github.com/bep)" -] -[languages.en.blackfriday] -angledQuotes = false -hrefTargetBlank = true - - -[languages.nn] -languageName = "Nynorsk" -weight = 1 -title = "DocuAPI-døme" - -# Left sidebar footer items. Use HTMl or Markdown. -toc_footers = [ -"Registrer deg for ein utviklarnøkkel", -"Dokumentasjonen er driven av [DocuAPI](https://github.com/bep/docuapi)", -"Hugo Theme av [bep](https://github.com/bep)" -] - -[languages.nn.blackfriday] -# Norwegian uses angled quotes -angledQuotes = true -hrefTargetBlank = true \ No newline at end of file diff --git a/doc-new/themes/docuapi/exampleSite/content/errors.md b/doc-new/themes/docuapi/exampleSite/content/errors.md deleted file mode 100644 index db7949ea..00000000 --- a/doc-new/themes/docuapi/exampleSite/content/errors.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -weight: 20 -title: Errors - ---- - -# Errors - - - -The Kittn API uses the following error codes: - - -Error Code | Meaning ----------- | ------- -400 | Bad Request -- Your request sucks -401 | Unauthorized -- Your API key is wrong -403 | Forbidden -- The kitten requested is hidden for administrators only -404 | Not Found -- The specified kitten could not be found -405 | Method Not Allowed -- You tried to access a kitten with an invalid method -406 | Not Acceptable -- You requested a format that isn't json -410 | Gone -- The kitten requested has been removed from our servers -418 | I'm a teapot -429 | Too Many Requests -- You're requesting too many kittens! Slow down! -500 | Internal Server Error -- We had a problem with our server. Try again later. -503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. diff --git a/doc-new/themes/docuapi/exampleSite/content/errors.nn.md b/doc-new/themes/docuapi/exampleSite/content/errors.nn.md deleted file mode 100644 index 3ef6cdcb..00000000 --- a/doc-new/themes/docuapi/exampleSite/content/errors.nn.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -weight: 20 -title: Feil - ---- - -# Feil - - - -Kittn-APIet tek i bruk følgjande feilkodar: - -Feilkode | Forklaring ----------- | ------- -400 | Bad Request -- Din førespurnad har forbetringspotensiale -401 | Unauthorized -- Feil API-nøkkel -403 | Forbidden -- Denne kattungen er berre tilgjengeleg for administratorar -404 | Not Found -- Denne kattungen vart ikkje funnen -405 | Method Not Allowed -- Du prøvde å få tak i kattungen på ein snodig og ulovleg måte -406 | Not Acceptable -- Du bad om eit format som ikkje er JSON -410 | Gone -- Kattungen har rømt frå serveren. -418 | I'm a teapot -429 | Too Many Requests -- Du spør om for mange kattungar, ta det med ro! -500 | Internal Server Error -- Me har eit problem med serveren. Prøv igjen seinare. -503 | Service Unavailable -- Me er nede for vedlikehald. Prøv igjen seinare. - diff --git a/doc-new/themes/docuapi/exampleSite/content/index.md b/doc-new/themes/docuapi/exampleSite/content/index.md deleted file mode 100644 index 933884b3..00000000 --- a/doc-new/themes/docuapi/exampleSite/content/index.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -weight: 10 -title: API Reference ---- - -# Introduction - -Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database. - -We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. - -**This example API documentation page was created with [DocuAPI](https://github.com/bep/docuapi/), a multilingual documentation theme for the static site generator [Hugo](http://gohugo.io/).** - -# Authentication - -> To authorize, use this code: - -```go -package main - -import "github.com/bep/kittn/auth" - -func main() { - api := auth.Authorize("meowmeowmeow") - - // Just to make it compile - _ = api -} -``` - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -``` - -```shell -# With shell, you can just pass the correct header with each request -curl "api_endpoint_here" - -H "Authorization: meowmeowmeow" -``` - -```javascript -const kittn = require('kittn'); - -let api = kittn.authorize('meowmeowmeow'); -``` - -> Make sure to replace `meowmeowmeow` with your API key. - -Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers). - -Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following: - -`Authorization: meowmeowmeow` - - - -# Kittens - -## Get All Kittens - -```go -package main - -import "github.com/bep/kittn/auth" - -func main() { - api := auth.Authorize("meowmeowmeow") - - _ = api.GetKittens() -} -``` - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -api.kittens.get() -``` - -```shell -curl "http://example.com/api/kittens" - -H "Authorization: meowmeowmeow" -``` - -```javascript -const kittn = require('kittn'); - -let api = kittn.authorize('meowmeowmeow'); -let kittens = api.kittens.get(); -``` - -> The above command returns JSON structured like this: - -```json -[ - { - "id": 1, - "name": "Fluffums", - "breed": "calico", - "fluffiness": 6, - "cuteness": 7 - }, - { - "id": 2, - "name": "Max", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 - } -] -``` - -This endpoint retrieves all kittens. - -### HTTP Request - -`GET http://example.com/api/kittens` - -### Query Parameters - -Parameter | Default | Description ---------- | ------- | ----------- -include_cats | false | If set to true, the result will also include cats. -available | true | If set to false, the result will include kittens that have already been adopted. - - - -## Get a Specific Kitten - -```go -package main - -import "github.com/bep/kittn/auth" - -func main() { - api := auth.Authorize("meowmeowmeow") - - _ = api.GetKitten(2) -} -``` - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get(2) -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -api.kittens.get(2) -``` - -```shell -curl "http://example.com/api/kittens/2" - -H "Authorization: meowmeowmeow" -``` - -```javascript -const kittn = require('kittn'); - -let api = kittn.authorize('meowmeowmeow'); -let max = api.kittens.get(2); -``` - -> The above command returns JSON structured like this: - -```json -{ - "id": 2, - "name": "Max", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 -} -``` - -This endpoint retrieves a specific kitten. - - - -### HTTP Request - -`GET http://example.com/kittens/` - -### URL Parameters - -Parameter | Description ---------- | ----------- -ID | The ID of the kitten to retrieve - diff --git a/doc-new/themes/docuapi/exampleSite/content/index.nn.md b/doc-new/themes/docuapi/exampleSite/content/index.nn.md deleted file mode 100644 index 1667d279..00000000 --- a/doc-new/themes/docuapi/exampleSite/content/index.nn.md +++ /dev/null @@ -1,211 +0,0 @@ ---- -weight: 10 -title: API ---- - -# Innleiing - -Velkomen skal du vere til Kittn API! Du kan bruke vårt API til å kalle våre Kittn endepunkt. Her kan du hente ut ymse informasjon om kattar, kattungar og ulike rasar frå vår database. - -Her finn du kodedøme i Shell, Ruby, Python og Go! Du ser desse døma i det mørke feltet til høgre på skjermen -- og du kan byta programmeringsspråk ved å klikke på menyen oppe til høgre. - -**Denne API-dokumentasjonen vart laga med [DocuAPI](https://github.com/bep/docuapi/), eit tema for den statiske nettstadsmakaren [Hugo](http://gohugo.io/).** - -# Autentisering - -> For å autentisere ein brukar, bruk denne koden: - -```go -package main - -import "github.com/bep/kittn/auth" - -func main() { - api := auth.Authorize("meowmeowmeow") - - // Just to make it compile - _ = api -} -``` - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -``` - -```shell -# With shell, you can just pass the correct header with each request -curl "api_endpoint_here" - -H "Authorization: meowmeowmeow" -``` - -```javascript -const kittn = require('kittn'); - -let api = kittn.authorize('meowmeowmeow'); -``` - -> Gjer vel og erstatt `meowmeowmeow` med din eigen API-nøkkel. - -Kittn tek i bruk API-nøklar for å gi tilgang til APIet. Du kan kan registrere deg for å få ein slik nøkkel på vår [utviklarportal](http://example.com/developers). - -Kittn forventar at API-nøkkelen er med i alle API-førespurnader til serveren i ein header som ser slik ut: - -`Authorization: meowmeowmeow` - - - -# Kattungar - -## Hent alle kattungane - -```go -package main - -import "github.com/bep/kittn/auth" - -func main() { - api := auth.Authorize("meowmeowmeow") - - _ = api.GetKittens() -} -``` - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -api.kittens.get() -``` - -```shell -curl "http://example.com/api/kittens" - -H "Authorization: meowmeowmeow" -``` - -```javascript -const kittn = require('kittn'); - -let api = kittn.authorize('meowmeowmeow'); -let kittens = api.kittens.get(); -``` - -> Programmet over gir ein JSON-struktur som ser slik ut: - -```json -[ - { - "id": 1, - "name": "Fluffums", - "breed": "calico", - "fluffiness": 6, - "cuteness": 7 - }, - { - "id": 2, - "name": "Max", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 - } -] -``` - -Dette endepunktet leverer alle kattungar. - -### HTTP-førespurnad - -`GET http://example.com/api/kittens` - -### Query-parametrar - -Parameter | Standardverdi | Skildring ---------- | ------- | ----------- -include_cats | false | Set til true for å få alle kattar. -available | true | Set til false for å ta med kattar som allereie er blitt adoptert vekk. - - - -## Hent éin kattunge - -```go -package main - -import "github.com/bep/kittn/auth" - -func main() { - api := auth.Authorize("meowmeowmeow") - - _ = api.GetKitten(2) -} -``` - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get(2) -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -api.kittens.get(2) -``` - -```shell -curl "http://example.com/api/kittens/2" - -H "Authorization: meowmeowmeow" -``` - -```javascript -const kittn = require('kittn'); - -let api = kittn.authorize('meowmeowmeow'); -let max = api.kittens.get(2); -``` - -> Programmet over gir ein JSON-struktur som ser slik ut: - -```json -{ - "id": 2, - "name": "Max", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 -} -``` - -Dette endepunktet hentar ut éin spesifikk kattunge. - - - -### HTTP-førespurnad - -`GET http://example.com/kittens/` - -### URL-parametrar - -Parameter | Skildring ---------- | ----------- -ID | IDen til kattungen du ynskjer å hente - diff --git a/doc-new/themes/docuapi/exampleSite/layouts/partials/hook_head_end.html b/doc-new/themes/docuapi/exampleSite/layouts/partials/hook_head_end.html deleted file mode 100644 index 56fe097e..00000000 --- a/doc-new/themes/docuapi/exampleSite/layouts/partials/hook_head_end.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ with getenv "ADD_GA" }} - -{{ end }} \ No newline at end of file diff --git a/doc-new/themes/docuapi/exampleSite/layouts/partials/hook_left_sidebar_end.html b/doc-new/themes/docuapi/exampleSite/layouts/partials/hook_left_sidebar_end.html deleted file mode 100644 index 3fa7a7bd..00000000 --- a/doc-new/themes/docuapi/exampleSite/layouts/partials/hook_left_sidebar_end.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ if getenv "REPOSITORY_URL" -}} -
- - - -
-{{ end }} diff --git a/doc-new/themes/docuapi/exampleSite/static/.gitkeep b/doc-new/themes/docuapi/exampleSite/static/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/doc-new/themes/docuapi/exampleSite/static/_headers b/doc-new/themes/docuapi/exampleSite/static/_headers deleted file mode 100644 index e73bede1..00000000 --- a/doc-new/themes/docuapi/exampleSite/static/_headers +++ /dev/null @@ -1,4 +0,0 @@ -/* - X-Frame-Options: DENY - X-XSS-Protection: 1; mode=block - diff --git a/doc-new/themes/docuapi/i18n/en.yaml b/doc-new/themes/docuapi/i18n/en.yaml deleted file mode 100644 index bfe6a122..00000000 --- a/doc-new/themes/docuapi/i18n/en.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- id: translations - translation: - one: "Translation" - other: "Translations" - -# Search label -- id: search - translation: "Search" diff --git a/doc-new/themes/docuapi/i18n/nn.yaml b/doc-new/themes/docuapi/i18n/nn.yaml deleted file mode 100644 index 494c8ef6..00000000 --- a/doc-new/themes/docuapi/i18n/nn.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- id: translations - translation: - one: "Omsetjing" - other: "Omsetjingar" - -# Search label -- id: search - translation: "Søk" diff --git a/doc-new/themes/docuapi/images/screenshot.png b/doc-new/themes/docuapi/images/screenshot.png deleted file mode 100644 index 890ba311..00000000 Binary files a/doc-new/themes/docuapi/images/screenshot.png and /dev/null differ diff --git a/doc-new/themes/docuapi/images/tn.png b/doc-new/themes/docuapi/images/tn.png deleted file mode 100644 index 8208e21e..00000000 Binary files a/doc-new/themes/docuapi/images/tn.png and /dev/null differ diff --git a/doc-new/themes/docuapi/layouts/404.html b/doc-new/themes/docuapi/layouts/404.html deleted file mode 100644 index 6503875b..00000000 --- a/doc-new/themes/docuapi/layouts/404.html +++ /dev/null @@ -1,3 +0,0 @@ -{{define "main"}} -

Page Not Found!

-{{end}} \ No newline at end of file diff --git a/doc-new/themes/docuapi/layouts/_default/baseof.html b/doc-new/themes/docuapi/layouts/_default/baseof.html deleted file mode 100644 index 456b40c4..00000000 --- a/doc-new/themes/docuapi/layouts/_default/baseof.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - {{ .Title }} - {{ partial "styles.html" . }} - {{ partial "js.html" . }} - {{ partial "hook_head_end.html" . }} - - - - - NAV - - - -
- {{ partial "hook_left_sidebar_start.html" . }} - {{ partial "hook_left_sidebar_logo.html" . }} - {{ with .Site.Params.language_tabs }} -
- {{ range . }} - {{ .name }} - {{ end }} -
- {{ end }} - {{ if .Site.Params.search }} - -
    - {{ end }} -
    -
    - {{ if .IsTranslated }} - - {{ end }} - {{ with .Site.Params.toc_footers }} - - {{ end}} - {{ partial "hook_left_sidebar_end.html" . }} -
    -
    -
    -
    - {{block "main" .}}This is the main content.{{end}} -
    -
    - {{ with .Site.Params.language_tabs }} -
    - {{ range . }} - {{ .name }} - {{ end }} -
    - {{ end }} -
    -
    - {{ partial "hook_body_end.html" . }} - - diff --git a/doc-new/themes/docuapi/layouts/index.html b/doc-new/themes/docuapi/layouts/index.html deleted file mode 100644 index 463387d5..00000000 --- a/doc-new/themes/docuapi/layouts/index.html +++ /dev/null @@ -1,5 +0,0 @@ -{{define "main"}} - {{ range .Data.Pages }} - {{ .Content }} - {{ end }} -{{end}} \ No newline at end of file diff --git a/doc-new/themes/docuapi/layouts/partials/hook_body_end.html b/doc-new/themes/docuapi/layouts/partials/hook_body_end.html deleted file mode 100644 index e69de29b..00000000 diff --git a/doc-new/themes/docuapi/layouts/partials/hook_head_end.html b/doc-new/themes/docuapi/layouts/partials/hook_head_end.html deleted file mode 100644 index e69de29b..00000000 diff --git a/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_end.html b/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_end.html deleted file mode 100644 index e69de29b..00000000 diff --git a/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_logo.html b/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_logo.html deleted file mode 100644 index f88cd968..00000000 --- a/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_logo.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_start.html b/doc-new/themes/docuapi/layouts/partials/hook_left_sidebar_start.html deleted file mode 100644 index e69de29b..00000000 diff --git a/doc-new/themes/docuapi/layouts/partials/js.html b/doc-new/themes/docuapi/layouts/partials/js.html deleted file mode 100644 index 57a640b2..00000000 --- a/doc-new/themes/docuapi/layouts/partials/js.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ if .Param "search" }} - -{{ else }} - -{{ end }} \ No newline at end of file diff --git a/doc-new/themes/docuapi/layouts/partials/styles.html b/doc-new/themes/docuapi/layouts/partials/styles.html deleted file mode 100644 index 4e6721d8..00000000 --- a/doc-new/themes/docuapi/layouts/partials/styles.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/doc-new/themes/docuapi/layouts/partials/translations.html b/doc-new/themes/docuapi/layouts/partials/translations.html deleted file mode 100644 index 93a902de..00000000 --- a/doc-new/themes/docuapi/layouts/partials/translations.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ if .IsTranslated }} - -{{ end }} diff --git a/doc-new/themes/docuapi/requirements.txt b/doc-new/themes/docuapi/requirements.txt deleted file mode 100644 index 01cfb184..00000000 --- a/doc-new/themes/docuapi/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -Pygments==2.0.2 diff --git a/doc-new/themes/docuapi/static/images/logo.png b/doc-new/themes/docuapi/static/images/logo.png deleted file mode 100644 index 68d1d7a8..00000000 Binary files a/doc-new/themes/docuapi/static/images/logo.png and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/fonts/slate.eot b/doc-new/themes/docuapi/static/slate/fonts/slate.eot deleted file mode 100755 index 13c4839a..00000000 Binary files a/doc-new/themes/docuapi/static/slate/fonts/slate.eot and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/fonts/slate.svg b/doc-new/themes/docuapi/static/slate/fonts/slate.svg deleted file mode 100755 index 5f349823..00000000 --- a/doc-new/themes/docuapi/static/slate/fonts/slate.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - diff --git a/doc-new/themes/docuapi/static/slate/fonts/slate.ttf b/doc-new/themes/docuapi/static/slate/fonts/slate.ttf deleted file mode 100755 index ace9a46a..00000000 Binary files a/doc-new/themes/docuapi/static/slate/fonts/slate.ttf and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/fonts/slate.woff b/doc-new/themes/docuapi/static/slate/fonts/slate.woff deleted file mode 100755 index 1e72e0ee..00000000 Binary files a/doc-new/themes/docuapi/static/slate/fonts/slate.woff and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/fonts/slate.woff2 b/doc-new/themes/docuapi/static/slate/fonts/slate.woff2 deleted file mode 100755 index 7c585a72..00000000 Binary files a/doc-new/themes/docuapi/static/slate/fonts/slate.woff2 and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/images/logo.png b/doc-new/themes/docuapi/static/slate/images/logo.png deleted file mode 100644 index 68a478fa..00000000 Binary files a/doc-new/themes/docuapi/static/slate/images/logo.png and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/images/navbar.png b/doc-new/themes/docuapi/static/slate/images/navbar.png deleted file mode 100644 index df38e90d..00000000 Binary files a/doc-new/themes/docuapi/static/slate/images/navbar.png and /dev/null differ diff --git a/doc-new/themes/docuapi/static/slate/javascripts/all.js b/doc-new/themes/docuapi/static/slate/javascripts/all.js deleted file mode 100755 index 4a1507eb..00000000 --- a/doc-new/themes/docuapi/static/slate/javascripts/all.js +++ /dev/null @@ -1,997 +0,0 @@ -(function(){if(!('ontouchstart'in window))return;var lastClick={},isThresholdReached,touchstart,touchmove,touchend,click,closest;isThresholdReached=function(startXY,xy){return Math.abs(startXY[0]-xy[0])>5||Math.abs(startXY[1]-xy[1])>5;};touchstart=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY];this.threshold=false;};touchmove=function(e){if(this.threshold)return false;this.threshold=isThresholdReached(this.startXY,[e.touches[0].clientX,e.touches[0].clientY]);};touchend=function(e){if(this.threshold||isThresholdReached(this.startXY,[e.changedTouches[0].clientX,e.changedTouches[0].clientY])){return;} -var touch=e.changedTouches[0],evt=document.createEvent('MouseEvents');evt.initMouseEvent('click',true,true,window,0,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);evt.simulated=true;e.target.dispatchEvent(evt);};click=function(e){var time=Date.now(),timeDiff=time-lastClick.time,x=e.clientX,y=e.clientY,xyDiff=[Math.abs(lastClick.x-x),Math.abs(lastClick.y-y)],target=closest(e.target,'A')||e.target,nodeName=target.nodeName,isLink=nodeName==='A',standAlone=window.navigator.standalone&&isLink&&e.target.getAttribute("href");lastClick.time=time;lastClick.x=x;lastClick.y=y;if((!e.simulated&&(timeDiff<500||(timeDiff<1500&&xyDiff[0]<50&&xyDiff[1]<50)))||standAlone){e.preventDefault();e.stopPropagation();if(!standAlone)return false;} -if(standAlone){window.location=target.getAttribute("href");} -if(!target||!target.classList)return;target.classList.add("energize-focus");window.setTimeout(function(){target.classList.remove("energize-focus");},150);};closest=function(node,tagName){var curNode=node;while(curNode!==document.body){if(!curNode||curNode.nodeName===tagName){return curNode;} -curNode=curNode.parentNode;} -return null;};document.addEventListener('touchstart',touchstart,false);document.addEventListener('touchmove',touchmove,false);document.addEventListener('touchend',touchend,false);document.addEventListener('click',click,true);})();/*!* jQuery JavaScript Library v2.2.0 -* http://jquery.com/ -* -* Includes Sizzle.js -* http://sizzlejs.com/ -* -* Copyright jQuery Foundation and other contributors -* Released under the MIT license -* http://jquery.org/license -* -* Date: 2016-01-08T20:02Z*/(function(global,factory){if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document");} -return factory(w);};}else{factory(global);}}(typeof window!=="undefined"?window:this,function(window,noGlobal){var arr=[];var document=window.document;var slice=arr.slice;var concat=arr.concat;var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var support={};var -version="2.2.0",jQuery=function(selector,context){return new jQuery.fn.init(selector,context);},rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase();};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,selector:"",length:0,toArray:function(){return slice.call(this);},get:function(num){return num!=null?(num<0?this[num+this.length]:this[num]):slice.call(this);},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;ret.context=this.context;return ret;},each:function(callback){return jQuery.each(this,callback);},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},slice:function(){return this.pushStack(slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j=0;},isPlainObject:function(obj){if(jQuery.type(obj)!=="object"||obj.nodeType||jQuery.isWindow(obj)){return false;} -if(obj.constructor&&!hasOwn.call(obj.constructor.prototype,"isPrototypeOf")){return false;} -return true;},isEmptyObject:function(obj){var name;for(name in obj){return false;} -return true;},type:function(obj){if(obj==null){return obj+"";} -return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj;},globalEval:function(code){var script,indirect=eval;code=jQuery.trim(code);if(code){if(code.indexOf("use strict")===1){script=document.createElement("script");script.text=code;document.head.appendChild(script).parentNode.removeChild(script);}else{indirect(code);}}},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();},each:function(obj,callback){var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i0&&(length-1)in obj;} -var Sizzle=/*!* Sizzle CSS Selector Engine v2.2.1 -* http://sizzlejs.com/ -* -* Copyright jQuery Foundation and other contributors -* Released under the MIT license -* http://jquery.org/license -* -* Date: 2015-10-17*/(function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date(),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;} -return 0;},MAX_NEGATIVE=1<<31,hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,push_native=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){var i=0,len=list.length;for(;i+~]|"+whitespace+")"+whitespace+"*"),rattributeQuotes=new RegExp("="+whitespace+"*([^\\]'\"]*?)"+whitespace+"*\\]","g"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+identifier+")"),"CLASS":new RegExp("^\\.("+identifier+")"),"TAG":new RegExp("^("+identifier+"|[*])"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ -whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,rescape=/'|\\/g,runescape=new RegExp("\\\\([\\da-f]{1,6}"+whitespace+"?|("+whitespace+")|.)","ig"),funescape=function(_,escaped,escapedWhitespace){var high="0x"+escaped-0x10000;return high!==high||escapedWhitespace?escaped:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},unloadHandler=function(){setDocument();};try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){push_native.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){} -target.length=j-1;}};} -function Sizzle(selector,context,results,seed){var m,i,elem,nid,nidselect,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results;} -if(!seed){if((context?context.ownerDocument||context:preferredDoc)!==document){setDocument(context);} -context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}} -if(support.qsa&&!compilerCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))){if(nodeType!==1){newContext=context;newSelector=selector;}else if(context.nodeName.toLowerCase()!=="object"){if((nid=context.getAttribute("id"))){nid=nid.replace(rescape,"\\$&");}else{context.setAttribute("id",(nid=expando));} -groups=tokenize(selector);i=groups.length;nidselect=ridentifier.test(nid)?"#"+nid:"[id='"+nid+"']";while(i--){groups[i]=nidselect+" "+toSelector(groups[i]);} -newSelector=groups.join(",");newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;} -if(newSelector){try{push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){}finally{if(nid===expando){context.removeAttribute("id");}}}}}} -return select(selector.replace(rtrim,"$1"),context,results,seed);} -function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];} -return(cache[key+" "]=value);} -return cache;} -function markFunction(fn){fn[expando]=true;return fn;} -function assert(fn){var div=document.createElement("div");try{return!!fn(div);}catch(e){return false;}finally{if(div.parentNode){div.parentNode.removeChild(div);} -div=null;}} -function addHandle(attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler;}} -function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&(~b.sourceIndex||MAX_NEGATIVE)- -(~a.sourceIndex||MAX_NEGATIVE);if(diff){return diff;} -if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}} -return a?1:-1;} -function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};} -function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};} -function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});} -function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;} -support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;};setDocument=Sizzle.setDocument=function(node){var hasCompare,parent,doc=node?node.ownerDocument||node:preferredDoc;if(doc===document||doc.nodeType!==9||!doc.documentElement){return document;} -document=doc;docElem=document.documentElement;documentIsHTML=!isXML(document);if((parent=document.defaultView)&&parent.top!==parent){if(parent.addEventListener){parent.addEventListener("unload",unloadHandler,false);}else if(parent.attachEvent){parent.attachEvent("onunload",unloadHandler);}} -support.attributes=assert(function(div){div.className="i";return!div.getAttribute("className");});support.getElementsByTagName=assert(function(div){div.appendChild(document.createComment(""));return!div.getElementsByTagName("*").length;});support.getElementsByClassName=rnative.test(document.getElementsByClassName);support.getById=assert(function(div){docElem.appendChild(div).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length;});if(support.getById){Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var m=context.getElementById(id);return m?[m]:[];}};Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};}else{delete Expr.find["ID"];Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId;};};} -Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else if(support.qsa){return context.querySelectorAll(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}} -return tmp;} -return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(document.querySelectorAll))){assert(function(div){docElem.appendChild(div).innerHTML=""+"";if(div.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");} -if(!div.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");} -if(!div.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");} -if(!div.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");} -if(!div.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}});assert(function(div){var input=document.createElement("input");input.setAttribute("type","hidden");div.appendChild(input).setAttribute("name","D");if(div.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=");} -if(!div.querySelectorAll(":enabled").length){rbuggyQSA.push(":enabled",":disabled");} -div.querySelectorAll("*,:x");rbuggyQSA.push(",.*:");});} -if((support.matchesSelector=rnative.test((matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(div){support.disconnectedMatch=matches.call(div,"div");matches.call(div,"[s!='']:x");rbuggyMatches.push("!=",pseudos);});} -rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}} -return false;};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0;} -var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;} -compare=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a===document||a.ownerDocument===preferredDoc&&contains(preferredDoc,a)){return-1;} -if(b===document||b.ownerDocument===preferredDoc&&contains(preferredDoc,b)){return 1;} -return sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;} -return compare&4?-1:1;}:function(a,b){if(a===b){hasDuplicate=true;return 0;} -var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a===document?-1:b===document?1:aup?-1:bup?1:sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);} -cur=a;while((cur=cur.parentNode)){ap.unshift(cur);} -cur=b;while((cur=cur.parentNode)){bp.unshift(cur);} -while(ap[i]===bp[i]){i++;} -return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0;};return document;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document){setDocument(elem);} -expr=expr.replace(rattributeQuotes,"='$1']");if(support.matchesSelector&&documentIsHTML&&!compilerCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){}} -return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!==document){setDocument(context);} -return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!==document){setDocument(elem);} -var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null;};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}} -while(j--){results.splice(duplicates[j],1);}} -sortInput=null;return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;} -return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";} -return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);} -match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){Sizzle.error(match[0]);} -return match;},"PSEUDO":function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;} -if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);} -return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";} -if(!operator){return true;} -result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}} -start=dir=type==="only"&&!start&&"nextSibling";} -return true;} -start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;} -if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff];} -if(node===elem){break;}}}}} -diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);} -if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};} -return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);} -lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":function(elem){return elem.disabled===false;},"disabled":function(elem){return elem.disabled===true;},"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;} -return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}} -return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text");},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i=0;){matchIndexes.push(i);} -return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}} -return true;}:matchers[0];} -function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});} -function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret;}];for(;i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context===document||context||outermost;} -for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!==document){setDocument(elem);xml=!documentIsHTML;} -while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){results.push(elem);break;}} -if(outermost){dirruns=dirrunsUnique;}} -if(bySet){if((elem=!matcher&&elem)){matchedCount--;} -if(seed){unmatched.push(elem);}}} -matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);} -if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}} -setMatched=condense(setMatched);} -push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}} -if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;} -return unmatched;};return bySet?markFunction(superMatcher):superMatcher;} -compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);} -i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}} -cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;} -return cached;};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&support.getById&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}else if(compiled){context=context.parentNode;} -selector=selector.slice(tokens.shift().value.length);} -i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;} -if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;} -break;}}}} -(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context);return results;};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(div1){return div1.compareDocumentPosition(document.createElement("div"))&1;});if(!assert(function(div){div.innerHTML="";return div.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});} -if(!support.attributes||!assert(function(div){div.innerHTML="";div.firstChild.setAttribute("value","");return div.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});} -if(!assert(function(div){return div.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null;}});} -return Sizzle;})(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break;} -matched.push(elem);}} -return matched;};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n);}} -return matched;};var rneedsContext=jQuery.expr.match.needsContext;var rsingleTag=(/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/);var risSimple=/^.[^:#\[\.,]*$/;function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});} -if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});} -if(typeof qualifier==="string"){if(risSimple.test(qualifier)){return jQuery.filter(qualifier,elements,not);} -qualifier=jQuery.filter(qualifier,elements);} -return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});} -jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";} -return elems.length===1&&elem.nodeType===1?jQuery.find.matchesSelector(elem,expr)?[elem]:[]:jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));};jQuery.fn.extend({find:function(selector){var i,len=this.length,ret=[],self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i1?jQuery.unique(ret):ret);ret.selector=this.selector?this.selector+" "+selector:selector;return ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;} -root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);} -if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(jQuery.isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}} -return this;}else{elem=document.getElementById(match[2]);if(elem&&elem.parentNode){this.length=1;this[0]=elem;} -this.context=document;this.selector=selector;return this;}}else if(!context||context.jquery){return(context||root).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this.context=this[0]=selector;this.length=1;return this;}else if(jQuery.isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);} -if(selector.selector!==undefined){this.selector=selector.selector;this.context=selector.context;} -return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break;}}} -return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;} -if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);} -return indexOf.call(this,elem.jquery?elem[0]:elem);},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){} -return cur;} -jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return dir(elem,"parentNode");},parentsUntil:function(elem,i,until){return dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return dir(elem,"nextSibling");},prevAll:function(elem){return dir(elem,"previousSibling");},nextUntil:function(elem,i,until){return dir(elem,"nextSibling",until);},prevUntil:function(elem,i,until){return dir(elem,"previousSibling",until);},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem);},children:function(elem){return siblings(elem.firstChild);},contents:function(elem){return elem.contentDocument||jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;} -if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);} -if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);} -if(rparentsprev.test(name)){matched.reverse();}} -return this.pushStack(matched);};});var rnotwhite=(/\S+/g);function createOptions(options){var object={};jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=true;});return object;} -jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var -firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex-1){list.splice(index,1);if(index<=firingIndex){firingIndex--;}}});return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0;},empty:function(){if(list){list=[];} -return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];if(!memory){list=memory="";} -return this;},locked:function(){return!!locked;},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire();}} -return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&jQuery.isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);}else{newDefer[tuple[0]+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments);}});});fns=null;}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};promise.pipe=promise.then;jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[i^1][2].disable,tuples[2][2].lock);} -deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?promise:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);} -return deferred;},when:function(subordinate){var i=0,resolveValues=slice.call(arguments),length=resolveValues.length,remaining=length!==1||(subordinate&&jQuery.isFunction(subordinate.promise))?length:0,deferred=remaining===1?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this;values[i]=arguments.length>1?slice.call(arguments):value;if(values===progressValues){deferred.notifyWith(contexts,values);}else if(!(--remaining)){deferred.resolveWith(contexts,values);}};},progressValues,progressContexts,resolveContexts;if(length>1){progressValues=new Array(length);progressContexts=new Array(length);resolveContexts=new Array(length);for(;i0){return;} -readyList.resolveWith(document,[jQuery]);if(jQuery.fn.triggerHandler){jQuery(document).triggerHandler("ready");jQuery(document).off("ready");}}});function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();} -jQuery.ready.promise=function(obj){if(!readyList){readyList=jQuery.Deferred();if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);}} -return readyList.promise(obj);};jQuery.ready.promise();var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(jQuery.type(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!jQuery.isFunction(value)){raw=true;} -if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,key,value){return bulk.call(jQuery(elem),value);};}} -if(fn){for(;i-1&&data!==undefined){dataUser.set(this,key,value);}});},null,value,arguments.length>1,null,true);},removeData:function(key){return this.each(function(){dataUser.remove(this,key);});}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||jQuery.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data));}else{queue.push(data);}} -return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;} -if(fn){if(type==="fx"){queue.unshift("inprogress");} -delete hooks.stop;fn.call(elem,next,hooks);} -if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key]);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;} -if(arguments.length",""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option;wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;function getAll(context,tag){var ret=typeof context.getElementsByTagName!=="undefined"?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!=="undefined"?context.querySelectorAll(tag||"*"):[];return tag===undefined||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],ret):ret;} -function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i-1){if(ignored){ignored.push(elem);} -continue;} -contains=jQuery.contains(elem.ownerDocument,elem);tmp=getAll(fragment.appendChild(elem),"script");if(contains){setGlobalEval(tmp);} -if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}} -return fragment;} -(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue;})();var -rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;} -function returnFalse(){return false;} -function safeActiveElement(){try{return document.activeElement;}catch(err){}} -function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;} -for(type in types){on(elem,type,selector,data,types[type],one);} -return elem;} -if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}} -if(fn===false){fn=returnFalse;}else if(!fn){return this;} -if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);} -return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});} -jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!elemData){return;} -if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;} -if(!handler.guid){handler.guid=jQuery.guid++;} -if(!(events=elemData.events)){events=elemData.events={};} -if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};} -types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;} -special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}} -if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}} -if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);} -jQuery.event.global[type]=true;}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return;} -types=(types||"").match(rnotwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);} -continue;} -special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;} -if(special.remove){special.remove.call(elem,handleObj);}}} -if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);} -delete events[type];}} -if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events");}},dispatch:function(event){event=jQuery.event.fix(event);var i,j,ret,matched,handleObj,handlerQueue=[],args=slice.call(arguments),handlers=(dataPriv.get(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;} -handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.rnamespace||event.rnamespace.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}} -if(special.postDispatch){special.postDispatch.call(this,event);} -return event.result;},handlers:function(event,handlers){var i,matches,sel,handleObj,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(event.type!=="click"||isNaN(event.button)||event.button<1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&(cur.disabled!==true||event.type!=="click")){matches=[];for(i=0;i-1:jQuery.find(sel,this,null,[cur]).length;} -if(matches[sel]){matches.push(handleObj);}} -if(matches.length){handlerQueue.push({elem:cur,handlers:matches});}}}} -if(delegateCount]*)\/>/gi,rnoInnerhtml=/\s*$/g;function manipulationTarget(elem,content){if(jQuery.nodeName(elem,"table")&&jQuery.nodeName(content.nodeType!==11?content:content.firstChild,"tr")){return elem.getElementsByTagName("tbody")[0]||elem;} -return elem;} -function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;} -function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);if(match){elem.type=match[1];}else{elem.removeAttribute("type");} -return elem;} -function cloneCopyEvent(src,dest){var i,l,type,pdataOld,pdataCur,udataOld,udataCur,events;if(dest.nodeType!==1){return;} -if(dataPriv.hasData(src)){pdataOld=dataPriv.access(src);pdataCur=dataPriv.set(dest,pdataOld);events=pdataOld.events;if(events){delete pdataCur.handle;pdataCur.events={};for(type in events){for(i=0,l=events[type].length;i1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(isFunction){args[0]=value.call(this,index,self.html());} -domManip(self,args,callback,ignored);});} -if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;} -if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i");},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=jQuery.contains(elem.ownerDocument,elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));} -return clone;},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}} -elem[dataPriv.expando]=undefined;} -if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({domManip:domManip,detach:function(selector){return remove(this,selector,true);},remove:function(selector){return remove(this,selector);},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value;}});},null,value,arguments.length);},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent="";}} -return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML;} -if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i")).appendTo(doc.documentElement);doc=iframe[0].contentDocument;doc.write();doc.close();display=actualDisplay(nodeName,doc);iframe.detach();} -elemdisplay[nodeName]=display;} -return display;} -var rmargin=(/^margin/);var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view.opener){view=window;} -return view.getComputedStyle(elem);};var swap=function(elem,options,callback,args){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];} -ret=callback.apply(elem,args||[]);for(name in options){elem.style[name]=old[name];} -return ret;};var documentElement=document.documentElement;(function(){var pixelPositionVal,boxSizingReliableVal,pixelMarginRightVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return;} -div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";container.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;"+"padding:0;margin-top:1px;position:absolute";container.appendChild(div);function computeStyleTests(){div.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;"+"position:relative;display:block;"+"margin:auto;border:1px;padding:1px;"+"top:1%;width:50%";div.innerHTML="";documentElement.appendChild(container);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=divStyle.marginLeft==="2px";boxSizingReliableVal=divStyle.width==="4px";div.style.marginRight="50%";pixelMarginRightVal=divStyle.marginRight==="4px";documentElement.removeChild(container);} -jQuery.extend(support,{pixelPosition:function(){computeStyleTests();return pixelPositionVal;},boxSizingReliable:function(){if(boxSizingReliableVal==null){computeStyleTests();} -return boxSizingReliableVal;},pixelMarginRight:function(){if(boxSizingReliableVal==null){computeStyleTests();} -return pixelMarginRightVal;},reliableMarginLeft:function(){if(boxSizingReliableVal==null){computeStyleTests();} -return reliableMarginLeftVal;},reliableMarginRight:function(){var ret,marginDiv=div.appendChild(document.createElement("div"));marginDiv.style.cssText=div.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;"+"display:block;margin:0;border:0;padding:0";marginDiv.style.marginRight=marginDiv.style.width="0";div.style.width="1px";documentElement.appendChild(container);ret=!parseFloat(window.getComputedStyle(marginDiv).marginRight);documentElement.removeChild(container);div.removeChild(marginDiv);return ret;}});})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];if(ret===""&&!jQuery.contains(elem.ownerDocument,elem)){ret=jQuery.style(elem,name);} -if(!support.pixelMarginRight()&&rnumnonpx.test(ret)&&rmargin.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}} -return ret!==undefined?ret+"":ret;} -function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return;} -return(this.get=hookFn).apply(this,arguments);}};} -var -rdisplayswap=/^(none|table(?!-c[ea]).+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"},cssPrefixes=["Webkit","O","Moz","ms"],emptyStyle=document.createElement("div").style;function vendorPropName(name){if(name in emptyStyle){return name;} -var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}} -function setPositiveNumber(elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value;} -function augmentWidthOrHeight(elem,name,extra,isBorderBox,styles){var i=extra===(isBorderBox?"border":"content")?4:name==="width"?1:0,val=0;for(;i<4;i+=2){if(extra==="margin"){val+=jQuery.css(elem,extra+cssExpand[i],true,styles);} -if(isBorderBox){if(extra==="content"){val-=jQuery.css(elem,"padding"+cssExpand[i],true,styles);} -if(extra!=="margin"){val-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{val+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(extra!=="padding"){val+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}} -return val;} -function getWidthOrHeight(elem,name,extra){var valueIsBorderBox=true,val=name==="width"?elem.offsetWidth:elem.offsetHeight,styles=getStyles(elem),isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";if(document.msFullscreenElement&&window.top!==window){if(elem.getClientRects().length){val=Math.round(elem.getBoundingClientRect()[name]*100);}} -if(val<=0||val==null){val=curCSS(elem,name,styles);if(val<0||val==null){val=elem.style[name];} -if(rnumnonpx.test(val)){return val;} -valueIsBorderBox=isBorderBox&&(support.boxSizingReliable()||val===elem.style[name]);val=parseFloat(val)||0;} -return(val+ -augmentWidthOrHeight(elem,name,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles))+"px";} -function showHide(elements,show){var display,elem,hidden,values=[],index=0,length=elements.length;for(;index1);},show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();} -return this.each(function(){if(isHidden(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);} -jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;} -this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);} -if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);} -return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop];} -result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.nodeType===1&&(tween.elem.style[jQuery.cssProps[tween.prop]]!=null||jQuery.cssHooks[tween.prop])){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var -fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=jQuery.now());} -function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;} -if(includeWidth){attrs.opacity=attrs.width=type;} -return attrs;} -function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;} -if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);} -if(nType!==1||!jQuery.isXMLDoc(elem)){name=name.toLowerCase();hooks=jQuery.attrHooks[name]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);} -if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;} -if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;} -elem.setAttribute(name,value+"");return value;} -if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;} -ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&jQuery.nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;} -return value;}}}},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(rnotwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){propName=jQuery.propFix[name]||name;if(jQuery.expr.match.bool.test(name)){elem[propName]=false;} -elem.removeAttribute(name);}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);} -return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle;if(!isXML){handle=attrHandle[name];attrHandle[name]=ret;ret=getter(elem,name,isXML)!=null?name.toLowerCase():null;attrHandle[name]=handle;} -return ret;};});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name];});}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;} -if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];} -if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;} -return(elem[name]=value);} -if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;} -return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");return tabindex?parseInt(tabindex,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:-1;}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex;} -return null;}};} -jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});var rclass=/[\t\r\n\f]/g;function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";} -jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});} -if(typeof value==="string"&&value){classes=value.match(rnotwhite)||[];while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+curValue+" ").replace(rclass," ");if(cur){j=0;while((clazz=classes[j++])){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" ";}} -finalValue=jQuery.trim(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}} -return this;},removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(jQuery.isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});} -if(!arguments.length){return this.attr("class","");} -if(typeof value==="string"&&value){classes=value.match(rnotwhite)||[];while((elem=this[i++])){curValue=getClass(elem);cur=elem.nodeType===1&&(" "+curValue+" ").replace(rclass," ");if(cur){j=0;while((clazz=classes[j++])){while(cur.indexOf(" "+clazz+" ")>-1){cur=cur.replace(" "+clazz+" "," ");}} -finalValue=jQuery.trim(cur);if(curValue!==finalValue){elem.setAttribute("class",finalValue);}}}} -return this;},toggleClass:function(value,stateVal){var type=typeof value;if(typeof stateVal==="boolean"&&type==="string"){return stateVal?this.addClass(value):this.removeClass(value);} -if(jQuery.isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});} -return this.each(function(){var className,i,self,classNames;if(type==="string"){i=0;self=jQuery(this);classNames=value.match(rnotwhite)||[];while((className=classNames[i++])){if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className);} -if(this.setAttribute){this.setAttribute("class",className||value===false?"":dataPriv.get(this,"__className__")||"");}}});},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+getClass(elem)+" ").replace(rclass," ").indexOf(className)>-1){return true;}} -return false;}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,isFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;} -ret=elem.value;return typeof ret==="string"?ret.replace(rreturn,""):ret==null?"":ret;} -return;} -isFunction=jQuery.isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;} -if(isFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;} -if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(jQuery.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});} -hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){return jQuery.trim(elem.value);}},select:{get:function(elem){var value,option,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one"||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;for(;i-1){optionSet=true;}} -if(!optionSet){elem.selectedIndex=-1;} -return values;}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(jQuery.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1);}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/;jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;} -if(rfocusMorph.test(type+jQuery.event.triggered)){return;} -if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();} -ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;} -data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;} -if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;} -for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;} -if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}} -i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||{})[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data);} -handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}} -event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&jQuery.isFunction(elem[type])&&!jQuery.isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;} -jQuery.event.triggered=type;elem[type]();jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}} -return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});jQuery.event.trigger(e,null,elem);if(e.isDefaultPrevented()){event.preventDefault();}}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});jQuery.fn.extend({hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});support.focusin="onfocusin"in window;if(!support.focusin){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event));};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true);} -dataPriv.access(doc,fix,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this,attaches=dataPriv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix);}else{dataPriv.access(doc,fix,attaches);}}};});} -var location=window.location;var nonce=jQuery.now();var rquery=(/\?/);jQuery.parseJSON=function(data){return JSON.parse(data+"");};jQuery.parseXML=function(data){var xml;if(!data||typeof data!=="string"){return null;} -try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){xml=undefined;} -if(!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data);} -return xml;};var -rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";} -var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnotwhite)||[];if(jQuery.isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};} -function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;} -return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");} -function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}} -if(deep){jQuery.extend(true,target,deep);} -return target;} -function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}} -if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} -if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;} -if(!firstDataType){firstDataType=type;}} -finalDataType=finalDataType||firstDataType;} -if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);} -return responses[finalDataType];}} -function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}} -current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;} -if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);} -prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);} -break;}}}} -if(conv!==true){if(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}} -return{state:"success",data:response};} -jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;} -options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,fireGlobals,i,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(state===2){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()]=match[2];}} -match=responseHeaders[key.toLowerCase()];} -return match==null?null:match;},getAllResponseHeaders:function(){return state===2?responseHeadersString:null;},setRequestHeader:function(name,value){var lname=name.toLowerCase();if(!state){name=requestHeadersNames[lname]=requestHeadersNames[lname]||name;requestHeaders[name]=value;} -return this;},overrideMimeType:function(type){if(!state){s.mimeType=type;} -return this;},statusCode:function(map){var code;if(map){if(state<2){for(code in map){statusCode[code]=[statusCode[code],map[code]];}}else{jqXHR.always(map[jqXHR.status]);}} -return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);} -done(0,finalText);return this;}};deferred.promise(jqXHR).complete=completeDeferred.add;jqXHR.success=jqXHR.done;jqXHR.error=jqXHR.fail;s.url=((url||s.url||location.href)+"").replace(rhash,"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(rnotwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host;}catch(e){s.crossDomain=true;}} -if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);} -inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(state===2){return jqXHR;} -fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");} -s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url;if(!s.hasContent){if(s.data){cacheURL=(s.url+=(rquery.test(cacheURL)?"&":"?")+s.data);delete s.data;} -if(s.cache===false){s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+nonce++):cacheURL+(rquery.test(cacheURL)?"&":"?")+"_="+nonce++;}} -if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);} -if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}} -if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);} -jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+ -(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);} -if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||state===2)){return jqXHR.abort();} -strAbort="abort";for(i in{success:1,error:1,complete:1}){jqXHR[i](s[i]);} -transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);} -if(state===2){return jqXHR;} -if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);} -try{state=1;transport.send(requestHeaders,done);}catch(e){if(state<2){done(-1,e);}else{throw e;}}} -function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(state===2){return;} -state=2;if(timeoutTimer){window.clearTimeout(timeoutTimer);} -transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);} -response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;} -modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}} -if(status===204||s.type==="HEAD"){statusText="nocontent";}else if(status===304){statusText="notmodified";}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error;}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0;}}} -jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);} -jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);} -completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}} -return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){if(jQuery.isFunction(data)){type=type||callback;callback=data;data=undefined;} -return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url));};});jQuery._evalUrl=function(url){return jQuery.ajax({url:url,type:"GET",dataType:"script",async:false,global:false,"throws":true});};jQuery.fn.extend({wrapAll:function(html){var wrap;if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapAll(html.call(this,i));});} -if(this[0]){wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);} -wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;} -return elem;}).append(this);} -return this;},wrapInner:function(html){if(jQuery.isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});} -return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html);});},unwrap:function(){return this.parent().each(function(){if(!jQuery.nodeName(this,"body")){jQuery(this).replaceWith(this.childNodes);}}).end();}});jQuery.expr.filters.hidden=function(elem){return!jQuery.expr.filters.visible(elem);};jQuery.expr.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0||elem.getClientRects().length>0;};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add);}});}else if(!traditional&&jQuery.type(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}} -jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():(value==null?"":value);s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value);};if(traditional===undefined){traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional;} -if(jQuery.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}} -return s.join("&").replace(r20,"+");};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}):{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest();}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials"in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i];}} -if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);} -if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";} -for(i in headers){xhr.setRequestHeader(i,headers[i]);} -callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort();}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error");}else{complete(xhr.status,xhr.statusText);}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders());}}};};xhr.onload=callback();errorCallback=xhr.onerror=callback("error");if(xhr.onabort!==undefined){xhr.onabort=errorCallback;}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback();}});}};} -callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null);}catch(e){if(callback){throw e;}}},abort:function(){if(callback){callback();}}};}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;} -if(s.crossDomain){s.type="GET";}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,callback;return{send:function(_,complete){script=jQuery("